auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Export Emacs highlighting to LaTeX?


From: Tassilo Horn
Subject: Re: Export Emacs highlighting to LaTeX?
Date: Fri, 14 May 2021 21:23:44 +0200
User-agent: mu4e 1.5.13; emacs 28.0.50

jfbu <jfbu@free.fr> writes:

Hi Jean-François,

> This leds me to wonder if a poor man solution is feasible which would
> rely on Emacs own fontlocking support: i.e. is it feasible to add an
> "export to LaTeX mark-up" feature to convert the produced (internal to
> Emacs eLisp) mode-dependent highlight into LaTeX (or Plain TeX)
> mark-up?

I've thought that Org could do that, i.e., export some emacs highlighted
#+BEGIN_SRC...#+END_SRC block to LaTeX.  However, it just created a
verbatim environment and the docs suggest that there is also support for
lstlistings and minted but not "hand-crafted" LaTeX highlighting.  I've
used the latter several years ago, and have been very satisfied.  I have
no idea about LaTeX3 support, though.

> One could also imagine that some eLisp function would take a region
> and a language from a TeX buffer and insert underneath it
> LaTeX-formatted (or Plain TeX-formatted) mark-up. The original could
> be enclosed in a comment environment or other means to let it be
> ignored by LaTeX compiling itself.

Well, that's certainly feasible to some degree, i.e., you can access all
faces and their attributes and convert them to some similar looking
LaTeX code.

Maybe someone on the list wants to start hacking away.  To get started,
could you supply some language snippet in some language supported by
stock emacs -Q, a screenshot how it looks, and the equivalently looking
LaTeX code?

> If not, its installment would reinforce domination of Emacs eLisp on
> the world at large as collaborative projects would have to impose on
> all participants not only a code of conduct but also the mandatory
> usage of Emacs for text editing.

Well, that sounds like a very worthwhile goal indeed!

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]