auctex
[Top][All Lists]
Advanced

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

Export Emacs highlighting to LaTeX?


From: jfbu
Subject: Export Emacs highlighting to LaTeX?
Date: Fri, 14 May 2021 14:10:32 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

Hi,

Code highlighting (for PDF output) is a problem with partial solutions
in LaTeX world.  This 7 years old question on tex.sx

https://tex.stackexchange.com/questions/153896/has-the-time-come-for-a-latex3-successor-to-listings

has interesting quality answers and remain relevant.

Accidentally hitting it today, I learn about very recent
new LaTeX package https://ctan.org/pkg/codehigh, currently apparently
covering highlighting of latex code itself (latex2 or latex3)
in pdf output.

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?

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.

(I sort of remember "comment" package creates external files
but one can create easily an alternative "ignore" environment
if desired, \iffalse...\fi method being the simplest one
which however is dangerous is enclosed code to ignore is (La)TeX,
but one can produce completely safe solutions)

Perhaps something like this already exists?

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.

Best,
Jean-François




reply via email to

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