![新的类阻止 XeLaTeX 编译章节标题](https://linux22.com/image/295356/%E6%96%B0%E7%9A%84%E7%B1%BB%E9%98%BB%E6%AD%A2%20XeLaTeX%20%E7%BC%96%E8%AF%91%E7%AB%A0%E8%8A%82%E6%A0%87%E9%A2%98.png)
我创建了一个新类,用于capitulo
防止每章都出现分页符。但是当我激活这些代码行时,不会打印章节编号。
以下是 MWE:
\documentclass[12pt,twoside,twocolumn]{constitution}
\usepackage[top=3cm, bottom=2cm, inner=3cm,outer=2.5cm]{geometry}% See geometry.pdf to learn the layout options.
\usepackage[portuguese]{babel}
\begin{document}
\capitulo{Generalidades}
\article{Denominação e Sede}
\section{} A ABCD, adiante também designada por ABCD, foi fundada a X de X de 1994 e tem a sua sede na cidade XY.
并且constitution.cls
是:
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesClass{constitution}[2009/05/15 v0.0.1 Document class for typesetting a constitution]
\LoadClass{report}
\RequirePackage[letterpaper,margin=1in]{geometry}
\RequirePackage[colorlinks,linkcolor=blue]{hyperref}
%\usepackage{hyperref}
\RequirePackage{titlesec}
\RequirePackage{titletoc}
\RequirePackage{paralist}
%\newcommand{\bylaw}[1]{\part{#1} \setcounter{section}{0}}
%\renewcommand{\partname}{Bylaw}
\titleclass\capitulo{straight}[\part]
\titleformat{\capitulo}[display]{\filcenter\LARGE\normalfont\bfseries}{Cap\'{\i}tulo \thecapitulo}{0pt}{\filcenter\Large\normalfont\bfseries}
\titlespacing*{\capitulo}{0mm}{*4}{*2.3}[0mm]
\newcounter{capitulo}
\renewcommand\thecapitulo{\Roman{capitulo}}
\titlecontents{capitulo}
[1.5em]
{\bfseries}
{\contentslabel{2.3em}}
{\hspace*{-2.3em}}
{\titlerule*[1pc]{.}\contentspage}
\titleclass\article{straight}[\part]
\titleformat{\article}[display]{\filcenter\normalfont\bfseries}{Artigo \thearticle}{0pt}{\filcenter\normalfont\bfseries}
\titlespacing*{\article}{0mm}{*4}{*2.3}[0mm]
\newcounter{article}
\renewcommand\thearticle{\arabic{article}}
\titlecontents{article}
[1.5em]
{\bfseries}
{\contentslabel{2.3em}}
{\hspace*{-2.3em}}
{\titlerule*[1pc]{.}\contentspage}
%TEXTO QUE ESTAVA COMENTADO
\makeatletter
\renewcommand\section{\@startsection
{section}{1}{0mm}%
{-\baselineskip}%
{-0.5\baselineskip}%
{\normalfont\normalsize\bfseries}}%
\makeatother
%TEXTO QUE ESTAVA COMENTADO
\makeatletter
\@addtoreset{section}{article}
\makeatother
\titleformat{\section}[runin]{\normalfont\scshape}
{Sec\c{c}\~ao \thesection.}{.5em}{}[\quad]
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\theenumi}{\alph{enumi}}
\renewcommand{\theenumii}{\roman{enumii}}
我的问题是:我希望各部分能够按原样呈现,Seccção 1
并且章节标题能够按原样格式化。