我试图将章节标题与章节标签放在一行上,将章节名称放在下一行上。即:
|
Article II
This is the Title
|
我的尝试:
\usepackage{titlesec}
\renewcommand{\thesection}{{Article \Roman{section}}}
\titleformat{name=\section}{\large\bfseries}{\center{\thesection}}{.5em}{\newline \centering}[]
\section{This is the Title}
我还没有找到成功的方法centerline{}
,centering
或者center{}
答案1
像这样 :
\documentclass[12pt]{article}
\usepackage[explicit]{titlesec}
\usepackage{lipsum}
\renewcommand{\thesection}{Article \Roman{section}}
\titleformat{\section}[block]%
{\centering\Large\bfseries}%
{\rule{2pt}{12pt}\\\thesection\\#1\\\rule{2pt}{12pt}} % format
{0cm} % sep
{}
\begin{document}
\section{Test}
\lipsum[1]
\section{This should be centered}
\lipsum[1]
\end{document}