答案1
你必须改变
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule]
到
\colorlet{titlerulecolor}{orange}
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[{\color{titlerulecolor}\titlerule}]
梅威瑟:
\documentclass[a4paper,10pt]{article}
\usepackage{parskip}
\usepackage[usenames,dvipsnames]{xcolor}
\colorlet{titlerulecolor}{orange}
\usepackage{titlesec}
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[{\color{titlerulecolor}\titlerule}]
\titlespacing{\section}{0pt}{3pt}{3pt}
\begin{document}
\pagestyle{empty}
\section{Personal Data}
Text
\end{document}
当然,您可以选择橙色以外的其他颜色。
颜色示例rgb
:
\documentclass[a4paper,10pt]{article}
\usepackage{parskip}
\usepackage[usenames,dvipsnames]{xcolor}
\definecolor{titlerulecolor}{rgb}{.9,.1,.9}
\usepackage{titlesec}
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[{\color{titlerulecolor}\titlerule}]
\titlespacing{\section}{0pt}{3pt}{3pt}
\begin{document}
\pagestyle{empty}
\section{Personal Data}
Text
\end{document}