![在引用列表中施加自定义间距](https://linux22.com/image/390046/%E5%9C%A8%E5%BC%95%E7%94%A8%E5%88%97%E8%A1%A8%E4%B8%AD%E6%96%BD%E5%8A%A0%E8%87%AA%E5%AE%9A%E4%B9%89%E9%97%B4%E8%B7%9D.png)
我想在\citep
命令列出的参考列表的项目之间设置自定义间距,类似于我在文本中使用“\hspace*”的操作。一种选择是写:
\documentclass{beamer}
\usepackage{natbib}
\begin{document}
\begin{frame}
\citep{A,B,C}\hspace*{5cm}\citep{X,Y,Z}
\end{frame}
\end{document}
但我希望只有一组括号,而不是两组。(也就是说,我想要“(A, B, C, [自定义空间] X, Y, Z)”。
答案1
!
这是用于标记空格应出现位置的引用命令。!
任何引用字符串中只允许出现一个空格。
语法是:
\spcite[<spacewidth>]{<keylist>!<keylist>}
我已将默认间距设置为,3em
但可以在定义中更改。
\begin{filecontents}{\jobname.bib}
@incollection{Chomsky1993,
Address = {Cambridge, Mass.},
Author = {Noam Chomsky},
Booktitle = {The View From Building 20},
Editor = {Kenneth Hale and Samuel Jay Keyser},
Pages = {1-52},
Publisher = {MIT Press},
Title = {A Minimalist Program for Linguistic Theory},
Year = {1993}}
@book{Chomsky1965,
Address = {Cambridge Mass.},
Author = {Noam Chomsky},
Publisher = {{MIT} Press},
Title = {Aspects of the Theory of Syntax},
Year = {1965}}
@book{Chomsky1986,
Address = {Cambridge Mass.},
Author = {Noam Chomsky},
Publisher = {{MIT} Press},
Title = {Barriers},
Year = {1986}}
\end{filecontents}
\documentclass{article}
\usepackage{natbib}
\bibliographystyle{plainnat}
\makeatletter
\def\@spcite#1!#2\@nil{\gdef\sp@tmp{#1}\gdef\sp@tmpii{#2}}
\newcommand\spcite[2][3em]{\edef\sp@tmpiii{#2}\expandafter\@spcite\sp@tmpiii\@nil\NAT@open\citealp{\sp@tmp}\NAT@sep\hspace*{#1}\citealp{\sp@tmpii}\NAT@close}
\makeatother
\begin{document}
\spcite{Chomsky1965!Chomsky1993,Chomsky1986}
\bibliography{\jobname}
\end{document}