Mostrando postagens com marcador latex. Mostrar todas as postagens
Mostrando postagens com marcador latex. Mostrar todas as postagens

20 de mai. de 2015

Frontmatter no Coppetex

Baixando os arquivos de compilação da biblioteca da Coppe para geração de teses e dissertações, o CoppeTeX, é provável que, ao compilar sem nenhuma modificação, aconteça um erro. Este erro pode ser contornado comentando a linha "\frontmatter" dentro de thesis.tex, mas acontece uma pequena mudança entre o padrão da Coppe (o padrão diz que a parte pré-textual seja numerada com números romanos, mas a numeração acontece com letras, a, b, c ...)

A correção do erro é editar o arquivo coppe.cls e substituir as linhas \eqparbox{signture@list}{\protect\centering% por \eqmakebox[signture@list]{% (linhas 290, 295 e 301 na versão que tenho em mãos).

Fonte: Sourceforge/coppetex

26 de jul. de 2014

Contador em LaTeX com referência cruzada

Quem usa LaTeX sabe que é possível referenciar figuras, tabelas e equações através de labels, porque usa contadores internos, como variáveis de programação mesmo. Então, é possível, sim, ter um contador ao longo do texto e fazer referência a esse contador.

Minha primeira tentativa foi usando os comandos \newcounter{foo} e \addtocounter{foo}{1}. O primeiro, que vai no preâmbulo, define uma variável foo que vai ser incrementada ao longo do texto através do segundo comando, onde o número entre chaves é o número a somar ao contador. Esse sistema funciona para referências diretas, por exemplo, se eu estiver falando Tabela 3 em vez de tabela a seguir, basta incrementar o contador e mostrar, no texto, quanto vale o contador (eu usei o \arabic{foo}). A referência que usei para essa tentativa foi o LaTeX Counters.

Então, percebi que, se precisasse referenciar ao tal foo mais à frente do texto, perderia a referência, pois só teria o valor atual de foo (se, por exemplo, forem colocados dois foo entre onde quero referenciar e onde estou referenciando, vou obter foo+2). Se acharam confuso, aposto que este tópico está ainda mais, vejam o exemplo abaixo para esclarecer.

A solução foi com os comandos \newenvironment e \refstepcounter. No primeiro, defino o nome do novo ambiente entre chaves e o número de argumentos a ser recebido entre colchetes. O segundo serve para guardar uma referência numa label a este número. (Mais sobre o \newenvironment em Wikibooks). A seguir está o código:

  1. \documentclass{article}
  2.  
  3. \newcounter{tabela} \setcounter{tabela}{0}
  4. \newcounter{subtabela}[tabela] \setcounter{subtabela}{0}
  5.  
  6. \newenvironment{tabela}[1]
  7. {
  8.    \refstepcounter{tabela} %contador
  9.     \textbf{Tabela \thetabela} #1
  10. }
  11.  
  12. \begin{document}
  13.  
  14. \tabela{Primeira Tabela}\label{um}\\
  15. \tabela{Segunda Tabela}\label{dois}\\
  16. \tabela{Terceira Tabela}\label{tres}\\
  17. \tabela{Quarta Tabela}\label{quatro}\\
  18.  
  19. Tabela 1 = \ref{um}\\
  20. Tabela 3 = \ref{tres}\\
  21. Tabela 2 = \ref{dois}\\
  22. Tabela 4 = \ref{quatro}\\
  23. \end{document}

O comando \tabela recebe como entrada o texto da tabela e dá como saída em negrito seu número, seguido do texto. Abaixo a saída gerada:

24 de mai. de 2014

Células ocupando mais de uma coluna (LaTeX)

Para fazer uma tabela em LaTeX com em que uma das linhas tenha menos colunas que o restante, por exemplo, duas subtabelas, utiliza-se o comando multicolumn. No exemplo, usamos uma tabela com 4 colunas e a primeira linha somente com duas colunas maiores:

O comando multicolumn requer 3 argumentos: o número de colunas a ser ocupado; o formato da coluna (|c| por exemplo, significa com borda direita e esquerda, e centralizado); o texto a ser escrito nesse espaço. A figura acima foi obtida usando o multicolumn duas vezes, separado pelo operador &.

Eis o código

\begin{tabular}{|c|c|c|c|}
   \hline
  1.   \multicolumn{2}{|c|}{\textbf{Algoritmo 1}}&
  2.   \multicolumn{2}{|c|}{\textbf{Algoritmo 2}}\\
  3.   \hline
  4.   Execuções & Resultado &Execuções & Resultado \\
  5.   \hline
  6. \end{tabular}

Fontes de Consulta:
Apostila de LaTeX (Professor Reginaldo Santos, UFMG) - Seção 7.8
texblog

15 de mai. de 2014

Símbolo de Dominância no LaTeX

Para usar os símbolos de dominância (Otimização de Pareto, Pareto Optimality) no seu documento LaTeX, use o pacote multiobjective.
Que foi gerado com o seguinte código:
    \documentclass[a4paper,12pt]{article}
    \usepackage{multiobjective} 
    \begin{document}
    $$
    A \dom B
    $$
    \end{document}
A tabela a seguir mostra os símbolos e seu comando:

NomeComando
dominance \dom
negative dominance \negdom
weak dominance \weakdom
negative weak dominance \negweakdom
strict dominance \strictdom
negative strict dominance \negstrictdom
better \better
Fonte: http://get-software.net/macros/latex/contrib/multiobjective/multiobjective.dtx

14 de mai. de 2014

Verificação Ortográfica no WinShell

Para instalar um corretor ortográfico pt_br, pt_pt ou qualquer outro, vá até a pasta C:\Program Files (x86)\WinShell\Dictionaries e cole os arquivos pt_BR.aff e pt_BR.dic, que podem ser obtidos neste link. Caso o link não funcione, procure dentro da Wiki do Open Office sobre dicionários e corretores ortográficos (spell check). Após colocar os arquivos nessa pasta, reinicie o WinShell e clique em Options, depois em Language e deve aparecer a opção pt_BR em Spell Checker.

Fonte de consulta: ctan.mackichan.com/systems/windows/winshell/Install.txt

21 de mar. de 2013

Citar um site no BibTeX

A maneira mais simples de citar uma página da internet num trabalho escrito em LaTeX é usando o seguinte:

No arquivo .tex, inclua o pacote url

    1. \usepackage{url}

E, no arquivo .bib


  1. @MISC{
  2.         zeroum,
  3.         TITLE = "The Register",
  4.         HOWPUBLISHED = {\url{http://www.theregister.co.uk/2011/02/01/arm_holdings_q4_2010_numbers/}},
  5.         NOTE = "acessado em 18/03/2013",}

Resultado:


19 de mar. de 2013

LaTeX newbie - Letras normais no ambiente equation

Se você quer colocar um texto (ou mesmo, um nome de variável) numa equação, no LaTeX, o texto fica em itálico e mais separado e algumas letras ficam estilizadas (o "x", por exemplo). Para escrever um texto com formatação "normal", use dentro de um \textrm, como no exemplo a seguir:


  1. \begin{center}
  2.  \begin{equation}
  3.     \textrm{SYS\_PLLCLKOUT}=f_{XTAL}\times(\textrm{SYSPLLCTRL\_Val \& 0x1F})+1)
  4.    \label{[[ referência ]]}
  5.  \end{equation}
  6. [[ legenda ]]
  7. \end{center}


Resultado:



Sem o textrm:



Fonte de consulta: http://anthony.liekens.net/index.php/LaTeX/UnformattedTextInMathMode

    10 de fev. de 2013

    Texto da tabela alinhado à esquerda - LaTeX

    Para escolher o alinhamento do texto no ambiente tabular, utilize begin{tabular}{x|x...}, onde x é l, c ou r, esquerda, centro ou direita, respectivamente e a presença da barra vertical indica a presença ou não de linha.

    26 de jan. de 2013

    LaTeX no Ubuntu - Kile

    Para construir documentos pdf em LaTeX no Ubuntu, recomendo o seguinte:

    1) Instalar pacotes básicos [http://ubuntued.info/como-instalar-o-latex-no-ubuntu]

    :~$sudo apt-get install texlive texlive-latex-extra texlive-lang-portuguese

    2) Instalar o Kile (pela Central de programas do Ubuntu)

    3) Definir leitor de pdf como evince (vem com o okular como padrão)
    Troque o conteúdo deste campo por evince
    Para quem está começando a lidar com LaTeX, sugiro o bom manual do professor Reginaldo Santos.

    28 de dez. de 2012

    Exibir tabela ascii com LaTeX

    Deu um trabalho do cão, espero que ninguém mais precise fazer isso na mão...


    1. \begin{center}
    2. \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}\hline
    3.    000\textit{d} & 00\textit{h} & (nul) && 023\textit{d} & 17\textit{h} & (etb)&& 046\textit{d} & 2E\textit{h}& . \\ \hline
    4.    001\textit{d} & 01\textit{h}& (soh) && 024\textit{d} & 18\textit{h} & (can) && 047\textit{d} & 2F\textit{h}& /  \\ \hline
    5.    002\textit{d} & 02\textit{h}& (stx) &&025\textit{d} & 19\textit{h} &  (em) && 048\textit{d} & 30\textit{h}& 0 \\ \hline
    6.    003\textit{d} & 03\textit{h}& (etx) &&  026\textit{d} & 1A\textit{h}   & (eof) &&  049\textit{d} &31\textit{h} & 1 \\ \hline
    7.    004\textit{d} & 04\textit{h} & (eot) &&027\textit{d} & 1B\textit{h} & (esc) && 050\textit{d} & 32\textit{h}& 2  \\ \hline
    8.    005\textit{d} & 05\textit{h} & (enq) &&028\textit{d} & 1C\textit{h} & (fs) && 051\textit{d} & 33\textit{h}& 3  \\  \hline
    9.    006\textit{d} & 06\textit{h} & (ack) &&029\textit{d} & 1D\textit{h} & (gs) && 052\textit{d} & 34\textit{h}& 4\\  \hline
    10.    007\textit{d} & 07\textit{h} & (bel) &&030\textit{d} & 1E\textit{h} & (rs) && 053\textit{d} & 35\textit{h}& 5\\  \hline
    11.    008\textit{d} & 08\textit{h}  & (bs)  && 031\textit{d} & 1F\textit{h} & (us) && 054\textit{d} &36\textit{h} & 6   \\ \hline
    12.    009\textit{d} & 09\textit{h}   & (tab)&& 032\textit{d} & 20\textit{h} & (espaço) && 055\textit{d} &37\textit{h} & 7 \\ \hline
    13.    010\textit{d} & 0A\textit{h}  & (lf) && 033\textit{d} & 21\textit{h} & ! && 056\textit{d} & 38\textit{h} &8\\ \hline
    14.    011\textit{d} & 0B\textit{h} & (vt)  &&034\textit{d} & 22\textit{h} & "&& 057\textit{d} & 39\textit{h} &9\\ \hline
    15.    012\textit{d} & 0C\textit{h}  & (np)  &&035\textit{d} & 23\textit{h} & \&& 058\textit{d} & 3A\textit{h} &:\\ \hline
    16.    013\textit{d} & 0D\textit{h} & (cr)  &&036\textit{d} & 24\textit{h} & \$ && 059\textit{d} & 3B\textit{h} &;  \\ \hline
    17.    014\textit{d} & 0E\textit{h}  & (so)  &&037\textit{d} & 25\textit{h} & \% && 060\textit{d} & 3C\textit{h} &<\\ \hline
    18.    015\textit{d} & 0F\textit{h} & (si)  &&038\textit{d} & 26\textit{h} & \& && 061\textit{d} & 3D\textit{h} &=  \\ \hline
    19.    016\textit{d} & 10\textit{h}  & (dle) &&039\textit{d} & 27\textit{h} & ' && 062\textit{d} & 3E\textit{h} &>\\ \hline
    20.    017\textit{d} & 11\textit{h}  & (dc1) &&040\textit{d} & 28\textit{h} & ( &&063\textit{d} & 3F\textit{h} & ?\\ \hline
    21.    018\textit{d} & 12\textit{h} & (dc2) &&041\textit{d} & 29\textit{h} & ) &&064\textit{d} & 40\textit{h} & @\\ \hline
    22.    019\textit{d} & 13\textit{h}  & (dc3) &&042\textit{d} & 2A\textit{h} & * &&065\textit{d} & 41\textit{h} & A\\ \hline
    23.    020\textit{d} & 14\textit{h}  & (dc4) && 043\textit{d} & 2B\textit{h} & +&& 066\textit{d} & 42\textit{h} &B\\ \hline
    24.    021\textit{d} & 15\textit{h}  & (nak) &&044\textit{d} & 2C\textit{h} & '&& 067\textit{d} & 43\textit{h} &C\\ \hline
    25.    022\textit{d} & 16\textit{h}  & (syn) &&045\textit{d} & 2D\textit{h} & - && 068\textit{d} & 44\textit{h} &D\\ \hline
    26.  \end{tabular}
    27. \end{center}
    28. 0x045 a 0x088:
    29. \begin{center}
    30. \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}\hline
    31.   069\textit{d} & 45\textit{h} & E &&
    32.   092\textit{d} & 5C\textit{h} & $\backslash$ &&
    33.  115\textit{d} & 73\textit{h} & s  \\ \hline
    34.    070\textit{d} & 46\textit{h} & F &&
    35.    093\textit{d} & 5D\textit{h} & ]  &&
    36.    116\textit{d} & 74\textit{h} & t   \\ \hline
    37.    071\textit{d} & 47\textit{h} & G &&
    38.    094\textit{d} & 5E\textit{h} & \^{} &&
    39.    117\textit{d} & 75\textit{h} & u \\ \hline
    40.    072\textit{d} & 48\textit{h} & H &&  
    41.    095\textit{d} & 5F\textit{h} & \_ &&  
    42.    118\textit{d} & 76\textit{h} & v \\ \hline
    43.    073\textit{d} & 49\textit{h} & I &&
    44.    096\textit{d} & 60\textit{h} & `  &&
    45.    119\textit{d} & 77\textit{h} & w  \\ \hline
    46.    074\textit{d} & 4A\textit{h} & J &&
    47.    097\textit{d} & 61\textit{h} & a &&
    48.    120\textit{d} & 78\textit{h} & x  \\  \hline
    49.    075\textit{d} & 4B\textit{h} & K &&  
    50.    098\textit{d} & 62\textit{h} & b &&
    51.    121\textit{d} & 79\textit{h} & y \\  \hline
    52.    076\textit{d} & 4C\textit{h} & L &&
    53.    099\textit{d} & 63\textit{h} & c  &&
    54.    122\textit{d} & 7A\textit{h} & z \\  \hline
    55.    077\textit{d} & 4D\textit{h} & M &&
    56.    100\textit{d} & 64\textit{h} & d  &&
    57.    123\textit{d} & 7B\textit{h} & \{   \\ \hline
    58.    078\textit{d} & 4E\textit{h} & N &&
    59.    101\textit{d} & 65\textit{h} & e  &&
    60.    124\textit{d} & 7C\textit{h} & $\vert$  \\ \hline
    61.    079\textit{d} & 4F\textit{h} & O &&
    62.    102\textit{d} & 66\textit{h} & f &&
    63.    125\textit{d} & 7D\textit{h} & \} \\ \hline
    64.    080\textit{d} & 50\textit{h} & P  &&
    65.    103\textit{d} & 67\textit{h} & g &&
    66.    126\textit{d} & 7E\textit{h} & \~{} \\ \hline
    67.    081\textit{d} & 51\textit{h} & Q  &&
    68.    104\textit{d} & 68\textit{h} & h  &&
    69.    127\textit{d} & 7F\textit{h} & DEL \\ \hline
    70.    082\textit{d} & 52\textit{h} & R  &&
    71.    105\textit{d} & 69\textit{h} & i  &&
    72.    & & \\ \hline
    73.    083\textit{d} & 53\textit{h} & S &&
    74.    106\textit{d} & 6A\textit{h} & j  &&
    75.    & & \\ \hline
    76.    084\textit{d} & 54\textit{h} & T  &&
    77.    107\textit{d} & 6B\textit{h} & k  &&
    78.    & & \\ \hline
    79.    085\textit{d} & 55\textit{h} & U &&
    80.    108\textit{d} & 6C\textit{h} & l &&
    81.    & & \\ \hline
    82.    086\textit{d} & 56\textit{h} & V &&
    83.    109\textit{d} & 6D\textit{h} & m &&
    84.    & & \\ \hline
    85.    087\textit{d} & 57\textit{h} & W &&
    86.    110\textit{d} & 6E\textit{h} & n &&
    87.    & & \\ \hline
    88.    088\textit{d} & 58\textit{h} & X &&
    89.    111\textit{d} & 6F\textit{h} & o &&
    90.    & & \\ \hline
    91.    089\textit{d} & 59\textit{h} & Y &&
    92.    112\textit{d} & 70\textit{h} & p &&
    93.    & & \\ \hline
    94.    090\textit{d} & 5A\textit{h} & Z  &&
    95.    113\textit{d} & 71\textit{h} & q &&
    96.    & & \\ \hline
    97.    091\textit{d} & 5B\textit{h} & [  &&
    98.    114\textit{d} & 72\textit{h} & r  &&
    99.    & & \\ \hline
    100.  \end{tabular}
    101. \end{center}


    Usando 3 colunas e 2 páginas, funcionou bem com A4. A segunda página está mais didática, mais fácil de editar e entender. Somente Ascii, sem Ascii extendido ou Unicode...

    Palavras-chave: Tabela ascii usando LaTeX e tabular

    Keywords: Show ascii table using LaTeX

    Quem sou eu

    Raphael Fernandes
    Carioca, Brasileiro, Estudante de Robótica
    Hiperativo, Imperativo
    Gosto de tecnologia, de transporte, de Rock, de reclamar e de propagandas criativas (e outras coisas que posso ter falado em um post ou não)
    Musicalmente falando, sou assim.

    Related Posts Plugin for WordPress, Blogger...

    Veja também...