LaTeX forum ⇒ Viewers for PDF, PS, and DVINew opensource software for rendering dvi files generated by LuaTeX

Information and discussion about output viewers related to LaTeX (e.g. Adobe Reader, Ghostview, YAP, ...)
matjplc
Posts: 4
Joined: Sun Oct 30, 2022 10:24 pm

New opensource software for rendering dvi files generated by LuaTeX

Postby matjplc » Sun Oct 30, 2022 10:40 pm

Hi all, I've recently released dvi-decode, a Javascript module for decoding LuaTeX dvi files.

This may be useful to developers out there that need a solution to render LaTeX to the browser.

I have a demo React app running here: DVI Viewer

Happy to answer any questions.

Matt.

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook
User avatar
Stefan Kottwitz
Site Admin
Posts: 9906
Joined: Mon Mar 10, 2008 9:44 pm

New opensource software for rendering dvi files generated by LuaTeX

Postby Stefan Kottwitz » Sun Oct 30, 2022 11:57 pm

Hi Matt,

welcome to the forum!

Thank you for sharing this information. That's a very interesting project. Especially as it's based on DVI instead of the usual PDF. I tested it with sample LuaLaTeX files but failed for now, probably because of a missing Renderer=Opentype option, but my test files were just plots without text. I used LuaLaTeX for plotting (memory issues), so font loading with Renderer=Opentype is new to me. No worries, that was just my first try, I will see how it works.

By the way, on many sites (this forum and others, TikZ.net and other galleries), we use the compiler at TeXlive.net that has a similar purpose, rendering LaTeX files in a web browser, just including compiling. It may be an interesting combination.

Stefan
LaTeX.org admin

matjplc
Posts: 4
Joined: Sun Oct 30, 2022 10:24 pm

New opensource software for rendering dvi files generated by LuaTeX

Postby matjplc » Mon Oct 31, 2022 3:56 am

Thanks Stefan,

dvi-decode is still somewhat experimental and does not yet support images. I will add note about this on the demo. I know that the image filenames are written to the dvi file as 'special' commands by LuaTeX, so I will look into extracting that data.

[Renderer=Opentype] is required the ensure the expected character encodings are written to the dvi file. I had noticed variations in encodings produced with different LuaTeX Renderer modes, so to simplify coding I constrained the supported options to the OpenType mode only.

I see the dvi format as a better fit for a web-based rendering pipeline since resources such as fonts and images can easily be served separately. i.e. we don't necessarily require a "portable" document format.

Matt.

matjplc
Posts: 4
Joined: Sun Oct 30, 2022 10:24 pm

New opensource software for rendering dvi files generated by LuaTeX

Postby matjplc » Mon Nov 14, 2022 11:26 pm

dvi-decode has been updated to extract image references from the postscript 'specials' if they exist in the dvi file.

Referenced EPS files should be converted to SVG for use in browser.

See a new demo including images here https://matjp.github.io/dvi-viewer/

Matt

matjplc
Posts: 4
Joined: Sun Oct 30, 2022 10:24 pm

New opensource software for rendering dvi files generated by LuaTeX

Postby matjplc » Thu Nov 17, 2022 2:58 am

A further update for anyone interested.

dvi-decode v0.3.0 has been released which removes the dependency on the OpenType renderer. So, you no longer need to re-declare fonts. The default font options should work.

However, there is now a requirement that you build your dvi file on a system with the package 'luaotfload' version >= 3.15

https://github.com/matjp/dvi-decode

Matt


Return to “Viewers for PDF, PS, and DVI”

Who is online

Users browsing this forum: No registered users and 3 guests