Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should `\tikz@text@width` be reset inside a node? #743

Closed
u-fischer opened this issue Sep 12, 2019 · 2 comments · Fixed by #745

Comments

@u-fischer
Copy link

commented Sep 12, 2019

When the text width key is used the value is stored in \tikz@text@width. This confuses tikz commands inside the node. An example is chemfig which uses tikz for the arrows:

\documentclass{article}
\usepackage{chemfig}
\usepackage{tikz}

\begin{document}
\makeatletter
\begin{tikzpicture}
\node[text width=6cm]{
%\let\tikz@text@width\pgfutil@empty
\tikz[->]{\node(a){A};\draw(a)--(1,0);}
};
\end{tikzpicture}

\begin{tikzpicture}
\node[text width=6cm]{
\let\tikz@text@width\pgfutil@empty
\tikz[->]{\node(a){A};\draw(a)--(1,0);}
};
\end{tikzpicture}

\begin{tikzpicture}
\node[text width=6cm]{\chemfig{C-C}};
\end{tikzpicture}

\begin{tikzpicture}
\node[text width=6cm]{%
\let\tikz@text@width\pgfutil@empty
\chemfig{C-C}};
\end{tikzpicture}

\end{document}

image

@hmenke

This comment has been minimized.

Copy link
Member

commented Sep 12, 2019

TikZ pictures can't be nested. Sometimes it works but that is a pure coincidence.

@hmenke hmenke added the node label Sep 12, 2019
@hmenke

This comment has been minimized.

Copy link
Member

commented Sep 12, 2019

What about the zillions of other parameters that aren't reset?

hmenke added a commit to hmenke/pgf that referenced this issue Sep 12, 2019
hmenke added a commit to hmenke/pgf that referenced this issue Sep 16, 2019
hmenke added a commit to hmenke/pgf that referenced this issue Sep 20, 2019
@hmenke hmenke closed this in #745 Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.