Está en la página 1de 43

Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.

txt Pgina 1 de 43

Aumentar numeracion en secciones


--------------------------------
http://tex.stackexchange.com/questions/60209/how-to-add-an-extra-level-of-sections-with-headings-below-
subsubsection

You can use the titlesec package to change the way \paragraph formats the titles and set the
secnumdepth counter to four to obtain numbering for the paragraphs:

\documentclass{article}
\usepackage{titlesec}

\setcounter{secnumdepth}{4}

\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\begin{document}

\section{Test Section}
test
\subsection{Test Subsection}
test
\subsubsection{Test Subsubsection}
test
\paragraph{Test Modified Paragraph}
test

\end{document}

Lista de acrnimos en LaTeX


---------------------------
https://rockandgis.com/2015/05/12/lista-de-acronimos-en-latex/

Antes de empezar quiero aclarar que este tipo de entradas no llevan ningn orden preestablecido,
aunque pudiera parecerlo al estar enumeradas las anteriores sobre LaTeX (I, II y III). Posiblemente de
aqu en adelante hable de paquetes interesantes y no vale la pena llevar un orden de este tipo. Al lo.

Uno de los primeros problemas retos a los que me enfrent al escribir la memoria del TFG era la
necesidad de hacer una lista de acrnimos o un glosario de trminos. Hay muchas soluciones para esto,
pero la que me result ms til y decid implementar fue la siguiente: el paquete acronym.

Para utilizarlo basta con escribir en el prembulo

\usepackage{acronym}

Lo que hice a partir de aqu fue crear un documento nuevo llamado acronimos.tex en el que iba poniendo
por orden alfabtica la lista de acrnimos de la siguiente manera:

\acrodef{AGPL}{Affero General Public License}


AGPL: Affero General Public License.

\acrodef{AVHRR}{Advanced Very High Resolution Radiometer}


AVHRR: Advanced Very High Resolution Radiometer.

\acrodef{AWS}{Amazon Web Services}


AWS: Amazon Web Services.

\acrodef{CR}{Continuum Removal}
CR: Continuum Removal.

\acrodef{CRAN}{Comprehensive R Archive Network}


CRAN: The Comprehensive R Archive Network.

Como puedes ver el paquete utiliza el comando \acrodef{textocorto}{textolargo} para definir el


acrnimo. As en el documento cada vez que escribo un acrnimo lo hago de la siguiente manera:

\ac{CR}
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 2 de 43

y aparecer escrito Continuum Removal (CR) la primera vez y simplemente CR las siguientes donde
aparezca.

Otras opciones del paquete son:

acf{} hace que siempre aparezca el texto completo del acrnimo correspondiente.
acp{} incluye el plural del acrnimo.
acs{} hace que aparezca la versin crta del acrnimo.
acresetall{} resetea todos los acrnimos de forma que se establecen como no usados.
acused{} marca el acrnimo como usado.

Te fijars en que los repito. Lo hago porque quiero que en mi documento salgan impresos en un
captulo. Para eso tengo que llamar a este documento desde el documento maestro donde quiera que
aparezca con:

\input{acronimos.tex}
\addcontentsline{toc}{chapter}{Lista de Acrnimos}

El comando \addcontentsline con las opciones toc y chapter crea un captulo que aparecer en el ndice
de contenidos del documento

Acrnimos y lista de simbolos (no andubo OK)


-----------------------------
http://tex.stackexchange.com/questions/86666/how-to-create-both-list-of-abbreviations-and-list-of-
nomenclature-using-nomencl

It is indeed possible to have two separate lists using nomencl.

You can define them as groups with corresponding titles.

When doing so, you need to remove the main title by placing \renewcommand{\nomname}{} in the preamble.

Here is an example with two groups:

\documentclass{article}
\usepackage{nomencl}
\makenomenclature

%% This removes the main title:


