| 1 |
\documentclass{ltxdoc} |
| 2 |
\usepackage[svgnames,dvipsnames]{xcolor} |
| 3 |
\usepackage{graphicx} |
| 4 |
\usepackage{fontspec} |
| 5 |
\setmainfont{Warnock Pro} |
| 6 |
\setsansfont{Cronos Pro} |
| 7 |
\usepackage[scale=.8]{FiraMono} |
| 8 |
\usepackage{polyglossia} |
| 9 |
\setmainlanguage{brazil} |
| 10 |
\usepackage{tcolorbox} |
| 11 |
\tcbuselibrary{listings,skins,xparse,breakable} |
| 12 |
\usepackage{tikz} |
| 13 |
\usetikzlibrary{positioning,shapes,snakes} |
| 14 |
|
| 15 |
\newtcblisting[auto counter,list inside=codigo,number within=chapter]{codigo}[2][]{% |
| 16 |
%title={Exemplo~\thetcbcounter:~#2}, |
| 17 |
%list entry={\protect\numberline{\thetcbcounter}#2}, |
| 18 |
title={#2}, |
| 19 |
center, |
| 20 |
colback=green!20, |
| 21 |
colbacktitle=green!50, |
| 22 |
colframe=green, |
| 23 |
listing only, |
| 24 |
fonttitle=\bfseries\sffamily\large,coltitle=black,titlerule=0pt,enhanced,drop fuzzy shadow,breakable,#1%halign title=center |
| 25 |
} |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
\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}>>} |
| 30 |
\author{Youssef Cherem} |
| 31 |
\date{2020} |
| 32 |
|
| 33 |
\begin{document} |
| 34 |
\frenchspacing |
| 35 |
|
| 36 |
\begin{center} |
| 37 |
\tikz\node[diamond,shape aspect=1.2,%draw=green,ultra thick, |
| 38 |
remember picture,overlay,%minimum size=0.6\textwidth, |
| 39 |
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]2020}; |
| 40 |
\end{center} |
| 41 |
|
| 42 |
\vspace{4cm} |
| 43 |
|
| 44 |
%\maketitle |
| 45 |
|
| 46 |
%\BgThispage |
| 47 |
|
| 48 |
%\tcblistof[\section*]{codigo}{Lista de Códigos} |
| 49 |
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. |
| 50 |
Sugere-se seu emprego com a classe \tcboxverb[blank,fuzzy halo=.5mm with teal]{book} ou com a classe \tcboxverb[blank,fuzzy halo=.5mm with red]{scrbook}. |
| 51 |
|
| 52 |
Comandos para elementos na capa e folha de rosto: |
| 53 |
|
| 54 |
\begin{codigo}{} |
| 55 |
\orientador{} \orientadora{} \coorientador{} \coorientadora{} |
| 56 |
|
| 57 |
\tipotrabalho{} \local{} \instituicao{} \capa \folhaderosto |
| 58 |
\end{codigo} |
| 59 |
|
| 60 |
Para mudar as fontes dos elementos: |
| 61 |
|
| 62 |
\begin{codigo}{} |
| 63 |
\titlefont{} \authorfont{} \localfont{} \datefont{} |
| 64 |
\end{codigo} |
| 65 |
|
| 66 |
Para elementos pré-textuais (sem números de página) e textuais (com números de página): |
| 67 |
|
| 68 |
\begin{codigo}{} |
| 69 |
\pretextual \textual |
| 70 |
\end{codigo} |
| 71 |
|
| 72 |
Esses comandos não são obrigatórios nem aplicados por padrão. O usuário pode redefinir o cabeçalho como quiser, usando os comandos do pacote \tcboxverb[blank,fuzzy halo=.5mm with green]{scrlayer-scrpage}. |
| 73 |
|
| 74 |
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”: |
| 75 |
|
| 76 |
\begin{codigo}{} |
| 77 |
\listofquadros |
| 78 |
\listofmapas |
| 79 |
\end{codigo} |
| 80 |
|
| 81 |
Esses ambientes são usados da mesma forma que uma figura: |
| 82 |
|
| 83 |
\begin{codigo}{} |
| 84 |
\begin{quadro} ... \end{quadro} |
| 85 |
|
| 86 |
\begin{mapa} ... \end{mapa} |
| 87 |
\end{codigo} |
| 88 |
|
| 89 |
Para fazer citações, use o ambiente \texttt{citacao}: |
| 90 |
|
| 91 |
\begin{codigo}{} |
| 92 |
\begin{citacao} ... \end{citacao} |
| 93 |
\end{codigo} |
| 94 |
|
| 95 |
Se o usuário quiser criar outras listas e ambientes, basta seguir o exemplo abaixo: |
| 96 |
|
| 97 |
\begin{codigo}{Criando novos ambientes} |
| 98 |
\DeclareFloatingEnvironment[fileext=loe,listname={Lista de esculturas},% |
| 99 |
within=none]{escultura} |
| 100 |
\DeclareCaptionListFormat{listaescultura}{\esculturaname\ #1#2\hfill--\hfill} |
| 101 |
\captionsetup[escultura]{listformat=listaescultura} |
| 102 |
\makeatletter |
| 103 |
\renewcommand*{\l@escultura}{\@dottedtocline{1}{1.5em}{6.5em}} |
| 104 |
\makeatother |
| 105 |
|
| 106 |
\end{codigo} |
| 107 |
|
| 108 |
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}. |
| 109 |
|
| 110 |
Uma alternativa simplificada para essas definições está disponível ao utilizar uma das classes \tcboxverb[blank,fuzzy halo=.5mm with red]{KOMA-Script} (\texttt{scrbook}, \texttt{scrartcl} e \texttt{scrreport}): |
| 111 |
|
| 112 |
\begin{codigo}{} |
| 113 |
\DeclareNewTOC[% |
| 114 |
type=exercicio,% |
| 115 |
types=exercicios,% |
| 116 |
float,% define a floating environment |
| 117 |
floattype=4,% |
| 118 |
name=Exercício,% |
| 119 |
%counterwithin=chapter, |
| 120 |
listname={Lista de Exercícios}, |
| 121 |
%tocentryindent=0pt,% <- added |
| 122 |
tocentrydynnumwidth,% <- added |
| 123 |
tocentrynumsep=0pt% <- added |
| 124 |
]{loe} |
| 125 |
\setuptoc{loe}{chapteratlist} |
| 126 |
|
| 127 |
\BeforeStartingTOC[loe]{\def\autodot{\hfill~--~\hfill}} |
| 128 |
\end{codigo} |
| 129 |
|
| 130 |
|
| 131 |
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. |
| 132 |
|
| 133 |
|
| 134 |
\begin{codigo}{Exemplo com a classe scrbook} |
| 135 |
\documentclass[footsepline=true,headsepline=true]{scrbook} |
| 136 |
\usepackage{abnt} |
| 137 |
\usepackage{xcolor,xcolor-material} |
| 138 |
\usepackage[sfdefault,lf]{FiraSans} |
| 139 |
|
| 140 |
%se quiser linha no rodapé |
| 141 |
\ModifyLayer[addvoffset=-.8ex]{scrheadings.foot.above.line} |
| 142 |
\ModifyLayer[addvoffset=-.8ex]{plain.scrheadings.foot.above.line} |
| 143 |
|
| 144 |
%\pagestyle{scrheadings} |
| 145 |
%\clearscrheadfoot |
| 146 |
%\ihead{\headmark} |
| 147 |
%\ohead{\pagemark} |
| 148 |
% pretextual já faz isso. |
| 149 |
|
| 150 |
\setkomafont{footsepline}{\color{orange}} |
| 151 |
\setkomafont{headsepline}{\color{teal!50!yellow}} |
| 152 |
\setkomafont{pagenumber}{\normalfont\bfseries\sffamily\color{red}} |
| 153 |
|
| 154 |
%\renewcommand*{\chapterpagestyle}{scrheadings} %não necessário - já implementado |
| 155 |
|
| 156 |
%todos esses elementos iguais |
| 157 |
\RedeclareSectionCommands |
| 158 |
[beforeskip=\baselineskip, afterskip=\baselineskip,font=\normalsize\bfseries] |
| 159 |
{part,chapter, |
| 160 |
section,subsection,subsubsection} |
| 161 |
|
| 162 |
|
| 163 |
\setkomafont{chapter}{\color{orange}} \setkomafont{section}{\color{teal}} |
| 164 |
\setkomafont{subsection}{\color{green!50!black}} |
| 165 |
|
| 166 |
%\setkomafont{disposition}{\normalsize} % não funciona, redefinição com |
| 167 |
%\RedeclareSectionCommand ou \RedeclareSectionCommands |
| 168 |
|
| 169 |
\KOMAoptions{headsepline=2pt:\textwidth,footsepline=2pt:\textwidth} |
| 170 |
|
| 171 |
%medidas |
| 172 |
\DeclareNewLayer[ |
| 173 |
background, |
| 174 |
%outermargin, |
| 175 |
%topmargin, |
| 176 |
contents=\layercontentsmeasure |
| 177 |
]{measurelayer} |
| 178 |
\AddLayersToPageStyle{@everystyle@}{measurelayer} |
| 179 |
\usepackage{showframe} |
| 180 |
|
| 181 |
\begin{document} |
| 182 |
|
| 183 |
\pretextual |
| 184 |
|
| 185 |
\textual |
| 186 |
|
| 187 |
\chapter{Capítulo} |
| 188 |
\section{Seção} |
| 189 |
\subsection{Subseção} |
| 190 |
|
| 191 |
\chapter{Capítulo} |
| 192 |
\section{Seção} |
| 193 |
\subsection{Subseção} |
| 194 |
\newpage |
| 195 |
\subsection{title} |
| 196 |
\end{document} |
| 197 |
|
| 198 |
\end{codigo} |
| 199 |
|
| 200 |
|
| 201 |
\begin{tcolorbox}[center,width=.8\textwidth] |
| 202 |
\centering |
| 203 |
\includegraphics[width=\linewidth]{koma} |
| 204 |
\end{tcolorbox} |
| 205 |
|
| 206 |
|
| 207 |
\end{document} |