Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following code:

\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}

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
1  
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
add comment

1 Answer

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:

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

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

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

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
add comment

Your Answer

 
discard

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.