html-to-latex-listing
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

html-to-latex-listing

Convert code highlighted as html to LaTex listings. This library only works on a small subset of html, but it is sufficient to handle the output of "Copy With Highlighting" and "Paste as Html" from VSCode. Note that background color is not preserved.

I got frustrated with the current state of the art of syntax highlighting in LaTex. Both minted and listing does not provide satisfactory highlighting to my taste. This package ensures that the highlighting is consistent with VSCode at the price of some manual effort.

npm install html-to-latex-listing
npx html-to-latex-listing 'snippet/*.html'
\documentclass{article}
\usepackage{xcolor}
\usepackage{fancyvrb}
\begin{document}
\VerbatimInput[commandchars=\\\{\}]{snippet/foo.tex}
\end{document}

Readme

Keywords

none

Package Sidebar

Install

npm i html-to-latex-listing

Weekly Downloads

10

Version

0.3.2

License

none

Unpacked Size

13.3 kB

Total Files

12

Last publish

Collaborators

  • lachrist