我刚开始学习 beamer,发现\usepackage[turkish]{babel} 与 \includegraphics 不一致这个问题适用于投影机,但\shorthandoff{=}
解决方案无效。有人有其他解决方案吗?谢谢。
\documentclass{beamer}
\mode<presentation>
\usepackage[utf8]{inputenc}
\usepackage[turkish]{babel}
\usepackage{graphicx}
\begin{document}
\begin{frame}
\begin{figure}
\centering
\shorthandoff{=}
\includegraphics[scale=0.3]{resimler/stmornek2.png}
\shorthandon{=}
\end{figure}
\end{frame}
\end{document}
答案1
如果将命令移到框架之外,它就会起作用:
\documentclass{beamer}
\mode<presentation>
\usepackage[turkish]{babel}
\usepackage{graphicx}
\begin{document}
\shorthandoff{=}
\begin{frame}
\begin{figure}
\centering
\includegraphics[scale=0.3]{resimler/stmornek2.png}
\end{figure}
\end{frame}
\shorthandon{=}
\end{document}
或者如果你将fragile
选项添加到框架中:
\documentclass{beamer}
\mode<presentation>
\usepackage[turkish]{babel}
\usepackage{graphicx}
\begin{document}
\begin{frame}[fragile]
\begin{figure}
\shorthandoff{=}
\centering
\includegraphics[scale=0.3]{resimler/stmornek2.png}
\shorthandon{=}
\end{figure}
\end{frame}
\end{document}
作为埃格尔在他的评论中提到,您正在使用utf8
的选项inputenc
,因此您实际上并不需要模块的=
简写,您可以在 之后简单地停用它们:turkish
babel
\begin{document}
\documentclass{beamer}
\mode<presentation>
\usepackage[utf8]{inputenc}
\usepackage[turkish]{babel}
\usepackage{graphicx}
\begin{document}
\shorthandoff{=}
\begin{frame}
\begin{figure}
\centering
\includegraphics[scale=0.3]{resimler/stmornek2.png}
\end{figure}
\end{frame}
\end{document}