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

scale line widthkey that can be used here to scale the line width of the red line. – Mar 28 '20 at 01:58