ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Denis Maier via ntg-context <ntg-context@ntg.nl>
To: <ntg-context@ntg.nl>
Cc: denis.maier@unibe.ch, hugo.fisher@gmail.com
Subject: Re: LuaMetaTEX as LaTeX to XHTML/ePub transpiler?
Date: Fri, 10 Sep 2021 15:34:41 +0000	[thread overview]
Message-ID: <401e18d8b7bf46f49f40afefe308e064@unibe.ch> (raw)
In-Reply-To: <CAAahdHPkX-K94aqBO_ETJYYHQNzhqM7LnNVXp_v2HMUPCUb9_g@mail.gmail.com>

You may want to have a look at the lwarp package as an alternative to tex4ht.

Denis

> -----Ursprüngliche Nachricht-----
> Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von Hugh Fisher via
> ntg-context
> Gesendet: Freitag, 10. September 2021 13:14
> An: ntg-context@ntg.nl
> Cc: Hugh Fisher <hugo.fisher@gmail.com>
> Betreff: [NTG-context] LuaMetaTEX as LaTeX to XHTML/ePub transpiler?
> 
> I have documents in LaTeX, and would like to generate XHTML (ePub) output
> without going through an intermediate DVI or PDF step.
> Markup to markup, translating or transpiling rather than typesetting.
> 
> My use case is that I have two tabletop gaming books, 60 - 80 pages of text and
> diagrams, written for pdfLaTeX and now with XeLaTeX. I'm very happy with
> LaTeX and the wonderful PDF output for print.
> 
> But now I also want to create ePub/XHTML as well as print versions.
> So far I've tried tex4ebook and tex4ht and neither works for me.
> Firstly, some of the LaTeX commands are not recognised or causing errors.
> 
> And secondly, when I managed to get a small test section to work, the
> generated XHTML/HTML is very large, full of tiny <span>s. The problem seems
> to be that tex4ht runs TeX which typesets everything into DVI with every
> element carefully placed on a page, and then tex4ht tries to reverse that back
> into HTML. All this extra HTML will slow down / interfere with the ebook
> reader which is doing the final page layout at runtime on a particular device.
> 
> How I would like it to work is directly from LaTeX to HTML without any low
> level typesetting. If I have a LaTex source paragraph
> 
>     This is some text with \textbf{some parts} in bold.
> 
> The <whatever>TEX will copy the source text to the destination. If there's a TeX
> command, here \textbf, it looks for a Lua function with that name and invokes
> it with whatever argument text is present.
> The Lua function emits <b>, then recursively processes the argument text, then
> emits </b>. Similarly there would be an implied lookup of \beginParagraph and
> \endParagraph which would emit <p> and </p>.
> Plain text just gets copied through unchanged.
> 
> 
> So (finally) my question: is LuaMetaTEX what I'm looking for?
> 
> Yes is the answer I'm hoping for. And any guidance would be much
> appreciated.
> 
> No, but best starting point? I've never tried modifying TeX code itself, but I am
> an experienced and sometimes competent programmer.
> who has written a compiler parser and a high level code generator.
> 
> No and not a good idea to try?
> 
> Any other responses?
> 
> 
> --
> 
>         cheers,
>         Hugh Fisher
> ________________________________________________________________
> ___________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ________________________________________________________________
> ___________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2021-09-10 15:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 11:13 Hugh Fisher via ntg-context
2021-09-10 11:26 ` Henning Hraban Ramm via ntg-context
2021-09-11 11:14   ` Hugh Fisher via ntg-context
2021-09-10 11:47 ` Hans Hagen via ntg-context
2021-09-11 11:19   ` Hugh Fisher via ntg-context
2021-09-11 12:00     ` Hans Hagen via ntg-context
2021-09-10 15:34 ` Denis Maier via ntg-context [this message]
2021-09-10 15:50   ` Denis Maier via ntg-context
2021-09-11 11:49   ` Hugh Fisher via ntg-context
2021-09-11 12:03     ` Hans Hagen via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=401e18d8b7bf46f49f40afefe308e064@unibe.ch \
    --to=ntg-context@ntg.nl \
    --cc=denis.maier@unibe.ch \
    --cc=hugo.fisher@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).