APA 样式引用中括号颜色错误

APA 样式引用中括号颜色错误

我正在制作一个 beamer 演示文稿(Madrid主题)并使用 apa 样式的引用。我注意到引用的格式不统一,即,只有围绕年份的括号中的一个是彩色的。

在此处输入图片描述

第一个是用 \citep{} 命令得到的,我觉得没问题。第二个是用 \cite{} 命令得到的,但括号的颜色不正确。

为什么?这两个颜色中哪一个颜色“错误”?我该如何修复?

类似的问题被问到这里,但从未得到答复。以下是一些可以重现的代码

\documentclass[aspectratio=169]{beamer}

\usetheme{Madrid}
\hypersetup{
    unicode=true,
    pdftoolbar=true,
    pdfmenubar=true,
    pdffitwindow=false,
    pdfnewwindow=true,
    colorlinks=true,
    linkcolor=,
    citecolor=magenta,
    filecolor=magenta,
    urlcolor=cyan
}

%\setbeameroption{show notes on second screen=right}

\usepackage[natbibapa]{apacite}

% ------------  Information on the title page  --------------------
\title[]{\bf{My title}}

\author[]{Me\inst{1}}
\institute[]{Super cool university, Super cool country\inst{1}}
\date[Important conference]{Today}

%------------------------------------------------------------

%------------------------------------------------------------
%The next block of commands puts the table of contents at the 
%beginning of each section and highlights the current section:

\AtBeginSection[]
{
    \begin{frame}
        \frametitle{Outline}
        \tableofcontents[currentsection]
    \end{frame}
}
%------------------------------------------------------------

\begin{document}

\frame{\titlepage}  % Creates title page

%---------   table of contents after title page  ------------
\begin{frame}
    \frametitle{Outline}
    \tableofcontents
\end{frame}
%---------------------------------------------------------

\section{Introduction}

\begin{frame}{Introduction}
\citep{Hiranuma1999a}
\cite{Hiranuma1999a}
\end{frame}

\begin{frame}[allowframebreaks]{Bibliography}
    \medskip
    \bibliographystyle{apacite}
    \bibliography{bibliography.bib}
\end{frame}

\end{document}

以及参考书目

@article{Hiranuma1999a,
    title = {Syntactic difficulty in {E}nglish and {J}apanese: {A} textual study},
    author = {Hiranuma, So},
    journal = {UCL Working Papers in Linguistics},
    year = {1999},
    volume = {11},
    pages = {309--322}
}

编译命令

pdflatex main.tex
bibtex main
pdflatex main.tex
pdflatex main.tex

我正在全新安装 Ubuntu 22.04。LaTeX 是使用以下命令安装的

$ sudo apt install texlive-full

版本pdflatex

pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian)
kpathsea version 6.3.4/dev
Copyright 2021 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.03

我也尝试xelatexlualatex

XeTeX 3.141592653-2.6-0.999993 (TeX Live 2022/dev/Debian)
kpathsea version 6.3.4/dev
Copyright 2021 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 70.1; using 70.1
Compiled with zlib version 1.2.11; using 1.2.11
Compiled with FreeType2 version 2.11.1; using 2.11.1
Compiled with Graphite2 version 1.3.14; using 1.3.14
Compiled with HarfBuzz version 2.7.4; using 2.7.4
Compiled with libpng version 1.6.37; using 1.6.37
Compiled with pplib version v2.05 less toxic i hope
Compiled with fontconfig version 2.13.1; using 2.13.1

答案1

来自的诀窍https://tex.stackexchange.com/a/134129/36296在这里也适用:

\documentclass[aspectratio=169]{beamer}

\usetheme{Madrid}
\hypersetup{
    unicode=true,
    pdftoolbar=true,
    pdfmenubar=true,
    pdffitwindow=false,
    pdfnewwindow=true,
    colorlinks=true,
    linkcolor=,
    citecolor=magenta,
    filecolor=magenta,
    urlcolor=cyan
}

%\setbeameroption{show notes on second screen=right}

\usepackage[natbibapa]{apacite}

% ------------  Information on the title page  --------------------
\title[]{\bf{My title}}

\author[]{Me\inst{1}}
\institute[]{Super cool university, Super cool country\inst{1}}
\date[Important conference]{Today}

\let\oldbibitem=\bibitem
\renewcommand{\bibitem}[2][]{\label{#2}\oldbibitem[#1]{#2}}
\let\oldcite=\cite
\renewcommand\cite[1]{\hypersetup{linkcolor=magenta} \hyperlink{#1}{\oldcite{#1}}}
\let\oldcitep=\citep
\renewcommand\citep[1]{\hypersetup{linkcolor=magenta}\hyperlink{#1}{\oldcitep{#1}}}
\let\oldciteauthor=\citeauthor
\renewcommand\citeauthor[1]{\hypersetup{linkcolor=magenta}\hyperlink{#1}{\oldciteauthor{#1}}} 



\begin{filecontents*}[overwrite]{\jobname.bib}
@article{Hiranuma1999a,
    title = {Syntactic difficulty in {E}nglish and {J}apanese: {A} textual study},
    author = {Hiranuma, So},
    journal = {UCL Working Papers in Linguistics},
    year = {1999},
    volume = {11},
    pages = {309--322}
}
\end{filecontents*}

%------------------------------------------------------------

%------------------------------------------------------------
%The next block of commands puts the table of contents at the 
%beginning of each section and highlights the current section:

\AtBeginSection[]
{
    \begin{frame}
        \frametitle{Outline}
        \tableofcontents[currentsection]
    \end{frame}
}
%------------------------------------------------------------

\begin{document}

\frame{\titlepage}  % Creates title page

%---------   table of contents after title page  ------------
\begin{frame}
    \frametitle{Outline}
    \tableofcontents
\end{frame}
%---------------------------------------------------------

\section{Introduction}

\begin{frame}{Introduction}
\citep{Hiranuma1999a}
\cite{Hiranuma1999a}
\end{frame}

\begin{frame}[allowframebreaks]{Bibliography}
    \medskip
    \bibliographystyle{apacite}
    \bibliography{\jobname}
\end{frame}

\end{document}

在此处输入图片描述

相关内容