Dicas e Truques Latex Wide Screen

50
DICAS & TRUQUES Recursos Adicionais egis da Silva Santos rg3915 , yahoo.com.br 2009 wide screen 1 / 50

Transcript of Dicas e Truques Latex Wide Screen

Page 1: Dicas e Truques Latex Wide Screen

DICAS & TRUQUESRecursos Adicionais

Regis da Silva Santosrg3915 , yahoo.com.br

2009

wide screen

1 / 50

Page 2: Dicas e Truques Latex Wide Screen

DICAS & TRUQUES e Recursos Adicionais

1 Compilando por Linha de Comando - DOS

2 Compilando arquivos em lotes

3 Alterando numeracao do capıtulo

4 Capıtulo personalizado

5 Alterando numeracao do enumerate

6 Ajustando largura das colunas

7 Cabecalhos personalizados (Fancy Headings)

8 Indice remissivo

9 Indice remissivo personalizado

10 Indice remissivo em 3 colunas

11 Expressoes matematicas com mesmo tamanho

12 Reduzindo fonte de expressoes matematicas

13 Inserindo sequencia a partir de macros do Winedt

14 Inserindo arquivos PDF dentro de um arquivo TEX

15 MarginPar apenas do lado esquerdo

16 MarginPar do lado esquerdo com TikZ

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

18 Alterando legenda de figura

19 Convertendo figuras para outros formatos

20 Salvando figuras para o Office

21 Editando o texto em figuras EPS

22 Figuras pstricks monocromaticas

23 Subfiguras

24 MiniPage

25 Figura ao lado de texto com wrapfig

26 Figura ao lado de texto com floatflt

27 Figura PSTricks com codigo do lado

28 Capıtulo personalizado com TikZ

29 Como foi feita a tela de apresentacao

30 Slides Beamer em WideScreen

31 Alguns sites interessantes 2 / 50

Page 3: Dicas e Truques Latex Wide Screen

Compilando por Linha de Comando - DOS

As vezes torna-se necessario compilar arquivos pelo Prompt de Comando do DOS devido algumas opcoes adicionais.Mas para compilar o arquivo desejado e necessario que voce va para a pasta onde esta o arquivo usando a opcaocd; por exemplo, cd pasta/subpasta. Para criar o DVI digite:

latex arquivo.tex

Quando o arquivo contem figuras PostScript1 deve-se digitar a seguinte sequencia de comandos:

latex arquivo.tex

dvips arquivo.dvi

ps2pdf arquivo.ps

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

ps2pdf arquivo.ps novoarquivo.pdf

1PostScript sao figuras criadas a partir de comandos ASCII.3 / 50

Page 4: Dicas e Truques Latex Wide Screen

Compilando por Linha de Comando - DOS

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

pdflatex arquivo.tex

Obs: Se o arquivo contiver figuras PostScript elas nao serao compiladas usandoapenas este comando.Se desejar, tambem pode usar o comando dvi2pdf, para isso digite:

dvipdfm arquivo.tex

4 / 50

Page 5: Dicas e Truques Latex Wide Screen

Compilando arquivos em lotes

Para criar uma sequencia de comandos e executa-los numa unica vez, e necessario criar umarquivo BATH que nada mais e que um arquivo de lotes de comandos do DOS.Entao, crie um arquivo com a extensao .bat e digite asequencia 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.Salve o arquivo com a extensao .bat e execute-o pelo Windows Explorer.Obs: O arquivo deve estar dentro da pasta onde sera compilado o arquivo TEX.

5 / 50

Page 6: Dicas e Truques Latex Wide Screen

Alterando numeracao do capıtulo

P: Como eu faco para alterar a numeracao do capıtulo. Eu queria que iniciassea partir do capıtulo 2.

R: Digite:

\setcounter{chapter}{1}

6 / 50

Page 7: Dicas e Truques Latex Wide Screen

Capıtulo Personalizado

O LATEX dispoe de alguns layouts personalizados para capıtulos. Para isto car-regue o pacote fncychap.Existem 7 opcoes. Para escolhe-las basta digitar, por exemplo:

\usepackage[Sonny]{fncychap}

As opcoes sao:

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

7 / 50

Page 8: Dicas e Truques Latex Wide Screen

Capıtulo Personalizado

