# [HOWTO] LaTeX Quickstart Guide

## slartibartfasz

LaTex Quickstart Guide

What is LaTeX? And what is it good for?

LaTeX is a macro package for TeX, which is a programming language for typesetting text. You can think of LaTeX as a markup language to turn text into high quality documents.

Adavantages

 the author provides a logical structure, and doesnt have to deal with details of how the output looks like

 it is excellent when typesetting formulas

 it provides automatic processing of footnotes, sidenumbers, table of contents,...

 it is quite difficult to produce ugly documents

 it forces the user to think logical

Disadavantages

 it forces the user to think logical

 it is not suited for design purposes

 it is not very well suited for producing a lot of complicated tables

The main difference between custom WYSIWYG word processing software (aka Microsoft Windows) and LaTeX is the strict separation of the look of a document and its content. In LaTeX the author provides a logical structure and the look is determined by a (predefined) style.

This has several advantages and a disadvantage (well matter of taste i guess  :Wink:  ). When writing you can concentrate completely on the content and just using the default settings you will always get reasonably pretty documents. Moreover it is very easy to change the look of a finished document. The disadvantage is, that u can only see the final document after you ran it through the LaTeX processor.

The basic LaTeX file is just a text dokument (think: source code) which is run through the latex executable (think: compiler) to produce the final document.

How to Use It

For this very short guide i assume that you are using gentoo  :Smile:  and already did:

```
emerge tetex

emerge kile

```

Kile is a special LaTeX editor. You can of course use any text editor you like, but to wet your feet this is the quickest way. Before we jump right into our first document let me add a short note about productivity with whatever editor you choose: It pays to take the time to learn keyboard shortcuts for your editor/desktop. <F2><ALT-TAB><ALT-TAB> in kile on kde for example, compiles your document, lets you see the dvi file (if you opened it before in a dvi-viewer) and jumps back to kile again. This can become very fast. (thx odegard for pointing this out)

A basic LaTeX document consists of two main parts. The header (also called preamble):

```
\documentclass{report}

\usepackage{graphicx}

```

and the body:

```
\begin{document}

\author{I. M. Foo}

\title{My very first LaTeX document}

\maketitle

\tableofcontents

\chapter{Basics}

This is the first paragraph in the first chapter. The title of this chapter is \emph{Basic}.

\end{document}
```

The header is where you can tell LaTeX what type of document you want to make. Typical choices include report, article, letter and so on. In addition to that you can provide some layout options like for example '\documentclass[a4paper,11pt,oneside]{report}' which will tell LaTeX to layout your text for A4 paper size, 11pt font size and onesided. There are a lot more options to discover - read on!

Besides the documentclass you can specify some special packages in the header, much like using a library in a programming language. In our example we included the graphicx package, which provides support for adding (e)ps figures to your document. When working with pdftex you can use png or jpg but unfortunately no eps pictures with this package. This is not a big problem though, because you can convert pictures from eps to pdf with a tool called epstopdf which comes with your latex distribution. If u want to change to pdflatex entirely, you can simply add \usepacke{epstopdf} in your preamble and pdftex will create the missing files for you.

The body holds the content of your document. In the example some important features can be seen. Every command starts with a backslash. The scope of most commands is everything that is inside the immediatly following curly brackets. In our example - Basics is the argument to the \title command.

We can also see two commands without arguments \tableofcontents and \maketitle. The latter takes the information of \author and \title and prints it neatly on the first page of your document. The size, font, spacing, page setup, ... for the title page is completely automatic. The former includes - surprise - the table of contents.

To see the output of this example put the code into kile, save the document and press <F2>. This will run your code through the latex executable and compile a dvi file, which u can view by klicking on the bear icon.

You will notice, that your document already has three pages. A neat title page, containing the author, title and date, the table of contents page and the page where the first chapter begins. Everything neatly typeset.

One thing is missing tough: the table of contents is empty - this is because LaTeX needs to read the whole document in sequence to know on which page a chapter begins. If you press <F2> a second time and look at the dvi file again, you will see that the first chapter with correct page and chapter numbering appears.

What you have just done is the basic LaTex working cycle: write code, compile, debug...da capo - i bet most of you guys know that better than i do  :Wink: 

Instead of walking you through all the basics - and being as reduntant as possible, i want to point you to some documents you should read. As you already have tetex installed as we agreed above, just take a look at the following documents on your harddisk:

```
/usr/share/texmf/doc/latex/general/essential.dvi

/usr/share/texmf/doc/latex/general/l2kurz.dvi
```

The first is for english, the second for german users. For answers to some common questions point your browser to /usr/share/texmf/doc/help/faq/index.html.

Tips, Tricks & Useful Packages

The following assumes that you have read the short LaTeX instructions i pointed out above.

Common LaTeX Editors

The two most often used editors in LaTeX are emacs and vim. Though i'm not comfortable with emacs i know that a special extension for LaTeX exists. Search for emacs on CTAN or take a look at the AUCTex homepage. Likewise there are some vim enhacements for LaTeX which can be found on the homepage of the vim-latex project and on http://www.vim.org.

Other common editors are Lyx (closest ti WYSIWYG) and Kile. For sake of simplicity i assume that you use Kile for this Quickstart guide.

Packages & tetex

Unfortunately a lot of packages that come with tetex are outdated (thx to aja who pointed this out to me). To update any packages, got to CTAN download the tarball and unpack it to /usr/share/texmf/source/<packagename>. Change to the directory and

```
latex <packagename>.ins

latex <packagename>.drv

latex <packagename>.drv
```

Then remove everything in /usr/share/texmf/tex/latex/<packagename> and /usr/share/texmf/doc/latex/<packagename> and copy all .sty and .cfg files to the former, all .pdf, .dvi and .tex files to the latter directory. now run

```
mktexlsr
```

 and the new package is installed. This procedure works for most packages, difference are covered in the README that comes with the package.

Typesetting Beautiful Tables

It is a matter of taste, how tables should be typeset, but in my humble opinion, tables using the booktabs package look best. This small package comes with three commands and some advice.

The advice is never use vertical rules in tables. The commands are \toprule, \midrule and \bottomrule. and are used like this:

```
\begin{tabular}{@{}ccc@{}} \toprule

row one & second column & third column \\ \midrule

row two & second column & third column \\ \bottomrule

\end{tabular}
```

Other packages that enhance table printing are tabularx and longtable

Writing Units

Everyone who uses a lot of units in his text will find the SIunits package useful. It provides SI conform typesetting like '\watt\per\meter\usk\kelvin' in normal text and math mode with proper spaces between figure and unit.

Making a Nomenclature

When you are using a lot of math and symbols, the nomencl package provides a convenient way to produce a nomenclature (glossary) automatically. Consider the following:

```
\begin{equation}

v = \frac{s}{t}

\end{equation}

\nomencl{v}{velocity [\meter\per\second]}

\nomencl{s}{space [\meter]}

\nomencl{t}{time [\second]}

% more text

% where u want the nomenclature to appear:

\printglossary
```

This will produce a neat nomenclature. If you want to you can also refer to the equation and page of the equation by adding \refeq and \refeqpage at the approriate places. Attention: This example needs some more steps to work, please refer to the package documentation, or tell me if i should provide more details here.

Making a Bibliography

For doing this, i recommend the natbib package. Basically you save your bibliography information in a special .bib file and use the following commands in your LaTeX file:

```
As stated by \citet{todd}, the velocity of .... \citep{foo}

%more text

% the style to print your bibliography

\bibliographystyle{plainnat}

% the file with your bibliogrphy items

\bibliography{../bibliography}
```

If you now run your document through LaTeX, then BibTeX (<F11> in Kile) and then LaTeX again to get all references right it will produce the following output:

```
As stated by Ben Todd [1], the velocity of .... [2]
```

And your document will have a properly sorted bibliography section pretty printed according to your bibliographystyle.

Including Hyperlinks

To include hyperlinks, most people use the hyperref package. To see it in action just put

```
\usepackage{hyperref}
```

 in the preamble (header) of your document. The package will automatically insert hyperlinks for the table of contents, footnotes, citations and references to figures and equations. 

To include hyperlinks in a pdf, add the following option to the hyperref call:

```
\usepackage[dvipdfm]{hyperref}
```

For details on the many options of this package see the package documentation.

Producing PDF Files

There are several ways of producing PDF out of dvi files. The one i'd like to cover here involves dvipdfm (see above). As soon as you have your dvi file just run

```
dvipdfm <yourfile>
```

 to get it in the pdf format.

Another way to achieve this, is using pdflatex - a special flavor of LaTeX for producing pdf (thx clockwise and hans-peter). It can be invoked directly in Kyle be choosing the appropriate compile command. If you include figures in your document you have to provide them in the pdf format in this case. If you want dvi and pdf output with pdflatex you can include all pictures without extension in your sourcecode and the compiler will chose the eps or pdf version of the picture respectively. 

Which one of those methods you chose is up to you. If you cant get something to work, try the other method.

