3

I am a beginner with latex and tikz, and am using a .sty template to set my default fonts etc throughout the document (university requirement). This makes all the default text slightly larger than usual and adds 1.5 line spacing.

However I would like to add a flowchart (which I built successfully in a separate latex file using tikz). The problem is that once I pasted the code into the other document (the one with the template), the text inside the flowchart changed to that document's default (larger and with 1.5 line spacing). Obviously this made all the process boxes of the flowchart larger and they no longer fit in a page. Is there a way to only change the font of the tikz shapes to the latex default? I found ways how to add line spacing to the tikz shapes, or change the font, but cannot find how to set it to the latex default (which is not the default of that document).

Thanks. Your help is greatly appreciated.

  • As a workaround, you can compile your tikz figure in a separate .tex with appropiate font settings, and then \includegraphics the resulting pdf into the main one. Use standalone class (or preview package) in the separate .tex, to get the figure with appropiate bounding box. – JLDiaz May 9 '14 at 9:08
  • 1
    Normally it is better to use the same font for diagrams (or the sans font you are using). Could you not just use e.g. the default sans with \small for the diagram? – cfr May 10 '14 at 2:17
1

A small extension of cfr's comment:

\documentclass[17pt]{extarticle}
\usepackage[doublespacing]{setspace}
\usepackage{tikz}
\usepackage{kantlipsum}
\begin{document}
\kant[1]
\begin{tikzpicture}[every node/.style={font=\small\singlespacing}]
\node [text width=12cm] {\kant[1]};
\end{tikzpicture}

\kant[3]
\end{document}

enter image description here

0
...
\usepackage[doublespacing]{setspace}
...
\begin{tikzpicture}
\node {\parbox{12cm}{\small\singlespacing\kant[1]}};
\end{tikzpicture}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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