创建新的标题样式

创建新的标题样式

我想知道是否有人可以提供一个代码来生成类似于下面显示的文档的标题。 enter image description here

答案1

一个非常“基本”的设置作为一个表格并将其注入到页眉中fancyhdr

\documentclass{article}

\usepackage{fancyhdr}

\usepackage{tabularx}
\usepackage{multirow}
\usepackage[headheight=15pt]{geometry}

\newcounter{week}

\renewcommand{\arraystretch}{0.3}
\newcommand{\myniceheader}{%
\refstepcounter{week}
\begin{tabularx}{\linewidth}{XcX}
\cline{1-1} \cline{3-3} 
&  \multirow{5}{*}{\bfseries Problems of Week \theweek} & \tabularnewline
\cline{1-1}  \cline{3-3}  \tabularnewline
\cline{1-1}  \cline{3-3}  \tabularnewline
\cline{1-1}  \cline{3-3}  \tabularnewline
\cline{1-1}  \cline{3-3}  
\end{tabularx}}



\renewcommand{\headrulewidth}{0pt}
\fancypagestyle{plain}{%
  \fancyhf{}
  \chead{\myniceheader}
}

\usepackage{blindtext}
\begin{document}
\pagestyle{plain}

\blindtext[20]



\end{document}

enter image description here

使用阵列规则颜色进行更新并控制规则的厚度

\documentclass{article}

\usepackage[table]{xcolor}
\usepackage{fancyhdr}

\usepackage{tabularx}

\usepackage{multirow}
\usepackage[headheight=28pt]{geometry}

\newcounter{week}

\renewcommand{\arraystretch}{0.3}
\newcommand{\myniceheader}{%
\refstepcounter{week}
\begingroup
\arrayrulecolor{blue}
\renewcommand{\arrayrulewidth}{1.5pt}
\begin{tabularx}{\linewidth}{XcX}
\cline{1-1} \cline{3-3} 
&  \multirow{5}{*}{\bfseries Problems of Week \theweek} & \tabularnewline
\cline{1-1}  \cline{3-3}  \tabularnewline
\cline{1-1}  \cline{3-3}  \tabularnewline
\cline{1-1}  \cline{3-3}  \tabularnewline
\cline{1-1}  \cline{3-3}  
\end{tabularx}
\endgroup
}



\renewcommand{\headrulewidth}{0pt}
\fancypagestyle{plain}{%
  \fancyhf{}
  \chead{\myniceheader}
}

\usepackage{blindtext}
\begin{document}
\pagestyle{plain}

\blindtext[20]



\end{document}

enter image description here

相关内容