灵魂中的页面引用

灵魂中的页面引用

我正在使用这个soul包。

这有效:

\ul{lorem ipsum}

这不起作用:

\ul{lorem \cite{foo} ipsum}

这确实有效:

\ul{lorem {\cite{foo}} ipsum}

以下两种方法都不起作用:

\ul{lorem  \cite[42]{foo}  ipsum}
\ul{lorem {\cite[42]{foo}} ipsum}

因为soul说,“我遇到了用大括号括起来的可连字符材料,我无法处理。”

soul建议将其放在\mbox或中\hbox;这些对我来说都不起作用。

我读了用括号括起来的可连字符材料但我不确定它有多大相关性。(我尝试了它的建议,但没有任何效果。)

如何我将这样的引文放在soul?理想情况下,引文应该是可连字符的。

M(N)WE:

\documentclass{article}

\usepackage[american]{babel}
\usepackage[style=mla]{biblatex}
\usepackage{soul}

\begin{document}

\begin{thebibliography}{9}
\bibitem{lamport94}
  Leslie Lamport,
  \emph{\LaTeX: A Document Preparation System}.
  Addison Wesley, Massachusetts,
  2nd Edition,
  1994.
\end{thebibliography}

The \ul{underlined text on \cite[42]{lamport94} is underlined}, presumably.

\end{document}

建议的解决方案(替换soululem)似乎对实际的 BibTeX 条目不起作用:

麦格

\documentclass{article}

\usepackage[american]{babel}
\usepackage[normalem]{ulem}

\usepackage[style=mla]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@ARTICLE{uncivil,
  author = {Ismael, Jacqueline S. and Shereen T. Ismael},
  title = {The Arab Spring and the uncivil state},
  journal = {Arab Studies Quarterly},
  year = {2013},
  volume = {35.3},
  pages = {229--240},
  owner = {wchargin},
  timestamp = {2014.02.12}
}
\end{filecontents*}

\addbibresource{\jobname.bib}

\begin{document}

The \uline{underlined text on \cite[42]{uncivil} is underlined}, presumably.

\printbibliography
\end{document}

第一个pdflatexbibtex命令运行正常,但pdflatex再次运行会出现错误:

! Extra }, or forgotten \endgroup.
\UL@stop ...z@ \else \UL@putbox \fi \else \egroup 
                                                  \egroup \UL@putbox \fi \if...
l.11 ... text on \cite[42]{uncivil} is underlined}
                                                  , presumably.

答案1

如果您将牢不可破的材料放入里面\mbox,那么您的两个示例都可以正常工作。

  1. 第一届

    \documentclass{article}
    
    \usepackage[american]{babel}
    \usepackage[style=mla]{biblatex}
    \usepackage{soul}
    
    \begin{document}
    
    \begin{thebibliography}{9}
    \bibitem{lamport94}
      Leslie Lamport,
      \emph{\LaTeX: A Document Preparation System}.
      Addison Wesley, Massachusetts,
      2nd Edition,
      1994.
    \end{thebibliography}
    
    The \ul{underlined text on \mbox{\cite[42]{lamport94}} is underlined}, presumably.
    
    \end{document} 
    

    在此处输入图片描述

  2. 第二届

    \documentclass{article}
    
    \usepackage[american]{babel}
    \usepackage[normalem]{ulem}
    
    \usepackage[style=mla]{biblatex}
    \usepackage{filecontents}
    \begin{filecontents*}{\jobname.bib}
    @ARTICLE{uncivil,
      author = {Ismael, Jacqueline S. and Shereen T. Ismael},
      title = {The Arab Spring and the uncivil state},
      journal = {Arab Studies Quarterly},
      year = {2013},
      volume = {35.3},
      pages = {229--240},
      owner = {wchargin},
      timestamp = {2014.02.12}
    }
    \end{filecontents*}
    
    \addbibresource{\jobname.bib}
    
    \begin{document}
    
    The \uline{underlined text on \mbox{\cite[42]{uncivil}} is underlined}, presumably.
    
    \printbibliography
    \end{document} 
    

    在此处输入图片描述

答案2

您可以使用\uline正如ulemKarl 所指出的,您必须将其放在\cite里面\mbox才能使其与第二个 mwe 一起工作。

\documentclass{article}

\usepackage[american]{babel}  % biblatex likes it
\usepackage{biblatex}         % for \cite
\usepackage[normalem]{ulem}             % for \uline


\begin{document}

\begin{thebibliography}{9}
\bibitem{lamport94}
  Leslie Lamport,
  \emph{\LaTeX: A Document Preparation System}.
  Addison Wesley, Massachusetts,
  2nd Edition,
  1994.
\end{thebibliography}

The \uline{underlined text on \mbox{\cite[42]{lamport94}} is underlined}, presumably.

\end{document}

但这只不过是一种解决方法。

在此处输入图片描述

相关内容