Personal tools
You are here: Home log latex
Document Actions

latex

1   2008-04-11 latex doc

The Not So Short Introduction to LaTeX2. a pdf copy in /usr/local/doc/computer.

LaTeX wikibooks: http://en.wikibooks.org/wiki/LaTeX

2   Figures

2.1   2007-09-20 include eps or png

check chapter 5 of the latex book

to include eps figures, use usepackage[dvips]{color,graphicx}

to include pdf, png, jpg, gif figures, use usepackage[pdftex]{color,graphicx}. however eps figures can't be included. for png figures, the filename should have no '.' in the main filename, (i.e. test.png NOT test.df.png)

2.2   2007-10-04 turn a figure clockwise 90 degree

angle is used to specify that:

\includegraphics[angle=-90,width=1\textwidth]{figure.png}

2.3   2008-12-16 include figure with dot in the filename

For example, if you have file named fig.2008.06.25.pdf, to include it, use:

\includegraphics[type=pdf,ext=.pdf,read=.pdf]{fig.2008.06.25}

Note that there is no extension name for the file.

3   2007-10-15 long and wide tables

http://start.it.uts.edu.au/w/doc/LaTeX/tabular.html

http://www.math.upenn.edu/tex_docs/newhelpindex.html

the standard way to work with tables is to use the built-in tabular environment within the table environment.:

\begin{table}
\caption{...}
\begin{tabular}{|rrrr|rrrrrrrr|rrr|}
\hline
...
97 & PNA-4 & None & None &  &  &  &  &  &  &  &  & 97 & 38 & 3  \\
\hline
\end{tabular}
\end{table}

3.1   package supertabular and longtable are designed for long multiple-page tables.

both of them work with begin{center} ... end{center} not the begin{table}...end{table} environment, which tabular works with. The way to put caption is different too. The format of table entries is same as tabular.

supertabular modifies the table width, even for different rows in the same table. tablecaption can be put behind begin{center} too.

\usepackage{supertabular}

\begin{center}
\begin{supertabular}{|rrrr|rrrrrrrr|rrr|}
\tablecaption{ ... } \\
\hline
...
\hline
\end{supertabular}
\end{center}

longtable keeps all tables in the same width. http://www.astro.psu.edu/gradinfo/psuthesis/longtable.html

\usepackage{longtable}

\begin{center}
\begin{longtable}{|rrrr|rrrrrrrr|rrr|}
\caption{....} \\
\hline
....
\hline
\end{longtable}
\end{center}

package tabularx is designed to deal with wide tables by overlapping cells, which is not ideal. begin{tabular*}{textwidth}{|r|r|} can control width too. but it just tosses out extra cells. The format of tabularx is same as tabular.

package ltxtable is supposed to merge the benefits of both longtable and tabularx but it requires the table to be in a separate file, which is extra hassle to batch output. the syntax is LTXtable{width}{file} and the file looks like:

