![](/img/trans.png)
[英]LaTex: How to change caption on figures from “Figure 1:” to “Figure 1 |”
[英]LaTeX: how to change SOME figure's titles from Figure to Code?
我的手稿使用\begin{figure}...\end{figure}
来处理图像和代码片段。
但是,我希望代码片段的标题为“代码 1....”而不是“图 1....”,而图片的标题仍为“图 1....”。
我能找到的只是如何更改整个文档的图形标题。
您可以使用 float 包创建新的浮点类型:
\documentclass{article}
\usepackage{float}
\newfloat{Code}{htbp}{loc}
\begin{document}
\begin{figure}[htbp]
\caption{a figure}
\end{figure}
\begin{Code}[htbp]
\caption{some code}
\end{Code}
\end{document}
(尽管如果您使用适当的源代码包来包含代码,而不是图像,结果会更好,例如listings
或minted
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.