\renewcommand{\nomname}{}
%% this modifies item separation:
\setlength{\nomitemsep}{8pt}
%% this part defines the groups:
%----------------------------------------------
\usepackage{etoolbox}
\renewcommand\nomgroup[1]{%
\item[\Large\bfseries
\ifstrequal{#1}{N}{Nomenclature}{%
\ifstrequal{#1}{A}{List of Abbreviations}{}}%
]\vspace{10pt}} % this is to add vertical space between the groups.
%----------------------------------------------

\begin{document}

\nomenclature[A]{\textbf{IMO}}{in my opinion}
\nomenclature[A]{\textbf{OP}}{original poster}
\nomenclature[N]{$c$}{speed of light in vacuum}
\nomenclature[N]{$h$}{Plank constant}

\printnomenclature[2cm]

\end{document}

COMENTARIOS--------------

Cambiar "List of Abbreviations" por "Acr\'onimos" y "Nomenclature" por "Lista de s\'imbolos"


Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 3 de 43

Encerrar una letra en un crculo


--------------------------------
Submitted by sergio on Fri, 10/05/2012 - 23:13

El comando \textcircled{x} genera el carcter x encerrado en un crculo.

Sage
----

Sistema CAS (Computer Algebra System) que puede embeber su codigo en latex
y luego compilar para obtener resultados que se incluyen en el archivo
latex, similar a lo que puede hacerse con maxima utilizando paquete maxiplot.sty

Instalar Sage
-------------
https://help.ubuntu.com/community/SAGE

Download binaries from their website

Go to the website

http://sagemath.org/download.html

and pick up a mirror to download. Choose 'Download for Linux', then

choose your architecture (32 or 64 bit),


then choose the 'lzma' package with the word Ubuntu and your Ubuntu version in the name.

if you use the Metalinks mirror then see http://wiki.sagemath.org/


DownloadAndInstallationGuide#Metalink for help

For example, for a 32-bit processor running Ubuntu 10.4, you'd select sage-4.4.4-linux-32bit-
ubuntu_10.04_lts-i686-Linux.tar.lzma where 4.4.4 is the latest Sage version at the time of writing.

Installing reduces to unpacking into /opt (or any other location of your choice), and putting a link
to the sage executable in /usr/local/bin:

sudo su
cd /opt
tar --lzma -xvf /path_to_sage_package/sage-?.?.?-linux-ubuntu-...lzma
ln -s /opt/sage.?-?-?.../sage /usr/local/bin/sage
sage

Convertir un dibujo hecho en Tikz a .png


----------------------------------------

Encontr el siguiente artculo:

Compile a LaTeX document into a PNG image that's as short as possible


---------------------------------------------------------------------
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 4 de 43

http://tex.stackexchange.com/questions/11866/compile-a-latex-document-into-a-png-image-thats-
as-short-as-possible/11880#11880

Se hace el archivo .tex con comandos tikz pero en el \documentclass se coloca lo siguiente:

\documentclass[convert={density=300,size=1080x800,outext=.png}]{standalone}

Luego se compila pdflatex -shell-escape archivo.tex

Y se crea el archivo.png

Otro link interesante:

TikZ to non-PDF
---------------
http://tex.stackexchange.com/questions/13349/tikz-to-non-pdf

convert -density 600x600 file.pdf -quality 90 -resize 1080x800 file.png

Quitar numeros al pie de pagina x defecto


-----------------------------------------
http://tex.stackexchange.com/questions/54333/no-page-numbering/54335

\pagenumbering can be helpful in removing page numbers and resetting it, at the same time. The
following minimal example, using the article document class, removes the page numbers until the ToC,
and then starts it again at 1 (set using \arabic):

\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\pagenumbering{gobble}% Remove page numbers (and reset to 1)
\clearpage
\thispagestyle{empty}
\section*{First random title} \lipsum[1]
\section*{Second random title} \lipsum[2]
\clearpage
\pagenumbering{arabic}% Arabic page numbers (and reset to 1)
\tableofcontents
\section{First section} \lipsum[3]
\section{Second section} \lipsum[4]
\section{Last section} \lipsum[5]
\end{document}

\pagenumbering{gobble} sets the "page number printing macro" to \gobble, which eats its argument/
contents. \pagenumbering{arabic} resets this to \arabic{page}.

The principle holds for other (standard) document classes as well.

Suprimir numero de pagina


-------------------------
http://tex.stackexchange.com/questions/7355/how-to-suppress-page-number/7357

You could use \pagenumbering{gobble} to switch off page numbering.

To switch it on afterwards, use \pagenumbering{arabic} for arabic numbers or alph, Alph, roman, or
Roman for lowercase resp. uppercase alphabetic resp. Roman numbering.

Problemas con tablas


--------------------

28/08/2016 al compilar con pdflatex en un entorno tabular


m{0.1\textwidth}
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 5 de 43

da error de caracteres irregulares

se arregla cargando

\usepackage{array}
\usepackage{tabularx}

Estos packages definen el comando "m"

How to crop an eps file?


------------------------
http://feng.li/crop-eps/

When you create a figure (in e.g. eps format) with R, the margins around the main context are always
to wide. To save space in the final documents, e.g. LaTeX generated pdf file. I have figured out two
ways of reducing the margins.If you just want to shrink the white margin of an eps file, try Method AC
If you want to crop an esp file, see Method D

Method A (R users) Before you make your graph in R, use par(mar=c(bottom, left, top, right))to specify
the margin you want to keep. The default value is c(5, 4, 4, 2) + 0.1. Try this example to see the
differences.
par(mar=c(5,4,4,2)+0.1) # The defualt margins
plot(rnorm(100))
dev.copy2eps() # Save as eps

par(mar=c(4,4,0,0)+0.1) # Figure with very tight margins


plot(rnorm(100))
dev.copy2eps()

Method B (use epstool) Very handy tool that can handle the optimal bounding box
epstool --copy --bbox file.eps file_new.eps

Method C (use ps2epsi)It automatically calculates the bounding box required for all encapsulated
PostScript files, so most of the time it does a pretty good job
ps2epsi <input.eps> <output.eps>

Method D (DIY for any eps )Use a text editor open your eps file and you will find a line like this
%%BoundingBox: 0 0 503 503
in the front lines of the file. Adjust these vales to proper integers. Save it and test if the margins
are better. When you want to crop an eps file and include it into LaTeX with \includegraphics command,
you should use \includegraphics* instead. Because If * is present, then the graphic is clipped to
the size specified. If * is omitted, then any part of the graphic that is outside the specified
bounding box will over-print the surrounding text. By the way, the options trim, bb, viewport
options in \includegraphics can do the same job in a different manner without editing the eps file,
see the help document for details.

Operador sumatoria con indices por debajo y arriba


---------------------------------------------------

\sum_limits_{i=1}^n i^2

agregando _limits asegura que se coloquen los indices x debajo y arriba


del operador sumatoria

Exporting Matrices in Octave/Matlab to LaTeX format


-----------------------------------------------------

http://sachinashanbhag.blogspot.com.ar/2012/11/exporting-matrices-in-octavematlab-to.html

I often need to include vectors or matrices computed during GNU Octave sessions in my lectures or
presentations. Here is a quick program called matrixTeX.m (stored on Google Drive) that takes in a
matrix A and spits out the matrix form in LaTeX.

In the simplest form, matrixTeX(A), it simply takes in a matrix A, checks whether the elements are
integers or floats, and prints out to the screen in the appropriate format using the amsmath matrix
environment bmatrix.
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 6 de 43

If you'd like the elements of the matrix displayed in a particular format, you can optionally use a
second input argument to specify a C-style formatting string: e.g: matrixTeX(A, '%10.4e'), or matrixTeX
(A, '%d').
In addition, you can also specify a third argument to specify alignment of columns as or matrixTeX(A,
'%d','r'), where the 'r' stands for right alignment. This option uses the bmatrix* environment
provided by the mathtools package, which needs to be included in the LaTeX preamble.

Inkscape incorporar formulas en latex


-------------------------------------

Seguir instrucciones de https://pav.iki.fi/software/textext/


bajar la ltima version de textext y copiarla en
~/.config/inkscape/extensions

asegurarse que el archivo


-rwxr-x--- 1 jgarcia jgarcia 32240 may 7 20:20 textext.py
pueda ejecutarse

(MUY IMPORTANTE, si este archivo textext.py no tiene "x" no funka el metodo)

tambien bajar
Pstoedit with its plot-svg back-end compiled in, or,
Pstoedit and Skconvert, or,
Pdf2svg
python-lxml

Existe una aplicacion InkLaTeX para importar contenido latex a inkscape


ver siguiente link:

http://web.archive.org/web/20160315034718/http://www.kono.cis.iwate-u.ac.jp/~arakit/inkscape/
inklatex.html

pero tengo problemas para importar un archivo .tex con comandos (7/5/2016)

Tablas con filas de colores alternados


--------------------------------------
http://texblog.org/2011/04/19/highlight-table-rowscolumns-with-color/

To do alternating row colors, you can also include the xcolor package with the table option
(i.e. \usepackage[table]{xcolor}),
and immediately preceding the tabular environment use the command

\rowcolors{start}{color1}{color2}

this will produce a table with colored rows, starting at the row indicated by start, with odd rows
colored color1 and even rows colored color2.

A bit simpler than putting the rowcolor command before each row.

Furthermore, coloring rows alternatively is similarly easy. This time we are using light gray (defined
above) and white. Here it makes sense to define a new colored column type, so we dont have to retype
the thing every time:
1

\newcolumntype{g}{>{\columncolor{Gray}}c}

The name of the new column type is g. If you only need to color one column you may want to use >
{\columncolor{Gray}}c in the tabular environment definition directly.

Complete code example:


1
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 7 de 43

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

\newcolumntype{g}{>{\columncolor{Gray}}c}
\begin{table}[ht]
\centering
\begin{tabular}{c|g|c|g|c|g|c|g}
\hline
&col1 &col2 &col3 &col4 & col5 &col6 &col7\\
\hline
row1& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
row2& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
row3& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
row4& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
row5& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
row6& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
\hline
\end{tabular}
\end{table}

Figure dentro de un entorno minipage


------------------------------------
http://tex.stackexchange.com/questions/55337/how-to-use-figure-inside-a-minipage

Figure is a floating environment and minipage is, unfortunately, not. Therefore, if you put a floating
object inside a non-floating minipage, you will get an error. But the other way around is possible--
you can put a minipage inside a figure environment:

\begin{figure}
\centering
\begin{minipage}[c]{\textwidth}
\centering
\includegraphics[width=3.0in]{example-image-a}
\caption{Caption for image}
\label{fig:sample_figure}
\end{minipage}
\end{figure}
Another method is to avoid using figure entirely. This can be done with help of the caption package
(with its captionof facility, so that you can have a caption for the figure):

.....in preamble
\usepackage{caption}

......in document body

\begin{minipage}[c]{\textwidth}
\centering
\includegraphics[width=3.0in]{example-image-a}
\captionof{figure}{Caption for image}
\label{fig:sample_figure}
\end{minipage}
The total mwe will be:

\documentclass{article}
\usepackage{mwe} % new package from Martin scharrer
\usepackage{caption}
\begin{document}
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 8 de 43

\begin{figure}
\centering
\begin{minipage}[c]{\textwidth}
\centering
\includegraphics[width=3.0in]{example-image-a}
\caption{Caption for image}
\label{fig:sample_figure}
\end{minipage}
\end{figure}

\noindent
\begin{minipage}[c]{\textwidth}
\centering
\includegraphics[width=3.0in]{example-image-a}
\captionof{figure}{Caption for image}
\label{fig:sample_figure}
\end{minipage}

\end{document}

\parbox
-------
https://en.wikibooks.org/wiki/LaTeX/Boxes

minipage and parbox

Most standard LaTeX boxes are not long commands, i.e. they do not support breaks nor paragraphs.
However you can pack a paragraph of your choice into a box with either the \parbox[pos][height]
[contentpos]{width}{text} command or the \begin{minipage}[pos][height][contentpos]{width} text \end
{minipage} environment.

The pos parameter can take one of the letters center, top or bottom to control the vertical alignment
of the box, relative to the baseline of the surrounding text. The height parameter is the height of
the parbox or minipage. The contentpos parameter is the position of the content and can be one of
center, top, bottom or spread. width takes a length argument specifying the width of the box. The main
difference between a minipage and a \parbox is that you cannot use all commands and environments
inside a parbox, while almost anything is possible in a minipage.

Probar este c\'odigo para entender como funka

\noindent
\fbox{\parbox[b][4em][t]{0.3\textwidth}{Some \\ text} }
\fbox{\parbox[c][4em][s]{0.3\textwidth}{Some \vfill text} }
\fbox{\parbox[c][4em][c]{0.3\textwidth}{Some \\ text} }

Incorporar codigo maxima a latex


--------------------------------
Adaptado de:
http://webs.um.es/mira/tex/maxima_latex.php
y experiencias propias

cargar los siguientes paquetes al inicio:

\usepackage{amsmath}
\usepackage{maxiplot}

El paquete maxiplot introduce unos pocos entornos y comandos especficos para la inclusin del cdigo
Maxima. Para la realizacin de clculo nos interesan

\begin{maxima} Cdigo Maxima \end{maxima} \imaxima{ Cdigo Maxima }

Y para la inclusin de grficos desde Maxima con salida para Gnuplot nos interesan
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 9 de 43

\begin{maximacmd} Cdigo Maxima \end{maximacmd} \imaximacmd{ Cdigo Maxima }

Prefiero utilizar el entorno "maximamcd"


A diferencia de lo que ocurre con "maxima" e "\imaxima", las unidades de Cdigo Maxima van separados
ahora por dlar ($)
o punto y coma (;) puesto que son cdigo nativo de Maxima.
Entoces puedo crear y probar mi codigo maxima en un archivo script,
cargarlo en maxima con el comando batchload("nombre_script")
y probarlo.

Para compilarlo hacer: pdflatex -shell-escape <nombre_archivo.tex>


luego: maxima -b <nombre_archivo.mac>
finalmente: pdflatex -shell-escape <nombre_archivo.tex>

si tiene codigo gnuplot:


pdflatex -shell-escape <nombre_archivo.tex>
gnuplot <nombre_archivo.gnp>
pdflatex -shell-escape <nombre_archivo.tex>

Colocar entorno itemize o enumerate dentro de un \caption


---------------------------------------------------------
Adaptado de:
http://www.latex-community.org/forum/viewtopic.php?f=45&t=8774
http://tex.stackexchange.com/questions/10551/using-the-itemize-environment-inside-a-caption

colocar en el llamado al paquete:

\usepackage[list=off]{caption}

y previo al \caption colocar:

\captionsetup{singlelinecheck=off}

\caption{Cualquier cosa
{\footnotesize \begin{multicols}{3}
\begin{enumerate}
\item Primero
\item Segundo
\end{enumerate}
\end{multicols}
}
}

probado con pdflatex y anda OK!

Cmo continuar la numeracin entre dos enumeraciones distintas


---------------------------------------------------------------
http://minisconlatex.blogspot.com.ar/2012/05/como-continuar-con-la-numeracion-entre.html

Por defecto, en LaTeX, cada vez que creamos una enumeracin, se reinicia la cuenta en 1. Si en vez de
esto, queremos que la cuenta siga desde el ltimo valor de la enumeracin anterior, podemos utilizar
uno de los dos mtodos siguientes:

La forma ms fcil es utilizando el paquete {enumitem}, que es especfico para esto. Si queremos que
la segunda enumeracin siga la cuenta, ponemos "[resume]". Si queremos que reinicie la cuenta en 1, no
ponemos nada.

\documentclass[a4paper,openright,12pt]{report}
\usepackage[spanish]{babel}
\usepackage[latin1]{inputenc}
\usepackage{enumitem} % enumerados
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 10 de 43

\begin{document}

Primera lista de la compra:

\begin{enumerate}
\item Manzanas.
\item Pltanos.
\item Fresas.
\end{enumerate}

Segunda lista de la compra:

\begin{enumerate}[resume]
\item Limones.
\item Naranjas.
\item Pomelos.
\end{enumerate}

\end{document}

El mtodo anterior tiene un problema. No podemos editar el formato de la enumeracin. Si queremos


hacerlo, podemos usar el paquete {enumerate} ms un contador, como se muestra a continuacin. Por
ejemplo, en este caso, queremos que la enumeracin sea con letras maysculas encerradas entre
parntesis (y que lo indicamos como "[(A)]"):

\documentclass[a4paper,openright,12pt]{report}
\usepackage[spanish]{babel}
\usepackage[latin1]{inputenc}
\usepackage{enumerate} % enumerados

\begin{document}

\newcounter{nx} % creamos un contador con el nombre "nx".

Primera lista de la compra:

\begin{enumerate}[(A)]
\item Manzanas.
\item Pltanos.
\item Fresas.
\setcounter{nx}{\value{enumi}} % le damos al contador el valor de la enumeracin.
\end{enumerate}

Segunda lista de la compra:

\begin{enumerate}[(A)]
\setcounter{enumi}{\value{nx}} % reiniciamos la enumeracin con el valor del contador.
\item Limones.
\item Naranjas.
\item Pomelos.
\end{enumerate}

\end{document}

Publicado por Luis en 16:01 Enviar por correo electrnicoEscribe un blogCompartir con TwitterCompartir
con FacebookCompartir en Pinterest
Etiquetas: listas

Glosarios en Latex
-------------------
http://magali-e.blogspot.com.ar/2014/06/glosarios-en-latex.html

Hace mucho que no escribo algo tcnico, pero aqu les va lo que aprend entre ayer y hoy sobre los
glosarios en LaTex.
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 11 de 43

Al parecer antes habia una paquete \userpackage{glossary}, pero olvidenlo para siempre , ya est
descontinuado. Lo sustituy \userpackage{glossaries}.

En el preambulo (si ahi donde ponen los otros paquetes) incluyen el paquete as:

\usepackage[colorlinks]{hyperref}
%este es para que se haga un hipervinculo entre las referencias y las figuras o/o tablas, etc

\usepackage[toc,style=altlistgroup,hyperfirst=false]{glossaries}

%este es el del glosario, el toc es para que se incluya en la tabla de contenidos y el style es para
que se despliegue el glosario en orden alfabetico.

antes de que pongan \begin{document}

le indican a latex que construir un glosario

\makeindex
\makeglossaries
\input{./glosario.tex}

\title{Mi tesis}
\author{MCC. magali-e}
\date{\today}

\begin{document}
\maketitle

En este caso, yo hice un archivo aparte porque voy a usar muchas definiciones y era muy latoso poner
todas las definiciones en el prembulo.

Bsicamente el archivo glosario.tex contiene los siguiente:

\newglossaryentry{ruteador}{
name={ruteador},
description={En una red de computadoras existe un nodo llamado ruteador, que se encarga de trazar una
ruta entre un nodo origen a un nodo destino}
}

\newglossaryentry{teorema de Kuhn-Tucker}
{name={Teorema de Kuhn-Tucker},
description={condiciones necesarias y suficientes para que la solucin de una programacin no lineal
sea ptima. Es una generalizacin del mtodo de los Multiplicadores de Lagrange}
}

\newglossaryentry{broadcast}
{
name={Broadcast},
description={El direccionamiento de un paquete
a todos los destinos utilizando un cdigo especial en el campo de direccin. Cuando se transmite
un paquete con este cdigo, todas las mquinas de la red lo reciben y procesan. Este modo de operacin
se conoce como difusin (broadcasting)}
}

\newglossaryentry{unicast}
{
name={Unicast},
description={La transmisin de punto a punto con un emisor y un receptor se conoce como unidifusin
(unicasting)}
}

el formato es :
\newglossaryentry{nombre} %como ser escrito en el texto
{
name={Nombre}, %como ser escrito en el glosario
description={aqu defines que es nombre}
}

despues de todo esto, hasta el final de documento, justo antes del \end{document} escribes
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 12 de 43

\printglossaries

Si creias que esto es todo... te equivocas, despues de estos compilas con pdflatex, ya sea desde tu
editor (kile, texmaker, winedt, etc), esta primera compilacin te crea los archivos .glo, gls, .glg
y .ist, por lo que despues en consola corres esto, para crear el enlace entre los archivos y el
documento final.

makeindex -s tesis.ist -t tesis.glg -o tesis.gls tesis.glo

despues de eso, compilas de nuevo y el glosario ya debe estar en tu .pdf

OJO QUE EL ULTIMO COMANDO NO ANDA!!!!

Building your document

Building your document and its glossary requires three steps:

build your LaTeX document this will also generate the files needed by makeglossaries
invoke makeglossaries a script which selects the correct character encodings and language
settings and which will also run xindy or makeindex if these are specified in your document file
build your LaTeX document again to produce a document with glossary entries

Thus:

latex doc.tex
makeglossaries doc.glo
latex doc.tex

where latex is your usual build call (perhaps pdflatex) and doc is the name of your LaTeX master file.

If your entries are interlinked (entries themselves link to other entries with \gls calls), you will
need to run steps 1 and 2 twice, that is, in the following order: 1, 2, 1, 2, 3.

If you encounter problems, view the doc.log and doc.glg files in a text editor for clues.

Convertir imagenes a base64


---------------------------

en una terminal

base64 <archivo de la imagen> > <nombre archivo>.b64

lo convierte a base64 en el archivo <nombre archivo>.b64

Colocar imagenes base64 en latex


--------------------------------
http://tex.stackexchange.com/questions/208819/embedding-images-in-tex-file-as-base64-strings

f you have a command line base64 decoder (base64 -d here) and allow

pdflatex --shell-escape

to run external commands then you do not need anything other than the standard graphics package.

Here I include a base64 encoded pdf image.

\documentclass{article}
\begin{filecontents*}{\jobname.64}
JVBERi0xLjUKJbXtrvsKMyAwIG9iago8PCAvTGVuZ3RoIDQgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRl
RGVjb2RlCj4+CnN0cmVhbQp4nJWTO1LEMAyG+5xCNYXQy69j7BFoWIpsAdx/Bjlksx4nZE0VWSP/
3y9Z+ZwIY46SAjRBThRyhq8rvL4RXL8nAlFDTQw3jxTZvAxmkCKohSEKclzOaCF5SV6KZ/iY3l8c
IZSyKTSBFmGvdASBkqFZce0H50BrTdTqsNBW8cKapNpeA66qXfFts6rEGKP9w7zfKJGhCaJokNKb
vw9GyStcaD5kHvfgQ3HzsAW/PXSCz2bfw1btIMH9Pb7JCsmA+YbVvsvZ1DmonzMYJeRUx86p+F4Z
GGfMXHXvGRXBEkPNrLdUGP0zwzSwNuxGPTK/k6nu5ZpQUTSRI9ne3dAL7zkVoGCaUIo2DTUt/gU6
+9U6/xtIJSzkocmdrVNnfAyw6+3ZUg3Ma4ftX25hXKYfzwLt9wplbmRzdHJlYW0KZW5kb2JqCjQg
MCBvYmoKICAgMzA1CmVuZG9iagoyIDAgb2JqCjw8CiAgIC9FeHRHU3RhdGUgPDwKICAgICAgL2Ew
IDw8IC9DQSAxIC9jYSAxID4+CiAgID4+Cj4+CmVuZG9iago1IDAgb2JqCjw8IC9UeXBlIC9QYWdl
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 13 de 43

CiAgIC9QYXJlbnQgMSAwIFIKICAgL01lZGlhQm94IFsgMCAwIDI5Mi4zODk5MjMgNDM3LjI5MzI0
MyBdCiAgIC9Db250ZW50cyAzIDAgUgogICAvR3JvdXAgPDwKICAgICAgL1R5cGUgL0dyb3VwCiAg
ICAgIC9TIC9UcmFuc3BhcmVuY3kKICAgICAgL0NTIC9EZXZpY2VSR0IKICAgPj4KICAgL1Jlc291
cmNlcyAyIDAgUgo+PgplbmRvYmoKMSAwIG9iago8PCAvVHlwZSAvUGFnZXMKICAgL0tpZHMgWyA1
IDAgUiBdCiAgIC9Db3VudCAxCj4+CmVuZG9iago2IDAgb2JqCjw8IC9DcmVhdG9yIChjYWlybyAx
LjExLjIgKGh0dHA6Ly9jYWlyb2dyYXBoaWNzLm9yZykpCiAgIC9Qcm9kdWNlciAoY2Fpcm8gMS4x
MS4yIChodHRwOi8vY2Fpcm9ncmFwaGljcy5vcmcpKQo+PgplbmRvYmoKNyAwIG9iago8PCAvVHlw
ZSAvQ2F0YWxvZwogICAvUGFnZXMgMSAwIFIKPj4KZW5kb2JqCnhyZWYKMCA4CjAwMDAwMDAwMDAg
NjU1MzUgZiAKMDAwMDAwMDcwNSAwMDAwMCBuIAowMDAwMDAwNDE5IDAwMDAwIG4gCjAwMDAwMDAw
MTUgMDAwMDAgbiAKMDAwMDAwMDM5NyAwMDAwMCBuIAowMDAwMDAwNDkxIDAwMDAwIG4gCjAwMDAw
MDA3NzAgMDAwMDAgbiAKMDAwMDAwMDg5NyAwMDAwMCBuIAp0cmFpbGVyCjw8IC9TaXplIDgKICAg
L1Jvb3QgNyAwIFIKICAgL0luZm8gNiAwIFIKPj4Kc3RhcnR4cmVmCjk0OQolJUVPRgo=
\end{filecontents*}
\usepackage{graphicx}

\begin{document}

\immediate\write18{base64 -d \jobname.64 > \jobname-tmp.pdf}

picture is

\fbox{\includegraphics[width=3cm]{\jobname-tmp.pdf}}

\end{document}

shareimprove this answer

Escribir en octave una matriz en cdigo latex


---------------------------------------------
http://tex.stackexchange.com/questions/43706/octave-to-latex

If all you need is a matrix, you can do this:

strrep(strrep(mat2str(A),",","&"),";","\\\\\n")(2:end-1)

where A is your matrix. That will give you the body of your matrix, without the \begin{matrix} and \end
{matrix}

strcat("\\begin{bmatrix}\n",strrep(strrep(mat2str(A),",","&"),";","\\\\\n")(2:end-1),"\n\\end{bmatrix}
\n")

will generate the whole thing.

I don't think there is a more comprehensive solution in Octave.

Another option seems to be using scilab. It is also more or less MATLAB compatible (some say even more
than Octave), and it has a prettyprint function that seems to do what you want. I have no experience
with scilab, though.

Adecuar Emacs/Auctex para usar Pdflatex y Evince por defecto


------------------------------------------------------------
http://ubuntudriver.blogspot.com.ar/2012/04/adecuar-emacsauctex-para-usar-pdflatex.html

Por alguna razn que desconocemos, nuestro do preferido para editar ficheros LaTeX ---emacs y
auxtex--- no viene preconfigurado en Ubuntu para usar por defecto el formato pdflatex y el visor
Evince. Por una parte creemos desfasado compilar con Latex para crear un .dvi y por otra, la mayora
de visores no actualizan automticamente un .pdf si ste ha sido modificado; no es el caso de Evince.
Por tanto, queremos que al compilar los .tex desde emacs+auctex acte pdflatex y que bajo demanda se
habra el .pdf generado mediante Evince ... y por suerte emacs es muy configurable.

Suponemos ya instalado en nuestro Ubuntu emacs, texlive y auctex; si no es as, ejectese la siguiente
orden de consola:

sudo apt-get install emacs texlive auctex


Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 14 de 43

Este post ha sido elaborado en colaboracin con nuestro seguidor D. Alberto Rodrguez, que recibe
nuestro agradecimiento.

Procedimiento

Seguiremos los siguientes pasos:

Abrimos cualquier fichero .tex que tengamos a mano.


Pulsamos en "LaTeX" del men contextual de emacs.
Posicionamos el cursor en "Customize AUCTeX" y pulsamos en "Extend this Menu".
Volvemos a pulsar en "LaTeX" y poner el cursor sobre "Customize AUCTeX" ... ahora aparecer un
men ms amplio, como era de esperar.
Nos posicionaremos sobre "Tex Command" y luego sobre "Tex Pdf Mode..." del submen; haremos clic y
veremos que se abre una nueva pgina. Se trata de operar sobre ella.
Veremos el apartado "Tex Pdf Mode" y debe estar en "off (nill)". Esto debe cambiar y para ello
pulsamos sobre la tecla "Toggle" y ahora aparecer a "on (non-nill)". Es necesario guardar lo hecho,
por lo que pulsaremos sobre el botn "Save for future sessions". Con esto AUCTeX compilar ahora
los .tex con pdflatex y generar ficheros .pdf. Pulsamos sobre el botn "Exit".
Seguidamente pulsamos de nuevo sobre "Latex" y pulsamos sobre "Customize AUCTeX > Tex Command >
Tex View > Tex View...". Vamos a "Tex Source Correlate Method" y:
Pulsamos en el botn "Value Menu" y seleccionamos "synctex". Pulsamos en el botn "State" y
marcamos "Save for Future Sessions".
Pulsamos en "Value Menu" de la seccin "Tex Source Correlate Start Server" y marcamos
"Always". Pulsamos en el botn "State" y marcamos "Save for Future Sessions".
Pulsamos en "Toggle" de la seccin "Tex Source Correlate Mode". Pulsamos en el botn "State"
y marcamos "Save for Future Sessions".

Pulsamos sobre el botn "Exit".

Para seleccionar a Evince o Okular como visor predeterminado de pdf:


Pulsamos de nuevo sobre "Latex" y pulsamos sobre "Customize AUCTeX > Tex Command > Tex View >
Tex View Program List..." y pulsamos sobre el botn "INS" y rellenamos el formulario como sigue:
en "Name:" escribimos: Evince.
si no vemos junto a "Value Menu" la palabra "Command:", pulsamos en dicho botn y
seleccionamos "Command".
En "Command:" escribimos: evince --page-index=%(outpage) %o
Pulsamos en "State" y seleccionamos "Save for Future Sessions".
Pulsamos sobre el botn "Exit".
Pulsamos de nuevo sobre "Latex" y pulsamos sobre "Customize AUCTeX > Tex Command > Tex View >
Tex View Program Selection.." y pulsamos sobre el botn "INS" y rellenamos el formulario como sigue:
Pulsamos sobre el primer botn de "Value Menu" y seleccionamos "Single predicate"
Pulsamos en el botn "Value Menu" contiguo y seleccionamos "output-pdf".
En "Viewer" pulsamos su botn correspondiente de "Value Menu" y seleccionamos "Evince".
Pulsamos en "State" y seleccionamos "Save for Future Sessions".
Pulsamos sobre el botn "Exit".

Ahora cerramos emacs y si volvemos a abrir con l algn .tex, veremos que funciona como desebamos.

Using tables the smart way / generate tables with pgfplotstable


---------------------------------------------------------------
http://www.latex-tutorial.com/tutorials/advanced/lesson-9/

De archivos cvs se pueden generar las tablas, ver el artculo

ERROR: No room for a new \dimen


-------------------------------
http://tex.stackexchange.com/questions/38607/no-room-for-a-new-dimen

I have this error message:

! No room for a new \dimen . \ch@ck ...\else \errmessage {No room for
a new #3}
\fi
which I can not find a cure for.
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 15 de 43

Answer
-----

This can depend on two reasons:

too many packages;


a programming error, such as saying \newdimen inside the definition of a command.
In case 1, load

\usepackage{etex}
just after the \documentclass line. In case 2, correct the definition.

If you're loading morefloats or manyfoot, then add

\reserveinserts{28}
just after loading etex; this is necessary to accomplish with the needs of those packages.

Note

This trick has to do with the allocation mechanism of insertion classes, that use "high" numbered
registers; for example the insertion class \@mpfootnotes uses the registers with number 254 and the
last allocated one uses 234. An insertion class reserves the registers of type \count, \dimen, \skip,
\box and, of course, \insert with the assigned number. Conversely, commands such as \newcounter or
\newlength start from 11 upwards.

When the last allocated counter or length corresponds to number 233, the next request would result
(with ordinary LaTeX) in the No room message. By loading etex, in this case the system will allocate
instead the first free register in the extended pool, that is, from 256 to 32767.

The packages morefloats and manyfoot allocate 18 and 10 insertion classes; but, depending on the
loading order, this could cause clashes; say that packages loaded before them allocate \count
registers up to 220: there will be no room for the new insertion classes.

The command \reserveinserts{28} fools the allocation mechanism by pretending that registers from 206
to 233 are already occupied, so a request for a new register, when the last allocated one was 217,
will go directly to the extended pool. In this way, morefloats and manyfoot can do their allocations
safely, by occupying slots that are surely free, independently on the package loading order (the
allocation commands are conveniently patched so as to not interfere with the process of insertion
class allocation).

As Stephen remarks in a comment, if morefloats is loaded with more than 18 additional floats (which is
the default), then the argument to \reserveinserts should be modified accordingly. Just add 10 to the
number of floats for morefloats in case you also use manyfoot.

Otros comentarios
-----------------
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=noroom

No room for a new thing


------------------------

The technology available to Knuth at the time TeX was written is said to have been particularly poor
at managing dynamic storage; as a result much of the storage used within TeX is allocated as fixed
arrays, in the reference implementations. Many of these fixed arrays are expandable in modern TeX
implementations, but size of the arrays of registers is written into the specification as being 256
(usually); this number may not be changed if you still wish to call the result TeX (see testing TeX
implementations).

If you fill up one of these register arrays, you get a TeX error message saying

! No room for a new \<thing>.


The \things in question may be \count (the object underlying LaTeXs \newcounter command), \skip (the
object underlying LaTeXs \newlength command), \box (the object underlying LaTeXs \newsavebox
command), or \dimen, \muskip, \toks, \read, \write or \language (all types of object whose use is
hidden in LaTeX; the limit on the number of \read or \write objects is just 16).

There is nothing that can directly be done about this error, as you cant extend the number of
available registers without extending TeX itself. Of course, e-TeX, Omega and LuaTeX all do this, as
does MicroPress Incs VTeX.

The commonest way to encounter one of these error messages is to have broken macros of some sort, or
incorrect usage of macros (an example is discussed in epsf problems).
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 16 de 43

However, sometimes one just needs more than TeX can offer, and when this happens, youve just got to
work out a different way of doing things. An example is the difficulty of loading PicTeX with LaTeX.
The more modern drawing package, pgf with its higher-level interface TikZ is also a common source of
such problems.

In such cases, it is usually possible to use the e-TeX extensions (all modern distributions provide
them). The LaTeX package etex modifies the register allocation mechanism to make use of e-TeXs
extended register sets. Etex is a derivative of the Plain TeX macro file etex.src, which is used in
building the e-TeX Plain format; both files are part of the e-TeX distribution and are available in
current distributions.

It is possible that, even with etex loaded, you still find yourself running out of things. Problems
can be caused by packages that use large numbers of inserts (inserts are combinations of counter,
box, dimension and skip registers, used for storing floats and footnotes). Morefloats does this, of
course (naturally enough, allocating new floats), and footnote packages such as manyfoot and bigfoot
(which uses manyfoot) can also give problems. The etex extensions allow you to deal with these things:
the command \reserveinserts{n} ensures there is room for <n> more inserts. Hint: by default morefloats
adds 18 inserts (though it can be instructed to use more), and manyfoot seems to be happy with 10
reserved, but there are hard limits that we cannot program around the discussion of running out of
floats has more about this. It is essential that you load etex before any other packages, and reserve
any extra inserts immediately:

\documentclass[...]{...}
\usepackage{etex}
\reserveinserts{28}
The e-TeX extensions dont help with \read or \write objects (and neither will the etex package), but
the morewrites package can provide the illusion of large numbers of \write objects.

Figuras paralelas en \LaTeX


---------------------------
http://ingenium-liber.blogspot.com.ar/2011/11/figuras-paralelas-en-latex.html

La flexibilidad que da el lenguaje de programacin \LaTeX, permite que una misma cosa se pueda
realizar de distintas formas ofreciendo un amplio abanico de alternativas que se adaptan a los gustos
de cada uno.

Como ejemplo de esta flexibilidad escribo sobre las alternativas para poner varias figuras una al lado
de la otra en paralelo:

Opcin 1 (usando solo minipage):

Concretamente el ejemplo mostrado en el enlace es:


\documentclass{article}
\begin{document}
\begin{figure}
\begin{minipage}[b]{0.5\linewidth}
\centering\rule{2cm}{2cm}
\caption{Primera figura}
\label{fig:figura1}
\end{minipage}%
\begin{minipage}[b]{0.5\linewidth}
\centering\rule{2cm}{2cm}
\caption{Segunda subfigura}
\label{fig:figura2}
\end{minipage}
\end{figure}
\end{document}

Opcin 2 (usando subfloats):

Para este caso, el ejemplo del mismo es:


\documentclass{article}
\usepackage{subfig}
\begin{document}
\begin{figure}
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 17 de 43

\centering
\subfloat[Primera subfigura]{\label{fig:1a}\rule{2cm}{2cm}}
\hspace{1cm}
\subfloat[Primera subfigura]{\label{fig:1b}\rule{2cm}{2cm}}
\caption{Figura con subfiguras}
\label{fig:1}
\end{figure}
\end{document}
Opcin 3 (usando minipage y subcaption):

En esta ocasin, se puede usar este ejemplo:


\documentclass{article}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{minipage}[b]{.5\linewidth}
\centering\rule{2cm}{2cm}
\subcaption{Primera subfigura}\label{fig:1a}
\end{minipage}%
\begin{minipage}[b]{.5\linewidth}
\centering\rule{2cm}{2cm}
\subcaption{Segunda subfigura}\label{fig:1b}
\end{minipage}
\caption{Figura con subfiguras}\label{fig:1}
\end{figure}
\end{document}

Para ver el resultado de cada uno basta con compilarlos por separado en distintos archivos (los
paquetes subcaption y subfig son incompatibles) y elegir la opcin que se adapte ms a las necesidades
del momento.

A modo de comentario sobre las aplicaciones de cada uno dir que la primera opcin es ms para figuras
"independientes" y las otras dos opciones es para verdaderas "subfiguras"; adems hay que tener en
cuenta que el paquete subfig puede dar problemas con hyperrefer y no funciona con la clase beamer.
Para ms datos sobre la comparacin entre subfig y subcaption recomiendo visitar este enlace donde
Axel Sommerfeldt hace una buena comparativa de estos paquetes (lejos de ser objetiva como l dice por
ser autor de los paquetes caption y subcaption jeje).

Nota1: Para no tener que usar figuras concretas, he usado el comando \rule{2cm}{2cm} que a la hora de
utilizar con las figuras que cada cual tenga deber sustituir por el correspondiente \includegraphics
[opciones-que-quieras]{nombre-y-ruta-de-la-imagen}.

Nota2: Antes exista un paquete llamado subfigure que ya est obsoleto y no se recomienda usar.

TABLAS. OCULTAR COLUMNAS


------------------------
http://texblog.org/
http://tex.stackexchange.com/questions/16604/easiest-way-to-delete-a-column

Removing/hiding a column in a LaTeX table


Posted on 24. October 2014 Leave a Comment

Its easy to add, remove, or shift rows. Just copy-and-paste or delete the corresponding line in the
table. Removing columms is a different story. You might be able to come up with some sophisticated
regular expression, which removes the right value in every row. Otherwise, the only way is to use
another program or to do it manually. Also, what if you later decide to include the column?

Here is a neat way to hide table columns. This trick requires minimal changes to the table and can be
undone easily.

Define a new column type that swallows its content.


Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 18 de 43

The array package implements a macro to define your own column type. This is useful when complicated
column styles are reused multiple times. Here, we will use it to hide the column content.

The following code defines a new column type H that packs its content into a box of zero size. To
remove the intercolumn space after the column we use: @{}.
1
2
3

%In the preamble


\usepackage{array}
\newcolumntype{H}{>{\setbox0=\hbox\bgroup}c<{\egroup}@{}}

Now we can hide/unhide columns by using the newly defined column type H.

\begin{tabular}{lcrH}
...
\end{tabular}

LaTeX Controlando el espacio entre prrafos


Publicado el 01/07/2012 por Javier Montero
-------------------------------------------
http://elclubdelautodidacta.es/wp/2012/07/latex-controlando-el-espacio-entre-parrafos/

Objetivo: presentar la dimensin \parskip para el control del espaciado entre prrafos.

Ya sabes cmo trata \LaTeX por defecto la separacin entre prrafos: no los separa. El espaciado que
hay entre un prrafo y el siguiente es el mismo que entre dos lneas consecutivas. Para poder
distinguir dnde acaba uno y comienza otro \LaTeX indenta la primera lnea de cada prrafo.

Pero hay ms estilos a la hora de distinguir prrafos. En el artculo Cambiando el estilo de los
prrafos aprendimos la utilizacin del paquete parskip para hacer que los prrafos no se indentaran y
mantuvieran un espacio de separacin entre ellos.

Hoy voy a presentarte la magnitud \parskip (no la confundas con el paquete parskip, pese a que lleven
el mismo nombre), que sirve para configurar el espaciado extra que queremos que exista entre prrafos.

Por defecto, la distancia entre prrafos es la misma que entre lneas, es decir, \parskip vale cero.
Pero podemos cambiar su valor empleando el comando \setlength, que ya conocemos:

\setlength{\parskip}{8mm}

Si escribimos esta lnea en el prembulo, todos los prrafos del documento aparecern separados 8mm
ms la distancia normal entre lneas. Presta atencin a esto, voy a repetirlo: no es que la distancia
entre prrafos sea de 8mm, sino 8mm ms la habitual entre lneas.

Tambin puedes incluir el comando anterior en el cuerpo del documento. En este caso la separacin
nueva slo se aplicar a partir del prrafo que lo contenga. Si, en cualquier momento, quieres
regresar a la distancia por defecto, puedes recurrir a esto otro:

\setlength{\parskip}{0cm}

Observa que, aunque el valor sea cero, es necesario indicar las unidades.

Naturalmente, tambin puedes limitar el efecto del comando acotndolo en un grupo delimitado por
llaves:

{\setlength{\parskip}{8mm}.....Resto del prrafo o prrafos....}

El valor de \parskip tambin puede ser negativo, algo que en algunas circunstancias particulares puede
ser conveniente:

\setlength{\parskip}{-2mm}
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 19 de 43

A m me gusta que la distancia entre prrafos sea una lnea en blanco, es decir, que la separacin sea
dos veces el espacio normal entre lneas. En un artculo reciente expliqu que LaTeX controlaba el
interlineado a travs de la magnitud \baselineskip (que no debamos modificar sino a travs del
multiplicador \baselinestretch).

Por lo tanto, si quiero que la distancia extra entre prrafos sea la misma que el interlineado, puedo
escribir, simplemente:

\setlength{\parskip}{\baselineskip}

Tambin podemos recurrir a unidades relativas en vez de absolutas.

\setlength{\parskip}{1ex}

De este modo, la distancia extra entre prrafos ser el equivalente a la altura de la letra x, que
depende, naturalmente, del tamao de la fuente empleada.

Para finalizar, voy a hablarte de lo que en \LaTeX se conoce como longitudes de goma. Hay ocasiones en
las que podramos desear estticamente que la altura de las pginas sea siempre la misma. El problema
es que \LaTeX puede tomarse al pie de la letra, con rigurosa precisin, nuestros comandos. Si, como en
los ejemplos anteriores, indicamos la longitud exacta que queremos entre prrafos, puede que luego los
nmeros no cuadren a la hora de encajar todo en la pgina, con el resultado de que la altura de las
pginas podr variar de una a otra.

Sera interesante poder decirle a \LaTeX: quiero 1cm extra entre prrafos, pero, si lo consideras
necesario, ajusta flexiblemente esa cantidad, segn tu buen criterio, para que luego todo encaje bien
en la pgina.

Ah entra lo que se conoce como longitudes de goma, en relacin a la flexibilidad de este material.
Observa este comando flexible:

\setlength{\parskip}{1cm plus 5mm minus 4mm}

Lo que le estamos diciendo a \LaTeX es que la separacin extra ha de ser 1cm, pero, si se considera
necesario, puede crecer un poco, hasta 5mm ms, o reducirse hasta 4mm menos.

Flexibilidad, la clave del control

Latex Simbolos especiales


-------------------------
http://es.wikibooks.org/wiki/Manual_de_LaTeX/Escribiendo_texto/Signos_ortogr%C3%A1ficos

originalmente slo lee texto de cdigo ASCII, por lo que si queremos usar palabras acentuadas,
necesitamos algunas instrucciones. He aqu la forma de conseguir acentuaciones y signos ortogrficos
que no tienen un ASCII:

\' (acento agudo) \` ` (acento grave)


\~ ~ (tilde) \" (diresis)
\^ ^ (circunflejo) \c c (c con cedilla)
?` (signo izquierdo de interrogacin) !` (signo izquierdo de exclamacin)

As, para obtener palabras como conexin escribimos conexi\'on. La acentuacin de la letra i requiere
de un paso previo, que consiste en eliminar el puntito que ha de ser remplazado por el acento. Pare
esto escribimos \i. As, al escribir \'{\i} obtenemos .

Hay smbolos que no estn definidos de manera inmediata en \mathbf{L\!\!^{{}_{\scriptstyle A}} \!\!\!\!
\!\;\; T\!_{\displaystyle E} \! X}, pero que podemos conseguir muy fcilmente. Por ejemplo, el smbolo
de grado, , podemos obtenerlo con $\phantom{a}^{\circ}$, aunque quedar demasiado espacio entre l y
la palabra que le precede. Por eso, es mejor escribir \hspace{-1.5mm}$\phantom{a}^{\circ}$. Sera an
mejor si definimos nuestro propio comando para obtener el smbolo que hemos creado. Por ejemplo,
podemos escribir (de preferencia en el prembulo),

\newcommand{\grad}{\hspace{-2mm}$\phantom{a}^{\circ}$}

y as, al escribir La temperatura era de 47 \grad C obtendremos La temperatura era de 47C


Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 20 de 43

LaTeX/Installing Extra Packages


-------------------------------
http://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages#Manual_installation

Add-on features for LaTeX are known as packages. Dozens of these are pre-installed with LaTeX and can
be used in your documents immediately. They should all be stored in subdirectories of texmf/tex/latex
named after each package. The directory name "texmf" stands for TEX and METAFONT. To find out what
other packages are available and what they do, you should use the CTAN search page which includes a
link to Graham Williams' comprehensive package catalogue.

A package is a file or collection of files containing extra LaTeX commands and programming which add
new styling features or modify those already existing. There are two main file types: class files
with .cls extension, and style files with .sty extension. There may be ancillary files as well. When
you try to typeset a document which requires a package which is not installed on your system, LaTeX
will warn you with an error message that it is missing. You can download updates to packages you
already have (both the ones that were installed along with your version of LaTeX as well as ones you
added). There is no limit to the number of packages you can have installed on your computer (apart
from disk space!), but there is a configurable limit to the number that can be used inside any one
LaTeX document at the same time, although it depends on how big each package is. In practice there is
no problem in having even a couple of dozen packages active.

Most LaTeX installations come with a large set of pre-installed style packages, so you can use the
package manager of the TeX distribution or the one on your system to manage them. See the automatic
installation. But many more are available on the net. The main place to look for style packages on the
Internet is CTAN. Once you have identified a package you need that is not in your distribution, use
the indexes on any CTAN server to find the package you need and the directory where it can be
downloaded from. See the manual installation.

Contents

1 Automatic installation
2 Manual installation
2.1 Downloading packages
2.2 Installing a package
3 Checking package status
4 Package documentation
5 External resources
6 See Also

Automatic installation

If on an operating system with a package manager or a portage tree, you can often find packages in
repositories.

With MikTeX there is a package manager that allows you to pick the package you want individually. As a
convenient feature, upon the compilation of a file requiring non-installed packages, MikTeX will
automatically prompt to install the missing ones.

With TeX Live, it is common to have the distribution packed into a few big packages. For example, to
install something related to internationalization, you might have to install a package like texlive-
lang. With TeX Live manually installed, use tlmgr to manage packages individually.

tlmgr install <package1> <package2> ...


tlmgr remove <package1> <package2> ...

The use of tlmgr is covered in the Installation chapter.

If you cannot find the wanted package with any of the previous methods, see the manual installation.
Manual installation
Downloading packages

What you need to look for is usually two files, one ending in .dtx and the other in .ins. The first is
a DOCTeX file, which combines the package program and its documentation in a single file. The second
is the installation routine (much smaller). You must always download both files. If the two files are
not there, it means one of two things:

Either the package is part of a much larger bundle which you shouldn't normally update unless you
change LaTeXversion of LaTeX;
or it's an older or relatively simple package written by an author who did not use a .dtx file.

Download the package files to a temporary directory. There will often be a readme.txt with a brief
description of the package. You should of course read this file first.
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 21 de 43

Installing a package

There are five steps to installing a LaTeX package. (These steps can also be used on the pieces of a
complicated package you wrote yourself; in this case, skip straight to Step 3.)

1. Extract the files Run LaTeX on the .ins file. That is, open the file in your editor and process it
as if it were a LaTeX document (which it is), or if you prefer, type latex followed by the .ins
filename in a command window in your temporary directory. This will extract all the files needed from
the .dtx file (which is why you must have both of them present in the temporary directory). Note down
or print the names of the files created if there are a lot of them (read the log file if you want to
see their names again).

2. Create the documentation Run LaTeX on the .dtx file. You might need to run it twice or more, to get
the cross-references right (just like any other LaTeX document). This will create a .dvi file of
documentation explaining what the package is for and how to use it. If you prefer to create PDF then
run pdfLaTeX instead. If you created a .idx as well, it means that the document contains an index,
too. If you want the index to be created properly, follow the steps in the indexing section. Sometimes
you will see that a .glo (glossary) file has been produced. Run the following command instead:

makeindex -s gglo.ist -o name.gls name.glo

3. Install the files While the documentation is printing, move or copy the package files from your
temporary directory to the right place[s] in your TeX local installation directory tree. Packages
installed by hand should always be placed in your "local" directory tree, not in the directory tree
containing all the pre-installed packages. This is done to a) prevent your new package accidentally
overwriting files in the main TeX directories; and b) avoid your newly-installed files being
overwritten when you next update your version of TeX.

For a TDS(TeX Directory Structure)-conformant system, your "local installation directory tree" is a
folder and its subfolders. The outermost folder should probably be called texmf-local/ or texmf/. Its
location depends on your system:

MacTeX: Users/username/Library/texmf/.
Unix-type systems: Usually ~/texmf/.
MikTeX: Your local directory tree can be any folder you like, as long as you then register it
as a user-managed texmf directory (see http://docs.miktex.org/manual/localadditions.html#id573803)

The "right place" sometimes causes confusion, especially if your TeX installation is old or does not
conform to the TeX Directory Structure(TDS). For a TDS-conformant system, the "right place" for a
LaTeX .sty file is a suitably-named subdirectory of texmf/tex/latex/. "Suitably-named" means sensible
and meaningful (and probably short). For a package like paralist, for example, I'd call the directory
texmf/tex/latex/paralist.

Often there is just a .sty file to move, but in the case of complex packages there may be more, and
they may belong in different locations. For example, new BibTeX packages or font packages will
typically have several files to install. This is why it is a good idea to create a sub-directory for
the package rather than dump the files into misc along with other unrelated stuff. If there are
configuration or other files, read the documentation to find out if there is a special or preferred
location to move them to.

Where to put files from packages Type Directory (under texmf/ or texmf-local/) Description
.afm fonts/afm/foundry/typeface Adobe Font Metrics for Type 1 fonts
.bst bibtex/bst/packagename BibTeX style
.cls tex/latex/base Document class file
.dvi doc package documentation
.enc fonts/enc Font encoding
.fd tex/latex/mfnfss Font Definition files for METAFONT fonts
.fd tex/latex/psnfss Font Definition files for PostScript Type 1 fonts
.map fonts/map/ Font mapping files
.mf fonts/source/public/typeface METAFONT outline
.pdf doc package documentation
.pfb fonts/type1/foundry/typeface PostScript Type 1 outline
.sty tex/latex/packagename Style file: the normal package content
.tex doc TeX source for package documentation
.tex tex/plain/packagename Plain TeX macro files
.tfm fonts/tfm/foundry/typeface TeX Font Metrics for METAFONT and Type 1 fonts
.ttf fonts/truetype/foundry/typeface TrueType font
.vf fonts/vf/foundry/typeface TeX virtual fonts
others tex/latex/packagename other types of file unless instructed otherwise

For most fonts on CTAN, the foundry is public.


Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 22 de 43

4. Update your index Finally, run your TeX indexer program to update the package database. This
program comes with every modern version of TeX and has various names depending on the LaTeX
distribution you use. (Read the documentation that came with your installation to find out which it
is, or consult http://www.tug.org/fonts/fontinstall.html#fndb):

teTeX, TeX Live, fpTeX: texhash


web2c: mktexlsr
MacTeX: MacTeX appears to do this for you.
MikTeX: initexmf --update-fndb (or use the GUI)
MiKTeX 2.7 or later versions, installed on Windows XP through Windows 7: Start -> All Programs
-> MikTex -> Settings. In Windows 8 use the keyword Settings and choose the option of Settings with
the MiKTex logo. In Settings menu choose the first tab and click on Refresh FNDB-button (MikTex will
then check the Program Files directory and update the list of File Name DataBase). After that just
verify by clicking 'OK'.

warning
This step is utterly essential, otherwise nothing will work.

5. Update font maps If your package installed any TrueType or Type 1 fonts, you need to update the
font mapping files in addition to updating the index. Your package author should have included a .map
file for the fonts. The map updating program is usually some variant on updmap, depending on your
distribution:

TeX Live and MacTeX: updmap --enable Map=mapfile.map (if you installed the files in a personal
tree) or updmap-sys --enable Map=mapfile.map (if you installed the files in a system directory).
MikTeX: Run initexmf --edit-config-file updmap, add the line "Map mapfile.map to the file that
opens, then run initexmf --mkmaps.

See http://www.tug.org/fonts/fontinstall.html.

The reason this process has not been automated widely is that there are still thousands of
installations which do not conform to the TDS, such as old shared Unix systems and some Microsoft
Windows systems, so there is no way for an installation program to guess where to put the files: you
have to know this. There are also systems where the owner, user, or installer has chosen not to follow
the recommended TDS directory structure, or is unable to do so for political or security reasons (such
as a shared system where she cannot write to a protected directory). The reason for having the texmf-
local directory (called texmf.local on some systems) is to provide a place for local modifications or
personal updates, especially if you are a user on a shared or managed system (Unix, Linux, VMS,
Windows NT/2000/XP, etc.) where you may not have write-access to the main TeX installation directory
tree. You can also have a personal texmf subdirectory in your own login directory. Your installation
must be configured to look in these directories first, however, so that any updates to standard
packages will be found there before the superseded copies in the main texmf tree. All modern TeX
installations should do this anyway, but if not, you can edit texmf/web2c/texmf.cnf yourself.
Checking package status

The universal way to check if a file is available to TeX compilers is the command-line tool kpsewhich.

$ kpsewhich tikz
/usr/local/texlive/2012/texmf-dist/tex/plain/pgf/frontendlayer/tikz.tex

kpsewhich will actually search for files only, not for packages. It returns the path to the file. For
more details on a specific package use the command-line tool tlmgr (TeX Live only):

tlmgr info <package>

The tlmgr tool has lot more options. To consult the documentation:

tlmgr help

Package documentation

To find out what commands a package provides (and thus how to use it), you need to read the
documentation. In the texmf/doc subdirectory of your installation there should be directories full
of .dvi files, one for every package installed. This location is distribution-specific, but is
typically found in:
Distribution Path
MiKTeX %MIKTEX_DIR%\doc\latex
TeX Live $TEXMFDIST/doc/latex

Generally, most of the packages are in the latex subdirectory, although other packages (such as BibTeX
and font packages) are found in other subdirectories in doc. The documentation directories have the
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 23 de 43

same name of the package (e.g. amsmath), which generally have one or more relevant documents in a
variety of formats (dvi, txt, pdf, etc.). The documents generally have the same name as the package,
but there are exceptions (for example, the documentation for amsmath is found at latex/amsmath/
amsdoc.dvi). If your installation procedure has not installed the documentation, the DVI files can all
be downloaded from CTAN. Before using a package, you should read the documentation carefully,
especially the subsection usually called "User Interface", which describes the commands the package
makes available. You cannot just guess and hope it will work: you have to read it and find out.

You can usually automatically open any installed package documentation with the texdoc command:

texdoc <package-name>

Creating LaTeX code in Scilab is easy!


--------------------------------------
Posted By Mizue Horiuchi, Wednesday, August 10, 2011
http://www.equalis.com/blogpost/731635/129430/Creating-LaTeX-code-in-Scilab-is-easy

Writing a result of Scilab computation on your paper using LaTeX is much easier if you use the
function "prettyprint. This will give you a [\text{\LaTeX}] code of your Scilab input/output as long
as it is of types: real/complex matrices, polynomial, Boolean, integer, string, tlist, rational and
cell. Here is an example.

-->A = rand(5, 5);


-->str = prettyprint(A)

You can see the tex (given as .txt) and pdf files I created by copying and pasting the above code. If
you want to write this on a Scilab graphic window, type

-->xstring(0.2, 0.2, str)

Listas.enumeracion
------------------
Si se tiene una lista con "enumerate" y se quiere colocar una sublista (en ingls "nested") y que
tenga numeracin no continuada con la anterior:

* Cargar el paquete "easylist"


* la sublista debe estar con \begin{easylist} y \end{easylist}
* cada item de la sublista comienza con (Alt+May+s) en vez de \item

mayores detalles ver easylist-doc.pdf

Tablas color
------------
http://tex.stackexchange.com/questions/94799/how-do-i-color-table-columns-and-rows

\usepackage{xcolor,colortbl}

\newcommand{\mc}[2]{\multicolumn{#1}{c}{#2}}
\definecolor{Gray}{gray}{0.85}
\definecolor{LightCyan}{rgb}{0.88,1,1}

\newcolumntype{a}{>{\columncolor{Gray}}c}
\newcolumntype{b}{>{\columncolor{white}}c}

\begin{document}

\begin{table}
\begin{tabular}{l | a | b | a | b}
\hline
\rowcolor{LightCyan}
\mc{1}{} & \mc{1}{x} & \mc{1}{y} & \mc{1}{w} & \mc{1}{z} \\
\hline
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 24 de 43

variable 1 & a & b & c & d \\


variable 2 & a & b & c & d \\ \hline
\end{tabular}
\end{table}

\end{document}

Archivos postscript
-------------------

los archivos terminados .ps son postscript, algunas aplicaciones como XFOIL, guardan las imagenes en
archivos .ps que contienen varias paginas, cada una
con la imagen guardada.

Se convierte en un problema retirar una imagen en particular.

El procedimiento que me sirvio fue el siguiente

Instalar psutils desde el gestor de instalaciones.

La siguiente pagina contiene un manual de estas utilidades:


http://knackered.org/angus/psutils/

Entre una de las aplicaciones se encuentra psselect


que permite seleccionar paginas de un archivo .ps

psselect -p1 archivo.ps 01.ps

retira la pagina 1 del archivo.ps y la guarda en el archivo 01.ps

Pero esta imagen carece de boundary box, o algo parecido, por lo que
hay que convertirla a .eps

ps2eps 01.ps

(http://www.ipv6.tm.uka.de/~bless/ps2eps)
y aparece el archivo 01.eps, que tampoco tiene el boundary box, se la
convierte a .pdf

ps2pdf 01.eps

(http://www.ps2pdf.com/)
obteniendose el archivo 01.pdf que se puede manejar como una imagen y
colocar dentro del archivo .tex

Modificar captions de figuras, tablas, etc


-------------------------------------------
http://www.peteryu.ca/tutorials/publishing/latex_captions

paquete CAPTION y SUBCAPTION

Insertar pgina en landscape a mitad de texto


----------------------------------------------
(http://www.lawebdelprogramador.com/foros/TeX_Latex/688562-
Insertar_pagina_en_landscape_a_mitad_de_texto.html)

Para insertar una pagina en horizontal en latex la opcin mas comoda es incluir el paquete pdflscape,
si vamos a sacar un pdf, o el paquete lscape sino lo vamos a sacar en pdf. Una vez incluido \usepackage
{pdflscape}. introducimos
\begin{landscape} %%%%Aqui introducimos la tabla, la figura o lo que queramos poner en horizontal%%%%%
\end{landscape}.

Insertar una pagina A3 en un documento A4


-----------------------------------------
http://stackoverflow.com/questions/2812892/change-paper-size-in-the-middle-of-a-latex-document

Here is an example which uses a KOMA-Script class to insert an A3 page in the middle of the document:

\documentclass[version=last, pagesize=auto, paper=a4]{scrartcl}


Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 25 de 43

\begin{document}

\null
\clearpage

\KOMAoptions{paper=a3}
\recalctypearea

\null
\clearpage

\KOMAoptions{paper=a4}
\recalctypearea

\null

\end{document}

Integrales cerradas (simples, dobles, triples)


----------------------------------------------
http://fotonvirtual.wordpress.com/2012/09/21/integrales-multiples-y-cerradas-en-latex/

Para lograr esto, agregamos al preambulo de la siguiente linea:

\usepackage[integrals]{wasysym}

Luego, la integral doble cerrada se colocar simplemente escribiendo \oiint.

En concreto, la frmula del ejemplo se escribe con el comando

\displaystyle\oiint_{S}\vec{E}\cdot \hat{n}dS = \dfrac{q_{int}}{\epsilon_0}

Ahora, si se quisiera colocar una integral triple cerrada, entonces ser necesario agregar al preambulo

\usepackage{txfonts}

y la integral triple cerrada se introducir escribiendo \oiiint

Texto dentro de un circulo


--------------------------

En el pdf de simbolos indica que


\textcircled{\footnotesize C}
hace la letra dentro de un circulo, pero muy justa, achicando el texto
queda mejor.

Citations within a caption in Latex


-----------------------------------
http://lookherefirst.wordpress.com/2008/04/28/citations-within-a-caption-in-latex/

Citations within a caption of a table or figure can produce errors. You will need to use the
\protect statement.

\caption{The top line shows the result by Einstein et al \protect\cite{einstein}}.

LaTeX Controlando el espacio entre prrafos


Publicado el 01/07/2012 por Javier Montero
-------------------------------------------
http://elclubdelautodidacta.es/wp/2012/07/latex-controlando-el-espacio-entre-parrafos/

Objetivo: presentar la dimensin \parskip para el control del espaciado entre prrafos.
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 26 de 43

Ya sabes cmo trata \LaTeX por defecto la separacin entre prrafos: no los separa. El espaciado que
hay entre un prrafo y el siguiente es el mismo que entre dos lneas consecutivas. Para poder
distinguir dnde acaba uno y comienza otro \LaTeX indenta la primera lnea de cada prrafo.

Pero hay ms estilos a la hora de distinguir prrafos. En el artculo Cambiando el estilo de los
prrafos aprendimos la utilizacin del paquete parskip para hacer que los prrafos no se indentaran y
mantuvieran un espacio de separacin entre ellos.

Hoy voy a presentarte la magnitud \parskip (no la confundas con el paquete parskip, pese a que lleven
el mismo nombre), que sirve para configurar el espaciado extra que queremos que exista entre prrafos.

Por defecto, la distancia entre prrafos es la misma que entre lneas, es decir, \parskip vale cero.
Pero podemos cambiar su valor empleando el comando \setlength, que ya conocemos:

\setlength{\parskip}{8mm}

Si escribimos esta lnea en el prembulo, todos los prrafos del documento aparecern separados 8mm
ms la distancia normal entre lneas. Presta atencin a esto, voy a repetirlo: no es que la distancia
entre prrafos sea de 8mm, sino 8mm ms la habitual entre lneas.

Tambin puedes incluir el comando anterior en el cuerpo del documento. En este caso la separacin
nueva slo se aplicar a partir del prrafo que lo contenga. Si, en cualquier momento, quieres
regresar a la distancia por defecto, puedes recurrir a esto otro:

\setlength{\parskip}{0cm}

Observa que, aunque el valor sea cero, es necesario indicar las unidades.

Naturalmente, tambin puedes limitar el efecto del comando acotndolo en un grupo delimitado por
llaves:

{\setlength{\parskip}{8mm}.....Resto del prrafo o prrafos....}

El valor de \parskip tambin puede ser negativo, algo que en algunas circunstancias particulares puede
ser conveniente:

\setlength{\parskip}{-2mm}

A m me gusta que la distancia entre prrafos sea una lnea en blanco, es decir, que la separacin sea
dos veces el espacio normal entre lneas. En un artculo reciente expliqu que LaTeX controlaba el
interlineado a travs de la magnitud \baselineskip (que no debamos modificar sino a travs del
multiplicador \baselinestretch).

Por lo tanto, si quiero que la distancia extra entre prrafos sea la misma que el interlineado, puedo
escribir, simplemente:

\setlength{\parskip}{\baselineskip}

Tambin podemos recurrir a unidades relativas en vez de absolutas.

\setlength{\parskip}{1ex}

De este modo, la distancia extra entre prrafos ser el equivalente a la altura de la letra x, que
depende, naturalmente, del tamao de la fuente empleada.

Para finalizar, voy a hablarte de lo que en \LaTeX se conoce como longitudes de goma. Hay ocasiones en
las que podramos desear estticamente que la altura de las pginas sea siempre la misma. El problema
es que \LaTeX puede tomarse al pie de la letra, con rigurosa precisin, nuestros comandos. Si, como en
los ejemplos anteriores, indicamos la longitud exacta que queremos entre prrafos, puede que luego los
nmeros no cuadren a la hora de encajar todo en la pgina, con el resultado de que la altura de las
pginas podr variar de una a otra.

Sera interesante poder decirle a \LaTeX: quiero 1cm extra entre prrafos, pero, si lo consideras
necesario, ajusta flexiblemente esa cantidad, segn tu buen criterio, para que luego todo encaje bien
en la pgina.

Ah entra lo que se conoce como longitudes de goma, en relacin a la flexibilidad de este material.
Observa este comando flexible:

\setlength{\parskip}{1cm plus 5mm minus 4mm}

Lo que le estamos diciendo a \LaTeX es que la separacin extra ha de ser 1cm, pero, si se considera
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 27 de 43

necesario, puede crecer un poco, hasta 5mm ms, o reducirse hasta 4mm menos.

Flexibilidad, la clave del control

Sangra
-------
LaTeX genera el documento y al principio de cada parrafo guara un espacio que se conoce como sangra.
Mi jefe no es amigo de este estilo (yo tampoco la verdad). Para quitar tal sagnra, debe escribirse:

\begin{document}

\setlength{\parindent}{0pt}

\end{document}

-------------------------------
a simple way to create a footnote with a star symbol could be like this:

add to the preambule:

\newcommand{\footstar}[1]{$^*$ \footnotetext{$^*$#1}}

and whenever you want to add a footnote with a star in your document, you just have to use:

\footstar{whatever your footnote with star is!!}

This worked for me, and it is specially usefull when you want to add footnote inside of a table and
you don't want to have a number in your footnote.

Cmo usar en LaTeX varios idiomas


---------------------------------
http://minisconlatex.blogspot.com.ar/2011_03_01_archive.html

A continuacin mostrar cmo trabajar en LaTeX en varios idiomas. Nuestro archivo .tex ser similar a
lo siguiente, donde se han cargado los idiomas "spanish" y "USenglish".

\documentclass[a4paper,openright,12pt]{report}
\usepackage[spanish,USenglish]{babel} % espanol, ingles
\usepackage[latin1]{inputenc} % acentos sin codigo

\begin{document}

\end{document}

Cuando se cargan ms de un idioma, LaTex trabaja con el ltimo paquete. Para ir cambiando el idioma
utilizado a lo largo del documento, se utiliza el comando \selectlanguage{spanish}.

\selectlanguage{spanish}

Primero en espaol. Tenemos que minimizar los costes (\ref{fun:min_esp}).

\begin{equation} \label{fun:min_esp}
\min_{u} J = \sum_{i} y(i) \cdot 1.5
\end{equation}

\selectlanguage{USenglish}

Next, in English. Expenses should be minimized (\ref{fun:min_eng}).

\begin{equation} \label{fun:min_eng}
\min_{u} J = \sum_{i} y(i) \cdot 1.5
\end{equation}

Ntese que LaTeX pone automticamente "min" con acento o sin acento, y la separacin de decimales con
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 28 de 43

coma o punto, dependiendo de si se trabaja en espaol o ingls.

Si se quiere cambiar el lenguaje de un environment, es + prctico

\begin{otherlanguage}{english}
\begin{abstract}

Abstract Traducir el resumen al idioma ingls.

% \begin{keywords}
Key Words: (escribir en ingls las cinco palabras claves)
% \end{keywords}

\end{abstract}
\end{otherlanguage}

Mysterious TeX Errors


---------------------
(http://www.tug.org/errors.html )

You have to specify \maketitle after \begin{document}.


LaTeX error: Bad math environment delimiter

This can be caused by forgetting a closing brace.


Too many }

This can be caused by forgetting the \ on \begin, even though the document has the right number of
{ and }.
Missing $ inserted from \:

In LaTeX, \: is a math mode operator which inserts a ``medium'' space. So constructs like this:

\LaTeX\: % missing $ error

result in the mysterious Missing $ inserted error. It's advisable to get in the habit of using {}
after abbreviations to minimize problems like this, as in:

\LaTeX{}: % ok

Missing number, treated as zero

If [...] follows \\, even with intervening whitespace and newlines, it will be taken as an optional
argument, and thus expected to start with a number. (Even if amsmath is loaded, apparently, in
contrast to the The LaTeX Companion.) For example, a math alignment like this causes the error:

a^2 & a^3 \\


[b^2] & ...

One remedy is to insert {} before the left bracket.


Misplaced \noalign

Using tabular, this can be caused by an \hline without a preceding \\. Similarly, using booktabs, this
is the result of leaving out the \\ in the line before \bottomrule.
Section headings one character in output

Perhaps you left off the braces after \section. It should be used like this:

\section{The section title}

\pdfendlink ended up in different nesting level than \pdfstartlink

This happens when hyperref is used under pdftex and a citation splits across a page boundary. To fix
it, note the page number of the error and specify the draft option to hyperref so you get an output
PDF. Then you can see the citation in question and rewrite to fix it. (Thanks to James Bednar's
posting on the pdftex list about this.)
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 29 de 43

Matemticas en latex
--------------------
sitios con muchos ejemplos de frmulas
http://rinconmatematico.com/instructivolatex/formulas.htm
http://es.wikipedia.org/wiki/Ayuda:Usando_TeX#Subrayado.2C_sobrerrayado

Apndices
---------
The separate numbering of appendices is also supported by LaTeX. The \appendix macro can be used to
indicate that following sections or chapters are to be numbered as appendices.

In the report or book classes this gives:

\appendix
\chapter{First Appendix}

For the article class use:

\appendix
\section{First Appendix}

Only use the \appendix macro once for all appendices.

Cambiar "cuadro" por "tabla" en caption de tablas


-------------------------------------------------
(5/11/2012) http://www.lawebdelprogramador.com/foros/TeX_Latex/581751-cambiar_cuadros_por_tablas.html

en las nuevas versiones del paquete spanish basta incluir (en el preambulo)

\usepackage[spanish, es-tabla]{babel}

otra, es colocar luego de \begin{document} no en el prembulo.


\renewcommand{\listtablename}{ndice de tablas}
\renewcommand{\tablename}{Tabla}

Acronyms in LaTeX
-----------------
(http://staff.science.uva.nl/~polko/HOWTO/LATEX/acronym.html)

Especially in scientific literature many acronyms pop up. To deal with them in a consistent way, the
acronym package has been created. This package will write out the acronym the first time it is used
and write it as an acronym for the rest of the article. A short introduction follows, with a link to
the full manual at the bottom.

Introduction
Loading the package
To load the package, add \usepackage{acronym} after the documentclass and before \begin{document}.
Defining the acronyms
You can define acronyms with \acrodef{label}[acronym]{written out form}, for example \acrodef{etacar}[$
\eta$ Car]{Eta Carinae}, with the restriction that the label should be simple ASCII. If label and
acronym are the same, just use \acronym{SN}{supernova}.
Using the acronyms
The standard command to use an acronym is \ac{label}. The first time you use this, the acronym will be
written in full with the acronym in parentheses: supernova (SN). At later times it will just print the
acronym: SN.
Other commands

\acresetall
resets all acronyms to not used. Useful after the abstract to redefine all acronyms in the
introduction.
\acf{label}
written out form with acronym in parentheses, irrespective of previous use
\acs{label}
acronym form, irrespective of previous use
\acl{label}
written out form without following acronym
\acp{label}
plural form of acronym by adding an s. \acfp. \acsp, \aclp work as well.
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 30 de 43

Adaptacin de LaTeX al espaol


-------------------------------
(http://aristarco.dnsalias.org/node/9)
Submitted by aristarco on Sat, 2006-07-08 15:18.

Una de las cosas que el usuario de habla hispana se encuentra con LaTeX es que genera algunas cosas en
ingls, tales como "table of contents" o "chapter". En "The Not So Short Introduction to LaTeX" no se
dice nada de cmo cambiar esos ttulos generados automticamente. Y qu pasa con las tildes o las
ees?

No hay problema. Uno puede escribir el documento LaTeX usando esos caracteres, aunque hay que incluir
lo siguiente tras \documentclass:

\usepackage[latin1]{inputenc}

Para cambiar los ttulos de captulos, secciones, ndices, etc. se usan los siguientes comandos (puede
que no hagan falta todos), que deben colocarse tras \begin{document}:

\newcommand\listfigurename{Lista de Figuras}
\newcommand\listtablename{Lista de Tablas}
\newcommand\bibname{Bibliografa}
\newcommand\indexname{Indice alfabtico}
\newcommand\figurename{Figura}
\newcommand\tablename{Tabla}
\newcommand\partname{Parte}
\newcommand\chaptername{Captulo}
\newcommand\appendixname{Apndice}
\newcommand\abstractname{Resumen}
\newcommand\glossname{Glosario}

Todos estos comandos se han incluido en la plantilla presentada en el siguiente apartado.

Otra importante adaptacin del entorno LaTeX al castellano consiste en configurar ste para que
aplique los patrones de guionado (hyphenation) propios del espaol a la hora de partir palabras en
distintas lneas. En MiKTeX esto se consigue fcilmente gracias a la herramienta MiKTeX Options:

Seleccionar la pestaa Languages


Seleccionar el idioma "spanish" para documentos en espaol, "english" para documentos en ingls,
etc., deseleccionando todas las dems opciones. Slo debe quedar una activa. Si lo que se desea es
evitar en lo posible la ruptura de palabras, seleccionar "nohyphenation" en la lista de idiomas.
Seleccionar la pestaa General
Pulsar botn Update Now en la seccin Format files. A consecuencia de esto, MiKTeX puede indicar
que no puede crear algunos ficheros de formato, esto es normal,
ya que la instalacin estndar de MiKTeX no es la completa.
Por ltimo, pulsar Aceptar y la ventana de MiKTeX se cierra. La prxima vez que se ejecute LaTeX
se usar el patrn de silabeo seleccionado, sin necesidad de aadir nada al cdigo LaTeX.

LaTeX: Incluir varias imgenes en una figura (package subfig)


-------------------------------------------------------------
(http://plagatux.es/2009/04/latex-incluir-varias-imagenes-en-una-figura-latex/)

Seguramente, aquellos que ya hayis trabajado con recordaris la primera vez que os enfrentasteis al
problema de insertar una imagen. La primera vez que tienes que hacerlo (insertar la imagen no
pensis mal guarretes ) se os pasa de todo por la cabeza: vaya coazo tener que hacer esto siempre
que quiera insertar una imagen, con Word se hace todo ms fcil, a partir de ahora el latex solo lo
ver en los colchones y en los trajes que me pongo los sbados por la noche en fin esas cosas. Pero
al cabo de un tiempo os acostumbris y vis las ventajas de insertar todas las imgenes con sus
etiquetas y ttulos. Sin embargo hay ocasiones en las que tenemos que hacer algo ms complejo con esto
de la insercin de imgenes, y es que en cierto tipo de documentos nos interesa incluir subimgenes
dentro de una imagen o figura. A continuacin os doy las claves para llevar esta tarea a cabo.

Cmo deca, a veces nos interesa tener varias imgenes dentro de una figura, cada una con una letra
asignada. Por ejemplo, tenemos la figura 7 de nuestro captulo 4 y queremos que existan las imgenes
4.7.a, 4.7.b, 4.7.b y 4.7.d. Esto con se puede llevar a cabo de una forma bastante sencilla. Primero
vamos a ver una imagen con el resultado que queremos obtener:

Para conseguir este resultado tenemos que tener varias cosas en cuenta:

Incluir el paquete subfig (\usepackage{subfig})


Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 31 de 43

Hacer uso del entorno figure (\begin{figure} . \end{figure})


Incluir cada imagen dentro de un subfloat
Etiquetar cada subfigura con \label
Etiquetar la figura entera con \label
Poner el texto al menos en la figura entera con \caption
Os dejo aqu el cdigo utilizado para obtener la imagen de arriba. Est documentado para que no
tengis ningn tipo de problema, pero en caso de que lo hubiese no dudis en comentar.

\begin{figure}[ht!]
\centering
%%----primera subfigura----
\subfloat[]{
\label{fig:museo:a} %% Etiqueta para la primera subfigura
\includegraphics[width=0.42\textwidth]{./imagenes/museo1.jpeg}}
\hspace{0.1\linewidth}
%%----segunda subfigura----
\subfloat[]{
\label{fig:museo:b} %% Etiqueta para la segunda subfigura
\includegraphics[width=0.42\textwidth]{./imagenes/museo2.jpeg}}\\[20pt]
%%----tercera subfigura----
\subfloat[]{
\label{fig:museo:c} %% Etiqueta para la tercera subfigura
\includegraphics[width=0.42\textwidth]{./imagenes/museo3.jpeg}}
\hspace{0.1\linewidth}
%%----cuarta subfigura----
\subfloat[]{
\label{fig:museo:d} %% Etiqueta para la cuarta subfigura
\includegraphics[width=0.42\textwidth]{./imagenes/museo4.jpeg}}
\caption{Algunos ejemplos de clusteres del museo. El tema del clster de la esquina superior
izquierda es claramente de figuritas femeninas, el de la esquina superior derecha contiene una
variedad de imgenes de caballos y el de abajo a la izquierda muestra una coleccin de cermicas. En
el de abajo a la derecha se muestra una variedad de imgenes mezcladas con siete imgenes de frutas}
\label{fig:museo} %% Etiqueta para la figura entera
\end{figure}

The LaTeX boxedminipage package


-------------------------------
(http://www.mackichan.com/index.html?techtalk/468.htm~mainFrame)

Version: 3.x, 4.x, 5.x - Scientific WorkPlace & Scientific Word

The package creates a LaTeX minipage environment surrounded by rules, like this:

You can control the width of the environment. Additionally, you can use the standard TeX commands
\fboxrule and \fboxsep to determine the thickness of the rules and the distance between the rules and
the inside edge of the box, respectively.

No package options are defined for the package. Instead, you enter the package commands in
encapsulated TeX fields. The package is installed in TCITeX/TeX/LaTeX/contrib/misc.

How to use the boxedminipage environment


Add the boxedminipage package to your document.
Place the insertion point where you want the boxed environment to begin.
Enter an encapsulated TeX field and type \begin{boxedminipage}{x} where x is the desired width of the
minipage.
The command for first example above is \begin{boxedminipage}{1.75in}. The commands for the second are
\setlength{\fboxrule}{4pt}
\setlength{\fboxsep}{12pt}
\begin{boxedminipage}{3in}
Choose OK.
Enter the content or move the insertion point to the end of the information you want to box.
Enter an encapsulated TeX field, type \end{boxedminipage} and choose OK.

Instalacion manual de texlive (no probada 5/9/2012)


-----------------------------

I suggest you remove the version you have, and install TeX Live 2012 from the TUG DVD or web site:
https://www.tug.org/texlive/acquire.html
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 32 de 43

Installation instructions are at https://www.tug.org/texlive/acquire-netinstall.html

Incluir archivos graficos .gif


------------------------------
(http://tex.stackexchange.com/questions/7602/how-to-add-a-gif-file-to-my-latex-file)

Ejecutar desde terminal: pdflatex -shell-escape ...

\documentclass{article}
\usepackage{graphicx}
\usepackage{epstopdf}

\epstopdfDeclareGraphicsRule{.gif}{png}{.png}{%
convert gif:#1 png:\OutputFile
}
\AppendGraphicsExtensions{.gif}

\begin{document}

\includegraphics{demo.eps}\qquad
\includegraphics{knuth-tex.gif}

\end{document}

Buscar documentos latex


-----------------------

en la consola escribir

texdoc -l <nombre-archivo-a-buscar>

Links para latex


----------------
http://www.giss.nasa.gov/tools/latex/
http://www.fceia.unr.edu.ar/lcc/cdrom/Instalaciones/LaTex/latex.html
http://copa.uniandes.edu.co/software/latex/manual.html
http://www.math.harvard.edu/texman/
http://www.math.harvard.edu/texman/
http://www.cervantex.es/

Instalar paquetes latex manualmente


-----------------------------------
seguir las instrucciones, usualmente hay un archivo .dtx que se compila con latex (latex .....dtx),
sale
entre otras cosas un archivo .sty y seguir las instrucciones + abajo

Coloco el paquete (.sty) en un directorio de /usr/share/texmf-texlive/tex/latex (yo lo meto en un


directorio con el mismo nombre del paquete, pero no creo que sea necesario), luego me voy a la consola
y all hago texconfig, despus del mensaje presiono enter para continuar y en la tabla de opciones que
aparece selecciono REHASH, presiono enter nuevamente y luego EXIT.

-------------------------------------------------------------
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes

a set of Frequently Asked Questions (FAQ) for English-speaking


users of TeX.

Rotando texto y otros objetos (LaTeX/Packages/Rotating)


-------------------------------------------------------
(http://en.wikibooks.org/wiki/LaTeX/Packages/Rotating)

The package rotating gives you the possibility to rotate any object of an arbitrary angle. Once you
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 33 de 43

have loaded it with the standard command in the preamble:

\usepackage{rotating}

you can use three new environments:

\begin{sideways}

it will rotate the whole argument by 90 degrees counterclockwise. Moreover:

\begin{turn}{30}

it will turn the argument of 30 degrees. You can give any angle as an argument, whether it is positive
or negative. It will leave the necessary space to avoid any overlapping of text.

\begin{rotate}{30}

like turn, but it will not add any extra space.

If you want to make a float sideways so that the caption is also rotated, you can use

\begin{sidewaysfigure}

or

\begin{sidewaystable}

Note, though, they will be placed on a separate page.

If you would like to rotate a tikz-picture you could use sideways+minipage.

\begin{figure}[htbp]
\begin{sideways}
\begin{minipage}{17.5cm}
\input{../path/to/picture}
\end{minipage}
\end{sideways}
\centering
\caption[Caption]{Caption.}
\label{pic:picture}
\end{figure}

Options

The rotating package takes the following options

counterclockwise/anticlockwise - in single sided documents turn sidewaysfigures/sidewaystables


counterclockwise
clockwise - default - in single sided documents turn sidewaysfigures/sidewaystables clockwise
figuresright - in two sided documents all sidewaysfigures/sidewaystables are same orientation
(left of figure, table now bottom of page). This is the style preferred by the Chicago Manual of Style
(broadside)
figuresleft - in two sided documents all sidewaysfigures/sidewaystables are same orientation (left
of figure, table now at top of page)
(default) - in two sided documents sidewaysfigures/sidewaystables are oriented depending on page
number (takes two passes)

Display gotchas

NOTE: Many DVI viewers do not support rotating of text and tables. The text will be displayed
normally. You must convert your DVI file to a PDF document and view it in a PDF viewer to see the
rotation in effect. Take care however that printing from those PDF files may rotate the respective
page again in the same direction under certain circumstances. This behaviour can be influenced by the
settings of your dvi2pdf converter, look at your manual for further information.

This is included in the Ubuntu 'texlive-latex-recommended' package.

Como colocar direcciones de mail o url en \caption de figures o tablas


----------------------------------------------------------------------
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 34 de 43

Se carga el paquete "url", pero al tenerse espacios o signos como % en


la direccin de mail o url puede dar error. Otro problema se presenta
al intentar colocar el url o mail en un \caption.

Esto se soluciona haciendo un defined-url, aca va un ejemplo:

\urldef{\myself}\url{myself%node@gateway.net}

otra forma

\urldef{\myself}\url|myself%node@gateway.net|

Ahora se coloca en el \caption la llamada "\myself" en lugar de


"\url{myself%node@gateway.net}"
puesto que el defined-url es robusto

(fuente url.pdf manual del package url)

How to install LaTeX Style Files (.sty) on Ubuntu, using TeTeX or Tex Live
(http://blog.irrepupavel.com/2007/02/installing-latex-style-files-sty-on.html)
------------------------------------------------

One thing that makes LaTeX so powerful is the enourmous amount of extensions available. Some
extensions, usually with the .sty filename extension, do not come with an installation tutorial. I
consider that they do not come with a tutorial because it is assumed it is an easy task. Another
reason for having no installation instructions might be because it is platform dependent (i.e.,
different installation directories).

The directory for installing LaTeX files, on Ubuntu, depends on the distribution you are using. If you
are using TeTeX, it is:

/usr/share/texmf-tetex/tex/latex

If you are using TeX Live, it is:

/usr/share/texmf-texlive/tex/latex

To install a style file you have to create a directory for it and copy the contents there. Next you
have to run the program mktexlsr as root.

This is an example on how to install the prooftree extension, using the TeTeX distribution:

create a directory named prooftree on /usr/share/texmf-tetex/tex/latex


copy the file prooftree.sty and the file prooftree.tex to the directory /usr/share/texmf-tetex/tex/
latex/prooftree
run sudo mktexlsr

17/07/2012 ANDUVO OK!!!!!

Problemas con objetos flotates


------------------------------
(http://ltx.blogspot.com.ar/2003/09/controlando-las-figuras-flotantes.html)

El problema que te reporta LaTeX no se debe a que tengas demasiados graficos, sino demasiados
"floats". Un "float" es normalmente un grafico, aunque puede ser una tabla u otra cosa, que LaTeX no
vuelca inmediatamente "a papel", sino que lo mantiene en espera de encontrar un buen lugar para el.
Normalmente ese buen lugar suele estar en la pagina siguiente, o un par de ellas despues, y en el
momento que "la suelta" deja de ocuparle memoria.

No obstante, a veces LaTeX decide que el mejor sitio para un float es al final del documento (o
capitulo, en caso de libros o reports). Una vez que toma esa decisision, todos los floats que sigan a
ese tambien los va "acumulando" para soltarlos juntos al final. Es en este caso cuando se puede
encontrar con "demasiados floats sin procesar".

La razon por la que decide llevar un float al final es porque es demasiado grande para quedar bien en
una pagina junto con mas texto. Asi que el culpable de tus penas sera probablemente el primer grafico
"grande" que uses.
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 35 de 43

La solucion puede ser simplemente reducir el tamao de ese grafico, o mas elegantemente forzar a latex
a que lo vuelque en la siguiente pagina en lugar de llevarlo al final. Para hacer esto segundo, usa el
truco:

\afterpage{\clearpage}

que debes poner justo despues de la figura grande que te da problemas. Para que ese comando funcione
necesitas el paquete afterpage.

Otra forma es usando el package float:

para poner las imagenes donde te de la gana, te hace falta el paquete float \usepackage{float}, y en
vez de utilitar \begin{figure}[h] tienes que utilizar \begin{figure}[H].
Que no se te pase, H mayuscula y no h minuscula.

Wrapping text around figures


----------------------------
(http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions)

Although not normally the case in academic writing, an author may prefer that some floats do not break
the flow of text, but instead allow text to wrap around it. (Obviously, this effect only looks decent
when the figure in question is significantly narrower than the text width.)

A word of warning: Wrapping figures in LaTex will require a lot of manual adjustment of your document.
There are several packages available for the task, but none of them work perfectly. Before you make
the choice of including figures with text wrapping in your document, make sure you have considered all
the options. For example, you could use a layout with two columns for your documents and have no text-
wrapping at all.

Anyway, we will look at the package wrapfig. (Note: wrapfig may not come with the default installation
of LaTeX; you might need to install additional packages manually.)

To use wrapfig, you must first add this to the preamble:

\usepackage{wrapfig}

This then gives you access to:

\begin{wrapfigure}[lineheight]{alignment}{width}

Alignment can normally be either l for left, or r for right. Lowercase l or r forces the figure to
start precisely where specified (and may cause it to run over page breaks), while capital L or R
allows the figure to float. If you defined your document as twosided, the alignment can also be i for
inside or o for outside, as well as I or O. The width is, of course, the width of the figure. An
example:

\begin{wrapfigure}{r}{0.5\textwidth}
\begin{center}
\includegraphics[width=0.48\textwidth]{gull}
\end{center}
\caption{A gull}
\end{wrapfigure}

Latex example wrapfig.png

Note that we have specified a size for both the wrapfigure environment and the image we have included.
We did it in terms of the text width: it is always better to use relative sizes in LaTeX, let LaTeX do
the work for you! The "wrap" is slightly bigger than the picture, so the compiler will not return any
strange warning and you will have a small white frame between the image and the surrounding text. You
can change it to get a better result, but if you don't keep the image smaller than the "wrap", you
will see the image over the text.

The wrapfig package can also be used with user-defined floats with float package. See below in the
section on custom floats.

W R A P F I G . S T Y ver 3.6 (Jan 31, 2003)


%
% Copyright (C) 1991-2003 by Donald Arseneau <asnd@triumf.ca>
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 36 de 43

% This software is released under the terms of the LaTeX Project


% public license.
%
% Environments "wrapfigure" and "wraptable" place a figure or table
% at the side of the page and wrap text around it.
%
% \begin{wrapfigure}[12]{r}[34pt]{5cm} <figure> \end{wrapfigure}
% -- - ---- ---
% [number of narrow lines] {placement} [overhang] {width of figure}
%
% Placement is one of r, l, i, o, R, L, I, O, for right, left,
% inside, outside, (here / FLOAT).
% The figure sticks into the margin by `overhang', if given, or by the
% length \wrapoverhang, which is normally zero.
% The number of wrapped text lines is normally calculated from the height
% of the figure, but may be specified manually ("12" above).
%
% Environments similar to "wrapfigure" and "wraptable" may be easily added,
% or invoked by "\begin{wrapfloat}{float_name}"
%
% More detailed instructions are given below, following the definitions.
% Please direct any problem reports to asnd@triumf.ca

Controlando las figuras flotantes


---------------------------------

Cuando se introduce material dentro de un entorno figure o table, se est dando a LaTeX carta blanca
para que la coloque donde mejor quede, de acuerdo con sus gustos estticos. Estos gustos dependen de
ciertas variables que puedes modificar. Algunas se modifican mediante el comando \renewcommand,
mientras que otras son contadores y deben cambiarse con el comando \setcounter.

A continuacin va un ejemplo de cmo modificar todas estas variables. Los valores que se espeficican
son los que LaTeX usa por defecto, de modo que en este ejemplo particular no estamos modificando nada:

Fraccin de la pgina ocupada por los flotantes. Los siguientes parmetros controlan la cantidad
de espacio vertical que puede ocupar un flotante, o el texto de una pgina. En todos los casos se mide
en tanto por 1, es decir, dividiendo la altura del flotante entre la altura de la zona de pgina
impresa (\textheight).
\renewcommand{\bottomfraction}{.3} Mximo tamao que puede ocupar un flotante situado en
posicin "bottom" (parte inferior de la hoja). Por defecto, las figuras que ocupen ms del 30%, se
dejarn para la hoja siguiente.
\renewcommand{\topfraction}{.7} Mximo tamao que puede ocupar un flotante situado en posicin
"top" (en lo alto de la hoja). Por defecto, figuras que ocupen ms del 70% de la zona de texto, se
dejaran para una pgina aparte, compuesta nicamente de figuras sin texto (lo que se llama una
floating page)
\renewcommand{\textfraction}{.2} Mnimo tamao que ha de tener la zona ocupada por el texto en
una pgina en que haya flotantes. Si, debido a que coinciden varios flotantes en la pgina, la
cantidad de texto bajara por debajo del 20% del alto de la pgina, LaTeX decidir mover un flotante a
otro lugar para poder meter ms texto en dicha pgina. No se recomienda bajar este valor por debajo
de .15, pues el texto puede hacerse difcil de leer. Por otro lado es evidente que \topfraction+
\textfraction debe ser menor que 1, y lo mismo para \bottomfraction+\textfraction. Violar estos
requisitos causar problemas al algoritmo de colocacin de flotantes.
\renewcommand{\floatpagefraction}{.5} Mnimo tamao que deben ocupar los flotantes en una
floating page. Una pgina as se compone slo de entornos flotantes (figuras y tablas), sin texto
entre ellas. Por defecto, al menos el 50% de este tipo de pginas debe estar cubierto por flotantes,
quedando el resto en blanco. Si la figura fuese ms pequea, se metera en una pgina normal, con ms
texto debajo (o encima).
\renewcommand{\dbltopfraction}{.7} Lo mismo que \topfraction pero para documentos a doble
columna.
\renewcommand{\dblfloatpagefraction}{.5} Lo mismo que \dblpagefraction pero para documentos a
doble columna.
Contadores. Los siguientes contadores limitan el mximo nmero de flotantes que pueden aparecer en
una pgina, incluso si son muy pequeos y por tanto ocupan una fraccin de pgina permitida por los
parmetros anteriores.
\setcounter{topnumber}{2} Mximo nmero de flotantes que pueden aparecer en posicin
"top" (parte superior).
\setcounter{bottomnumber}{1} Mximo nmero de flotantes que pueden aparecer en posicin
"bottom" (parte inferior).
\setcounter{totalnumber}{3} Mximo nmero de flotantes que pueden aparecer en total en
cualquier pgina.
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 37 de 43

\setcounter{dbltopnumber}{2} Lo mismo que topnumber, pero para documentos a doble columna.

Blog sobre latex


----------------

texblog.org muchos datos y consultas

Conversion de cvs a tablas


--------------------------
If you want to use Excel table in LaTeX document you can:

retype it in LaTeX syntax --> not recommended, especially if a table can change
save as CSV and use csv2latex (http://brouits.free.fr/csv2latex/)
use excel2latex addon for Excel --> this is a very handy solution
open Excel file in some other spreadsheet that has the ability to save as LaTeX file, e.g.,
Gnumeric
a related soultion is offered by Spreadsheet2latex

Subrayado y tachado de palabras


-------------------------------
Por defecto, LaTeX carece de subrayado (quien lo quisiera?), pero si alguna vez hace falta, existe el
paquete ulem. Ojo, porque ulem cambia el efecto de \emph{} y hace que el texto vaya subrayado en vez
de en itlica. Para evitar esto, hay que poner \normalem despus de incluirlo. Entonces, podemos
subrayar con \uline{texto}, si queremos una raya ondulada, \uwave{texto}. Ya de paso, con este mismo
paquete, podemos tachar con \sout{texto}.

Fuente: http://barrapunto.com/journal.pl?op=display&uid=13088&id=11295

Cmo interrumpir una lista numerada con un comentario y continuar despus con la numeracin correcta?
---------------------------------------------------------------------
Existen dos formas de hacerlo:

a) Por algn motivo seguramente hayis tenido que iniciar una enumeracin en LaTex mediante el comando
\begin{enumerate}, habis salido de ella, y habis vuelto a comenzar otra enumeracin, pero el
problema es que la enumeracin vuelve a comenzar desde 1, cuando lo que realmente querais hacer era
continuar con la enumeracin anterior.
La solucin ms fcil es modificar el contador actual, el cul se encontrar a 0, y establecerlo en el
ltimo nmero que se qued. As, si el ltimo \item fue el 4, habra que establecer el contador a 4.
Para ello se usa la sentencia \setcounter{numi}{valor}, siendo "numi" la enumeracin del primer nivel
de la jerarqua, y "valor" el contador.

http://ahorcandoeltiempo.blogspot.com.ar/2006/12/iniciando-contador-de-enumerate-en.html

b) Entre las mdwtools hay un paquete llamado mdwlist que permite hacer eso:

\begin{enumerate}
\item ...
\item ...
\suspend{enumerate}
Texto...
\resume{enumerate}
\item ...
\item ...
\end{enumerate}

Disponible en CTAN:macros/latex/contrib/supported/mdwtools/

Las mdwtools es un grupo de packages realizados por Mark Wooding, disponibles en texlive-latex-
recommended
mdwlist.sty -- Various list related environments. There's a more
versatile `description' environment, and some stuff for
making `compacted' lists (with no extra space between
items).
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 38 de 43

http://www.aq.upm.es/Departamentos/Fisica/agmartin/webpublico/latex/FAQ-CervanTeX/FAQ-CervanTeX-8.html

Renombrar "Cuadro" por "Tabla"


--------------------------------

Para cambiar la etiqueta "Cuadro" por "Tabla" en los entornos correspondientes a las tablas se debe
escribir:

\renewcommand{\listtablename}{Indice de tablas}
\renewcommand{\tablename}{Tabla}

O bien editar en el archivo spanish.ldf ubicado en \ruta_de_miktex\tex\generic\Babel las respectivas


instrucciones.

Lists: Enumerate, itemize, description and how to change them


-------------------------------------------------------------

Latex distinguishes between three different enumeration/itemization environments. Each of them provide
four levels, which means you can have nested lists of up to four levels.

Enumerate:

\begin{enumerate}
\item ...
\end{enumerate}

The enumerate-environment is used to create numbered lists.


If you like to change the appearance of the enumerator, the simplest way to change is to use the
enumerate-package, giving you the possibility to optionally choose an enumerator.

\usepackage{enumerate} % Permite hacer enumeraciones con letras


...
\begin{enumerate}[I]%for capital roman numbers.
\item
\end{enumerate}

\begin{enumerate}[(a)]%for small alpha-characters within brackets.


\item
\end{enumerate}

Itemize:

\begin{itemize}
\item ...
\end{itemize}

Itemization is probably the mostly used list in Latex. It also provides four levels. The bullets can
be changed for each level using the following command:

\renewcommand{\labelitemi}{$\bullet$}
\renewcommand{\labelitemii}{$\cdot$}
\renewcommand{\labelitemiii}{$\diamond$}
\renewcommand{\labelitemiv}{$\ast$}

Amongst the more commonly used ones are $\bullet$ (\bullet), $\cdot$ (\cdot), $\diamond$ (\diamond), $-
$ (-), $\ast$ (\ast) and $\circ$ (\circ).

Description:

\begin{description}
\item[] ...
\end{description}

The description list might be the least known. It comes in very handy if you need to explain notations
or terms. Its neither numbered nor bulleted.

Example:

\begin{description}
\item[Biology] Study of life.
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 39 de 43

\item[Physics] Science of matter and its motion.


\item[Psychology] Scientific study of mental processes and behaviour.
\end{description}

And in a PDF it would look like this:


Example of a description list.

Example of a description list.

Note:

The space between different items can be controlled with the \itemsep command (can only be added just
after begin):

\begin{itemize}\itemsep2pt
\item
\end{itemize}

Letras griegas en negrita


-------------------------

Bold Greek letters are available using boldsymbol in the amsmath package.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
Let $\boldsymbol\alpha$ be a vector. Call it $\boldsymbol\beta$.
\end{document}

Insertar dibujos tikz y escalarlos a la pagina


-----------------------------------------------

Write the command to insert your figure in TeX file.


Command scalebox change your scale in postscript file, but you may not see scaled figure in dvi file.
eg.

\begin{figure}[h]
\centerline{
\scalebox{0.8}{
\input{foo.pstex_t}
}
}
\caption{This is an example}
\label{fig-eg}
\end{figure}

It is not true that \scalebox{0.5} of the graphics package scales a graph to 0.8 times of the original
size. It scales it simply by this factor, as Ian Thompson already said in his answer.

Note that their is also \resizebox{<width>}{<height>}{<content>} which allows you to scale the image
to a given size. This can be more useful for adjusting bigger graphics or pictures: \resizebox
{\textwidth}{!}{<content>} scales the content directly to the size of the main text. The ! for the
height states that it should scale with the width. See my answer to Quickest way to include graphics
for more explanation about scale vs. direct width/height.

See the graphics/x manual for the other commands like \rotatebox. Note that if you want to resize
images you can use the optional arguments of \includegraphics
[height=<height>,width=<width>,angle=<angle>,keepaspectratio]{<filename>}.

For other things like diagrams drawn using TeX commands (pgf/tikz, pstricks, etc.) there is the
adjustbox package which gives you \adjustbox
{height=<height>,width=<width>,angle=<angle>,keepaspectratio}{<TeX content>} or the similar and very
new gincltex which allows you to include .tex files like images using \includegraphics.

Scaling figures
---------------
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 40 de 43

Scaling example, with \resizebox:

\begin{figure}[ht]
\centerline{\resizebox{1.00\linewidth}{!}{\input{fig0b.pstex_t}}}
\caption{A switched-capacitor DAC}
\label{f0}
\end{figure}

Como pegar un grfico de openoffice a inkscape o a latex?


----------------------------------------------------------
Hice un grfico de barras en el openoffice calc (es como el excel), ahora es grfico lo quiero pegar
en inkscape y desagrupar sus elementos para poder editarlo. Pero no logro ni siquiera copiarlo, pongo
copiar y pegar y no me sale nada en la hoja del ikscape. Alguien me puede decir como copiarlo y luego
desagrupar sus elemento spara lograr editarlo?

Lo que puedes hacer es copiar el grfico a OpenOffice Draw y de ah lo exportas a un formato vectorial
que pueda usar Inkscape (PDF y SVG sirven bien para eso). Los pasos son:

Copia el grfico al portapapeles (Editar - Copiar) en Calc. Crea un nuevo archivo de dibujo de
OpenOffice Draw (Archivo - Nuevo - Dibujo). Pga el contenido del portapapeles (Editar - Pegar).
Aparecer la grfica. Exporta el dibujo en formato PDF o formato SVG (Archivo - Exportar, selecciona
el nombre del archivo y grbalo. Cualquiera de los dos formatos (PDF y SVG) sirve para editar en
Inkscape como grficos de vectores, pero prueba ambos porque el resultado no es exactamente el mismo.
Abre Inkscape. Abre el archivo SVG o PDF que quieres modificar (Archivo - Abrir, selecciona el
archivo). Si es un PDF te preguntar algunos detalles, pero los valores predeterminados suelen servir.
Aparecer tu grfica en Inkscape. Seleccinala y desagrpala (Objeto - Desagrupar); hazlo varias veces
seguidas porque los elementos suelen estar agrupados de manera anidada. A veces las lneas de los ejes
o de tendencia se ven muy tnues; ajusta el grosor de las lneas y deben verse mejor.

Colocar archivos eps realizados en gnuplot y compilar con pdflatex


------------------------------------------------------------------

Cargar el siguiente paquete despus de graphic{s,x}, e.g.:


\usepackage[pdftex]{graphicx}
\usepackage{epstopdf} % Ejecutando pdflatex -shell-escape <archivo>.tex
% crea un archivo pdf convirtiendo los archivos
% graficos eps en pdf

Dentro del archivo latex crear un entorno gnuplot como este x ejemplo:

\begin{gnuplot}
set term postscript portrait enhanced
set size 1,0.2
set yrange [0:0.2]
set output 'imagenes/perfil-esqueleto.eps'
set xlabel 'x/C'
set ylabel 'y/C'
plot 'imagenes/perfil-esqueleto.dat' u 1:2 w l lw 4 notitle
\end{gnuplot}

Ojo con la terminal!.

Compilar el archivo .tex con

pdflatex -shell-escape <archivo latex>.tex

Se crea un archivo <archivo latex>.gnuplot con los comandos para crear los archivos .eps

Luego correr gnuplot:

gnuplot '<archivo latex>.gnuplot'

Verificar que se hayan creado los archivos .eps en el directorio donde los indicamos.

Finalmente compilamos dos (2) veces el archivo .tex


Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 41 de 43

pdflatex -shell-escape <archivo latex>.tex

Tambin se puede crear aparte con gnuplot, en este caso, setear la terminal de esta forma:

gnuplot> set terminal postscript eps enhanced

Guardar el archivo hecho en gnuplot con extension .eps

En el archivo latex colocar:

\begin{figure}[!h]
\centering
\IfFileExists{imagenes/tp-03-3-1-2.eps}{\includegraphics[angle=0,width=\textwidth]{imagenes/
tp-03-3-1-2.eps}}{}
\caption{Funci\'on respuesta en frecuencia}
\label{fig:tp.3.1.2.funcion.respuesta.frecuencia}
\end{figure}

Y compilar con la siguiente sentencia:

pdflatex -shell-escape 2011.dsm.tp.03.tex

Compilar x lo menos 2 (dos) veces!

4 ways to framed displayed formulas in LaTeX


--------------------------------------------

Using \fbox and \parbox


-----------------------
The formula will be framed. Must declare the width of the frame.

\fbox
{
\parbox{5cm}
{
[
\oint\limits_C V\,d\tau =
\oint\limits_Sigma\nabla\times V\,d\sigma
]
}
}

Using fbox and minipage


-----------------------
The formula will be framed. Must declare the width of the frame.

\fbox
{
\begin{minipage}[position]{5cm}
[
\oint\limits_C V\,d\tau =
\oint\limits_Sigma\nabla\times V\,d\sigma
]
\end{minipage}
}

Using equation environment and fbox


-----------------------------------
The formula will be centred, framed and numbered.

begin{equation}
\fbox
{
$ \displaystyle
\oint\limits_C V\,d\tau =
\oint\limits_Sigma\nabla\times V\,d\sigma
$
}
end{equation}
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 42 de 43

Using displaymath enviroment and fbox


-------------------------------------
The formula will be centred, framed and unnumbered.

begin{displaymath}
fbox
{
$ \displaystyle
\oint\limits_C V\,d\tau =
\oint\limits_Sigma\nabla\times V\,d\sigma
$
}
end{displaymath}

Manually markup changes of text, such as additions, deletions, or replacements in LaTeX


----------------------------------------------------------------------------------------

In LaTeX there is a package that allows user to manually markup changes of text, such as additions,
deletions, or replacements. The changes will be shown in different colour. Deleted text will be
crossed out. The package is called Manual change markup. It is a free package under the LaTeX
Project Public License. If you install LateX from MiKTeX or TeX Live, most probabily, you already have
this package installed.

The identifier to this package is changes. Therefore, in order to use it, make the declaration to
the use of this package in the preamble, after the \documentclass{}. For example,

\documentclass{article}

\usepackage{changes}
Examples of usage:

\added{new text} for addition.


\deleted{old text} for deletion.
\replaced{new text}{old text} for replacement.
In order to deliver the final version of the document, add final option to the changes option.

\usepackage[final]{changes}
Manual change markup documentation on CTAN (pdf).

LaTeX example creating a lecture note


---------------------------------------
By Rizauddin on April 15, 2008
This LaTeX example will create an automatic exercises numbering as well as the problems in each
exercise. It is useful for creating lecture notes.

Example

\documentclass[a4paper,12pt]{book}

\newcounter{exercisenum}[section]
\renewcommand{theexercisenum}{\arabic{exercisenum}}
\newenvironment{\exercise}
\stepcounter{exercisenum}

\vspace{1pc}\par\noindent\textbf{Exercise \thesection.\theexercisenum}\par

\newcounter{problemnum}[exercisenum]
\renewcommand{theproblemnum}{\arabic{problemnum}}
\newcommand{\problem}
{
\stepcounter{problemnum}
\theproblemnum.
}

\newcounter{secondproblemnum}[problemnum]
\renewcommand{thesecondproblemnum}{alph{secondproblemnum}}
\newcommand{secondproblem}
{
\stepcounter{secondproblemnum}
\thesecondproblemnum)
Archivo: /home/jgarcia/Dropbox/latex/trucos.latex.txt Pgina 43 de 43

\begin{document}

\chapter{Introduction}

\section{Function}

\begin{exercise}

\begin{tabular}{lll}
\multicolumn{3}{l}{Solve for $x$.} \
problem $x + 3 = 4$ &amp; problem $x + 3 = 4$ &amp; problem $x + 3 = 4$ \
\multicolumn{3}{l}{
\problem \secondproblem $x + 11 = 0$
\secondproblem $x + 11 = 0$
\secondproblem $x + 11 = 0$
} \
\problem $x + 3 = 4$ &amp; problem $x + 3 = 4$ &amp; problem $x + 3 = 4$ \
\problem $x + 3 = 4$ &amp; problem $x + 3 = 4$ &amp; problem $x + 3 = 4$ \
\end{tabular}

\end{exercise}

\begin{exercise}

\problem
Cras egestas rhoncus mi. Donec sed orci rhoncus risus consequat
posuere. Maecenas ut lorem at neque imperdiet varius. Mauris imperdiet
arcu a eros. Proin elementum elementum nibh.

\problem Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In eget magna.

\end{exercise}

\end{document}

También podría gustarte