LaTeX.js

JavaScript LaTeX to HTML5 translator

MIT License

Downloads
4.2K
Stars
770
Committers
5

Bot releases are hidden (Show)

LaTeX.js - v0.12.6: bugfixes Latest Release

Published by michael-brade over 1 year ago

The main fixes are the missing directories when using webpack and a crash when using LaTeX.js in/with React.

  • fixed #120, #121, #132, #139
  • updated puppeteer, added firefox screenshotting
  • updated some dependencies
LaTeX.js - v0.12.4: infrastructure, for real

Published by michael-brade over 4 years ago

I had to fix it again. Verdict: ES6 modules and automatic detection of node/browser environment doesn't work.

So now LaTeX.js (HtmlGenerator to be exact) simply assumes a DOM implementation, HtmlGenerator doesn't load svgdom itself anymore. Without support for top-level await in browsers, terser, and node, this just cannot be done properly in ES6.

Other changes:

  • include LaTeXJSComponent in the main exports, don't create an extra bundle anymore
  • include SyntaxError in the main exports
  • to make sure that HtmlGenerator doesn't require a DOM implementation already on import anymore, it cannot create a cache of html elements directly; now create() takes a string or a factory function for element creation
LaTeX.js - v0.12.2: infrastructure

Published by michael-brade over 4 years ago

This release fully supports ES6 modules. LaTeX.js itself has not changed, but the build system and the docs have improved a lot.

exports:

  • no default export anymore, export: he, parse, Generator, HtmlGenerator

build:

  • simplified rollup config and build
  • added visualizer
  • generate correct source maps
  • get rid of all eval calls
  • use dynamic imports for external packages and documentclasses

unit tests:

  • update to puppeteer 3.3, now we can start to support Firefox screenshots
  • added a script to create a native LaTeX rendering for the test cases
  • updated mocha
  • support and fix code coverage

docs:

  • moved to VuePress
  • use a git worktree in the website folder to generate the docs and playground in the gh-pages branch
LaTeX.js - v0.12.1: bugfixing

