{"id":16718669,"url":"https://github.com/planeshifter/node-make-latex","last_synced_at":"2026-03-11T05:30:58.107Z","repository":{"id":27861661,"uuid":"31352388","full_name":"Planeshifter/node-make-latex","owner":"Planeshifter","description":"convert JS objects to LaTeX tables from inside node.js ","archived":false,"fork":false,"pushed_at":"2015-03-20T04:30:00.000Z","size":224,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-02T11:07:03.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Planeshifter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-26T05:39:39.000Z","updated_at":"2015-03-20T04:30:00.000Z","dependencies_parsed_at":"2022-09-01T15:21:08.361Z","dependency_job_id":null,"html_url":"https://github.com/Planeshifter/node-make-latex","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Planeshifter/node-make-latex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fnode-make-latex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fnode-make-latex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fnode-make-latex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fnode-make-latex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Planeshifter","download_url":"https://codeload.github.com/Planeshifter/node-make-latex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fnode-make-latex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261479920,"owners_count":23164798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T21:38:03.681Z","updated_at":"2026-03-11T05:30:58.062Z","avatar_url":"https://github.com/Planeshifter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Dependencies][dependencies-image]][dependencies-url]\n\n# make-latex\n\n\u003e create LaTeX tables from inside node.js\n\n## Install\n\nEasily via npm:\n\n```sh\n$ npm install --save make-latex\n```\n\n## Usage\n\n```js\nvar makeLatex = require('make-latex');\n\nvar mat = [\n  [1, 2, 3],\n  [4, 5, 6],\n  [7, 8, 9]\n];\n\nmakeLatex(mat);\n/*\nreturns:\n\\begin{table}\n\\centering\n\\begin{tabular}{ccc}\n1 \u0026 2 \u0026 3 \\\\\n4 \u0026 5 \u0026 6 \\\\\n7 \u0026 8 \u0026 9 \\\\\n\\end{tabular}\n\\end{table}\n*/\n```\n\n## API\n\n### makeLatex(obj [, options])\n\nMain function which takes a JavaScript object `obj` and converts it to LaTeX.\nThe function returns a string which can be directly embedded in LaTeX.\nCurrently, the following types of objects are supported:\n\n1. An array of arrays, or more specifically a square matrix (inner arrays must all\n  have equal length).\n2. An array of objects.\n3. An object\n\nThe function accepts an optional options object which governs the created LaTeX output.\nThe options object can have the following keys:\n\n| Key        |   Description           | Default Value |\n| ------------- |:-------------:| -----:|\n| caption       | Caption of the created table | none |\n| label         | Label of the created table | none |\n| captionPlacement         | Position of Caption, either \"bottom\" or \"top\" | \"bottom\" |\n| colnames      | If supplied, first row in table prints names of columns | Object.keys() for Array of Objects, [\"Key\", \"Value\"] for Object |\n| spec          | See Spec section      | centered, no vertical lines\n| pos           | See Positions section | none |\n| digits        | Number of decimial places for numeric values | none |\n\n#### Spec\n\nIn LaTeX, the spec argument determines the alignment which is used\nin each column and where to insert vertical lines.\n\n| Key        |   Description  |\n| ------------- |:-------------:|\n|  l  | left-justified column |\n|  c  | centered column |\n|  r  | right-justified column |\n|  \\| \t| vertical line |\n|  \\|\\| |\tdouble vertical line |\n\n#### Positions\n\n| Key        |   Description  |\n| ------------- |:-------------:|\n|  h  | allowed to be placed inline |\n|  t  | go into top area |\n|  b  | go into a bottom area |\n|  p  | go on a float page or column area |\n\nAppending `!` to either of those positions will force LaTeX to ignore restrictions related to number of floats\nthat can be placed in an array or the size an array can occupy.\n\n## License\n\nMIT © [Philipp Burckhardt](http://www.philipp-burckhardt.com)\n\n[npm-url]: https://npmjs.org/package/make-latex\n[npm-image]: https://badge.fury.io/js/make-latex.svg\n\n[travis-url]: https://travis-ci.org/Planeshifter/node-make-latex\n[travis-image]: https://travis-ci.org/Planeshifter/node-make-latex.svg?branch=master\n\n[coveralls-image]: https://img.shields.io/coveralls/Planeshifter/node-make-latex/master.svg\n[coveralls-url]: https://coveralls.io/r/Planeshifter/node-make-latex?branch=master\n\n[dependencies-image]: https://david-dm.org/Planeshifter/node-make-latex.svg\n[dependencies-url]: https://david-dm.org/Planeshifter/node-make-latex\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaneshifter%2Fnode-make-latex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaneshifter%2Fnode-make-latex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaneshifter%2Fnode-make-latex/lists"}