CHAPTERONEPACKAGE DESCRIPTIONIn this chapter a short introduction of the package will be given. The package has been written in orderfor 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 isthat 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, withthis package one can change the appearance of each chapter in the publication. However, this is notdesirable so don't forget modesty and consistency.1.1 Basic use and requirementsThe package is invoked by writing the following in the preamble of your documentnusepackage[style]ffancychaptersgIf the option, style, is omitted then the default de�nition of chapter is used. There are six prede�nedchapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds toSwedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con�guration and ifthat con�guration is su�cient, then this is all that is needed.The package does not rely on any other package. However, for the style Lenny a postscript font isdefault, but this font can easily be changed. I encourage the use of the default postscript font since it isscalable in a truly huge manner, which makes Lenny nice.

1reg. trademark of Ingvar Kamprad Elmhult Aktiebolag 2Figura: Bjarne

1Package description

T he package fncychap has been written such that chapter level headings can be altered fast and for meto 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 inwriting macros.

In any publication it is important to remember that consistency plays a important role. That is, withthis package one can change the appearance of each chapter in the publication. However, this is notdesirable 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

\usepackage[style]{fncychap}

If the option, style, is omitted then the default definition of chapter is used. Originally, there weresix predefined chapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The namescorresponds to Swedish given names, almost surely (a.s.) like IKEA1. Each such style has a defaultconfiguration 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 ofthese 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 eachappendix (up to Z). The second chapter head is a new one defined by Jean-Marc Francois and he namedit Bjornstrup.

Originally, fncychap did not rely on any other package. However, for the style Lenny a postscript fontis default, but this font can easily be changed. I encourage the use of the default postscript font since itis scalable in a truly huge manner, which makes Lenny nice. In the current release and with the use ofJean-Marcs Bjornstrup the color package from the base distribution will be invoked.

1reg. trademark of Ingvar Kamprad Emtaryd Agunnaryd

2

Figura: Bjornstrup8 / 50

Page 9: Dicas e Truques Latex Wide Screen

Capıtulo Personalizado

CHAPTER 1PACKAGE DESCRIPTIONIn this chapter a short introduction of the package will be given. The package has been written in orderfor 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 isthat 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, withthis package one can change the appearance of each chapter in the publication. However, this is notdesirable so don't forget modesty and consistency.1.1 Basic use and requirementsThe package is invoked by writing the following in the preamble of your documentnusepackage[style]ffancychaptersgIf the option, style, is omitted then the default de�nition of chapter is used. There are six prede�nedchapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds toSwedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con�guration and ifthat con�guration is su�cient, then this is all that is needed.The package does not rely on any other package. However, for the style Lenny a postscript font isdefault, but this font can easily be changed. I encourage the use of the default postscript font since it isscalable in a truly huge manner, which makes Lenny nice.

1reg. trademark of Ingvar Kamprad Elmhult Aktiebolag 2Figura: Conny

CHAPTER 1 PACKAGE DESCRIPTIONIn this chapter a short introduction of the package will be given. The package has been written in orderfor 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 isthat 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, withthis package one can change the appearance of each chapter in the publication. However, this is notdesirable so don't forget modesty and consistency.1.1 Basic use and requirementsThe package is invoked by writing the following in the preamble of your documentnusepackage[style]ffancychaptersgIf the option, style, is omitted then the default de�nition of chapter is used. There are six prede�nedchapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds toSwedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con�guration and ifthat con�guration is su�cient, then this is all that is needed.The package does not rely on any other package. However, for the style Lenny a postscript font isdefault, but this font can easily be changed. I encourage the use of the default postscript font since it isscalable in a truly huge manner, which makes Lenny nice.

1reg. trademark of Ingvar Kamprad Elmhult Aktiebolag 2Figura: Glenn

9 / 50

Page 10: Dicas e Truques Latex Wide Screen

Capıtulo Personalizado

