4up 的 Beamer 幻灯片,带有 pdf 书签

4up 的 Beamer 幻灯片,带有 pdf 书签

我使用以下脚本创建幻灯片的 4up 版本:

#!/bin/bash
# beamer2handout is just a small convenient interface to pdfnup
# (http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic/firth/software/pdfjam/)
#
# beamer2handout creates 4up or 6up a4-sized pdf docs of your
# input pdf (intented for and tested with latex-beamer docs)
# $Id: beamer2handout 604 2005-04-27 11:00:56Z adam $
# by Arthur van dam, useful hints by David Firth and Eelco Dolstra.

# Customize this to your own needs:
pdfnup="pdfnup";
addArgs="";

usagetext=\
"Usage:
  $ beamer2handout (input.pdf) [(4up|6up) [output.pdf]]"

helptext=\
"beamer2handout converts a (latex-beamer) pdf file to A4-sized handouts.
One can choose for either four (default) or six slides on one page.
$usagetext"

if test -n "${1}"; then
        case "${1}" in
                *".pdf");;
                "--help") echo "$helptext";
                          exit 0;;
                *) echo "beamer2handout: first argument must be input pdf filename.";
                   echo "$usagetext";
                   exit 1;;
        esac
        inFile=${1};
else
        echo "beamer2handout: Missing arguments";
    echo "$usagetext";
        exit 1;
fi
if test -n "${2}"; then
        case "${2}" in
                "4up") nup="2x2"; orient="landscape";;
                "6up") nup="2x3"; orient="portrait";;
                *) nup="2x2"; orient="landscape";
                   echo "beamer2handout warning: ignoring invalid 2nd argument '${2}'.
                         Defaulting to 2x2.";;
        esac
else
        nup="2x2"; orient="landscape";
fi
if test -n "${3}"; then
        case "${3}" in
                *".pdf") addArgs="$addArgs --outfile ${3}";;
                *) echo "beamer2handout: Third argument (when used) should be output pdf filename.";
                   echo "$usagetext";
                   exit 1;;
        esac
fi

# Use array instead of string for nupCmd, to allow argvalues with spaces.
nupCmd=\
($pdfnup $inFile --paper a4paper --nup $nup --orient $orient \
--noautoscale false --scale 0.93 --delta "3mm 3mm" --frame true \
$addArgs);

# Now run it!
echo "beamer2handout: calling pdfnup:
${nupCmd[@]}";

"${nupCmd[@]}";

问题是,由此生成的 PDF 不包含书签。有没有办法让 4up 带有书签?

答案1

如果您要使用pgfpages,您可以免费获得书签。边框、方向等都可以调整。

\documentclass{beamer}

\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}

\begin{document}

\section{1}\frame{1}
\section{2}\frame{2}
\section{3}\frame{3}
\section{4}\frame{4}
\section{5}\frame{5}
\section{6}\frame{6}
\section{7}\frame{7}
\section{8}\frame{8}
\section{9}\frame{9}
\section{10}\frame{10}


\end{document}

相关内容