You are on page 1of 50

DICAS & TRUQUES

Recursos Adicionais

LATEX

Regis
da Silva Santos
rg3915 , yahoo.com.br
2009

1 / 50

DICAS & TRUQUES e Recursos Adicionais

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Compilando por Linha de Comando - DOS


Compilando arquivos em lotes
do captulo
Alterando numeracao
Captulo personalizado
do enumerate
Alterando numeracao
Ajustando largura das colunas
Cabecalhos personalizados (Fancy Headings)
Indice remissivo
Indice remissivo personalizado
Indice remissivo em 3 colunas
matematicas

Expressoes
com mesmo tamanho
matematicas

Reduzindo fonte de expressoes

Inserindo sequencia
a partir de macros do Winedt
Inserindo arquivos PDF dentro de um arquivo TEX
MarginPar apenas do lado esquerdo

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

MarginPar do lado esquerdo com TikZ


Inserindo figuras .png, .pdf, .jpg, .mps
Alterando legenda de figura
Convertendo figuras para outros formatos
Salvando figuras para o Office
Editando o texto em figuras EPS

Figuras pstricks monocromaticas


Subfiguras
MiniPage
Figura ao lado de texto com wrapfig
Figura ao lado de texto com floatflt

Figura PSTricks com codigo


do lado
Captulo personalizado com TikZ

Como foi feita a tela de apresentacao


Slides Beamer em WideScreen
Alguns sites interessantes
2 / 50

Compilando por Linha de Comando - DOS


