
我正在嘗試製作幻燈片
\documentclass[11pt] {beamer}
\usepackage{caption}
\usepackage{graphicx}
\begin{document}
\section{my photos}
\begin{frame}
\footnotesize\textbf Is this the same as previous figure?
\begin{figure}[h!]
\caption{This is amazing photo}
\centering
\includegraphics[width=0.4\textwidth]{photo1.jpg}
\end{figure}
\end{frame}
\end{document}
該文件有效,但它在標題之前的圖形頂部列印“圖形”。
答案1
您想要獲得這樣的東西嗎?
\documentclass{beamer}
\usepackage[labelformat=empty]{caption}
\begin{document}
\begin{frame}
\frametitle{my photos}
\footnotesize\textbf Is this the same as previous figure?
\begin{figure}[h!]
\caption{This is an amazing photo}
\centering
\includegraphics[width=0.4\textwidth]{TasmanianDevil.jpg}
\end{figure}
\end{frame}
\end{document}
答案2
沒有必要使用該caption
包,您可以修改標題的投影機模板,如下所示:
\documentclass[11pt]{beamer}
\setbeamertemplate{caption}{%
\raggedright
\insertcaption\par
}
\begin{document}
\section{my photos}
\begin{frame}
\footnotesize\textbf{Is this the same as previous figure?}
\begin{figure}
\caption{This is amazing photo}
%\centering
\includegraphics[width=0.4\textwidth]{example-image-duck}
\end{figure}
\end{frame}
\end{document}
與問題無關:
你不需要
graphicx
有投影機的包beamer 沒有浮動機制,加入浮動說明符如 [h!] 沒有意義
\centering
圖形是不必要的,beamer 預設將圖形居中它應該是
\textbf{....}
而不是\textbf ....
(除非您只想將一個字母設為粗體)