| LaTeX for Computer Science Publications | navigate:back |
Some notes on writing computer science publications for ACM, IEEE and Elsevier in LaTeX (this is a first version - trust it and die). Comments and suggestions are welcome.
| General Remarks: Organization of the Latex File |
For the review process of conferences and journals, a review version is often requested requiring large fonts and double spacing. The final version for a conference is then eventually formatted by the author with a latex class file provided by the conference. The final version for a journal is often formatted by the journal with the review version as a starting point.
Conferences have often a page limit for the final version (e.g. five, six, but often ten pages). When writing the review version, every then and now I want to know how many "real" pages I have already written, e.g. I want to see the paper formatted for both, review and final version. For this, I have two templates, review.tex and paper.tex.
paper.tex (here with acm sig-alternate class file):
\documentclass{sig-alternate}
\begin{document}
\conferenceinfo{CASES} {September 30--October 3, 2007, Salzburg, Austria.}
\CopyrightYear{2007}
\crdata{978-1-59593-826-8/07/0009}
\title{My Paper Title}
\numberofauthors{2}
\author{%
\alignauthor Stefan Schaeckeler ...
\alignauthor Weijia Shang ...}
\maketitle
\input{abstract.tex}
\category{D.3.4}{Programming Languages}{Processors}
\category{E.4}{Coding And Information Theory}{Data Compaction and Compression}
\terms{Languages, Performance, Experimentation, Algorithms}
\keywords{Embedded systems}
\input{body.tex}
\bibliographystyle{abbrv}
\bibliography{references}
\end{document}
|
\documentclass[11pt]{article} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[T1]{fontenc} % euro quality fonts [T1] (togeth. w/ textcomp)
\usepackage{textcomp, amssymb} % additional symbols (there are more packages)
\usepackage[latin1]{inputenc} % umlaute in input file
\usepackage{setspace} % doublespacing
%\usepackage{ngerman} % newgerman: Worttrennung, Befehle für Umlaute
\usepackage{ifpdf} % if pdflatex then ... else ...
%newer versions of latex don't need pdftex and dvips argument respectively
\ifpdf
\usepackage{aeguill} % PS converted CM fonts for better acro preview
\usepackage[pdftex]{graphicx} % graphics packages
\usepackage[pdftex]{color} % color packages
\else
\usepackage[dvips]{graphicx} % graphics packages
\usepackage[dvips]{color} % color packages
\fi
\usepackage{anysize} % margin package
\marginsize{0.8in}{0.8in}{0.27in}{1.27in} % review version with 1 in margins
\begin{document}
\begin{center}\LARGE\bf My Paper Title\end{center}
\vspace{5mm}
{\bf
\input {abstract.tex}
}
\doublespacing
\input {body.tex}
\singlespacing
\bibliographystyle{abbrv}
\bibliography{references}
\end{document}
|
The actual text is in abstract.tex and body.tex and the references are in references.bib. These files are shared among review.tex and paper.tex.
abstract.tex:
\begin{abstract}
...
\end{abstract}
|
body.tex:
\section{Introduction}\label{section:introduction}
...
\section{Related Work}\label{section:relatedwork}
...
|
references.bib:
@inproceedings{schaeck200701,
...
}
|
A makefile is governing the compilation. A hash mark in line 2 or 3 is choosing between review and final version (acually, adding or removing a hash mark in line 3 is enough).
# source file - no spaces after the definition
file=review
#file=paper
# dvi output uses .eps figure files
dvi:
latex ${file}
bibtex ${file}
latex ${file}
latex ${file}
# ps output uses .eps figure files
ps: dvi
dvips ${file}.dvi -o ${file}.ps
pstops "1:(0,-1.8cm)" ${file}.ps printout.ps
|
# pdf output via pdflatex uses .pdf figure files
pdf:
pdflatex ${file}
bibtex ${file}
pdflatex ${file}
pdflatex ${file}
# count words
words: ps
ps2ascii ${file}.ps| wc
# view xdvi file
xdvi:
xdvi -keep ${file} &
# ocassional backups
backup:
zip -9y versions/version-`date +"%Y%m%d"`.zip *
# clean up (not complete)
clean:
rm *~ lablst.* printout.ps ${file}.ps ${file}.pdf\
*.dvi *.bak *.aux *.log *.toc *.out *.doc *.blg *.bbl
|
| General Remarks: latex vs pdflatex |
Conferences and for their review cycle also journals, accept pdf files and often postscript files, too. For compiling a latex file, one has the choice between plain latex (latex) and pdflatex (pdflatex).
latex: .tex -> .dvi -> .ps -> .pdf
With plain latex, a latex file can be translated with latex, then dvips and eventually pstopdf into a dvi, ps and pdf file, e.g.
$ latex paper.tex $ dvips paper.dvi -o paper.ps $ pstopdf paper.ps paper.pdf |
pdflatex: .tex -> .pdf
With pdflatex, a latex file is directly translated into a pdf file, e.g.
$ pdflatex paper.tex |
Pdflatex can include pdf features like table of contents (on the left-hand side of acrobat), clickable links and email addresses as well as clickable links from reference to tables and figures. Plain latex can't.
Graphics are included with the includegraphics command.
\begin{figure*}[!ht]
\centering
\includegraphics{figure}
\caption{figure caption}\label{figure:fig}
\end{figure*}
|
Pdflatex can only include pdf files and plain latex can only include encapsulated postscript files. If suffix .eps or .pdf is skipped in the includegraphics command, then pdflatex is searching for a pdf file with suffix .pdf and plain latex is searching for an encapsulated postscript file with the suffix .eps. Hence, by providing eps and pdf files, the latex file can be compiled with both, pdflatex and plain latex. This is the recommended.
For previewing, I prefer xdvi and use therefore plain latex. $todo: discuss inverse search with xdvi$
| General Remarks: Fonts in Figures |
All Microsoft office applications such as word and excel use the same fonts - windows' true type fonts - and it is no problem using the font of the main document for an embedded excel diagram. Only LaTeX is using its own fonts system, and graphics as well as diagrams created with other software is using different fonts. Here is how to remedy this situation.
xfig: xfig is a tool for interactive generation of figures. Although it looks simple, it is relatively powerful. By calling xfig with these options
$ xfig -specialtext -latexfonts -startlatexFont default & |
and post-processing the fig file with fig2dev, three files can be generated: the plain figure without any text as an encapsulated postscript file figure.eps and as a pdf file figure.pdf as well as a latex file figure.tex containing the actual text to be processed by latex, e.g. latex fonts are then used for the text. A makefile target:
Makefile
xfig: figure.fig
fig2dev -L pstex figure.fig figure.eps
epstopdf figure.eps
fig2dev -L pstex_t -p figure figure.fig figure.tex
|
The generated latex file, e.g. figure.tex, is including the plain figure and positioning the text over the figure. Hence it must be included not via the command includegraphcs, but it must be "inlined"
\begin{figure*}[!ht]
\centering
\input{figure.tex}
\caption{figure caption}\label{figure:fig}
\end{figure*}
|
Because the text is processed by latex, math like $x^2_3$ can be used. xfig doesn't know about the sizes of the latex fonts, and it places them slightly off. One has to redo then the fig file and change the position of the text. This is ok for figures without much text. For figures with a lot of text, a latex package like xy might be more appropriate (it should be included in most latex distributions). A local copy of the user guide is available here click.
gnuplot: gnuplot is a tool for generating plots. It can be scripted, e.g. the commands can be stored in a file like plot.gpl and run through the gnuplot program.
Makefile:
gnuplot:
gnuplot plot.gpl
epstopdf plot.eps
|
set title ""
set xlabel "time"
set ylabel "space"
set xtics 1
set format x "$%g$"
set format y ""
set size 0.65,0.85
set output "plot.eps"
set terminal epslatex
plot [0:10][0:32] "plot.data" using 1:2 title "unoptimized" with lines,
"plot.data" using 1:3 title "optimized" with lines 5
set output "plot.jpeg"
set terminal jpeg
replot
set terminal pop |
There are different terminals for generating different output formats. I create jpegs for fast previewing, and eps for inclusion in the latex file. Terminal epslatex creates not only an encapsulated postscript file (excluding text), but also a latex file containing the actual text to be processed by latex. It positions text over the figure and must be included not via the command includegraphics, but "inlined"
\begin{figure*}[!ht]
\centering
\input{plot.tex}
\caption{plot caption}\label{figure:plot}
\end{figure*}
|
When setting the size to 0.65,0.85, the plot fits one column of a two column formatted paper. $todo: doublecheck$
If converting the eps file with epstopdf to pdf, then pdflatex can be used to compile the latex file, too.
| IEEE Conference Paper |
For conference papers to be included in IEEE Xplore, fonts must be embedded. This can be achieved with the postscript version as a starting point
Makefile:
pdf: ps ps2pdf14 -dPDFSETTINGS=/prepress -dEmbedAllFonts=true printout.ps printout.pdf pdfopt printout.pdf paper.pdf rm printout.pdf |
When a paper is accepted for inclusion in IEEE Xplore, one gets an account for a tool to check the paper for pdf conformity (cavet: every then and now, IEEE changes the pdf specification).
One of the standard IEEE conference styles, latex8, doesn't provide any means of adding the copyright code (at least not that I'm aware of) and once I was required to add it a horrible hack.
IEEE conference style latex8 including makefiles and so forth for download ieeeconferencetemplate.zip. Get the documentation for latex8 from IEEE's website.
IEEE conference style IEEEtran (with conference option) including makefiles and so forth for download ieeeconferencetemplate2.zip (to come). Get the documentation for IEEEtran from IEEE's website.
| ACM Conference Paper |
ACM conference class sig-alternate including makefiles and so forth for download acmconferencetemplate.zip. Get the documentation for sig-alternate from ACM's website.
| ACM Journal Paper |
ACM has a template for review versions. When accepted, the latex source code together with eps and/or pdf figures are sent to the printer. He appears to use then a similar class file for the final version (the differences for my ACM journal paper have been minor: slightly wider margins, different front for the title, although I use the acmtable environment, the tables look slightly different, different size for figure captions, description environment looks slightly different, different font for tt markup).
ACM journal class acmtrans2m including makefiles and so forth for download acmjournaltemplate.zip (to come). Get the documentation for acmtrans2m from ACM's website.
| Elsevier Journal Paper |
Elsevier has a template for review versions. This is pretty generic and some Elsevier journals want a different formatting. When accepted, the latex source code together with the eps and/or pdf figures are sent to the printer. He is then using a proprietary - better looking - class file for the final version.
Elsevier journal class elsart including makefiles and so forth for download elsevierjournaltemplate.zip (to come). Get the documentation for elsart from Elsevier's website.
| General Hints |
General hints, tips and tricks.
review.tex:
\usepackage{lineno}
\begin{linenumbers}
\input {body.tex}
\end{linenumbers}
|
\begin{table}
...
\end{table}
|
\begin{table}
\vspace{-2mm}
...
\vspace{-2mm}
\end{table}
|
\begin{table}[!t]
\renewcommand{\arraystretch}{1.3}
...
\end{table}
|