아래 코드의 \fill 부분에 \ftone, \fttwo 로 하면 에러가 나는 반면에 \def에 해당하는 문구로 바꾸면 정상적으로 출력됩니다. 원인이 무엇인지 알고 싶네요.
\documentclass[12pt]{standalone} \usepackage{kotex} \usepackage{mathtools} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{calc,math,angles,positioning,intersections,decorations.markings,backgrounds} \tikzmath{% \xmax=3; \xmin=-3; \ymin=-5; \ymax=2; \pp=\xmin+0.2; \qq=\xmax-0.2; \aa=-2; \bb=0; \cc=2; }% \begin{document} \begin{tikzpicture}[yscale=0.4, xscale=1.2, declare function={ F1(\x)=pow(\x,4)-4*pow(\x,2); F2(\x)=0;} ] \draw[line width=0.6pt, -stealth, name path global=lx] (\xmin,0)--(\xmax,0) node {$x$}; \draw[line width=0.6pt, -stealth, name path global=ly] (0,\ymin)--(0,\ymax) node {$y$}; \def\ftone{plot[domain={\aa:\cc},samples=300] (\x,{F1(\x)})} %\ftone 의 정의 \def\fttwo{plot[domain={\cc:\aa}] (\x,{F2(\x)})} %\fttwo 의 정의 \begin{scope} \clip (\xmin,\ymin) rectangle (\xmax,\ymax); \draw[very thick,name path global=f1] plot[domain={\pp:\qq},samples=300] (\x,{F1(\x)}); \draw[thick,name path global=f2] plot[domain={\pp:\qq}] (\x,{F2(\x)}); \end{scope} \begin{scope}[on background layer] \fill[gray!60] (-2,0)--\ftone--\fttwo--cycle; %에러가 나는 부분 %\fill[gray!60] (-2,0)--plot[domain={\aa:\cc},samples=300] (\x,{F1(\x)})--plot[domain={\cc:\aa}] (\x,{F2(\x)})--cycle; %정상적인 출력 \end{scope} \coordinate (O) at (0,0); \coordinate (Ox) at (1,0); \coordinate (Oy) at (0,1); \end{tikzpicture} \end{document}
KTUG 한국 텍 사용자 그룹