当我尝试在引用前添加不间断空格时,Latex 不会在呈现的 pdf 中的引用前显示波浪符号 (~)。
以下是我希望看到的:根据 xx (2013)~[refID]
According to xx (2013)~\cite{xx}
According to xx (2013)\nobreakspace\cite{xx}
但是,使用上述代码后我得到的结果是:根据 xx (2013) [refID]
最小工作示例:
\documentclass{article}
\begin{filecontents}{\jobname.bib}
@book{key,
author = {Author, A.},
year = {2001},
title = {Title},
publisher = {Publisher},
}
\end{filecontents}
\begin{document}
According to xx\textasciitilde{}\cite{key}, ...
\bibliographystyle{plain}
\bibliography{\jobname}
\end{document}
问题在于波浪号后面的空格。我该如何删除它?
答案1
我无法重现您的图片。在 overleaf 上(通过 LuaLaTeX)生成的图片如下:
以下是我使用自己的 TeX Live 2021 尝试的结果:
\documentclass{article}
\usepackage{textcomp}
\begin{filecontents}{\jobname.bib}
@book{key,
author = {Author, A.},
year = {2001},
title = {Title},
publisher = {Publisher},
}
\end{filecontents}
\begin{document}
According to xx\textasciitilde{ }\cite{key}, ...
According to xx\textasciitilde{}\cite{key}, ...
According to xx\textasciitilde\cite{key}, ...
According to xx\texttildelow\cite{key}, ...
According to xx\verb+~+\cite{key}, ...
According to xx$\sim$\cite{key}, ...
\bibliographystyle{plain}
\bibliography{\jobname}
\end{document}