![\sectionmark에서 adjustbox를 어떻게 사용할 수 있나요?](https://rvso.com/image/286976/%5Csectionmark%EC%97%90%EC%84%9C%20adjustbox%EB%A5%BC%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%EC%82%AC%EC%9A%A9%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%82%98%EC%9A%94%3F.png)
\sectionmark에서 adjustbox를 사용하고 싶지만 작동하지 않습니다. 이에 대한 해결 방법이 있나요?
\documentclass{book}
\usepackage{blindtext}
\usepackage{adjustbox}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{#1 \adjustbox{valign=t}{\rule{1.5pt}{\baselineskip}} \thesection}}
\fancyhead[RO]{\rightmark}
\fancyhead[LO]{}
\begin{document}
\chapter{An example chapter}
\section{An example section}
\blindtext[25]
\end{document}
답변1
\rule
및 둘 다 \adjustbox
깨지기 쉬운 명령이므로 \protect
인수를 이동할 때(of 인수는) 앞에 사용해야 합니다 \sectionmark
.
그러나 소원을 이루는 더 좋은 방법이 있습니다.
\documentclass{book}
\usepackage{blindtext}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{%
\markright{#1 \strut\vrule width 1.5pt\relax\ \thesection}}
\fancyhead[RO]{\rightmark}
\fancyhead[LO]{}
\begin{document}
\chapter{An example chapter}
\section{An example section}
\blindtext[25]
\end{document}