KTUG 한국 텍 사용자 그룹

Menu

KTUG :: Q&A 마당 › tkz-graph 명령어의 중복된 vertex 이름 처리 방법?

커꿈 | 2015.03.14 23:41:47 | 메뉴 건너뛰기 쓰기

http://www.ktug.org/xe/index.php?mid=KTUG_QnA_board&document_srl=202686


위 질문에서 파생되는 질문입니다.


\documentclass[a4paper, reqno, twoside]{amsart}


\usepackage{tikz}

\usepackage{tkz-graph}


\def\linegraph#1\end{%
\begin{tikzpicture}
\SetGraphUnit{0.5}
\tikzset{VertexStyle/.style = {
shape = circle,
fill = black,
inner sep = 0pt,
outer sep = 0pt,
minimum size = 0.35em,
line width = 0pt,
draw}}
\SetVertexMath
\tikzset{EdgeStyle/.style ={thin}}
\Vertices[LabelOut,Lpos=90,Ldist=-0.2em,style={font=\scriptsize}]{line}{#1}
\Edges(#1)
\end{tikzpicture}}

\def\LinearGraph#1{\linegraph#1\end}



\begin{document}

\begin{tikzpicture}

\SetGraphUnit{0.5}

\tikzset{VertexStyle/.style = {
shape = circle,
fill = black,
inner sep = 0pt,
outer sep = 0pt,
minimum size = 0.35em,
line width = 0pt,
draw}}

\SetVertexMath

\tikzset{EdgeStyle/.style ={thin}}

\Vertices[LabelOut,Lpos=90,Ldist=-0.2em,style={font=\scriptsize}]{line}{-2,-3,-4,-5}

\Edges(-2,-3,-4,-5)
\end{tikzpicture}


VS


\LinearGraph{-2,3,-4,-5} % 문제없이 컴파일되고 원하는 결과를 얻습니다.

\LinearGraph{-2,-2,-4,-5}

% 여기서 문제가 발생합니다. 선분이 그어지지 않습니다.

% 아마도 입력값 -2, -2가 중복되어 생기는 문제인 듯 합니다.

% \LinearGraph{-2,-2,-3,-4}처럼 입력하면 vertex의 이름을 각각 a1, a2, a3, a4와 같이 서로 다른 이름으로 배정하고, label은 -2, -2, -3, -4로 원래 입력된 값으로 출력되도록 \LinearGraph 명령어를 변경할 수 있을까요?

 \end{document}

댓글 [8]

댓글 쓰기

목록 삭제

KTUG 한국 텍 사용자 그룹