summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/br-lex/br-lex.cls
blob: 4e27afb119ca6a2994adbed76d1bb51cdaa52e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
  %% br-lex.cls
  %% Copyright (c) Youssef Cherem <ycherem(at)gmail.com>, 2017
  %
  % This work may be distributed and/or modified under the
  % conditions of the LaTeX Project Public License, either version 1.3c
  % of this license or (at your option) any later version.
  % The latest version of this license is in
  %   http://www.latex-project.org/lppl.txt
  % and version 1.3 or later is part of all distributions of LaTeX
  % version 2005/12/01 or later.
  %
  % This work has the LPPL maintenance status `maintained'.
  % 
  % The Current Maintainer of this work is Youssef Cherem.
  %
  % This work consists of the files br-lex.cls, brlex-doc.tex, the example
  % leis-exemplo.tex and the files compiled therefrom: 
  % brlex-doc.pdf and leis-exemplo.pdf

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{br-lex}[2017/08/01]
\LoadClassWithOptions{mwbk}
\RequirePackage[normalem]{ulem}

\widowpenalty 1000
\clubpenalty  1000
\displaywidowpenalty 1000



\SetSectionFormatting{section}
{12pt}
{\centering\large\textbf{\ifHeadingNumbered
		Se\c{c}\~{a}o~
		\HeadingNumber\enspace\fi\\[8pt] %retirei o ponto
		\HeadingText}}
{6pt}

\renewcommand{\thesection}{\Roman{section}}

\renewcommand{\thechapter}{\Roman{chapter}}

%%%SECTION IN TOC%%%%
\renewcommand*\l@section[2]{\mw@tocline{1}{1.5em}{4em}{Seção~ #1}{#2}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\RequirePackage{hyperref}
%\RequirePackage[all]{nowidow}

\RequirePackage{ifxetex}
\ifxetex
\RequirePackage{fontspec}
\RequirePackage{polyglossia}
\setmainlanguage{brazil}
\else
\RequirePackage[utf8]{inputenc}
\RequirePackage[brazil]{babel}
\fi

\RequirePackage{textcase}

%%risca partes do texto
\newcommand{\cortado}[1]{\sout{#1}}

\newcommand{\titulo}[1]{
	\begin{center}
		\centering \bfseries \huge #1
	\end{center}
	\thispagestyle{plain}}

\newcommand{\descricao}[1]{\hfill%
	\begin{minipage}{0.5\textwidth}
		#1
	\end{minipage}
	\vspace{\baselineskip}
	}




% % % Para começar capítulos na mesma página:


% opção de começar capítulos na mesma página: capitulo

\DeclareOption{capitulo}{%
%\SetSectionFormatting[wholewidth]{chapter}
%{12pt}
%{\centering\Large\textbf{\ifHeadingNumbered
%		\@chapapp\enspace
%		\HeadingNumber\enspace\fi\\[8pt] %retirei o ponto
%		\HeadingText}}
%{6pt}



\SetSectionFormatting[wholewidth]{chapter}
{12pt}
{\FormatRigidChapterHeading{4\baselineskip}{0pt}%
	{\centering\large\MakeUppercase\@chapapp\space}{\Large\MakeUppercase}}
{\baselineskip}

}


%%%capítulos em maiúsculas 

\SetSectionFormatting[breakbefore,wholewidth]{chapter}
{12pt}
{\FormatRigidChapterHeading{4\baselineskip}{0pt}%
	{\centering\large\MakeUppercase\@chapapp\space}{\Large\MakeUppercase}}
{\baselineskip}



%%%%%



\DeclareOption{paragrafoespaco}{%
\setlength{\parskip}{8pt}%
\setlength{\parindent}{0pt}%
}

\DeclareOption{paragrafonormal}{%
	\setlength{\parskip}{0pt}%
}

\ExecuteOptions{paragrafoespaco}

\ProcessOptions\relax




%%%%%%%%%
%# a unidade básica de articulação será o artigo, indicado pela abreviatura "Art.", seguida de numeração ordinal até o nono e cardinal a partir deste;
%
%# os artigos desdobrar-se-ão em parágrafos ou em incisos; os parágrafos em incisos, os incisos em alíneas e as alíneas em itens;
%
%# os parágrafos serão representados pelo sinal gráfico "§", seguido de numeração ordinal até o nono e cardinal a partir deste, utilizando-se, quando existente apenas um, a expressão "parágrafo único" por extenso;
%
%# os incisos serão representados por algarismos romanos, as alíneas por letras minúsculas e os itens por algarismos arábicos;
%%%%%


\newcounter{artigo}
\newcommand{\artigo}{\refstepcounter{artigo} % 
	\par
	\ifnum\theartigo<10 %
	{\bfseries Art.~\arabic{artigo}º~~}%
	\else
	{\bfseries Art. \arabic{artigo}~~}%
	\fi
	%Art. \arabic{artigo}.~
	\setcounter{inciso}{0}
}

\newcounter{paragrafo}[artigo]
\newcommand{\paragrafo}{\refstepcounter{paragrafo} %
	\par 
	\ifnum\theparagrafo<10 %
	\hangindent=2em \hangafter=0 \S~\arabic{paragrafo}º~%
	\else
	\hangindent=2em \hangafter=0 \S~\arabic{paragrafo}~%
	\fi
}

\newcommand{\paragrafounico}{\hangindent=2em \hangafter=0 Parágrafo único.\enspace}


\newcounter{inciso}[paragrafo]
\newcommand{\inciso}{\refstepcounter{inciso} % 
\par
\ifnum\theparagrafo=0
\hangindent=2em \hangafter=0
\else 
\hangindent=3.5em \hangafter=0
\fi 
\Roman{inciso} --- 
}



\newcounter{alinea}[inciso]
\newcommand{\alinea}{\refstepcounter{alinea} %
\par 
 \hangindent=5em  \hangafter=0	\alph{alinea}) 
}

\newcounter{itens}[alinea]
\newcommand{\itens}{\refstepcounter{itens} % 
\par 
 \hangindent=6.5em \hangafter=0	\arabic{itens}. 
}


\endinput