A Different Style

When you are tired of the standard style and are looking for something with a fresher look, you could try to use the koma-script package. Its original purpose was to introduce some european, (in order not to say german  :Wink:  ) stilistic differences, especially the use of the DIN A4 paper format. Meanwhile it evolved into a full featured alternative style that provides a different way of using the printable paper area. For a quick look, just change \documentclass{report} to \documentclass{scrreprt}. For more options look at /usr/share/texmf/doc/latex/koma-script. A lot of english speaking people use the memoir class for the same reasons. This package is not included in the standard tetex installation, but as all other packages it can be downloaded from CTAN.

Different Languages

LaTeX has good support for writing in different languages. For using non ascii characters directly from your keybord (german umlauts for example) just add \usepackage[<encoding>]{inputenc} to your document header. For informations regarding the possible encodings take a look at /usr/share/texmf/doc/latex/base/inputenc.dvi. The package babel provides support for dozens of languages from afrikaans to welsh. If u want support for languages like arabic or chinese you might want to look at the omega package. As i dont have experience with this, i wont dig deeper here.

Typesetting Sourcecode

Although there are some more ways to do it, i'd like to encourage you to take a look at the listings package. It is the most feature rich of the possible packets and 100% LaTeX native. Other possibilities inlcude lgrind and a2ps, which can be found on CTAN and portage respectively.

For a quick way to test the listings packet you can try:

```
\usepackage{listings}

\begin{document}

% text

\lstinputlisting[language=perl,breaklines]{../scripts/example.pl}
```

Which will typeset the perl script example.pl in your document. There are a lot of programming languages available and the layout is completely customizable. As always refer to the package documentation for details.

Changing The Font

If you want to change the font you have to be careful not to break the layout of your document. It is important that you use the same font with its apporpiate styles (sans serif, caps, italic) thoroughout your whole document. You could of course specify the font seperatly as covered in the essential guides, but a better way is do this via packages. You could try the following:

```
\usepackage{cmbright}

%\usepackage{concrete}

%\usepackage{pandora}

%\usepackage{palatino}

%\usepackage{ae}

%\usepackage{pxfonts}

%\usepackage{txfonts}

```

Uncomment one of these packages a time, recompile your document and look at the output. Make sure that you also look at the fonts that are used in special environments like equations. Attention: not all of these fonts can be converted into pdf properly. Some appear jagged on the screen although thy print perfectly - you may need to change the font if this problem arises.

Another thing to be aware of when using these fonts is the corresponding math font. AFAIK only cmbright provides the matching font for mathematical environments.

Alternatives include:

```

\usepackage{mathptmx} % Times as body and math font

\usepackage{mathpazo} % Palatino as body font, Euler as math font

```

Listing Figures And Tables

This is as easy as it can get:

```
\listoffigures

\listoftables
```

 Thats all  :Smile:  . One thing you might want to do is to include this in the table of contents. There is a special package to do this: tocbibind. It will put your bibliography, list of figures and list of tables into the table of contents. Although this is quite convenient there is probably a better way to do this. Better, because it enables you to add anything you want into the table of contents. Using an example from above  you could do the following:

```
\usepackage{nomencl}

\makeglossary

% your document

\cleardoublepage

\addcontentsline{toc}{chapter}{Index of Symbols}

\stepcounter{chapter}

\printglossary
```

This will add a line to your table of contents \addcontentsline after processing all floating objects and setting the pagecounter to the actual page (\cleardoublepage). Then the chapter counter is increased by one and finally the glossary is printed.

Running LaTeX Repeatedly

If you use indexes, glossaries, bibliographies and the like, it is often necessary to run LaTeX not only once, but several times (max. 4 usually). To do this automatically there is a nice little perl script available at this side. latexmk watches all files that are involved with your document and reads the messages to find out how often your document needs to be processed. This becomes especially handy in the last stages of editing your document, because latexmk has a mode where it watches your document, runs latex repeatedly until all references are resolved and lets you watch the resulting file in a viewer of your choice - all by simply saving your document. People who use advanced editors like vim and emacs for example will appreceate this, because the editing cycle becomes very fast this way and the hands never have to leave the keyboard. (Just imagine this on a xinerama - two monitor system  :Very Happy:  ) (thx to Hans-Peter for this tip)

Usefull Links

A lot of people have written very clever things about, in and with LaTeX - the text above was written, trying to be as un-reduntant as possible, but the foundation of it can be found when following the links presented here. (Standing on the shoulders of giants  :Wink:  )

 General LaTeX:

http://www.dante.de [german]

http://www.tex.ac.uk

http://www.micropress-inc.com/linux/

 Newsgroups and the power of google:

http://groups.google.at/groups?hl=de&lr=&ie=UTF-8&group=de.comp.text.tex [german]

http://groups.google.at/groups?hl=de&lr=&ie=UTF-8&group=comp.text.tex

 Things not to do in LaTeX:

ftp://ftp.dante.de/tex-archive/info/german/l2tabu/l2tabu.pdf [pdf,german]

 Editors

http://vim-latex.sourceforge.net/

http://freshmeat.net/projects/auctex/

http://preview-latex.sourceforge.net

http://x-symbol.sourceforge.net

http://kile.sourceforge.net/

http://www.lyx.org/

http://www.texmacs.org/

Thats all - happy TeXing  :Cool: 

Although there are quite some more tips on LaTeX i decided that for a mere posting this is enough. If you want, i can continue this (additional tips, example files, ...) on another basis - gentoo docs perhaps, but i wont do so unless there is need for it.

If you feel that something is missing, or you spot an error, please tell me.

----------

## smokeslikeapoet

I've been coached to learn latex for a long time from a mentor of mine. He doesn't have time to teach me himself and this is the guide I've been looking for a while. I can't wait to see the rest of it. Thanks. BTW, are there any GTK editors you would suggest for editing latex docs?

----------

## slartibartfasz

unfortunately i dont know any good GTK editors, but a lot of people like to use vim - there are a lot of macros specifically for latex... i guess emacs provides a latex toolbox too...

----------

## AgenT

Thank you for the guide. Will be useful when I need to use LaTeX for the first time.

One quick question. Seeing as LaTeX is a markup language, does that make it language (and character set) unbiased? If not, is there support for many languages that do not use the English alphabet? For example, would I have to do anything extra to have my text file written in Russian or Greek be "marked up" by LaTeX?

----------

## Elm0

An excellent beginners guide, thankyou.

I currently use Kile, which is a Latex editor in the same vane as Quanta is for HTML under KDE. Eases you into things a bit without hiding the underlying code your creating, and then when you truly understand it provides a nice enviroment to work in.

----------

## slartibartfasz

@AgenT:

forgot that - thx for reminding me - i will add a section about non ascii encoding...

----------

## pilla

just FYI, I've posted a link to this thread in our local TeX User Group list, and there is already a good feedback about it.

Keep it going on.

----------

## Disquiet

You can also convert it to html (latex2html)

Also why is making the user think logical a disadvantage? I'd have thought that was a good thing  :Smile: ?

----------

## slartibartfasz

 *Bloody Bastard wrote:*   

> just FYI, I've posted a link to this thread in our local TeX User Group list, and there is already a good feedback about it.
> 
> Keep it going on.

 

so much publicity...  :Shocked: 

 *Disquiet wrote:*   

> You can also convert it to html (latex2html)
> 
> Also why is making the user think logical a disadvantage? I'd have thought that was a good thing ?

 

1) yes - and to some others too. see:

http://www.ctan.org/tex-archive/support/

http://www.ctan.org/tex-archive/help/wp-conv/

2) as everything in life, also logic and creativity need to be balanced - u can carry everything too far - just think of star trek and pointed ears  :Wink: 

----------

## cleber

I used to edit TeX in emacs, but using tools like kile or mictex is sure a help.

What other options for TeX editting you guys use?

----------

## odegard

I just did my master thesis in latex using pico (but somehow using pico is not 1337, bah). Anyway, I had two xterms open, one big editing the file and one small running latex thesis.tex and the xdvi thesis.dvi.

My rythm would be like this:

edit text

ctrl-o (save)

alt-tab (change window)

arrow-up+arrow-up+enter (compile, two commands back in history)

arrow-up+arrow-up+enter (xdvi, two commands back in history)

alt-f4 (to close xdvi)

alt-tab

edit text

etc. etc. etc.

This is really fast when you get the hang of it.

In the beginning I used kwrite with bracket-autonotification or what it is called but found out I didn't need it.

Anyway. I'd like to add something about tables. I use a hacked deluxetable style-file and these tables really look good and it is easy to do heavy customizations. If you're unfamiliar about deluxetable, I can write a short introduction and find a link to the required file.

Lastly, there is a sentence in the section about producing pdf files that belong to the section about hyperlinks.

If I may come with a suggestion: I think you should mention something about different documentclasses and perhaps be more specific about how the document is structured as in 1st you have dicument-type, then the preamble (commands and stuff) and the then document-part. You've mentioned this already but I think it's not clear. Still, it is a great guide, great job!!