%% LaTeX2e file `ltx1.tex'
%% generated by the `filecontents' environment
%% from source `ltxtable' on 2006/06/21.
%%
\begin{longtable}{|cXX|}
the & head& line\endhead
the & foot& line\endfoot
a&b&b\\
\multicolumn{2}{c}{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}&c\\
a&b&b b b b b b b b b b b b b b b b b b b b b b b b b b \\
a a& b b& c c\\
a a& b b&
  c c c c c c c c c c c c c c c c c c c c c c c c c c c c c cc cc\\
a a  aaaa& b b& c ccccc\\
\end{longtable}

latex2html is a very good tool to sidestep the page limitation of dvi, ps and pdf. cuz html doesn't have the page idea. latex2html treats tabular and tabular* differently (xx* is the version with width specified. same as for supertabular, longtable, tabularx). for tabular, it generates a html table. for tabular*, it generates an image table.

the other way is to use large page size. see below.

4   2007-10-15 specify page size/dimension

one way is just for pdflatex, http://www.artofproblemsolving.com/LaTeX/AoPS_L_GuideLay.php add following after documentclass, usepackage etc.:

%\pdfpagewidth and \pdfpageheight is only good for pdflatex
\pdfpagewidth 13in
\pdfpageheight 22in

the 2nd alternative is to change page size. you have add custom packages. http://www.andy-roberts.net/misc/latex/latextutorial8.html

\documentclass[a2paper, 10pt]{article}
\usepackage[a2paper]{geometry}

5   2007-10-29 Error "Too many unprocessed floats"

according to http://www.mackichan.com/index.html?techtalk/356.htm~mainFrame, there're 3 ways. \clearpage, package float, package placeins.

The \clearpage command forces LaTeX to output any floating objects that occur in the document before the command. The \afterpage is supposed to work with \clearpage to avoid the ugly gap, but not really well.

\clearpage
\begin{figure}
\includegraphics[width=0.5\textwidth]{figures/cluster_plot_AtMSQTsnp_2.png}
\caption{cluster plot for AtMSQTsnp 2.} \label{flAtMSQTsnp2}
\end{figure}

float uses the special [H] placement for the float (different from [h]):

\usepackage{float}
...
\begin{figure}[H]
\includegraphics[width=0.5\textwidth]{figures/cluster_plot_AtMSQTsnp_2.png}
\caption{cluster plot for AtMSQTsnp 2.} \label{flAtMSQTsnp2}
\end{figure}

http://people.cs.uu.nl/piet/floats/node1.html

http://theoval.cmp.uea.ac.uk/~nlct/latex/thesis/node26.html

http://www.tex.ac.uk/cgi-bin/texfaq2html?label=tmupfl

all sorts of float packages, http://www.tex.ac.uk/cgi-bin/texfaq2html?label=floats

morefloats package; this 'simply' increases the number of floating inserts that LaTeX can handle at one time (from 18 to 36).

5.2   2007-10-30 label for a figure.

the \label{l1} has to be put behind \caption{figure title}. otherwise, the link to that figure would not display the correct figure number.

\caption{figure title} \label{l1} could be put in front of \includegraphics.... but then the caption/title appears above the actual picture, which contradicts the convention (people tend to put figure title below picture in most papers).

5.3   2007-10-30 warning ! pdfTeX warning (ext4): destination ... already used, duplicate ignored

Complete warning:

! pdfTeX warning (ext4): destination with the same identifier (name{figure.156} ) has been already used, duplicate ignored

it's a warning that could be ignored. supposedly only happen to long documents. but mine is just a latex file including another latex file which is full of figure floats. haven't figured out exactly. but people are suggesting this (http://www.rpi.edu/dept/arc/docs/latex-thesis/latextopdf.pdf)

\usepackage{ifpdf}
\ifpdf
\usepackage[pdftex, bookmarks, colorlinks, plainpages=false,pdfpagelabels,breaklinks]{hyperref}
\else
\usepackage[dvips, bookmarks, colorlinks, linkcolor=blue, urlcolor=blue, citecolor=blue, plainpages=false,pdfpagelabels,linktocpage]{hyperref}
\fi

other links: http://osdir.com/ml/tex.miktex/2005-04/msg00032.html, http://phaseportrait.blogspot.com/2006/12/hyperref-options-for-proper.html, http://www.tex.ac.uk/cgi-bin/texfaq2html?label=pdfpagelabels

6   2007-10-30 include another latex file

according to "Nor So Short Introduction to Latex" (Chapter 1, section "Big Projects") two ways. \include{filename}, \input{filename}. the former will start a new page.

7   2007-11-27 latex presentation http://www.miwie.org/presentations/presentations.html

prosper: it has evolved into ha-prosper and further into powerdot.

texpower

latex-beamer: a very serious package. Check the pdf guide in /usr/share/doc/latex-beamer/.

these two are not directly related to make presentation in latex

texlive-pictures

texlive-pstricks

9   2008-02-27 control page margin, layout, text area size

put these in the beginning of the latex document:

\addtolength{\textheight}{5.8cm}
\addtolength{\textwidth}{3.5cm}
\addtolength{\hoffset}{-2cm}  %offset from the left
\addtolength{\voffset}{-3cm}  %offset from the top
\setlength{\parindent}{0pt}   %set the paragraph indent to zero.
\setlength{\parskip}{2ex plus 0.5ex minus 0.5ex}      %increase the space between two paragraphs to 3ex.

The plus and minus parts of the length above tell TEX that it can compress and expand the inter paragraph skip by the amount specified, if this is necessary to properly fit the paragraphs onto the page.

10   2008-02-27 no figure environment in class letter

No \begin{figure}...\end{figure}. so just insert bare \includegraphics[angle=-90]{figure.png}.

« November 2009 »
Su Mo Tu We Th Fr Sa
1234567
891011121314
15161718192021
22232425262728
2930
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: