tikzpicture 상단에 표시되도록 각 질문 부분을 어떻게 표시합니까?

tikzpicture 상단에 표시되도록 각 질문 부분을 어떻게 표시합니까?

저는 아직 라텍스를 처음 접했지만 다양한 크기의 모양이 포함된 시험을 입력하고 있습니다. 각 열에서 모양의 상단을 수직으로 정렬하여 질문 번호도 정렬할 수 있기를 바랍니다((a)가 (b)에 정렬되고 둘 다 해당 이미지의 상단에 있고 그렇지 않음) 하단). MWE를 만드는 것은 이번이 처음이므로 완벽하지 않을 수 있습니다.

\documentclass[12pt]{exam}
\usepackage{tikz}
\usepackage{multicol}

    \begin{questions}
    \question Find the area of each figure shown below.
    \begin{parts}
        \begin{multicols}{2}
            \part{
                \begin{tikzpicture}[scale=0.3]
                    \draw (0,0) circle (4);
                    \draw (0,0) -- node[above]{4 m} (4,0);
                    \draw[fill=black] (0,0) circle (0.07);
                \end{tikzpicture}
                }
                
            \part{
            \begin{tikzpicture}[scale=0.3]
                    \draw (0,0) circle (8);
                    \draw (0,0) -- node[above]{8 mm} (8,0);
                    \draw[fill=black] (0,0) circle (0.07);
                \end{tikzpicture}
                }
        \end{multicols}
    \end{parts}
\end{questions}

\end{document}

답변1

해결책은 baseline=(current bounding box.north)tikzpicture에 옵션을 제공하는 것입니다. 따라서 \begin{tikzpicture}[scale=0.3,baseline=(current bounding box.north)].

pgfmanual에 따르면 구문이 \draw (0,0) circle (4);오래되었습니다. 최신 구문은 \draw (0,0) circle [radius=4];.

4 m노드의 텍스트(및 유사) 대신 텍스트 에 8 mmsiunitx 패키지를 사용하는 것을 고려하십시오 . 그러면 와 사이의 간격은 에 비해 크지 않습니다 .\usepackage{siunitx}\qty{4}{\m}4m4 m

대신 을 사용할 수 있습니다 \draw[fill=black].\fill

관련 정보