更改两个子图之间的垂直线的颜色和粗细

更改两个子图之间的垂直线的颜色和粗细

我正在使用以下代码插入两个子图:

\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得到

在此处输入图片描述

相关内容