如何将图像放大到页面顶部并使内容在投影仪中换行?

如何将图像放大到页面顶部并使内容在投影仪中换行?

我公司的 CI 希望在某些但不是所有框架(目录/部分启动器)的右侧显示图片(PNG)

我的问题是,图片无法到达框架顶部,上面总是有一些空白。我已经找到了一些关于拉伸图像的答案,但我的图片不是某种背景。

期望的输出是:

期望的输出

以下是我目前所掌握的信息:

\documentclass[aspectratio=169,hyperref={unicode},t]{beamer}

\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{graphs}
\usepackage{graphicx}
\usepackage{color}
\usepackage{wrapfig}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{navigation}{}
\setbeamertemplate{headerline}{}

\setbeamertemplate{footline}{
  \leavevmode\hbox to \paperwidth{%
    \color{white}{\hfill some footer text%
        \hfill \insertframenumber{} / \inserttotalframenumber}
        \hspace{2em}%
    }%
  \vskip1.5ex%
}{}
\setbeamertemplate{background canvas}{%
    \begin{tikzpicture}
    \clip (0,0) rectangle (\paperwidth,\paperheight);
    \fill[gray,thin] (0.0,0.0) rectangle (\paperwidth,3ex);
    \end{tikzpicture}
}

\begin{document}

\section{Test}
\subsection{Test Test}
\begin{wrapfigure}{r}{.493\textwidth}
    \hbox to .35\paperwidth{
        \vbox to \paperheight{
            %% this will be replaced by a includegraphics:
            \tikz \draw [red,anchor=south east,ultra thick] (0,0) rectangle (.462\textwidth,-.935\textheight);
            %% how to enlagre until top of page? 
        }
    }
\end{wrapfigure}

\begin{frame}[t]{how to enlarge image until top of page making content wrap?}
    \begin{itemize}
        \item content must wrap before image (works for title already)
        \item image must end with top and right edge of page
        \item image must connect to gray bar drawn in background\\
              may ''slip'' behind it but must not overlap amd have no gap between
    \end{itemize}
\end{frame}

\begin{wrapfigure}{r}{.493\textwidth}
    \hbox to .35\paperwidth{
        \vbox to \paperheight{
            %% this will be replaced by a includegraphics:
            \tikz \draw [red,anchor=south east,ultra thick] (0,0) rectangle (.462\textwidth,-.935\textheight);
            %% how to enlagre until top of page? 
        }
    }
\end{wrapfigure}

\begin{frame}[t]{why does minipage move the image?}
    \begin{minipage}[t][\textheight][t]{.4\textwidth}
        \begin{itemize}
            \item content must wrap before image (works for title already)
            \item image must end with top and right edge of page
            \item image must connect to gray bar drawn in background\\
                  may ''slip'' behind it but must not overlap amd have no gap between
        \end{itemize}
    \end{minipage}
\end{frame}

\end{document}

正如您所看到的,我尝试解决换行问题,minipage但是这使我最初的问题变得更加严重......

当前的情况如下:

图像电流输出太低

答案1

事实证明,你可以将 放在frame里面minipage而不移动它。将图像放在小页面的右侧相对容易。

第一页演示了文本区域和页面大小之间的差异,因此创建了\beamermargin。 ( 中可能已经定义了长度beamer,欢迎您搜索源代码以尝试找到它。)\hspace{-\beamermargin}用于将图像一直移动到页面的右边缘。

值得注意的是\tikz\includegraphics通常会变得比预期的稍微大一些,因此一般来说人们可能需要使用.99\textheight以避免创建空白页。

\documentclass[aspectratio=169,hyperref={unicode},t]{beamer}

\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{graphs}
\usepackage{graphicx}
\usepackage{color}
\usepackage{wrapfig}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{navigation}{}
\setbeamertemplate{headerline}{}

\setbeamertemplate{footline}{
  \leavevmode\hbox to \paperwidth{%
    \color{white}{\hfill some footer text%
        \hfill \insertframenumber{} / \inserttotalframenumber}
        \hspace{2em}%
    }%
  \vskip1.5ex%
}{}
\setbeamertemplate{background canvas}{%
    \begin{tikzpicture}
    \clip (0,0) rectangle (\paperwidth,\paperheight);
    \fill[gray,thin] (0.0,0.0) rectangle (\paperwidth,3ex);
    \end{tikzpicture}
}
\newlength{\beamermargin}
\setlength{\beamermargin}{\dimexpr 0.5\paperwidth-0.5\textwidth}

\begin{document}
\rule{\textwidth}{\textheight}

\begin{minipage}[b][\textheight][t]{.5\textwidth}
  \begin{frame}[t]{how to enlarge image until top of page making content wrap?}
    \begin{itemize}
        \item content must wrap before image (works for title already)
        \item image must end with top and right edge of page
        \item image must connect to gray bar drawn in background\\
              may ''slip'' behind it but must not overlap amd have no gap between
    \end{itemize}
    \vfill
    \rule{\textwidth}{10pt}
  \end{frame}
\end{minipage}\hfill
\rule{.35\paperwidth}{\textheight}%
\hspace{-\beamermargin}

\end{document}

演示


此解决方案将图像叠加在页面上。需要运行两次才能正确定位。环境wraptext与此类似,minipage但允许分页。

\documentclass[aspectratio=169,hyperref={unicode},t]{beamer}

\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{graphs}
\usepackage{graphicx}
\usepackage{color}

\usepackage{lipsum}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{navigation}{}
\setbeamertemplate{headerline}{}

\setbeamertemplate{footline}{
  \leavevmode\hbox to \paperwidth{%
    \color{white}{\hfill some footer text%
        \hfill \insertframenumber{} / \inserttotalframenumber}
        \hspace{2em}%
    }%
  \vskip1.5ex%
}{}
\setbeamertemplate{background canvas}{%
    \begin{tikzpicture}
    \clip (0,0) rectangle (\paperwidth,\paperheight);
    \fill[gray,thin] (0.0,0.0) rectangle (\paperwidth,3ex);
    \end{tikzpicture}
}
\newenvironment{wraptext}[1][.35\paperwidth]% #1 is width of image (optional)
{\addtolength{\textwidth}{-#1}\hsize=\textwidth}{}

\begin{document}
\tikz[remember picture,overlay]{\node[below left,inner sep=0pt] at (current page.north east)
{\includegraphics[width=.35\paperwidth,height=\textheight]{example-image}};}% no gap
\begin{wraptext}
\lipsum[1]
\end{wraptext}
\end{document}

演示

相关内容