Resumo
Estrutura mínima de um documento, listas, alinhamento, figuras, tabelas, equações, classes de documento e os pacotes essenciais.
Pré-requisito: Aula 01 (instalação e ambiente).
1. Estrutura mínima de um documento
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc} % (não necessário no XeLaTeX/LuaLaTeX)
\usepackage[T1]{fontenc}
\usepackage[brazil]{babel}
\usepackage{lipsum} % texto de exemplo
\title{Título do documento}
\author{Seu Nome}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
\section{Introdução}
\lipsum[1]
\section{Desenvolvimento}
\subsection{Subseção}
\lipsum[2]
\end{document}1.1 Sumário automático
\tableofcontentsgera automaticamente o índice.- Use
\section,\subsection,\subsubsectionpara organizar.
2. Texto e formatação básica
2.1 Listas
\begin{itemize}
\item Item simples
\item Outro item
\end{itemize}
\begin{enumerate}
\item Primeiro
\item Segundo
\end{enumerate}2.2 Alinhamento
\begin{flushleft}Texto alinhado à esquerda.\end{flushleft}
\begin{center}Texto centralizado.\end{center}
\begin{flushright}Texto à direita.\end{flushright}3. Figuras e tabelas
3.1 Inserir figuras
\usepackage{graphicx}
\begin{figure}[ht]
\centering
\includegraphics[width=0.7\textwidth]{exemplo.png}
\caption{Legenda da figura.}
\label{fig:exemplo}
\end{figure}3.2 Inserir tabelas
\begin{table}[ht]
\centering
\begin{tabular}{|l|c|r|}
\hline
Nome & Idade & Nota \\
\hline
Ana & 23 & 8.5 \\
João & 25 & 9.1 \\
\hline
\end{tabular}
\caption{Tabela de exemplo.}
\label{tab:exemplo}
\end{table}4. Equações
\usepackage{amsmath}
\begin{equation}\label{eq:pitagoras}
a^2 + b^2 = c^2
\end{equation}Para equações sem numeração, use \[ ... \] ou \begin{equation*}.
5. Classes de documento (quando usar)
article: artigos, relatórios curtos.report: capítulos, TCCs, trabalhos maiores.book: livros com capítulos, frontmatter/backmatter.beamer: apresentações.
Dica
A classe define comandos como
\chapter(não disponível emarticle).
6. Pacotes essenciais
6.1 Pacotes básicos
graphicx: imagens.amsmath: equações avançadas.hyperref: links e referências clicáveis.geometry: margens e tamanho de papel.fontenc,inputenc,babel: codificação e idioma (para pdfLaTeX).
6.2 Pacotes recomendados para ABNT/TCC
abntex2eabntex2cite: normas ABNT.tocloft: personalizar sumário.biblatex(ounatbib) +biberpara bibliografia.
7. Configurando o documento (preâmbulo)
\documentclass[12pt,a4paper]{report}
\usepackage[top=3cm,bottom=3cm,left=3cm,right=3cm]{geometry}
\usepackage{setspace}
\doublespacing
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE,RO]{\thepage}
\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[RE]{\nouppercase{\leftmark}}7.1 Fonte e tamanho
Trocar fonte com fontspec (XeLaTeX/LuaLaTeX):
\usepackage{fontspec}
\setmainfont{TeX Gyre Termes}