Published by michael-brade about 5 years ago

  • build improvements
  • unit testing fixes (write screenshots and diffs synchronously)
  • allow starred environments (#64)
  • fixed bezier curves and implemented the optional argument of bezier curves
  • fixed \line, \vector, \oval to not shift in some corner cases
  • better and more beautiful arrowhead like in pict2e
  • made \put work with negative y-values
LaTeX.js - v0.12.0: this brings packages

Published by michael-brade over 5 years ago

parser:

  • fixed url chars according to RFC3986
  • implemented key-value lists
  • implemented csv groups
  • use _ instead of skip_space to make to code more readable

core:

  • documentclasses: implemented inheritance of options
  • implemented standard documentclass options, allow any font size option (e.g. 26pt)
  • implemented \usepackage, added first packages
  • refactor: added Generator class with TeX logic so that HtmlGenerator only needs to worry about the DOM
  • refactor: macros.ls -> latex.ltx.ls
  • import symbols from packages and custom macros
  • introduced Length and Vector classes
  • fixed \oval{} and \circle*
  • update to KaTeX 0.10.0, SVG.js 3.0

HtmlGenerator:

  • added precision option, default is 3 digits

new packages:

  • hyperref
  • echo
  • multicol
  • latexsym
  • textgreek
  • stix
  • gensymb
  • textcomp

CSS:

  • fixed layout bug: do not make html and body a grid! Otherwise we'll have nested grids.
  • set font properties at the root (<html>)
  • set CSS variables on the root element (also for webcomponent), this is important for the root font size
  • webcomponent: @font-face doesn't work inside a shadow DOM, so add cmu.css to parent document

tests

  • fixed fixure loading (#21)
  • refactored screenshot code
  • don't instrument screenshot tests for code coverage
  • refactor loading fixtures from subdirectories to allow grouping them by package, for instance

build

  • swiched to rollup, get rid of babel, uglify-js
  • parallelize build
  • output ES modules and UMD packages

playground:

  • use split-grid and CSS grid for layout
LaTeX.js - v0.11.0: improved API, added web component

Published by michael-brade about 6 years ago

API:

  • new HtmlGenerator API: it is now possible to get parts of the resulting HTML document
  • added an implementation of a LaTeX.js webcomponent (using tags)
  • CSS: use grid instead of flex, now the page looks correct even without margin content

CLI:

  • added -u (base URL) option
  • fixed reading of custom macros (-m)

build system:

  • integrate with CircleCI, Greenkeeper
  • update unit tests
  • create source maps
  • show code coverage
LaTeX.js - v0.10.1: expose API more consistently, include build for the browser

Published by michael-brade about 6 years ago

  • html-generator.ls now checks if window is defined, not test.ls anymore
  • added index.js as the new main entry point
  • made bin/latex.js executable
LaTeX.js - v0.10.0: better layout, added \marginpar

Published by michael-brade over 6 years ago

general:

  • implemented \marginpar
  • finished \parbox alignment combinations, all should work now
  • fixed a few more whitespace issues, esp. in restricted horizontal mode; still some more left to go...

layout:

  • layout can now be changed using \setlength
  • implement default layout values for 10pt, onecolumn, oneside options
  • margins and \textwidth: calculate their percentages relative to \paperwidth
  • layout is still responsive; to make it static, use an absolute --paperwidth in the CSS

picture environment:

  • implemented \qbezier and \cbezier
  • implemented \oval
  • implemented \multiput
  • \line, \vector, \[qc]bezier: add room for linewidth using bbox()
  • fixed \vector arrow head: it now ends exactly at the line end and properly scales with the linewidth
  • fixed \put outside of a picture environment
  • fixed picture offset

other fixes:

  • HTML: set the charset to UTF-8
  • API: optional arguments always have "?" appended => "o" is now "o?"
  • little parser fixes
  • more tests, extended the playground
LaTeX.js -

Published by michael-brade over 6 years ago

This release is another mostly bugfix release:

  • CLI: add -a option to copy assets (CSS, fonts) to the destination
  • better parser error messages when parsing the preamble
  • distinguish between inline- and block-environments (block envs force vertical mode, i.e. start a new paragraph)
  • implemented continuing after a block-environment properly (LaTeX's \@endparenv)
  • use (modified) svgdom instead of domino: CLI and tests can now render SVG!

misc:

  • updated KaTeX
  • added picture tests and screenshots
LaTeX.js - Bugfixes, assets

Published by michael-brade over 6 years ago

This release now also includes the CSS files and the CM fonts.

Bugfixes:

  • fix centering of lists, be more like LaTeX and use \llap for the label
  • fix alignment of lists
  • fix wrong font in \verb
  • fix list and verse margins, use em instead of rem
LaTeX.js - Closer

Published by michael-brade over 6 years ago

restructure:

  • implemented \documentclass and parsing the preamble
  • use JS classes for documentclasses: extract article.ls, book.ls, report.ls
  • implemented environments like in LaTeX: any macro can be used in \begin/\end, and therefore, environments can now mostly be implemented without touching the parser

boxes:

  • implemented boxes: \mbox, \makebox, \parbox, \fbox, \framebox, \[rl]lap, \smash, \[vh]phantom
  • implemented lengths (changing CSS variables still TODO)

picture environment:

  • implemented \line, \Line, \vector, \Vector, \circle, and \put

titling:

  • \frontmatter, \mainmatter, \backmatter, \appendix
  • \maketitle, \title, \author, \date
  • titlepage and abstract environments

new CLI features:

  • switch output: full HTML5 or "barely" the <body> contents
  • change default documentclass
  • add custom macros
  • add custom styles

unit tests:

  • support screenshot tests (useful for CSS unit testing)

fonts:

  • set default font size to 10pt
  • \emph and \em are now context-aware
  • regenerated the CM fonts (fixes missing glyphs), fixed missing slanted typewriter
  • more beautiful \underline
LaTeX.js - Big Macro Improvements

Published by michael-brade almost 7 years ago

much better macro implementation:

  • the arguments of macros and the macro type can now be specified in JavaScript, making the parser more or less independent of new macros (see macros.ls for documentation)
  • macros return an array of nodes or strings
  • thus, the limitation of always treating groups as macro parameters is gone
  • prevent macros from calling JavaScript Object methods

more features:

  • use CSS variables for lengths
  • implemented diacritics (text-mode accents)
  • implemented counters, calc expressions, printing counters
  • sections use now use LaTeX counters and not CSS counters anymore
  • implemented \label and \ref
  • implemented \verb

reimplemented lists:

  • enumerate items can now be \label'd and \ref'd
  • labels for all lists are now defined by counters and macros like in LaTeX
  • max. list depths are adhered to

other new macros:

  • \the, \value
  • \message, \showthe
  • \endinput

misc:

  • refactor code (symbols and macros in their own files)
  • bugfixes (url charset, float, quotes, empty lines after \item, ] in environments, dependencies)
LaTeX.js -

Published by michael-brade almost 7 years ago

  • added quote, quotation, verse environments
  • added font environments
  • implemented \item[label]
  • added many more symbols, more than 200 are now supported
  • added \noindent
LaTeX.js - First cli release!

Published by michael-brade almost 7 years ago

This release adds

  • the latex.js cli
  • multicols support
  • enumerate and description lists
  • \url and \href
  • automatic hyphenation with Hypher

and fixes

  • a few last whitespace bugs
  • the math font, it now uses the CMU font instead of the KaTeX fonts
  • quite a few more little bugs