![tikzpicture 比例问题](https://linux22.com/image/368205/tikzpicture%20%E6%AF%94%E4%BE%8B%E9%97%AE%E9%A2%98.png)
如果我编译这个(使用 lualatex):
\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=1]
% Declare Points
\coordinate (C) at (-0.085,0.318);
\coordinate (B) at (0.868,0.868);
\coordinate (A) at (0.868,-0.232);
% Draw EquilateralTriangle
\draw[thick] (C)
-- (B) node[midway, sloped, scale=0.5] {O}
-- (A) node[midway, sloped, scale=0.5] {O}
-- cycle node[midway, sloped, scale=0.5] {O};
\end{tikzpicture}
\end{document}
最后一个“O”漂浮在任何地方......
我的代码中是否存在明显问题?这是一个错误吗?(如果是,有什么解决方法吗?)
答案1
您只需绘制C
然后循环即可。这将完美缩放。
编辑:问题应该是cycle
关闭路径的当前部分,如果稍后使用当前部分,可能会导致一些问题。
\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=1]
% Declare Points
\coordinate (C) at (-0.085,0.318);
\coordinate (B) at (0.868,0.868);
\coordinate (A) at (0.868,-0.232);
% Draw EquilateralTriangle
\draw[thick] (C)
-- (B) node[midway, sloped, scale=0.5] {O}
-- (A) node[midway, sloped, scale=0.5] {O}
-- (C) node[midway, sloped, scale=0.5] {O} -- cycle;
\end{tikzpicture}
\end{document}