Chapter 1Package descriptionIn this chapter a short introduction of the package will be given. The package has been written in orderfor 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 isthat 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, withthis package one can change the appearance of each chapter in the publication. However, this is notdesirable so don't forget modesty and consistency.1.1 Basic use and requirementsThe package is invoked by writing the following in the preamble of your documentnusepackage[style]ffancychaptersgIf the option, style, is omitted then the default de�nition of chapter is used. There are six prede�nedchapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds toSwedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con�guration and ifthat con�guration is su�cient, then this is all that is needed.The package does not rely on any other package. However, for the style Lenny a postscript font isdefault, but this font can easily be changed. I encourage the use of the default postscript font since it isscalable in a truly huge manner, which makes Lenny nice.

1reg. trademark of Ingvar Kamprad Elmhult Aktiebolag 2Figura: Lenny

CHAPTER1PACKAGE DESCRIPTIONIn this chapter a short introduction of the package will be given. The package has been written in orderfor 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 isthat 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, withthis package one can change the appearance of each chapter in the publication. However, this is notdesirable so don't forget modesty and consistency.1.1 Basic use and requirementsThe package is invoked by writing the following in the preamble of your documentnusepackage[style]ffancychaptersgIf the option, style, is omitted then the default de�nition of chapter is used. There are six prede�nedchapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds toSwedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con�guration and ifthat con�guration is su�cient, then this is all that is needed.The package does not rely on any other package. However, for the style Lenny a postscript font isdefault, but this font can easily be changed. I encourage the use of the default postscript font since it isscalable in a truly huge manner, which makes Lenny nice.

1reg. trademark of Ingvar Kamprad Elmhult Aktiebolag 2Figura: Rejne

CHAPTER 1Package description

In this chapter a short introduction of the package will be given. The package has been written in orderfor 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 isthat 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, withthis package one can change the appearance of each chapter in the publication. However, this is notdesirable so don't forget modesty and consistency.1.1 Basic use and requirementsThe package is invoked by writing the following in the preamble of your documentnusepackage[style]ffancychaptersgIf the option, style, is omitted then the default de�nition of chapter is used. There are six prede�nedchapter styles, namely Sonny, Lenny, Glenn, Conny, Rejne and Bjarne. The names corresponds toSwedish given names, almost surely (a.e.) like IKEA1. Each such style has a default con�guration and ifthat con�guration is su�cient, then this is all that is needed.The package does not rely on any other package. However, for the style Lenny a postscript font isdefault, but this font can easily be changed. I encourage the use of the default postscript font since it isscalable in a truly huge manner, which makes Lenny nice.

1reg. trademark of Ingvar Kamprad Elmhult Aktiebolag 2Figura: Sonny

10 / 50

Page 11: Dicas e Truques Latex Wide Screen

Alterando numeracao do enumerate

P: Como eu faco para alterar a numeracao do enumerate? Eu queria iniciar apartir 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 setimo\item oitavo

\end{enumerate}

11 / 50

Page 12: Dicas e Truques Latex Wide Screen

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}

Voce tambem pode ajustar

\hoffset=-1.0cm

\textwidth=18cm

12 / 50

Page 13: Dicas e Truques Latex Wide Screen

Cabecalhos personalizados (Fancy Headings)

Uma opcao interessante para ajustar as larguras da pagina e usando o pacotegeometry. 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

Page 14: Dicas e Truques Latex Wide Screen

Cabecalhos personalizados (Fancy Headings)

Para cabecalhos personalizados digite estes codigos no preambulo:

%Configuracoes de cabecalho personalizado para relatorio.\usepackage{fancyhdr}\pagestyle{fancy}

