emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Luca Ferrari <fluca1978@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: emphasizing source code words
Date: Thu, 04 Feb 2021 13:13:21 +0100	[thread overview]
Message-ID: <877dnouj32.fsf@posteo.net> (raw)
In-Reply-To: <CAKoxK+4xs55=DEnsTfhs1tQK9v1xBBbE5d2gZqO7Qh5GeN7KMg@mail.gmail.com> (Luca Ferrari's message of "Thu, 4 Feb 2021 12:38:36 +0100")

Hi Luca

Luca Ferrari <fluca1978@gmail.com> writes:

> Thanks, but stil Im not able to figure it out. I've searched thru the
> org documentation without any luck.
>
> Luca

To use the minted package as backend (https://www.ctan.org/pkg/minted),
I have in my Emacs:

(setq org-latex-listings 'minted)
  (setq org-latex-minted-options
     '(("frame" "lines") ("linenos=true") ("breaklines")))

You also need to install the Python pigments library on your OS. In
Arch (in my case) is the python-pygments package.

And you have to make sure that when you export to LaTeX it always compiles
with the -shell-escape option. For example:

(setq org-latex-pdf-process
      '("lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"
	"lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"
	"lualatex -shell-escape -interaction nonstopmode -output-directory %o %f"))

Lastly, in Org docs you need of course to load the minted package:

#+LaTeX_HEADER: \usepackage{minted}

You can see how the highlighting looks like in this post from my blog (in
Spanish): under the title there is a button to download the entry in PDF
version: https://lunotipia.juanmanuelmacias.com/evitar_funcion_lua.html

Finally, you may be interested in this new package that TEC has written:

https://www.reddit.com/r/emacs/comments/lbkmmz/the_best_syntax_highlighting_in_a_pdf_youll_see_a/

Best regards,

Juan Manuel 





      reply	other threads:[~2021-02-04 12:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 12:51 Luca Ferrari
2021-02-01 12:55 ` TEC
2021-02-04 11:38   ` Luca Ferrari
2021-02-04 12:13     ` Juan Manuel Macías [this message]

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=877dnouj32.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=fluca1978@gmail.com \
    --subject='Re: emphasizing source code words' \
    /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).