繁体   English   中英

LaTex:如何将图上的标题从“图 1:”更改为“图 1 |”

[英]LaTex: How to change caption on figures from “Figure 1:” to “Figure 1 |”

我在下面有以下 LaTex 代码,它生成直方图:

\documentclass[review,12pt]{elsarticle}

\usepackage{lineno,hyperref}

\usepackage[utf8]{inputenc}
\usepackage[dvipsnames]{xcolor}
\usepackage{amssymb, lipsum, color}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{comment}
\usepackage{smartdiagram}
\usetikzlibrary{shapes.geometric}
\usepackage{float}

\begin{document}

\begin{figure}[H]
\centering
\includegraphics[scale=0.8]{Histogram A.jpg}
\caption{Histogram Title}\label{Histogram A}
\end{figure}

\end{document}

我在这里附上了直方图的图片: 直方图 A

直方图上的标题将从Figure 1: Histogram Title开始。 如何将其更改为Figure 1 | Histogram Title Figure 1 | Histogram Title IE。 如何将冒号替换为 pipe 符号?

提前谢谢了!

使用caption package:

\documentclass[review,12pt]{elsarticle}

\usepackage{lineno,hyperref}

\usepackage[utf8]{inputenc}
\usepackage[dvipsnames]{xcolor}
\usepackage{amssymb, lipsum, color}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{comment}
\usepackage{smartdiagram}
\usetikzlibrary{shapes.geometric}
\usepackage{float}

\usepackage{caption}
\DeclareCaptionLabelSeparator{bar}{\space\textbar\space}
\captionsetup{labelsep=bar}

\begin{document}

\begin{figure}[htbp]
\centering
\includegraphics[scale=0.8]{example-image-duck}
\caption{Histogram Title}\label{Histogram A}
\end{figure}

\end{document}

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM