
나는 아주 무작위로 실험을 하고 있었고 섹션 제목에 TikZ를 삽입하는 것에 대해 궁금해했습니다.
를 사용하면 article
이
\documentclass{article}
\usepackage{tikz}
\newcommand{\my}{\tikz\draw (0,0) circle (5pt);}
\begin{document}
\section{Introduction \protect\my}
\end{document}
공장.
하지만 를 사용하면 moderncv
이
\documentclass{moderncv}
\usepackage{tikz}
\moderncvstyle{classic}
\newcommand{\my}{\tikz\draw (0,0) circle (5pt);}
\begin{document}
\section{Introduction \protect\my}
\end{document}
작동하지 않습니다.
왜?
답변1
, 및 로드 hyperref
사이 에 충돌이 있습니다 .tikz
moderncv
hyperref
해결 방법에는 \texorpdfstring
명령을 정의하는 데 사용하는 것이 포함됩니다.
이 같은:
\texorpdfstring{tikz code}{alternative (empty)}
MWE는 다음과 같아야 합니다.
\documentclass{moderncv}
\usepackage{tikz}
\moderncvstyle{classic}
\newcommand{\my}{\texorpdfstring{\tikz\draw (0,0) circle (5pt);}{}}
\firstname{John}
\familyname{Doe}
\begin{document}
\section{Introduction \protect\my}
\end{document}