` vezes torna-se necessario

As
compilar arquivos pelo Prompt de Comando do

DOS devido algumas opcoes


adicionais. Mas para compilar o arquivo dese
jado e necessario
que voce va para a pasta onde esta o arquivo usando a
cd; por exemplo, cd pasta/subpasta. Para criar o DVI digite:
opcao
latex arquivo.tex

figuras PostScript 1 deve-se digitar a seguinte sequencia

Quando o arquivo contem


de comandos:
latex arquivo.tex
dvips arquivo.dvi
ps2pdf arquivo.ps

Esta sequencia
cria o arquivo DVI, converte para PS e depois para PDF.
de renomear o arquivo:
Para o comando ps2pdf temos ainda a opcao
ps2pdf arquivo.ps novoarquivo.pdf
1

figuras criadas a partir de comandos ASCII.


PostScript sao
3 / 50

Compilando por Linha de Comando - DOS

Se desejar converter o arquivo DVI direto para PDF deve-se


digitar:
pdflatex arquivo.tex

serao

Obs: Se o arquivo contiver figuras PostScript elas nao


compiladas usando apenas este comando.
pode usar o comando dvi2pdf, para isso
Se desejar, tambem
digite:
dvipdfm arquivo.tex

4 / 50

Compilando arquivos em lotes

Para criar uma sequencia


de comandos e executa-los
numa unica
vez,

e necessario
criar um arquivo BATH que nada mais e que um arquivo
de lotes de comandos do DOS.
crie um arquivo com a extensao
.bat e digite a
Entao,

sequencia
de comandos dentro dele. Exemplo,
latex arquivo01
bibtex arquivo01
makeindex arquivo01
latex arquivo01
dvips arquivo01.dvi
ps2pdf arquivo01.ps

Se desejar acrescente mais arquivos na sequencia.


.bat e execute-o pelo
Salve o arquivo com a extensao
Windows Explorer.
Obs: O arquivo deve estar dentro da pasta onde sera compilado o
arquivo TEX.
5 / 50

do captulo
Alterando numeracao

do captulo. Eu queP: Como eu faco para alterar a numeracao


ria que iniciasse a partir do captulo 2.
R: Digite:
\setcounter{chapter}{1}

6 / 50

Captulo Personalizado

de alguns layouts personalizados para captulos.


O LATEX dispoe
Para isto carregue o pacote fncychap.

Existem 7 opcoes.
Para escolhe-las basta digitar, por exemplo:
\usepackage[Sonny]{fncychap}
sao:

As opcoes
Bjarne, Bjornstrup, Conny, Glenn, Lenny, Rejne e Sonny

7 / 50

Captulo Personalizado

Package description

CHAPTER

ONE

PACKAGE DESCRIPTION

he package fncychap has been written such that chapter level headings can be altered fast and for me
to learn more about LATEX and TEX. I have no idea if this package is written in a good way. Thus,
if anyone reads and tries FncyChap I would appreciate any feedback. This will help me gain insight in
writing macros.
In any publication it is important to remember that consistency plays a important role. That is, with
this package one can change the appearance of each chapter in the publication. However, this is not
desirable so dont forget modesty and consistency.

1.1

In this chapter a short introduction of the package will be given. The package has been written in order
for me to learn more about LATEX and TEX. I have no idea if this package is written in a good way. Thus,
if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is
that it will help me gain insight in writing macros.
In any publication it is important to remember that consistency plays a important role. That is, with
this package one can change the appearance of each chapter in the publication. However, this is not
desirable so don't forget modesty and consistency.

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage[style]ffancychaptersg

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned
chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to
Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if
that con guration is sucient, then this is all that is needed.
The package does not rely on any other package. However, for the style Lenny a postscript font is
default, but this font can easily be changed. I encourage the use of the default postscript font since it is
scalable in a truly huge manner, which makes Lenny nice.

Basic use and requirements

The package is invoked by writing the following in the preamble of your document
\usepackage[style]{fncychap}
If the option, style, is omitted then the default definition of chapter is used. Originally, there were
six predefined chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names
corresponds to Swedish given names, almost surely (a.s.) like IKEA1 . Each such style has a default
configuration and if that configuration is sufficient, then this is all that is needed.
In the present release of fncychap two additional chapter definitions have been included. The first of
these is named PetersLenny, after the author Peter Osborn. This chapter definition is based on Lenny,
Peter has carefully tweaked the measures of the lines individually for each chapter (up to 20) and each
appendix (up to Z). The second chapter head is a new one defined by Jean-Marc Francois and he named
it Bjornstrup.
Originally, fncychap did not rely on any other package. However, for the style Lenny a postscript font
is default, but this font can easily be changed. I encourage the use of the default postscript font since it
is scalable in a truly huge manner, which makes Lenny nice. In the current release and with the use of
Jean-Marcs Bjornstrup the color package from the base distribution will be invoked.

1 reg.

trademark of Ingvar Kamprad Emtaryd Agunnaryd

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

Figura: Bjarne

Figura: Bjornstrup
8 / 50

Captulo Personalizado

CHAPTER 1

CHAPTER 1

PACKAGE DESCRIPTION

PACKAGE DESCRIPTION
I

n this chapter a short introduction of the package will be given. The package has been written in order
for me to learn more about LATEX and TEX. I have no idea if this package is written in a good way. Thus,
if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is
that it will help me gain insight in writing macros.
In any publication it is important to remember that consistency plays a important role. That is, with
this package one can change the appearance of each chapter in the publication. However, this is not
desirable so don't forget modesty and consistency.

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage[style]ffancychaptersg

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned
chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to
Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if
that con guration is sucient, then this is all that is needed.
The package does not rely on any other package. However, for the style Lenny a postscript font is
default, but this font can easily be changed. I encourage the use of the default postscript font since it is
scalable in a truly huge manner, which makes Lenny nice.

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

In this chapter a short introduction of the package will be given. The package has been written in order
for me to learn more about LATEX and TEX. I have no idea if this package is written in a good way. Thus,
if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is
that it will help me gain insight in writing macros.
In any publication it is important to remember that consistency plays a important role. That is, with
this package one can change the appearance of each chapter in the publication. However, this is not
desirable so don't forget modesty and consistency.

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage[style]ffancychaptersg

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned
chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to
Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if
that con guration is sucient, then this is all that is needed.
The package does not rely on any other package. However, for the style Lenny a postscript font is
default, but this font can easily be changed. I encourage the use of the default postscript font since it is
scalable in a truly huge manner, which makes Lenny nice.

Figura: Conny

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

Figura: Glenn
9 / 50

Captulo Personalizado

Chapter

CHAPTER

In this chapter a short introduction of the package will be given. The package has been written in order
for me to learn more about LATEX and TEX. I have no idea if this package is written in a good way. Thus,
if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is
that it will help me gain insight in writing macros.
In any publication it is important to remember that consistency plays a important role. That is, with
this package one can change the appearance of each chapter in the publication. However, this is not
desirable so don't forget modesty and consistency.

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage[style]ffancychaptersg

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned
chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to
Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if
that con guration is sucient, then this is all that is needed.
The package does not rely on any other package. However, for the style Lenny a postscript font is
default, but this font can easily be changed. I encourage the use of the default postscript font since it is
scalable in a truly huge manner, which makes Lenny nice.

CHAPTER 1

1
PACKAGE DESCRIPTION

Package description

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

n this chapter a short introduction of the package will be given. The package has been written in order
for me to learn more about LATEX and TEX. I have no idea if this package is written in a good way. Thus,
if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is
that it will help me gain insight in writing macros.
In any publication it is important to remember that consistency plays a important role. That is, with
this package one can change the appearance of each chapter in the publication. However, this is not
desirable so don't forget modesty and consistency.

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage[style]ffancychaptersg

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned
chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to
Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if
that con guration is sucient, then this is all that is needed.
The package does not rely on any other package. However, for the style Lenny a postscript font is
default, but this font can easily be changed. I encourage the use of the default postscript font since it is
scalable in a truly huge manner, which makes Lenny nice.

Figura: Lenny

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

Package description

In this chapter a short introduction of the package will be given. The package has been written in order
for me to learn more about LATEX and TEX. I have no idea if this package is written in a good way. Thus,
if anyone reads and tries FancyChapters I would appreciate any feedback, good or bad. The reason is
that it will help me gain insight in writing macros.
In any publication it is important to remember that consistency plays a important role. That is, with
this package one can change the appearance of each chapter in the publication. However, this is not
desirable so don't forget modesty and consistency.

1.1 Basic use and requirements


The package is invoked by writing the following in the preamble of your document
nusepackage[style]ffancychaptersg

If the option, style, is omitted then the default de nition of chapter is used. There are six prede ned
chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds to
Swedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con guration and if
that con guration is sucient, then this is all that is needed.
The package does not rely on any other package. However, for the style Lenny a postscript font is
default, but this font can easily be changed. I encourage the use of the default postscript font since it is
scalable in a truly huge manner, which makes Lenny nice.

Figura: Rejne

reg. trademark of Ingvar Kamprad Elmhult Aktiebolag

Figura: Sonny

10 / 50

do enumerate
Alterando numeracao

do enumerate? Eu
P: Como eu faco para alterar a numeracao
queria iniciar a partir do numero 5, por exemplo.
R: Use o comando
\setcounter{enumi}{4}
%inicia o contador a partir do 5.
\begin{enumerate}[M1] \setcounter{enumi}{4}
\item quinto
\item sexto
\item s
etimo
\item oitavo
\end{enumerate}

11 / 50

Ajustando largura das colunas


Requer o pacote multicol.

Para ajustar a largura das colunas digite no preambulo:


\columnsep=2cm
A sintaxe para o comando de multicolunas e
\begin{multicols}{2}
Texto
\end{multicols}

pode ajustar
Voce tambem
\hoffset=-1.0cm
\textwidth=18cm
12 / 50

Cabecalhos personalizados (Fancy Headings)

interessante para ajustar as larguras da pagina

Uma opcao
e
usando o pacote geometry. Veja o exemplo:
\usepackage[lmargin=2cm,rmargin=2cm,tmargin=3cm,bmargin=1.5cm]{geometry}
left (esquerda), right (direita), top (topo ou superior), bottom (inferior).

13 / 50

Cabecalhos personalizados (Fancy Headings)

Para cabecalhos personalizados digite estes codigos


no preambulo:
es de cabec
%Configurac
o
alho personalizado para relat
orio.
\usepackage{fancyhdr}
\pagestyle{fancy}
% com isto n
os nos certificamos que o cabec
alho dos cap
tulos e
% sec

oes est
ao em min
usculo.
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhead{} % deleta a configurac

ao atual para cabec


alho.
\renewcommand{\chaptermark}[1]{%
\markboth{\thechapter.\ #1}{}} %redefine para que aparec
a apenas o no do capitulo.
\fancyhead[L]{\bfseries\leftmark} %capitulo do lado esquerdo.
\fancyhead[R]{\bfseries\rightmark} %sec

ao do lado direito.
\fancyfoot{} % deleta a configurac

ao atual para rodap


e.
\fancyfoot[R]{\bfseries\thepage} %no da pagina do lado direito e no rodap
e.
\fancyfoot[C]{\scriptsize{Cabec
alho personalizado}}
\fancyfoot[L]{R
egis 2009}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
\addtolength{\headheight}{0.5pt} % cria espac
o para a linha
\fancypagestyle{plain}{%
\fancyhead{} % exibe o cabec
alho e o rodap
e
\renewcommand{\headrulewidth}{0pt} % e a linha
}

14 / 50

Indice remissivo
do LATEX, o pacote makeidx
Para habilitar o recurso de indexacao

precisa ser carregado no preambulo


com:
\usepackage{makeidx}
precisam ser habilitados pelo coe os comandos de indexacao
mando
\makeindex

no preambulo
do arquivo de entrada.
O conteudo
do ndice remissivo e especificado com comandos

\index{chave}
onde chave e a entrada do ndice remissivo.
15 / 50

Indice remissivo

\documentclass{report}
\usepackage{makeidx}
\makeindex
\begin{document}
Exemplo \index{Exemplo}.
Espac
o vetorial \index{Espac
o!vetorial}, espac
o m
etrico \index{Espac
o!m
etrico}
\printindex %no final do documento
\end{document}

E ainda, no final do documento, digite


\printindex
clique no cone LATEX
Para gerar o ndice remissivo na compilacao,
para compilar a primeira vez;
Depois clique no cone Make Index para gerar o ndice;
Depois clique novamente no cone LATEX para gerar o DVI final.
4.3.
Veja mais detalhes em IshortBR.pdf, secao
16 / 50

Indice remissivo personalizado

Para inserir um ndice personalizado que tenha uma letra maiuscula

em todas as letras do alfabeto no ndice remissivo, primeiro prepare o documento:


Carregue o pacote makeidx;
Antes de \begin{document} digite \makeindex;
Para indexar uma palavra, no corpo do texto digite por
exemplo, \index{func

ao};
No final do documento digite \printindex.

17 / 50

Indice remissivo personalizado

Agora, no bloco de notas, crie um arquivo contendo o seguinte

codigo:
%%% Coloca cada letra entre grupos no in
cio da linha
heading_prefix "{\\bfseries "
heading_suffix "}\\nopagebreak\n"
headings_flag 1
% Traduz Symbols
symhead_positive
symhead_negative
numhead_positive
numhead_negative

e Numbers para Portugu


es.
"S\\{\\i}mbolos"
"s\\{\\i}mbolos"
"N\\umeros"
"n\\umeros"

18 / 50

Indice remissivo personalizado

Salve o arquivo no formato .ist, por exemplo, indexstyle.ist.


No DOS digite os seguintes comandos:
latex arquivo
bibtex arquivo
makeindex arquivo
makeindex -s indexstyle.ist arquivo
latex arquivo

19 / 50

Indice remissivo personalizado

Figura: Exemplo de ndice remissivo personalizado.


20 / 50

Indice remissivo em 3 colunas

No preambulo
digite:
\makeatletter
\renewenvironment{theindex}
{\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\setlength{\columnseprule}{0pt}
\setlength{\columnsep}{35pt}
\begin{multicols}{3}[\section*{\indexname}]
\markboth{\MakeUppercase\indexname}%
{\MakeUppercase\indexname}%
\thispagestyle{plain}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt plus 0.3pt}
\relax
\let\item\@idxitem}%
{\end{multicols}\if@restonecol\onecolumn\else\clearpage\fi}
\makeatother

www.latex-community.org
21 / 50

matematicas

Expressoes
sempre com mesmo
tamanho
` vezes nao
gostamos quando uma fracao
fica expremida na
As
1
linha de texto, exemplo, 2 . E queremos que ela esteja no seu
1
tamanho natural, .
2
digite $\displaystyle \frac{1}{2}$.
Entao,
Mas se quiser que isto fique em todo o texto, digite:
\everymath\displaystyle

