emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Pre-PATCH] Overhaul of the LaTeX preview system


From: Timothy
Subject: Re: [Pre-PATCH] Overhaul of the LaTeX preview system
Date: Mon, 29 May 2023 01:31:59 +0800
User-agent: mu4e 1.10.3; emacs 28.2.50

Hi Rudolf,

Thanks for testing the branch :)

> ISSUE 1: CLIPPING
>
> On my HiDPI screen, the new previews are clipped slightly at the edges.
> I had this issue before and fixed it in [1][2].  Has the same bug crept
> back?
>
> [1] 
> <https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=52ebf6b45>
> [2] 
> <https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5337a49f3>

We’re thinking of adding `--exact-bbox' to the default `dvisvgm' flags, which it
seems has a good chance of resolving this. It was originally swapped for
`--bbox=preview' (when using `dvisvgm' to get dimension info), but now we do 
this
via the LaTeX compilation stdout, and so we can go back to `--exact-bbox'.

> ISSUE 2: TIKZ
>
> I use LaTeX Babel blocks for TikZ, and these stopped working.  From the
> *Messages* buffer:
>
> Executing Latex unknown at position 846…
> Processing LaTeX file 
> /var/folders/ky/8r5j3qz55hb94lpg1jr9vl1c0000gn/T/babel-ntjCLq/latex-aGIYEN.tex…
> Compiling 
> /var/folders/ky/8r5j3qz55hb94lpg1jr9vl1c0000gn/T/babel-ntjCLq/latex-aGIYEN.tex…
> org-compile-file: File 
> “/var/folders/ky/8r5j3qz55hb94lpg1jr9vl1c0000gn/T/babel-ntjCLq/latex-aGIYEN.svg”
>  wasn’t producedorg babel latex failed
> PDF file produced.
>
> The linked LaTeX file compiles without errors, and a PDF file with
> correct content sits next to it.  Perhaps the preview system needs to
> wait longer?

Hmmm, not sure what’s going on. Care to provide a MWE?

> [Also notice the missing space in “producedorg”.]
>
> It would be *FABULOUS* if this patch-set could also make ’ob-babel’ use
> the same mechanism as the new previews, ’dvisvgm’ (TeX to DVI to SVG)
> instead of Inkscape (TeX to PDF to SVG).  It would fix, for example,
> scaling.  On my system, LaTeX Babel outputs everything at half of the
> correct size, and I cannot convince Inkscape to scale up to save my
> life.  The previews and ’dvisvgm’ work as expected, conversely.

The hard part was the overhauled machinery, hooking up the new system to
ob-babel should be possible without too much hassle. It might need to wait for
another patch-set though (this one is already at ~100 commits and a few thousand
lines changed).

> It would be *SUPER-FABULOUS* if the new previews worked with TikZ out of
> the box, as per the Org manual saying “any LaTeX environment is handled”
> [1] when not using MathJax.  Currently, PGF plots show as “blobs of
> letters” and the simplest TikZ pictures, such as
>
> \begin{tikzpicture}
>   \filldraw (0, 0) circle[radius = 1cm];
> \end{tikzpicture}
>
> make the preview system choke with
>
> error in process filter: org-latex-preview–svg-make-fg-currentColor: Wrong 
> type argument: stringp, nil
> error in process filter: Wrong type argument: stringp, nil

I tried this example on my computer, and it worked flawlessly (see
<https://0x0.st/Hq7Z.png>). If you could give me a stacktrace, that might help.

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), 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/tec>.

reply via email to

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