1

I am using scale= option to scale a tikzpicture and wondeing what is the best way to propely handle the scaling of the red horizontal line in such a case.

enter image description here

Code:

\documentclass{article}
\usepackage{tikz}

\newcommand{\MyTikzPicture}{% \begin{tikzpicture}[scale=\Scale] \def@HalfLineWidth{20pt}% \draw [line width=2@HalfLineWidth, line cap=round] (2.0,3.0) -- (2.0,6.0) node [below, pos=0] {scale=\Scale};

    \begin{scope}[xshift=-\@HalfLineWidth]
        \draw [line width=2.0pt, red] (2.0,3.0) -- ++(2*\@HalfLineWidth,0);
    \end{scope}
\end{tikzpicture}%

}%

\begin{document}

\def\Scale{1.0} \MyTikzPicture \quad \def\Scale{2.0} \MyTikzPicture

\end{document}

Peter Grill
  • 223,288

0 Answers0