emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Diego Zamboni <diego@zzamboni.org>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: Choosing a LaTeX Compiler (my predilection for LuaTeX)
Date: Wed, 07 Apr 2021 17:29:36 +0200	[thread overview]
Message-ID: <874kgixgdb.fsf@posteo.net> (raw)
In-Reply-To: <CAGY83EfEA8UxB81OWK1uuv7zMknZDzCnVmTAmdKb51QhY5JSOA@mail.gmail.com> (Diego Zamboni's message of "Wed, 7 Apr 2021 16:16:27 +0200")

Hi Diego

Diego Zamboni writes:

> Hi Juan Manuel,
>
> Thank you for writing this, which is the clearest explanation I have
> seen of the advantages of LuaLaTeX/XeLaTeX. I have been using LaTeX
> for nearly 30 years, but stopped using it intensively every day when
> pdfLaTeX was still the bleeding edge. When I started again in the last
> couple of years, it has been a bit confusing to understand why and
> what all these different versions are. These days I use LuaLaTeX as
> well, but most of the documents I process are exported from Org-mode.

Certainly, LuaTeX has many possibilities, although perhaps we would have
liked more if there was a "LispTeX" :-D (by the way, the most lispy thing
I've seen on planet TeX is this strange and interesting package [a Lisp
interpreter written in TeX! language]:
https://www.ctan.org/pkg/lisp-on-tex)

This is a very simple example of what can be done in LuaTeX through its
 Lua interpreter (from Org): we define a command, with a simple Lua
 function, that put all capital letters of the document in TeX Gyre
 Pagella font, in red and scaled; and all digits in bold. (Anyway, this
 can also be done in Org Mode with a custom filter...):

#+NAME:luacode
#+begin_src lua :exports none
  function change_test ( text )
       text = string.gsub ( text, "%d",   "\\textbf{%0}" )
       text = string.gsub ( text, "%u",   "{\\myfamily %0}" )
       return text
  end
#+end_src

#+NAME:latexcode
#+begin_src latex :exports none :noweb yes
  \usepackage{fontspec}
  \usepackage{luacode}
  \usepackage{xcolor}
  \setmainfont{Linux Libertine O}
  \newfontfamily\myfamily{TeX Gyre Pagella}[Scale=2,Color=red]

  \begin{luacode}
  <<luacode>>
  \end{luacode}

  \newcommand\change{\directlua{luatexbase.add_to_callback
       ( "process_input_buffer" , change_test , "change_test" )}}
  \newcommand\nochange{\directlua{luatexbase.remove_from_callback
	( "process_input_buffer" , "change_test" )}}
#+end_src

#+begin_src latex :noweb yes :results raw
,#+LaTeX_HEADER: <<latexcode>>
#+end_src

#+LaTeX:\change

Lorem ImpsuM DoloR Sit aMet

1234567890

#+LaTeX:\nochange

Lorem ImpsuM DoloR Sit aMet

1234567890

x-----

For more esoteric features I recommend trying the chickenize
package (very didactic): https://www.ctan.org/pkg/chickenize

Best regards,

Juan Manuel 




  reply	other threads:[~2021-04-07 15:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-05 20:48 Juan Manuel Macías
2021-04-05 21:17 ` Dr. Arne Babenhauserheide
2021-04-05 21:36   ` Juan Manuel Macías
2021-04-06 19:03     ` physiculus
2021-04-06 19:13       ` Juan Manuel Macías
2021-04-07 16:57         ` physiculus
2021-04-07 17:26           ` Juan Manuel Macías
2021-04-07 17:53             ` physiculus
2021-04-07 19:52               ` Juan Manuel Macías
2021-04-06 19:46       ` tomas
2021-04-06 20:09         ` Juan Manuel Macías
2021-04-07 14:16 ` Diego Zamboni
2021-04-07 15:29   ` Juan Manuel Macías [this message]
2021-04-06 20:44 Ypo

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=874kgixgdb.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=diego@zzamboni.org \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: Choosing a LaTeX Compiler (my predilection for LuaTeX)' \
    /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

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).