Beamer 脚注减少右边距

Beamer 脚注减少右边距

如何才能减少 beamer 脚注的右边距,而不改变文本边距?

理想情况下,脚注应该大约在页码结束的位置结束,以便对于下面的示例,年份仍然在第一行。

如果有办法让脚注忽略文本边距,那么就会有足够的空间,但我不知道如何实现这一点,如果能得到任何帮助我将不胜感激。

在此处输入图片描述


梅威瑟:

\documentclass{beamer}

\usepackage[hang,ragged]{footmisc}

\usepackage[backend=biber, maxnames=2, style=lncs]{biblatex}
\addbibresource{biblatex-examples.bib} 

% custom citations (only author, title, year, DOI / arxiv):
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
  \printnames[given-family]{author}:%
  \setunit{\addspace}%
  \printfield{title}%
  \nobreak\setunit{\addspace}% discourage break here
  \printfield{year}%
  \iffieldundef{doi}
    {\iffieldundef{eprint}
      {} % no DOI or eprint, don't add the penalty
      {\penalty-300 \setunit{\addspace}%
       \printfield{eprint}}}
    {\penalty-300 \setunit{\addspace}%
     \printfield{doi}}}
{\multicitedelim}
{\usebibmacro{postnote}}


\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]{}

\usepackage{lipsum}

\begin{document}

\begin{frame}
  Hello World!\footcite{baez/article}
  \lipsum[1-1]
\end{frame}

\end{document}

答案1

除了使用footmisc软件包之外,您还可以调整此答案https://tex.stackexchange.com/a/169775/36296。脚注框的大小可以通过文本宽度 + 右边距(1cm)-脚注标记宽度(1.8em)-页码右边空间(约为1em,但实际上会更小一些,因为页码使用小字体,如果您愿意,可以微调这个值)来计算。

\documentclass{beamer}


%\usepackage[hang,ragged]{footmisc}

\usepackage[backend=biber, maxnames=2, style=lncs]{biblatex}
\addbibresource{biblatex-examples.bib} 

% custom citations (only author, title, year, DOI / arxiv):
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
  \printnames[given-family]{author}:%
  \setunit{\addspace}%
  \printfield{title}%
  \nobreak\setunit{\addspace}% discourage break here
  \printfield{year}%
  \iffieldundef{doi}
    {\iffieldundef{eprint}
      {} % no DOI or eprint, don't add the penalty
      {\penalty-300 \setunit{\addspace}%
       \printfield{eprint}}}
    {\penalty-300 \setunit{\addspace}%
     \printfield{doi}}}
{\multicitedelim}
{\usebibmacro{postnote}}

\makeatletter
\renewcommand<>\beamer@framefootnotetext[1]{%
  \global\setbox\beamer@footins\vbox{%
    \hsize\framewidth
    \textwidth\hsize
    \columnwidth\hsize
    \unvbox\beamer@footins
    \reset@font\footnotesize
    \@parboxrestore
    \protected@edef\@currentlabel
         {\csname p@footnote\endcsname\@thefnmark}%
    \color@begingroup
      \uncover#2{\@makefntext{%
        \rule\z@\footnotesep\ignorespaces\parbox[t]{\dimexpr\textwidth+1cm-1.8em-1em}{#1\@finalstrut\strutbox}\vskip1sp}}%
    \color@endgroup}%
}
\makeatother

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]{}

\usepackage{lipsum}

\setbeamertemplate{footnote}
{
  \parindent 1em\noindent%
  \raggedright
  \hbox to 1.8em{\insertfootnotemark}\insertfootnotetext\par%
}


\begin{document}

\begin{frame}
  Hello World!\footcite{baez/article}
  \lipsum[1-1]
\end{frame}

\end{document}

在此处输入图片描述

如果您只想将日期保留在同一行,则可以\raggedright从脚注模板中删除。在我看来,这比将日期突出到页边距中看起来更好。

\documentclass{beamer}


%\usepackage[hang,ragged]{footmisc}

\usepackage[backend=biber, maxnames=2, style=lncs]{biblatex}
\addbibresource{biblatex-examples.bib} 

% custom citations (only author, title, year, DOI / arxiv):
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
  \printnames[given-family]{author}:%
  \setunit{\addspace}%
  \printfield{title}%
  \nobreak\setunit{\addspace}% discourage break here
  \printfield{year}%
  \iffieldundef{doi}
    {\iffieldundef{eprint}
      {} % no DOI or eprint, don't add the penalty
      {\penalty-300 \setunit{\addspace}%
       \printfield{eprint}}}
    {\penalty-300 \setunit{\addspace}%
     \printfield{doi}}}
{\multicitedelim}
{\usebibmacro{postnote}}

\makeatletter
\renewcommand<>\beamer@framefootnotetext[1]{%
  \global\setbox\beamer@footins\vbox{%
    \hsize\framewidth
    \textwidth\hsize
    \columnwidth\hsize
    \unvbox\beamer@footins
    \reset@font\footnotesize
    \@parboxrestore
    \protected@edef\@currentlabel
         {\csname p@footnote\endcsname\@thefnmark}%
    \color@begingroup
      \uncover#2{\@makefntext{%
        \rule\z@\footnotesep\ignorespaces\parbox[t]{\dimexpr\textwidth-1.8em}{#1\@finalstrut\strutbox}\vskip1sp}}%
    \color@endgroup}%
}
\makeatother

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]{}

\usepackage{lipsum}

\setbeamertemplate{footnote}
{
  \parindent 1em\noindent%
%  \raggedright
  \hbox to 1.8em{\insertfootnotemark}\insertfootnotetext\par%
}


\begin{document}

\begin{frame}
  Hello World!\footcite{baez/article}
  \lipsum[1-1]
\end{frame}

\end{document}

在此处输入图片描述

相关内容