Odegard

----------

## slartibartfasz

 *odegard wrote:*   

> I just did my master thesis in latex using pico (but somehow using pico is not 1337, bah). Anyway, I had two xterms open, one big editing the file and one small running latex thesis.tex and the xdvi thesis.dvi.
> 
> My rythm would be like this:
> 
> edit text
> ...

 

i do it almost exactly the same way - will add a note about this...

 *Quote:*   

> 
> 
> Anyway. I'd like to add something about tables. I use a hacked deluxetable style-file and these tables really look good and it is easy to do heavy customizations. If you're unfamiliar about deluxetable, I can write a short introduction and find a link to the required file.
> 
> 

 

go on - i never used deluxtables - if u write something i'll include it above...

 *Quote:*   

> 
> 
> Lastly, there is a sentence in the section about producing pdf files that belong to the section about hyperlinks.
> 
> 

 

changed it - thx

 *Quote:*   

> 
> 
> If I may come with a suggestion: I think you should mention something about different documentclasses and perhaps be more specific about how the document is structured as in 1st you have dicument-type, then the preamble (commands and stuff) and the then document-part. You've mentioned this already but I think it's not clear. 

 

u are right - i added some more explanation there... thx

----------

## BumptiousBob

Another resource for those wanting to learn more is the "Not so short introduction to latex" which can be found at:

http://www.ctan.org/ctan/tex-archive/info/lshort/

I printed this when I first started playing with latex and haven't used anything else since.   :Wink: 

----------

## gwion

hey, thanks very much for this introduction... i inquired about pdfs and i got an introduction to a very powerful system for creating documents...   :Very Happy: 

i am not joking... many thanks for that... after a little trying it starts to become convenient so quickly... could easily be that i stick with latex for quit a while...

*thumbsup*

cheers,

gwion

----------

## slartibartfasz

 *BumptiousBob wrote:*   

> Another resource for those wanting to learn more is the "Not so short introduction to latex" which can be found at:
> 
> http://www.ctan.org/ctan/tex-archive/info/lshort/
> 
> I printed this when I first started playing with latex and haven't used anything else since.  

 

thats a nice one  :Smile:  for a reference - i just felt that it would be too much for a quickstart guide, therefore i just listed essentials.dvi and its german pendant l2kurz.dvi

 *gwion wrote:*   

> hey, thanks very much for this introduction... i inquired about pdfs and i got an introduction to a very powerful system for creating documents...
> 
> i am not joking... many thanks for that... after a little trying it starts to become convenient so quickly... could easily be that i stick with latex for quit a while...
> 
> *thumbsup* 

 

no problem - its a pleasure for me - though it feels a bit akward to write this, because a friend of mine considers me as a tex beginner...well the same guy uses the english keyboard layout on his german keybord, because he is faster in vi   :Shocked: 

----------

## Ox-

There may be more, but I know of 2 (la)tex editors in portage: texmacs and lyx.

Just loading them quickly it looks like lyx might be a little better, but I don't have any real experience with either.

----------

## clockwise

just a few extra things i've picked up...

i use pdflatex for creating pdf's. it generates them straight from the .tex source rather than going through a dvi. i often found that dvipdf conversions look hideous if you send them to someone using windows.

lyx is a a good latex editor, may even be gtk (though i stick to vim, myself.)

does anyone know a good sans-style font for latex and how i could use it? i've been putting \begin{sffamily} ... \end{sffamily} in my documents, which gives me a style i like, but doesn't affect page numbers and other odd bits.

----------

## slartibartfasz

thx ox and clockwise - i changed the appropriate sections...

clockwise i added a section about changing the font ...

----------

## arand

This is a good intro.  I wil be looking into this more as I begin to work with latex more.  

One question for people who have experience with this.  I will be inserting alot of images primarly jpeg and png.  How should I deal with this?  I know that for normal latex it will only except eps files, while latex2pdf (spelling?) will except the png or jpeg.  

I was thinking of putting all the images into one folder and running mogrify to convert all the pictures to .eps files and use them in latex. 

Thanks again for the intro.

----------

## clockwise

thanks for the font help, makes my documents so much more consistent.

a for graphics...

i put all my images as .jpg's into a subdirectory which i tend to call "img", put the name is arbitrary. one thing i've noticed though (at least for me), you can only insert .pdf's into a .pdf document and only .ps's into a .ps document. of course, if anyone knows a way around this then i would be interested.

so the code...

```

%% import package

\usepackage{graphicx}

%% optionally set the image directory

\graphicspath{{./img/}}

\begin{document}

.

.

.

%% insert the figure

\begin{figure}[ht]

  %% centre it

  \begin{center}

    %% scale if needed

    \scalebox{1}{

      %% insert the image, no extension needed

      \includegraphics{domes}

    }

    \caption{Paul Klee, ``Rote und wei\ss e Kuppeln''(\emph{Red and White Domes}), 1914}

  \end{center}

\end{figure}

.

.

.

\end{document}

```

----------

## slartibartfasz

i am not aware of a way to include jpg directly - usually i convert pictures using tools from gs and imagemagick - some special tools for converting graphics can also be found on ctan...

one thing u might try to convert jpg on the fly can be found here, but it never tested this - according to the example u can include graphics from compressed archives by making a system call - on the first look, i dont see a reason why the system call shouldnt go to convert isntead of bzip... hope that helps...

----------

## clockwise

just thinking... i exlusively use pdflatex, i have a feeling that it can handle .jpg's and latex cannot.... however, that coed definitely works for inserting .jpg's directly into .pdf files. no conversion needed.

----------

## Malice

Since this thread seems to have gained a slightly Latex evangilistic spin, I thought I should swing in, and spin it some more.  :Twisted Evil: 

I use Latex for everything including making Power Point like presentations.

Using a latex package/preprocessor combo called PPower4 - http://www-sp.iti.informatik.tu-darmstadt.de/software/ppower4/  (there is another one called TexPower that I am going to look at sometime - http://texpower.sourceforge.net/ )  I can write a lecture or whatever in Latex, and generate a whizzy PDF document with transitions and semi-animated diagrams.  PPower4 is a Java app BTW.

The fancier PDF transitions are kinda slow and clunky, so I stick to the simple ones.   Also I think you are pretty much limited to the Adobe viewer (there is a linux version), since it implements all of the PDF standard.

Also, I prefer JEdit for hacking Latex source.  Does the job nicely.

For those considering Latex - go for it.  It takes a while to get the hang of it, but you will soon be laughing at all the people bitching about how MS Word keeps reformating their documents for them and eating their figures.

Nice howto by the way.  Wish I come across something like this when I was teaching myself Latex.

----------

## slartibartfasz

thats a great tip, Malice, thx  :Very Happy: 

----------

## Malice

 *slartibartfasz wrote:*   

> thats a great tip, Malice, thx 

 

No problem.

If anyone needs a hand sorting out a Latex/PPower4 presentation then let me know (PM).  I have a Makefile that I use that has been evolving over the last couple of months, and does the job nicely.

It generates a PDF with fancy colours and diagrams for presentations, and plain black and white for printed versions (which can be slide per page, or however many slides per page you want).

PDF presentations = platform independant presentations (assuming the platform has the Acrobat reader available - which most of them do) which has to be a good thing  :Smile:  .

----------

## Malice

Also...

Anyone have a semi-decent way of spell checking a latex file??

You can use the -t arg with Aspell 

```
aspell -t -c latexfile.tex
```

to tell it to ignore the latex macros themselves, but most of my docs are full of Java source code (using the listings package) which is damn annoying to get through with Aspell.  Also a lot of the preamble gets picked on by Aspell too.

