Brief outline of the bug
Using the TikZ ([turn]<ANGLE>:<DISTANCE>) syntax in combination with any transforms (global or scope, so far tested for shift and scale) leads to a faulty drawing (angle between and distance from the newly created point to the old point wrong).
% ORIGINALLY POSTED: https://tex.stackexchange.com/questions/758036/how-to-use-turn-coordinate-specification-in-combination-with-global-transforms-l
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% DESCRIPTION: Plain, no modification
% STATUS: WORKING
\draw[black]
(0,0)
arc(0:90:-1.5 and 1.5)
arc(90:135:-2.0 and 2.0)
--([turn]0:0.5)
node[below]{plain}
;
% DESCRIPTION: Scale
% STATUS: FAIL
\begin{scope}[scale=0.5]
\draw[red]
(0,0)
arc(0:90:-1.5 and 1.5)
arc(90:135:-2.0 and 2.0)
--([turn]0:0.5)
node[below]{scale}
;
\end{scope}
% DESCRIPTION: Shift
% STATUS: FAIL
\begin{scope}[xshift=5cm]
\draw[red]
(0,0)
arc(0:90:-1.5 and 1.5)
arc(90:135:-2.0 and 2.0)
--([turn]0:0.5)
node[below]{xshift}
;
\end{scope}
\end{tikzpicture}
\end{document}
Tested with
- TeX Live 2025.2-3 (Arch Linux)
- TeX Live 2025 (Overleaf)
- TeX Live 2024 (Overleaf)
- TeX Live 2023 (Overleaf)
- TeX Live 2022 (Overleaf)
- TeX Live 2020 (Overleaf)
Partial Workaround
Using transform canvas instead of standard transforms does produce the correct output.
% AUTHOR: jlab
% SOURCE: https://tex.stackexchange.com/a/758038
% LICENSE: CC BY-SA 4.0
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% DESCRIPTION: Plain, no modification
\draw[black]
(0,0)
arc(0:90:-1.5 and 1.5)
arc(90:135:-2.0 and 2.0)
--([turn]0:0.5)
node[below]{plain}
;
% DESCRIPTION: Scale
\begin{scope}[transform canvas={scale=0.5}]
\draw[red]
(0,0)
arc(0:90:-1.5 and 1.5)
arc(90:135:-2.0 and 2.0)
--([turn]0:0.5)
node[below]{scale}
;
\end{scope}
% DESCRIPTION: Shift
\begin{scope}[transform canvas={xshift=5cm}]
\draw[red]
(0,0)
arc(0:90:-1.5 and 1.5)
arc(90:135:-2.0 and 2.0)
--([turn]0:0.5)
node[below]{xshift}
;
\end{scope}
\end{tikzpicture}
\end{document}
Caveats:
- It also scales font sizes, nodes, etc. (with standard method not affected), which might be undesirable
- It does not work with all document classes out of the box (e. g. for
standalone, one cannot use shift or over unity scale in combination with transform canvas without manual resizing of the bounding box, as this does not happen automatically)
Minimal working example (MWE)
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% DESCRIPTION: Plain, no modification
% STATUS: WORKING
\draw[black]
(0,0)
arc(0:90:-1.5 and 1.5)
arc(90:135:-2.0 and 2.0)
--([turn]0:0.5)
node[below]{plain}
;
% DESCRIPTION: Scale
% STATUS: FAIL
\begin{scope}[scale=0.5]
\draw[red]
(0,0)
arc(0:90:-1.5 and 1.5)
arc(90:135:-2.0 and 2.0)
--([turn]0:0.5)
node[below]{scale}
;
\end{scope}
% DESCRIPTION: Shift
% STATUS: FAIL
\begin{scope}[xshift=5cm]
\draw[red]
(0,0)
arc(0:90:-1.5 and 1.5)
arc(90:135:-2.0 and 2.0)
--([turn]0:0.5)
node[below]{xshift}
;
\end{scope}
\end{tikzpicture}
\end{document}
Brief outline of the bug
Using the TikZ
([turn]<ANGLE>:<DISTANCE>)syntax in combination with any transforms (global or scope, so far tested forshiftandscale) leads to a faulty drawing (angle between and distance from the newly created point to the old point wrong).Tested with
Partial Workaround
Using
transform canvasinstead of standard transforms does produce the correct output.Caveats:
standalone, one cannot useshiftor over unityscalein combination withtransform canvaswithout manual resizing of the bounding box, as this does not happen automatically)Minimal working example (MWE)