lundi 1 février 2010

[转] LNCS LaTeX style works

I’m writing a paper for a conference. It should be written with conformance to the Lecture Notes in Computer Science style. After visiting the page with information for LNCS authors) I though that it might be a sort of magic for many people.
Springer encourages authors to use LaTeX2e, provides a style file for LaTeX, documentation and samples. The samples and instructions are quite good to start writing a paper immediately if
• you know LaTeX, and
• the llncs style is installed.
Springer can’t help with the first issue. But it isn’t important.
The problem is that they don’t provide (or I haven’t found) help on installing the style. The number of people that can do it is much smaller of those who know LaTeX.
Fortunately, I’m one from that small group. Here is my way to use the style locally without putting it into the core LaTeX directories.
The style files are stored in the file llncs2e.zip. I unpacked them into the folder “~/univer/gpce05/springer/texmf/tex/latex/llncs2e“. In fact, the path before “texmf” is not important.
First of all, I decided to check the sample file llncs.dem. As dvi-file already exists, I generated pdf:
```\$ pdflatex llncs.dem
\$ pdflatex llncs.dem
```
The command was given twice to get correct links. On the first run, the database of links is created, and on the next runs the database is used.
Now goes local installation of the style. I’m not going to comment it. Consider it as magic:
```\$ export TEXMFLOCAL=~/univer/gpce05/springer/texmf
\$ texconfig rehash
\$ file ~/univer/gpce05/springer/texmf/ls-R
```
The first command specifies location of the local TeX repository. The second commands indexes the repository, and the last one just makes sure that the index is created.
To check, use the sample from the file typeinst.zip. Let me demonstrate a failure first. Open a new window and try to compile the TeX-file:
```\$ latex typeinst.tex
```
You get an error like:
```LaTeX Error: File `llncs.cls' not found.
```
The right way is to specify the location of the repository first:
```\$ export TEXMFLOCAL=~/univer/gpce05/springer/texmf
\$ latex typeinst.tex
\$ latex typeinst.tex
```
Again, I’m running LaTeX twice to get correct links.