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}
egin{document}
egin{figure}[h!]
caption{A picture of a gull.}
centering
includegraphics[width=0.5 extwidth]{atom_in_cavity.jpg}
end{figure}
egin{figure}[h!]
centering
eflectbox{%
includegraphics[width=0.5 extwidth]{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}
egin{document}
egin{figure}
egin{minipage}{0.5 extwidth}
includegraphics[width= extwidth]{atoms_in_cavity.jpg}
end{minipage}%
egin{minipage}{0.5 extwidth}
caption{A picture of a gull.}
end{minipage}
end{figure}
egin{SCfigure}
centering
includegraphics[width=0.5 extwidth]{atoms_in_cavity.jpg}
caption{A picture of a gull}
end{SCfigure}
end{document}


——数声风笛离亭晚,我想潇湘君想秦!
原文地址:https://www.cnblogs.com/hujianhua/p/3219153.html