
我確信有一個簡單的答案,但我已經到了使用 \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}