8

I'm new to LaTeX and i'm struggling with TikZ, especially flowcharts. I'm dutch and therefor I'm using the documentclass 'rapport1':

\documentclass[11pt]{rapport1}  
\usepackage[dutch]{babel}

This documentclass has a default parindent which I managed to erase with the following line:

\setlength{\parindent}{0pt}

This line however seems not to affect the indentation within tikz nodes:

problem

\documentclass[11pt]{rapport1}  
\usepackage[dutch]{babel}

\setlength{\parindent}{0pt}

\usepackage{tikz}
\usetikzlibrary{shapes, arrows}
\tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=5em,
                     text centered, rounded corners, minimum height=4em] 

\begin{document}
    \begin{tikzpicture}[node distance = 2cm, auto]
        \node [block] (test) {This is a test!};
    \end{tikzpicture}
\end{document}

Is there a way to solve this issue and get the node block rendered just as it would when using \documentclass{article}?

  • I loaded up your image to our default picture service to include it directly. As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again. – Tobi Jan 31 '12 at 22:01
  • I improved the formatting of your code a little: I made your example became copyable ad full working code (not a snippet) and fixed the line width to avoid vertical scrolling. – Tobi Jan 31 '12 at 22:09
9

Just set \unitindent to 0 pt instead of changing \parindent:

\setlength{\unitindent}{0pt}

TikZ node

This is used by the class, in rapport1.cls we find

\newdimen\unitindent
...
\setlength\parindent{\unitindent}

Specifically, \parindent can be reset to \unitindent by internal class macros, such as \@indentset:

\newcommand*\@indentset{%
            \global\parindent=\unitindent
            \global\leftmargini=\unitindent
            \global\@needwriteindenttrue}

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.