Talk:LaTeX/Basics

why ps2pdf?
What's the good point of doing tex-->ps-->pdf to create a PDF if you can simply do tex--> PDF? in the first (old) approach you get bad fonts, no hyperlinks, etc. Creating the PDF straight away you'll get a good document with high quality pictures and internal links, why shouldn't we suggest to use pdflatex whenever possible?? Alessio Damato 13:07, 31 October 2006 (UTC)

You might be using a package like pstricks to draw lines etc. These won't appear in the PDF if you just run pdflatex. 131.111.232.123 (talk) 23:52, 2 June 2010 (UTC)

How exactly do I create output from my *.tex source file?
This chapter lacks precise information on how exactly output files (*.pdf, *.dvi, *.eps, etc.) are obtained from the *.tex source file. I myself have downloaded MikTeX 2.7 and pdflatex is included. I also have my *.tex file. Where do I place it and how exactly do I use this pdflatex plugin to produce an output file?
 * See the section "A Typical Command Line Session". The details regarding pdflatex aren't there, but they should be (and I'll add it). You might also want to consider installing a nice editor to write the tex files, and compile the PDF, etc. documents by pressing buttons (rather than typing commands from a command prompt). I'd recommend Texmaker, which is free. From this program, I just click on the "PDFLAT" button, then the Adobe reader button, and then I can see the output. +mt  22:29, 6 September 2007 (UTC)
 * Lots of tex editors have compliers built right into them. I use TeXnicCenter and it has a button "build and view current file" that does the wacky command line stuff for you. Perhaps the command line is used because there's such a huge amount of tex editors out there (with no real standard version I guess), or because of a million other reasons, but if you're using a tex editor that's fairly mainstream, there should be a button that does the cmd line stuff for you. -ai 1:24, 26 May 2008

Explanation of environments
Where can I get more information about environments which is used by \begin command? These environments are used in many pages like in "Title Creation" but I can not find in the right side floating TOC the explanation of them.

UTF?
In instructionto make first document:
 * Edit/Create your LaTeX input file. This file must be plain ASCII text. On Unix all the editors will create just that. On Windows you might want to make sure that you save the file in ASCII or Plain Text format.

But in internationalizations topic are mentioned that I can write unicode characters as well. So file cannot by ASCII!! After reopening I'll get mess. But if saving in UTF-8, BOM is allowed or not?
 * If you save in UTF-8, in order for the characters to appear correct, one must add \usepackage[utf8]{inputenc}.187.106.55.135 (discuss) 06:33, 25 March 2011 (UTC)

Special Characters
The special characters are not explained, i get the spanish version of ? and ! (turned by 180 degree) instead. Would be quite helpful if this chapter would explain why.


 * Those are not special characters as explained in that section. -- As they are so rare in normal text, and usually used in math contexts, they will print just as in math. In text context, the cmr fonts map those to the spanish forms of question mark and exclamation mark. I'll make sure to leave a note soon. -- Johannes Bo (discuss • contribs) 21:23, 20 July 2015 (UTC)

Modernization effort
I've submitted a fairly significant rewrite with the following goals:
 * 1) Encourage modern engines and PDF output: When most of this book was originally written, XeLaTeX and LuaLaTeX were very new. Ten years later, this is no longer the case, and the average user probably wants PDF output. On that note...
 * 2) Optimize reading for the average user: A discussion of DVI and PostScript output is kept around, but placed after the common .tex -> .pdf workflow.
 * 3) Remove questionable advice: I've removed the section suggesting to use Ghostscript to "compress" the output PDF. Modern LaTeX engines do a pretty good job of minimizing PDF output size, and the recommended technique gets lots of its savings by lossily recompressing images in the document. (see ). While it may be a useful technique, it's probably not good general-purpose advice.

Feedback is greatly appreciated. Nitpick away - while I've made a fair number of Wikipedia edits, it's been a while, and I'm sure there's things I could do better.

