emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [patch] Add two new header args to LaTeX block


From: Ihor Radchenko
Subject: Re: [patch] Add two new header args to LaTeX block
Date: Sun, 11 Feb 2024 14:43:00 +0000

Juan Manuel Macías <maciaschain@posteo.net> writes:

>> Considering that 'imagemagick is one of the variants in
>> `org-preview-latex-process-alist', it might be reasonable to allow
>> :process imagemagick == :imagemagick yes
>
> I wouldn't equate it. ':imagemagic yes' uses 'org-latex-convert-pdf'.
> Instead, «:process 'imagemagick» depends on:
>
> (imagemagick :programs
> ...

Agree.

>> Also, it feels incomplete to be able to define latex command for :file
>> foo.pdf, but be limited to a pre-defined list of symbols for :file .png.
>
> The ".png" method without ":imagemagick" does not depend on
> 'org-latex-pdf-process' but on 'org-create-formula-image', and this in turn
> depends on the value of 'org-preview-latex-default-process':
> ...
> If you put :file foo.png without :imagemagick, and want to control the
> process or change the compiler, you can do it with:
>
> :process '(foo :latex-compiler ("some LaTeX command")) 
>
> since this syntax is what org-preview-latex-default-process expects.
>
> In all other cases, including :imagemagick, the compilation process
> depends on the value of org-latex-pdf-process.

Got it.
Although, it is confusing to have different formats of :process
value depending on :file extension.

It would make things easier for users if
    :results file :file foo.png :process '("lualatex -interaction nonstopmode
    -output-directory %o %f")

worked as expected, automatically overriding :latex-compiler value in
let-bound `org-preview-latex-process-alist'.

> Anyway, I don't understand why that feature option (convert to an image
> without :imagemagick method) is limited to .png, when other graphic files are
> possible. I can define something like this:
>
> (setq org-preview-latex-default-process
>       '(my-process
>       :programs ("lualatex" "convert")
>       :description "pdf > jpg"
>       :image-input-type "pdf"
>       :image-output-type "jpg"
>       :latex-compiler ("lualatex -interaction nonstopmode -output-directory 
> %o %f")
>       :image-converter ("convert -density %D -trim -antialias %f -quality 100 
> %O")))
>
> But if I put :file foo.jpg nothing happens. Maybe that part should be
> corrected... Something like (string-match-p "\\.png\\|\\.jpg\\|..." out-file)?

I agree that it should be corrected.
Moreover, it would be nice to unify handling .png and imagemagick
branches of the code.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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