| Linha 1: | Linha 1: | ||
=Pacotes= | =Pacotes= | ||
==Listings== | == 1 - Listings == | ||
=== 1.1 Descrição === | |||
* Comando utilizado para visualizar código-fonte no LaTeX. | * Comando utilizado para visualizar código-fonte no LaTeX. | ||
=== 1.2 Como Utilizar === | |||
*Para utilizar o pacote Listings, é necessário adicioná-lo no arquivo LaTeX através do comando: | *Para utilizar o pacote Listings, é necessário adicioná-lo no arquivo LaTeX através do comando: | ||
\usepackage{listings} | \usepackage{listings} | ||
*Depois de adicionado, pode-se configurar o modo de exibição do código dentro dos parâmetros do comando: | *Depois de adicionado, pode-se configurar o modo de exibição do código dentro dos parâmetros do comando: | ||
\lstset{parametro1=valor1,parametro2=valor2} | \lstset{parametro1=valor1,parametro2=valor2} | ||
* O Pacote Listings possui suporte para várias linguagens de programação, dentre elas: bash, sh, JAVA, Pascal, Perl, PHP, HTML, entre outras. | |||
*Lista de alguns parâmetros usuais: | *Lista de alguns parâmetros usuais: | ||
| Linha 34: | Linha 40: | ||
tabsize=2, % sets default tabsize to 2 spaces | tabsize=2, % sets default tabsize to 2 spaces | ||
title=\lstname % show the filename of files included with \lstinputlisting; also try caption instead of title | title=\lstname % show the filename of files included with \lstinputlisting; also try caption instead of title | ||
* Fazendo a configuração desejada, para adicionar um código-fonte basta utilizar o seguinte comando: | |||
\begin{lstlisting} | |||
apt-get update | |||
apt-get install openvswitch-switch | |||
\end{lstlisting} | |||
=== 1.3 - Manuais e Referências === | |||
Link para o manual do pacote: [ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf Manual] | |||
Link resumo de utilização do pacote: [http://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings Resumo] | |||
= BibTex = | = BibTex = | ||
Edição das 16h48min de 20 de fevereiro de 2015
Pacotes
1 - Listings
1.1 Descrição
- Comando utilizado para visualizar código-fonte no LaTeX.
1.2 Como Utilizar
- Para utilizar o pacote Listings, é necessário adicioná-lo no arquivo LaTeX através do comando:
\usepackage{listings}
- Depois de adicionado, pode-se configurar o modo de exibição do código dentro dos parâmetros do comando:
\lstset{parametro1=valor1,parametro2=valor2}
- O Pacote Listings possui suporte para várias linguagens de programação, dentre elas: bash, sh, JAVA, Pascal, Perl, PHP, HTML, entre outras.
- Lista de alguns parâmetros usuais:
backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
basicstyle=\footnotesize, % the size of the fonts that are used for the code
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
breaklines=true, % sets automatic line breaking
captionpos=b, % sets the caption-position to bottom
commentstyle=\color{mygreen}, % comment style
deletekeywords={...}, % if you want to delete keywords from the given language
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
frame=single, % adds a frame around the code
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
keywordstyle=\color{blue}, % keyword style
language=Octave, % the language of the code
morekeywords={*,...}, % if you want to add more keywords to the set
numbers=left, % where to put the line-numbers; possible values are (none, left, right)
numbersep=5pt, % how far the line-numbers are from the code
numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false, % underline spaces within strings only
showtabs=false, % show tabs within strings adding particular underscores
stepnumber=2, % the step between two line-numbers. If it's 1, each line will be numbered
stringstyle=\color{mymauve}, % string literal style
tabsize=2, % sets default tabsize to 2 spaces
title=\lstname % show the filename of files included with \lstinputlisting; also try caption instead of title
- Fazendo a configuração desejada, para adicionar um código-fonte basta utilizar o seguinte comando:
\begin{lstlisting}
apt-get update
apt-get install openvswitch-switch \end{lstlisting}
1.3 - Manuais e Referências
Link para o manual do pacote: Manual
Link resumo de utilização do pacote: Resumo
BibTex
- BibTeX automatiza a maior parte do trabalho envolvido na gestão de referências para uso em arquivos LaTeX. Você precisa digitar cada referência apenas uma vez, e suas citações e lista de referência são automaticamente emitidas de forma consistente, em um estilo de sua escolha.
- Você precisa transformar suas referências existentes em formato BibTeX. Uma forma fácil de fazer isto é usando o Zotero.
@article{fruchart_introduction_2013,
title = {An introduction to topological insulators},
volume = {14},
url = {http://www.sciencedirect.com/science/article/pii/S1631070513001461},
number = {9},
urldate = {2015-02-18},
journal = {Comptes Rendus Physique},
author = {Fruchart, Michel and Carpentier, David},
year = {2013},
pages = {779--815},
file = {[PDF] de arxiv.org:/home/tulio/.zotero/zotero/nymgoact.default/zotero/storage/DBBCPB4B/Fruchart e Carpentier - 2013 - An introduction to topological insulators.pdf:application/pdf;Snapshot:/home/tulio/.zotero/zotero/nymgoact.default/zotero/storage/GEH8Z2ZZ/S1631070513001461.html:text/html}
}
- Referências BibTeX são armazenados em um banco de dados de texto simples com um formato simples. Quando você quer se referir a um item no banco de dados, você escreve \cite{<label>}, onde <label> é o rótulo anexado ao de referência no banco de dados.
- O estilo com que a referência aparece é determinado pelas configurações do babel.
- Para utilizar o BibTex você precisa basicamente de 5 passos.
- Um arquivo .bib com as suas referências.
- Usar no preambulo \usepackage{cite}.
- Citar a referência no texto ( \cite{fruchart_introduction_2013}, note que estou citando o artigo no exemplo acima).
- Compilar Bibtex (bibtex myarticle). A maioria dos editores de texto para Latex já tem essa opção.
- Não esquecer de compilar seu documento tex duas vezes.