biblatex:\parencite 中为大写,但 \textcite 中不是大写

biblatex:\parencite 中为大写,但 \textcite 中不是大写

我怎样才能使\parencite输出为大写但大小写为正常\textcite

结果:

\parencite{CARNAP1934} -> (CARNAP, 1934)

\textcite{CARNAP1934} -> Carnap (1934)

梅威瑟:

\documentclass[12pt,a4paper]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}


\usepackage[citestyle=authoryear,bibstyle=authortitle,labelnumber,natbib=true,firstinits=true,isbn=false,babel=other,language=brazilian,backend=biber]{biblatex}


\addbibresource{test.bib}
\begin{document}


\section{Intro}

\textcite{CARNAP1937}

\section{Conclusion}

\parencite{CARNAP1935}

\parencite{SCHICKORE2006}

\printbibliography

\end{document}

.bib:

@book{CARNAP1935,
Address = {London},
Author = {Carnap, Rudolf},
Publisher = {Kegan Paul, Trench, Trubner \& Co.},
Title = {Philosophy and Logical Syntax},
Year = {1935}}

@book{CARNAP1937,
Address = {London},
Author = {Carnap, Rudolf},
Note = {Transl. Amethe Smeaton (Countess von Zeppelin)},
Publisher = {Kegan Paul},
Title = {The Logical Syntax of Language},
Year = 1937}

@book{SCHICKORE2006,
Address = {Dordrecht},
Author = {Schickore, J. and Steinle, F.},
Publisher = {Kluwer Academic Pub},
Title = {Revisiting discovery and justification: historical and philosophical perspectives on the context distinction},
Volume = {14},
Year = {2006}}

答案1

我认为唯一的方法是重新定义 cite 命令。在下面的例子中,我定义了一个名为 的新宏,uppercite它通过重新定义来格式化名称\mkbibnamelast

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
  \usebibmacro{uppercite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\newbibmacro*{uppercite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\usebibmacro{cite:label}%
        \setunit{\addspace}}
       {\def\mkbibnamelast##1{\MakeUppercase{##1}}\printnames{labelname}%
        \setunit{\nameyeardelim}}%
     \usebibmacro{cite:labelyear+extrayear}}
    {\usebibmacro{cite:shorthand}}}

完整的 MWE 为:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{CARNAP1935,
Address = {London},
Author = {Carnap, Rudolf},
Publisher = {Kegan Paul, Trench, Trubner \& Co.},
Title = {Philosophy and Logical Syntax},
Year = {1935}}

@book{CARNAP1937,
Address = {London},
Author = {Carnap, Rudolf},
Note = {Transl. Amethe Smeaton (Countess von Zeppelin)},
Publisher = {Kegan Paul},
Title = {The Logical Syntax of Language},
Year = 1937}

@book{SCHICKORE2006,
Address = {Dordrecht},
Author = {SCHICKORE, J. and STEINLE, F.},
Date-Added = {2012-07-19 08:53:43 +0000},
Date-Modified = {2013-03-09 19:03:37 +0000},
Publisher = {Kluwer Academic Pub},
Title = {Revisiting discovery and justification: historical and philosophical perspectives on the context distinction},
Volume = {14},
Year = {2006}}
\end{filecontents*}
\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[citestyle=authoryear,bibstyle=authortitle,labelnumber,natbib=true,firstinits=true,isbn=false,babel=other,language=brazilian,backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
  \usebibmacro{uppercite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\newbibmacro*{uppercite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\usebibmacro{cite:label}%
        \setunit{\addspace}}
       {\def\mkbibnamelast##1{\MakeUppercase{##1}}\printnames{labelname}%
        \setunit{\nameyeardelim}}%
     \usebibmacro{cite:labelyear+extrayear}}
    {\usebibmacro{cite:shorthand}}}

\begin{document}
\verb+\textcite{CARNAP1937}+\quad\textcite{CARNAP1937}


\verb+\parencite{CARNAP1935}+\quad\parencite{CARNAP1935}

\verb+\parencite{SCHICKORE2006}+\quad\parencite{SCHICKORE2006}

\verb+\parencite{CARNAP1935}\parencite{SCHICKORE2006}+\parencite{CARNAP1935}\parencite{SCHICKORE2006}

\verb+\parencite{CARNAP1935,SCHICKORE2006}+\parencite{CARNAP1935,SCHICKORE2006}

\printbibliography
\end{document}

在此处输入图片描述

答案2

适用于biblatex3.4 以上版本的替代解决方案是基于确定当前的“分隔符上下文”是否parencite

\makeatletter
\renewcommand*{\mkbibnamefamily}[1]{%
  \ifdefstring{\blx@delimcontext}{parencite}
    {\textsc{#1}}
    {#1}}
\makeatother

(是的,它使用了\textsc而不是 hideous \MakeUppercase,但当然它\MakeUppercase也可以用于。)

也可以看看大写和非大写引用

相关内容