latex題注(caption)位置


http://anything-is-ok.blog.163.com/blog/static/205720233201301634053760/

我們以插入圖片為例來說明latex中將題注(caption)置於不同位置的方法。

一般而言圖片的題注會加在圖片下方。如果想要使題注位於圖片上方,只需要 \caption{caption-content} 置於命令 \includegraphics[options]{picture-file} 之前即可。下面是一個例子。

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h!]
\caption{A picture of a gull.}
\centering
\includegraphics[width=0.5\textwidth]{atom_in_cavity.jpg}
\end{figure}
\begin{figure}[h!]
\centering
\reflectbox{%
\includegraphics[width=0.5\textwidth]{atom_in_cavity.jpg}}
\caption{A picture of the same gull
looking the other way!}
\end{figure}
\end{document}

有的時候我們還可能希望題注出現在圖片的右面。這可以通過兩種方法實現。第一,在figure環境中嵌套小頁(minipage)環境來實現。第二,使用sidecap宏包中的SCfigure環境。下面例子中我們分別使用了這兩種方法實現了題注的側置。

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\usepackage{sidecap}
\begin{document}
\begin{figure}
\begin{minipage}{0.5\textwidth}
\includegraphics[width=\textwidth]{atoms_in_cavity.jpg}
\end{minipage}%
\begin{minipage}{0.5\textwidth}
\caption{A picture of a gull.}
\end{minipage}
\end{figure}
\begin{SCfigure}
\centering
\includegraphics[width=0.5\textwidth]{atoms_in_cavity.jpg}
\caption{A picture of a gull}
\end{SCfigure}
\end{document}


——數聲風笛離亭晚,我想瀟湘君想秦!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM