TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following code:



% Define block styles
    text width=3em,
    text badly centered,
    inner sep=0pt
    text width=10em,
    text centered,
    rounded corners
    minimum height=2em
    inner sep=2.5pt
rectangle connector/.style={
    to path={(\tikztostart) -- ++(#1,0pt) \tikztonodes |- (\tikztotarget) },
rectangle connector/.default=-2cm,
straight connector/.style={
    to path=--(\tikztotarget) \tikztonodes
\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) ;


I want to scale the tikzpicture but haven't been able to do it. The problem apparently is between the tikz and babel packages.

I've tried a couple of things I read in other questions:

  1. Using \shorthandoff{<>}. This is needed to compile even when \scalebox is not used, but won't do any good once I turn \scalebox on.
  2. Replacing the & character with ampersand replacement=\&. This improved nothing.

If I disable the babel package, scaling works. The problem is I can't disable that package because I'm writing in Spanish.

Any ideas?

share|improve this question
You have to put \shorthandoff outside of \scalebox – egreg Apr 10 '12 at 14:54
Well, that was quick and easy. Thanks @egreg! – Gabriel Apr 10 '12 at 14:56
But why use scalebox ? You get a fine picture with TikZ and then you modify the line width, the size of the fonts etc. You use em in your graph but finally why ? There are solution to avoid the use of scalebox! You can easily change some dimensions to avoid this. – Alain Matthes Apr 10 '12 at 15:35
@Altermundus because it's easier than changing one thing at a time. This way I just resize the whole thing and be done with it. – Gabriel Apr 10 '12 at 15:41
up vote 5 down vote accepted

The \shorthandoff{<>} command must go outside the argument to \scalebox or it won't have any effect.

You can better use \deactivatequoting and \activatequoting afterwards:


or better yet, since you're using Unicode input, call


which will disable all shorthands. Check the documentation for more information: there is an extensive paper by Javier Bezos available with texdoc spanish.

You might alternatively choose to say \deactivatequoting after \begin{document}, if you don't need the "quoting" feature the shorthands << and >> provide.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.