http://aprendolatex.wordpress.com

22 / 50

matematicas

Reduzindo fonte de expressoes

matematica

Caso a expressao
fique muito grande e possvel
reduzir seu tamanho com o comando \scriptstyle. Este
exemplo.
comando deve ser digitado no incio da expressao,
$p(x) = a_0 + a_1 x + a_2 x2 + \ldots + a_n xn$ %normal
$\scriptstyle p(x) = a_0 + a_1 x + a_2 x2 + \ldots + a_n xn$ %menor
$\scriptscriptstyle p(x) = a_0 + a_1 x + a_2 x2 + \ldots + a_n xn$ %menor ainda

Exemplo
p(x) = a0 + a1 x + a2 x2 + . . . + an xn
p(x)=a0 +a1 x+a2 x2 +...+an xn
p(x)=a0 +a1 x+a2 x2 +...+an xn

23 / 50


Inserindo sequencia
a partir de macros do Winedt

Para inserir uma sequencia


numerica
usando Macros no Winedt proceda da
seguinte maneira:
1 Selecione o numero
de linhas que voce quer numerar, por exemplo 5.

2 Clique em Tools/Enumerate Lines...


3 Na guia Line Numbers

a) Escolha em First Line: 1


b) Increment: 1
c) Length: 0
Se desejar, insira algo antes ou depois preenchendo Before ou After. Pronto!
Resultado:
1
2
3
4
5
24 / 50

