我尝试使用 \ifthenelse 启用/禁用我的 3D 视图的一些选项。
\documentclass[fontsize=12pt,paper=a4]{scrbook}
\usepackage{media9}
\usepackage{graphicx}
\usepackage{ifthen}
\begin{document}
\begin{figure}[H]
\scalebox{.5}{
\includemedia[
width=1\linewidth,
height=0.56\linewidth,
3Daac=60.000001669652114,
3Droll=-37.47084467351308,
3Dc2c=-0.012050606310367584 -0.0156868789345026 0.9998043775558472,
3Dcoo=38.000003814697266 21.499998092651367 -0.7999938726425171,
3Droo=59.6515823704357,
{\ifthenelse{\boolean{myDraft}}{3Dmenu}{}}]
{\includegraphics{./_Images/Transceiver.png}}{./_CAD/TransceiverMC.prc}}
\end{figure}
\end{document}
但是我收到了错误:未知选项 \ifthenelse
如何根据我的草稿变量?是否有可能在 \includemedia 调用之外设置该选项?
编辑:
我发现这问题,但是就我而言,我无法处理它。
答案1
由于评论太长:问题可能是它\ifthenelse
不能完全扩展。
可能有效的是执行测试,将新选项存储在宏中,然后在中添加该选项\edef
:
\def\myopt{}
\ifthenelse{\boolean{myDraft}}{\def\myopt{3Dmenu}}{}
\edef\temp{\unexpanded{
\includemedia[
width=1\linewidth,
height=0.56\linewidth,
3Daac=60.000001669652114,
3Droll=-37.47084467351308,
3Dc2c=-0.012050606310367584 -0.0156868789345026 0.9998043775558472,
3Dcoo=38.000003814697266 21.499998092651367 -0.7999938726425171,
3Droo=59.6515823704357,}
\myopt]
}\temp{\includegraphics{./_Images/Transceiver.png}}{./_CAD/TransceiverMC.prc}