A friend of mine has a script which strips out the nasty stuff (latex macros, source code, anything that he doesn't want spell checked) and then runs Aspell on that.  The downside of his approach is that when he does find a spelling mistake, he has to manually fix it in his original un-stripped version of the document.

An approach that just occured to me as I was writing this is to put any source code (and anything else that you don't want spell-checked)  in a different latex file, and include it into your main file when needed.  That way you run Aspell on the main file and it doesn't see the source code - must start doing that.  I already have the preamble in a different file.

Anyone have any other approaches that work well?

----------

## slartibartfasz

if u use vim - try the following packages, both ignore program languages but check comments in source code - sounds like what u are looking for  :Smile:  :

http://www.vim.org/scripts/script.php?script_id=499

http://www.vim.org/scripts/script.php?script_id=195

and afaik it is possible to have 1 external file with source code and tell the listings package to include lines x-y while keeping the line numbering in tex consistent from one listing to the other...

----------

## arand

In relation to the spelling question.  I checked in kile with a simple document.  Kile seems to at least ignore stuff like usepackage however it will not ignore the argument like graphicx.

----------

## slartibartfasz

 *arand wrote:*   

> In relation to the spelling question.  I checked in kile with a simple document.  Kile seems to at least ignore stuff like usepackage however it will not ignore the argument like graphicx.

 

yeah - it has basic support for the tex syntax - but i doubt that it can take the source code parts  :Sad: 

----------

## softchill

I'm looking for the package where pdflatex is... I thought it was in tetex, but it is'nt. Can anyone guide me ?

----------

## arand

I just Emerged kile on a new system and it automagically was installed along the way.  I tried qpkg.

```
 qpkg -f /usr/bin/pdflatex 
```

However it gave no output so I am not sure what package that you need to emerge.

Maybe someone else can help.

----------

## softchill

I pretended to emerge kile, and here's the output:

```
[softchill@aria softchill]$ emerge -p kile 

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild  N   ] sys-apps/pciutils-2.1.10-r1  

[ebuild  N   ] sys-apps/usbutils-0.11-r1  

[ebuild  N   ] sys-apps/hotplug-20030501-r2  

[ebuild  N   ] net-print/cups-1.1.19-r1  

[ebuild  N   ] app-text/ghostscript-7.05.6-r3  

[ebuild  N   ] media-libs/libart_lgpl-2.3.12  

[ebuild  N   ] app-text/sgml-common-0.6.3-r3  

[ebuild  N   ] app-admin/fam-oss-2.6.9-r3  

[ebuild  N   ] dev-libs/libxslt-1.0.31  

[ebuild  N   ] kde-base/kdelibs-3.1.2-r1  

[ebuild  N   ] app-editors/kile-1.5
```

I dont think any of these would install pdflatex. And tetex is already installed.

----------

## arand

Like I said I am not sure what package is needed for pdflatex.  If you don't want to emerge all of those packages 

I would suggest that you just compile everything and see if it works.  If it doesn't then you can unmerge the apps you don't need.  If you want to cut down a little on the apps installed try setting your use varibles to include -cups so that you don't have to compile cups.

----------

## daen1543

Pdflatex is just a symlink to pdftex, which is part of the tetex package. Hope this helps.

```
[04:34:39][daen@menace:~]$ ls -l `which pdflatex`

lrwxrwxrwx    1 root     root            6 Aug 14 13:19 /usr/bin/pdflatex -> pdftex

[04:35:00][daen@menace:~]$ qpkg -f `which pdftex`

app-text/tetex *
```

----------

## don quixada

I use Jext for my LaTeX editor. It's a java-based text editor. In fact, I use it to do all of my coding. It has a plugin for MikTeX (for windows) that can be modified for Linux to generate dvi/pdf files and it has a built-in console. It's not GTK but you can at least make it _look_ like Gnome. 

As far as spelling goes, it's a bit dodgy. I copy my code into OpenOffice.org and it does the spell checking; I have gotten (g)vim (using Aspell) to do it for me too, but it was too annoying using that program as a word processor so I stopped. My brother uses emacs and it can be setup to spell-check and colourize (hehe, two different countries' spelling rules in one word) your code, but I don't like emacs either (I'm picky aren't I?). 

For use with pdflatex: As far as images go, I convert the picture to eps (using Gimp) then I convert again to PDF (using eps2pdf). Converting them to PDF makes them easy to manipulate in the LaTeX document (i.e. scaling, rotating etc.).  

As far as a random (but important) LaTeX tip goes: \usepackage{fullpage} is your friend. Unless you're writing a book, you'll want to use this as it yields correct margin sizes for reports.  Long/short: it will make your reports look oh-so-much better!

As far as touting LaTeX goes: it's great and I even did my resume in it (it looks awesome)!

I hope these tips can be of some use to you...

good luck!

dq

----------

## StinkyLou

slartibartfasz,

Thanks for an outstanding quick-start guide!  I wish I'd had something so concise when I started learning LaTeX.   :Wink: 

Malice,

 *Quote:*   

> If anyone needs a hand sorting out a Latex/PPower4 presentation then let me know (PM). I have a Makefile that I use that has been evolving over the last couple of months, and does the job nicely.

 

PPower4 looks like a great package.  Have you considered submitting an ebuild?

Cheers!

----------

## bludger

Does anyone have any information on using latex with truetype fonts, such as the standard microsoft fonts?  I would like to be able to print to pdf and have something that looks good both on paper and on the screen.

----------

## XeroByte

Thank you dude, needed a guide like that... haven't read the whole thing because I'll try it later, but bookmarked the link...

EDIt: when I run 'emerge dvipdfm' it wants to install an older package of tetex (1.x.x) tho I have installed the newer 2.x.x... Is that supposed to be or is that a mistake?

----------

## slartibartfasz

 *XeroByte wrote:*   

> when I run 'emerge dvipdfm' it wants to install an older package of tetex (1.x.x) tho I have installed the newer 2.x.x... Is that supposed to be or is that a mistake?

 

i guess so - try without downgrading tetex and if it works without proplems report on bugs.gentoo.org.

@StinkyLou:

there is an ebuild for prosper, which is quite similar to PPower4. the makefile mentioned by malice sorts tex source into a print and a screen version - if u want it, i'll see if i can find it again.

@bludger:

there is not really such a thing as microsoft truetype on latex - for changing the fonts read the section in the guide and take a look at the FAQ links. i'm pretty sure u find more about this topic than u wanted to know  :Wink: 

@all: thx   :Embarassed: 

----------

## don quixada

Another useful tip which I forgot to mention was getting a degree symbol:

```

\newcommand{\degree}{$\tt{^o}$ }

```

With this command one can type: 40\degree C and when processed, the \degree will be a little degree symbol.

I found this the easiest way of getting the symbol, it doesn't require using any outside packages etc...

dq

----------

## bmichaelsen

For all interested in vim-latex, here is a ebuilds:

http://www.breakmygentoo.net/ebuilds/vim-latex-1.5_rc1.ebuild.tar.bz2

as you might wonder, it is not yet in portage ....

https://bugs.gentoo.org/show_bug.cgi?id=30285

Greetz, Björn

----------

## don quixada

Could you tell us a little more about vim-latex? (or provide a link?) My first experience with LaTeX and vim was not too successful, but maybe I should try again.

Thx.

dq

----------

## bmichaelsen

 *Quote:*   

> Could you tell us a little more about vim-latex? (or provide a link?) My first experience with LaTeX and vim was not too successful, but maybe I should try again. 

 

http://vim-latex.sourceforge.net/

The helpfile will be installed by the ebuild and be available by typing

```
:help latex-suite
```

 in vim

----------

## slartibartfasz

 *don quixada wrote:*   

> Could you tell us a little more about vim-latex? (or provide a link?) My first experience with LaTeX and vim was not too successful, but maybe I should try again.

 

i've made very good experiences with vim-latex. its takes some time to get used to the new commands but its really convenient. especially the bracket jump and autofolding are very handy. the only thing i dont use is the 'compiler' (\ll) - i usually have 'latexmk -pvc --force' running to see the updated dvi whenever i write the buffer. btw for anyone interested, i hacked latexmk to support the nomencl package.

[EDIT] @björn - good idea with the ebuild  :Smile: 

----------

## Birnenpfluecker

thx for that guide. I'm emerging and will test it. Found no proper guide how to start until I found this one. Good work.

----------

## Birnenpfluecker

Ready with the compiling, but I have a problem. I'm a noob to linux and doesn't which program I need to read the *.dvi files....

So I can't read the manuals you posted. Sorry for the stupid question

----------

## don quixada

Install `xdvik'. (`emerge -s' is your friend.)

dq

----------

## Birnenpfluecker

thx for the fast answer

----------

## bmichaelsen

vim-latex is now in portage:

```
bash-2.05b$ emerge -s latexsuite

Searching...   

[ Results for search key : latexsuite ]

[ Applications found : 1 ]

 

*  app-vim/latexsuite [ Masked ]

      Latest version available: 1.5_rc1

      Latest version installed: 1.5_rc1

      Size of downloaded files: 184 kB

      Homepage:    http://vim-latex.sourceforge.net/

      Description: vim plugin: Latex-Suite attempts to provide a comprehensive set of tools to view, edit and compile LaTeX documents in Vim.

```

----------

## Cloney

Just to say that (for ~x86 anyway) Kile 1.6 is in arch. Hopefully this will fix the broken Latex reference file, and provide some Quick Build options that don't immediately fire up a viewer.

I'm compiling at the moment, I'll let you know how it goes. Thanks for this thread by the way - Kile is fantastic, and has really eased my relationship with LaTeX. I thought I hated it, but it turned out I just hated eMacs   :Twisted Evil: 

EDIT: Right, got it up. The editor's changed to the kate editor, embedded, which is a bit more powerful (haven't fiddled with all the options yet). The LaTeX quick-reference works (woo!), but there's still no option for a Quick Build that doesn't open a viewer. (I think I'll file a Kile feature request).

What bugs me is when you're editing page n of an m page document, and doing a quick build always starts the viewer up on page 1, so you have to scroll through. What I really want is kghostview on file-watch mode to simply be brought to the front on a quickbuild.

UPDATE: Idiot that I am, I just discovered watch mode, which does exactly what I need. Was this in 1.5.2?

Cloney

----------

## theprog

I've been using LaTeX for a while now, and discovered some solutions to various problems....

1. Ugly fonts on Windows:

By default, LaTeX uses the bitmap font Computer Modern Roman, which doesn't look bad, until it is scaled by software, such as Acrobat Reader.

Two solutions:

Use pdftex. It automatically uses scalable fonts.

Include the line \usepackage{times}. It will use the Times scalable font, thus making everything pretty.

2. Graphics Formats

Using pdftex one can include images in the pdf format, as well as png and possibly jpg. For ps files, try using ps2pdf. I've found that it works well.

However, I've got a problem of my own.

I've got a file with over 100 chapters.

LaTeX works well for the formatting in every aspect except the table of contents. The spacing between the chapter number and the title is too small, but I haven't found a way to increase it.

----------

## MrTwister

Hi,

i tried to "compile" the example you gave in your post but i always get an error.  It always says "This is TeX, Version 3.14159 (Web2C 7.3.1)

(Fatal format file error; I'm stymied)". All i did was copy & paste. And i even tried to "compile" a document example from the web and i get the same error (I do F2 in kile...and i tried "latex test.tex", but it gives me the error i mentionend above. What is wrong ?!?

----------

## slartibartfasz

 *MrTwister wrote:*   

> Hi,
> 
> i tried to "compile" the example you gave in your post but i always get an error.  It always says "This is TeX, Version 3.14159 (Web2C 7.3.1)
> 
> (Fatal format file error; I'm stymied)". All i did was copy & paste. And i even tried to "compile" a document example from the web and i get the same error (I do F2 in kile...and i tried "latex test.tex", but it gives me the error i mentionend above. What is wrong ?!?

 

your .fmt files are missing. try to create them using 'fmtutil --missing' or if that does not help 'texconfig formats'. if u have no luck with either of these commands, u will need to reinstall tex.

----------

## slartibartfasz

 *theprog wrote:*   

> I've been using LaTeX for a while now, and discovered some solutions to various problems....
> 
> 1. Ugly fonts on Windows:
> 
> By default, LaTeX uses the bitmap font Computer Modern Roman, which doesn't look bad, until it is scaled by software, such as Acrobat Reader.
> ...

 

This is a possible solution. the problem comes from font types. type1 and truetype fonts are no problem but if a font is only available in the metafont format, the pdf looks ugly because the font is printed as bitmap. sometimes it helps to produce a ps first with 'dvips -Ppdf' and then convert this to pdf.

ftp://ftp.dante.de/tex-archive/fonts/ps-type1/cm-super/

is a replacement for CM fonts which should work with pdf afaik - didnt test it though...

 *Quote:*   

> 
> 
> However, I've got a problem of my own.
> 
> I've got a file with over 100 chapters.
> ...

 

try 

```
\renewcommand{\l@subsection}{\@dottedtocline{2}{1.5em}{3.3em}}

```

the first number is the distance from the left page border, the second number is the space occupied by the chapter number. (em is a unit - the space that a 'm' needs, of course u can use another latex unit if u like)

or u can use the tocloft package to configure about a gazillion options about your table of contents. if u are using tetex u can find the documentation for the package on your harddisk:

```
/usr/share/texmf/doc/latex/styles/tocloft.dvi
```

----------

## ikokai

Oh, I love LaTeX. I am using it for all my text processing needs.

I am using it with vi + vim-latex.

It's just great. I am just typing \ll to compile and \lv to view the file. I configured it to create postscript output and preview it with gv. gv is watching the postscript file so when I recompile it gets updated in the preview too.

I am using mainly ps because of this update possibility in gv, and because gv can show me all the colors and graphics what xdvi can not.

For presentation I used to be write them with foiltex and ppower4, but now I found beamer. It is a really great package with a good manual, and it can handle ps an pdf output as well without the postprocessing nightmare with ppower4 (although you can use it with ppower4 together) search for it in google you won't regret it  :Wink:  .

Usually if somebody wants from me a word document, I just compile my latex source with latex2rtf. It can handle some math too, but with the complicated ones you can have problems (but it can generate images for the math and include it in the rtf)

----------

## carambola5

 *don quixada wrote:*   

> Another useful tip which I forgot to mention was getting a degree symbol:
> 
> ```
> 
> \newcommand{\degree}{$\tt{^o}$ }
> ...

 

Probably better to use:

```
\newcommand{\degree}{$^\circ$}
```

----------

## bubbas

Hi i've got a problem with xdvi

after having emerged tetex, now an emerge xdvik says:

These are the packages that I would merge, in order:

Calculating dependencies    ...done!

[ebuild  N    ] media-libs/t1lib-1.3.1  

[blocks B     ] app-text/tetex (from pkg app-text/xdvik-22.40y-r1)

[blocks B     ] app-text/tetex (from pkg app-text/ptex-3.1.3)

[ebuild  N    ] app-text/ptex-3.1.3  

[ebuild  N    ] app-text/xdvik-22.40y-r1  

some ideas?

cu

vale

----------

## slartibartfasz

 *bubbas wrote:*   

> Hi i've got a problem with xdvi
> 
> after having emerged tetex, now an emerge xdvik says:
> 
> These are the packages that I would merge, in order:
> ...

 

yep: might be that u have 'canna' emerged or in your useflags. if 'doc' is enabled too (also a useflag) u get this behaviour as some of the docs that come with canna can only be compiled with ptex. solution: disable the useflags or hack canna not to use them.

----------

## bubbas

hm 

i don't even know what canna is and it isn't emerged. 

My useflags:

USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm gtk gtk2 imlib

jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses nls oggvorbis

opengl pam pdflib png python qt quicktime readline sdl slang spell ssl

svga tcpd truetype X xml2 xmms xv zlib"

and manually added (make.conf): alsa

So doc isn't in there.

but thanks for your reply

cu

vale

----------

## slartibartfasz

hmm - then it is something different   :Rolling Eyes: 

try 

```
qpkg
```

 to find out the depencies - i think it is part of the 'gentoolkit'.

to be sure about the useflags u can try this:

```
root@box # USE="-doc -canna" emerge -pv <package>
```

[EDIT]

(disregard the lines above)

ok - here it is:

from /home/cvsroot/gentoo-x86/app-text/xdvik/xdvik-22.40y-r1.ebuild:

```
DEPEND=">=media-libs/t1lib-1.3

app-text/ptex

!app-text/tetex

virtual/x11

cjk? ( media-fonts/kochi-substitute )

libwww? ( >=net-libs/libwww-5.3.2-r1 )"

```

its a hard dependency of xdvik - u can probably find out why by looking at the changelog or at bugs.gentoo.org

----------

## discostu

I got my .tex file to compile with the latex command (after having to run fmutil --missing), but now xdvi doesn't seem to work? what do I have to do?

```
xdvi myfirst.dvi

kpathsea: Running mktexpk --mfmode ljfour --bdpi 600 --mag 1+120/600 --dpi 720 cmbx12

mktexpk: Mismatched mode ljfour and resolution 600; ignoring mode.

mktexpk: Running mf \mode:=ljfour; mag:=1+120/600; nonstopmode; input cmbx12

This is METAFONT, Version 2.7182 (Web2C 7.3.1)

(Fatal base file error; I'm stymied)

grep: cmbx12.log: No such file or directory

mktexpk: `mf \mode:=ljfour; mag:=1+120/600; nonstopmode; input cmbx12' failed to make cmbx12.720pk.

kpathsea: Appending font creation commands to missfont.log.

xdvi.bin: Can't find font cmbx12.720pk

xdvi.bin: Not all pixel files were found

```

 I have tetex, dvipdfm, and latex packages emerged, but there appears to be a block on xdvik package, but for some reason I still have the command "xdvi"

How can I get this working? Thanks!  :Smile: 

----------

## slartibartfasz

perhaps running mktexlsr helps - but it seems that this is an error of xdvik, i'd try to use another dvi viewer (i use kdvi). but i dont really know what the problem is - sorry   :Confused: 

[EDIT]

one thing u might want to try is to disable any special font instructions in your tex file in case u use that...

----------

## bubbas

now i have:

```
emerge unmerge tetex
```

then

```
emerge xdvik
```

should work then. tetex is emerged together with xdvik then I think.

cu

vale

----------

## slartibartfasz

 *carambola5 wrote:*   

>  *don quixada wrote:*   Another useful tip which I forgot to mention was getting a degree symbol:
> 
> ```
> 
> \newcommand{\degree}{$\tt{^o}$ }
> ...

 

i agree with carambola5 that his way is a bit better - i know two better ones still:

1)

```
\usepackage{textcomp}

... very hot 40\textcelsius

```

2)

```
\usepackage{SIunits}

... very hot \unit{40}{\degreecelsius}

```

the second method has the advantage that the space between the figure and the unit can be configured (should be \thinspace aka \,) imho. and it works inside math environments too - the character is correctly printed upright and not slanted as it usually would be in a math environment. ihmo the slanted character in math should be used vor symbold and variables only.

----------

## carambola5

Anyone know of (or capable of making) a simple "cheat sheet" for using LaTeX?  I love LaTeX, but over winter break, my skills deteriorated quickly (since I had only just begun learning it).  A 3" x 5" card chock full of info would be really great.

@slartibartfasz: your sig is wrong.  To an engineer, the glass is neither half full nor half empty, just 1.333 times too large taking into account a 1.5 sloshing safety factor.

----------

## slartibartfasz

 *carambola5 wrote:*   

> Anyone know of (or capable of making) a simple "cheat sheet" for using LaTeX?  I love LaTeX, but over winter break, my skills deteriorated quickly (since I had only just begun learning it).  A 3" x 5" card chock full of info would be really great.

 

sorry no  :Sad: 

i usually keep a collection of useful tricks and things i wan to remember after the \end{document} - sort of a template.

 *carambola5 wrote:*   

> @slartibartfasz: your sig is wrong.  To an engineer, the glass is neither half full nor half empty, just 1.333 times too large taking into account a 1.5 sloshing safety factor.

 

pah - safety is for wussies  :Wink:  - my calculations work ... well, usually

----------

## nulltype

I have a metafont <fontname>.mf file that I would like to use in a LaTeX document.  I installed it to /usr/share/texmf/fonts/source/public/<fontname>.

How do I use it in a LaTeX document?

----------

## M104

Here's a little Makefile I use in my projects that will produce many different output formats from the .ltx source file simply by changing the target.  Two smaller advantages are that you can run "make clean" to prepare your project directory for ditsribution and you can store command modifications in the Makefile.

It's much easier to type "make pdf" than to remember "pdflatex --all --of --my --options my_project.ltx"  :Very Happy: 

First, make a project directory and then a src/ subdirectory for your .ltx file.  Then pop this Makefile in and change the NAME="..." line to your file name minus the ltx extension.  This should work for most simple single file LaTeX projects, but you can modify the commands to fit your needs.

Please let me know if you have a better one or any suggestions!

```
NAME="your_project"

all:

        @echo "-- Nothing to do, please choose a target to make. --"

        @echo "Available targets:"

        @echo "  rtf     pdf"

        @echo "  dvi     ps"

        @echo "  html    txt"

        @echo -e "\nYou can also use \"make clean\" to clean all non-source files."

rtf:

        latex2rtf src/${NAME}.ltx

        @mv src/${NAME}.rtf . &>/dev/null

html:

        latex2html src/${NAME}.ltx

        @mv src/${NAME} . &>/dev/null

pdf:

        pdflatex src/${NAME}.ltx

ps: dvi

        dvips -t letter -o ${NAME}.ps ${NAME}.dvi

dvi:

        latex src/${NAME}.ltx

txt:

        detex < src/${NAME}.ltx > ${NAME}.txt

clean:

        @echo '  Cleaning...'

        @find . \( -name '*.dvi' -o -name '*.ps' -o -name '*.pdf' \

            -o -name '*.txt' -o -name '*.log' -o -name '*.aux' \

            -o -name '*.rtf' -o -name '*.bak' -o -name '*~' \) \

            -type f -print | xargs rm -f

        @rm -rf ${NAME} &>/dev/null

```

----------

## karnesky

I must say I'm very impressed with HA-prosper's ability to create split slides & to use a table-of-contents.  It makes for beautiful presentations.

I do have one question:  does anyone know of a LaTeX package that would be analagous to WordPerfect's MakeItFit tool, which will automatically adjust margins, font size, line spacing, etc. so that the text will exactly fill a user-desired number of pages?  This was a very useful trick that I am sure should be possible in LaTeX, but I can't figure out how to do it.

----------

## erikbjohn

I am suprised nobody is mentioning using Emacs as an editor.  I have fjound that this proves to be a very powerful tool.   In fact, I am able to use the R program (for stats) using ESS in Emacs, while editing the final paper output in the LaTeX document all from one window.  This proves to b e a very efficient combination. In addition, all of the pdf commands as well as spell checking can also be done from this window.  :Confused: 

----------

## stahlsau

And I am surprised only one of you mentioning LYX. It's sorta GUI for LaTex so one hasn't to learn the coding-language, very nice for beginners who only wanna write something without messing with the "how-to-make-it-look-good".

Possibly it's no choice for the hardliner-latex-code-fetishists, but I encourage anyone who doesn't want to learn latex to try it out. I've written a lot of docs for university with lyx in the last years, and that with ease  :Wink: 

----------

## daff

I found two "cheat-sheets" for LaTeX, which are quite helpful:

LaTeX-Symbols, 91 (!) pages

Very nice cheat-sheet for quickly recalling things like text properties, document structure, etc.

----------

## poke@ulyssis

Wath about this combination!

I use pdflatex with graphicx and I also wanna make a html page of my document.

But latex2html gives this error:

*********** WARNINGS ***********  

No implementation found for style `graphicx'

So I won't see my figures in html

thx

----------

## omega_cubed

 *poke@ulyssis wrote:*   

> Wath about this combination!
> 
> I use pdflatex with graphicx and I also wanna make a html page of my document.
> 
> But latex2html gives this error:
> ...

 

What kind of graphics are you using? If you are just using eps files, you can try switching to using epsfig instead. I just tried latex2html on my thesis and the epsfigs translates into png image just fine with it. 

Otherwise if the reason you use graphicx is for png or jpeg images, may I suggest hacking through the HTML file yourself and adding images?  Okay, just kidding, but check out this guide and see if it helps. 

And here is a page that gives some general info regarding using graphics in latex, it explicitly states that it keeps in mind the use with latex2html, so I think it will work. 

Cheers, 

W

----------

## data

It looks like everyone's having great fun with LaTeX here   :Smile: 

I just discovered it a few days ago and I love it. However I need a little help.

When I include a C++ source file in my document all the accents that are in the included code get messed up (ie moved to the beginning of the word).

I use this to enable accents in my standard LaTeX.

```
\usepackage[latin9]{inputenc}
```

and this to format and include a C++ file 

```
\lstinputlisting[language=c++,breaklines]{simu1/Generator.cc}   
```

Any sound advice or even vague ideas about why this is happening  :Question: 

Thanks.

----------

## slartibartfasz

You could use the option 'texcl' or one of the possible escape sequences to typeset LaTeX code inside a listing. Also try to explicitly set 'extendedchars' as an option.

Details about the options can be found in /usr/share/texmf/doc/latex/listings/listings.dvi

Welcome to LaTeX  :Very Happy: 

----------

## data

Great it worked, thanks.

I just added this line towards the beginning of my document.

```
\lstset{extendedchars=true}
```

Now all the accents appear normally.

----------

## mvikred

```
The LOG file does not exist or you do not have read permission. Maybe you forgot to create the LOG file?
```

thts the error i get , every time i try to run .... i followed all the steps in the guide for latex , but i still end up getting this result 

plzzz help 

mvikred

----------

## slartibartfasz

Can you give us some more details? What command did you issue, what did you try already...

----------

## karnesky

Try running latex from an xterm or shell.

IIRC, Kile prints this error when it tried to open a log that doesn't exist.  Usually the log doesn't exist because latex didn't make one.  Perhaps you didn't save your file and/or didn't save it with an appropriate extension.

----------

## mvikred

 *slartibartfasz wrote:*   

> Can you give us some more details? What command did you issue, what did you try already...

 

i used F2 command , tht is latex command , and the output shud be a dvi file , instaed i get this msg

mvikred

----------

## mvikred

 *karnesky wrote:*   

> Try running latex from an xterm or shell.
> 
> IIRC, Kile prints this error when it tried to open a log that doesn't exist.  Usually the log doesn't exist because latex didn't make one.  Perhaps you didn't save your file and/or didn't save it with an appropriate extension.

 

mvikred@Tamarlane mvikred $ ls

Desktop  DjSuketu-BinTereSanam.mp3  Kihim Beach Pics-June 1st  MyDownloads  Output.avi  int.tex  int.tex~  temp  wordlist

mvikred@Tamarlane mvikred $ latex

This is TeX, Version 3.14159 (Web2C 7.3.1)

**

Please type the name of your input file.

**int.tex

(Fatal format file error; I'm stymied)

mvikred@Tamarlane mvikred $

this is what i get when i do what u say , and i did save the file with .tex extension from kile also   :Sad: 

mvikred

----------

## karnesky

See if http://www.tex.ac.uk/cgi-bin/texfaq2html?label=formatstymy helps

----------

## mvikred

 *karnesky wrote:*   

> See if http://www.tex.ac.uk/cgi-bin/texfaq2html?label=formatstymy helps

 

thanx man this worked

mvikred

----------

## arand

A little note for the front page of this thread.  

dvipdfm now depends on tetex <2 and is blocked by tetex 2*.  What this means is if you do a emerge -uD world it will downgrade you to tetex1*.  Currently tetex 2* will install its own dvipdfm.  I have not tried it out personally to see how it works. 

I would recommend at least for the time being removing 

```
emerge dvipdfm
```

 from the first post.

----------

## slartibartfasz

Thanks, arand, i didnt notice that - the version of dvipdfm works fine for me. I'll remove the line.

----------

## karnesky

latex-suite for vim is quite nice.

But I'm having a problem with the Alt Key Macros.  I can't seem to use any of the macros in vim on the console or in rxvt.

In gvim, alt-[l,c,b] but alt-i inserts an 'é'

Anyone have any ideas regarding the use of these?  Thanks!

EDIT: It appears alt-m has been replaced with alt-b.

----------

## slartibartfasz

vim and gvim read different rc files (/etc/vim) maybe thats the reason.

----------

## karnesky

Thanks for the reply.  I don't think that is the problem.

gvim reads both .vimrc and .gvimrc.  vim just reads the former.  I have absolutely nothing in ~/.gvimrc and nothing relevant in /etc/vim/gvimrc.

As a work-around, I've put this into my tex.vim file:

```
imap <C-b> <Plug>Tex_MathBF

imap <C-c> <Plug>Tex_MathCal

imap <C-l> <Plug>Tex_LeftRight

imap <C-i> <Plug>Tex_InsertItem

imap <C-k> <Plug>IMAP_JumpBack
```

----------

## discostu

I'm using latex for my English class and we're required to have our name, date, and assignment number in the upper right hand corner. To keep my assignment to 1 page, I'm using the fullpage package. I'm also using the fancyhdr package to do the header. However, because the header is 3 lines, it overlaps the body. When I add \headheight it kind of fixes it, but it seems to move everything down the page and it doesn't look good. What's the best way to fix this?

Thanks,

Stu

----------

## arand

 *discostu wrote:*   

> \ldots However, because the header is 3 lines, it overlaps the body. When I add \headheight it kind of fixes it, but it seems to move everything down the page and it doesn't look good. What's the best way to fix this?
> 
> Thanks,
> 
> Stu

 

A quick fix might be to subtract the same amount from \textheight.

Another soution might be to remove the full page package but I am not sure on that fact.  

Hope this is helpful.

----------

## dpl

After a professor of mine suggested I learn LaTeX, I did a quick search on the forums for LaTeX and how to use it, and found this. This is friggin' fantastic!

Thanks a ton to slartibartfasz and all others who pitched in. If it were not for these easy to use and follow instructions, I'd still be lost.

- dpl

----------

## Pseud

I get this error after I sync'd today:

```

# emerge -pvt tetex

These are the packages that I would merge, in reverse order:

Calculating dependencies ...done!

[blocks B     ] app-text/tetex (from pkg app-text/ptex-3.1.3)

[blocks B     ] app-text/tetex (from pkg app-text/xdvik-22.40y-r2)

[ebuild  N    ] app-text/xdvik-22.40y-r2  -cjk +libwww 2,203 kB

[ebuild  N    ]  app-text/ptex-3.1.3  +X -debug +doc 1,966 kB

[ebuild   R   ] app-text/tetex-2.0.2-r3  +X -debug +doc 0 kB

```

Why the blocking?

----------

## tfh

Same type of issue here with another latex package :

```

[blocks B     ] dev-tex/eurosym (from pkg app-text/tetex-2.0.2-r3)

[blocks B     ] >=app-text/tetex-2 (from pkg dev-tex/eurosym-1.4)

```

Maybe those packages got included in tetex ? I don't know the solution either .

----------

## BlackEdder

From the emerge man page:

       [blocks B ] app-text/dos2unix (from pkg app-text/hd2u-0.8.0)

              Dos2unix  is  Blocking  hd2u from being emerged.  Blockers are

              defined when two packages will clobber each others  files,  or

              otherwise  cause  some  form of breakage in your system.  How-

              ever, blockers  usually  do  not  need  to  be  simultaneously

              emerged because they usually provide the same functionality.

You will have to unmerge tetex to be able to emerge the others

----------

## twam

Is there no easy and automatic way of updating the packages like Miktex for Windows? I don't want to download 20 packages by hand and include them.

----------

## karnesky

 *twam wrote:*   

> Is there no easy and automatic way of updating the packages like Miktex for Windows? I don't want to download 20 packages by hand and include them.

 I suggest getting the packages you use into portage.  However, the main tetex site runs a rsync server.

----------

## slartibartfasz

 *twam wrote:*   

> Is there no easy and automatic way of updating the packages like Miktex for Windows? I don't want to download 20 packages by hand and include them.

 

There is en eclass for tex packages - just take a look at one of the existing ebuilds - most of them consist of three steps:

inherit eclass

download

run tex and install

If the packages you want to install follow the standards, all you need to do is to save such a basic ebuild under the proper name in /usr/local/portage/dev-tex and emerge it. If it works and you want to be nice you can then submit the ebuild to bugs.gentoo.org for inclusion, next time the package is upgraded someone (not necessarily you) will adjust the ebuild and everyone will be update automatically. Gentoo rocks  :Very Happy: 

----------

## erebus

Is there any chance someone could extend this guide to include making truetype fonts available to latex/pdflatex? I can't seem to get it work.

I'm following the guide here and trying to install the genium font;

http://ipe.compgeom.org/pdftex_1.html

But for some reason can't get pdflatex to detect my gentium.map file.

----------

## Flandry

I've tried putting some small caps into my thesis with \textsc (also tried \sc), but apparently small caps aren't in the default install because i get this warning:

```
Font shape `OT1/cmr/bx/sc' undefined(Font) using `OT1/cmr/bx/n' instead on input line 1. Font shape `OT1/cmr/bx/sc' undefined(Font) using `OT1/cmr/bx/n' instead

./methods.tex:0: Some font shapes were not available, defaults substituted.
```

Is that unusual?  How can i get the small caps font shapes installed?

----------

## Felly

I love LaTeX but I wouldn't mind that for some projects I would be able to use a more 'modern' look. Perhaps a bit like the O'Reilly books regarding fonts.

Is this possible ?

----------

## karnesky

 *Felly wrote:*   

> Perhaps a bit like the O'Reilly books regarding fonts.  Is this possible?

 Sure, just use the same fonts that they use:

The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is Lucas-Font's TheSans Mono Condensed.

Try to get Type-1 versions of all of these (or something similar), add them to your local texmf directory, and then call \def\rmdefault{TheSansMono} (or similar).

----------

## Felly

It seems that those are commerical fonts ?

Any freeware look-a-likes ? It doesn't have to be an exact match, just something that looks _good_.

No, I'm not too lazy to look myself. Problem is, I get lost all the time on those font websites with thousands of downloads. I don't know a thing about fonts  :Embarassed: 

----------

## karnesky

 *Felly wrote:*   

> It seems that those are commerical fonts ?

 Yes.  As are most fonts found in for-profit books. *Quote:*   

> Any freeware look-a-likes ? It doesn't have to be an exact match, just something that looks _good_.
> 
> No, I'm not too lazy to look myself. Problem is, I get lost all the time on those font websites with thousands of downloads. I don't know a thing about fonts 

 I'm no better at doing this for you, though.  Bitstream vera serif is somewhat similar to Birka.  You're on your own for the others.

----------

## furanku

 *Felly wrote:*   

> It seems that those are commerical fonts ?
> 
> Any freeware look-a-likes ? It doesn't have to be an exact match, just something that looks _good_.
> 
> No, I'm not too lazy to look myself. Problem is, I get lost all the time on those font websites with thousands of downloads. I don't know a thing about fonts 

 

In principle you can use nearly all fonts in LaTeX. But you have to take a lot of care about font families, math fonts, ... to get something that looks as good as the original CMR family. Take a look at this guide. There are some packages described that use the standard postscript fonts (Times, Helvetica, Palatino, ...) to give LaTeX a "modern look", with some samples in the end. Try for example simply to insert a \usepackage{mathpazo} in your document.  But a real LaTeXnician consider these "hacks" as evil, some of the reasons (and some other usefull informations) are described in the LaTeX Tabu List.

----------

## qleak

 *slartibartfasz wrote:*   

> 
> 
> Disadavantages
> 
>  it forces the user to think logical
> ...

 

I don't see any reason for this disadvantage. LaTeX is fairly good at producing even the most complicated tables

see the tabular environment. 

However the main weakness LaTeX really does have is the inability to easily include graphics.

Personally I have to use graphics all the time so I use the \usepackage{graphics} and create eps files to include using the command

\includegraphics{figure.eps}

Some people use \usepackage{pstricks} to include their eps files.

Anyway you'll need a quality program to produce eps files.. I would recommend scilab, kig, drgeo or xfig for this purpose.. maybe even gimp if you want to tweak your graphics.

----------

## furanku

 *qleak wrote:*   

> I don't see any reason for this disadvantage. LaTeX is fairly good at producing even the most complicated tables
> 
> see the tabular environment.
> 
> 

 

I agree. In fact, LaTeX is made for scientifical publications, and used all the time for typesetting tables. It may be a bit uncomfortable for beginners but the tabular environment and it's extension packages are very powerfull. 

 *qleak wrote:*   

> 
> 
> However the main weakness LaTeX really does have is the inability to easily include graphics.
> 
> Personally I have to use graphics all the time so I use the \usepackage{graphics} and create eps files to include using the command
> ...

 

The graphics package is obsolete and shouldn't be used anymore. Use graphicx instead.

 *qleak wrote:*   

> 
> 
> Some people use \usepackage{pstricks} to include their eps files.
> 
> 

 

That's indeed a very nice package, but causes some problems when trying to generate pdf output directly via pdflatex, not via dvipdf.

 *qleak wrote:*   

> 
> 
> Anyway you'll need a quality program to produce eps files.. I would recommend scilab, kig, drgeo or xfig for this purpose.. maybe even gimp if you want to tweak your graphics.

 

There's  for almost all graphic formats a converter to postscript/pdf, so that shouldn't be such a big problem.

----------

## patrik

 *karnesky wrote:*   

> latex-suite for vim is quite nice.
> 
> But I'm having a problem with the Alt Key Macros.  I can't seem to use any of the macros in vim on the console or in rxvt.
> 
> In gvim, alt-[l,c,b] but alt-i inserts an 'é'
> ...

 

I had the same problem. Try it with xterm.

patrik

----------

## kernelcowboy

I know this is the wrong forum, but hopefully not too far from the target.  I use gentoo on all my machines!  Gentoo Rocks!!

Any programmers or software designers using LaTeX for use case writing?  

I use the Cockburn style.  I prefer to do the non stardard numbering for that style.  I also like to have use cases in separate files, and packaged in html all linked together. 

The numbering style goes like this (for anyone not familiar.)

Main Scenario:

1. User does ...

2.  System does big network thing ...

3.  User has System save it all

Extensions

a.  at any time, the System may ....

2a.  The network fails mid network thing

  2a.1  System does ...

  2a.2  Use case continues

2b.  Some else happens at this step

  2b.1  Use case fails.

Note that the Extension numbering is specialized:  the number states the step the extension forks from.

So, can LaTex do this?   :Wink: 

Cheers

----------

## DOSBoy

You'd be able to use \include to pull in the use cases from separate files, wouldn't you?

As to the numbering, I'm sure it's possible.

----------

## n0rad

Hey

i had teTeX running, but i must have done sth (i don't know what) but now tex/latex doesn't work anymore.

Whenever i want to run latex it can't find the file given unless it's an absolut path.

```

latex f2.tex

This is TeX, Version 3.14159 (Web2C 7.4.5)

! I can't find file `f2.tex'.

<*> f2.tex

Please type another input file name:

```

But the file exists at the location latex is called. If you give an absulut path as a parameter i get this:

```

LaTeX2e <2001/06/01>

Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, n

ohyphenation, loaded.

! LaTeX Error: File `article.cls' not found.

Type X to quit or <RETURN> to proceed,

or enter new name. (Default extension: cls)

Enter file name

```

I tried to re-emerge teTeX but that didn't help.

Btw. when re-emerging i had problems too. Bug #30432. It says sth about env vars. But i don't get which ones are meant.

I hope you guys can help, because i have no idea where i should start looking for an error.

tia, bye

----------

## n0rad

ADDITION:

Looks like sth is wrong with my TEXINPUTS, because if i export TEXINPUTS = :.TeX it works.

It was set to TEXINPUTS = .TeX before. Where can i set global TEXINPUTS?

----------

## jorges

This is copy of another post. I thought it could be of interest to some.

An ebuild for the latest version of the latexsuite package (latexSuite20041219, see bug 112101) has been submitted to bugzilla. It is just the previous ebuild (latexsuite-1.5.ebuild) with a minor change to reflect the different upstream name for the new version. NOTE: Although it's been around some time already, it is still marked as a development snapshot at the developer's web http://vim-latex.sourceforge.net/index.php?subject=download&title=Download

The changelog from the previous release is quite long, http://vim-latex.sourceforge.net/vimfiles/ftplugin/latex-suite/ChangeLog, in my case I was after some improvements on the alt keys mapping feature.  

It installed ok on my machine* and so far so good. 

* vim 6.3.084 (gvim not installed), running x86 (mostly).

jorges

----------

## matttions

There is a very beautiful gtk2 editor for LaTeX 

http://winefish.berlios.de/

There is also an ebuild on bugzilla  :Smile: 

https://bugs.gentoo.org/show_bug.cgi?id=106164

There also a topic on the forum :

https://forums.gentoo.org/viewtopic-t-128649-start-0-postdays-0-postorder-asc-highlight-.html

Give it a chance  :Smile: 

----------

## dbasetrinity

nice guide 

I might finally be able to create a pdf on linux now lol 

creating pdf's is probably about the only aspect i still miss on a windows system.

thanks for elimating windows fully from my life now lol

----------

## robbyjo

Any pointers to make table inside a table? From what I tried, nesting tabular inside another tabular doesn't work well. Another complain is that I can't insert some picture inside any of the table.

----------

## ufechner

Hello,

how I can I install a latex package, that is not part of the default distribution of gentoo, like the mathabx package?

It's easy to install in freebsd, but how can I do it with gentoo linux?

Regards:

Uwe Fechner

----------

## pinger

This is going to sound real stupid but... although I've emerged tetex, I cannot for the life of me find latex anywhere... I always thought it was provided by the tetex package?   :Embarassed:   :Rolling Eyes: 

----------

## nichocouk

 *ufechner wrote:*   

> Hello,
> 
> how I can I install a latex package, that is not part of the default distribution of gentoo, like the mathabx package?
> 
> It's easy to install in freebsd, but how can I do it with gentoo linux?

 

Look at this page

 *pinger wrote:*   

> This is going to sound real stupid but... although I've emerged tetex, I cannot for the life of me find latex anywhere... I always thought it was provided by the tetex package?

 

What do you mean? the latex command is at /usr/bin/latex

And yes it is provided by tetex.

----------

## pinger

 *nichocouk wrote:*   

> 
> 
>  *pinger wrote:*   This is going to sound real stupid but... although I've emerged tetex, I cannot for the life of me find latex anywhere... I always thought it was provided by the tetex package? 
> 
> What do you mean? the latex command is at /usr/bin/latex
> ...

 

Well, I have emerged several times 

```
app-text/tetex-3.0_p1-r1  USE="X motif -Xaw3d -doc -lesstif -neXt"
```

and there is no /usr/bin/latex. Bug? Or something really stupid on my part?

----------

## nichocouk

mmmhhh. I have the latest stable version: 

```
app-text/tetex-2.0.2-r5  +X -doc
```

quite probably a bug somewhere, you can inform the maintainers on bugzilla, if nobody else has done it. You should probably stick to the stable version for now.

----------

## infion

 *pinger wrote:*   

> This is going to sound real stupid but... although I've emerged tetex, I cannot for the life of me find latex anywhere... I always thought it was provided by the tetex package?   

 

Same problem here and also pdflatex is missing  :Sad: 

----------

## pinger

I posted the following bug...

https://bugs.gentoo.org/show_bug.cgi?id=120319

----------

## rdd

I've run into another tetex upgrade problem posted at https://forums.gentoo.org/viewtopic-t-426735.html (any help would be greatly appreciated) which caused me to reemerge tetex a few times and after one of the reemerges I had no latex in my path. After reemerging again I had it back though. Odd...

----------

## pinger

Probably related to to this bug, which I also experience: 97668

----------

## rdd

Thanks for the buglink! After following the link in that bug to bug 90915, and tried reemerging tetex after closing X. Closed X, logged in as root and reemerged tetex and it seems to work fine now! Oddness indeed, i suppose the root environment needed to be set up properly when emerging tetex...

----------

## TheCoop

tetex has been obsoleted and isn't maintained any longer - a lot of the stuff included in tetex is now old. Are there any alternatives to tetex in portage atm?

----------

## V-Li

For the sake of completeness: TeXLive is available.  Also have a look at g-CTAN for other packages.

----------

## Onanymous

I used to work with miktex in windows before, and just recently switched to gentoo. TexLive was one of the first things I installed and I must say I am pretty dissapointed. mainly by the fact that tlmgr is removed from ebuild, which means no automatic latex class downloads available on demand, you have to install them manually one by one, or raher install some bundles through portage interface.  Why deleting tlmgr? I do not get it!

----------

## ppurka

 *Onanymous wrote:*   

> I used to work with miktex in windows before, and just recently switched to gentoo. TexLive was one of the first things I installed and I must say I am pretty dissapointed. mainly by the fact that tlmgr is removed from ebuild, which means no automatic latex class downloads available on demand, you have to install them manually one by one, or raher install some bundles through portage interface.  Why deleting tlmgr? I do not get it!

 It is because you work as user and the installation of texlive was done as root and maintained by your package manager. If tlmgr works on its own then it will bypass the package manager. That is not how package management works in gentoo/linux in general.

----------