Inserindo arquivos PDF dentro de um arquivo TEX

Para juntar varios


arquivos PDF dentro de um so no seu arquivo

TEX, digite no preambulo:


\usepackage[final]{pdfpages}
E no corpo de texto digite:
%insere apenas as p
aginas 1 e 3.
\includepdf[pages={1,3}, nup=1x1, landscape, scale=1]{nome_do_arquivo.pdf}
%insere as p
aginas de 5 at
e 30.
\includepdf[pages={5-30}, nup=1x1, scale=1]{nome_do_arquivo.pdf}
\includepdf[pages=-, nup=1x1, scale=1]{nome_do_arquivo.pdf} %insere todas as p
aginas

e portrait (retrato), para isto basta tirar a opcao

O modo padrao
landscape (paisagem).

25 / 50

MarginPar apenas do lado esquerdo

que simula o comando \marginpar


Esta e uma adaptacao

para que o conteudo


fique apenas do lado esquerdo das paginas.
No exemplo, crie um novo contador e um novo comando:
\newcounter{exemplo}
\newlength\larguraexemplo
\setlength\larguraexemplo{1.5cm}
\newcommand\exemplo{
\refstepcounter{exemplo}
\par\noindent\hspace{-\larguraexemplo}\makebox[\larguraexemplo][l]
{{\tiny ex.\theexemplo}}%
}

