npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

latex-data-table

v1.0.2

Published

Make latex tables

Readme

Generate LaTex (data) tables from Node

This package generates LaTex-Tables in different styles from within a node application.

Features

  • Different table styles:
    • booktabs: Pretty booktabs table
    • default: Standard Latex table using double lines
    • ascii: Text table with the clui package. Useful to get a preview of your table before compiling it to LaTeX. Ascii table columns can be configured to do simple test-wrapping.
  • Number formatting:
    • You can specify units and decimal scalings for each table column. Column values are then scaled automatically and units and scaling factors are shown in the table header.
    • Format numbers in the table body by precision or number of decimal places
    • Scientific notations are automatically converted to math (5e+5 -> $ 5\cdot 10^{5}$)
  • Commenting
    • A latex-comment can be added to each table row. Body comments are added after the line, a header comment is added above the header line.

Installation

Install directly from this repository:

npm install i4h/latex-data-table

Examples

A Simple Table

Quickly generate a table by specifying an array with the header contents and a matrix with the body contents:

var LatexTable = require('latex-data-table');

var header = ["Column1", "Column2"];
var body = [[1,"a"],[2,"b"]];
/* Generate latex code */
var latex = LatexTable(body, header);

The generated table will look like this:

Check examples/simple_latex.* to find the full example and the generated latex.

A Data Table

The example in examples/showcase_latex demonstrates how to actually show and format some data. Options for individual columns are defined in the header:

var LatexTable = require('latex-data-table');

var options = {
	style = 'booktabs'
	caption = '...',
	label = '...',
};

var header = {
    comment: "header comment" ,
    cells:
        [
            {
                content: 'Name',
                spec: "l"},
            {
                content: 'Power',
                spec: "r",
                decimalScaling: "1",
                units: "Gazillions",
                formatter: {decimals: 0}
            },
            {
                content: 'Loading time',
                spec: "r",
                decimalScaling: "-1",
                units: "Seconds",
                formatter: {precision: 2}
            },
        ]
};

var body = [
    {
        comment: "first line comment",
        cells: ['vim', '15', 0.2]
    },
    {
        comment: "second line comment",
        cells: ['emacs', '10000', 1234]
    },
];

/* Generate latex code */
var result = LatexTable(body, header);

The generated table in default and booktab styling will look like this:

To output your table to the console for a preview, use the ascii style. Column width can be controlled manually by setting the colWidth property on the corresponding column.

  Name      Power [10 Gazillions]              Loading time [10^{-1} Seconds]     
  --------------------------------------------------------------------------------
  vim       2                                  2.0                                 #first line comment
  emacs     1000                               1.2e+4                              #second line comment