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 🙏

© 2025 – Pkg Stats / Ryan Hefner

gdoc2latex

v5.0.1

Published

Converts Google Docs files to Latex

Readme

gdoc2latex

Converts Google Docs files to LaTeX. Try it in your browser with the gdoc2latex GUI.

Install

  1. Install Node.js
  2. Install gdoc2latex with npm i -g gdoc2latex

Use

  1. Download your Google Doc with File > Download > Web page (.html)
  2. Unzip the document, and run gdoc2latex -i YourDocumentName.html
  3. Compile the generated LaTeX and BibTeX sources
  4. ???
  5. Profit!

Supported features

Supported:

  • Title: Sets the title (maximum 1)
  • Subtitle: Sets the subtitle (maximum 1)
  • Heading 1: Creates a \section
  • Heading 2: Creates a \subsection
  • Heading 3: Creates a \subsubsection
  • Heading 4: Creates a \subsubsubsection
  • Bold: Wraps in \textbf
  • Underline: Wraps in \underline
  • Italics: Wraps in \textif
  • Superscript: Wraps in \textsuperscript
  • Subscript: Wraps in \textsubscript
  • Center algined text: Wraps in \centering
  • Right algined text: Wraps in \raggedleft
  • Tables: Creates centered table with borders
  • Unordered lists: Creates itemize
  • Ordered lists: Creates enumerate
  • References (use BibTeX in footnotes): Creates index.bib and \cites it
  • Footnotes: Inserts \footnote
  • Comments: Added at bottom of Latex document, indexed alphabetically
  • Line breaks: Inserts \\
  • Page breaks: Inserts \pagebreak
  • Web and email links: Inserts \href
  • Internal links to sections: Inserts \hyperref
  • Images: Inserts figure
  • Image captions (use alt text): Inserts \caption
  • Charts (linked and unlinked): Inserts figure
  • Chart captions (use alt text): Inserts \caption
  • Drawings (linked and unlinked): Inserts figure
  • Drawing captions (use alt text): Inserts \caption
  • Custom image, chart and drawing widths
  • Code `inline` and in blocks (```)

Not supported:

  • Custom fonts
  • Headers and footers
  • Custom table widths
  • Custom table, image, chart and drawing alignment
  • Custom font sizing

(these aren't definitely out of scope, but they haven't been implemented yet)

Detailed usage

See help with gdoc2latex --help:

$ gdoc2latex --help
Usage: gdoc2latex [options]

Converts Google Docs files to LaTeX

Options:
  -i, --input <file>           Input HTML file, downloaded from Google Docs (default: "index.html")
  -o, --output <file>          Output TeX file (default: "index.tex")
  -f, --force                  Overwrite output TeX file if it already exists and create output directory if necessary (default: false)
  -s, --template-start <file>  Custom starting template TeX source
  -e, --template-end <file>    Custom ending template TeX source
  -h, --help                   display help for command

For example:

gdoc2latex --input doc.html --output doc.tex --force --template-start mystart.tex --template-end myend.tex

The input HTML file should be downloaded from Google Docs with File > Download > Web page (.html)

The template start should set up and open a LaTeX document and the end should close a LaTeX document. See the default_templates folder for examples.

Output

gdoc2latex will output two files: a .tex and .bib

With pdflatex and bibtex, index.tex and index.bib can be compiled with:

pdflatex -shell-escape index
bibtex index
pdflatex -shell-escape index
pdflatex -shell-escape index

This will result in a complete index.pdf

Contributing

  1. Install Node.js
  2. Clone this repository
  3. Run npm install

From here you can edit the code. You can run the tests with npm test, or check it builds with npm run build. To install it locally for further testing on your own files, run npm run build then npm install -g.

Releases

Versions follow the semantic versioning spec. Use npm version <major | minor | patch> to bump the version, then push. Ensure you have set follow tags option to true with git config --global push.followTags true. GitHub actions will then pick it up and handle the actual publishing to the NPM registry.