Mkline (discuss • contribs) 03:36, 31 December 2017 (UTC)


 * Any updates welcome, but please don't steer users into Xe and Lua too much, pdftex is still the standard engine. --Johannes Bo (discuss • contribs) 08:22, 1 January 2018 (UTC)


 * Would you mind elaborating a bit? I'll try not to suggest that one engine is preferred over another in my writing, but the ability to work with fontspec and Unicode over all the traditional TeX encoding challenges seems like an obvious benefit to newcomers. Mkline (discuss • contribs) 05:37, 10 January 2018 (UTC)
 * Any usual english journal uses either latex (really dvi mode) or pdflatex. Use of another engine can lead to different results. But journals normally just use the content, the LaTeX code is pretty uninteresting for most. For a thesis, non of this applies and people are free to use anything, unless there is some bad template around. --Johannes Bo (discuss • contribs) 18:02, 11 January 2018 (UTC)

Is "switch" a good label?
I'm new to LaTeX, so I'm seeking some feedback before making changes to the article.

In Section 1.5 LaTeX Commands:

"Most standard LaTeX commands have a switch equivalent."

This phrasing made me assume switches aren't commands. After much confusion, I went back and looked at the definition of a LaTeX command, and found that switches DO meet the definition of a command.

When I was trying to understand this concept I searched for "switch" in this WikiBook. Most of the finds were just the common verb meaning of switch rather than the noun concept in this section. The hits that are relevant are:

https://en.wikibooks.org/wiki/LaTeX/Fonts There is a table with the headings "LaTeX command" and "Equivalent switch". Also "Generally, one should prefer the commands over their equivalent switches because the former automatically corrects spacing immediately following the end of the selected style." These example give the impression that switches aren't commands.

https://en.wikibooks.org/wiki/LaTeX/FAQ "Most likely you have used \raggedleft, \raggedright or \centering at some point and forgotten to switch it off. These commands are switches—they remain active until the end of the scope, or until the end of the document if there is no scope." This one agrees with me that switches are commands.

So, two problems. Firstly there's internal contradiction as to whether switches are commands. Second, the term "switch" as a noun is used so infrequently that it made me question whether it's useful to use that term at all. So I started wondering whether "switch" has any provenance. I tried to find a formal definition of "switch" in the definition of TeX/LaTeX. I couldn't find one, but again, I'm new to this, so maybe I wasn't searching in the right place.

Anyway, I'm wondering whether we should rewrite this section to avoid the term "switch" entirely. Something like the following.

"Many LaTeX formatting commands come in pairs.


 * 1) A form with an argument, where the argument is the text to which the format is applied.
 * 2) A form without an argument, where the formatting will be applied to all text after the command until the end of the current scope. This form should almost never be called outside of any scope, otherwise it will apply on the rest of the document.

One example of such a pair are the commands \emph and \em."

Then launch into the excellent example that contrasts the use of these two commands.

Jim 14159 (discuss • contribs) 10:53, 22 May 2021 (UTC)


 * Responding to my own question. Having learnt more about LaTeX, I now know my proposed wording is wrong, because for some commands the "switch" form can have arguments, and the other form can have more than one argument, as occurs in the pair: \textcolor and \color It would be good to have a short word to describe each form. I still haven't located the provenance of the word "switch". I'm wondering whether "scope form" is clearer, with the other form being described as the "argument form". Here's a second attempt at my previous suggested wording.
 * "Many LaTeX formatting commands come in pairs.
 * An argument form, where one of the arguments is the text to which the format is applied. Often there is only one argument.
 * A scope form, where the formatting will be applied to all text after the command until the end of the current scope. This form should almost never be called outside of any scope, otherwise it will apply on the rest of the document. Often the scope form has no arguments.
 * One example of such a pair are the commands \emph and \em."
 * Then continue as before with the \emph and \em example. Then do a similar example with \textcolor and \color.
 * Also, some environment/command pairs also use the scope form the command, so we need the label there too. Jim 14159 (discuss • contribs) 02:05, 31 May 2021 (UTC)