[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: puzzled about :fit for LaTeX src block
From: |
Juan Manuel Macías |
Subject: |
Re: puzzled about :fit for LaTeX src block |
Date: |
Thu, 13 Jan 2022 15:41:01 +0000 |
Eric S Fraga writes:
> This did it! Thank you. I am curious now to find out what tool was
> used instead... something for later today!
Well, it seems that if you use ":imagemagick yes", the image is created
with the `org-babel-latex-convert-pdf' function. I almost always use this
to create images from latex blocks, for example:
#+begin_src latex: imagemagick yes :iminoptions -density 600
\bfseries Hello world!
#+end_src
":fit" crop the image, but you can also put in your "org-format-latex-header"
"\\documentclass[varwidth]{standalone}"
On the contrary, without :imagemagick, but with results to *.png file,
`org-create-formula-image' is used, which depends on
"org-preview-latex-process-alist" and
"org-preview-latex-default-process". Since I only use LuaTeX for
everything, I have this in my init, in order to preview LaTeX fragments:
(setq luamagick
'(luamagick
:programs ("lualatex" "convert")
:description "pdf > png"
:message "you need to install lualatex and imagemagick."
:use-xcolor t
:image-input-type "pdf"
:image-output-type "png"
:image-size-adjust (1.0 . 1.0)
:latex-compiler ("lualatex -interaction nonstopmode -output-directory
%o %f")
:image-converter ("convert -density %D -trim -antialias %f -quality 100
%O")))
(add-to-list 'org-preview-latex-process-alist luamagick)
(setq org-preview-latex-default-process 'luamagick)
Note that the -trim option for the "convert" program (last line) allows
you to crop the image from the pdf page.
Best regards,
Juan Manuel