% com isto nos nos certificamos que o cabecalho dos capıtulos e% secoes estao em minusculo.\renewcommand{\chaptermark}[1]{\markboth{#1}{}}\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}

\fancyhead{} % deleta a configuracao atual para cabecalho.\renewcommand{\chaptermark}[1]{%\markboth{\thechapter.\ #1}{}} %redefine para que apareca apenas o no do capitulo.

\fancyhead[L]{\bfseries\leftmark} %capitulo do lado esquerdo.\fancyhead[R]{\bfseries\rightmark} %secao do lado direito.\fancyfoot{} % deleta a configuracao atual para rodape.\fancyfoot[R]{\bfseries\thepage} %no da pagina do lado direito e no rodape.\fancyfoot[C]{\scriptsize{Cabecalho personalizado}}\fancyfoot[L]{Regis 2009}\renewcommand{\headrulewidth}{0.5pt}\renewcommand{\footrulewidth}{0.5pt}\addtolength{\headheight}{0.5pt} % cria espaco para a linha\fancypagestyle{plain}{%\fancyhead{} % exibe o cabecalho e o rodape\renewcommand{\headrulewidth}{0pt} % e a linha

}

14 / 50

Page 15: Dicas e Truques Latex Wide Screen

Indice remissivo

Para habilitar o recurso de indexacao do LATEX, o pacote makeidx precisa sercarregado no preambulo com:

\usepackage{makeidx}

e os comandos de indexacao precisam ser habilitados pelo comando

\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

Page 16: Dicas e Truques Latex Wide Screen

Indice remissivo

\documentclass{report}\usepackage{makeidx}\makeindex\begin{document}

Exemplo \index{Exemplo}.

Espaco vetorial \index{Espaco!vetorial}, espaco metrico \index{Espaco!metrico}

\printindex %no final do documento\end{document}

E ainda, no final do documento, digite

\printindex

Para gerar o ındice remissivo na compilacao, clique no ıcone LATEX 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.

Veja mais detalhes em IshortBR.pdf, secao 4.3.16 / 50

Page 17: Dicas e Truques Latex Wide Screen

Indice remissivo personalizado

Para inserir um ındice personalizado que tenha uma letra maiuscula em todasas 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{funcao};No final do documento digite \printindex.

17 / 50

Page 18: Dicas e Truques Latex Wide Screen

Indice remissivo personalizado

Agora, no bloco de notas, crie um arquivo contendo o seguinte codigo:%%% Coloca cada letra entre grupos no inıcio da linhaheading_prefix "{\\bfseries "heading_suffix "}\\nopagebreak\n"headings_flag 1

% Traduz Symbols e Numbers para Portugues.symhead_positive "S\\’{\\i}mbolos"symhead_negative "s\\’{\\i}mbolos"numhead_positive "N\\’umeros"numhead_negative "n\\’umeros"

18 / 50

Page 19: Dicas e Truques Latex Wide Screen

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

Page 20: Dicas e Truques Latex Wide Screen

Indice remissivo personalizado

Figura: Exemplo de ındice remissivo personalizado.20 / 50

Page 21: Dicas e Truques Latex Wide Screen

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

Page 22: Dicas e Truques Latex Wide Screen

Expressoes matematicas sempre com mesmo tamanho

As vezes nao gostamos quando uma fracao fica expremida na linha de texto,

exemplo, 12 . E queremos que ela esteja no seu tamanho natural,

12

.Entao, digite $\displaystyle \frac{1}{2}$.Mas se quiser que isto fique em todo o texto, digite:

\everymath\displaystyle

http://aprendolatex.wordpress.com

22 / 50

Page 23: Dicas e Truques Latex Wide Screen

Reduzindo fonte de expressoes matematicas

Caso a expressao matematica fique muito grande e possıvel reduzir seu tamanhocom o comando \scriptstyle. Este comando deve ser digitado no inıcio da ex-pressao, exemplo.$p(x) = a_0 + a_1 x + a_2 xˆ2 + \ldots + a_n xˆn$ %normal$\scriptstyle p(x) = a_0 + a_1 x + a_2 xˆ2 + \ldots + a_n xˆn$ %menor$\scriptscriptstyle p(x) = a_0 + a_1 x + a_2 xˆ2 + \ldots + a_n xˆn$ %menor ainda

Exemplo

p(x) = a0 + a1x + a2x2 + . . . + anxn

p(x)=a0+a1x+a2x2+...+anxn

p(x)=a0+a1x+a2x2+...+anxn

23 / 50

Page 24: Dicas e Truques Latex Wide Screen

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: 1b) Increment : 1c) Length: 0

Se desejar, insira algo antes ou depois preenchendo Before ou After. Pronto!Resultado:1234

5

24 / 50

Page 25: Dicas e Truques Latex Wide Screen

Inserindo arquivos PDF dentro de um arquivo TEX

Para juntar varios arquivos PDF dentro de um so no seu arquivo TEX, digite nopreambulo:

\usepackage[final]{pdfpages}

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

O modo padrao e portrait (retrato), para isto basta tirar a opcao landscape (paisa-gem).

25 / 50

Page 26: Dicas e Truques Latex Wide Screen

MarginPar apenas do lado esquerdo

Esta e uma adaptacao que simula o comando \marginpar para que o conteudofique apenas do lado esquerdo das paginas. No exemplo, crie um novo contadore 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}}%

}

