在下面的 MWE 中,我想在第二张幻灯片上揭开图片的最后一部分。因此,我使用了 \only<2->{...}。使用 LaTeX->PS->PDF 进行编译时,一切正常。
但现在,我坚持使用 PDFLaTeX 和 auto-pst-pdf,因为我有很多图形 (.pdf) 需要包含。我使用了 pdflatex-autopstpdf.tcohttps://www.ctan.org/tex-archive/graphics/pstricks/pst-support?lang=de。
不幸的是,图片的最后一部分(\only<2->{...} 内)根本没有显示出来。我收到消息“Package pst-pdf 警告:'LaTeX1-pics.pdf' 包含 2 页”。有人能帮忙吗?
\documentclass[12pt,xcolor=pst]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{geometry}
\geometry{papersize={16cm,12cm}}
\usepackage{xcolor}
\usepackage{pst-all}
\begingroup
\catcode`\#=11
\gdef\autorotatonone{-dAutoRotatePages#/None}
\endgroup
\usepackage[pspdf={\autorotatonone}]{auto-pst-pdf}
\begin{document}
\begin{frame}
\centering
\resizebox{0.6\textwidth}{!}{
\begin{pspicture}[showgrid=false]
\psline[linewidth=1.5pt](0,-2.5)(0,-0.3)
\psline[linewidth=1.5pt](0,0.3)(0,2.5)(6,2.5)(6,-2.5)(0,-2.5)
\rput[l]{90}(-0.3,0.5){\small Photoplate}
%Ion
\psline[linewidth=0.6pt]{->}(-0.7,0)(-0.2,0)
\pscircle[fillstyle=solid,fillcolor=green,linewidth=0.4pt](-0.7,0){0.1}
\rput[c](-0.7,0){\tiny\boldmath$+$}
%Path which is supposed to show up by second slide
\only<2->{\psarc[linecolor=gray,linewidth=0.7pt](0,1){1}{-90}{90}
\rput[r](0.6,1.1){\scriptsize$m_1$}}
\end{pspicture}
}
\end{frame}
\end{document}
答案1
使用以下命令运行该文档xelatex
:
\documentclass[12pt]{beamer}
\usepackage[ngerman]{babel}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{geometry}
\geometry{papersize={16cm,12cm}}
\usepackage{xcolor}
\usepackage{pst-all}
\begin{document}
\begin{frame}
\centering
\resizebox{0.6\textwidth}{!}{%
\begin{pspicture}(0,-3)(6,3)
\psline[linewidth=1.5pt](0,-2.5)(0,-0.3)
\psline[linewidth=1.5pt](0,0.3)(0,2.5)(6,2.5)(6,-2.5)(0,-2.5)
\rput[l]{90}(-0.3,0.5){\small Photoplate}
%Ion
\psline[linewidth=0.6pt]{->}(-0.7,0)(-0.2,0)
\pscircle[fillstyle=solid,fillcolor=green,linewidth=0.4pt](-0.7,0){0.1}
\rput[c](-0.7,0){\tiny\boldmath$+$}
%Path which is supposed to show up by second slide
\only<2->{\psarc[linecolor=gray,linewidth=0.7pt](0,1){1}{-90}{90}
\rput[r](0.6,1.1){\scriptsize$m_1$}}
\end{pspicture}%
}
\end{frame}
\end{document}