TikZ 默认长度单位中的基线

TikZ 默认长度单位中的基线

最近,我一直在使用基线TikZ 图片中的参数,但我不知道长度的默认单位是什么。我知道厘米是 TikZ 包的默认单位,但对于基线

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}

\begin{document}

without baseline :
    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45]
        \clip(-1,-1) rectangle (5,5);
        \draw [line width=1pt] (0,4)-- (4,4);
        \draw [line width=1pt] (4,4)-- (4,0);
        \draw [line width=1pt] (4,0)-- (0,0);
        \draw [line width=1pt] (0,0)-- (0,4);
    \end{tikzpicture}\\
with baseline (no unit) :
    \begin{tikzpicture}[baseline=2, line cap=round,line join=round,>=triangle 45]
        \clip(-1,-1) rectangle (5,5);
        \draw [line width=1pt] (0,4)-- (4,4);
        \draw [line width=1pt] (4,4)-- (4,0);
        \draw [line width=1pt] (4,0)-- (0,0);
        \draw [line width=1pt] (0,0)-- (0,4);
    \end{tikzpicture}\\
with baseline (cm) :
    \begin{tikzpicture}[baseline=2cm, line cap=round,line join=round,>=triangle 45]
        \clip(-1,-1) rectangle (5,5);
        \draw [line width=1pt] (0,4)-- (4,4);
        \draw [line width=1pt] (4,4)-- (4,0);
        \draw [line width=1pt] (4,0)-- (0,0);
        \draw [line width=1pt] (0,0)-- (0,4);
    \end{tikzpicture}
\end{document}

有人知道我可以在哪里找到这类信息吗?

此致

答案1

似乎这是在以下情况下解释的pt

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}

\begin{document}

without baseline :
    \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45]
        \clip(-1,-1) rectangle (5,5);
        \draw [line width=1pt] (0,4)-- (4,4);
        \draw [line width=1pt] (4,4)-- (4,0);
        \draw [line width=1pt] (4,0)-- (0,0);
        \draw [line width=1pt] (0,0)-- (0,4);
    \end{tikzpicture}\\
with baseline (no unit) :
    \begin{tikzpicture}[baseline=2, line cap=round,line join=round,>=triangle 45]
        \clip(-1,-1) rectangle (5,5);
        \draw [line width=1pt] (0,4)-- (4,4);
        \draw [line width=1pt] (4,4)-- (4,0);
        \draw [line width=1pt] (4,0)-- (0,0);
        \draw [line width=1pt] (0,0)-- (0,4);
    \end{tikzpicture}\\
with baseline (pt) :
    \begin{tikzpicture}[baseline=2pt, line cap=round,line join=round,>=triangle 45]
        \clip(-1,-1) rectangle (5,5);
        \draw [line width=1pt] (0,4)-- (4,4);
        \draw [line width=1pt] (4,4)-- (4,0);
        \draw [line width=1pt] (4,0)-- (0,0);
        \draw [line width=1pt] (0,0)-- (0,4);
    \end{tikzpicture}
\end{document}

给出相同的结果。

相关内容