
簡単な答えがあるはずですが、\renew コマンドでさまざまなことを試してみて、イライラしてしまいました。
すべてのセクションの見出しを再フォーマットして、自動番号付けで「質問」というテキストを含めたいと思います。現在、次のようになっています。
\section{Question 1}
\section{Question 2}
\section{Question 3}
期待通りの結果です。セクションの見出しを次のように表示したいのですが、
\section{}
\section{}
\section{}
テキストは次のように表示されます
Question 1
Question 2
Question 3
これは可能ですか? もし可能であれば、誰かヒントを持っていますか? どうもありがとうございます、CC。
答え1
答え2
samcarter のソリューションに似ていますが、次のものを使用します\section
(引数は不要)。
\documentclass{article}
\let\oldsection\section% Store \section in \oldsection
\renewcommand{\section}{% Update \section
\refstepcounter{section}% Step section counter
\oldsection*{Question~\thesection}}% Write a \section* with a specific header
\begin{document}
\section
Some content.
\section
Some more content.
\end{document}