diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/abnt |
Initial commit
Diffstat (limited to 'macros/latex/contrib/abnt')
-rw-r--r-- | macros/latex/contrib/abnt/README.md | 18 | ||||
-rw-r--r-- | macros/latex/contrib/abnt/abnt-doc.pdf | bin | 0 -> 97368 bytes | |||
-rw-r--r-- | macros/latex/contrib/abnt/abnt-doc.tex | 104 | ||||
-rw-r--r-- | macros/latex/contrib/abnt/abnt.sty | 203 |
4 files changed, 325 insertions, 0 deletions
diff --git a/macros/latex/contrib/abnt/README.md b/macros/latex/contrib/abnt/README.md new file mode 100644 index 0000000000..5e30fe9d13 --- /dev/null +++ b/macros/latex/contrib/abnt/README.md @@ -0,0 +1,18 @@ +======= abnt -- A package for typesetting Brazilian academic texts ========== + +This package implements rules to typeset Brazilian academic texts. + +Copyright (c) Youssef Cherem <ycherem(at)gmail.com>, 2018 + + This file is part of the abnt LaTeX2e package. + This work may be distributed and/or modified under the conditions of + the LaTeX Project Public License, version 1.3c of the license. + The latest version of this license is in + http://www.latex-project.org/lppl.txt + and version 1.3c or later is part of all distributions of LaTeX + version 2005/12/01 and of this work. + + This work has the LPPL maintenance status "author-maintained". + ======================================================================== + + diff --git a/macros/latex/contrib/abnt/abnt-doc.pdf b/macros/latex/contrib/abnt/abnt-doc.pdf Binary files differnew file mode 100644 index 0000000000..0f4f6084cc --- /dev/null +++ b/macros/latex/contrib/abnt/abnt-doc.pdf diff --git a/macros/latex/contrib/abnt/abnt-doc.tex b/macros/latex/contrib/abnt/abnt-doc.tex new file mode 100644 index 0000000000..4d4b0a80aa --- /dev/null +++ b/macros/latex/contrib/abnt/abnt-doc.tex @@ -0,0 +1,104 @@ +\documentclass{ltxdoc} +\usepackage[svgnames,dvipsnames]{xcolor} +\usepackage{fontspec} +\setmainfont{Warnock Pro} +\setsansfont{Cronos Pro} +\usepackage[scale=.8]{FiraMono} +\usepackage{polyglossia} +\setmainlanguage{brazil} +\usepackage{tcolorbox} +\tcbuselibrary{listings,skins,xparse} +\usepackage{tikz} +\usetikzlibrary{positioning,shapes,snakes} + +\newtcblisting[auto counter,list inside=codigo]{codigo}[2][]{% + %title={Código~\thetcbcounter:~#2}, + title=#2, + hbox, + center, + colback=green!30, + colbacktitle=green!50, + colframe=green, + listing only,fonttitle=\bfseries\sffamily\large,coltitle=black,titlerule=0pt,enhanced,drop fuzzy shadow%halign title=center + } + + + +\title{\tikz \node[inner sep=0pt,remember picture,overlay] at (0,1){\includegraphics[height=3cm,width=0.4\textwidth,keepaspectratio]{icone}};\\O pacote <<\texttt{abnt}>>} +\author{Youssef Cherem} +\date{2018} + +\begin{document} +\frenchspacing + +\begin{center} + \tikz\node[diamond,shape aspect=1.2,%draw=green,ultra thick, + remember picture,overlay,%minimum size=0.6\textwidth, + left color=SpringGreen,shading angle=45,align=center] at (0,0){\includegraphics[height=3cm,width=0.4\textwidth,keepaspectratio]{icone}\\{\Large O pacote <<\texttt{abnt}>>}\\[10pt]\large Youssef Cherem\\[6pt]2018}; +\end{center} + +\vspace{4cm} + +%\maketitle + +%\BgThispage + +%\tcblistof[\section*]{codigo}{Lista de Códigos} +O pacote \tcboxverb[blank,fuzzy halo=.5mm with green]{abnt} é uma interpretação suficiente, mas não exaustiva, das normas da ABNT. É uma implementação concisa das normas, proporcionando \textit{facilidade} e \textit{flexibilidade} ao usuário. O uso deste pacote não dispensa conhecimento básico de \LaTeX, e não há qualquer garantia de que será aceito pela sua instituição sem nenhuma modificação. Seu objetivo é reduzir ao mínimo a interferência de comandos alheios às classes comuns. +Sugere-se seu emprego com a classe \texttt{book}, mas também pode, porventura, funcionar com outras classes. + +Seus comandos são: + +\begin{codigo}{} +\orientador{} \orientadora{} \coorientador{} \coorientadora{} + +\tipotrabalho{} \local{} \instituicao{} \capa \folhaderosto +\end{codigo} + +Para mudar as fontes dos elementos: + +\begin{codigo}{} +\titlefont{} \authorfont{} \localfont{} \datefont{} +\end{codigo} + +Também são disponibilizados ambientes e listas para quadros e mapas, além das usuais figuras e tabelas. Assim, podem ser inseridas listas de “quadros” e “mapas”: + +\begin{codigo}{} +\listofquadros +\listofmapas +\end{codigo} + + Esses ambientes são usados da mesma forma que uma figura: + +\begin{codigo}{} +\begin{quadro} ... \end{quadro} + +\begin{mapa} ... \end{mapa} +\end{codigo} + +Para fazer citações, use o ambiente \texttt{citacao}: + +\begin{codigo}{} +\begin{citacao} ... \end{citacao} +\end{codigo} + +Se o usuário quiser criar outras listas e ambientes, basta seguir o exemplo abaixo: + +\begin{codigo}{Criando novos ambientes} +\DeclareFloatingEnvironment[fileext=loe,listname={Lista de esculturas},% +within=none]{escultura} +\DeclareCaptionListFormat{listaescultura}{\esculturaname\ #1#2\hfill--\hfill} +\captionsetup[escultura]{listformat=listaescultura} +\makeatletter +\renewcommand*{\l@escultura}{\@dottedtocline{1}{1.5em}{6.5em}} +\makeatother + +\end{codigo} + +Aqui, definimos um novo ambiente “escultura”, com um arquivo de lista de extensão \texttt{loe} e nome “Lista de Figuras”, cujo contador não recomeça em todos os capítulos (\texttt{within=none}). \verb|\l@escultura| serve para redefinir os espaços na lista. Para alternativas de formatação, referir-se à documentação dos pacotes \texttt{newfloat} e \texttt{caption}. + +Todos os outros comandos são os usuais das classes padrão. Recomenda-se o uso do pacote \texttt{biblatex-abnt} para as normas de citação e referências bibliográficas segundo a ABNT. + +Se porventura o usuário necessitar alterações, sugere-se empregar os pacotes \texttt{titlesec} e \texttt{sectsty}, para títulos, e o pacote \texttt{scrlayer-scrpage} para cabeçalhos, e o pacote \texttt{tocstyle} para listas e sumário, ou então redefinir os comandos de sua classe (p. ex., \texttt{book.cls}). + +\end{document} diff --git a/macros/latex/contrib/abnt/abnt.sty b/macros/latex/contrib/abnt/abnt.sty new file mode 100644 index 0000000000..4c89246eba --- /dev/null +++ b/macros/latex/contrib/abnt/abnt.sty @@ -0,0 +1,203 @@ +%% abnt.sty +%% Copyright (c) Youssef Cherem <ycherem(at)gmail.com>, 2018 +% +% 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. + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{abnt}[2018/11/19] +\RequirePackage[left=3cm,top=3cm,right=2cm,bottom=2cm]{geometry} +\RequirePackage{setspace} +\RequirePackage[automark,markcase=used]{scrlayer-scrpage} +\newcommand{\pretextual}{\clearpairofpagestyles} + +\newcommand{\textual}{ +\pagestyle{scrheadings} +\rohead*{\pagemark} +% same as: %\lohead[\pagemark]{\pagemark} +\lehead*{\pagemark} +} + +\RequirePackage{emptypage} + +\RequirePackage{etoolbox}%\ifdefempty{def}{true}{false} + + +\def\@makechapterhead#1{% + %\vspace*{50\p@}% <----------------- Space from top of page to Chapter # + {\parindent \z@ \raggedright \normalfont + \ifnum \c@secnumdepth >\m@ne + \huge\bfseries \thechapter\ \enspace %\. <-- Chapter # + %\par\nobreak + %\vskip 20\p@% <-------------- Space between Chapter # and title + \fi + \interlinepenalty\@M + \Huge \bfseries #1\par\nobreak% <------------------ Chapter title + \vskip 40\p@% <------------------ Space between chapter title and first paragraph +}} + +\def\@makeschapterhead#1{% + %\vspace*{50\p@}% + {\parindent \z@ \centering + \normalfont + \interlinepenalty\@M + \Huge \bfseries #1\par\nobreak + \vskip 40\p@ +}} + + + + +\RequirePackage{newfloat} +\DeclareFloatingEnvironment[fileext=lom,listname={Lista de mapas},within=none]{mapa} +\DeclareFloatingEnvironment[fileext=loq,listname={Lista de quadros},within=none]{quadro} + +\RequirePackage{caption} + +%\DeclareCaptionListFormat{list}{#1#2~--} +%\DeclareCaptionListFormat{list}{#1#2~--} +\DeclareCaptionListFormat{listafigura}{\figurename\ #1#2\hfill--\hfill}%\hfill--\hfill +\DeclareCaptionListFormat{listamapa}{\mapaname\ #1#2\hfill--\hfill} +\DeclareCaptionListFormat{listaquadro}{\quadroname\ #1#2\hfill--\hfill} +\DeclareCaptionListFormat{listatabela}{\tablename\ #1#2\hfill--\hfill} +\captionsetup[figure]{listformat=listafigura} +\captionsetup[mapa]{listformat=listamapa} +\captionsetup[quadro]{listformat=listaquadro} +\captionsetup[table]{listformat=listatabela} +\captionsetup{labelsep=endash} + +\RequirePackage{chngcntr} +\counterwithout{figure}{chapter} +\counterwithout{table}{chapter} + +\renewcommand*{\l@figure}{\@dottedtocline{1}{1.5em}{5.5em}} +\renewcommand*{\l@table}{\@dottedtocline{1}{1.5em}{5.5em}} +\renewcommand*{\l@mapa}{\@dottedtocline{1}{1.5em}{5.5em}} +\renewcommand*{\l@quadro}{\@dottedtocline{1}{1.5em}{6em}} +%\renewcommand{\p@table}{\tablename~} +%\renewcommand*{\p@figure}{\figurename~} %=\DeclareCaptionListFormat{listafigura}{\figurename\#1#2~--} +%\renewcommand*{\p@mapa}{\mapaname~} +%\renewcommand*{\p@quadro}{\quadroname~} + + +\usepackage{tocbasic} + +\DeclareTOCStyleEntry[ +linefill=\TOCLineLeaderFill, +%entryformat=%\large\textbf, +%pagenumberformat=\color{red}, +%entrynumberformat=\color{red}, +%beforeskip= 0pt plus .2pt +%pagenumberformat=%\large\textbf%\normalfont +]{tocline}{chapter} + +\newcommand{\@orientador}{} +\newcommand{\orientador}[1]{\gdef\@orientador{#1}} + +\newcommand{\@orientadora}{} +\newcommand{\orientadora}[1]{\gdef\@orientadora{#1}} + + +\newcommand{\@coorientador}{} +\newcommand{\coorientador}[1]{\gdef\@coorientador{#1}} + +\newcommand{\@coorientadora}{} +\newcommand{\coorientadora}[1]{\gdef\@coorientadora{#1}} + + +\newcommand{\oorientador}{\if\@orientador\empty\relax \else Orientador: \@orientador\fi} +\newcommand{\aorientadora}{\if\@orientadora\empty\relax \else Orientadora: \@orientadora\fi} +\newcommand{\ocoorientador}{\if\@coorientador\empty\relax \else Coorientador: \@coorientador\fi} +\newcommand{\acoorientadora}{\if\@coorientadora\empty\relax \else Coorientadora: \@coorientadora\fi} + + +\newcommand{\@instituicao}{} +\newcommand{\instituicao}[1]{\gdef\@instituicao{#1}} + +\newcommand{\@local}{} +\newcommand{\local}[1]{\gdef\@local{#1}} + +\newcommand{\@tipotrabalho}{} +\newcommand{\tipotrabalho}[1]{\gdef\@tipotrabalho{#1}} + +\newcommand*{\@titlefont}{\bfseries} +\newcommand*{\titlefont}[1]{\gdef\@titlefont{#1}} + +\newcommand*{\@authorfont}{\normalfont} +\newcommand*{\authorfont}[1]{\gdef\@authorfont{#1}} + +\newcommand*{\@localfont}{\normalfont} +\newcommand*{\localfont}[1]{\gdef\@localfont{#1}} + +\newcommand*{\@datefont}{\normalfont} +\newcommand*{\datefont}[1]{\gdef\@datefont{#1}} + +\newcommand*{\@instituicaofont}{\normalfont} +\newcommand*{\instituicaofont}[1]{\gdef\@instituicaofont{#1}} + + +\newcommand{\capa}{% + \begin{titlepage} + \centering + {\@instituicaofont\@instituicao}\par\vspace*{4\baselineskip} + {\@authorfont\@author}\par + \vspace*{4\baselineskip} + {\@titlefont\@title} + \vfill + {\@localfont\@local}\\ + {\@datefont\@date} + + \if@twoside \cleardoublepage \else \clearpage \fi + \end{titlepage} +} + +\newcommand{\folhaderosto}{% + \setcounter{page}{1} +\thispagestyle{empty} +\begin{center} +{\@authorfont\@author} +\vfill +\vfill +{\@titlefont\@title} +\end{center} +\vfill +\bgroup +\leftskip=6cm +\singlespacing% +\noindent\@tipotrabalho\par\medskip +\noindent \ifdefempty{\@orientador}{\aorientadora}{\oorientador}\par +\noindent \ifdefempty{\@coorientador}{\acoorientadora}{\ocoorientador} + +\par +\egroup +\vfill +\vfill +\begin{center} +{\@localfont\@local}\\ +{\@datefont\@date} +\end{center} +\if@twoside \cleardoublepage \else \clearpage \fi +} + + +\newenvironment{citacao}{\vskip -4pt + \singlespacing\setlength{\parindent}{0pt} + \leftskip=6cm\footnotesize}{\medskip} + +\RequirePackage{enumerate} + + + +\onehalfspacing + + +\endinput
\ No newline at end of file |