実現したいこと
-
\@seccntformat
を再定義することで、\section{}
のセクション番号を角丸長方形で囲む
エラーメッセージ
20行1列
1Undefined control sequence. 2\roundbox ...picture}[baseline=(char.base)] \node
該当のソースコード
LaTeX
1\documentclass[lualatex]{jlreq} 2\usepackage{tikz} 3 4\newcommand{\roundbox}[1]{% 5 \begin{tikzpicture}[baseline=(char.base)] 6 \node[draw, rounded corners=2pt, inner sep=2pt] (char) {#1}; 7 \end{tikzpicture}% 8} 9 10\makeatletter 11\renewcommand{\@seccntformat}[1]{\roundbox{\csname the#1\endcsname\quad}} 12\makeatother 13 14\begin{document} 15\roundbox{\thesection} 16\makeatletter 17\@seccntformat{section} 18\makeatother 19\section{Introduction} 20This is the introduction section. 21\end{document} 22
試したこと
第15行で\roundbox{\thesection}
なら正しくコンパイルされることを、16-18行で\@seccntformat{}
単体では正しく(書き換えられたコマンドが)展開されることを確認しました。\section{Introduction}
に展開された\node
にかぎってUndefined control sequence.
が発生する理由と解決策を教えていただきたく思います。(また、未定義とされているcontrol sequenceは\node
で正しいでしょうか。)
補足情報(FW/ツールのバージョンなど)
ビルドのコマンド:
lualatex -synctex=1 -interaction=nonstopmode -file-line-error -recorder -output-directory="..." -synctex=1 -interaction=nonstopmode "main.tex"

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。