我正在使用以下代码插入两个子图:
\documentclass[a4paper, 12pt]{article}
\usepackage[margin=0.8in]{geometry}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}
\newcommand{\rulesep}{\unskip\ \vrule\ }
\begin{document}
\begin{figure}[H]
\centering
\captionsetup[subfigure]{justification=centerlast}
\begin{subfigure}{.48\linewidth}
\centering
\includegraphics[width=\linewidth]{subfigure_1.jpeg}
\caption[caption]{This is the caption\\Isosurface corresponding to \, $\lambda_{2,m} = -3$.}
\label{subfig1}
\end{subfigure}
\hfill
\rulesep
\begin{subfigure}{.48\linewidth}
\centering
\includegraphics[width=\linewidth]{subfigure_2.jpeg}
\caption[caption]{This is the caption\\Isosurface corresponding to \, $\lambda_{2,m} = -3$.}
\label{subfig2}
\end{subfigure}
\caption{Figure 1}
\end{figure}
\end{document}
可以看到,负责插入垂直线的命令是\rulesep
。我无法更改线条的粗细和颜色。有人可以帮我做吗?
答案1
使用\color
。我还稍微改变了 的定义\rulesep
。
\documentclass[a4paper, 12pt]{article}
\usepackage[margin=0.8in]{geometry}
\usepackage{graphicx,xcolor}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}
\captionsetup[subfigure]{justification=centerlast}
\newcommand{\rulesep}{\unskip\hfill{\color{red}\vrule}\hfill\ignorespaces}
\begin{document}
\begin{figure}[htp]
\centering
\begin{subfigure}{.48\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption[caption]{This is the caption\\Isosurface corresponding
to $\lambda_{2,m} = -3$.\label{subfig1}}
\end{subfigure}
\rulesep
\begin{subfigure}{.48\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption[caption]{This is the caption\\Isosurface corresponding
to $\lambda_{2,m} = -3$.\label{subfig2}}
\end{subfigure}
\caption{Figure 1}
\end{figure}
\end{document}
如果你变成\vrule
你\vrule width 1pt
得到