
我有數字列表頁面。其中一些圖的標題有引用。如何從圖形清單頁面中刪除引文並將引文保留在正常頁面上?問候
:::::::::::::::::::::::::: 附錄 我正在使用以下指令:
\newcommand{\munepsfig}[3][scale=1.0]{%
\begin{figure}[!htbp]
\centering
\vspace{2mm}
\includegraphics[#1]{figures/#2.eps}
\caption{#3}
\label{fig:#2}
\end{figure}
}
用法範例:
\munepsfig[scale=0.5,angle=90]{barchart}{Population over time}
答案1
使用可選參數\caption
:
\caption[Text to the LoF]{Text for the document \cite{xx}}
透過對原始問題的編輯,我建議\munepsfig
(使用xparse
套件)的定義:
\usepackage{xparse}
\NewDocumentCommand\munepsfig{O{scale=1.0}mom}
{%
\begin{figure}[!htbp]
\centering
\vspace{2mm}
\includegraphics[#1]{figures/#2.eps}
\IfNoValueTF {#3}
{\caption{#4}}
{\caption[#3]{#4}}
\label{fig:#2}
\end{figure}%
}
並像這樣使用它:
\munepsfig[scale=0.5,angle=90]{image}[Text for the LoF]{Text for the document}
如果你想在 LoF 中使用不同的文本,或者簡單地作為
\munepsfig[scale=0.5,angle=90]{image}{Text for the document and the LoF}
文件和 LoF 中具有相同的文字。
請注意,新的第三個參數是可選的,因此只有當您想使用 的可選參數時才必須使用它\caption
。
答案2
如果您僅\cite
在標題中使用,而不在其他引用命令中使用,並且沒有可選參數,則另一種方法是使用etoolbox
添加 pre 和 post 鉤子\listoffigures
並重新定義\cite
\usepackage{etoolbox}
\makeatletter
\let\oldcite\cite
\pretocmd{\listoffigures}{\def\cite{\ignorespaces\@gobble}}{}{}
\apptocmd{\listoffigures}{\let\cite\oldcite}{}{}
\makeatother
答案3
如果您因為排序bibliographystyle
(按外觀)而想這樣做,我建議使用該包notoccite
。
它允許在目錄中引用,但其編號遵循它在正文中出現的位置。
答案4
您需要更改自訂命令的設定以採用一個附加參數,即要寫入圖形清單的材質。在下面的程式碼中, 的內容#4
將顯示在圖形清單中;#3
除了引用命令之外,它應該非常相似。
\newcommand{\munepsfig}[4][scale=1.0]{%
\begin{figure}[!htbp]
\centering
\vspace{2mm}
\includegraphics[#1]{figures/#2.eps}
\caption[#4]{#3}
\label{fig:#2}
\end{figure}
}
您可以按如下方式使用此修改後的命令:
\munepsfig[scale=0.5,angle=90]{barchart}{Population over time
\cite{some-source}}{Population over time}
這種方法的缺點是:如果圖表清單中顯示的材料與標題中顯示的材料相同,您仍然需要提供第四個參數。如果不這樣做,LaTeX 將繼續在輸入流中向前尋找下一個標記(實際上可以是任何內容)並將其視為命令的第四個參數。如果你這樣做,預計會出現奇怪的錯誤訊息和奇怪的崩潰...