Documentos de Académico
Documentos de Profesional
Documentos de Cultura
txt Pgina 1 de 43
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}
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.
\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{CR}{Continuum Removal}
CR: Continuum Removal.
\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.
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
When doing so, you need to remove the main title by placing \renewcommand{\nomname}{} in the preamble.
\documentclass{article}
\usepackage{nomencl}
\makenomenclature
\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--------------
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
Go to the website
http://sagemath.org/download.html
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
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}
Y se crea el archivo.png
TikZ to non-PDF
---------------
http://tex.stackexchange.com/questions/13349/tikz-to-non-pdf
\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}.
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.
se arregla cargando
\usepackage{array}
\usepackage{tabularx}
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
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.
\sum_limits_{i=1}^n i^2
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.
tambien bajar
Pstoedit with its plot-svg back-end compiled in, or,
Pstoedit and Skconvert, or,
Pdf2svg
python-lxml
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)
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.
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 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}
\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
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.
\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} }
\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
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
\usepackage[list=off]{caption}
\captionsetup{singlelinecheck=off}
\caption{Cualquier cosa
{\footnotesize \begin{multicols}{3}
\begin{enumerate}
\item Primero
\item Segundo
\end{enumerate}
\end{multicols}
}
}
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}
\begin{enumerate}
\item Manzanas.
\item Pltanos.
\item Fresas.
\end{enumerate}
\begin{enumerate}[resume]
\item Limones.
\item Naranjas.
\item Pomelos.
\end{enumerate}
\end{document}
\documentclass[a4paper,openright,12pt]{report}
\usepackage[spanish]{babel}
\usepackage[latin1]{inputenc}
\usepackage{enumerate} % enumerados
\begin{document}
\begin{enumerate}[(A)]
\item Manzanas.
\item Pltanos.
\item Fresas.
\setcounter{nx}{\value{enumi}} % le damos al contador el valor de la enumeracin.
\end{enumerate}
\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.
\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.
\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.
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.
en una terminal
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.
\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}
picture is
\fbox{\includegraphics[width=3cm]{\jobname-tmp.pdf}}
\end{document}
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")
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.
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:
Este post ha sido elaborado en colaboracin con nuestro seguidor D. Alberto Rodrguez, que recibe
nuestro agradecimiento.
Procedimiento
Ahora cerramos emacs y si volvemos a abrir con l algn .tex, veremos que funciona como desebamos.
! 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
-----
\usepackage{etex}
just after the \documentclass line. In case 2, correct the definition.
\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
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
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.
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:
\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):
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.
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.
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
Now we can hide/unhide columns by using the newly defined column type H.
\begin{tabular}{lcrH}
...
\end{tabular}
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:
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}
\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:
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.
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:
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}$}
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.
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:
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
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):
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):
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>
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.
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
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:
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
\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.
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
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}.
Here is an example which uses a KOMA-Script class to insert an A3 page in the middle of the document:
\begin{document}
\null
\clearpage
\KOMAoptions{paper=a3}
\recalctypearea
\null
\clearpage
\KOMAoptions{paper=a4}
\recalctypearea
\null
\end{document}
\usepackage[integrals]{wasysym}
Ahora, si se quisiera colocar una integral triple cerrada, entonces ser necesario agregar al preambulo
\usepackage{txfonts}
Citations within a caption of a table or figure can produce errors. You will need to use the
\protect statement.
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:
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}
\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:
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.
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:
\newcommand{\footstar}[1]{$^*$ \footnotetext{$^*$#1}}
and whenever you want to add a footnote with a star in your document, you just have to use:
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.
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}
\begin{equation} \label{fun:min_esp}
\min_{u} J = \sum_{i} y(i) \cdot 1.5
\end{equation}
\selectlanguage{USenglish}
\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
\begin{otherlanguage}{english}
\begin{abstract}
% \begin{keywords}
Key Words: (escribir en ingls las cinco palabras claves)
% \end{keywords}
\end{abstract}
\end{otherlanguage}
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:
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
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:
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:
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.
\appendix
\chapter{First Appendix}
\appendix
\section{First Appendix}
en las nuevas versiones del paquete spanish basta incluir (en el preambulo)
\usepackage[spanish, es-tabla]{babel}
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
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}
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:
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:
\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 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.
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
\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}
en la consola escribir
texdoc -l <nombre-archivo-a-buscar>
-------------------------------------------------------------
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes
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
\usepackage{rotating}
\begin{sideways}
\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}
If you want to make a float sideways so that the caption is also rotated, you can use
\begin{sidewaysfigure}
or
\begin{sidewaystable}
\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
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.
\urldef{\myself}\url{myself%node@gateway.net}
otra forma
\urldef{\myself}\url|myself%node@gateway.net|
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
/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:
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.
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.
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.)
\usepackage{wrapfig}
\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}
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.
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
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
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
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}
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}
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
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}
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}
\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
\begin{figure}[ht]
\centerline{\resizebox{1.00\linewidth}{!}{\input{fig0b.pstex_t}}}
\caption{A switched-capacitor DAC}
\label{f0}
\end{figure}
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.
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}
Se crea un archivo <archivo latex>.gnuplot con los comandos para crear los archivos .eps
Verificar que se hayan creado los archivos .eps en el directorio donde los indicamos.
Tambin se puede crear aparte con gnuplot, en este caso, setear la terminal de esta forma:
\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}
\fbox
{
\parbox{5cm}
{
[
\oint\limits_C V\,d\tau =
\oint\limits_Sigma\nabla\times V\,d\sigma
]
}
}
\fbox
{
\begin{minipage}[position]{5cm}
[
\oint\limits_C V\,d\tau =
\oint\limits_Sigma\nabla\times V\,d\sigma
]
\end{minipage}
}
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
begin{displaymath}
fbox
{
$ \displaystyle
\oint\limits_C V\,d\tau =
\oint\limits_Sigma\nabla\times V\,d\sigma
$
}
end{displaymath}
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:
\usepackage[final]{changes}
Manual change markup documentation on CTAN (pdf).
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$ & problem $x + 3 = 4$ & problem $x + 3 = 4$ \
\multicolumn{3}{l}{
\problem \secondproblem $x + 11 = 0$
\secondproblem $x + 11 = 0$
\secondproblem $x + 11 = 0$
} \
\problem $x + 3 = 4$ & problem $x + 3 = 4$ & problem $x + 3 = 4$ \
\problem $x + 3 = 4$ & problem $x + 3 = 4$ & 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}