Latex로 6개의 피라미드형 점 생성

Latex로 6개의 피라미드형 점 생성

이 질문을 어디에 넣어야 할지 모르겠지만, Latex를 사용하여 피라미드 모양의 6개 점으로 구성된 그래픽 요소를 만드는 것이 가능합니까?

유니코드 문자 블록에서는 이 기호를 찾을 수 없으므로 다음 시도는 Latex 또는 유사한 방법으로 만들어 보는 것입니다. 그리고 이것이 작동하지 않으면 그냥 png 이미지를 받아들이세요...

아래 기호 T3=6은 제가 만들려는 기호입니다.

점의 피라미드 모양

답변1

tikz로 할 수 있습니다. 명령 정의 의 설명을 참조하세요 \pyrdot.

여기에 이미지 설명을 입력하세요

\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\newcommand{\pyrdot}[1]{
    % you can tune the size of the pyramid using the scale option
    \begin{tikzpicture}[scale=.4] 
        \pgfmathsetmacro{\n}{#1}                            % define \n, the number of rows 
        \edef\m{0}                                          % define \m, the total number of circles
        \foreach \i in {1, ..., \n} {                       % vertical loop
            \foreach \k in {1, ..., \i} {                   % horizontal loop
                \fill ($(\k,-\i)+(-.5*\i,0)$) circle (4mm); % draw the circle (size = 4mm, shifted to the left)
                \pgfmathparse{int(\m+1)}                    % increment \m
                \xdef\m{\pgfmathresult}
            }
        }
        % put the text below the pyramid
        \node[anchor=north] at (current bounding box.south) {$T_{\n}=\m$};
    \end{tikzpicture}
}

\begin{document}

\section{pyramidical dots}
\pyrdot{1}
\pyrdot{2}
\pyrdot{3}
\pyrdot{4}
\pyrdot{5}
\pyrdot{6}

\end{document}

참고자료

관련 정보