Documente Academic
Documente Profesional
Documente Cultură
23 de Setembro, 2013
(ESALQ/USP) A
Introdução ao L TEX 1 / 146
Plano do curso
23/09 04/10
18:3020:30
Lab. A ou B (LCE)
Introdução
Ambientes comuns
Ambiente matemático
BibTEX
Beamer
Pôster
knitr (LATEX + R)
(ESALQ/USP) A
Introdução ao L TEX 2 / 146
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 3 / 146
Introdução
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 4 / 146
Introdução Histórico
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 5 / 146
Introdução Histórico
TEX
Programming (1969)
Tipograa
TEX (1977)
(ESALQ/USP) A
Introdução ao L TEX 6 / 146
Introdução Histórico
TEX
(ESALQ/USP) A
Introdução ao L TEX 7 / 146
Introdução Histórico
TEX
O nome do jogo
τ χνoλoγı́α (tecnologia) → arte e tecnologia
τ χ → TEX
Pronunciado tec
O E deslocado serve para salientar a importância da tipograa e
diferenciar de outros sistemas
(ESALQ/USP) A
Introdução ao L TEX 8 / 146
Introdução Histórico
TEX
Grandes vantagens:
Equações matemáticas
Espaçamento entre caracteres e hifenização
Previne erros de formatação, forçando o autor a declarar e pensar na
sequência lógica do documento
Milhares de pacotes adicionais (via CTAN)
(ESALQ/USP) A
Introdução ao L TEX 9 / 146
Introdução Histórico
LATEX
(ESALQ/USP) A
Introdução ao L TEX 10 / 146
Introdução Histórico
LATEX
(ESALQ/USP) A
Introdução ao L TEX 11 / 146
Introdução Histórico
LATEX
WYSIWYM (What You See Is What WYSIWYG (What You See Is What
You Mean) You Get )
LATEX
OpenOce, MS Oce, . . .
Foco no conteúdo, ao invés da
Necessário se preocupar com a
formatação
formatação
Necessário compilar para gerar
Resultado aparece com a
o resultado
edição
Maior exibilidade de
Formatação restrita
formatação, com alta qualidade
(ESALQ/USP) A
Introdução ao L TEX 12 / 146
Introdução Instalação
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 13 / 146
Introdução Instalação
Distribuições
Uma distribuição do LATEX é uma versão que agrega alguns (ou muitos)
pacotes adicionais. As principais são:
Linux: TEXLive
Mac OS X: MacTEX
Windows: MikTEX
Multi-plataforma: XeTEX, LuaTEX
(ESALQ/USP) A
Introdução ao L TEX 14 / 146
Introdução Instalação
Editores
(ESALQ/USP) A
Introdução ao L TEX 15 / 146
Conceitos iniciais
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 16 / 146
Conceitos iniciais Estrutura do Arquivo
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 17 / 146
Conceitos iniciais Estrutura do Arquivo
Estrutura do Arquivo
\end{document}
será interpretado como o conteúdo do documento
Todo comando começa com barra invertida (\)
(ESALQ/USP) A
Introdução ao L TEX 18 / 146
Conceitos iniciais Estrutura do Arquivo
Estrutura do Arquivo
\end{document}
(ESALQ/USP) A
Introdução ao L TEX 19 / 146
Conceitos iniciais Formatação
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 20 / 146
Conceitos iniciais Formatação
Formatação
(ESALQ/USP) A
Introdução ao L TEX 21 / 146
Conceitos iniciais Formatação
Formatação
Conguração típica:
\documentclass[a4paper]{article}
(ESALQ/USP) A
Introdução ao L TEX 22 / 146
Conceitos iniciais Formatação
Acentuação
O pacote
\usepackage[brazil]{babel}
ativa o suporte à língua portuguesa
Já os pacotes
\usepackage[latin1]{inputenc} % use utf8 para Linux e Mac
\usepackage[T1]{fontenc}
são pacotes LATEX que denem a codicação de caracteres (latin1,
utf8, . . .), e permitem acentuação pelo teclado
Um detalhe: frases iniciadas com % são comentários, e podem ser
usados em qualquer parte do documento
(ESALQ/USP) A
Introdução ao L TEX 23 / 146
Conceitos iniciais Formatação
Conguração mínima
\documentclass{article}
\usepackage[brazil]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\end{document}
(ESALQ/USP) A
Introdução ao L TEX 24 / 146
Conceitos iniciais Formatação
Exercício 1
Escreva o texto exatamente como está digitado a seguir:
(ESALQ/USP) A
Introdução ao L TEX 25 / 146
Conceitos iniciais Formatação
Acentuação
Quando o pacote de acentuação não tiver sido declarado (ou você quiser
voltar as origens do TEX . . .)
Acento Comando
ç \c{c}
è \`{e}
é \'{e}
ê \^{e}
õ \~{o}
ü \"{u}
`` ''
(ESALQ/USP) A
Introdução ao L TEX 26 / 146
Conceitos iniciais Formatação
(ESALQ/USP) A
Introdução ao L TEX 27 / 146
Conceitos iniciais Formatação
Estilo Comando
Negrito {\bf Negrito}
Inclinado {\sl Inclinado}
Itálico {\it Itálico}
Datilografado {\tt Datilografado}
Romano {\rm Romano}
Sem Serifa {\sf Sans Serif}
Caixa Alta {\sc Caixa Alta}
(ESALQ/USP) A
Introdução ao L TEX 28 / 146
Conceitos iniciais Formatação
Tamanho Comando
Tamanho {\tiny Tamanho}
Tamanho {\scriptsize Tamanho}
Tamanho {\footnotesize Tamanho}
Tamanho {\small Tamanho}
Tamanho {\normalsize Tamanho}
Tamanho {\large Tamanho}
Tamanho {\Large Tamanho}
Tamanho {\LARGE Tamanho}
Tamanho {\huge Tamanho}
Tamanho {\Huge Tamanho}
(ESALQ/USP) A
Introdução ao L TEX 29 / 146
Conceitos iniciais Formatação
Exercício 2
Coloque em negrito as palavras: macros e tipográfica.
Coloque em itálico o termo: processador de textos
Use a fonte sem serifa para as palavras: artigos e livros
Use o tamanho \Large para o termo: textos matemáticos e
científicos
Use o tamanho \tiny para o termo: assuntos diversos
(ESALQ/USP) A
Introdução ao L TEX 30 / 146
Conceitos iniciais Formatação
Alinhamento
\begin{flushleft}
Texto alinhado à esquerda.
\end{flushleft}
Texto alinhado à esquerda.
\begin{flushright}
Texto alinhado à direita.
\end{flushright}
Texto alinhado à direita.
\begin{center}
Texto centralizado.
\end{center}
Texto centralizado.
(ESALQ/USP) A
Introdução ao L TEX 31 / 146
Conceitos iniciais Formatação
Caracter Comando
$ \$
{} \{ \}
\ $\backslash$
# \#
% \%
& \&
_ \_
∼ $\sim$
\^{}
\~{}
(ESALQ/USP) A
Introdução ao L TEX 32 / 146
Conceitos iniciais Formatação
Exercício 3
Escreva o seguinte texto centralizado:
O Word não possui nem ~10% da capacidade de
editoração do LaTeX!
(ESALQ/USP) A
Introdução ao L TEX 33 / 146
Conceitos iniciais Formatação
Capa
\title{Título do Trabalho}
\author{Donald Knuth \and Leslie Lamport}
\date{\today} % ou escrever a data como 23/09/13
Com estas informações o usuário pode criar uma capa, inserindo o comando
\maketitle
no local onde deseja que a capa seja criada (geralmente logo após o
\begin{document})
(ESALQ/USP) A
Introdução ao L TEX 34 / 146
Conceitos iniciais Formatação
Sumário
\tableofcontents
no local onde deseja que ele apareça (geralmente logo após o \maketitle)
(ESALQ/USP) A
Introdução ao L TEX 35 / 146
Conceitos iniciais Formatação
Sumário
\tableofcontents
no local onde deseja que ele apareça (geralmente logo após o \maketitle)
Atenção!
É necessário compilar 2 vezes para o sumário ser atualizado!
(ESALQ/USP) A
Introdução ao L TEX 35 / 146
Conceitos iniciais Formatação
Exercício 4
Monte uma capa
Insira uma seção, e duas subseções no documento
Insira o sumário
(ESALQ/USP) A
Introdução ao L TEX 36 / 146
Conceitos iniciais Formatação
Cor
Para a utilização de cores pré denidas é necessária a instalação do pacote
xcolor, além disso, deve ser acrescentada a opção [dvipsnames].
\textcolor{red}{texto} ⇒ texto
\textcolor[rgb]{1.00,0.00,0.00}{texto} ⇒ texto
\textcolor{green}{texto} ⇒ texto
\textcolor[RGB]{0,255,0}{texto} ⇒ texto
\textcolor{magenta}{texto} ⇒ texto
\textcolor[rgb]{1.00,0.00,0.50}{texto} ⇒ texto
Espaçamento
(ESALQ/USP) A
Introdução ao L TEX 38 / 146
Conceitos iniciais Formatação
Exercício 5
Escreva o texto exatamente como está digitado a seguir:
(ESALQ/USP) A
Introdução ao L TEX 39 / 146
Ambientes
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 40 / 146
Ambientes
Ambientes
(ESALQ/USP) A
Introdução ao L TEX 41 / 146
Ambientes Textos Alinhados
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 42 / 146
Ambientes Textos Alinhados
Textos Alinhados
Em LATEX o texto por default aparece justicado, no entanto, é possível
alterar a forma de alinhamento.
Ambiente flushleft: tudo que estiver entre
\begin{flushleft}
\end{flushleft}
será alinhado à esquerda;
Ambiente flushright: tudo que estiver entre
\begin{flushright}
\end{flushright}
será alinhado à direita;
Ambiente center: tudo que estiver entre
\begin{center}
\end{center}
será centralizado;
(ESALQ/USP) A
Introdução ao L TEX 43 / 146
Ambientes Ambiente Verbatim
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 44 / 146
Ambientes Ambiente Verbatim
Ambiente Verbatim
\end{verbatim}
será impresso idêntico ao texto digitado.
No parágrafo: para escrever sem formatação no parágrafo deve-se
utilizar o comando
\verb|texto|, \verb+texto+ ou \verb=texto=.
Ob.: deve-se tomar cuidado para que o simbolo escolhido para o
comando \verb não esteja presente no texto.
(ESALQ/USP) A
Introdução ao L TEX 45 / 146
Ambientes Ambiente Verbatim
Ambiente Verbatim
Exemplo 1
\begin{verbatim}
O texto \textbf{não} apresenta formatação.
O texto impresso pelo \LaTex{} será idêntico ao texto digitado.
\end{verbatim}
Exemplo 2
No \verb|\LaTeX{}| o comando \verb|\newpage| inicia uma
nova página.
Exercício 6
Reproduza o seguinte texto:
2. Vetores e Matrizes
A <- matrix(c(1,2,3,4,5,6),ncol=3,nrow=2) matrix 3 x 2
B <- matrix(c(1,2,3,4,5,6),ncol=2,nrow=3) matrix 2 x 3
V <- A%*%B produto A B
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 48 / 146
Ambientes Ambiente Minipage
Ambiente Minipage
\begin{minipage}[alinhamento][altura][alinhamento]{largura}
\end{minipage}
(ESALQ/USP) A
Introdução ao L TEX 49 / 146
Ambientes Ambiente Minipage
Ambiente Minipage
Exemplo
Nesta janela também podemos
adicionar textos, imagens ou
Nessa janela podemos adicionar tabelas. Isso possibilita inserir
textos, imagens ou tabelas. várias guras, textos ao lado
de imagens, textos ao lado de
tabelas.
(ESALQ/USP) A
Introdução ao L TEX 50 / 146
Ambientes Ambiente Minipage
Ambiente Minipage
Exemplo
O Exemplo foi gerado através do código
\begin{minipage}[c]{5.3cm}
Nessa janela podemos adicionar textos, imagens ou tabelas.
\end{minipage} \hfill
\begin{minipage}[c]{5.3cm}
Nesta janela também podemos adicionar textos, imagens ou
tabelas. Isso possibilita inserir várias figuras, textos
ao lado de imagens, textos ao lado de tabelas.
\end{minipage}
(ESALQ/USP) A
Introdução ao L TEX 51 / 146
Ambientes Ambiente Minipage
Ambiente Minipage
Exercício 7
Escreva o código abaixo em um ambiente minipage e ao lado apresentar o
resultado dom código
O LATEX é legal!
Escrever em negrito
Sem formatação.
(ESALQ/USP) A
Introdução ao L TEX 52 / 146
Ambientes Ambiente Lista
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 53 / 146
Ambientes Ambiente Lista
Ambiente Lista
(ESALQ/USP) A
Introdução ao L TEX 54 / 146
Ambientes Ambiente Lista
Ambiente Lista
\begin{itemize}
\item Adição;
Adição;
\begin{itemize}
Naturais;
\item Naturais; Inteiros;
\item Inteiros;
Subtração;
\end{itemize}
\item Subtração; Multiplicação;
\item Multiplicação; Divisão.
\item Divisão.
\end{itemize}
(ESALQ/USP) A
Introdução ao L TEX 55 / 146
Ambientes Ambiente Lista
Ambiente Lista
\begin{enumerate}
\item Adição; 1 Adição;
\begin{enumerate}
1 Naturais;
\item Naturais; 2 Inteiros;
\item Inteiros;
2 Subtração;
\end{enumerate}
\item Subtração; 3 Multiplicação;
\item Multiplicação; 4 Divisão.
\item Divisão.
\end{enumerate}
(ESALQ/USP) A
Introdução ao L TEX 56 / 146
Ambientes Ambiente Lista
Ambiente Lista
\begin{description}
\item [Windows] Sistema operacional da Microsoft;
\item [MacOS] Sistema operacional da Apple;
\item [Linux] Sistema operacional livre.
\end{description}
(ESALQ/USP) A
Introdução ao L TEX 57 / 146
Ambientes Ambiente Lista
Exercício 8
Crie uma lista numerada com 3 itens
No terceiro item crie uma lista comum com pelo menos 2 items
(ESALQ/USP) A
Introdução ao L TEX 58 / 146
Ambientes Ambiente Lista
Ambiente Lista
\begin{enumerate}
\item Adição; 1 Adição;
\begin{enumerate}[a.]
a. Naturais;
\item Naturais; b. Inteiros;
\item Inteiros;
2 Subtração;
\end{enumerate}
\item Subtração; 3 Multiplicação;
\item Multiplicação; 4 Divisão.
\item Divisão.
\end{enumerate}
(ESALQ/USP) A
Introdução ao L TEX 59 / 146
Ambientes Ambiente Lista
Ambiente Lista
\begin{enumerate}[1)]
\item Adição; 1) Adição;
\begin{enumerate}[a -] a - Naturais;
\item Naturais; b - Inteiros;
\item Inteiros;
2) Subtração;
\end{enumerate}
\item Subtração; 3) Multiplicação;
\item Multiplicação; 4) Divisão.
\item Divisão.
\end{enumerate}
(ESALQ/USP) A
Introdução ao L TEX 60 / 146
Ambientes Ambiente Lista
Ambiente Lista
Exercício 9
Reproduza a lista a seguir:
(ESALQ/USP) A
Introdução ao L TEX 61 / 146
Inserindo Figuras
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 62 / 146
Inserindo Figuras
Figuras e Tabelas
(ESALQ/USP) A
Introdução ao L TEX 63 / 146
Inserindo Figuras
Pacote: graphicx
(ESALQ/USP) A
Introdução ao L TEX 64 / 146
Inserindo Figuras
Pacote: graphicx
Comando: includegraphics
(ESALQ/USP) A
Introdução ao L TEX 64 / 146
Inserindo Figuras
\includegraphics[opção]{figura.*}
(ESALQ/USP) A
Introdução ao L TEX 65 / 146
Inserindo Figuras
\includegraphics[opção]{figura.*}
(ESALQ/USP) A
Introdução ao L TEX 65 / 146
Inserindo Figuras
(ESALQ/USP) A
Introdução ao L TEX 66 / 146
Inserindo Figuras
Posicionamento;
Legenda;
Referência.
(ESALQ/USP) A
Introdução ao L TEX 66 / 146
Inserindo Figuras
\begin{figure}[posicionamento]
\centering
\includegraphics[opção1, opção2, ...]{figura.*}
\caption{legenda}
\label{nome de referência}
\end{figure}
(ESALQ/USP) A
Introdução ao L TEX 67 / 146
Inserindo Figuras
(ESALQ/USP) A
Introdução ao L TEX 68 / 146
Inserindo Figuras
(ESALQ/USP) A
Introdução ao L TEX 68 / 146
Inserindo Figuras
(ESALQ/USP) A
Introdução ao L TEX 69 / 146
Inserindo Figuras
Solução:
\begin{figure}[H]
\centering
\includegraphics[height=10cm, width=10cm]{figura1.png}
\caption{Exemplo de uma figura no \LaTeX{}}
\label{fig:ex1}
\end{figure}
(ESALQ/USP) A
Introdução ao L TEX 70 / 146
Inserindo Figuras
(ESALQ/USP) A
Introdução ao L TEX 71 / 146
Inserindo Figuras
(ESALQ/USP) A
Introdução ao L TEX 72 / 146
Inserindo Figuras
(ESALQ/USP) A
Introdução ao L TEX 72 / 146
Inserindo Tabelas
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 73 / 146
Inserindo Tabelas Ambiente Tabular
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 74 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
(ESALQ/USP) A
Introdução ao L TEX 75 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
\end{tabular};
(ESALQ/USP) A
Introdução ao L TEX 75 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
\end{tabular};
Na especificação deve-se denir a justicação de cada célula. A
quantidade de colunas é calculada em função do número de
parâmetros denidos;
(ESALQ/USP) A
Introdução ao L TEX 75 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
(ESALQ/USP) A
Introdução ao L TEX 76 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
(ESALQ/USP) A
Introdução ao L TEX 77 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
(ESALQ/USP) A
Introdução ao L TEX 77 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
Exemplo 1
\begin{tabular}{lcr}
\hline
Elemento & Porcentagem & Fator \\ \hline
Ferro & 10 & 3 \\
Cloro & 33 & 7 \\
Oxigênio & 51 & 1 \\ \hline
\end{tabular}
(ESALQ/USP) A
Introdução ao L TEX 78 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
Exemplo 1
\begin{tabular}{lcr}
\hline
Elemento & Porcentagem & Fator \\ \hline
Ferro & 10 & 3 \\
Cloro & 33 & 7 \\
Oxigênio & 51 & 1 \\ \hline
\end{tabular}
(ESALQ/USP) A
Introdução ao L TEX 78 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
produz:
Elemento Porcentagem Fator
Ferro 10 3
Cloro 33 7
Oxigênio 51 1
(ESALQ/USP) A
Introdução ao L TEX 79 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
Exemplo 2
\begin{tabular}{l|c|r}
\hline
Elemento & Porcentagem & Fator \\ \hline
Ferro & 10 & 3 \\ \cline{2-2}
Cloro & 33 & 7 \\ \cline{2-3}
Oxigênio & 51 & 1 \\ \hline \hline
\end{tabular}
(ESALQ/USP) A
Introdução ao L TEX 80 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
produz:
Elemento Porcentagem Fator
Ferro 10 3
Cloro 33 7
Oxigênio 51 1
(ESALQ/USP) A
Introdução ao L TEX 81 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
Exercício 10
1 - Reproduza a tabela a seguir
Posição Município População
1 São Paulo 11.376.685
2 Rio de Janeiro 6.690.290
3 Salvador 2.710.968
4 Brasília 2.648.532
5 Fortaleza 2.500.194
(ESALQ/USP) A
Introdução ao L TEX 82 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
É possível criar tabelas e quadros com multicolunas, ou seja, mesclar mais
de uma célula, usando o comando \multicolumn. A sintaxe do comando é
dado por:
\begin{tabular}{especificação}
\hline
\multicolumn{n}{especificação}{texto}
.
.
.
\end{tabular}
em que
n é o número de colunas a serem mescladas;
especificação é como será justicada a coluna;
texto é o que será impresso dentro da célula.
(ESALQ/USP) A
Introdução ao L TEX 83 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
Exemplo 1
\begin{tabular}{|c|c|c|c|c|}
\hline
\multicolumn{5}{|c|}{Horário das aulas} \\\hline
SEG & TER & QUA & QUI & SEX \\\hline
12:00 & 14:00 & 11:30 & 17:30 & 18:00 \\\hline
\end{tabular}
(ESALQ/USP) A
Introdução ao L TEX 84 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
produz:
Horário das aulas
SEG TER QUA QUI SEX
12:00 14:00 11:30 17:30 18:00
(ESALQ/USP) A
Introdução ao L TEX 85 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
Exemplo 2
\begin{tabular}{l|lr|c}
\hline
Coluna 1 & \multicolumn{2}{c|}{Colunas 2 e 3}& Coluna 4 \\\hline
1000 & 2000 & 3000 & 4000 \\\cline{2-3}
& 2000 & 3000 & 6000 \\\hline
3000 & 2000 & 3000 & 4000 \\\cline{2-3}
& 2000 & 3000 & 6000 \\\hline
5000 & 2000 & 3000 & 4000 \\\cline{2-3}
& 2000 & 3000 & 6000 \\\hline
7000 & 2000 & 3000 & 4000 \\\hline
\end{tabular}
(ESALQ/USP) A
Introdução ao L TEX 86 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
produz:
Coluna 1 Colunas 2 e 3 Coluna 4
1000 2000 3000 4000
2000 3000 6000
3000 2000 3000 4000
2000 3000 6000
5000 2000 3000 4000
2000 3000 6000
7000 2000 3000 4000
(ESALQ/USP) A
Introdução ao L TEX 87 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
Exercício 11
Reproduza o quadro a seguir
2 semestre 2013
Horário Seg Ter Qua Qui Sex
13:30-14:30
14:30-15:30
15:30-17:30
17:30-19:00
19:00-21:00
21:00-22:00
(ESALQ/USP) A
Introdução ao L TEX 88 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
(ESALQ/USP) A
Introdução ao L TEX 89 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
Exemplo
\begin{tabular}{llc}
\hline
\multirow{2}{*}{Coluna 1} & \multirow{2}{*}{Colunas 2} & Outra \\
& & coluna \\ \hline
\multirow{2}{*}{Primeira} & Segunda & 385 \\ \cline{2-3}
& Segunda & 397 \\ \hline
\multirow{2}{*}{Primeira} & Segunda & 376 \\ \cline{2-3}
& Segunda & 390 \\ \hline
\end{tabular}
(ESALQ/USP) A
Introdução ao L TEX 90 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
resulta em:
Outra
Coluna 1 Colunas 2
coluna
Segunda 385
Primeira
Segunda 397
Segunda 376
Primeira
Segunda 390
(ESALQ/USP) A
Introdução ao L TEX 91 / 146
Inserindo Tabelas Ambiente Tabular
Ambiente Tabular
Exercício 12
Reproduza o quadro a seguir
Brasil
Estado Time
São Paulo
Santos
São Paulo
Palmeiras
Curintha
Flamengo
Botafogo
Rio de Janeiro
Vasco
Fluminense
(ESALQ/USP) A
Introdução ao L TEX 92 / 146
Inserindo Tabelas Ambiente Table
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 93 / 146
Inserindo Tabelas Ambiente Table
Ambiente Table
(ESALQ/USP) A
Introdução ao L TEX 94 / 146
Inserindo Tabelas Ambiente Table
Ambiente Table
O ambiente tabular nem sempre satisfaz as nossas necessidades quando precisamos criar
uma tabela;
(ESALQ/USP) A
Introdução ao L TEX 94 / 146
Inserindo Tabelas Ambiente Table
Ambiente Table
O ambiente tabular nem sempre satisfaz as nossas necessidades quando precisamos criar
uma tabela;
como:
título/legenda;
numeração;
referência;
lista de tabelas.
(ESALQ/USP) A
Introdução ao L TEX 94 / 146
Inserindo Tabelas Ambiente Table
Ambiente Table
O ambiente tabular nem sempre satisfaz as nossas necessidades quando precisamos criar
uma tabela;
como:
título/legenda;
numeração;
referência;
lista de tabelas.
A sintaxe do comando é:
\begin{table}{especificação}
\caption{}
\begin{tabular}{especificações}
\end{tabular}
\label{}
\end{table}
(ESALQ/USP) A
Introdução ao L TEX 94 / 146
Inserindo Tabelas Ambiente Table
Ambiente Table
(ESALQ/USP) A
Introdução ao L TEX 95 / 146
Inserindo Tabelas Ambiente Table
Ambiente Table
Exemplo
\begin{table}[!tp]
\caption{Tabela sem sentido} \label{tab:semsentido}
\centering
\begin{tabular}{l|l} \hline
Parâmetro & Valor \\ \hline\hline
XYZ & 123 \\
ABC & 321 \\ \hline
\end{tabular}
\end{table}
(ESALQ/USP) A
Introdução ao L TEX 96 / 146
Inserindo Tabelas Ambiente Table
Ambiente Table
resulta em:
A Tabela 4 apresenta . . .
(ESALQ/USP) A
Introdução ao L TEX 97 / 146
Inserindo Tabelas Ambiente Table
Ambiente Tabular
Exercício 13
Reproduza tabela a seguir MUDAR
2 semestre 2013
Horário Seg Ter Qua Qui Sex
13:30-14:30
14:30-15:30
15:30-17:30
17:30-19:00
19:00-21:00
21:00-22:00
(ESALQ/USP) A
Introdução ao L TEX 98 / 146
Inserindo Tabelas Exportando Tabelas
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 99 / 146
Inserindo Tabelas Exportando Tabelas
R para LATEX
(ESALQ/USP) A
Introdução ao L TEX 100 / 146
Inserindo Tabelas Exportando Tabelas
R para LATEX
Exemplo:
Comandos de entrada no R:
x=rnorm(5,2,2)
y=rnorm(5,4,2)
A=data.frame(x,y)
require(xtable)
xtable(A)
(ESALQ/USP) A
Introdução ao L TEX 100 / 146
Inserindo Tabelas Exportando Tabelas
R para LATEX
(ESALQ/USP) A
Introdução ao L TEX 100 / 146
Inserindo Tabelas Exportando Tabelas
(ESALQ/USP) A
Introdução ao L TEX 101 / 146
Inserindo Tabelas Exportando Tabelas
(ESALQ/USP) A
Introdução ao L TEX 101 / 146
Inserindo Tabelas Exportando Tabelas
(ESALQ/USP) A
Introdução ao L TEX 101 / 146
Inserindo Tabelas Exportando Tabelas
(ESALQ/USP) A
Introdução ao L TEX 101 / 146
Inserindo Tabelas Exportando Tabelas
(ESALQ/USP) A
Introdução ao L TEX 101 / 146
Inserindo Tabelas Exportando Tabelas
(ESALQ/USP) A
Introdução ao L TEX 102 / 146
Inserindo Tabelas Exportando Tabelas
(ESALQ/USP) A
Introdução ao L TEX 102 / 146
Inserindo Tabelas Exportando Tabelas
(ESALQ/USP) A
Introdução ao L TEX 102 / 146
Inserindo Tabelas Exportando Tabelas
(ESALQ/USP) A
Introdução ao L TEX 102 / 146
Inserindo Tabelas Exportando Tabelas
(ESALQ/USP) A
Introdução ao L TEX 102 / 146
Ambiente Matemático
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 103 / 146
Ambiente Matemático Fórmulas Matemáticas
Plano de aula
1 Introdução
Histórico
Instalação
2 Conceitos iniciais
Estrutura do Arquivo
Formatação
3 Ambientes
Textos Alinhados
Ambiente Verbatim
Ambiente Minipage
Ambiente Lista
4 Inserindo Figuras
5 Inserindo Tabelas
Ambiente Tabular
Ambiente Table
Exportando Tabelas
6 Ambiente Matemático
(ESALQ/USP) A
Introdução ao L TEX 104 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 105 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 105 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 105 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas Matemáticas
Exemplo: a + b − 2c
(ESALQ/USP) A
Introdução ao L TEX 105 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas Matemáticas
Exemplo: a + b − 2c
$a+b-2c$
(ESALQ/USP) A
Introdução ao L TEX 105 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas Matemáticas
Exemplo: a + b − 2c
$a+b-2c$
a + b − 2c
(ESALQ/USP) A
Introdução ao L TEX 105 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas Matemáticas
Exemplo: a + b − 2c
$a+b-2c$
a + b − 2c
$$a+b-2c$$
(ESALQ/USP) A
Introdução ao L TEX 105 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas Matemáticas
Exemplo: a + b − 2c
$a+b-2c$
a + b − 2c
$$a+b-2c$$
a + b − 2c
(ESALQ/USP) A
Introdução ao L TEX 105 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 14
Reproduza o exemplo a seguir:
5x − 2 = 5.7 − 2 = 35 − 2 = 33
(ESALQ/USP) A
Introdução ao L TEX 106 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas numeradas
Eqnarray
(ESALQ/USP) A
Introdução ao L TEX 107 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas numeradas
Eqnarray
O ambiente eqnarray é o mais utilizado para apresentar fórmulas
matemáticas.
\begin{eqnarray}
5x=10\\
x=2
\end{eqnarray}
5x = 10 (2)
x =2 (3)
(ESALQ/USP) A
Introdução ao L TEX 107 / 146
Ambiente Matemático Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 108 / 146
Ambiente Matemático Fórmulas Matemáticas
\begin{eqnarray}
5( x - 9) &=& (x+3)- (4x+8) \\
5x - 45 &=& x + 3 - 4x - 8 \\
5x - x + 4x &=& 3 -8 + 45 \\
8x &=& 40 \\
x &=& 5
\end{eqnarray}
(ESALQ/USP) A
Introdução ao L TEX 109 / 146
Ambiente Matemático Fórmulas Matemáticas
\begin{eqnarray}
5( x - 9) &=& (x+3)- (4x+8) \\
5x - 45 &=& x + 3 - 4x - 8 \\
5x - x + 4x &=& 3 -8 + 45 \\
8x &=& 40 \\
x &=& 5
\end{eqnarray}
(ESALQ/USP) A
Introdução ao L TEX 109 / 146
Ambiente Matemático Fórmulas Matemáticas
\begin{eqnarray}
5( x - 9) &=& (x+3)- (4x+8)\qquad\qquad\qquad\qquad\qquad\\
5x - 45 &=& x + 3 - 4x - 8 \nonumber \\
5x - x + 4x &=& 3 -8 + 45 \\
8x &=& 40 \nonumber \\
x &=& 5
\end{eqnarray}
(ESALQ/USP) A
Introdução ao L TEX 110 / 146
Ambiente Matemático Fórmulas Matemáticas
\begin{eqnarray}
5( x - 9) &=& (x+3)- (4x+8)\qquad\qquad\qquad\qquad\qquad\\
5x - 45 &=& x + 3 - 4x - 8 \nonumber \\
5x - x + 4x &=& 3 -8 + 45 \\
8x &=& 40 \nonumber \\
x &=& 5
\end{eqnarray}
(ESALQ/USP) A
Introdução ao L TEX 110 / 146
Ambiente Matemático Fórmulas Matemáticas
\begin{eqnarray*}
5( x - 9) &=& (x+3)- (4x+8) \\
5x - 45 &=& x + 3 - 4x - 8 \\
5x - x + 4x &=& 3 -8 + 45 \\
8x &=& 40 \\
x &=& 5 \mbox{ textos}
\end{eqnarray*}
(ESALQ/USP) A
Introdução ao L TEX 111 / 146
Ambiente Matemático Fórmulas Matemáticas
\begin{eqnarray*}
5( x - 9) &=& (x+3)- (4x+8) \\
5x - 45 &=& x + 3 - 4x - 8 \\
5x - x + 4x &=& 3 -8 + 45 \\
8x &=& 40 \\
x &=& 5 \mbox{ textos}
\end{eqnarray*}
5(x − 9) = (x + 3) − (4x + 8)
5x − 45 = x + 3 − 4x − 8
5x − x + 4x = 3 − 8 + 45
8x = 40
x = 5 textos
(ESALQ/USP) A
Introdução ao L TEX 111 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 15
Escreva a equação apresentada a seguir:
(ESALQ/USP) A
Introdução ao L TEX 112 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas numeradas
Equation
(ESALQ/USP) A
Introdução ao L TEX 113 / 146
Ambiente Matemático Fórmulas Matemáticas
Fórmulas numeradas
Equation
O ambiente equation também é utilizado para apresentar fórmulas
matemáticas numeradas.
\begin{equation}
a+b=2c+d
\end{equation}
a + b = 2c + d (15)
(ESALQ/USP) A
Introdução ao L TEX 113 / 146
Ambiente Matemático Fórmulas Matemáticas
Letras gregas
(ESALQ/USP) A
Introdução ao L TEX 114 / 146
Ambiente Matemático Fórmulas Matemáticas
Potências e índices
Potências:
Índices:
Exemplos:
(ESALQ/USP) A
Introdução ao L TEX 115 / 146
Ambiente Matemático Fórmulas Matemáticas
Potências e índices
Potências:
Índices:
Exemplos:
$x^5$ ⇒ x
5
(ESALQ/USP) A
Introdução ao L TEX 115 / 146
Ambiente Matemático Fórmulas Matemáticas
Potências e índices
Potências:
Índices:
Exemplos:
$x^5$ ⇒ x
5
$x^{x^2}$ ⇒ x
x2
(ESALQ/USP) A
Introdução ao L TEX 115 / 146
Ambiente Matemático Fórmulas Matemáticas
Potências e índices
Potências:
Índices:
Exemplos:
$x^5$ ⇒ x
5
$x^{x^2}$ ⇒ x
x2
$a^2b$ ⇒ a b
2
(ESALQ/USP) A
Introdução ao L TEX 115 / 146
Ambiente Matemático Fórmulas Matemáticas
Potências e índices
Potências:
Índices:
Exemplos:
$x^5$ ⇒ x
5
$x^{x^2}$ ⇒ x
x2
$a^2b$ ⇒ a b
2
$a^{2b}$ ⇒ a
b
2
(ESALQ/USP) A
Introdução ao L TEX 115 / 146
Ambiente Matemático Fórmulas Matemáticas
Potências e índices
Potências:
Índices:
Exemplos:
$x^5$ ⇒ x
5
$x^{x^2}$ ⇒ x
x2
$a^2b$ ⇒ a b
2
$a^{2b}$ ⇒ a
b
2
$B_1$ ⇒ B1
(ESALQ/USP) A
Introdução ao L TEX 115 / 146
Ambiente Matemático Fórmulas Matemáticas
Potências e índices
Potências:
Índices:
Exemplos:
$x^5$ ⇒ x
5
$x^{x^2}$ ⇒ x
x2
$a^2b$ ⇒ a b
2
$a^{2b}$ ⇒ a
2b
$B_1$ ⇒ B1
$t_0$ ⇒ t0
(ESALQ/USP) A
Introdução ao L TEX 115 / 146
Ambiente Matemático Fórmulas Matemáticas
Potências e índices
Potências:
Índices:
Exemplos:
$x^5$ ⇒ x
5
$x^{x^2}$ ⇒ x
x2
$a^2b$ ⇒ a b
2
$a^{2b}$ ⇒ a
2b
$B_1$ ⇒ B1
$t_0$ ⇒ t0
$x_n+1$ ⇒ x n+1
(ESALQ/USP) A
Introdução ao L TEX 115 / 146
Ambiente Matemático Fórmulas Matemáticas
Potências e índices
Potências:
Índices:
Exemplos:
$x^5$ ⇒ x
5
$x^{x^2}$ ⇒ x
x2
$a^2b$ ⇒ a b
2
$a^{2b}$ ⇒ a
2b
$B_1$ ⇒ B1
$t_0$ ⇒ t0
$x_n+1$ ⇒ x n+1
$x_{n+1}$ ⇒ x n +1
(ESALQ/USP) A
Introdução ao L TEX 115 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 16
Escreva o seguinte modelo estatístico utilizando algum dos ambientes
matemáticos.
2 3
ij = µ + βi + βi + τj + βi τj + εij
y (16)
(ESALQ/USP) A
Introdução ao L TEX 116 / 146
Ambiente Matemático Fórmulas Matemáticas
Frações
(ESALQ/USP) A
Introdução ao L TEX 117 / 146
Ambiente Matemático Fórmulas Matemáticas
Frações
(ESALQ/USP) A
Introdução ao L TEX 117 / 146
Ambiente Matemático Fórmulas Matemáticas
Frações
(ESALQ/USP) A
Introdução ao L TEX 117 / 146
Ambiente Matemático Fórmulas Matemáticas
Frações
$\frac{x}{x+1}$ ⇒ x
x +1
(ESALQ/USP) A
Introdução ao L TEX 117 / 146
Ambiente Matemático Fórmulas Matemáticas
Frações
$\frac{x}{x+1}$ ⇒ x
x +1
$\frac{x^5}{x^3+y^3-z}$ ⇒ x5
x 3 +y 3 −z
(ESALQ/USP) A
Introdução ao L TEX 117 / 146
Ambiente Matemático Fórmulas Matemáticas
Frações
$\frac{x}{x+1}$ ⇒ x
x +1
$\frac{x^5}{x^3+y^3-z}$ ⇒ x5
x 3 +y 3 −z
$\frac{a+b}{c-d}$ ⇒ a +b
c −d
(ESALQ/USP) A
Introdução ao L TEX 117 / 146
Ambiente Matemático Fórmulas Matemáticas
p
$\dfrac{p}{q}$ ⇒
q
x0 + x1
$\dfrac{x_0 + x_1}{y_0 + y_1}$ ⇒
y0 + y1
2
t
$\dfrac{t^2}{z^5 -2}$ ⇒
z
5
−2
(ESALQ/USP) A
Introdução ao L TEX 118 / 146
Ambiente Matemático Fórmulas Matemáticas
p
$\dfrac{p}{q}$ ⇒
q
x0 + x1
$\dfrac{x_0 + x_1}{y_0 + y_1}$ ⇒
y0 + y1
2
t
$\dfrac{t^2}{z^5 -2}$ ⇒
z
5
−2
Comparação
(ESALQ/USP) A
Introdução ao L TEX 118 / 146
Ambiente Matemático Fórmulas Matemáticas
p
$\dfrac{p}{q}$ ⇒
q
x0 + x1
$\dfrac{x_0 + x_1}{y_0 + y_1}$ ⇒
y0 + y1
2
t
$\dfrac{t^2}{z^5 -2}$ ⇒
z
5
−2
Comparação
(ESALQ/USP) A
Introdução ao L TEX 118 / 146
Ambiente Matemático Fórmulas Matemáticas
p
$\dfrac{p}{q}$ ⇒
q
x0 + x1
$\dfrac{x_0 + x_1}{y_0 + y_1}$ ⇒
y0 + y1
2
t
$\dfrac{t^2}{z^5 -2}$ ⇒
z
5
−2
Comparação
(ESALQ/USP) A
Introdução ao L TEX 118 / 146
Ambiente Matemático Fórmulas Matemáticas
Raízes
√
$\sqrt{2}$ ⇒ 2
(ESALQ/USP) A
Introdução ao L TEX 119 / 146
Ambiente Matemático Fórmulas Matemáticas
Raízes
√
$\sqrt{2}$ ⇒ 2 √
−b ± b2 − 4ac
$\dfrac{-b \pm \sqrt{b^2 -4ac}}{2a}$ ⇒
2a
(ESALQ/USP) A
Introdução ao L TEX 119 / 146
Ambiente Matemático Fórmulas Matemáticas
Raízes
√
$\sqrt{2}$ 2 √ ⇒
−b ± b2 − 4ac
$\dfrac{-b \pm \sqrt{b^2 -4ac}}{2a}$ ⇒
2a
√
$\sqrt[3]{8}$ ⇒ 38
(ESALQ/USP) A
Introdução ao L TEX 119 / 146
Ambiente Matemático Fórmulas Matemáticas
Raízes
√
$\sqrt{2}$ 2 √ ⇒
−b ± b2 − 4ac
$\dfrac{-b \pm \sqrt{b^2 -4ac}}{2a}$ ⇒
2a
√
$\sqrt[3]{8}$ ⇒ 38
√
$\sqrt[(n+1)]{a}$ ⇒ (n+1) a
(ESALQ/USP) A
Introdução ao L TEX 119 / 146
Ambiente Matemático Fórmulas Matemáticas
Raízes
√
$\sqrt{2}$ 2 √ ⇒
−b ± b2 − 4ac
$\dfrac{-b \pm \sqrt{b^2 -4ac}}{2a}$ ⇒
2a
√
$\sqrt[3]{8}$ ⇒ 38
√
$\sqrt[(n+1)]{a}$ ⇒ (n+1) a
4 3 √
qp
$\sqrt[4]{\sqrt[3]{\sqrt{x}}}$ ⇒ x
(ESALQ/USP) A
Introdução ao L TEX 119 / 146
Ambiente Matemático Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 120 / 146
Ambiente Matemático Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 120 / 146
Ambiente Matemático Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 120 / 146
Ambiente Matemático Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 120 / 146
Ambiente Matemático Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 120 / 146
Ambiente Matemático Fórmulas Matemáticas
\begin{equation}
\Bigg( \bigg( \Big( \big( \big) \Big) \bigg) \Bigg)
\end{equation}
h i
(17)
(ESALQ/USP) A
Introdução ao L TEX 121 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 17
Escreva a equação a seguir utilizando o ambiente matemático $$ $$.
3 2
x 2 x + 1
2
x [2(√
x +1)3 ]
√ =
2
2
(ESALQ/USP) A
Introdução ao L TEX 122 / 146
Ambiente Matemático Fórmulas Matemáticas
Pontos
\cdots ⇒ 1, 2, · · · , n
(ESALQ/USP) A
Introdução ao L TEX 123 / 146
Ambiente Matemático Fórmulas Matemáticas
Pontos
\cdots ⇒ 1, 2, · · · , n
\ldots ⇒ 1, 2, . . . , n
(ESALQ/USP) A
Introdução ao L TEX 123 / 146
Ambiente Matemático Fórmulas Matemáticas
Pontos
\cdots ⇒ 1, 2, · · · , n
\ldots ⇒ 1, 2, . . . , n
... ⇒ 1, 2, ..., n
(ESALQ/USP) A
Introdução ao L TEX 123 / 146
Ambiente Matemático Fórmulas Matemáticas
Pontos
\cdots ⇒ 1, 2, · · · , n
\ldots ⇒ 1, 2, . . . , n
... ⇒ 1, 2, ..., n
1
.
\vdots ⇒ ..
n
(ESALQ/USP) A
Introdução ao L TEX 123 / 146
Ambiente Matemático Fórmulas Matemáticas
Pontos
\cdots ⇒ 1, 2, · · · , n
\ldots ⇒ 1, 2, . . . , n
... ⇒ 1, 2, ..., n
1
.
\vdots ⇒ ..
n
1
..
\ddots ⇒ .
n
(ESALQ/USP) A
Introdução ao L TEX 123 / 146
Ambiente Matemático Fórmulas Matemáticas
Limites
(ESALQ/USP) A
Introdução ao L TEX 124 / 146
Ambiente Matemático Fórmulas Matemáticas
Limites
\displaystyle
$\displaystyle\lim_{x\to+\infty}\left(1+\frac{1}{x}\right)^x=e$
1 x
lim 1 + =e
x →+∞ x
(ESALQ/USP) A
Introdução ao L TEX 124 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 18
Escreva os limites como apresentados a seguir:
x − 1
3
lim
x →1 x − 1
√ √
x + 2 − 2
lim
x →0 x
x + 8
3
lim
x →−2 x + 2
s
8x 3 − 27
lim
x →3/2 4x 2 − 9
(ESALQ/USP) A
Introdução ao L TEX 125 / 146
Ambiente Matemático Fórmulas Matemáticas
Somatórios e produtórios
(ESALQ/USP) A
Introdução ao L TEX 126 / 146
Ambiente Matemático Fórmulas Matemáticas
Somatórios e produtórios
(ESALQ/USP) A
Introdução ao L TEX 126 / 146
Ambiente Matemático Fórmulas Matemáticas
Somatórios e produtórios
P∞
$\sum_{i=1}^{\infty}$ ⇒ i =1
(ESALQ/USP) A
Introdução ao L TEX 126 / 146
Ambiente Matemático Fórmulas Matemáticas
Somatórios e produtórios
P∞
$\sum_{i=1}^{\infty}$ ⇒ i =1
∞
X
$\displaystyle \sum_{i=1}^{\infty}$ ⇒
i =1
(ESALQ/USP) A
Introdução ao L TEX 126 / 146
Ambiente Matemático Fórmulas Matemáticas
Somatórios e produtórios
P∞
$\sum_{i=1}^{\infty}$ ⇒ i =1
∞
X
$\displaystyle \sum_{i=1}^{\infty}$ ⇒
i =1
Qn
$\prod_{i=1}^{n}$ ⇒ i =1
(ESALQ/USP) A
Introdução ao L TEX 126 / 146
Ambiente Matemático Fórmulas Matemáticas
Somatórios e produtórios
P∞
$\sum_{i=1}^{\infty}$ ⇒ i =1
∞
X
$\displaystyle \sum_{i=1}^{\infty}$ ⇒
i =1
Qn
$\prod_{i=1}^{n}$ ⇒ i =1
Y n
$\displaystyle\prod_{i=1}^{n}$ ⇒
i =1
(ESALQ/USP) A
Introdução ao L TEX 126 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 19
Digite as fórmulas a seguir:
1 2
exp [−(x − µ) /2σ ], −∞ < x < ∞
2
f (x ) = √
2πσ
n
Y 1 2
exp [−(xi − µ) /2σ ]
2 2
L (µ, σ |x1 , . . . , xn ) = √
i =1 2πσ
ou seja,
x
" 2 #
1X
n
−µ
L(µ, σ2 |x1 , . . . , x ) = (2π)− n /2
(σ 2 )− n /2
exp −
i
n
2 =1
i
σ
Derivadas
$\frac{dy}{dx}$ ⇒ dy
dx
(ESALQ/USP) A
Introdução ao L TEX 128 / 146
Ambiente Matemático Fórmulas Matemáticas
Derivadas
$\frac{dy}{dx}$ ⇒ dy
dx
dy
$\dfrac{dy}{dx}$ ⇒
dx
(ESALQ/USP) A
Introdução ao L TEX 128 / 146
Ambiente Matemático Fórmulas Matemáticas
Derivadas
$\frac{dy}{dx}$ ⇒ dy
dx
dy
$\dfrac{dy}{dx}$ ⇒
dx
$\frac{d^3y}{dx^3}$ ⇒ d 3y
dx 3
(ESALQ/USP) A
Introdução ao L TEX 128 / 146
Ambiente Matemático Fórmulas Matemáticas
Derivadas
$\frac{dy}{dx}$ ⇒ dy
dx
dy
$\dfrac{dy}{dx}$ ⇒
dx
$\frac{d^3y}{dx^3}$ ⇒ d 3y
dx 3
3
d y
$\dfrac{d^3y}{dx^3}$ ⇒ 3
dx
(ESALQ/USP) A
Introdução ao L TEX 128 / 146
Ambiente Matemático Fórmulas Matemáticas
Derivadas
$\frac{dy}{dx}$ ⇒ dy
dx
dy
$\dfrac{dy}{dx}$ ⇒
dx
$\frac{d^3y}{dx^3}$ ⇒ d 3y
dx 3
3
d y
$\dfrac{d^3y}{dx^3}$ ⇒ 3
dx
$y^{(5)}-y'''+y''$ ⇒ y
(5) − y 000 + y 00
(ESALQ/USP) A
Introdução ao L TEX 128 / 146
Ambiente Matemático Fórmulas Matemáticas
Derivadas
$\frac{dy}{dx}$ ⇒ dy
dx
dy
$\dfrac{dy}{dx}$ ⇒
dx
$\frac{d^3y}{dx^3}$ ⇒ d 3y
dx 3
3
d y
$\dfrac{d^3y}{dx^3}$ ⇒ 3
dx
$y^{(5)}-y'''+y''$ ⇒ y
(5) − y 000 + y 00
∂f
$\frac{\partial f}{\partial x}(a,b)$ ⇒ ∂ x (a, b )
(ESALQ/USP) A
Introdução ao L TEX 128 / 146
Ambiente Matemático Fórmulas Matemáticas
Exemplo
∂f f (a + h , b ) − f (a, b )
(a, b) = lim
∂x h →0 h
(ESALQ/USP) A
Introdução ao L TEX 129 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 20
Digite as propriedades de derivadas dadas a seguir:
d x n = nx n−1
(1) dx
dc =0
(2) dx (c é constante)
d
(3) dx (cf (x )) = c dx d f (x )
d (f ± g ) = d f ± d g
(4) dx dx dx
d (fg ) = d f g + f d g
(5) dx dx dx
d f
(6) dx (f /g ) = g 2
0 g −fg 0
(ESALQ/USP) A
Introdução ao L TEX 130 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 21
Escreva a derivada parcial como segue:
∂f f (x + t , y , z ) − f (x , y , z )
(x , y , z ) = lim
∂x t →0 t
(ESALQ/USP) A
Introdução ao L TEX 131 / 146
Ambiente Matemático Fórmulas Matemáticas
Integrais
Z b
f (x )dx = F (b) − F (b)
a
(ESALQ/USP) A
Introdução ao L TEX 132 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 22
Digite as fórmulas a seguir:
∞ ∞
1
Z Z
2
exp [−(x − µ) /2σ ]dx = µ
2
( )=
E X xf (x )dx = x √
−∞ −∞ 2πσ
∞ ∞
1
Z Z
2
exp [−(x − µ) /2σ ]dx
2 2 2 2
(
E X )= x f (x )dx = x √
−∞ −∞ 2πσ
( ) = E (X 2 ) − [E (X )]2 = σ 2
Var X
Vetores e conjugados
$\vec{a}$ ⇒ ~a
(ESALQ/USP) A
Introdução ao L TEX 134 / 146
Ambiente Matemático Fórmulas Matemáticas
Vetores e conjugados
$\vec{a}$ ⇒ ~a
−→
$\overrightarrow{AB}$ ⇒ AB
(ESALQ/USP) A
Introdução ao L TEX 134 / 146
Ambiente Matemático Fórmulas Matemáticas
Vetores e conjugados
$\vec{a}$ ⇒ ~a
−→
$\overrightarrow{AB}$ ⇒ AB
←−
$\overleftarrow{AB}$ ⇒ AB
(ESALQ/USP) A
Introdução ao L TEX 134 / 146
Ambiente Matemático Fórmulas Matemáticas
Vetores e conjugados
$\vec{a}$ ⇒ ~a
−→
$\overrightarrow{AB}$ ⇒ AB
←−
$\overleftarrow{AB}$ ⇒ AB
$\bar z$ ⇒ z̄
(ESALQ/USP) A
Introdução ao L TEX 134 / 146
Ambiente Matemático Fórmulas Matemáticas
Vetores e conjugados
$\vec{a}$ ⇒ ~a
−→
$\overrightarrow{AB}$ ⇒ AB
←−
$\overleftarrow{AB}$ ⇒ AB
$\bar z$ ⇒ z̄
$\overline{AB}$ ⇒ AB
(ESALQ/USP) A
Introdução ao L TEX 134 / 146
Ambiente Matemático Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 135 / 146
Ambiente Matemático Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 135 / 146
Ambiente Matemático Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 135 / 146
Ambiente Matemático Fórmulas Matemáticas
(ESALQ/USP) A
Introdução ao L TEX 135 / 146
Ambiente Matemático Fórmulas Matemáticas
União e interseção
(ESALQ/USP) A
Introdução ao L TEX 136 / 146
Ambiente Matemático Fórmulas Matemáticas
União e interseção
S∞
$\bigcup_{i=1}^{\infty}$ ⇒ i =1
(ESALQ/USP) A
Introdução ao L TEX 136 / 146
Ambiente Matemático Fórmulas Matemáticas
União e interseção
S∞
$\bigcup_{i=1}^{\infty}$ ⇒ i =1
∞
[
$\displaystyle\bigcup_{i=1}^{\infty}$ ⇒
i =1
(ESALQ/USP) A
Introdução ao L TEX 136 / 146
Ambiente Matemático Fórmulas Matemáticas
União e interseção
S∞
$\bigcup_{i=1}^{\infty}$ ⇒ i =1
∞
[
$\displaystyle\bigcup_{i=1}^{\infty}$ ⇒
i =1
Tn
$\bigcap_{i=1}^{n}$ ⇒ i =1
(ESALQ/USP) A
Introdução ao L TEX 136 / 146
Ambiente Matemático Fórmulas Matemáticas
União e interseção
S∞
$\bigcup_{i=1}^{\infty}$ ⇒ i =1
∞
[
$\displaystyle\bigcup_{i=1}^{\infty}$ ⇒
i =1
Tn
$\bigcap_{i=1}^{n}$ ⇒ i =1
\ n
$\displaystyle\bigcap_{i=1}^{n}$ ⇒
i =1
(ESALQ/USP) A
Introdução ao L TEX 136 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 23
Digite as Leis de Morgan como apresentadas a seguir:
∞
!c ∞
c
[ \
i
A = A i
i =1 i =1
∞
!c ∞
c
\ [
i
A = A i
i =1 i =1
(ESALQ/USP) A
Introdução ao L TEX 137 / 146
Ambiente Matemático Fórmulas Matemáticas
Matrizes e Sistemas
Ambiente array
(ESALQ/USP) A
Introdução ao L TEX 138 / 146
Ambiente Matemático Fórmulas Matemáticas
$$ B = \left[
\begin{array}{r r r r r}
1 & 2 & 3 & 4 & 5\\
6 & 7 & 8 & 9 & 10\\
11 & 12 & 13 & 14 & 15\\
16 & 17 & 18 & 19 & 20\\
\end{array}
\right] $$
1 2 3 4 5
6 7 8 9 10
B =
11 12 13 14 15
16 17 18 19 20
(ESALQ/USP) A
Introdução ao L TEX 139 / 146
Ambiente Matemático Fórmulas Matemáticas
$$ M = \left[
\begin{array}{l l l l}
1 & 2 & \cdots & 10\\
2 & 3 & \cdots & 11\\
\vdots & \vdots & \ddots & \vdots\\
10 & 11 & \cdots & 20\\
\end{array}
\right] $$
1 2 ··· 10
2 3 ··· 11
M = . .. .. ..
.. . . .
10 11 · · · 20
(ESALQ/USP) A
Introdução ao L TEX 140 / 146
Ambiente Matemático Fórmulas Matemáticas
\begin{equation}
A = \left(
\begin{array}{ccc}
x - \lambda & 1 & 0 \\
0 & x - \lambda & 1 \\
0 & 0 & x - \lambda
\end{array}
\right)
\end{equation}
1 0
x −λ
A = 0 x −λ 1 (18)
0 0 x −λ
(ESALQ/USP) A
Introdução ao L TEX 141 / 146
Ambiente Matemático Fórmulas Matemáticas
\begin{equation}
B = \left[
\begin{array}{cccc}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}
\end{array}
\right] \nonumber
\end{equation}
a11 a12 ··· a1 n
a21 a22 ··· a2n
= .. .. .. ..
B
. . . .
am 1 am 2 ··· a mn
(ESALQ/USP) A
Introdução ao L TEX 142 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 24
Escreva a seguinte matriz de variâncias e covariâncias:
σ12
σ12 · · · σ1n
σ12 σ22 · · · σ2n
Cov(X ) = .. .. .. ..
. . . .
σ1n σ2n · · · σn2
(ESALQ/USP) A
Introdução ao L TEX 143 / 146
Ambiente Matemático Fórmulas Matemáticas
$$|x|=\left\{
\begin{array}{r c}
-x &\mbox{se} \quad x\le 0\\
x &\mbox{se} \quad x>0
\end{array}
\right. $$
−x se ≤0
x
|x | =
x se x >0
(ESALQ/USP) A
Introdução ao L TEX 144 / 146
Ambiente Matemático Fórmulas Matemáticas
$$
\left\{
\begin{array}{c c c c c c c c c}
a_{11}x_1&+&a_{12}x_2&+&\ldots&+&a_{1n}x_{n}&=& b_1\\
a_{21}x_1&+&a_{22}x_2&+&\ldots&+&a_{2n}x_{n}&=& b_2\\
\vdots &&&&&&&&\\
a_{m1}x_1&+&a_{m2}x_2&+&\ldots&+& a_{mn}x_{n}&=& b_n
\end{array}
\right.
$$
a11 x1 + a12 x2 + . . . + a1n xn = b1
+ a22 x2 + . . . + a2n xn = b2
a21 x1
..
.
am1 x1 + am2 x2 + . . . + amn xn = bn
(ESALQ/USP) A
Introdução ao L TEX 145 / 146
Ambiente Matemático Fórmulas Matemáticas
Exercício 25
Digite a função por partes da forma como estão apresentadas a seguir:
2x <0
x
0 ≤ x < π2
sin (x )
f (x ) =
1 π
2
≤x <3
−x + 3 x ≥ 3
(ESALQ/USP) A
Introdução ao L TEX 146 / 146