Closed csevast closed 1 year ago
The XDV file contains PDF literal
specials with PDF operators to draw the lines, like this one:
push:
right: 15pt
down: -253.261505pt
xxx: 'pdf: literal q 0.99626401 0 0 0.99626401 0 0 cm 0.39998 w 0 0 m 214.00452 -34.2415 l S Q'
pop:
Since dvisvgm doesn't support PDF specials, the lines are missing in the SVG file. You somehow need to tell the struktex
package to emit PostScript specials instead. By default, it seems to create PDF specials when using XeLaTeX. The conversion works fine with LaTeX. Unfortunately, I can't really help to solve this issue.
Add \PassOptionsToPackage{dvips}{pict2e}
to the very beginning of tex file, then the final svg output is OK.
The reason is similar to the one in https://github.com/mgieseki/dvisvgm/issues/192#issuecomment-1210954442
That's because TikZ creates PDF specials by default when used with XeLaTeX. dvisvgm doesn't support these.
But here struktex
loads pict2e
to draw diagonal lines, and pict2e
creates PDF specials by default when used with XeLaTeX, see pict2e
drivers p2e-xetex.def
and p2e-dvips.def
.
For the completeness, you may also add either
\UseName{sys_load_backend:n}{dvisvgm} % documented in `texdoc interface3`
or
\UseName{keys_set:nn}{sys}{backend=dvisvgm} % documented in `texdoc expl3`
to the very beginning of tex file, to load l3kernel's dvisvgm
backend. Otherwise xetex
backend is loaded, which may cause problems if utilities based on for example l3color and/or l3draw are used.
The combination of
\PassOptionsToPackage{dvips}{pict2e}
with
\def\pgfsysdriver{pgfsys-dvisvgm.def}
at the very beginning of the tex
files worked for me (the last one was set already, and I added the first one).
Thank you very much
Hi, I am using XeLaTeX and DVISVGM as conversion chain tool for TeX embedding in org-mode of Emacs. It works fine but in the case of STRUKTEX package (https://www.ctan.org/pkg/struktex), to produce structured program flowcharts, the inclined lines in the decision statement box are missing after conversion.
I applied the steps manually in command prompt in Windows 11 (all the input and output files are attached).
To produce the correct PDF file (although, it is not cropped to the size of the flowchart box): 1)
xelatex -interaction nonstopmode -output-directory .\ orgtexPMk6Om.tex
To produce the incorrect SVG file: 1)
xelatex -no-pdf -interaction nonstopmode -output-directory .\ orgtexPMk6Om.tex
2)dvisvgm -n -b min -c 1,1 -o orgtexPMk6Om.svg orgtexPMk6Om.dvx
Employed software versions info: XeLaTeX
DVISVGM
GhostView
The TeX input file
orgtexPMk6Om.tex
The correct PDF file: orgtexPMk6Om.pdf
The incorrect SVG file: