Beamer 中 \footcite 的定制

Beamer 中 \footcite 的定制

我正在尝试自定义 Beamer 演示文稿中脚注的引文外观。我希望它们采用个人格式(姓氏、名字的首字母、期刊和年份),字体小且为斜体。

由于我不是专家,我几乎成功地结合了 Stackexchange 的提示,biblatex但我仍遇到两件事情:

  • 引文前的点

  • 大写字母的名字

这是我的 MWE

\documentclass{beamer}
\usepackage[french]{babel}
\usepackage{filecontents}

\begin{filecontents}{jobname.bib}
@article{testArt,
 AUTHOR = {Author, Aa},
  TITLE = {A long title illustrating the need to remove the title from footnote citations, at least in Presentations},
JOURNAL = {Lorem Ipsum Stud.},
 VOLUME = {15},
  PAGES = {1--20},
   YEAR = {1999},
    URL = {https://math.stackexchange.com},
}
@Article{fakearXiv,
     AUTHOR = {Buthor, Bb},
      TITLE = {Not a real arXiv article},
      JOURNAL = {Lorem Ipsum Stud.},
 VOLUME = {15},
  PAGES = {1--20},
   YEAR = {1999},
    URL = {https://math.stackexchange.com},
}
\end{filecontents}

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

\addbibresource{jobname.bib}

\DeclareCiteCommand{\footcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {%
   %\setunit{\addnbspace}
   \printnames{author}%
       %\setunit{\labelnamepunct}
   \printfield{journaltitle}{}
   %\newunit
   \printfield{year}}
  {\addsemicolon\space}
 {\usebibmacro{postnote}}

  \newcommand\footnotenonum[1]{%
  \begingroup
  \renewcommand\thefootnote{}\footnote{#1}%
  \addtocounter{footnote}{-1}%
  \endgroup
}

\let\oldfootnote\footnote
\renewcommand{\footnote}[1]{\oldfootnote{\itshape#1}}
\let\footnotesize\tiny

\makeatletter
\renewrobustcmd{\blx@mkbibfootnote}[2]{%
  \iftoggle{blx@footnote}
    {\blx@warning{Nested notes}%
     \addspace\mkbibparens{#2}}
    {\unspace
     \ifnum\blx@notetype=\tw@
       \expandafter\@firstoftwo
     \else
       \expandafter\@secondoftwo
     \fi
       {\csuse{blx@theendnote#1}{\protecting{\blxmkbibnote{end}{#2}}}}
       {\csuse{footnotenonum#1}{\protecting{\blxmkbibnote{foot}{#2}}}}}}
\makeatother


\begin{document}
\begin{frame}
  \frametitle{essai}
  \footcite{testArt}
  \footcite{fakearXiv}
\end{frame}
\end{document}

我知道我的代码可能不够高效(并且不够干净)但这就是我所得到的......在此处输入图片描述

答案1

  • 我们的 biblatex 专家 @moewe 建议他的评论的定义如下\footcite

    \DeclareCiteCommand{\footcite}[\mkbibfootnote]
      {\usebibmacro{prenote}}
      {\printnames[family-given]{labelname}%
       \newunit
       \printfield{journaltitle}%
       \newunit
       \printlabeldateextra}
      {\addsemicolon\space}
      {\usebibmacro{postnote}}
    
  • 法语模块可biblatex自动将姓氏设置为小写,可以使用以下方法关闭

    \DefineBibliographyExtras{french}{\restorecommand\mkbibnamefamily}
    

    也可以看看在 biblatex 中保留小写

  • 要更改脚注的大小和字体形状,您只需设置相应的投影仪字体:

    \setbeamerfont{footnote}{size=\tiny,shape=\itshape}
    
  • 要获得未编号的脚注,您可以重新定义脚注模板:

    \setbeamertemplate{footnote}{%
      \parindent 1em\noindent%
      \raggedright
      \insertfootnotetext\par%
    }
    
  • 还请注意,firstinits已被弃用,应由 替代giveninits


\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{csquotes}
\usepackage{lmodern}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{testArt,
 AUTHOR = {Author, Aa},
  TITLE = {A long title illustrating the need to remove the title from footnote citations, at least in Presentations},
JOURNAL = {Lorem Ipsum Stud.},
 VOLUME = {15},
  PAGES = {1--20},
   YEAR = {1999},
    URL = {https://math.stackexchange.com},
}
@Article{fakearXiv,
     AUTHOR = {Buthor, Bb},
      TITLE = {Not a real arXiv article},
      JOURNAL = {Lorem Ipsum Stud.},
 VOLUME = {15},
  PAGES = {1--20},
   YEAR = {1999},
    URL = {https://math.stackexchange.com},
}
\end{filecontents}

\usepackage[style=authoryear,giveninits=true,uniquename=init]{biblatex}

\addbibresource{\jobname.bib}

\DefineBibliographyExtras{french}{\restorecommand\mkbibnamefamily}

\DeclareCiteCommand{\footcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\printnames[family-given]{labelname}%
   \newunit
   \printfield{journaltitle}%
   \newunit
   \printlabeldateextra}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}

\makeatletter
\def\@makefnmark{}
\makeatother      

\setbeamerfont{footnote}{size=\tiny,shape=\itshape}

\setbeamertemplate{footnote}{%
  \parindent 1em\noindent%
  \raggedright
  \insertfootnotetext\par%
}

\begin{document}
\begin{frame}
  \frametitle{essai}
  \footcite{testArt}
  \footcite{fakearXiv}
\end{frame}
\end{document}

在此处输入图片描述

相关内容