旋转图片而不使中心偏移

发布于 2024-07-04 17:52:21

以下例子中,旋转图片会导致图片的中心偏移,希望一直保持中心的位置,该怎么做?

\documentclass{beamer}
\usepackage{tikz}

\usebackgroundtemplate%
{\tikz\node {\includegraphics[width=0.5\paperwidth, angle=\value{page}, origin=c]{example-image}};}

\logo{\includegraphics[width=2cm, angle=\arabic{page}, origin=c]{example-image}}


\begin{document}

\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}

\end{document}

另一个小问题是:上述 angle 的参数过于单调,若是想写成一个表达式,如 3*\arabic{page} 之类的,该怎么做?

查看更多

关注者
0
被浏览
212
雾月
雾月 2024-07-05
这家伙很懒,什么也没写!

\noderotate 键。

\documentclass{beamer}
\usepackage{tikz}

\usebackgroundtemplate{\begin{tikzpicture}
  \draw[use as bounding box] (0,0) rectangle (\paperwidth,\paperheight);
  \node[inner sep=0pt,outer sep=0pt,rotate=3*\value{page}] at(.25\paperwidth,.75\paperheight) 
    {\pgfimage[width=0.5\paperwidth]{example-image}};
  \end{tikzpicture}}

\logo{\includegraphics[width=2cm, angle=\arabic{page}, origin=c]{example-image}}

\begin{document}

\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}
\frame{\arabic{page}}

\end{document}
1 个回答

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览