diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-06 20:00:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-06 20:00:22 +0000 |
commit | 42e149ae691b09e3d12d3cc32e7e1ad17fa835f8 (patch) | |
tree | c0e688ff9888c49862f7f5a3c38a8c7ddfafb9bf /Master/texmf-dist/tex | |
parent | 1a9eea45468c9c21fac9e57777b76161d23acb34 (diff) |
abntexto (6oct22)
git-svn-id: svn://tug.org/texlive/trunk@64638 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/abntexto/abntexto.cls | 177 |
1 files changed, 70 insertions, 107 deletions
diff --git a/Master/texmf-dist/tex/latex/abntexto/abntexto.cls b/Master/texmf-dist/tex/latex/abntexto/abntexto.cls index 9fa14dca863..aa12bb3eb8c 100644 --- a/Master/texmf-dist/tex/latex/abntexto/abntexto.cls +++ b/Master/texmf-dist/tex/latex/abntexto/abntexto.cls @@ -1,25 +1,9 @@ %! Public Domain Software -%! 2022-09-29 -%! 1.1.0-alpha +%! 2022-10-06 +%! 1.2.0-alpha %! Elayson %! abntexto dot classe at gmail dot com -% ANNOUNCEMENT - -% The implementation of legend areas has been improved. - -% Inclusion of the \appendix and \annex macros. - -% Removal of \noprotrusion and \extfile macros. - -% Better compatibility with the hyperref package. - -% The functionality of topics has been improved. - -% Footnotes have been adjusted according to the Standard. - -% Additions to the manual. - %! SUMÁRIO %! PRÉ-CONFIGURAÇÕES @@ -34,23 +18,23 @@ %! NOTAS DE RODAPÉ %! UTILIDADES %! IDENTIFICAÇÃO DO TRABALHO -%! PATCHS, HOOKS +%! A VÍRGULA COMO SEPARADOR DECIMAL %! INICIALIZAÇÃO -% |sec PRÉ-CONFIGURAÇÕES +% \sec PRÉ-CONFIGURAÇÕES % !======================================================= -% Identificação do formato |TeX| e da classe. Apenas o pacote |pkg keyval | é carregado no |pkg abntexto . +% Identificação do formato \TeX\ e da classe. Apenas o pacote \pkg{keyval} é carregado no \pkg{abntexto}. % |bcode !------------------------------------------------ \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{abntexto}[2022-09-29 1.1.0-alpha Preparation of works in ABNT standards] +\ProvidesClass{abntexto}[2022-10-06 1.2.0-alpha Preparation of works in ABNT standards] \RequirePackage{keyval} % |ecode !------------------------------------------------ -% Definição do sistema |emph chave|eq%valor | e de um comando de |emph debug . +% Definição do sistema \emph{chave=valor} e de um comando de \emph{debug}. Perceba que \tnba@bodyhook não pode ser igual a \cs\relax, mas \cs\empty ao invés. % |bcode !------------------------------------------------ \def\tnba@keyprefix{tnba} @@ -61,18 +45,20 @@ \def\advancecount#1{\global\advance#1by1 } \def\tnba@addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}} -\def\tnba@tobdocument{\tnba@addto\tnba@bdocumenthook} +\def\tnba@tobody{\tnba@addto\tnba@bodyhook} -\let\tnba@bdocumenthook=\empty -\AddToHook{begindocument}{\def\tnba@inbody{}\tnba@bdocumenthook} +\let\tnba@bodyhook=\empty +\AddToHook{begindocument}{\def\tnba@body{}\tnba@bodyhook} \def\tnba@error{\ClassError{abntexto}} % |ecode !------------------------------------------------ -% |sec FONTE TIPOGRÁFICA +% \sec FONTE TIPOGRÁFICA % !======================================================= -% Apenas o tamanho 12|,pt está definido. Defina outros usando |cs fontsizedef |metac size |metac defs . +% Apenas o tamanho 12\,pt está definido. Defina outros usando \cs\fontsizedef\cc{size}\cc{defs}. + +% Diferentemente de outras âncoras, \cs{\tnba@setfontsizehook} deve ser executado antes de \cs\begin\ccval{document} para evitar o alerta sobre \cs\normalsize\ não estar definido. % |bcode !------------------------------------------------ \def\fontsizedef#1#2{\@namedef{tnba@fontsize@#1}{#2}} @@ -86,20 +72,19 @@ \AddToHook{begindocument/before}{\tnba@setfontsizehook} -\def\spacing#1{\ifx\tnba@inbody\undefined - \def\tnba@spacinghook{\tnba@spacing{#1}} \else - \tnba@spacing{#1}\fi \ignorespaces +\def\spacing#1{\def\currspacing{#1}% + \ifx\tnba@body\undefined + \tnba@tobody{\tnba@spacing{#1}} \else + \tnba@spacing{#1}\fi \ignorespaces } -\def\tnba@spacing#1{\dimen0=\f@size pt \dimen0=#1\dimen0 \baselineskip=\dimen0 } +\def\tnba@spacing#1{\dimen0=\f@size pt \dimen0=#1\dimen0 \baselineskip=\dimen0} \def\singlesp{\baselineskip=\normalbaselineskip} \def\onehalfsp{\spacing{1.5}} \def\doublesp{\spacing{2}} - -\AddToHook{begindocument}{\csname tnba@spacinghook\endcsname} % |ecode !------------------------------------------------ -% |sec |emph LAYOUT +% \sec \emph{LAYOUT} % !======================================================= % |bcode !------------------------------------------------ @@ -129,8 +114,9 @@ \headsep=1cm \advance\topmargin-\headheight \advance\topmargin-\headsep \advance\textwidth-\tnba@L \advance\textwidth-\tnba@R - \advance\textheight-\tnba@T \advance\textheight-\tnba@B - \advance\headsep-\fontcharht\font`1 + \advance\textheight-\tnba@T \advance\textheight-\tnba@B + \setbox0=\hbox{\@setfontsize\@tempa{10}{12pt}\@tempa 1} + \advance\headsep-\ht0 \ifx\pdfpagewidth\undefined \ifx\pagewidth\undefined \tnba@error{O comando \@backslashchar paper só suporta saída em PDF. Use o formato PDF ou carregue o pacote *geometry*}\expandafter\enddocument\relax \else @@ -174,7 +160,7 @@ } % |ecode !------------------------------------------------ -% |sec SUMÁRIO +% \sec SUMÁRIO % !======================================================= % |bcode !------------------------------------------------ @@ -183,7 +169,7 @@ \def\extline#1#2#3#4{% \begingroup \csname use#1\romannumeral#2font\endcsname \nobreak - \extlineshape + \extlineshape \relax \hskip-\leftskip {#3}\nobreak \leaders\hbox{$\m@th \mkern4.5mu\hbox{.}\mkern4.5mu$}\hfil\nobreak \hbox to1.55em{\hss #4\kern-1pt\kern1pt}\par @@ -201,7 +187,7 @@ \def\l@section#1#2{\smartaboveskip{\penalty351}{\vskip1em plus1pt}% \begingroup \usetocifont \nobreak - \extlineshape + \extlineshape \relax \hskip-\leftskip \maybeuctoc{#1}\nobreak\hfil\nobreak \hbox to1.55em{\hss #2\kern-1pt\kern1pt}\par \endgroup @@ -218,7 +204,7 @@ \def\tocvfont#1{\def\usetocvfont{#1}} % |ecode !------------------------------------------------ -% |sec SECIONAMENTO +% \sec SECIONAMENTO % !======================================================= % |bcode !------------------------------------------------ @@ -315,7 +301,7 @@ \def\hreftocline#1{\Hy@MakeCurrentHrefAuto{#1}% \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}% } -\tnba@tobdocument{\ifx\hypertarget\undefined \let\hreftocline=\@gobble \fi} +\tnba@tobody{\ifx\hypertarget\undefined \let\hreftocline=\@gobble \fi} % |ecode !------------------------------------------------ % |bcode !------------------------------------------------ @@ -346,44 +332,44 @@ \def\appendixlabelwidth{8em} \def\annexlabelwidth{6.2em} -\def\l@appendix{% - \let\extlabelwidth=\appendixlabelwidth +\def\l@appendix{\let\extlabelwidth=\appendixlabelwidth \def\extlabelbox##1{\hbox to\extlabelwidth{Apêndice~##1~---~\hfil}}% \l@section } -\def\l@annex{% - \let\extlabelwidth=\annexlabelwidth +\def\l@annex{\let\extlabelwidth=\annexlabelwidth \def\extlabelbox##1{\hbox to\extlabelwidth{Anexo~##1~---~\hfil}}% \l@section } -\def\appendix{\def\section##1{\noindent \advance\appendixcount by1 +\def\appendix{\def\section##1{\newpage\noindent \advance\appendixcount by1 {\usesectionfont \centering \maybeucsec{Apêndice~\theappendix~---~##1}\tnba@nbpar}% - \addcontentsline{toc}{appendix}{\protect\extlabelbox{\theappendix}##1}% - \nobreak \vskip\sectionbelow + \hreftocline{appendix}% + \addcontentsline{toc}{appendix}{\protect\extlabelbox{\theappendix}##1}% + \nobreak \vskip\sectionbelow }% } -\def\annex{\def\section##1{\noindent \advance\annexcount by1 +\def\annex{\def\section##1{\newpage\noindent \advance\annexcount by1 {\usesectionfont \centering \maybeucsec{Anexo~\theannex~---~##1}\tnba@nbpar}% - \addcontentsline{toc}{annex}{\protect\extlabelbox{\theannex}##1}% - \nobreak \vskip\sectionbelow + \hreftocline{annex}% + \addcontentsline{toc}{annex}{\protect\extlabelbox{\theannex}##1}% + \nobreak \vskip\sectionbelow }% } % |ecode !------------------------------------------------ -% |sec CITAÇÕES +% \sec CITAÇÕES % !======================================================= % |bcode !------------------------------------------------ \def\qt#1{``#1''} \def\quote#1{\smartaboveskip{\penalty351}{\vskip\baselineskip}% - \hbox to\hsize{\hfil\vtop{\advance\hsize-4cm \noindent\small #1\getprev}}\useprev + \hbox to\hsize{\hfil\vtop{\advance\hsize-4cm \noindent\small #1\tnba@getprevdepth}}\tnba@useprevdepth \smartbelowskip{\vskip\baselineskip}% } % |ecode !------------------------------------------------ -% |sec ALÍNEAS +% \sec ALÍNEAS % !======================================================= % |bcode !------------------------------------------------ @@ -409,38 +395,32 @@ \let\endtopics=\par % |ecode !------------------------------------------------ -% |sec TABELAS +% \sec TABELAS % !======================================================= % |bcode !------------------------------------------------ \newenvironment{table}[1]{\begin{tabular}{#1}}{\end{tabular}} % |ecode !------------------------------------------------ -% |sec ÁREAS DE LEGENDA +% \sec ÁREAS DE LEGENDA % !======================================================= % |bcode !------------------------------------------------ -%\long\def\@makecaption#1#2{\sbox0{#1~—~#2}% -% \ifdim\wd0>\hsize -% #1~—~#2\par \else -% \global\@minipagefalse \hbox to\hsize{\hss\box0\hss}% -% \fi -% \vskip10pt -%} -%\def\place#1#2#3{\@float{#1}\centering\caption{#2}#3\end@float} - \def\tnba@lastplacenum{0} -% \legendplacedef{<type>}{<name>}{<ref-font>}{<file-extension>} -\def\legendplacedef#1#2#3#4{\expandafter\newcount\csname c@#1\endcsname +\def\legendplacedef#1#2#3#4#5{\expandafter\newcount\csname c@#1\endcsname \@namedef{#1name}{#2} - \@namedef{p@#1}##1{#3} - \@namedef{ext@#1}{#4} - \@namedef{l@#1}{\extline{#4}{1}} + \@namedef{p@#1}##1{#4} + \@namedef{ext@#1}{#5} + \@namedef{l@#1}{\extline{#5}{1}} \expandafter\edef\csname the#1\endcsname{\expandafter\noexpand\the\csname c@#1\endcsname} -% \tnba@key{pos}{\@namedef{fps@#1}{##1}} -% \@nameedef{ftype@#1}{\the\numexpr\tnba@lastplacenum+1} -% \@namedef{fnum@#1}{\csname #1name\endcsname ~\csname the#1\csname} + \@namedef{#5labelwidth}{10.4ex} + \@namedef{#5labelbox}##1{\hbox to\extlabelwidth{#2 ##1 ---\hfil}} + \@namedef{make#5}{\heading{#3}% + \expandafter\let\expandafter\extlabelwidth\csname #5labelwidth\endcsname + \expandafter\let\expandafter\extlabelbox\csname #5labelbox\endcsname + \@starttoc{#5}\twonewpage + } } % |ecode !------------------------------------------------ @@ -457,9 +437,9 @@ {\protect\extlabelbox\thelegend \tnba@savedlegend}% } -\def\tnba@makesrc{\hbox to\hsize{\hfil\tnba@makesrcA\hfil}\useprev} +\def\tnba@makesrc{\hbox to\hsize{\hfil\tnba@makesrcA\hfil}\tnba@useprevdepth} \def\tnba@makesrcA{\vtop{\hsize=\tnba@placewidth \srclabel - \vtop{\setbox0=\hbox{\srclabel}\advance\hsize-\wd0 \tnba@savedsrc \getprev}}% + \vtop{\setbox0=\hbox{\srclabel}\advance\hsize-\wd0 \tnba@savedsrc \tnba@getprevdepth}}% } % |ecode !------------------------------------------------ @@ -508,7 +488,7 @@ \def\placespaces#1#2{\def\placeabovespace{#1}\def\placebelowspace{#2}} % |ecode !------------------------------------------------ -% |sec NOTAS DE RODAPÉ +% \sec NOTAS DE RODAPÉ % !======================================================= % As notas de rodapé também foram modificadas. @@ -521,14 +501,14 @@ \def\footnoterule{\kern18pt\hrule width5cm\kern2.6pt} % |ecode !------------------------------------------------ -% |sec UTILIDADES +% \sec UTILIDADES % !======================================================= % |bcode !------------------------------------------------ -\def\getprev{\par\xdef\tnba@getprevA{\the\prevdepth}} -\def\useprev{\par\prevdepth=\tnba@getprevA} +\def\tnba@getprevdepth{\par\xdef\tnba@getprevdepthA{\the\prevdepth}} +\def\tnba@useprevdepth{\par\prevdepth=\tnba@getprevdepthA} -\long\def\sizedpar#1{\leavevmode\vtop{\ignorespaces#1\getprev}\useprev} +\long\def\sizedpar#1{\leavevmode\vtop{\ignorespaces#1\tnba@getprevdepth}\tnba@useprevdepth} \def\justifying{\let\\=\tnba@origcr \leftskip=0pt \rightskip=0pt @@ -543,17 +523,10 @@ \def\twonewpage{\newpage\leavevmode\newpage} % |ecode !------------------------------------------------ -% |sec IDENTIFICAÇÃO DO TRABALHO +% \sec IDENTIFICAÇÃO DO TRABALHO % !======================================================= % |bcode !------------------------------------------------ -%\long\def\indexcarddebug#1{\hbox{\vrule\vbox to7.5cm{\hsize=\hsize %\advance\hsize-2cm \advance\hsize-0.8pt -% \hrule\indexcardA{#1}\vss\indexcardbar\hrule}\vrule}% -%} -%\long\def\indexcarddebugA#1{\hbox spread2cm{\hss\vrule -% \vbox spread2cm{\hrule\vss#1\vss\hrule}\vrule\hss}% -%} - \long\def\indexcard#1{\hbox{\vrule\vbox to7.5cm{\hsize=12.5cm \advance\hsize by-2cm \advance\hsize by-0.8pt \hrule\indexcardA{#1}\vss\indexcardbar\hrule}\vrule}% } @@ -564,16 +537,16 @@ \def\judgeline#1{\par{\centering \rule{.7\linewidth}{.6pt}\\ #1\Enter[1.5]}} % |ecode !------------------------------------------------ -% |sec A VÍRGULA COMO SEPARADOR DECIMAL +% \sec A VÍRGULA COMO SEPARADOR DECIMAL % !======================================================= % |bcode !------------------------------------------------ {\catcode`,=\active - \gdef,{\futurelet\next\tnba@smartcomma} + \gdef,{\futurelet\let@token\tnba@smartcomma} } \def\tnba@smartcomma{% - \ifx\next\@sptoken \else - \ifx\next\space \else \mathord \fi\fi + \ifx\let@token\@sptoken \else + \ifx\let@token\space \else \mathord \fi\fi \tnba@mathcomma } @@ -590,7 +563,7 @@ \fi % |ecode !------------------------------------------------ -% |sec INICIALIZAÇÃO +% \sec INICIALIZAÇÃO % !======================================================= % |bcode !------------------------------------------------ @@ -635,8 +608,8 @@ \paragraphspaces {\baselineskip}{\baselineskip} \subparagraphspaces {\baselineskip}{\baselineskip} -\legendplacedef{figure}{Figura}{fig.\,#1}{lof} -\legendplacedef{table}{Tabela}{tab.\,#1}{lot} +\legendplacedef{figure}{Figura}{Lista de figuras}{fig.\,#1}{lof} +\legendplacedef{table}{Tabela}{Lista de tabelas}{tab.\,#1}{lot} \def\legendlabel{\legendname ~\thelegend ~---~} \def\srclabel{\raggedright\small Fonte:~} @@ -644,16 +617,6 @@ \placespaces{\baselineskip}{\baselineskip} -\def\makelof{\heading{Lista de figuras} - \def\extlabelwidth{12.5ex}% - \def\extlabelbox##1{\hbox to\extlabelwidth{Figura ##1 ---\hfil}}% - \@starttoc{lof}\twonewpage -} -\def\makelot{\heading{Lista de tabelas} - \def\extlabelwidth{12.5ex}% - \def\extlabelbox##1{\hbox to\extlabelwidth{Tabela ##1 ---\hfil}}% - \@starttoc{lot}\twonewpage -} \def\maketoc{\heading{Sumário} \def\extlabelwidth{4ex}% \def\extlabelbox##1{\hbox to\extlabelwidth{##1\hfil}}% @@ -666,7 +629,7 @@ \topskip=12pt -\pretextual +\AddToHook{begindocument}{\pretextual} \endinput % |ecode !------------------------------------------------ |