You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for outputting as HTML, both from CLI and from lib.
Reacted by Bruce C, Marlon Regenhardt, Tony, Luca Versari, Hans-Peter Deifel, Deyan Ginev, Abdullah Al Zawad, Francesco Cinà, Ilmari Vacklin, Hans Christian Schmitz and 200 more
Reacted by Jonathan de Jong, Jason, EaStack, Nika Sommer, Janosh Riebesell, ⑆ Neved4 ⑈, Kyle L. Davis, Tesla Zhang, Qyriad, Michele Orrù and 15 more
Adding on: If Typst's HTML output uses MathML for math syntax, that would be lovely (and feed into improved accessibility #133 )
Alternatively, KaTeX-style support so the math could just stay as is in HTML, and be converted dynamically.
Reacted by Matt Piekenbrock
Reacted by Deyan Ginev, Alexander Vödisch, Lily, Tesla Zhang, Mathias Magnusson, Gabriel Simmons, Jesse Farebrother, Bo An, max397574, Kush Patel and 7 more
much easier, and could increase Typst's popularity.
Reacted by Hourann, oxdc, vultix, Alejandro Osornio, Murphy Sünnenwold, Johnny T. Vestergaard, Enguerrand DE SMET, Janosh Riebesell, Ran, Kyle L. Davis and 39 more
Reacted by Jens, Mohammed Belgoumri, _casti, Michael Fortunato and Jacob Schneider
Great looking project! Am working on a combined book and website with math, and managing two environments is a huge waste of effort. Being able to have the same project for both, with shared libraries and glossary, would make it worth redoing from Latex/MathJax! Would want to replace Markdown in Jeckyll with it.
Maybe perhaps additional integration with GoHugo, GetZola, etc. can be added to be used instead of Markdown and AsciiDoc in static site generators. I posted this in initially in: #197
Reacted by qujihan, Cody Neiman, enkvadrat and Jean Gautier
Not sure if you meant to link this issue @sirinath 😅
But I agree, integrations with all those would be great even from a performance standpoint. No clue how that could work but would be willing to help if an effort is made towards it.
The home page (typst.app) mentions HTML Export is coming soon, and they also mentioned it in their paper on Typst earlier this year.
Reacted by Suminda Sirinath Salpitikorala Dharmasena, Deyan Ginev, Tony, aberges-grd, Jason, Nicholas Omer Chiasson, Alicia Miedl, John Gosset, stefnotch, Dominik George and 10 more
Hi @pranabekka wondering if you could point me to their paper earlier this year? I'd be very interested to read but I was not able to find it online...?
Pandoc already has support for Typst markup, so everyone can use it to turn their Typst source files into HTML, EPUB, LaTeX, and a zillion other markups. You can even tell Pandoc how to handle equations in HTML, e.g. MathJax or KaTeX or MathML or whatever.
Please don't get distracted by supporting conversion to other markup languages. Trying to replace LaTeX (and the TeX ecosystem) is ambitous enough, never mind competing with Pandoc as well.
Reacted by Rik Huijzer, Bo An, Domi, Rafael Villar Burke (Pachi) and Tamás Gulácsi
Reacted by Deyan Ginev, Enivex, xmcp, 0x5c, Claudio Mattera, Tony, Alicia Miedl, Nicholas Omer Chiasson, stefnotch, Anamitra Saha and 35 more
Pandoc already has support for Typst markup, so everyone can use it to turn their Typst source files into HTML, EPUB, LaTeX, and a zillion other markups. You can even tell Pandoc how to handle equations in HTML, e.g. MathJax or KaTeX or MathML or whatever.
Please don't get distracted by supporting conversion to other markup languages. Trying to replace LaTeX (and the TeX ecosystem) is ambitous enough, never mind competing with Pandoc as well.
Pandoc has a Typst writer, not a reader.
Reacted by Tesla Zhang, Duc-Viet Hoang, Sunny Huang, Kye W. Shi, Jesús Torres, Connor T. Wiegand, Tobin Cavanaugh, Robert, Bora, ShenMian and 3 more
everyone can use it to turn their Typst source files into HTML, EPUB, LaTeX, and a zillion other markups
Turning Typst *source* files to other formats is of very little use.
You would get HTML-formatted Typst source (containing all the #show, #text and so on), but then you would still need to interpret that Typst source to generate its output.
It is exactly the same thing with LaTeX.
Pandoc copies verbatim the LaTeX source to HTML, without interpreting it.
Or, better, Pandoc does implement a tiny subset of LaTeX, so that it can interpret trivial commands such as \emph{}, \subsection{}, or \cite{}, but everything else is unsupported (\citeauthor{}, \gls{}, \SI{}{}, \begin{tikzpicture}...).
Trying to replace LaTeX (and the TeX ecosystem) is ambitous enough
LaTeX does not support output formats other than PDF and DVI (if we exclude tex4ht, which does not really generate anything useable in my experience).
Since one of its (and Typst's) use cases is writing books, I would consider supporting one of the modern book formats (EPUB, which is just zipped HTML) a very big YES toward Typst.
Reacted by Alicia Miedl, herrgahr, Curious, Demian Ferreiro, Sol Astrius Phœnix, Luca Fabbian, stefnotch, Caleb Maclennan, francoisj, Adhalianna and 16 more
So, in summary: If you want HTML, PDF, ePub, and Kindle books, then you can already write in Markdown and use Bookdown or Pandoc to generate all those different output formats.
I already explained my point above, but this just not the same thing.
Not even close.
Typst (and Latex) cover two separate aspects:
Actually generating PDF output from textual input.
Perform (arbitrarily complex) transformation on text.
The former can easily be achieved, as you suggest, using Pandoc or Bookdown (which actually call Latex behind the scene).
The latter cannot.
Neither Pandoc or Bookdown can understand \citeauthor, \gls, \SI, \mypersonalcommand (nor the Typst equivalent).
And this is extremely frustrating if you are writing a book in Latex, because it means you can only target PDF (or DIV), while in 2023 EPUB should be a first class citizen.
Especially because most books are mostly text plus some maths, which is perfectly supported by HTML (and EPUB).
Latex have the excuse of being ancient.
If Typst does not embrace modern formats, it would be very disappointing.
Reacted by Enivex, Anamitra Saha, phiresky, Tony, 0x5c, Alicia Miedl, qujihan, maxwell-thum, Lily, Adhalianna and 39 more
@rikhuijzer Your statement "you can already ..." is simply not true yet because it misses the point. I have setup Markdown based workflows for several publishing houses and written typsetter software and Pandoc writers. I'm familiar with the moving parts here.
Others have explained in some, but your statement would not be true until such a time as Pandoc has a reader as well as writer and can has extensions to allow raw typst code embedded in Markdown or other ways of handling the transitions. Additionally it needs a read/write conversion for the math dialect.
Even with all that it still doesn't cover all the bases that HTML output from the compiler side (rather than just an input format reader) would handle, as others have explained.
Reacted by 0x5c, Alicia Miedl, Lily, Jak Kos and Robert
Activity
dginev commentedon Mar 22, 2023
Adding on: If Typst's HTML output uses MathML for math syntax, that would be lovely (and feed into improved accessibility #133 )
AntoniosBarotsis commentedon Mar 22, 2023
Interestingly enough, there already seems to be some HTML involved in the testing.
But yes, having the ability to generate proper, styled HTML would be great!
jason-s commentedon Mar 22, 2023
Alternatively, KaTeX-style support so the math could just stay as is in HTML, and be converted dynamically.
claudiomattera commentedon Mar 22, 2023
This is also necessary for supporting EPUB.
Generating an EPUB from LaTeX is pretty much impossible.
Hopefully a modern replacement for LaTeX will treat EPUBs as first-class citizen :D
Actually, I would go one step further, and say that it should support plain text output (which is also almost impossible in LaTeX).
Leedehai commentedon Mar 22, 2023
+1 for outputting HTML. This will make integration into popular note taking apps like
much easier, and could increase Typst's popularity.
bcourter commentedon Mar 23, 2023
Great looking project! Am working on a combined book and website with math, and managing two environments is a huge waste of effort. Being able to have the same project for both, with shared libraries and glossary, would make it worth redoing from Latex/MathJax! Would want to replace Markdown in Jeckyll with it.
sirinath commentedon Mar 23, 2023
Maybe perhaps additional integration with GoHugo, GetZola, etc. can be added to be used instead of Markdown and AsciiDoc in static site generators. I posted this in initially in: #197
AntoniosBarotsis commentedon Mar 23, 2023
Not sure if you meant to link this issue @sirinath 😅
But I agree, integrations with all those would be great even from a performance standpoint. No clue how that could work but would be willing to help if an effort is made towards it.
sirinath commentedon Mar 23, 2023
@AntoniosBarotsis Because #197 is a partial duplicate of #114 I added other parts not in this discussion.
Sorry I initially pasted the wrong link.
pranabekka commentedon Mar 24, 2023
The home page (typst.app) mentions HTML Export is coming soon, and they also mentioned it in their paper on Typst earlier this year.
Leedehai commentedon Mar 24, 2023
Hi @pranabekka wondering if you could point me to their paper earlier this year? I'd be very interested to read but I was not able to find it online...?
pranabekka commentedon Mar 25, 2023
Hi @Leedehai , you can find the pdf at https://www.user.tu-berlin.de/laurmaedje/programmable-markup-language-for-typesetting.pdf
I think it's a little outdated, and you can find the same information in the online docs.
phiresky commentedon Mar 30, 2023
I created a draft PR which (indirectly) adds HTML output: #461
ttmc commentedon Apr 6, 2023
Pandoc already has support for Typst markup, so everyone can use it to turn their Typst source files into HTML, EPUB, LaTeX, and a zillion other markups. You can even tell Pandoc how to handle equations in HTML, e.g. MathJax or KaTeX or MathML or whatever.
https://pandoc.org/
Please don't get distracted by supporting conversion to other markup languages. Trying to replace LaTeX (and the TeX ecosystem) is ambitous enough, never mind competing with Pandoc as well.
Enivex commentedon Apr 6, 2023
Pandoc has a Typst writer, not a reader.
claudiomattera commentedon Apr 6, 2023
Turning Typst *source* files to other formats is of very little use.
You would get HTML-formatted Typst source (containing all the
#show,#textand so on), but then you would still need to interpret that Typst source to generate its output.It is exactly the same thing with LaTeX.
Pandoc copies verbatim the LaTeX source to HTML, without interpreting it.
Or, better, Pandoc does implement a tiny subset of LaTeX, so that it can interpret trivial commands such as
\emph{},\subsection{}, or\cite{}, but everything else is unsupported (\citeauthor{},\gls{},\SI{}{},\begin{tikzpicture}...).LaTeX does not support output formats other than PDF and DVI (if we exclude tex4ht, which does not really generate anything useable in my experience).
Since one of its (and Typst's) use cases is writing books, I would consider supporting one of the modern book formats (EPUB, which is just zipped HTML) a very big YES toward Typst.
rikhuijzer commentedon May 4, 2023
rikhuijzer commentedon May 4, 2023
laurmaedje commentedon May 4, 2023
Relevant discussion: #721.
claudiomattera commentedon May 4, 2023
I already explained my point above, but this just not the same thing.
Not even close.
Typst (and Latex) cover two separate aspects:
The former can easily be achieved, as you suggest, using Pandoc or Bookdown (which actually call Latex behind the scene).
The latter cannot.
Neither Pandoc or Bookdown can understand
\citeauthor,\gls,\SI,\mypersonalcommand(nor the Typst equivalent).And this is extremely frustrating if you are writing a book in Latex, because it means you can only target PDF (or DIV), while in 2023 EPUB should be a first class citizen.
Especially because most books are mostly text plus some maths, which is perfectly supported by HTML (and EPUB).
Latex have the excuse of being ancient.
If Typst does not embrace modern formats, it would be very disappointing.
alerque commentedon May 4, 2023
@rikhuijzer Your statement "you can already ..." is simply not true yet because it misses the point. I have setup Markdown based workflows for several publishing houses and written typsetter software and Pandoc writers. I'm familiar with the moving parts here.
Others have explained in some, but your statement would not be true until such a time as Pandoc has a reader as well as writer and can has extensions to allow raw typst code embedded in Markdown or other ways of handling the transitions. Additionally it needs a read/write conversion for the math dialect.
Even with all that it still doesn't cover all the bases that HTML output from the compiler side (rather than just an input format reader) would handle, as others have explained.
laurmaedje commentedon Sep 18, 2023
Closing this in favor #721