do lado
Neste caso ira criar um exemplo com autonumeracao

esquerdo da pagina.

26 / 50

MarginPar apenas do lado esquerdo

No texto simplesmente digite:


\exemplo Texto texto texto texto texto texto.

Exemplo
ex. 1
ex. 2

Texto texto texto texto texto texto texto texto texto texto texto.
Texto texto texto texto texto texto texto texto texto texto texto.

27 / 50

MarginPar do lado esquerdo com TikZ

Baseado no exemplo anterior, so que com o pacote TikZ.


\newcommand{\exN}[1]{%
\tikz[remember picture]
\node (ex1)
{\begin{tikzpicture}[remember picture,overlay]
\node[xshift=-3.2cm] (ex) {\tiny #1};
\end{tikzpicture}
};
}

no manual pgfmanual.pdf.
Mais informacoes

28 / 50

Inserindo figuras .png, .pdf, .jpg, .mps


As figuras listadas acima somente podem ser inseridas, em seu formato original, com
o comando PDFLaTeX.

Para isto digite no preambulo:


\usepackage[pdftex]{color,graphicx}
Veja que o pacote color permitira o uso de cores no documento final, que tera a
.pdf. As extensoes
das figuras que podem ser includas no documento sao:

extensao
.png, .pdf, .jpg, .mps (METAPOST) e .tif.
o comando \begin{document} digite:
Logo apos
\DeclareGraphicsExtensions{.jpg,.pdf,.mps,.png}
do comando acima faz com que o LATEX procure por figuras com as exA inclusao

tensoes
declaradas: primeiro jpg, depois pdf, depois mps e por ultimo
png, isto sig
e necessario

do seu arquivo no comando


nifica que nao
voce colocar a extensao
\includegraphics.
serao
possveis neste pacote. Se nao
houver outra
Lembre-se que figuras .eps nao
forma, pode-se usar alguns aplicativos que transformam (wrap) ou embrulham o .eps
em um dos formatos suportados.
www.tex-br.org
29 / 50

Alterando legenda de figura

como
P: Quando eu tenho uma figura sem nenhuma descricao,
eu faco para tirar os dois pontinhos? Ou seja, normalmente fica
Figura 1.1: mas eu quero Figura 1.1.
R: Requer o pacote caption. Na figura digite:
\begin{figure}
\centering
\input{nome da figura}
\captionsetup{labelsep=none}
\caption{Legenda}\label{fig00}
\end{figure}

Pode digitar no preambulo


tambem,
que servira para todos.

30 / 50

Convertendo figuras para outros formatos - TEXtoEPS


Para salvar em EPS as figuras feitas em pstricks, use o pacote pst-eps.

Nota: Use \pagestyle{empty} para suprimir o numero


da pagina.

Crie um unico
arquivo, a figura PSTricks devera estar no corpo de texto deste arquivo. Salve como, por exemplo,

fig01.tex.

O preambulo
mnimo e:
\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-eps}
\pagestyle{empty}
\begin{document}
\begin{TeXtoEPS}
\begin{pspicture}(-1,-1)(1,1)
...
\end{pspicture}
\end{TeXtoEPS}
\end{document}
Depois abra a linha de comando do DOS e execute os seguintes comandos:
latex fig01
dvips fig01.dvi -E -o fig01.eps
Mais detalhes em C:\Arquivos de programas\MiKTeX 2.7\doc\latex\pst-eps.pdf
EPStoPDF
Para converter de EPS para PDF digite:
epstopdf fig.eps
31 / 50

PSTtoPDF - PSTricks to PDF

Requer o pacote pst-pdf.


Faca a figura PSTricks dentro do seu arquivo TEX.

Crie um preambulo
mnimo como se segue:
\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-pdf}
\begin{document}
\begin{pspicture}(-1,-1)(1,1)
...
\end{pspicture}
\end{document}
Depois abra a linha de comando do DOS e execute os seguintes comandos:

latex fig01.tex
dvips fig01.dvi
ps2pdf fig01.ps

Mais detalhes em C:\Arquivos de programas\MiKTeX 2.7\doc\latex\pst-pdf.pdf.

