如何让LaTeX在括号内打印引用?

7

我在LaTeX中遇到了参考文献格式的问题。

我的使用方式是:

\usepackage[backend=bibtex,style=authoryear]{biblatex} %

但是当我看参考文献时,文字不在括号内。

,在Roy等人2010年中审查

应该改为

,在 (Roy等人2010年) 中审查


1
请注意,您的示例中括号不正确。应该可以删除括号而不会使文本无法阅读。在这里,它不起作用(“reviewed in”)。您应该写:“在Roy等人(2010)中审查”。在LaTeX中,请使用\citet{}\textcite{} - iNyar
2个回答

17
所有的参考文献包都有一种方式来根据上下文情况添加或不添加引用括号。
通常情况下,所有引用都用括号括起来是不合适的。例如,如果你说“见 \cite{foobar}”,你可能想要“见(Foobar 1999)”。但在类似“(\cite{foobar} 还有有趣的例子)”这样的语句中,你并不希望使用括号,因为“((Foobar 1999) also ...)”看起来很丑,并且不符合标准排版规则。最好使用“(Foobar 1999 also has ...)”。
因此,在普通bibtex中,你可以使用没有括号的 \cite 和带有括号的 \citep。
在 biblatex 中,你也可以这么做。使用 \parencite 来获取带有括号的引用,而不是使用 \cite。

1
另一种在引用周围添加括号的方法是更改\cite宏的定义:
\documentclass{article}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{knuth,
  author       = {Knuth, Donald E.},
  title        = {The {\TeX} book},
  date         = 1984,
  maintitle    = {Computers \& Typesetting},
  volume       = {A},
  publisher    = {Addison-Wesley},
  location     = {Reading, Mass.},
  langid       = {english},
  langidopts   = {variant=american},
  sortyear     = {1984-1},
  sorttitle    = {Computers & Typesetting A},
  indexsorttitle= {The TeXbook},
  indextitle   = {\protect\TeX book, The},
  shorttitle   = {\TeX book}
}

@article{einstein,
    author = {Einstein, A.},
    title = {Die Grundlage der allgemeinen Relativitätstheorie},
    journal = {Annalen der Physik},
    volume = {354},
    number = {7},
    doi = {10.1002/andp.19163540702},
    pages = {769--822},
    year = {1916}
}
\end{filecontents*}

\usepackage[backend=bibtex,style=authoryear]{biblatex}
\addbibresource{\jobname.bib}


\DeclareCiteCommand{\cite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\usebibmacro{cite}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\cite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\usebibmacro{citeyear}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}


\begin{document}


\cite{einstein}

\printbibliography

\end{document}

enter image description here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接