GNU bug report logs -
#41089
11.91; preview-latex gets confused by tikz calc syntax
Previous Next
Reported by: Dylan Thurston <dpt <at> bostoncoop.net>
Date: Mon, 4 May 2020 22:54:01 UTC
Severity: normal
Found in version 11.91
Done: Arash Esbati <arash <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi Dylan,
Dylan Thurston <dpt <at> bostoncoop.net> writes:
> preview-latex appears to get confused by tikz calc syntax, which
> includes a dollar sign. Here is a minimal file:
> ------------------------------------------------------------
> \documentclass{article}
> \usepackage{tikz}
> \usetikzlibrary{calc}
>
> \begin{document}
> \[
> \begin{tikzpicture}[x=1.5cm]
> \node (S1) at (0,1) {$S_1$};
> \node (D1) at (1,1) {$D_1 \setminus V_1$};
> \node (V1) at (2,1) {$V_1$};
> \node at ($(S1.east)!0.5!(D1.west)$) {$\sqcup$};
> \node at ($(D1.east)!0.5!(V1.west)$) {$\sqcup$};
> \end{tikzpicture}
> \]
> \end{document}
>
> %%% Local Variables:
> %%% mode: latex
> %%% TeX-master: t
> %%% End:
> ------------------------------------------------------------
Your example works for me if I give preview-latex 2 hints:
1) Don't touch $ in order to keep tikz happy
2) Tell preview-latex that it should render tikzpicture environment.
Then your document would look like this:
--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[displaymath,floats,graphics,footnotes,
% textmath %% Don't touch $ %%
]{preview}
\PreviewEnvironment[{[]}]{tikzpicture}
\begin{document}
Text
\[
\begin{tikzpicture}[x=1.5cm]
\node (S1) at (0,1) {$S_1$};
\node (D1) at (1,1) {$D_1 \setminus V_1$};
\node (V1) at (2,1) {$V_1$};
\node at ($(S1.east)!0.5!(D1.west)$) {$\sqcup$};
\node at ($(D1.east)!0.5!(V1.west)$) {$\sqcup$};
\end{tikzpicture}
\]
Text
\begin{tikzpicture}[x=1.5cm]
\node (S1) at (0,1) {$S_1$};
\node (D1) at (1,1) {$D_1 \setminus V_1$};
\node (V1) at (2,1) {$V_1$};
\node at ($(S1.east)!0.5!(D1.west)$) {$\sqcup$};
\node at ($(D1.east)!0.5!(V1.west)$) {$\sqcup$};
\end{tikzpicture}
Text
\end{document}
--8<---------------cut here---------------end--------------->8---
where preview-latex in Emacs looks like this:
[x1.png (image/png, inline)]
[Message part 3 (text/plain, inline)]
Reg. the `textmath' option, this is the description from the manual:
`textmath' will make all text math subject to previews. Since math
mode is used throughly inside of LaTeX even for other purposes,
this works by redefining \(, \) and $ and the `math' environment
(apparently some people use that). Only occurences of these text
math delimiters in later loaded packages and in the main document
will thus be affected.
Best, Arash
This bug report was last modified 1 year and 161 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.