如何改变水平线的颜色?

如何改变水平线的颜色?

我已经在安装文件中了usepacke{xcolor}usepacke{color}我试过了 \newcommand{\HorizontalLine}{\rule{\linewidth}{0.5mm}{\color}{blue}}

但它不起作用,请帮忙。

 \begin{titlepage}
    \begin{center}
    \newcommand{\HorizontalLine}{\rule{\linewidth}{0.5mm}}
    {\Large Undergraduate/Master's Thesis}\\[1.3cm]
    %_____________________________________________________________________________
    \HorizontalLine \\[0.4cm]
    \begin{spacing}{3}
    {\huge \bfseries The Long, Long } \\
    {\huge \bfseries Long Long} \\
    {\huge \bfseries Title}\\
    \end{spacing}
    \HorizontalLine \\[1.5cm]
    % _____________________________________________________________________________

在此处输入图片描述

答案1

下面的代码会产生一条蓝线,然后将其颜色恢复为黑色:

\documentclass{article}
\usepackage{xcolor}
\newcommand{\HorizontalLine}{{\color{blue}\rule{\linewidth}{0.5mm}}}
\begin{document}
\noindent
\HorizontalLine
\end{document}

相关内容