32 / 50

Salvando figuras para o Office - Word

As figuras inseridas no Word devem estar no formato EPS, por oferecer uma melhor

se voce fizer uma figura em pstricks e salvar em


qualidade de impressao.
Entao
EPS, ao inserir no Word ela ficara com um fundo preto. Para corrigir este problema
faca o seguinte:
Abra o Corel Draw e crie um arquivo novo;
Clique em Arquivo/Importar... e escolha a figura EPS;
Escolha importar texto como curva;
No Gerenciador de objetos escolha o ultimo
objeto e delete a camada Bitmap

monocromatico;
Clique em Arquivo/Exportar... e salve a figura no mesmo formato EPS;
escolha Fundo transparente, RGBcolor e Texto.
Na caixa de opcoes
Pronto! Agora a figura pode ser inserida no Word. Lembre-se que a qualidade em tela
e muito boa, mas para impressao
fica excelente.
nao

33 / 50

Salvando figuras para o Office - PowerPoint

que no processo
Faca os mesmos procedimentos de construcao
anterior, mas no Corel Draw salve clicando em Arquivo/Exportar para o Office....
Otimizado para Impressao
comercial.
E escolha a opcao
Sua figura sera salva no formato PNG, formato ideal para o PowerPoint.

34 / 50

Editando o texto em figuras EPS

Requer os pacotes psfrag e graphicx.


\begin{figure}[!htb]
\psfrag{texto 1 no eps}{texto 1 novo}
\psfrag{texto 2 no eps}{texto 2 novo}
\centering
\includegraphics[width=5cm]{figura}
\caption{Legenda}\label{fig01}
\end{figure}

A troca sera finalizada quando converte o DVI para PS


(usando dvips).

35 / 50

Editando o texto em figuras EPS

b
Figura: Antes

3
2

1
2
Figura: Depois

36 / 50


Figuras pstricks monocromaticas

Para imprimir as figuras pstricks em preto e branco sem ter que


alterar as cores do arquivo, faca o seguinte:

Crie um arquivo novo e digite o seguinte codigo:


