https://github.com/juliandavidmr/htmltabletolatex
Converting html tables to latex tables
https://github.com/juliandavidmr/htmltabletolatex
cheerio generator-latex latex tables typescript
Last synced: 2 months ago
JSON representation
Converting html tables to latex tables
- Host: GitHub
- URL: https://github.com/juliandavidmr/htmltabletolatex
- Owner: juliandavidmr
- License: mit
- Created: 2017-06-17T16:09:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-18T15:54:13.000Z (over 8 years ago)
- Last Synced: 2025-07-18T02:16:42.849Z (3 months ago)
- Topics: cheerio, generator-latex, latex, tables, typescript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/htmltabletolatex
- Size: 16.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HtmlTableToLatex
Converter html tables tables in latex
## Installation
```bash
$ npm install htmltabletolatex --save
```## Usage
```js
// httl = HtmlTableToLatex
var httl = require('htmltabletolatex').HTTL;httl.latex("mytables.html").then(latex => {
// console.log("Latex tables:", latex);
httl.save('latex.tex', latex.join('\n'), (err, success) => {});
});
```## Example
#### Html input
```htmlTable: usuario
Name
Data Type
Nullable
PK
FK
Default
Comment
user_idUsuario
VARCHAR(45)
Yes
Yes
No
user_Correo
VARCHAR(45)
Yes
No
No
```
#### Latex output
```tex
\begin{center}
\caption{tableTableUsuario}
\label{labelTableUsuario}
\begin{tabular}{ |l|l|l|l|l|l|l| }
\hline
Name & DataType & Nullable & PK & FK & Default & Comment \\
UserIdUsuario & VARCHAR(45) & Yes & Yes & No & & \\ \hline
UserCorreo & VARCHAR(45) & Yes & No & No & & \\ \hline
\end{tabular}
\end{center}
```## API
### constructor(args) -> `HtmlTableToLatex`
| Param | Type | Description | Default |
| ----- | ---- | ----------- | ------- |
| minLengthColumnsByRow | number | Take into account only columns by minimum size in text | 3 |
| separator | string | Table columns size. i.e: `l, c, r` | l |
| lines | boolean | Show lines | `true` |#### Example
```js
var HtmlTableToLatex = require('htmltabletolatex').HtmlTableToLatex;var httl = new HtmlTableToLatex(2, 'l', false);
```**You can also change the parameters without the need of a constructor:**
```js
var httl = require('htmltabletolatex').HTTL;httl.lines = false;
httl.minLengthColumnsByRow = 2;
httl.separator = 'l';
```## Colaborate
```bash
# Fork it this repo
# Install typescript cli
$ git clone https://github.com//HtmlTableToLatex.git
$ cd HtmlTableToLatex
# Edit & transpile file index.ts
# Commit + push + Pull request
```### License MIT
This software is released under the [MIT License](./LICENSE).