Neste caso ira criar um exemplo com autonumeracao do lado esquerdo da pagina.

26 / 50

Page 27: Dicas e Truques Latex Wide Screen

MarginPar apenas do lado esquerdo

No texto simplesmente digite:\exemplo Texto texto texto texto texto texto.

Exemplo

ex. 1 Texto texto texto texto texto texto texto texto texto texto texto.ex. 2 Texto texto texto texto texto texto texto texto texto texto texto.

27 / 50

Page 28: Dicas e Truques Latex Wide Screen

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}

};}

Mais informacoes no manual pgfmanual.pdf.

28 / 50

Page 29: Dicas e Truques Latex Wide Screen

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 extensao .pdf. As extensoes das figuras que podem serincluıdas no documento sao: .png, .pdf, .jpg, .mps (METAPOST) e .tif.Logo apos o comando \begin{document} digite:

\DeclareGraphicsExtensions{.jpg,.pdf,.mps,.png}

A inclusao do comando acima faz com que o LATEX procure por figuras com as extensoes declaradas: primeiro jpg, depois pdf, depois mpse por ultimo png, isto significa que nao e necessario voce colocar a extensao do seu arquivo no comando \includegraphics.Lembre-se que figuras .eps nao serao possıveis neste pacote. Se nao houver outra forma, pode-se usar alguns aplicativos que transformam(wrap) ou “embrulham” o .eps em um dos formatos suportados.

www.tex-br.org

29 / 50

Page 30: Dicas e Truques Latex Wide Screen

Alterando legenda de figura

P: Quando eu tenho uma figura sem nenhuma descricao, como eu faco para tiraros 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

Page 31: Dicas e Truques Latex Wide Screen

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 mınimo 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

EPStoPDFPara converter de EPS para PDF digite:

epstopdf fig.eps

31 / 50

Page 32: Dicas e Truques Latex Wide Screen

PSTtoPDF - PSTricks to PDF

Requer o pacote pst-pdf.Faca a figura PSTricks dentro do seu arquivo TEX.Crie um preambulo mınimo 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

Page 33: Dicas e Truques Latex Wide Screen

Salvando figuras para o Office - Word

As figuras inseridas no Word devem estar no formato EPS, por oferecer uma melhor qualidade de impressao. Entao se voce fizer uma figuraem pstricks e salvar em 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;

Na caixa de opcoes escolha Fundo transparente, RGBcolor e Texto.

Pronto! Agora a figura pode ser inserida no Word. Lembre-se que a qualidade em tela nao e muito boa, mas para impressao fica excelente.

33 / 50

Page 34: Dicas e Truques Latex Wide Screen

Salvando figuras para o Office - PowerPoint

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

34 / 50

Page 35: Dicas e Truques Latex Wide Screen

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

Page 36: Dicas e Truques Latex Wide Screen

Editando o texto em figuras EPS

b

ca

Figura: Antes

12

√3

21

Figura: Depois36 / 50

Page 37: Dicas e Truques Latex Wide Screen

Figuras pstricks monocromaticas

Para imprimir as figuras pstricks em preto e branco sem ter que alterar as coresdo 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

Page 38: Dicas e Truques Latex Wide Screen

Figuras pstricks monocromaticas

Salve-o como PSTricksMonochrome.sty.No preambulo do seu arquivo TEX, digite:

\usepackage{PSTricksMonochrome}

E depois de \begin{document}, digite:

\PSTricksMonochrome%

Agora todas as figuras pstricks ficarao em preto e branco.

38 / 50

Page 39: Dicas e Truques Latex Wide Screen

Subfiguras

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

\end{figure}

1

1

−1

−1

(a) Circunferencia

b

F1

b

F2

(b) Elipse

Figura: Conicas39 / 50

Page 40: Dicas e Truques Latex Wide Screen

MiniPage

Minipage e um recurso interessante quando se deseja uma figura do lado da outra para economizar espaco na folha (mas nao significa que sao subfiguras). Digite:

