如何才能获得与图像大小完全相同的 PDF 页面?

如何才能获得与图像大小完全相同的 PDF 页面?

我想要一张只有一张图片的幻灯片。没有导航,没有边框。什么都没有,只有图片。如果这意味着 PDF 页面的大小与其他页面不同,那对我来说没问题。

目前,我最好的尝试是这样的:

在此处输入图片描述

最小示例

我尝试发出一个\framedgraphiconly命令:

\documentclass[hyperref={pdfpagelabels=false},usepdftitle=false]{beamer}
\usetheme{Frankfurt} % see http://deic.uab.es/~iblanes/beamer_gallery/index_by_theme.html as fallback
\usecolortheme{beaver}
\usefonttheme{professionalfonts}
\usepackage{hyperref}
\usepackage[utf8]{inputenc} % this is needed for german umlauts
\usepackage[english]{babel} % this is needed for german umlauts
\usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf
\usepackage{tikz}

\newcommand {\framedgraphiconly}[1] {
    \setbeamertemplate{navigation symbols}{}
    \begin{frame}[plain]
        \begin{center}
            \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{#1}
        \end{center}
        %\begin{tikzpicture}[remember picture,overlay]
            %\node[at=(current page.center)] {
                %\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{#1}
            %};
        %\end{tikzpicture}
    \end{frame}
}

\beamertemplatenavigationsymbolsempty

% Begin:Move navigation from top to bottom
\setbeamertemplate{navigation symbols}{}
\makeatletter
\setbeamertemplate{footline}
{%
  \pgfuseshading{beamer@barshade}%
  \ifbeamer@sb@subsection%
    \vskip-9.75ex%
  \else%
    \vskip-7ex%
  \fi%
  \begin{beamercolorbox}[ignorebg,ht=2.25ex,dp=3.75ex]{section in head/foot}
    \insertnavigation{\paperwidth}
  \end{beamercolorbox}%
  \ifbeamer@sb@subsection%
    \begin{beamercolorbox}[ignorebg,ht=2.125ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
      \usebeamerfont{subsection in head/foot}\insertsubsectionhead
    \end{beamercolorbox}%
  \fi%
}%
\setbeamertemplate{headline}{%
}
\makeatother
% End:Move navigation from top to bottom


\begin{document}

\title{Art in Machine Learning}
\subtitle{\href{https://github.com/MartinThoma/}{github.com/MartinThoma/}}
\author{Martin Thoma}
\date{15. Januar 2016}
\subject{Machine Learning}

\frame{\titlepage}

\section{Examples}
\subsection{Examples}
\framedgraphiconly{0099.jpg}

\section{ML-Basics}
\subsection{ML-Basics}

\begin{frame}{Was ist Machine Learning?}
    \begin{block}{Definition by Tom Mitchell: ML}
        A computer program is said to learn from \textbf{experience} $E$ with
        respect to some class of \textbf{tasks} $T$ and \textbf{performance
        measure} $P$, if its performance at tasks in $T$, as measured by $P$,
        improves with experience $E$.
    \end{block}
\end{frame}

\end{document}

如果你想要图片的话,它位于https://github.com/MartinThoma/LaTeX-examples/tree/master/presentations/ImageOnly

问题

如何才能获得与图像大小完全相同的 PDF 页面?在我的示例中:如何在不改变图像/图像显示的纵横比的情况下去除白色边框?(并且两边留有空白?)

答案1

incgraph

在此处输入图片描述

做你想做的事:

在此处输入图片描述

\documentclass[hyperref={pdfpagelabels=false},usepdftitle=false]{beamer}
\usetheme{Frankfurt} % see http://deic.uab.es/~iblanes/beamer_gallery/index_by_theme.html as fallback
\usecolortheme{beaver}
\usefonttheme{professionalfonts}
\usepackage{hyperref}
\usepackage[utf8]{inputenc} % this is needed for german umlauts
\usepackage[english]{babel} % this is needed for german umlauts
\usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf
\usepackage{tikz}
\usepackage{incgraph}

\newcommand {\framedgraphiconly}[1] {
    \setbeamertemplate{navigation symbols}{}
    \begin{frame}[plain]
        \begin{center}
            \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{#1}
        \end{center}
        %\begin{tikzpicture}[remember picture,overlay]
            %\node[at=(current page.center)] {
                %\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{#1}
            %};
        %\end{tikzpicture}
    \end{frame}
}

\beamertemplatenavigationsymbolsempty

% Begin:Move navigation from top to bottom
\setbeamertemplate{navigation symbols}{}
\makeatletter
\setbeamertemplate{footline}
{%
  \pgfuseshading{beamer@barshade}%
  \ifbeamer@sb@subsection%
    \vskip-9.75ex%
  \else%
    \vskip-7ex%
  \fi%
  \begin{beamercolorbox}[ignorebg,ht=2.25ex,dp=3.75ex]{section in head/foot}
    \insertnavigation{\paperwidth}
  \end{beamercolorbox}%
  \ifbeamer@sb@subsection%
    \begin{beamercolorbox}[ignorebg,ht=2.125ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
      \usebeamerfont{subsection in head/foot}\insertsubsectionhead
    \end{beamercolorbox}%
  \fi%
}%
\setbeamertemplate{headline}{%
}
\makeatother
% End:Move navigation from top to bottom


\begin{document}

\title{Art in Machine Learning}
\subtitle{\href{https://github.com/MartinThoma/}{github.com/MartinThoma/}}
\author{Martin Thoma}
\date{15. Januar 2016}
\subject{Machine Learning}

\frame{\titlepage}

\section{Examples}
\subsection{Examples}
%\framedgraphiconly{0099.jpg}

\incgraph{0099.jpg}

\section{ML-Basics}
\subsection{ML-Basics}

\begin{frame}{Was ist Machine Learning?}
    \begin{block}{Definition by Tom Mitchell: ML}
        A computer program is said to learn from \textbf{experience} $E$ with
        respect to some class of \textbf{tasks} $T$ and \textbf{performance
        measure} $P$, if its performance at tasks in $T$, as measured by $P$,
        improves with experience $E$.
    \end{block}
\end{frame}

\end{document}

相关内容