\usepackage[monochrome]{pstcol}
\makeatletter
\def\PSTricksMonochrome{%
\def\psset@bordercolor##1{\pst@getcolor{white}{\psbordercolor}}%
\def\psset@doublecolor##1{\pst@getcolor{white}{\psdoublecolor}}%
\def\psset@shadowcolor##1{\pst@getcolor{darkgray}{\psshadowcolor}}%
\def\psset@linecolor##1{\pst@getcolor{black}{\pslinecolor}}%
\def\psset@fillcolor##1{\pst@getcolor{white}{\psfillcolor}}%
\def\psset@gridcolor##1{\pst@getcolor{black}{\psgridcolor}}%
\def\psset@gridlabelcolor##1{\pst@getcolor{black}{\psgridlabelcolor}}%
\def\psset@hatchcolor##1{\pst@getcolor{black}{\pshatchcolor}}%
\def\psset@subgridcolor##1{\pst@getcolor{gray}{\pssubgridcolor}}}
\def\blue{\black}%
\def\red{\black}%
\def\darkgray{\black}%
\makeatother

37 / 50


Figuras pstricks monocromaticas

Salve-o como PSTricksMonochrome.sty.

No preambulo
do seu arquivo TEX, digite:
\usepackage{PSTricksMonochrome}
E depois de \begin{document}, digite:
\PSTricksMonochrome%
em preto e branco.
Agora todas as figuras pstricks ficarao

38 / 50

Subfiguras
Para subfiguras carregue o pacote subfigure.
\begin{figure}[!h]
\centering
\subfigure[Circunfer
encia]{\label{fig01a}%
\includegraphics[width=3cm]{figuras/figCirc}}\quad
\subfigure[Elipse]{\label{fig01b}%
\includegraphics[width=3cm]{figuras/figElipse}}
\caption{C
onicas}\label{fig01}
\end{figure}

F1

F2

(a) Circunferencia

(b) Elipse

Figura: Conicas
39 / 50

MiniPage
Minipage e um recurso interessante quando se deseja uma figura do lado da outra para economizar espaco na folha
significa que sao
subfiguras). Digite:
(mas nao
\begin{figure}[!h]
\begin{minipage}[t]{0.45\textwidth} %topo e 45% da largura da folha, respec.
\centering
\includegraphics[width=3cm]{figuras/figParabola}
\caption{Par
abola}\label{figParabola}
\end{minipage}
\begin{minipage}[t]{0.45\textwidth}
\centering
\includegraphics[width=3cm]{figuras/figTriangulo}
\caption{Tri
angulo}\label{figTriangulo}
\end{minipage}
\end{figure}

2
1
b

Figura: Parabola

Figura: Triangulo

40 / 50

Figura ao lado de texto com wrapfig

Para que a figura fique ao lado do texto use o pacote wrapfig.


\begin{wrapfigure}[5]{l}{3.5cm}
\centering
\includegraphics[width=3.5cm]{figura01}
\caption{Legenda}\label{fig01}
\end{wrapfigure}

Onde 5 e o numero
de linhas a serem

movidas para o lado, l (left) posiciona


a figura do lado esquerdo e 3.5 cm e a
onde vai ficar a figura.
largura da regiao

Figura: Legenda
41 / 50

Figura ao lado de texto com floatflt

podemos inserir uma figura ao lado do texto com o


Tambem
pacote floatflt.
\begin{floatingfigure}[l]{0.4\textwidth}
\centering
\includegraphics[width=0.4\textwidth]{figura02}
\caption{Legenda}\label{fig02}
\end{floatingfigure}

l (left) posiciona a figura do


A opcao
lado esquerdo e 0.4\textwidth significa que
a figura tera 40% da largura do texto.

P
olo Norte

O
y

Meridiano
principal
x

Equador

P
olo Sul

Figura: Legenda
42 / 50


Figura PSTricks com codigo
do lado

Para mostrar o codigo


que gera a figura pstricks precisamos
usar o pacote showexpl, que por sua vez usa o pacote listing.
\usepackage{pstricks,showexpl}
\begin{document}
\begin{LTXexample}[width=2cm,frame=single,rframe={}]
\begin{pspicture}[showgrid=true](0,0)(2,2)
\psline[linecolor=red,linestyle=dashed](1,1)(1.71,1.71)
\pscircle[linecolor=blue](1,1){1}
\psdots[linecolor=blue](1,1)
\end{pspicture}
\end{LTXexample}
\end{document}

1 \begin{pspicture}[showgrid=true](0,0)(2,2)
2
\psline[linecolor=red,linestyle=dashed](1,1)(1.71,1.71)
3
\pscircle[linecolor=blue](1,1){1}
4
\psdots[linecolor=blue](1,1)
5 \end{pspicture}
b

0
0

rframe={}.
Importante: Para remover o quadro sobre a figura digite a opcao
www.tug.org/PSTricks/ - (group)
43 / 50

Captulo personalizado com TikZ


Para personalizar o captulo usaremos o pacote tikz e outros:
\documentclass[svgnames]{report}
\usepackage[latin1]{inputenc} %acentuac

ao.
\usepackage[brazil]{babel}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage[explicit]{titlesec}

E crie um novo comando com o seguinte codigo:


\newcommand*\chapterlabel{}
\titleformat{\chapter}
{\gdef\chapterlabel{}\Huge\bfseries}
{\gdef\chapterlabel{\thechapter\ }}{0pt}
{\begin{tikzpicture}[remember picture,overlay]
\node[yshift=-3cm] at (current page.north west)
{\begin{tikzpicture}[remember picture, overlay]
\fill[fill=LightSkyBlue] (3.7,-2.2) rectangle (5.2,1.3);
\fill[fill=orange] (3.5,-2) rectangle (5,1.5);
\node[anchor=west,xshift=3cm,rectangle,text width=15cm,rounded corners=5pt,
inner sep=11pt,fill=Gold] {\chapterlabel#1};
\end{tikzpicture}
};
%continua...

44 / 50

Captulo personalizado com TikZ

%continuac

ao
\node[xshift=4cm,yshift=-4.2cm] at (current page.north west)
{\begin{tikzpicture}[remember picture, overlay]
\draw[smooth,samples=100,domain=0.0:2.75,color=blue]
plot(\x,{0.5*sin(2*\x r)-0.3});
\draw[smooth,samples=100,domain=0.0:3.2,color=blue]
plot(\x,{0.5*cos(2*\x r)-0.3});
\end{tikzpicture}
};
\end{tikzpicture}
}
\titlespacing*{\chapter}{0pt}{80pt}{0pt}

sao
feitas dentro do ambiente tikzpicture.
No caso, as ilustracoes
Exemplo:
1 Captulo Personalizado

45 / 50


Como foi feita a tela de apresentacao

deste material.
Veja como foi feita a tela de apresentacao
Requer os pacotes tikz e animate, entre outros do beamer.
\documentclass[svgnames]{beamer}
\usepackage{tikz}
\usepackage{animate}
\usepackage{wasysym} %fonte especial.
%Definic

ao de novas cores.
\definecolor{ciano}{rgb}{0,0.63,0.88}
\definecolor{azul}{rgb}{0.19,0.35,0.69}
\definecolor{azulB}{rgb}{0.27,0.49,0.82}
\definecolor{azulC}{rgb}{0.29,0.56,0.85}
\definecolor{azulD}{rgb}{0.13,0.36,0.87}
\definecolor{azulE}{rgb}{0.14,0.41,0.65}
\begin{document}
\begin{frame}
\begin{center}
...

46 / 50


Como foi feita a tela de apresentacao

(usando o contador mX).


Sequencia
para a animacao
...
\newcounter{mX}
\setcounter{mX}{0}
\begin{animateinline}[autoplay,loop,palindrome]{6}
\whiledo{\themX < 19}{
\begin{tikzpicture}
\path[use as bounding box] (0,0) rectangle (\paperwidth,\paperheight);
\draw[color=white] (9.4 + 0.1*\themX,5.5) node {\LaTeX};
\end{tikzpicture}
%
\stepcounter{mX}
\ifthenelse{\themX < 19}{
\newframe
}{
}
} % END \whiledo...
\end{animateinline}
\end{center} %...

47 / 50


Como foi feita a tela de apresentacao

%Tela de apresentac

ao com plano de fundo personalizado.


\begin{tikzpicture}[remember picture,overlay]
\node at (current page.south west)
{\begin{tikzpicture}[remember picture, overlay]
\node (A) at (0,0) {};
\node (B) at (0.78\paperwidth,0.27\paperheight) {};
\node (C) at (0.78\paperwidth,0) {};
\node (D) at (0,0.27\paperheight) {};
\node (E) at (0.78\paperwidth,0.39\paperheight) {};
\node (F) at (\paperwidth,0.39\paperheight) {};
\node (G) at (0.78\paperwidth,\paperheight) {};
\node (H) at (\paperwidth,\paperheight) {};
\fill[bottom color=azulE,top color=ciano] (A) rectangle (G);
\fill[bottom color=azulB,top color=azulC] (C) rectangle (H);
\fill[color=azul] (D) rectangle (E);
\fill[color=azulD] (B) rectangle (F);
\draw[color=white] (0.39\paperwidth,0.35\paperheight) node {\bf DICAS \&
TRUQUES};
\draw[color=white] (0.39\paperwidth,0.31\paperheight) node {\scriptsize
Recursos Adicionais};
\draw[color=white] (0.89\paperwidth,0.27\paperheight) node[below] {\tiny
R
egis da Silva Santos};
\draw[color=white] (0.89\paperwidth,0.27\paperheight) node[below=8pt] {\tiny
rg3915 $\smiley$ yahoo.com.br};
\draw[color=white] (0.89\paperwidth,0.27\paperheight) node[below=16pt] {\tiny
2009};
\end{tikzpicture}
};
\end{tikzpicture}
\end{frame}
48 / 50

Slides Beamer em WideScreen


o beamer possui as dimensoes
de 128mm por 96mm,
Por padrao
4:3, a fonte e 11pt por padrao.
Mas com o
e tela na proporcao
para
pacote beamerposter podemos configurar as dimensoes
o formato widescreen (16:9). Basta digitar:
\usepackage[orientation=landscape,size=custom,width=16,height=9,scale=0.5,debug]
{beamerposter} %widescreen.

Baixe o pacote em www-i6.informatik.rwth-aachen.de/dreuw/download/beamerposter.sty.110.

Se quiser voce ainda pode mudar o tamanho da fonte de uma


forma geral com o comando
\renewcommand*{\normalfont}{\footnotesize} %fonte menor.

www-i6.informatik.rwth-aachen.de/dreuw/latexbeamerposter.php#169-slides

49 / 50

Alguns sites interessantes

www.dm.ufscar.br/sadao/curso/latex/ - O primeiro site que voce deve entrar para obter


sobre LATEX e o do Sadao Massago. No final da pagina

informacoes
de curso via exemplos voce encontra

varios
outros links interessantes.
www.ctan.org/tex-archive/info/lshort/portuguese-BR/lshortBR.pdf

Manual IshortBR.pdf. Indispensavel.


www.ctan.org
etc.
Distribuidor de conteudo
LATEX. Nele voce encontra todos os pacotes, documentacao,

www.tex-br.org

varias

Site brasileiro, ideal para iniciantes e intermediarios.


Contem
dicas, interessantes.
www.tug.org
de informacoes
sobre o LATEX, voce encontra muitas informacoes
sobre o pacote pstricks.
Alem
www.dante.de/CTAN/graphics/pstricks/base/doc/pstricks-doc.pdf
Manual de Pstricks.
www.tug.org/PSTricks/main.cgi?file=examples
Exemplos de Pstricks.
www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf
Manual de PGF/TikZ.
www.texample.net/tikz/examples/
Exemplos de TikZ.

50 / 50

You might also like