使用 Babel spanish 包缩放 tikzpicture

使用 Babel spanish 包缩放 tikzpicture

我有以下代码:

\documentclass[a4paper,10pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage{tikz}
\usetikzlibrary{matrix,shapes,arrows,positioning,chains}
\usepackage[spanish,activeacute]{babel}

\begin{document}

% Define block styles
\tikzset{
desicion/.style={
    diamond,
    draw,
    text width=3em,
    text badly centered,
    inner sep=0pt
},
block/.style={
    rectangle,
    draw,
    text width=10em,
    text centered,
    rounded corners
},
cloud/.style={
    draw,
    ellipse,
    minimum height=2em
},
descr/.style={
    fill=white,
    inner sep=2.5pt
},
connector/.style={
 -latex,
 font=\scriptsize
},
rectangle connector/.style={
    connector,
    to path={(\tikztostart) -- ++(#1,0pt) \tikztonodes |- (\tikztotarget) },
    pos=0.5
},
rectangle connector/.default=-2cm,
straight connector/.style={
    connector,
    to path=--(\tikztotarget) \tikztonodes
}
}
\scalebox{0.85}{
\begin{tikzpicture}
\shorthandoff{<>}
\matrix (m)[matrix of nodes, column  sep=2cm,row  sep=8mm, align=center, nodes={rectangle,draw, anchor=center}, ampersand replacement=\&]{
\node [block] {A. Campos [1;14]}; \& \\
\node [block] {B. Bineado [1;4]}; \& \\
\node [cloud] {call \texttt{analisis\_campo}}; \& \\
\node [block] {C. Modelos [1;2]}; \& \\
\node [block] {D. Extinción [1;31]}; \&  \node [block] {E. Fracción de binarias [1;2]}; \\
\node [cloud] {call \texttt{analisis\_modelo}}; \& \\
\node [cloud] {call \texttt{analisis\_final}}; \& \node [desicion] {\scriptsize{Fin E?}}; \\
\node [desicion] {\scriptsize{Fin D?}}; \& \\
\node [desicion] {\scriptsize{Fin C?}}; \& \\
\node [desicion] {\scriptsize{Fin B?}}; \& \\
\node [desicion] {\scriptsize{Fin A?}}; \& \\
\node [block] {FIN}; \& \\
 };
\path [>=latex,->] (m-1-1) edge (m-2-1);
\path [>=latex,->] (m-2-1) edge (m-3-1);
\path [>=latex,->] (m-3-1) edge (m-4-1);
\path [>=latex,->] (m-4-1) edge (m-5-1);
\path [>=latex,->,dashed] (m-5-1) edge node[auto] {\scriptsize{MODEL}} (m-5-2);
\draw [>=latex,->] (m-5-2) |- (m-6-1);
\path [>=latex,->] (m-5-1) edge (m-6-1);
\path [>=latex,->] (m-6-1) edge (m-7-1);
\path [>=latex,->,dashed] (m-7-1) edge node[auto] {\scriptsize{MODEL}} (m-7-2);
\path [>=latex,->] (m-7-1) edge (m-8-1);
\draw [rectangle connector=2.5cm] (m-7-2) to node[descr] {No} (m-5-2);
\draw [rectangle connector=-3cm] (m-8-1) to  node[descr] {No} (m-5-1);
\draw [rectangle connector=-4cm,] (m-9-1) to node[descr] {No} (m-4-1);
\draw [rectangle connector=-5cm] (m-10-1) to  node[descr] {No} (m-2-1);
\draw [rectangle connector=-6cm] (m-11-1) to node[descr] {No} (m-1-1);
\draw [connector] (m-7-2) |- node[descr, pos=0.25] {Sí} (m-8-1);
\draw [straight connector] (m-8-1) to node[descr] {Sí} (m-9-1);
\draw [straight connector] (m-9-1) to node[descr] {Sí} (m-10-1);
\draw [straight connector] (m-10-1) to node [descr] {Sí} (m-11-1);
\draw [straight connector] (m-11-1) to node [descr] {Sí} (m-12-1) ;
\label{modelos_flow}
\end{tikzpicture}
}

\end{document}

我想缩放 tikzpicture,但一直无法做到。问题显然出在tikzbabel包之间。

我尝试了在其他问题中读到的几件事:

  1. 使用。即使不使用\shorthandoff{<>}也需要进行编译,但是一旦打开就不会有任何用处。\scalebox\scalebox
  2. 将字符替换&ampersand replacement=\&。这并没有什么改善。

如果我禁用该babel包,扩展就可以正常工作。问题是我不能禁用该包,因为我用西班牙语写作。

有任何想法吗?

答案1

命令\shorthandoff{<>}必须超出参数范围,\scalebox否则不会产生任何效果。

您可以更好地使用\deactivatequoting然后\activatequoting

\deactivatequoting
\scalebox{0.85}{...}
\activatequoting

或者更好的是,由于您使用的是 Unicode 输入,因此可以调用

\usepackage[spanish,es-noshorthands]{babel}

这将禁用所有简写。查看文档以了解更多信息:Javier Bezos 撰写的一篇详尽论文可供参考texdoc spanish

如果您不需要“引用”功能,您也可以选择\deactivatequoting在之后说,使用简写并提供。\begin{document}<<>>

相关内容