\begin{figure}[!h]\begin{minipage}[t]{0.45\textwidth}\centering\includegraphics[width=2.5cm]{figuras/figParabola}\caption{Parabola}\label{figParabola}

\end{minipage}\begin{minipage}[t]{0.45\textwidth}\centering\includegraphics[width=2.5cm]{figuras/figTriangulo}\caption{Triangulo}\label{figTriangulo}

\end{minipage}\end{figure}

1

2

−1

1 2−1−2

Figura: Parabola

bA

b

B

bC

b D

Figura: Triangulo

[t]{0.45\textwidth} significa topo e largura da minipage (45% da largura da folha), respectivamente.

40 / 50

Page 41: Dicas e Truques Latex Wide Screen

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}

x

y

O

b

P

b

a

Figura: Legenda

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 alargura da regiao onde vai ficar a figura.

41 / 50

Page 42: Dicas e Truques Latex Wide Screen

Figura ao lado de texto com floatflt

Tambem podemos inserir uma figura ao lado do texto com o pacote floatflt.\begin{floatingfigure}[l]{0.4\textwidth}\centering\includegraphics[width=0.4\textwidth]{figura02}\caption{Legenda}\label{fig02}

\end{floatingfigure}

A opcao l (left) posiciona a figura do lado esquerdo

x

y

z

O

Polo Norte

Polo Sul

ρ

P

Q

φ

θMeridianoprincipal

Equador

Figura: Legenda

e 0.4\textwidth significa que a figura tera 40% dalargura do texto.

42 / 50

Page 43: Dicas e Truques Latex Wide Screen

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}

0 1 20

1

2

b

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}

Importante: Para remover o quadro sobre a figura digite a opcao rframe={}.

www.tug.org/PSTricks/ - (group)43 / 50

Page 44: Dicas e Truques Latex Wide Screen

Capıtulo personalizado com TikZ

Para personalizar o capıtulo usaremos o pacote tikz e outros:\documentclass[svgnames]{report}\usepackage[latin1]{inputenc} %acentuacao.\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

Page 45: Dicas e Truques Latex Wide Screen

Capıtulo personalizado com TikZ

%continuacao\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}

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

1 Capıtulo Personalizado

45 / 50

Page 46: Dicas e Truques Latex Wide Screen

Como foi feita a tela de apresentacao

Veja como foi feita a tela de apresentacao deste material.Requer os pacotes tikz e animate, entre outros do beamer.\documentclass[svgnames]{beamer}\usepackage{tikz}\usepackage{animate}\usepackage{wasysym} %fonte especial.%Definicao 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

Page 47: Dicas e Truques Latex Wide Screen

Como foi feita a tela de apresentacao

Sequencia para a animacao (usando o contador mX)....\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

Page 48: Dicas e Truques Latex Wide Screen

Como foi feita a tela de apresentacao

%Tela de apresentacao 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 Regis 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

Page 49: Dicas e Truques Latex Wide Screen

Slides Beamer em WideScreen

Por padrao o beamer possui as dimensoes de 128mm por 96mm, e tela naproporcao 4:3, a fonte e 11pt por padrao. Mas com o pacote beamerposterpodemos configurar as dimensoes para 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 ocomando\renewcommand*{\normalfont}{\footnotesize} %fonte menor.

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

49 / 50

Page 50: Dicas e Truques Latex Wide Screen

Alguns sites interessantes

www.dm.ufscar.br/˜sadao/curso/latex/ - O primeiro site que voce deve entrar para obter informacoes sobre LATEX e o do Sadao Massago. No finalda pagina de curso via exemplos voce encontra varios outros links interessantes.

www.ctan.org/tex-archive/info/lshort/portuguese-BR/lshortBR.pdfManual IshortBR.pdf. Indispensavel.

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

www.tex-br.orgSite brasileiro, ideal para iniciantes e intermediarios. Contem varias dicas, interessantes.

www.tug.orgAlem de informacoes sobre o LATEX, voce encontra muitas informacoes sobre o pacote pstricks.

www.dante.de/CTAN/graphics/pstricks/base/doc/pstricks-doc.pdfManual de Pstricks.

www.tug.org/PSTricks/main.cgi?file=examplesExemplos de Pstricks.

www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdfManual de PGF/TikZ.

www.texample.net/tikz/examples/Exemplos de TikZ.

50 / 50