parent_url
stringlengths
41
46
parent_score
stringlengths
1
4
parent_body
stringlengths
25
35.5k
parent_user
stringlengths
37
42
parent_title
stringlengths
12
150
accepted
bool
2 classes
body
stringlengths
4
36.7k
score
stringlengths
1
4
user
stringlengths
37
42
answer_id
stringlengths
1
6
__index_level_0__
int64
0
322k
https://tex.stackexchange.com/questions/448
75
I have a simple command which I use to write set comprehensions so that the braces automatically resize with respect to size of the enclosed arguments, e.g. ``` \usepackage{amsmath} \newcommand{\set}[1]{\left\lbrace #1\right\rbrace} \begin{equation*} \set{x \in X \mid x > \frac{1}{2}} \end{equation*} % Produces something like: { x : X | x > 1/2 } ``` However, the `\mid` vertical bar wont resize like the braces `{ .. }` do. How can I get the `\mid` to resize as well?
https://tex.stackexchange.com/users/169
How to automatically resize the vertical bar in a set comprehension?
true
You can use `\middle|` instead of `\mid` like ``` \[ \left\{ x \in X \middle| x > \frac{1}{2}\right\} \] ``` or with better spacing ``` \[ \left\{ x \in X \,\middle|\, x > \frac{1}{2}\right\} \] ``` (I think this requires a somewhat modern TeX-distribution.)
80
https://tex.stackexchange.com/users/83
456
310
https://tex.stackexchange.com/questions/448
75
I have a simple command which I use to write set comprehensions so that the braces automatically resize with respect to size of the enclosed arguments, e.g. ``` \usepackage{amsmath} \newcommand{\set}[1]{\left\lbrace #1\right\rbrace} \begin{equation*} \set{x \in X \mid x > \frac{1}{2}} \end{equation*} % Produces something like: { x : X | x > 1/2 } ``` However, the `\mid` vertical bar wont resize like the braces `{ .. }` do. How can I get the `\mid` to resize as well?
https://tex.stackexchange.com/users/169
How to automatically resize the vertical bar in a set comprehension?
false
There is the `\middle` command, it is like `\left` and `\right` but for the middle =) However, LaTeX does not consider `\mid` to be a delimiter, so you have to use pipe instead (or vertical bar).
12
https://tex.stackexchange.com/users/119
457
311
https://tex.stackexchange.com/questions/452
93
I often create pictures in tikz that I want to either send to someone, or include in an email. The problem with that is that there is a big white space around and and especially below my pictures. To get around this, I usually print screen my figure and crop it to get the size I want. Another solution is to use beamer and then scaling to make the figure as big as the slide size. Those two solutions, though, are not all that good. What I would really like is a way to get the pdf file to be just as big as my picture, as if it was cropped from start. Is there a package to do that?
https://tex.stackexchange.com/users/14
How can I create a pdf document exactly as big as my tikz picture?
true
TikZ can do that itself. Have a look at section 63 of the TikZ documentation: “Externalizing graphics.” This describes how all TikZ graphics in a given document can be pre-processed to speed the actual processing of a document. This results in one PDF file per TikZ graphic. This is the (shortened) example document: ``` % This is the file survey.tex \documentclass{article} \usepackage{graphics} \usepackage{tikz} \pgfrealjobname{survey} \begin{document} In the following figure, we see a circle: \beginpgfgraphicnamed{survey-f1} \begin{tikzpicture} \fill (0,0) circle (10pt); \end{tikzpicture} \endpgfgraphicnamed \end{document} ``` The following command produces the image file `survey-f1.pdf` from the above document, cropped to just the TikZ picture: ``` pdflatex --jobname=survey-f1 survey.tex ```
42
https://tex.stackexchange.com/users/42
458
312
https://tex.stackexchange.com/questions/452
93
I often create pictures in tikz that I want to either send to someone, or include in an email. The problem with that is that there is a big white space around and and especially below my pictures. To get around this, I usually print screen my figure and crop it to get the size I want. Another solution is to use beamer and then scaling to make the figure as big as the slide size. Those two solutions, though, are not all that good. What I would really like is a way to get the pdf file to be just as big as my picture, as if it was cropped from start. Is there a package to do that?
https://tex.stackexchange.com/users/14
How can I create a pdf document exactly as big as my tikz picture?
false
For a single TikZ picture, you can also use the `preview` package ``` \documentclass{article} \usepackage{tikz} \usepackage[active,pdftex,tightpage]{preview} \PreviewEnvironment[{[]}]{tikzpicture} \begin{document} \begin{tikzpicture}[options] ... \end{tikzpicture} \end{document} ```
16
https://tex.stackexchange.com/users/169
459
313
https://tex.stackexchange.com/questions/448
75
I have a simple command which I use to write set comprehensions so that the braces automatically resize with respect to size of the enclosed arguments, e.g. ``` \usepackage{amsmath} \newcommand{\set}[1]{\left\lbrace #1\right\rbrace} \begin{equation*} \set{x \in X \mid x > \frac{1}{2}} \end{equation*} % Produces something like: { x : X | x > 1/2 } ``` However, the `\mid` vertical bar wont resize like the braces `{ .. }` do. How can I get the `\mid` to resize as well?
https://tex.stackexchange.com/users/169
How to automatically resize the vertical bar in a set comprehension?
false
This seems to work for me, possibly the horizontal spacing around the bar needs adjusting. ``` \documentclass{article} \usepackage{amssymb} \makeatletter \newcommand{\my@set}[1]{\left\lbrace #1\right\rbrace} \newcommand{\my@cset}[2]{% \left\lbrace #1\vphantom{#2}\right\vert% \left.\vphantom{#1}#2\right\rbrace} \def\my@first#1|#2\relax{#1} \def\my@second#1|#2\relax{#2} \newcommand{\set}[1]{% \edef\my@given{#1} \edef\my@start{\my@first #1|\relax}% \ifx\my@start\my@given \my@set{#1} \else \edef\my@last{\my@second #1\relax}% \my@cset{\my@start}{\my@last}% \fi} \begin{document} \[ \set{x \in X \int_0^1 | y \in Y} \; \set{x \in X \int_0^1 y \in Y} \] \[ \set{x | y} \set{a b} \] \end{document} ```
3
https://tex.stackexchange.com/users/86
460
314
https://tex.stackexchange.com/questions/439
14
I want to have drafting information appear on each page of document. I have seen something similar in the Kluwer document class where it defines `\@oddfoot` and `\@evenfoot` for a lot of possibilities. Is there an easier way than this? Is there a way to do it without overwriting existing headers?
https://tex.stackexchange.com/users/185
How to "stamp" the same text on each page of a document
false
There are a couple of packages to stamp a watermark on every page: `draftcopy` and `draftwatermark`. Depending on the nature of what you want to stamp on every page, they may be useful to you.
14
https://tex.stackexchange.com/users/18
461
315
https://tex.stackexchange.com/questions/439
14
I want to have drafting information appear on each page of document. I have seen something similar in the Kluwer document class where it defines `\@oddfoot` and `\@evenfoot` for a lot of possibilities. Is there an easier way than this? Is there a way to do it without overwriting existing headers?
https://tex.stackexchange.com/users/185
How to "stamp" the same text on each page of a document
false
ConTeXt provides layers for that purpose. You can read more about it at <http://wiki.contextgarden.net/Layers>.
5
https://tex.stackexchange.com/users/99
462
316
https://tex.stackexchange.com/questions/464
5
I would like to have all references in my document (to equations, figures, lemmas, random locations in text, etc.) be numbered in the same series, and I would like these numbers to appear in the margin. See [here](http://canyon23.net/math/tc.pdf) for examples: p. 30 (equation and paragraph labels), p. 31 (theorem label and figure label), p. 26 (\item label). I've managed to cobble together macros which do most of what I want, but two problems remain: * The marginal label aligns according to the *baseline*, but for displayed equations I would like it to be more centered (see p. 4 of above document). * I can't get labels for figures into the margin. Is there a package which does something like this? Is there a way for TeX to know the height of the current displayed equation, so that I can adjust the vertical position of the marginal note accordingly?
https://tex.stackexchange.com/users/203
Aligning marginal notes with center of line rather than baseline
false
> > Is there a package which does something like this? > > > I don't know if it does exactly what you ask for, but there's the [showlabels](http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=showlabels) package which I've used to do similar things. It's got some configuration options so may be able to do what you need.
3
https://tex.stackexchange.com/users/86
466
318
https://tex.stackexchange.com/questions/220
69
I want to write my final thesis using LaTeX, what should I do in order to be able to do that through Eclipse on a Mac OS X? If any another good editor exists, feel free to write your opinion on why using this instead of something else.
https://tex.stackexchange.com/users/62
I want to start using LaTeX on Mac OS X. Where do I start?
false
I use **[MacVim](http://code.google.com/p/macvim/)** for all my editing purposes, and naturally also for LaTeX. Together with the **[Vim-LaTeX](http://vim-latex.sourceforge.net/)** plugin, it’s very powerful. But of course it’s Vim and that’s not to everybody’s liking, and furthermore setting the Vim-LaTeX plugin up correctly is a bit of a hassle, in particular since the plugin by default maps a lot of keys to custom commands. On the one hand this is helpful for writing said commands, on the other hand it’s very annying when you actually want to use those commands. For example, by default you cannot easily write a quote mark (`"`) and some other characters.
3
https://tex.stackexchange.com/users/42
467
319
https://tex.stackexchange.com/questions/472
52
I often want to have more than one index in a longer LaTeX document. For instance, I might want a general concept index, an index of named persons, and an index of symbolism. How can I have two or more distinct indexes in LaTeX?
https://tex.stackexchange.com/users/93
How can I have two or more distinct indexes?
true
The [`multind`](http://www.ctan.org/tex-archive/help/Catalogue/entries/multind.html) package provides simple and straightforward multiple indexing. You tag each `\makeindex`, `\index` and `\printindex` command with a file name, and indexing commands are written to (or read from) the name with the appropriate (.idx or .ind) extension appended. To create a “general” and an “authors” index, one might write: ``` \usepackage{multind} \makeindex{general} \makeindex{authors} ... \index{authors}{Another Idiot} ... \index{general}{FAQs} ... \printindex{general}{General index} \printindex{authors}{Author index} ``` To complete the job, run LaTeX on your file enough times that labels, etc., are stable, and then execute the commands ``` makeindex general makeindex authors ``` See also this FAQ: [Multiple indexes](https://texfaq.org/FAQ-multind) **Update** `multind` is a package for LaTeX 2.09 Consider the following alternatives: * [index](https://www.ctan.org/tex-archive/macros/latex/contrib/index?lang=en) * [splitindex](https://www.ctan.org/pkg/splitindex?lang=en) * [imakeidx](https://www.ctan.org/pkg/imakeidx) * the *memoir* class has its own multiple-index functionality
26
https://tex.stackexchange.com/users/118
473
323
https://tex.stackexchange.com/questions/335
17
For my lectures, I like to colour the symbols in the equations to make it easier to follow what's going on - a bit like syntax highlighting. So all vector spaces are one colour, all sets another, `e` is in roman font, and so forth. At the moment, I do this by defining new macros for each symbol, so a typical line reads something like this: ``` Define \(\tyz^\tyw \coloneqq \tye^{\tyw \ty\ln(\tyz)}\) ``` I'd really like to be able to just type ``` Define \(z^w \coloneqq e^{w \ln(z)}\) ``` To do this, I'd need to be able to tell TeX that the maths symbol for, say, 'e' was not 'e' but actually 'e' in roman font and with a particular colour. Does anyone have any ideas on how to do this?
https://tex.stackexchange.com/users/86
Can I change the font and colour of a letter permanently?
true
In regular latex you can choose different fonts for different symbols, but not different colours. If you don't mind using xelatex or lualatex, however, you could try my new package "Unicode-math" which does allow you to do this sort of thing. The interface isn't that great, yet, but the general idea is ``` \setmathfont{XITS Math} \setmathfont[range= <Unicode slot for char you want>, Color=red] {XITS Math} ``` Limited by the number of fonts you can use at the moment, I'm afraid. **Update**: Here's an actual example: ``` \documentclass{article} \usepackage{unicode-math} \begin{document} \setmathfont{XITS Math} \setmathfont[range="65,math-style=upright,Colour=FF0000]{XITS Math} $def$ \end{document} ``` It doesn't work if you put `Colour` before the `math-style`, but I can't explain why that is right now. I also can't justify why you need to use `"65` rather than `"1D452`. It seems my code has taken on a life of its own `:)`
19
https://tex.stackexchange.com/users/179
474
324
https://tex.stackexchange.com/questions/405
13
ConTeXt and LaTeX are well-known and I'm aware of different engines to process those, e.g., XeTeX, pdfTeX, or LuaTeX. But on this [meta](https://tex.meta.stackexchange.com/questions/51/avoid-using-the-tex-tag/64#64) question discussion came up about TeX, plain-TeX, initex. Can someone please tell me the quick difference between those? Are there any other meta-packages? And what is bare minimum TeX (the one everything else is based upon)? And which one of these are "frozen" in featureset and bugs.
https://tex.stackexchange.com/users/137
What are some of the less-well-known TeX-like formats?
false
This site gobbled my previous answer, so you miss out on the hyperlinks, but some other less-known macro formats include: * lollipop * eplain * BLUe Of these, I think that eplain is the only one that is currently used and maintained. **Update 2015**: some time in the recent past, Vafa Khalighi has [revived lollipop](https://www.ctan.org/tex-archive/macros/lollipop).
7
https://tex.stackexchange.com/users/179
475
325
https://tex.stackexchange.com/questions/419
25
The title pretty much sums it up. I use the package srcltx in my documents. I am running Ubuntu with Kile 2.1 and Okular 0.8.2 as a viewer. I am pretty sure that inverse search should work, but I haven't been able to set it up. How does one configure the viewer and editor to make this feature work?
https://tex.stackexchange.com/users/200
How to set up inverse search with Okular and Kile
true
Check this Ubuntu forums thread: [How can I do an inverse search between okular and kile?](http://ubuntuforums.org/showthread.php?t=1088573) Here is a summary of the required steps (not tested): * Setup inverse search from Okular: Settings -> Configure Okular .. -> Editor -> Editor dropdown: "custom text editor" command: `kile %f --line %l` * Set up Kile to tell LaTeX to add source info, i.e., set LaTeX build tools from *Default* to *Modern*: Settings -> Configure kile -> Build -> LaTeX -> "Modern" in the dropdown menu * Add a new forwardDVI configuration: Settings -> Configure kile -> Build -> forwardDVI then: 1. "new..." button on the right 2. choose a name 3. put the full path to the perl script (see below) as the command (don't forget to escape, i.e., put a backslash in front of any spaces) 4. put '%target' as Options (the single quotes are important) --- ``` #!/usr/bin/perl # kile2okular. (c) Ian Wood, 2010 # based on: # kile2xdvi. (c) Juerg Wullschleger, 2009 if($ARGV[0] =~ m/file:(.*)#src:(\S*) (\S*)/){ $dviFile = $1; $line = $2; $sourceFile = $3; $sourcePos = '--unique "'.$line.' '.$sourceFile.'"'; if($dviFile =~ m|.*/([^/]*.dvi)|){ $dviFile = $1; }else{ print 'usage1: kile2xdvi <dvifile> or kile2xdvi "file:<dvifile>#src:<line> <sourcefile>"'."\n"; exit; } }else{ if((!$ARGV[0]) || ($ARGV[0] == "--help") || ($ARGV[0] == "-h")){ print 'usage2: kile2xdvi <dvifile> or kile2xdvi "file:<dvifile>#src:<line> <sourcefile>"'."\n"; exit; } $dviFile = $ARGV[0]; $sourcePos = ''; } if (!(-e $dviFile)){ print "$dviFile: No such file.\n"; exit -1; } `okular --unique "$dviFile#src:$line$sourceFile"\n`; exit; ```
17
https://tex.stackexchange.com/users/118
477
326
https://tex.stackexchange.com/questions/46
36
I want to use a really cool open-source OpenType font with my LaTeX document. I was told that either I could go through a long process of converting the OpenType font to one useable by LaTeX, or I should instead switch to using XeTeX. **Is there a way for me to use an unmodified OpenType font with my LaTeX document (and existing LaTeX installation)?**
https://tex.stackexchange.com/users/39
How do I use an OpenType font with my LaTeX document?
false
As far as I know you should install it as a system font. Such that it becomes available in system settings for UI fonts, web-browser and all apps. On Mac OS X and Linux (Gnome at least) it is simple as double clicking the downloaded font. After that you can use fontspec & Xe(La)TeX to select that font by name (note that font name can be different from the file name). If you don't want to install the font as a system font, you can drop the font into the same folder as your tex document and xelatex should be able to find it. To use OpenType and TrueType fonts with tex, latex (for dvi, dvi-ps, dvi-ps-pdf workflow) special font metrics will need to be generated and font map installed. Unfortunately I'm on a quest to find out how to properly do it. Note that using "cool fonts from the web" might not be of high quality as highly engineered fonts. The Latin Modern has something like more than 50 complete fonts to cover different weights, italics, maths and special ligatures. None of the other fonts come close for exploiting latex typography power. Commercial fonts from Adobe, Apple, Microsoft are usually of high typographical quality and are more complete.
5
https://tex.stackexchange.com/users/137
478
327
https://tex.stackexchange.com/questions/476
62
What are the advantages to using `\bigskip`, `\medskip`, and `\smallskip` instead of just using `\vspace{somelength}`?
https://tex.stackexchange.com/users/93
What, if anything, is the advantage of \bigskip and friends over \vspace?
true
Flexibility. ``` \show\bigskip ``` reveals that `\bigskip` expands to `\vspace{\bigskipamount}` so in terms of functionality, there's no difference. However, if after typing a 110 page thesis, you realise that the limit for length set by your university is 100 pages, then simply redefining `\bigskipammount` might get you your extra 10 pages in one fell swoop, rather than having to go through and considering each individual `\vspace` and remembering why it was there. In general, a good rule is that commands should carry contextual information. So even though `\(\vec{x}\)` and `\(\overline{x}\)` might look the same, `\(\vec{x}\)` should always be used for vectors and for nothing else. So that when that Big Shot Journal says "House style is that all vectors are purple with yellow dots", a simple `\renewcommand{\vec}[1]{\color{purple with yellow dots}#1}` does the trick *without* messing up any of the rest of the document. --- **Edit:** (in response to vanden's request in the comments) Of course, `\bigskipamount` is a *length* and in TeX, lengths can be a bit complicated: they don't have to be exact measurements but can include a little flexibility. Examining `latex.ltx` reveals that, unless further modified, `\bigskipamount` (and the others) are defined to be: ``` \newskip\smallskipamount \smallskipamount=3pt plus 1pt minus 1pt \newskip\medskipamount \medskipamount =6pt plus 2pt minus 2pt \newskip\bigskipamount \bigskipamount =12pt plus 4pt minus 4pt ``` Hopefully, the meaning of the syntax is clear. Thus if you are redefining `\bigskipamount` then it's good practice to also include a little flexibility. If this is new to someone, it's worth knowing that such lengths are called [*rubber* lengths](https://en.wikibooks.org/wiki/LaTeX/Lengths#Rubber/Stretching_lengths) and the extra bit is known as [*glue*](https://en.wikibooks.org/wiki/LaTeX/Boxes#TeX_boxes_and_glue_overview) so those are the words to look out for in the documentation. (Hope I've gotten that bit right; certainly those two words are *associated* with this concept.) **Moral of the Story**: Flexibility's what you need. (Probably only people of my generation who grew up in Britain will have a hope of getting the reference there)
85
https://tex.stackexchange.com/users/86
480
328
https://tex.stackexchange.com/questions/479
92
The standard font used for `\mathcal` does not include any lowercase characters. The *Comprehensive LaTeX Symbols List* suggests redefining `\mathcal` to use Zapf Chancery. However I do not particularly like that font. For example the uppercase "I" is very hard do distinguish from the non-mathcal "I". Are there any good alternatives?
https://tex.stackexchange.com/users/83
Lowercase \mathcal
false
`symbols` suggests using the `calligra` package as an alternative to Zapf Chancery. Put ``` \DeclareMathAlphabet{\mathcalligra}{T1}{calligra}{m}{n} ``` in the document’s preamble to use `\mathcalligra` for calligraphic symbols in the Calligra font. /EDIT: To be honest, I’m not thrilled by the result, and I expect you won’t be either. Still, I’ll leave this here. Perhaps someone can profit from it.
9
https://tex.stackexchange.com/users/42
481
329
https://tex.stackexchange.com/questions/46
36
I want to use a really cool open-source OpenType font with my LaTeX document. I was told that either I could go through a long process of converting the OpenType font to one useable by LaTeX, or I should instead switch to using XeTeX. **Is there a way for me to use an unmodified OpenType font with my LaTeX document (and existing LaTeX installation)?**
https://tex.stackexchange.com/users/39
How do I use an OpenType font with my LaTeX document?
false
Switch to XeTeX: 1. Change your invocations of `pdflatex` to `xelatex`. 2. `\usepackage{xltxtra}` at the beginning of your preamble (some XeTeX goodies, in particular it also loads `fontspec`, which is needed for font selection). 3. `\setmainfont{Name of OTF font}` in the preamble. 4. No step 4. It’s as easy as that. Drawback: you lose the advantages of the `microtype` package. Ah, and be sure to use UTF-8 as your source encoding, and remove any `\usepackage{inputenc}` declarations. See also: [Differences between LuaTeX, ConTeXt and XeTeX](https://tex.stackexchange.com/questions/36/differences-between-luatex-context-and-xetex).
28
https://tex.stackexchange.com/users/42
482
330
https://tex.stackexchange.com/questions/479
92
The standard font used for `\mathcal` does not include any lowercase characters. The *Comprehensive LaTeX Symbols List* suggests redefining `\mathcal` to use Zapf Chancery. However I do not particularly like that font. For example the uppercase "I" is very hard do distinguish from the non-mathcal "I". Are there any good alternatives?
https://tex.stackexchange.com/users/83
Lowercase \mathcal
false
A lowercase L can be done with `\ell`. But this seems to be the only lowercase letter that is included without loading any packages.
33
https://tex.stackexchange.com/users/97
483
331
https://tex.stackexchange.com/questions/485
87
> > **Possible Duplicate:** > > [How to add a forced line break inside a table cell](https://tex.stackexchange.com/questions/2441/how-to-add-a-forced-line-break-inside-a-table-cell) > > > In a table I would like to have a line break in the text inside a cell. Is there an easy way to do so, or do I have to create a new line without borders? The same holds true for other situations such as breaking a line in a caption for instance.
https://tex.stackexchange.com/users/124
How to break a line in a table
true
Would a `\parbox` work? ``` \begin{tabular}{ll} one line& \parbox[t]{5cm}{another\\column}\\ second line here& and here \end{tabular} ```
72
https://tex.stackexchange.com/users/117
486
333
https://tex.stackexchange.com/questions/487
9
I use Linux and have available to me the "compose" key, and thus can type characters like '°', 'ß', 'ï', 'į', 'ḯ', etc. Is it inherently "bad" to use the compose key to insert the characters, should I use LaTeX commands such as `\ss` instead of 'ß'? Does it even matter in the long run?
https://tex.stackexchange.com/users/142
Glyph insertion
true
Depends. If you only compile documents on your local machine do as you seem fit. If you collaborate you might want to use LaTeX commands for collaboration. In general case though LuaTeX and XeLaTeX use UTF-8 encoding by default and thus favor glyph characters. With package definition as below in the comment UTF-8 can be done in plain latex as well. I don't usually require special glyphs, I get them as a bonus author name spellings in citations hence I usually enable utx8 and friends just to make sure my document doesn't choke when it hits an accidental glyph here or there.
5
https://tex.stackexchange.com/users/137
489
334
https://tex.stackexchange.com/questions/487
9
I use Linux and have available to me the "compose" key, and thus can type characters like '°', 'ß', 'ï', 'į', 'ḯ', etc. Is it inherently "bad" to use the compose key to insert the characters, should I use LaTeX commands such as `\ss` instead of 'ß'? Does it even matter in the long run?
https://tex.stackexchange.com/users/142
Glyph insertion
false
I’m a firm believer that anything but Unicode is evil anyway. So inserting correct characters directly instead of relying on macros is *highly recommended* in my book. If nothing else, it improves the readability of the source code substantially. And we all know that readability is the most important metric of any source code.
5
https://tex.stackexchange.com/users/42
490
335
https://tex.stackexchange.com/questions/485
87
> > **Possible Duplicate:** > > [How to add a forced line break inside a table cell](https://tex.stackexchange.com/questions/2441/how-to-add-a-forced-line-break-inside-a-table-cell) > > > In a table I would like to have a line break in the text inside a cell. Is there an easy way to do so, or do I have to create a new line without borders? The same holds true for other situations such as breaking a line in a caption for instance.
https://tex.stackexchange.com/users/124
How to break a line in a table
false
Is this for a single cell, or an entire column of cells? If the later, try: ``` \documentclass{article} \begin{document} \begin{tabular}{lp{.2\textwidth}l} 42 & A paragraph of text & 42\\ 42 & Another paragraph & 42 \end{tabular} \end{document} ``` Even if it is for a single cell, I suspect that this is still the way to go.
15
https://tex.stackexchange.com/users/93
491
336
https://tex.stackexchange.com/questions/488
91
The blackboard bold font in the AMSFonts package only has capital letters. I sometimes wish to use a blackboard bold "1", for which I can use `\usepackage{bbold}`. But this changes the entire blackboard bold font, and I like the original AMSFonts versions of the capital letters better. Is there a simple way for me to get `\mathbb{1}` from one package and the blackboard bold capitals from another?
https://tex.stackexchange.com/users/206
Blackboard bold characters
true
This doesn't exactly answer your question (how to use `bbold` with AMS's black board bold characters). I believe that would require some TeX incantations. A cheaper work around is to use either the package [`bbm`](http://www.ctan.org/pkg/bbm-macros) or the package [`doublestroke`](https://www.ctan.org/pkg/doublestroke). The former defines the `\mathbbm` command and the latter uses the `\mathds` command, so they don't conflict with the AMS `\mathbb`. Also asthetically I prefer the `bbm` fonts over `bbold` since the latter is sans serif, which doesn't quite fit in right against the AMS serifed fonts.
57
https://tex.stackexchange.com/users/119
493
337
https://tex.stackexchange.com/questions/488
91
The blackboard bold font in the AMSFonts package only has capital letters. I sometimes wish to use a blackboard bold "1", for which I can use `\usepackage{bbold}`. But this changes the entire blackboard bold font, and I like the original AMSFonts versions of the capital letters better. Is there a simple way for me to get `\mathbb{1}` from one package and the blackboard bold capitals from another?
https://tex.stackexchange.com/users/206
Blackboard bold characters
false
You've already got a pretty good answer. Just in case you *really* wanted to use `amsmath` and `bbold`, the following TeX-hack seems to do the trick. ``` \usepackage{amsmath} \usepackage{amsfonts} \makeatletter \def\amsbb{\use@mathgroup \M@U \symAMSb} \makeatother \usepackage{bbold} \begin{document} $\mathbb{1}, \amsbb{X}$ \end{document} ```
18
https://tex.stackexchange.com/users/169
495
338
https://tex.stackexchange.com/questions/494
23
Sometimes it is convenient to refer to a group of equations by a letter and a number. For example: ``` 2+1 (A1) 2+4 (A2) x^4 (B3) x^e (B4) ``` Placing `\tag{A\theequation}\label{eqn:thisone}\stepcounter{equation}}` instead of just `\label{eqn:thisone}` works, but seems hacky (especially manually stepping the counter). Is there a better way?
https://tex.stackexchange.com/users/185
How to reference equations using letters and numbers
true
The `subequations` environment provided by the `amsmath` package trivially allows you to get equations grouped by number and differentiated by letter. For example, ``` \begin{subequations} \begin{align} 2+1 & \\ 2+4 & \end{align} \end{subequations} \begin{subequations} \begin{align} x^4 & \\ x^e & \end{align} \end{subequations} ``` will give the output ``` 2+1 (1a) 2+4 (1b) x^4 (2a) x^e (2b) ``` By redefining how the equation and subequation counters are displayed, you should also be able to switch the primary labeling to Alpha and the secondary to arabic if you specifically want `(A1)` and `(A2)` instead of `(1a)` and `(1b)`.
30
https://tex.stackexchange.com/users/32
497
339
https://tex.stackexchange.com/questions/499
12
I know that when writing a displayed equation, it's correct to write punctuation before the closing `\]` as follows: ``` This proves \[ x^2 = 3, \] and it follows that \[ x = \pm\sqrt{3}. \] ``` If I'm using a `cases` environment, where's the correct place for the period to end the sentence? ``` Absolute value is defined as \[ \lvert x \rvert = \begin{cases} x & \text{if $x \ge 0$} \\ -x & \text{if $x < 0$} \end{cases} \] ``` If I put it after the `cases` environment, it looks funny. If I leave it off completely, then it also looks bad. It looks okay to put it at the end of the second line (`$x < 0$.}`), but are there any better solutions?
https://tex.stackexchange.com/users/9
Proper punctuation after cases environment
true
You've pretty much enumerated all the sensible options in your question, so I don't know that there's anything else. What I've seen sometimes (IIRC) is to put a comma after each case, and then I guess the period could go at the end of the last one.
9
https://tex.stackexchange.com/users/125
501
341
https://tex.stackexchange.com/questions/64
151
A lot of people write makefiles that say something like ``` paper.pdf: paper.tex pdflatex paper bibtex paper pdflatex paper pdflatex paper ``` To handle re-running TeX to get new/changed references and so forth. Is there a better way to do this?
https://tex.stackexchange.com/users/60
Tools for automating document compilation
false
Like @crazymaik, I’ve set up a script that runs continually in the background so the file is automatically compiled whenever I save. The idea for that originally comes from [Paul Biggar](https://stackoverflow.com/questions/1240037/recommended-build-system-for-latex/1394702#1394702). Mine uses `latexmk` instead of `rubber` (however, I use `rubber-info` from inside Vim to parse the `log` file). This has the advantage of working out of the box with TeXLive. The script is a bit longer – I think the comments sufficiently explain why this is. I’ve posted the [**source as a gist**](http://gist.github.com/495725) on GitHub. ``` #!/bin/bash # Author: Konrad Rudolph # Original idea: Paul Biggar # # Usage: texit [--latex] target # # --latex: Use pdflatex instead of xelatex as the processor. Optional # target: The name of the target (i.e. the source file without trailing `.tex`) … ```
5
https://tex.stackexchange.com/users/42
502
342
https://tex.stackexchange.com/questions/503
740
I've heard that you should use `\[ ... \]` for displayed equations instead of `$$ ... $$`, but why is that? I'd assumed that it's so that you can more easily tell which are starting and which are ending delimiters, but if I always use a syntax-highlighting text editor, I can see that easily based on the color of the symbols. Is there any reason for this suggestion?
https://tex.stackexchange.com/users/9
Why is \[ ... \] preferable to $$ ... $$?
false
I suppose it could be useful if you share your files with someone else who doesn't have a syntax-highlighting text editor. Other than that, it probably doesn't matter much. Certainly if nobody else ever sees your LaTeX source files, I'd say write them however you want. This is neither here nor there, but personally I find neither of those as clear as `\begin{equation}...\end{equation}`.
16
https://tex.stackexchange.com/users/125
505
344
https://tex.stackexchange.com/questions/503
740
I've heard that you should use `\[ ... \]` for displayed equations instead of `$$ ... $$`, but why is that? I'd assumed that it's so that you can more easily tell which are starting and which are ending delimiters, but if I always use a syntax-highlighting text editor, I can see that easily based on the color of the symbols. Is there any reason for this suggestion?
https://tex.stackexchange.com/users/9
Why is \[ ... \] preferable to $$ ... $$?
false
[Edit: I should add the disclaimer that the following is based on just "I read it somewhere sometime ago", so I have no references to backup my claims.] As far as I know `$$ ... $$` is a TeX, amsTeX thing. LaTeX still supports it for one reason or another, but the "proper" one to use, as defined in the specifications, is `\[ ... \]`. All this just means that they are not promising that `$$` will always work. So it is technically possible (though unlikely in the near future), that compatibility with `$$` is removed from LaTeX and lots of your documents break. As to why one is in the specifications and not the other? I have no idea.
30
https://tex.stackexchange.com/users/119
507
346
https://tex.stackexchange.com/questions/503
740
I've heard that you should use `\[ ... \]` for displayed equations instead of `$$ ... $$`, but why is that? I'd assumed that it's so that you can more easily tell which are starting and which are ending delimiters, but if I always use a syntax-highlighting text editor, I can see that easily based on the color of the symbols. Is there any reason for this suggestion?
https://tex.stackexchange.com/users/9
Why is \[ ... \] preferable to $$ ... $$?
false
Spacing is wrong. It is a "deadly sin" according to l2tabu, section 1.6 on page 6: <http://www.ctan.org/tex-archive/info/l2tabu/english/>
197
https://tex.stackexchange.com/users/34
508
347
https://tex.stackexchange.com/questions/503
740
I've heard that you should use `\[ ... \]` for displayed equations instead of `$$ ... $$`, but why is that? I'd assumed that it's so that you can more easily tell which are starting and which are ending delimiters, but if I always use a syntax-highlighting text editor, I can see that easily based on the color of the symbols. Is there any reason for this suggestion?
https://tex.stackexchange.com/users/9
Why is \[ ... \] preferable to $$ ... $$?
false
`$$` is plain TeX and could have some side effects, also `fleqn` will not work anymore. Please have a look at [l2tabu](http://mirror.ctan.org/info/l2tabu/english/l2tabuen.pdf). In my opinion the best environment for equations is `gather` or `align`. If you use `equation` you sometimes get some strange spacings.
51
https://tex.stackexchange.com/users/201
509
348
https://tex.stackexchange.com/questions/429
92
I sometimes have to present on other people's equipment, such as machines running stripped down Linux distributions, presentation servers with a bare-bones PDF viewer running in a virtual machine, or a Windows box with a heavily locked-down Adobe Reader (e.g. with JavaScript disabled). So far I've tried to avoid doing anything fancy with `beamer`. But for some concepts, animations seem necessary. > > How can one create PDF presentations in LaTeX, preferably with `beamer`, which include animations that work on most PDF viewers? > > > Ideally, if the animations don't work then they should degrade gracefully. For instance, the first and last frame could still be shown. `Beamer` has `\animate` but this requires the PDF viewer to support showing several slides in succession, without manual intervention. [Jens Nöckel suggests using external movies](http://www.uoregon.edu/~noeckel/PDFmovie.html), which seems even less likely to work; this relies on a viewer being available for the movie format, and that the movie viewer can be called by the PDF viewer. Older documents suggest MetaPost or animated GIF files, which seem hacky (though I will consider them if no other alternatives exist). Please discuss only one main approach per answer.
https://tex.stackexchange.com/users/132
Animation in PDF presentations, without Adobe Reader?
false
The [`movie15`](http://www.ctan.org/tex-archive/help/Catalogue/entries/movie15.html) package allows you to set graphics or text, including the first frame of the movie, to display if the movie is inactive. This can be achieved with the `text` and `poster` options (taken directly from the documentation): ``` \includemovie[ text={\includegraphics[scale=2]{path/to/poster}} ]{}{}{path/to/movie} ``` will display the image specified by `path/to/poster`, scaled to twice its size, and ``` \includemovie[ poster, text={\phantom{\includegraphics[scale=2]{path/to/poster}}} ]{}{}{path/to/movie} ``` will display the first frame of the movie, and make it the size of the scaled `path/to/poster`. This obviously doesn't make the included movie playable in any more locations than it otherwise would be, but it *does* make it more elegant when playback is unavailable.
17
https://tex.stackexchange.com/users/32
511
349
https://tex.stackexchange.com/questions/220
69
I want to write my final thesis using LaTeX, what should I do in order to be able to do that through Eclipse on a Mac OS X? If any another good editor exists, feel free to write your opinion on why using this instead of something else.
https://tex.stackexchange.com/users/62
I want to start using LaTeX on Mac OS X. Where do I start?
false
There are more integrated environments for editing Latex documents, but I'm happy with a good general-purpose text editor + a good PDF viewer + some scripts. One nice thing is that I don't need to learn that many different tools; I can use the same text editor for Latex files, programming, etc. *TextMate* is fairly popular text editor for Mac OS X. It has a decent support for Latex, and it's easy to customise (e.g., you can define a keyboard shortcut that invokes a shell script that compiles your Latex document). *Preview* (part of Mac OS X) is a good tool for previewing PDF files that you produce with pdflatex. My typical workflow: * First, open the source code in your text editor and open the PDF file in Preview (you can make this a bit more automatic by using some scripts). Leave both windows open. * Edit the document in your text editor and hit the keyboard shortcut that compiles the document. Then press cmd+tab to switch to Preview. It will notice that the file has changed and it'll reload the document automatically, without losing the current location. In any case, download and install MacTex first to get started, as suggested in other answers. Among others, it'll provide all command-line tools such as "pdflatex" that you will need.
15
https://tex.stackexchange.com/users/100
512
350
https://tex.stackexchange.com/questions/510
393
Along the lines of [Why is \[ ... \] preferable to $$ ... $$?](https://tex.stackexchange.com/questions/503/why-are-and-preferable-to), what reasons are there (if any) to favor `\( ... \)` over `$ ... $`?
https://tex.stackexchange.com/users/206
Are \( and \) preferable to dollar signs for math mode?
true
`\( ... \)` is LaTeX syntax. `$ ... $` is TeX syntax. plainTeX only allows `$`. In LaTeX you can use both, but `\( ... \)` will give less obscure error messages when there is a mistake inside it. Both are shortcuts to start inline math environments.
281
https://tex.stackexchange.com/users/137
513
351
https://tex.stackexchange.com/questions/452
93
I often create pictures in tikz that I want to either send to someone, or include in an email. The problem with that is that there is a big white space around and and especially below my pictures. To get around this, I usually print screen my figure and crop it to get the size I want. Another solution is to use beamer and then scaling to make the figure as big as the slide size. Those two solutions, though, are not all that good. What I would really like is a way to get the pdf file to be just as big as my picture, as if it was cropped from start. Is there a package to do that?
https://tex.stackexchange.com/users/14
How can I create a pdf document exactly as big as my tikz picture?
false
The package **`standalone`** does just that. It is a new package (released this year, I think) which will produce a document exactly as big as your figure (and you can use this for text or other things as well). Here is how you would set up your document ``` \documentclass{standalone} \usepackage{tikz} %include other needed packages here \begin{document} \begin{tikzpicture} % include your tikz code here \end{tikzpicture} \end{document} ``` If you do that, then you will be able to compile this directly to get a .pdf document exactly as big as the figure, which can then be included in emails, word documents, or even as a picture in another .tex document using the `\includegraphics{}` command. The best thing about this is that it can also be included in a .tex document (e.g. `article`, `beamer`, etc.) as a .tex file using the `\input{}` command without having to change anything in the .tex document above. The main thing is to include the package standalone in your preamble (i.e. before `\begin{document}`) together with any packages you used in the above code, which in my example would be: ``` \usepackage{standalone} \usepackage{tikz} ``` and then where you want the picture to go put, for example: ``` \begin{figure}[!h] \input{mytikzfig.tex} \caption{ } \end{figure} ``` where mytikzfig.tex is the .tex document with your tikz picture using the standalone package. You can see this solution given in an answer to an StackOverflow [question](https://stackoverflow.com/questions/2701902/standalone-diagrams-with-tikz/2702045#2702045).
125
https://tex.stackexchange.com/users/14
514
352
https://tex.stackexchange.com/questions/516
124
I typically use ``` \textit{Some italicized text} ``` while some of my colleagues use ``` {\it Some other text} ``` Should I bother changing one or the other, or does it matter? Related: [*Is there any reason not to use \let to redefine a deprecated control sequence to the currently recommended one?*](https://tex.stackexchange.com/questions/304311/is-there-any-reason-not-to-use-let-to-redefine-a-deprecated-control-sequence-to)
https://tex.stackexchange.com/users/16
Does it matter if I use \textit or \it, \bfseries or \bf, etc
false
The `\it` syntax is inherited from LaTeX 2.09, and is regarded as supported 'for historical reasons only' in LaTeX2e. For bold, you should go for `\textbf` rather than `\bf`. For italic, you'd usually use `\emph` rather than `\textit` as it's semantic mark up and as it handles the italic correction automatically.
39
https://tex.stackexchange.com/users/73
517
353
https://tex.stackexchange.com/questions/451
218
I'm quite happy hacking TeX macros and cobbling together bits and pieces from different style files to suit my own ends, but I have a suspicion that my resulting hacks are not quite as elegant as they could be. In particular, with regard to when to expand and when not to expand macros. A common occurrence for me is defining a meta-command that defines a whole slew of sub-commands. So the *names* of the sub-commands will contain parameters depending on the parameter passed to the meta-command, and the *contents* of the sub-commands will also vary a little depending on what the meta-command got. Often it won't be a direct substitution but rather a "if `#1` is `a` do `\this` else do `\that`", but `\this` and `\that` need expansion at define time, not call time. Here's a very simple example just involving direct substitution: ``` \def\cohtheory#1{ \expandafter\newcommand\expandafter{\csname #1func\endcsname}[1][*]{% \MakeUppercase{#1}^{##1}} } ``` Sometimes I worry that my commands are more complicated than they need be. For example, if I want to call a command with two arguments and the arguments expand before the command, here's how I've coded it: ``` \expandafter \expandafter \expandafter \command\expandafter \expandafter \expandafter {\expandafter \argone \expandafter }\expandafter {\argtwo} ``` So I'm looking for guidance on when and how to control expansion in defining macros. I strongly suspect that such cannot be given in a simple answer, so to make this a focussed question, let me phrase it thus: > > Where's a good reference for writing TeX macros that includes advice on how to best deal with how to handle expansions? > > > Of course, if anyone can formulate some advice in short answer, I'd be only to happy to read it. (Note: this was partially motivated by juannavarroperez's adaptation of my answer to [this question](https://tex.stackexchange.com/questions/48/how-can-i-specify-a-long-list-of-math-operators) where over 20 `\expandafter`s got condensed down to just 1!)
https://tex.stackexchange.com/users/86
When to use \edef, \noexpand, and \expandafter?
true
Expansion is a complicated area of TeX programming. I'll try to explain the key primitives involved first, then try to come up with some examples. The `\expandafter` primitive expands the token after the next one. So ``` \expandafter\def\csname an-awkward-name\endcsname ``` will expand `\csname` before `\def`. So after one expansion the above turns into ``` \def\an-awkward-name ``` which will then do its thing. Life becomes more complex when you want to step further ahead, and it soon becomes very hard to track what is going on. The `\edef`> primitive does a full expansion of what is given as its argument (in contrast to `\def`, which simply stores the input). So ``` \def\examplea{more stuff} \edef\exampleb{Some stuff \csname examplea\endcsname} ``` will expand the `\csname name\endcsname` to `\examplea`, then expand that to leave a final definition of `\exampleb` as 'Some stuff more stuff'. Now, `\noexpand` comes in by preventing `\edef` from doing an expansion of the next token. So if I modify my above example to read ``` \def\examplea{more stuff} \edef\exampleb{Some stuff \expandafter\noexpand\csname examplea\endcsname} ``` then what will happen is that the `\edef` will execute the `\expandafter`, which will turn the above effectively into ``` \def\examplea{more stuff} \edef\exampleb{Some stuff \noexpand\examplea} ``` Now the `\noexpand` will operate (disappearing in the process), leaving the definition of `\exampleb` as 'Some stuff \examplea'. We can use this ability to cut down on `\expandafter` use, but there are a couple of other things to know. First, e-TeX includes an additional primitive `\unexpanded`, which will prevent expansion of multiple tokens. Secondly, there are various special cases where you don't need quite so many `\expandafter` statements. A classic example is from within `\csname`, as this will do expansion anyway. So you'll see things like ``` \csname name\expandafter\endcsname\token ``` which will expand `\token` before `\name`. Back to your example. In the first one, there isn't much to do: as the entire point is to have a dynamic name (`#1`), doing an `\edef` at point-of-definition doesn't really make sense. The closest one can get is something like ``` \edef\cohtheory{% \noexpand\newcommand\expandafter\noexpand\csname foofunc\endcsname[1][*]{% \noexpand\MakeUppercase{foo}^{##1}}% } ``` What will happen here is that `\newcommand` and `\MakeUppercase` will be protected from expansion, and the `\csname` will only expand once. (Tokens which don't have an expansion don't need protection, which is why things like '[1]' are simply included as is.) Of course, this is something of a 'toy' as all it does is create a fixed `\foofunc`. For your second example, you could instead do this: ``` \begingroup \edef\temp{% \endgroup \noexpand\command {\unexpanded\expandafter{\argone}}% {\unexpanded\expandafter{\argtwo}}% } \temp ``` I'm using a couple of extra ideas here. First, the group is used so that `\temp` is not altered anywhere other than where I'm using it. The `\endgroup` primitive will do nothing inside the `\edef`, and so will still be there to close the group when `\temp` is used. Secondly, `\unexpanded` works like a toks, and so will respect the `\expandafter` after it but before the `{`. This cuts down on an unnecessary `\expandafter`. There are more wrinkles to this, and often there are several equally-efficient and clear methods. You are best off posting specific examples, and seeking advice on how they might be achieved.
227
https://tex.stackexchange.com/users/73
519
355
https://tex.stackexchange.com/questions/516
124
I typically use ``` \textit{Some italicized text} ``` while some of my colleagues use ``` {\it Some other text} ``` Should I bother changing one or the other, or does it matter? Related: [*Is there any reason not to use \let to redefine a deprecated control sequence to the currently recommended one?*](https://tex.stackexchange.com/questions/304311/is-there-any-reason-not-to-use-let-to-redefine-a-deprecated-control-sequence-to)
https://tex.stackexchange.com/users/16
Does it matter if I use \textit or \it, \bfseries or \bf, etc
true
From [l2tabu](http://www.ctan.org/tex-archive/info/l2tabu/english/): > > Why not use obsolete commands? Obsolete commands do not support LaTeX2e's new font > selection scheme, or NFSS. `{\bf foo}`, for example, resets all font attributes which had been > set earlier before it prints *foo* in bold face. This is why you cannot simply define a bold-italics style by `{\it \bf Test}` only. (This definition will produce: **Test**.) On the other hand, the new commands `\textbf{\textit{Test}}` will behave as expected producing: ***Test***. > > > Apart from that, with the former commands there is no ‘italic correction’, cf. for instance > halfhearted (`{\it half}hearted`) to halfhearted (`\textit{half}hearted`). > > >
122
https://tex.stackexchange.com/users/83
520
356
https://tex.stackexchange.com/questions/363
25
It seems that a common operation needed when defining new commands is to scan over a list of arguments (separated e.g. by a comma, but maybe by something else) and do something with each argument in the list, find the last one, or whatever. For example to write commands that look like `\Command{a,b,c}` or `\Command{c.d.e}` and do something with each `a`, `b`, and `c`. See e.g. questions on [defining a list of operators](https://tex.stackexchange.com/questions/48/how-can-i-specify-a-long-list-of-math-operators) and [ignoring even numbered inputs](https://tex.stackexchange.com/questions/71/need-macro-to-ignore-specific-even-numbered-inputs). Some solutions have been posted there, but what would be the best idiom to perform such kind of operations? LaTeX's `\@for` looks very nice, but is it possible to use it to scan anything other than comma-separated lists?
https://tex.stackexchange.com/users/169
What is the best way to scan over a list of somethings?
false
I was hoping someone to post a better/nicer solution, but so far this seems to be the best one I've seen. ``` \def\do@scan#1:{% \ifx#1\relax \let\next\relax \else \DoSomethingWith{#1}\let\next\do@scan \fi\next } \newcommand{\scanlist}[1]{\do@scan#1:\relax:} ``` Of course instead of `:` one can use `,` or any other sensible separator.
11
https://tex.stackexchange.com/users/169
521
357
https://tex.stackexchange.com/questions/510
393
Along the lines of [Why is \[ ... \] preferable to $$ ... $$?](https://tex.stackexchange.com/questions/503/why-are-and-preferable-to), what reasons are there (if any) to favor `\( ... \)` over `$ ... $`?
https://tex.stackexchange.com/users/206
Are \( and \) preferable to dollar signs for math mode?
false
There are some good 'meta' reasons for using `\( ... \)` in some circumstances. Environments such as Fancy Verbatim and alltt will allow `\(` and `\)` to act as math mode, but $ will be interpreted as a literal. Another convenience is that some editors have an easier time with pair matching `\( ... \)` than `$`.
33
https://tex.stackexchange.com/users/207
523
358
https://tex.stackexchange.com/questions/515
8
I'm looking for either a template (or some pointers to generate one) for using to give talks. What I'm looking for is something that will allow a column for the 'full' talk, and then a second for notes, such that I can mostly work from the notes, but move back to the relevant point in the richer text should I lose my place. At the moment I fudge it with margin notes, and wide right margins. **Edit** This is for me to give a talk from, not something to display. I'm after something that will allow me to use shorter notes to talk from, but still give me the fall back of a fuller text. I guess something like: ``` I want to talk today about the benefits of using version control software, such as git, \righthandnote{Benefits of VCS and LaTeX} with talks, and why pure text based systems such as LaTeX are a natural fit, allowing for easy text based diffs, patching, etc. The actual files are also smaller, and and mean that entire repositories can be made available fairly easily. I'm now going to filler filler filler.... ``` The paragraph would be then on the left (1/2-2/3 width), and the \righthandnote would take the rest of the width, and be matched to the paragraph to allow me to see where I should move to, if I've lost the flow of what I was saying. Does that clarify what I'm after? It's to help me move away from full talks to notes, but with a fallback position.
https://tex.stackexchange.com/users/22
Template for a talk with a column to hold abridged content
true
I think I see what you are after. Try this, and season lengths to taste: ``` \documentclass[oneside]{article} \usepackage[left=2.54cm,right=7cm]{geometry} \setlength{\marginparwidth}{4cm} \setlength{\marginparsep}{1cm} \usepackage{lipsum} \begin{document} Some text, else the margin par will be after the lipsum text completes.\marginpar{Point the first.}\lipsum[42] Text.\marginpar{Point the second.} \lipsum[43] \end{document} ``` **EDIT:** Only after posting did I see that this is pretty much what the OP wished to improve upon. Deleted and then restored in light of exchange in the comments.
3
https://tex.stackexchange.com/users/93
529
360
https://tex.stackexchange.com/questions/503
740
I've heard that you should use `\[ ... \]` for displayed equations instead of `$$ ... $$`, but why is that? I'd assumed that it's so that you can more easily tell which are starting and which are ending delimiters, but if I always use a syntax-highlighting text editor, I can see that easily based on the color of the symbols. Is there any reason for this suggestion?
https://tex.stackexchange.com/users/9
Why is \[ ... \] preferable to $$ ... $$?
false
1. While my memory prevents me from naming the guilty software, I have seen LaTeX syntax highlighting become confused by the `$$ ... $$` construct when it parsed the `\[ ... \]` construct correctly. 2. Agreed, worry about some partially broken editor isn't a high priority. But, I have found that I am more than partially broken. If I've made a mess of a file, the left-hand and right-hand information in the `\[` way has, on occasion, helped me figure out just what I was on about more easily than the symmetric `$$` would have.
24
https://tex.stackexchange.com/users/93
530
361
https://tex.stackexchange.com/questions/531
166
There are several types of [quotation marks](http://en.wikipedia.org/wiki/Quotation_mark_glyphs) in the English language (and in other languages there are even more). There are also several ways in LaTeX to represent these. I have seen editors, that are capable of directly entering **“** and **”**. And I have also seen things like this **`''**. So, what is the best way to do English quotation marks in LaTeX?
https://tex.stackexchange.com/users/46
What is the best way to use quotation mark glyphs?
false
I have always simply used two backticks, ````, to create an opening quotation mark, and two apostrophes, `''`, to create a closing one. In fact, many editors will automatically keep track of which one you need next and enter it if you type the 'regular' quotation mark, `"`.
6
https://tex.stackexchange.com/users/32
532
362
https://tex.stackexchange.com/questions/531
166
There are several types of [quotation marks](http://en.wikipedia.org/wiki/Quotation_mark_glyphs) in the English language (and in other languages there are even more). There are also several ways in LaTeX to represent these. I have seen editors, that are capable of directly entering **“** and **”**. And I have also seen things like this **`''**. So, what is the best way to do English quotation marks in LaTeX?
https://tex.stackexchange.com/users/46
What is the best way to use quotation mark glyphs?
false
TeX/LaTeX display the real quotation marks by default: ``` and ```` are converted to opening quotation marks; `'` and `''` are closing quotation marks. You'll generally always see the curved quotes in the output, in the default font. You should always quote like ``` ``this'' ``` and not like `''this''` or `"this"`, because that appears like ”this” (closing quotation marks on both sides), and is very annoying to readers. (If you type the double quote character in Emacs, it automatically guesses whether you meant to insert ```` or `''`; other editors probably do too.) You can also directly enter the curved quote characters if you like, if you're using an environment that supports Unicode input: either `\usepackage[utf8]{inputenc}`, or XeTeX/LuaTeX. See the question on [glyph insertion](https://tex.stackexchange.com/questions/487/glyph-insertion).
37
https://tex.stackexchange.com/users/48
533
363
https://tex.stackexchange.com/questions/534
418
Often assignments (or even papers) have a word count limit. That is not a big deal when using Word, but I don't know how to do that using LaTeX. My solution has been so far to compile the document and then do a rough word count of my pdf file, sometimes even copying the contents of the pdf file and pasting in Word to get a mostly correct Word count. Is there any tool (maybe even an online tool), package, script or software to do that directly from my .tex document and still get the right word count (i.e., ignore commands, equations, etc)?
https://tex.stackexchange.com/users/14
Is there any way to do a correct word count of a LaTeX document?
false
The first one to come to mind is `detex` [which strips a tex file](http://www.cs.purdue.edu/homes/trinkle/detex/) of commands. You will then have to pass it through `wc` or some other word counting software. A search on the internet also brought up two items on Sourceforge: [word counter 1](http://lwc.sourceforge.net/) and [word counter 2](http://sourceforge.net/projects/texwc/). Disclaimer: out of the three, I've only used `detex` before. It worked reasonably well, but I was working with an English essay and it had no equations, so I don't know how it plays with math mode stuff. (Currently I don't have it installed so I can't check.)
13
https://tex.stackexchange.com/users/119
535
364
https://tex.stackexchange.com/questions/534
418
Often assignments (or even papers) have a word count limit. That is not a big deal when using Word, but I don't know how to do that using LaTeX. My solution has been so far to compile the document and then do a rough word count of my pdf file, sometimes even copying the contents of the pdf file and pasting in Word to get a mostly correct Word count. Is there any tool (maybe even an online tool), package, script or software to do that directly from my .tex document and still get the right word count (i.e., ignore commands, equations, etc)?
https://tex.stackexchange.com/users/14
Is there any way to do a correct word count of a LaTeX document?
true
This is [in the TeX FAQ](http://texfaq.org/FAQ-wordcount). The solutions suggested are: * [detex](https://www.ctan.org/pkg/detex) filename (which tries to strip LaTeX commands), then use any word count tool. (e.g. `wc`) * [latexcount.pl](https://www.ctan.org/pkg/latexcount), a Perl script for word count * [texcount](https://app.uio.no/ifi/texcount/intro.html), another script even has an [online interface](https://app.uio.no/ifi/texcount/online.php) * [wordcount](http://ctan.org/pkg/wordcount), which has a script that runs LaTeX with some settings, then counts word indications in the log file.
227
https://tex.stackexchange.com/users/48
536
365
https://tex.stackexchange.com/questions/537
15
I'd like to use the [gentium](http://en.wikipedia.org/wiki/Gentium) font in a LaTeX document, and the instructions I found [at this site](http://tclab.kaist.ac.kr/ipe/pdftex_3.html) make it look rather difficult. Is there a simple package that is now available that would allow me to use the gentium font more easily?
https://tex.stackexchange.com/users/136
Is there a simple way to use the gentium font in latex?
false
The [`gentium`](http://ctan.org/pkg/gentium) package found on CTAN may help get you started with using Gentium in pdfLaTeX.
3
https://tex.stackexchange.com/users/80
539
366
https://tex.stackexchange.com/questions/448
75
I have a simple command which I use to write set comprehensions so that the braces automatically resize with respect to size of the enclosed arguments, e.g. ``` \usepackage{amsmath} \newcommand{\set}[1]{\left\lbrace #1\right\rbrace} \begin{equation*} \set{x \in X \mid x > \frac{1}{2}} \end{equation*} % Produces something like: { x : X | x > 1/2 } ``` However, the `\mid` vertical bar wont resize like the braces `{ .. }` do. How can I get the `\mid` to resize as well?
https://tex.stackexchange.com/users/169
How to automatically resize the vertical bar in a set comprehension?
false
I think the best idea is to use the braket package, which provides markup for these sorts of constructions, for which the brackets and "pipes" expand where necessary.
17
https://tex.stackexchange.com/users/179
540
367
https://tex.stackexchange.com/questions/299
88
I often format path names with \texttt which can be very long. Usually Tex will not break this text. The line will just create a hbox overflow. It looks like this: ``` ................ ...C:\documents and settings ................ ................ ................ ................ ................ ................ ................ ``` How do I get Tex to create a line break?
https://tex.stackexchange.com/users/168
How to get long \texttt sections to break
true
If you are using the default LaTeX fonts (or a small number of others), you can enable hyphenation within `\texttt` using the `hyphenat` package: ``` \documentclass[twocolumn]{article} \usepackage{lipsum} \usepackage[htt]{hyphenat} \begin{document} \texttt{\lipsum[1]} \end{document} ``` Note that this still won't do a great job of formatting arbitrary strings because it will be relying on the hyphenation patterns in use. If your problem is about typesetting paths specifically, another option (arguably better) is to load the `url` package and use its `\path{...}` command: ``` \documentclass[twocolumn]{article} \usepackage{url} \begin{document} Here is a long path: \path{/usr/local/texlive/2010/texmf-dist/tex/latex/biblatex/biblatex.sty} \end{document} ``` This can have limitations with non-ASCII characters, however. If you get really stuck, you can force a line to end using `\newline` (aka `\\`) or `\linebreak`. These differ in important ways: `\newline` will cause the paragraph to end the line abruptly at that point, whereas `\linebreak` will still attempt to fill the line completely for justification purposes. This is illustrated in the following example: ``` \documentclass[twocolumn]{article} \begin{document} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum grav$\bullet$\newline ida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. \bigskip Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum grav$\bullet$\linebreak ida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. \end{document} ```
80
https://tex.stackexchange.com/users/179
543
368
https://tex.stackexchange.com/questions/526
6
In the following minimal document ``` \documentclass{article} \usepackage{fourier,eulervm} \begin{document} $1 < 2$ \end{document} ``` the output is missing the `<` symbol. On the other hand, if I load the two font packages in the opposite order ``` \documentclass{article} \usepackage{eulervm,fourier} \begin{document} $1 < 2$ \end{document} ``` the output is as it should. **Why?** I could not find this documented anywhere. **Added** A less minimal example would also show that whereas in the latter case the `<` does appear, the math fonts being used are not the Euler fonts. Hence I do think that the two are incompatible. I'm starting to think that perhaps incompatibility between different font packages is the norm and not the exception?
https://tex.stackexchange.com/users/18
Is there an incompatibility between `eulervm` and `fourier` packages?
true
Both packages mess around with the maths font loading, so you'd generally expect problems to arise loading them together. What are the combinations of fonts you're trying to use?
1
https://tex.stackexchange.com/users/179
544
369
https://tex.stackexchange.com/questions/534
418
Often assignments (or even papers) have a word count limit. That is not a big deal when using Word, but I don't know how to do that using LaTeX. My solution has been so far to compile the document and then do a rough word count of my pdf file, sometimes even copying the contents of the pdf file and pasting in Word to get a mostly correct Word count. Is there any tool (maybe even an online tool), package, script or software to do that directly from my .tex document and still get the right word count (i.e., ignore commands, equations, etc)?
https://tex.stackexchange.com/users/14
Is there any way to do a correct word count of a LaTeX document?
false
The last time I had to worry about this, I compiled my LaTeX document to PDF and ran it through `pdftotext`.
10
https://tex.stackexchange.com/users/112
546
370
https://tex.stackexchange.com/questions/204
33
The most obvious way to speed up LaTeX processing is to split a large and complex document into smaller pieces. For example, Makefiles, `\beginpgfgraphicnamed`/`\endpgfgraphicnamed` when using TiKZ, and splitting a large file into separate chapters are all helpful in splitting a large job into smaller, hopefully independent pieces. But sometimes this is not enough -- many packages do complicated things under the hood, leading to slow document processing. > > Are there any tools to help isolate > the culprits? > > > It would be great to also have the profiling tool provide suggestions on ways to speed things up.
https://tex.stackexchange.com/users/132
Are there LaTeX performance profiling tools?
false
pdfTeX (which is the default nowadays, even if you're generating DVI) has functions for doing timing tests. Use `\pdfresettime` to start it off and do ‘something’ with `\pdfelapsedtime` when you're done: ``` \documentclass{article} \pdfresettimer \usepackage{expl3,tikz} \showthe\pdfelapsedtime \begin{document} \end{document} ``` The value of `\pdfelapsedtime` is the number of seconds elapsed multiplied by 65536.
21
https://tex.stackexchange.com/users/179
547
371
https://tex.stackexchange.com/questions/538
126
..and I don't mean finding out why it doesn't compile, I mean serious debugging: breakpoints, figuring out value of variables at a given moment during run/compile, stepping, examining a stack (is there one?), etc. All the things that we take for granted when debugging a "real" programming language. Since TeX is "turing-complete", I would like to be able to really see what is going on internally. I'm guessing that a GUI interface for the debugger would be too much to ask, but if it exists, I'd love to hear about it.
https://tex.stackexchange.com/users/117
How to best debug LaTeX?
true
The trace package will load everything that TeX is doing during a particular piece of the run. The problem with that is that you can get a *lot* of information very rapidly. Selectively using trace can give a lot of insight into problems. At a lower level, there are various tracing settings that TeX provides (and which the trace package makes use of). It's possible to set just some of these values to get TeX to log certain parts of what it is doing, for example just assignments. Normally, the trace package is enough. For examining variables, the `\wlog` macro is the easiest way, although you can simply put`\show` or `\showthe` in the right places if it's a single thing you want to know. One thing I do a lot (especially with infinite loops) is simply insert an undefined control sequence into the code (I use `\MARK`). This will stop TeX with an error, and I can therefore see where I'm up to. Not elegant, but it works for me. The way TeX writes to the log can mean that you get an infinite loop without all of the data you want being added to the log. Strategic placement of `\@@end` (the TeX primitive `\end` renamed by LaTeX) can be used in these circumstances to force the run to end. I'm not sure how a graphical debugger would work, but then I only really program in TeX, so I'm used to the approach I've outlined. I've never come across one.
67
https://tex.stackexchange.com/users/73
548
372
https://tex.stackexchange.com/questions/522
77
It seems to be generally well accepted that the correct way to typeset a value with units is to separate the number from the units by a space, and write the units in an upright font. For example, ``` One hellameter is \( 1.0\times10^{27} \) m. ``` The symbol for 'micro-' is the Greek letter mu, but if you compile ``` At the telecom wavelength of \( 1.55\ \mu \)m ... ``` then the spacing will be correct and the 'm' will be upright, but the 'mu' won't be. > > How do you produce an upright lowercase mu? More generally, how do you make any Greek letter appear upright? > > >
https://tex.stackexchange.com/users/32
Best way to typeset micrometers?
true
The [`siunitx`](http://ctan.org/pkg/siunitx) package does this 'properly' without the user needing to worry ``` \documentclass{article} \usepackage{siunitx} \begin{document} \SI{1.55}{\micro\metre} \end{document} ``` (Note: I am the author of `siunitx`, which is the successor to both `SIunits` and `SIstyle`.) Of course, for the more general question about upright Greek letters then the [`upgreek`](http://ctan.org/pkg/upgreek) package is indeed the best plan.
119
https://tex.stackexchange.com/users/73
549
373
https://tex.stackexchange.com/questions/534
418
Often assignments (or even papers) have a word count limit. That is not a big deal when using Word, but I don't know how to do that using LaTeX. My solution has been so far to compile the document and then do a rough word count of my pdf file, sometimes even copying the contents of the pdf file and pasting in Word to get a mostly correct Word count. Is there any tool (maybe even an online tool), package, script or software to do that directly from my .tex document and still get the right word count (i.e., ignore commands, equations, etc)?
https://tex.stackexchange.com/users/14
Is there any way to do a correct word count of a LaTeX document?
false
Way back in the depths of time, I scribbled my own perl script to do this. My reason for doing this myself was that sometimes I wanted to count words in command arguments and sometimes not, so I built in a selection routine. Plus I figured that a bit of maths was worth a word so added that in. As the script is really simple, I'm copying it here (which automatically makes it some sort of free-to-use, I guess!). I don't think that I've used it for years, though - it's been a long time since "number of words" mattered to me at all. ``` #!/usr/bin/perl -w @ARGV and $ARGV[0] =~ /^-+h(elp)?$/ && die "Usage:\t$0 files\n\t$0 < files\n\t$0\n"; my $count = 0; my $first = ""; my $tex = 0; while ($first =~ /^\s*$/) { $first = <>; } if ($first =~ /^\\(input|section|setlength|documentstyle|chapter|documentclass|relax|contentsline|indexentry|begin|glossaryentry)/) { $tex = sub { $r = $_[0]; $m = $_[1]; $r =~ s/\\(emph|textbf|textit|texttt|em)\{//g; $r =~ s/\\(sub)*section\*?\{[^\}]*\}//; $r =~ s/\\title\{[^\}]*\}//; $r =~ s/\\\(.*?\\\)/maths/g; $r =~ s/\\\(.*?$/maths/; $r =~ s/^.*?\\\)/maths/; $r =~ s/\\\[.*?\\\]/maths/g; $r =~ s/.*?\\\]// and $m = 0; $m and $r = ""; $r =~ s/\\\[.*?$// and $m = 1; $r =~ s/\\\S*//g; $r =~ s/%.*//; return ($r,$m) }; } else { $tex = sub { return ($_[0],0) }; @split = split(" ", $first); $count += $#split + 1; } while ($s = <>) { ($t,$n) = &$tex($s,$n); @split = split(" ", $t); $count += $#split + 1; } print "Number of words: $count\n"; ```
15
https://tex.stackexchange.com/users/86
550
374
https://tex.stackexchange.com/questions/510
393
Along the lines of [Why is \[ ... \] preferable to $$ ... $$?](https://tex.stackexchange.com/questions/503/why-are-and-preferable-to), what reasons are there (if any) to favor `\( ... \)` over `$ ... $`?
https://tex.stackexchange.com/users/206
Are \( and \) preferable to dollar signs for math mode?
false
Anyone who's ever tried writing a simple perl (or whatever) script to quickly parse a LaTeX document and do something in maths mode but not in text mode will agree that `\( .. \)` is the only way to go! Trying to get the pattern matching right against `$a^2 + b^2$$c^2 + d^2$` is a nightmare. (Before anyone asks, yes I have, and it's called [mathgrep](https://github.com/loopspace/mathgrep). The pain and agony of writing that convinced me more than anything else of the value of making *everything* a configurable macro so it can be easily changed later.) --- Another reason: looking at the code, `\(` and `\)` actually checks that TeX is in the right mode before starting. So `hello \(world \(can\) we\) have some tea?` will produce an error, whereas `hello $world $can$ we$ have some tea?` will not.
85
https://tex.stackexchange.com/users/86
551
375
https://tex.stackexchange.com/questions/326
100
Aside from CTAN, what are good resources/repositories for Latex templates? In particular, I'm looking for some pretty Thesis templates (I'm familiar with classicthesis)
https://tex.stackexchange.com/users/171
LaTeX templates for writing a thesis
false
For the spanish speaking community, I maintain a [thesis format](http://navarroj.com/latex/ezthesis.html) which can be easily adapted to the requirements of different universities. The format itself can be used to write thesis documents in any language, but it has a `spanish` option which takes care of loading a suitable set of packages and options to get the entire format consistently translated into spanish.
8
https://tex.stackexchange.com/users/169
554
377
https://tex.stackexchange.com/questions/499
12
I know that when writing a displayed equation, it's correct to write punctuation before the closing `\]` as follows: ``` This proves \[ x^2 = 3, \] and it follows that \[ x = \pm\sqrt{3}. \] ``` If I'm using a `cases` environment, where's the correct place for the period to end the sentence? ``` Absolute value is defined as \[ \lvert x \rvert = \begin{cases} x & \text{if $x \ge 0$} \\ -x & \text{if $x < 0$} \end{cases} \] ``` If I put it after the `cases` environment, it looks funny. If I leave it off completely, then it also looks bad. It looks okay to put it at the end of the second line (`$x < 0$.}`), but are there any better solutions?
https://tex.stackexchange.com/users/9
Proper punctuation after cases environment
false
This is what I would do: ``` Absolute value is defined as: % \[ \left\lvert x \right\rvert \coloneqq \begin{cases} x & \text{if } x \ge 0 \\ -x & \text{if } x < 0 \end{cases} \] ``` Thus: a colon introducing the maths, and no punctuation afterwards. My reasoning is in my answer to ... err ... I thought we had a question on punctuation after maths here? What happened to it? Nonetheless, it was asked over on MathOverflow so I can cite it as [this answer](https://mathoverflow.net/questions/6675/periods-and-commas-in-mathematical-writing/6680#6680) instead. My basic point is that anyone reading more than a few symbols will need to stop "reading English" and switch to "reading maths" and that this mental switch has the same effect as a full stop. Of course, you can punctuate *internally* to the maths since punctuation still has meaning, but it should be read as being internal to the mathematics and not refer to the external text. Thus David's suggestion in his last sentence (at time of writing) makes sense to me. Those that find the absence of a full stop abhorrent (there are some, as can be seen by looking at the comments to my answer on MO) can adjust the preceding remark to make it a full sentence, or to make it clearer that it isn't. Thus: ``` Absolute value is defined as in the following formula. % \[ \left\lvert x \right\rvert \coloneqq \begin{cases} x & \text{if } x \ge 0 \\ -x & \text{if } x < 0 \end{cases} \] ``` (You may notice that I've also introduced a couple of other stylistic "improvements"!)
3
https://tex.stackexchange.com/users/86
555
378
https://tex.stackexchange.com/questions/553
461
I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there. Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document. As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them. This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But *please* explain why in the comments.) Also see our community poll question: [“I have used the following packages / classes”](https://tex.meta.stackexchange.com/a/1574/ "TeX Community Polls")
https://tex.stackexchange.com/users/86
What packages do people load by default in LaTeX?
false
The family of [**AMS math packages**](http://ctan.org/pkg/amsmath). At least `amsmath` and `amssymb`. Also `amsthm` if I need theorems and the class I'm using doesn't already define them. Particularly for writing equations, the AMS packages define a rich set of environments to group and align formulas in many different and useful ways. I also like that it encourages the use of *semantic* commands (e.g. the `cases` environment) over syntactic commands (e.g. a `\left\{` followed by an array). Its documentation can be found running `texdoc amsldoc` on a command line.
227
https://tex.stackexchange.com/users/169
556
379
https://tex.stackexchange.com/questions/557
84
Can someone please explain in a clear and concise way how am I supposed to enter the names of authors in a BibTeX file? I have entries with something like ``` @article{someid, author = {Juan A. Navarro P\'erez, Ra\'ul de la Garza and Andr\'es Espinoza}, ... ``` but somehow the output seems kind of wrong!
https://tex.stackexchange.com/users/169
How should I type author names in a bib file?
false
Two things to remember. First, each name must be separated by 'and', as this is what BibTeX looks for to separate them out. (It has to be 'and' in English, I'm afraid.) Second, BibTeX can understand different parts of a name if you give it as 'Surname, Firstname', *i.e.* with the surname first. So for your example I would have ``` @article{someid, author = {Navarro P\'erez, Juan A. and de la Garza, Ra\'ul and Espinoza, Andr\'es}, ... ``` Notice that BibTeX can detect a 'von' part (which includes the 'de la' here), if it is in the surname section but starts with a lower case letter.
31
https://tex.stackexchange.com/users/73
559
380
https://tex.stackexchange.com/questions/558
62
The `\show` command is extremely useful for figuring out what's going on with a particular macro. Similarly, using `\the` can tell me the value of a counter. I'd like to know if there's something similar for lengths and skips. At the moment, I end up doing something like `\rule{1pt}{\unknownlength}` but that's a fairly crude method.
https://tex.stackexchange.com/users/86
Is there a \show for lengths?
true
To show registers (which include dimensions, skips and counts) you want `\showthe`.
63
https://tex.stackexchange.com/users/73
560
381
https://tex.stackexchange.com/questions/553
461
I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there. Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document. As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them. This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But *please* explain why in the comments.) Also see our community poll question: [“I have used the following packages / classes”](https://tex.meta.stackexchange.com/a/1574/ "TeX Community Polls")
https://tex.stackexchange.com/users/86
What packages do people load by default in LaTeX?
false
*Edited by doncherry: Removed packages mentioned in separate answers.* I use TeX for a variety of documents: research papers, lectures/tutorials, presentations, miscellaneous documents (some in Japanese). Each of these different uses, requires different packages. Depending on my mood, I like to use different fonts. A particular nice combination for mathematics papers is ``` \usepackage[T1]{fontenc} % better treatment of accented words \usepackage{eulervm} % Zapf's Euler fonts \usepackage{tgpagella} % TeXGyre Pagella fonts ``` For references,... ``` \usepackage[notref,notcite]{showkeys} % useful when writing the paper \usepackage[noadjust]{cite} % [1,2,3,4,5] --> [1-5] useful in hep-th! \usepackage{hyperref} % hyperlinks, metadata,... ``` For lecture notes (again mathematical) I often like to section the document into "lectures" instead of sections and to add some colours to the titles,.... To do this it's useful to use ``` \usepackage{fancyhdr} % fancy headers \usepackage{titlesec} % to change how sections are displayed \usepackage{color} % to be able to do this in colour ``` and I also like to decorate using some silly glyphs, for which these fonts are useful: ``` \usepackage{wasysym,marvosym,pifont} ``` and also box equations and other things ``` \usepackage{fancybox,shadow} ``` I like adding pictures, whence ``` \usepackage[rflt]{floatflt} \usepackage{graphicx,subfigure,epic,eepic} ``` You may want to hide the answers to tutorial exercises, problems,... and this can be achieved with ``` \usepackage{version,ifthen} % ifthen allows controlling exclusions ``` I use XeLaTeX for documents containing Japanese, which works better with ``` \usepackage{fontspec} % makes it very easy to select fonts in XeLaTeX \usepackage{xunicode} % accents ```
12
https://tex.stackexchange.com/users/18
561
382
https://tex.stackexchange.com/questions/558
62
The `\show` command is extremely useful for figuring out what's going on with a particular macro. Similarly, using `\the` can tell me the value of a counter. I'd like to know if there's something similar for lengths and skips. At the moment, I end up doing something like `\rule{1pt}{\unknownlength}` but that's a fairly crude method.
https://tex.stackexchange.com/users/86
Is there a \show for lengths?
false
Somewhat more friendly than `\showthe`, which returns lengths in pt, is the [`printlen`](http://ctan.org/pkg/printlen) package. It gives `\printlength{...}`, which will typeset (so it's actually more like `\the` I guess) the length in the units specified by `\uselengthunit`. E.g., from the documentation: ``` The \verb|\textwidth| is \printlength{\textwidth} which is also \uselengthunit{in}\printlength{\textwidth} and \uselengthunit{mm}\printlength{\textwidth}. ```
62
https://tex.stackexchange.com/users/179
562
383
https://tex.stackexchange.com/questions/487
9
I use Linux and have available to me the "compose" key, and thus can type characters like '°', 'ß', 'ï', 'į', 'ḯ', etc. Is it inherently "bad" to use the compose key to insert the characters, should I use LaTeX commands such as `\ss` instead of 'ß'? Does it even matter in the long run?
https://tex.stackexchange.com/users/142
Glyph insertion
false
Disclaimer: This is not really an answer, but a bit long for a comment. What would worry me about using unicode characters directly is that the command might expand to more than just the character. This is particularly the case in maths mode. As an example, ∘ is, as a unicode character, simply a letter. However, mathematically it's an operator. Is the unicode support smart enough to know that in maths mode, *f∘g* should have a little extra space in it? (I want to add that I *don't* think that it should be that smart. For the same reason that we have `\langle` for `<`, then ∘ should be simply the character with the default spacing and `\circ` should be the operator. Borrowing from MathML, ∘ should expand to `<mi>&#x02218;<mi>` whereas `\circ` to `<mo>&#x02218;<mo>`. So the behaviour that I would *like* is that é can be used for `\'e` if they are *syntactically* the same.)
1
https://tex.stackexchange.com/users/86
563
384
https://tex.stackexchange.com/questions/479
92
The standard font used for `\mathcal` does not include any lowercase characters. The *Comprehensive LaTeX Symbols List* suggests redefining `\mathcal` to use Zapf Chancery. However I do not particularly like that font. For example the uppercase "I" is very hard do distinguish from the non-mathcal "I". Are there any good alternatives?
https://tex.stackexchange.com/users/83
Lowercase \mathcal
true
I'm a bit surprised that Will Robertson hasn't dropped by and mentioned [the STIX fonts](http://www.stixfonts.org/) as these have the lowercase calligraphic (and lowercase blackboard bold) glyphs. There doesn't yet seem to be a simple LaTeX package available mapping all the glyphs to particular commands, though. The [stix package on CTAN](http://www.ctan.org/tex-archive/fonts/stix/) at present seems to be just a copy of the fonts themselves (reorganised into correct texmf tree layout) but no style files as yet. I recall reading on the STIX website that LaTeX-related stuff was intended, but given how long it took the fonts to be released, I'm not holding my breath! --- As of 2018, this is now quite easy using luatex or xetex: ``` \documentclass{article} %\url{https://tex.stackexchange.com/q/479/86} \usepackage{amsmath} \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} % Any of the following work, and probably many more %\setmathfont{TeX Gyre Pagella Math} %\setmathfont{TeX Gyre Termes Math} %\setmathfont{STIX} \setmathfont{Asana Math} \begin{document} \begin{gather*} {ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ {abcdefghijklmnopqrstuvwxyz} \\ \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \mathcal{abcdefghijklmnopqrstuvwxyz} \\ \mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \mathscr{abcdefghijklmnopqrstuvwxyz} \\ \mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \\ \mathbb{abcdefghijklmnopqrstuvwxyz} \\ \end{gather*} \end{document} ``` As pointed out in the comments, you need to use `\mathscr` (or `\let\mathcal=\mathscr`).
32
https://tex.stackexchange.com/users/86
564
385
https://tex.stackexchange.com/questions/565
70
I'm a total newbie to LaTeX and I get very annoyed about this. Every time I write an equation, the text following the equation has some indentation but I don't want it to be there! ``` Look at the following formula \begin{equation} K_BT_k=Dexp\left\lbrace -\frac{1}{2N(E_F)|J|}\right\rbrace \end{equation} where $Dexp$ is a ... ``` The line starting with "where ..." is indented and looks horrible. Some people told me about `\noindent` but do I really have to write this command after every single equation?
https://tex.stackexchange.com/users/169
How can I get rid of indentation after an equation?
true
Remove the blank lines, either by actually removing them or adding '%'s: ``` Look at the following formula % \begin{equation} K_BT_k=Dexp\left\lbrace -\frac{1}{2N(E_F)|J|}\right\rbrace \end{equation} % where $Dexp$ is a long sentence guaranteed to take us over the end of this line and well into the next. ``` Simple, but subtle! **Explanation:** (added in edit) The indentation is created by the fact that, as far as TeX is concerned, the word 'where' begins a new paragraph and you've decided that new paragraphs should be indented (or rather, you haven't decided that new paragraphs shouldn't be indented). TeX detects this by the presence of the blank line (well, actually by the double newline, but what it considers a double newline is a little complicated so "blank line" is best for now). So to tell TeX that there isn't a new paragraph there, I simply remove the blank line. As I like to keep my source code with lots of visual spaces between things, I do this by putting the comment marker '%' on the blank line. Deleting it (as in Caramdir's answer) would be equivalent as far as TeX is concerned. In fact (as Caramdir pointed out in his answer), both the blank line before and after should be removed. As originally written, there are *three* paragraphs where there should (according to the wording) be just one. Although the fact that the equation starts a new paragraph is less obvious, it still can have an effect. Note that although it may have almost the same effect, using the `\noindent` command here would be wrong. Using `\noindent` says "This is a new paragraph, but I don't want it indented." whereas putting in the `%` says "This isn't a new paragraph.".
103
https://tex.stackexchange.com/users/86
566
386
https://tex.stackexchange.com/questions/565
70
I'm a total newbie to LaTeX and I get very annoyed about this. Every time I write an equation, the text following the equation has some indentation but I don't want it to be there! ``` Look at the following formula \begin{equation} K_BT_k=Dexp\left\lbrace -\frac{1}{2N(E_F)|J|}\right\rbrace \end{equation} where $Dexp$ is a ... ``` The line starting with "where ..." is indented and looks horrible. Some people told me about `\noindent` but do I really have to write this command after every single equation?
https://tex.stackexchange.com/users/169
How can I get rid of indentation after an equation?
false
Just remove the empty lines before and after the equation.
28
https://tex.stackexchange.com/users/83
567
387
https://tex.stackexchange.com/questions/553
461
I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there. Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document. As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them. This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But *please* explain why in the comments.) Also see our community poll question: [“I have used the following packages / classes”](https://tex.meta.stackexchange.com/a/1574/ "TeX Community Polls")
https://tex.stackexchange.com/users/86
What packages do people load by default in LaTeX?
false
Nothing surprising here: I use [natbib](http://www.ctan.org/tex-archive/help/Catalogue/entries/natbib.html), [hyperref](http://www.ctan.org/tex-archive/help/Catalogue/entries/hyperref.html) and [hypernat](http://ftp.uoi.gr/pub/tex/help/Catalogue/entries/hypernat.html) together. **Natbib** for referencing. **Hyperref** adds bookmarks for sections and lists and turns references and urls into links. **Hypernat** allows natbib and hyperref to work together. -- **Note (added 2015/02/11)**: `natbib` and `hyperref` have been working together just fine for at least ten years. `hypernat` is no longer needed for any TeX distribution with a vintage more recent than ca 2002.
28
https://tex.stackexchange.com/users/14
568
388
https://tex.stackexchange.com/questions/553
461
I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there. Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document. As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them. This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But *please* explain why in the comments.) Also see our community poll question: [“I have used the following packages / classes”](https://tex.meta.stackexchange.com/a/1574/ "TeX Community Polls")
https://tex.stackexchange.com/users/86
What packages do people load by default in LaTeX?
false
Another package I use is [`float`](http://www.ctan.org/pkg/float). It allows for the placement `H` for floats, which is somewhat equivalent to `h!`, but a bit stronger, making sure the figure or table goes exactly where I want it to be.
23
https://tex.stackexchange.com/users/14
569
389
https://tex.stackexchange.com/questions/553
461
I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there. Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document. As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them. This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But *please* explain why in the comments.) Also see our community poll question: [“I have used the following packages / classes”](https://tex.meta.stackexchange.com/a/1574/ "TeX Community Polls")
https://tex.stackexchange.com/users/86
What packages do people load by default in LaTeX?
false
``` \usepackage[parfill]{parskip} ``` I much prefer no indentation and space between paragraphs, so the [parskip](http://ctan.org/pkg/parskip) package is a must for me!
34
https://tex.stackexchange.com/users/14
570
390
https://tex.stackexchange.com/questions/553
461
I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there. Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document. As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them. This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But *please* explain why in the comments.) Also see our community poll question: [“I have used the following packages / classes”](https://tex.meta.stackexchange.com/a/1574/ "TeX Community Polls")
https://tex.stackexchange.com/users/86
What packages do people load by default in LaTeX?
false
I use [`hyperref`](http://tug.org/applications/hyperref/) for setting PDF metadata and to create links, both within the document and for clickable URLs. Even Elsevier has used [`urlbst`](http://nxg.me.uk/dist/urlbst/) to update their bibliography style to support URLs and DOIs; hyperref does the actual work of rendering `url =` and `doi =` BibTeX fields into clickable PDF links.
201
https://tex.stackexchange.com/users/132
571
391
https://tex.stackexchange.com/questions/553
461
I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there. Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document. As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them. This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But *please* explain why in the comments.) Also see our community poll question: [“I have used the following packages / classes”](https://tex.meta.stackexchange.com/a/1574/ "TeX Community Polls")
https://tex.stackexchange.com/users/86
What packages do people load by default in LaTeX?
false
The 'rich' document classes such as [memoir](http://www.ctan.org/tex-archive/help/Catalogue/entries/memoir.html) and [KOMA-Script](http://www.ctan.org/tex-archive/help/Catalogue/entries/koma-script.html) include a lot of functionality that is not available from the LaTeX kernel. So the packages you load when using the article class might be rather different from those when using memoir. A lot of packages that get used by many people with the base classes (things like float, caption, tocbibind and titlesec) are covered by the richer document classes.
84
https://tex.stackexchange.com/users/73
573
392
https://tex.stackexchange.com/questions/557
84
Can someone please explain in a clear and concise way how am I supposed to enter the names of authors in a BibTeX file? I have entries with something like ``` @article{someid, author = {Juan A. Navarro P\'erez, Ra\'ul de la Garza and Andr\'es Espinoza}, ... ``` but somehow the output seems kind of wrong!
https://tex.stackexchange.com/users/169
How should I type author names in a bib file?
true
I think things are just a *bit* more complicated than in @Joseph's answer. (Though in laying them out, I may violate the desire for a "concise" answer.) My go to reference for details of the BibTeX format is Norman Walsh's [page](http://nwalsh.com/tex/texhelp/bibtx-4.html) which self describes as: > > This help entry contains the same information as Appendix B of the LaTeX manual. > > > In BibTeX's world view, a name has four components: 1) First name (which includes any middle names provided) 2) von ("de la" or "van der" like components) 3) Last (Surname without the von part) 4) Jr (Things like "Jr.", "III", etc) The [page](http://nwalsh.com/tex/texhelp/bibtx-4.html) explains: > > you may type a name in one of three forms: > > > "First von Last" "von Last, First" "von Last, Jr, First" > > > You may almost always use the first form; you shouldn't if either there's a Jr part or the Last part has multiple tokens but there's no von part. > > > You can enclose components in braces to overcome BibTeX's identification of named components. Say, implausibly enough, that toni morrison were to wed someone named Jones and thus adopt the name 'toni morrison Jones'. You could render this '{t}oni {{m}orrison Jones}' with the braces around the 't' and 'm' to prevent a bibliographic style from altering the capitalization and the braces around 'morrison Jones' to force BibTeX to identify the entire string as the Last component, rather than treating `morrison' as the von part. Finally, you can use braces if 'and' or a coma are part of the name. In the example on the [page](http://nwalsh.com/tex/texhelp/bibtx-4.html): > > "{Barnes and Noble, Inc.}" > > >
85
https://tex.stackexchange.com/users/93
574
393
https://tex.stackexchange.com/questions/577
85
What resources (online or otherwise) exist that give good advice on *best practices* for TeX, etc.? I'm looking particularly for things that assume you already know TeX or LaTeX, and aim to help you achieve better results, with rationales explained. Resources with some specific focus are welcome. I'll start a list with two suggestions of my own so you can see what I mean. Somewhat to my surprise I haven't found this question asked here already. (Please point me to it if I'm wrong!) Note that what I'm asking is somewhat different from [What are good learning resources for a LaTeX beginner?](https://tex.stackexchange.com/questions/11/what-is-the-best-book-to-start-learning-latex) and [What are other good resources on-line for information about TeX, LaTeX and friends?](https://tex.stackexchange.com/questions/162/what-are-other-good-respources-on-line-for-information-about-tex-latex-and-frien), although there's lots of room for overlapping answers.
https://tex.stackexchange.com/users/206
Best practices references
false
The AMS's [Short Math Guide for LaTeX](ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf), besides being a good summary of math support (both native to (La)TeX and in the AMS's packages), includes a lot of good advice about typesetting math with LaTeX.
18
https://tex.stackexchange.com/users/206
578
394
https://tex.stackexchange.com/questions/577
85
What resources (online or otherwise) exist that give good advice on *best practices* for TeX, etc.? I'm looking particularly for things that assume you already know TeX or LaTeX, and aim to help you achieve better results, with rationales explained. Resources with some specific focus are welcome. I'll start a list with two suggestions of my own so you can see what I mean. Somewhat to my surprise I haven't found this question asked here already. (Please point me to it if I'm wrong!) Note that what I'm asking is somewhat different from [What are good learning resources for a LaTeX beginner?](https://tex.stackexchange.com/questions/11/what-is-the-best-book-to-start-learning-latex) and [What are other good resources on-line for information about TeX, LaTeX and friends?](https://tex.stackexchange.com/questions/162/what-are-other-good-respources-on-line-for-information-about-tex-latex-and-frien), although there's lots of room for overlapping answers.
https://tex.stackexchange.com/users/206
Best practices references
false
The Beamer User Guide spends a lot of time on best practices both on using the [Beamer package](http://www.ctan.org/tex-archive/help/Catalogue/entries/beamer.html) specifically, and more generally on writing presentations. (Personally I find its tone somewhat off-puttingly preachy at times, but the advice is good.)
15
https://tex.stackexchange.com/users/206
580
395
https://tex.stackexchange.com/questions/577
85
What resources (online or otherwise) exist that give good advice on *best practices* for TeX, etc.? I'm looking particularly for things that assume you already know TeX or LaTeX, and aim to help you achieve better results, with rationales explained. Resources with some specific focus are welcome. I'll start a list with two suggestions of my own so you can see what I mean. Somewhat to my surprise I haven't found this question asked here already. (Please point me to it if I'm wrong!) Note that what I'm asking is somewhat different from [What are good learning resources for a LaTeX beginner?](https://tex.stackexchange.com/questions/11/what-is-the-best-book-to-start-learning-latex) and [What are other good resources on-line for information about TeX, LaTeX and friends?](https://tex.stackexchange.com/questions/162/what-are-other-good-respources-on-line-for-information-about-tex-latex-and-frien), although there's lots of room for overlapping answers.
https://tex.stackexchange.com/users/206
Best practices references
false
A. J. Hildebrand has an extensive list of very useful ["best practices" LaTeX tips](http://www.math.uiuc.edu/~hildebr/tex/tips.html).
13
https://tex.stackexchange.com/users/48
581
396
https://tex.stackexchange.com/questions/577
85
What resources (online or otherwise) exist that give good advice on *best practices* for TeX, etc.? I'm looking particularly for things that assume you already know TeX or LaTeX, and aim to help you achieve better results, with rationales explained. Resources with some specific focus are welcome. I'll start a list with two suggestions of my own so you can see what I mean. Somewhat to my surprise I haven't found this question asked here already. (Please point me to it if I'm wrong!) Note that what I'm asking is somewhat different from [What are good learning resources for a LaTeX beginner?](https://tex.stackexchange.com/questions/11/what-is-the-best-book-to-start-learning-latex) and [What are other good resources on-line for information about TeX, LaTeX and friends?](https://tex.stackexchange.com/questions/162/what-are-other-good-respources-on-line-for-information-about-tex-latex-and-frien), although there's lots of room for overlapping answers.
https://tex.stackexchange.com/users/206
Best practices references
false
I'll stick in the [PGF package](http://www.ctan.org/tex-archive/help/Catalogue/entries/pgf.html) manual as well as it contains a fair amount of advice about how to prepare graphics and what makes a good graphic. (NB One thing I find particularly good about advice is that even if I disagree with it, it makes me think about why I disagree with it and that makes me better at whatever it is.)
6
https://tex.stackexchange.com/users/86
582
397
https://tex.stackexchange.com/questions/11
383
Which book (free or otherwise) was the most useful to you when you started learning LaTeX? I am frequently asked this question by friends who want to learn LaTeX, and I recommend the book which got me started, [The Not So Short Introduction to LaTeX2ε](http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf), but I feel that there might be better options around. Also see [LaTeX Introductions in languages other than English](https://tex.stackexchange.com/questions/84384/latex-introductions-in-languages-other-than-english).
https://tex.stackexchange.com/users/14
What are good learning resources for a LaTeX beginner?
false
I used [The Not So Short Introduction to LaTeX2ε](http://tobi.oetiker.ch/lshort/lshort.pdf) and still go back to it. (I think that all the answers should be in the answers so that it's easier for people to compare them; also, what I said is true: it is the one that I use and continually go back to.)
115
https://tex.stackexchange.com/users/86
583
398
https://tex.stackexchange.com/questions/575
2
I hope WinEdt6 is recognised as one of the best LaTeX's friends. I write my LaTeX stuff, and when a para is considered done, I want to `\done{the completed para text}` so that it differ from what I type next in say ink and background color. When the next para is done I do \done{another completed para text} and so on. I define \done as "doing nothing" command `\newcommand{\done}{}` as I do not want any changes to my compiled document - only to ease my writing by visually separating the "done" from "yet to be done". How do I do that with WinEdt 6, perhaps using switches? Any ideas?
https://tex.stackexchange.com/users/158
In WinEdt 6, how do I highlight a block of just typed text with no effect on the compiled document?
false
Use comments, any decent editor will highlight it in different color and not affect rendering. Example: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus arcu magna, malesuada ultrices tristique iaculis, fermentum dapibus quam. Aliquam erat volutpat. Fusce at urna odio, eu sollicitudin nisi. Sed non purus eu libero semper iaculis. %% %% TODO insert dates about imsum [from this website](http://www.lipsum.com/) %% Aenean pretium libero ac est aliquam ac consectetur nibh pellentesque. Morbi sit amet metus id enim pharetra interdum. Integer vel malesuada ante. Donec pellentesque erat eget neque imperdiet id posuere dolor aliquet. Duis quis accumsan nulla. Nullam eget velit egestas neque hendrerit ullamcorper. Donec et purus dolor, a bibendum neque. Vivamus lacinia pulvinar quam, nec blandit eros molestie eget. Fusce porttitor tortor nec tortor interdum. %% %% Finished %%
0
https://tex.stackexchange.com/users/137
584
399
https://tex.stackexchange.com/questions/577
85
What resources (online or otherwise) exist that give good advice on *best practices* for TeX, etc.? I'm looking particularly for things that assume you already know TeX or LaTeX, and aim to help you achieve better results, with rationales explained. Resources with some specific focus are welcome. I'll start a list with two suggestions of my own so you can see what I mean. Somewhat to my surprise I haven't found this question asked here already. (Please point me to it if I'm wrong!) Note that what I'm asking is somewhat different from [What are good learning resources for a LaTeX beginner?](https://tex.stackexchange.com/questions/11/what-is-the-best-book-to-start-learning-latex) and [What are other good resources on-line for information about TeX, LaTeX and friends?](https://tex.stackexchange.com/questions/162/what-are-other-good-respources-on-line-for-information-about-tex-latex-and-frien), although there's lots of room for overlapping answers.
https://tex.stackexchange.com/users/206
Best practices references
true
The [Essential Guide to LaTeX2ε Usage (l2tabu)](http://www.ctan.org/tex-archive/info/l2tabu/english/) explains some of the most common mistakes in LaTeX usage.
46
https://tex.stackexchange.com/users/83
585
400
https://tex.stackexchange.com/questions/553
461
I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there. Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document. As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them. This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But *please* explain why in the comments.) Also see our community poll question: [“I have used the following packages / classes”](https://tex.meta.stackexchange.com/a/1574/ "TeX Community Polls")
https://tex.stackexchange.com/users/86
What packages do people load by default in LaTeX?
false
I almost always load [**`microtype`**](http://www.ctan.org/pkg/microtype). It plays with ever-so-slightly shrinking and stretching of the fonts and with the extent to which text protrudes into the margins in a way that yields results that look better, that have fewer instances of hyphenation, and fewer overfull hboxes. It doesn't work with `latex`, you have to use `pdflatex` instead. It also works with `lualatex` and (protrusion only) with `xelatex`.
280
https://tex.stackexchange.com/users/93
586
401
https://tex.stackexchange.com/questions/220
69
I want to write my final thesis using LaTeX, what should I do in order to be able to do that through Eclipse on a Mac OS X? If any another good editor exists, feel free to write your opinion on why using this instead of something else.
https://tex.stackexchange.com/users/62
I want to start using LaTeX on Mac OS X. Where do I start?
false
If you like Eclipse, you can get the [TeXlipse](http://texlipse.sourceforge.net/) package, which adds LaTeX handling features to the IDE including: * Syntax highlighting * Document outline * Code folding * Templates * Build support, also partial building * Annotations for errors (while editing) * Content assist (completion of commands and references) * Easy navigation with F3 * Outline of the current file and the full project * Spell checking * Menu with common LaTeX math symbols * BibTeX editor and BibTeX-support * Line wrapping * Table editor * Support for several platforms (Windows, Linux, OS X) I'd vote for a more lightweight text editor like Vim or Emacs, (Or their Mac-ified GUI equivalents listed above), or TextMate (Although I've never found the charm it seems to hold for others). But, lightweight vs. sumo is a matter of personal preference (And the size of your RAM). Once again, MacTeX is the package you want to install LaTeX. After that, the editor you use is a matter of personal preference.
5
https://tex.stackexchange.com/users/186
587
402
https://tex.stackexchange.com/questions/553
461
I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there. Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document. As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them. This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But *please* explain why in the comments.) Also see our community poll question: [“I have used the following packages / classes”](https://tex.meta.stackexchange.com/a/1574/ "TeX Community Polls")
https://tex.stackexchange.com/users/86
What packages do people load by default in LaTeX?
false
One package that’s *really* general purpose is [**`nag`**](http://www.ctan.org/pkg/nag): It doesn’t *do* anything, per se, it just warns when you accidentally use deprecated LaTeX constructs from l2tabu ([English](http://texdoc.net/pkg/l2tabuen) / [French](http://texdoc.net/texmf-dist/doc/latex/l2tabu-french/l2tabufr.pdf) / [German](http://texdoc.net/pkg/l2tabu) / [Italian](http://texdoc.net/texmf-dist/doc/latex/l2tabu-italian/l2tabuit.pdf) / [Spanish](http://texdoc.net/texmf-dist/doc/latex/l2tabu-spanish/l2tabues.pdf) documentation). From the documentation: > > Old habits die hard. All the same, there are commands, classes and packages which are outdated and superseded. nag provides routines to warn the user about the use of those. As an example, we provide an extension that detects many of the “sins” described in l2tabu. > > > Therefore, I now always have the following in my header (*before* the `\documentclass`, thanks qbi): ``` \RequirePackage[l2tabu, orthodox]{nag} ``` It’s a bit like having `use strict;` in Perl: a useful best practice.
144
https://tex.stackexchange.com/users/42
589
403
https://tex.stackexchange.com/questions/534
418
Often assignments (or even papers) have a word count limit. That is not a big deal when using Word, but I don't know how to do that using LaTeX. My solution has been so far to compile the document and then do a rough word count of my pdf file, sometimes even copying the contents of the pdf file and pasting in Word to get a mostly correct Word count. Is there any tool (maybe even an online tool), package, script or software to do that directly from my .tex document and still get the right word count (i.e., ignore commands, equations, etc)?
https://tex.stackexchange.com/users/14
Is there any way to do a correct word count of a LaTeX document?
false
Here’s an excerpt from my `.vimrc` that gives me a comfortable word count in Vim: ``` function! WC() let filename = expand("%") let cmd = "detex " . filename . " | wc -w | tr -d '[:space:]'" let result = system(cmd) echo result . " words" endfunction command WC call WC() ``` Now I can invoke `:WC` in command mode to have the word count echoed in the status line.
41
https://tex.stackexchange.com/users/42
590
404
https://tex.stackexchange.com/questions/588
136
Sometimes the margins need to be changed for a particular page, paragraph, or other section of text. For example, if I'm writing a letter and want the left margin to be almost at the right side of the page for the four lines of my address, or if I am combining prose with poetry and want the poems to be indented relative to the rest of the work. What is the best way to change both left and right margins on the fly?
https://tex.stackexchange.com/users/32
How can I change the margins for only part of the text?
false
It might not answer the question directly, but: There is a `letter` class: ``` \documentclass{letter} ``` for writing letters. And for verse there is a package called...wait for it...verse: ``` \usepackage{verse} ``` As I said, it doesn't answer the specific question, but it might solve the two applications you want the solution for.
4
https://tex.stackexchange.com/users/117
592
405
https://tex.stackexchange.com/questions/591
126
In `\documentclass{article}`, the `\maketitle` command results in a lot of wasted vertical space. Is there any way for me to remove it? In other words, I'd like the author to appear directly below the title, and the date directly below the author.
https://tex.stackexchange.com/users/68
Removing vertical space inside \maketitle
true
You could alter the relevant documentclass definition wherein the `\maketitle` command is defined. But, don't do that. Your document will then compile differently for you than for others. Try something like this: ``` \documentclass{article} \author{Some random fellow\vspace{-2ex}% Toggle commenting out the command } \date{A long time ago} \title{A comprehensive treatise on everything\vspace{-2ex}% to see the effect } \begin{document} \maketitle \end{document} ```
109
https://tex.stackexchange.com/users/93
593
406
https://tex.stackexchange.com/questions/588
136
Sometimes the margins need to be changed for a particular page, paragraph, or other section of text. For example, if I'm writing a letter and want the left margin to be almost at the right side of the page for the four lines of my address, or if I am combining prose with poetry and want the poems to be indented relative to the rest of the work. What is the best way to change both left and right margins on the fly?
https://tex.stackexchange.com/users/32
How can I change the margins for only part of the text?
true
There are several packages available on CTAN to do this. [`changepage`](http://www.ctan.org/pkg/changepage) looks promising but you can find other alternatives by searching for "margins" or "changepage" on [ctan search](http://www.ctan.org/search). With the `changepage` package, you can use the `adjustwidth` environment as follows: ``` \begin{adjustwidth}{left amount}{right amount} \lipsum[2] \end{adjustwidth} ``` For example, to remove 100pt from the margin on both sides, you would use ``` \begin{adjustwidth}{100pt}{100pt} ```
93
https://tex.stackexchange.com/users/125
594
407
https://tex.stackexchange.com/questions/595
617
To make Latin-letter variables bold I can use e.g. `\mathbf{a}`, but while putting Greek letters or symbols such as `\nabla` inside `\mathbf` doesn't cause any errors or warnings, it also doesn't do anything else. **What is the best way to make bold math symbols, in particular Greek letters and `\nabla`?**
https://tex.stackexchange.com/users/32
How can I get bold math symbols?
true
The [AMS Short Math Guide](http://mirrors.ctan.org/info/short-math-guide/short-math-guide.pdf) recommends the `\boldsymbol` and `\pmb` commands (and suggests that you use the [`bm`](http://www.ctan.org/pkg/bm) package for the former to get a more powerful version than provided by [`amsmath`](http://www.ctan.org/pkg/amsmath)).
526
https://tex.stackexchange.com/users/206
596
408
https://tex.stackexchange.com/questions/205
124
What packages do you use and recommend for creating graphics in your LaTeX documents? As this is a community wiki post, please add your package to the accepted answer (or add a comment, and someone with >100 rep will add it to the CW answer), and include a brief description of what differentiates it from others and how it can be used (GUI drawing tool which generates code, type in raw text, or generates image for inclusion in document). We'll eventually sort these answers under headings.
https://tex.stackexchange.com/users/136
What graphics packages are there for creating graphics in LaTeX documents?
false
I've compiled this list. I don't have experience with most of these, but, if you do, **please** add more descriptive text to your package. If it does not appear, again, **please** add it. If you don't have the rep to edit, post it in a comment and @ messgage myself or the last editor. Also, if you feel that a certain element should not be in the list, remove it and leave a note in your edit explaining why it was removed. The big ones: **#1** [PGF/Ti*k*Z](http://www.texample.net/tikz/examples/). The standard. As Dima said, it's "powerful, flexible, easy to use, and stunning". Ti*k*Z provides a high-level user interface. PGF provides lower-level macros. **#2** [PStricks](http://tug.org/PSTricks/main.cgi). Probably the second most used package. **#3** [The default packages](http://tug.ctan.org/tex-archive/macros/latex/required/graphics/). More used than the others, but not by reason of being more powerful. These are mostly useful for including external images (e.g. `graphicx`) or combined with other packages (e.g. `xcolor` is used by PGF/Ti*k*Z). Other graphics packages and programmes typically included in TeX distributions include: * [pgfplots](http://pgfplots.sourceforge.net/) a package for creating 2D and 3D plots of mathematical functions and numerical data, using the PGF graphics framework. Supports but does not need external tools and addresses a wide range of data visualizations with high quality. * [Xy-pic](http://www.tug.org/applications/Xy-pic/Xy-pic.html) - Best suited to graphs and diagrams, but capabilities for other formats. * [ePiX](http://mathcs.holycross.edu/~ahwang/current/ePiX.html) - Best for mathematical figures, creates PSTricks, tikz, or eepic macros. * [MetaPost](http://www.tug.org/metapost.html) - Similar to MetaFont, outputs PostScript files. Used by Knuth. Allows direct inclusion in a LaTeX file via the [emp](http://www.ctan.org/tex-archive/macros/latex/contrib/emp/), [gmp](http://www.ctan.org/pkg/gmp) and [mpgraphics](http://www.ctan.org/pkg/mpgraphics) package. MetaPost is now integrated in LuaTeX via the mplib library. Using LuaTeX, you can include your metapost figures directly in the TeX/LaTeX file with the [luamplib](http://tug.ctan.org/tex-archive/macros/luatex/generic/luamplib/) package, without using any external software. * [MetaFun](http://wiki.contextgarden.net/MetaFun) - An extension to MetaPost. * [Mfpic](http://www.ctan.org/pkg/mfpic) - A set of (La)TeX macros providing an interface to MetaPost (or METAFONT). Independent GUI wrappers and tools which create images suitable for inclusion in LaTeX documents include: * [LaTeXPiX](http://home.tiscali.nl/nickvanbeurden/latexpix.htm) - Windows GUI, exports PGF LaTeX code * [TPX](http://tpx.sourceforge.net/) - Another Windows GUI, more flexible outputs than LaTeXPiX * [Xfig](http://xfig.org/userman/) - X-Window drawing tool, saves in its own .fig file, but outputs many formats (Including PS). * [Asymptote](http://asymptote.sourceforge.net/) - A vector graphics language. Can embed LaTeX within the image. Outputs graphics for your document, not code, although code may be compiled as part of document compilation, with shell escape enabled. It can generate both 2D and 3D figures. 3D figures can be included in a PDF file in the PRC format which allows them to be manipulated when viewed in Adobe Reader. * [Inkscape](http://inkscape.org/) - A very powerful and well-supported SVG editor. Can be used to export Ti*k*Z code. * [Ipe](http://ipe7.sf.net/) - A powerful vector graphics editor, with several snapping modes that make it especially suitable for variety of technical illustrations. Saves in its own .ipe file format, but outputs pdf and eps for inclusion in TeX documents. Uses LaTeX to typeset text, both labels and larger paragraphs. Supports layers and views, which make it possible to "build" illustrations incrementally in a presentation. * [Knitr](https://yihui.name/knitr/)/[Sweave](http://www.stat.uni-muenchen.de/~leisch/Sweave/) - Tools that allow you to include [R](http://www.r-project.org/) code directly into your LaTeX file. Sweave is the older utility and is part of base utils package in R. Knitr is a package that reimplements and extend the basic ideas in Sweave. They do much more than just generate graphics; they make inclusion of [R generated graphics](http://addictedtor.free.fr/graphiques/) into a LaTeX document very easy. * [KtikZ,QtikZ](http://www.hackenberger.at/blog/ktikz-editor-for-the-tikz-language) - A PGF/Tikz real-time compiler for GNU/Linux, based on Qt and designed to integrate into KDE it has a new version for Windows, but I haven't tested it yet). It can speed up the drawing time while at the same time allowing to code directly in Ti*k*Z code. It has a template option which allows to define user commands in an easy way as well as a menu with many common (and not so common) Ti*k*Z constructs. * [GeoGebra](http://www.geogebra.org) - Award-winning free interactive geometry tool. As such it is also a vector graphics editor and a graph plotting software. Supports exporting to PSTricks, Ti*k*Z and Asymptote in addition to more traditional image formats. Available for major desktop and mobile platforms.
121
https://tex.stackexchange.com/users/186
597
409
https://tex.stackexchange.com/questions/591
126
In `\documentclass{article}`, the `\maketitle` command results in a lot of wasted vertical space. Is there any way for me to remove it? In other words, I'd like the author to appear directly below the title, and the date directly below the author.
https://tex.stackexchange.com/users/68
Removing vertical space inside \maketitle
false
vanden says: > > You could alter the relevant documentclass definition wherein the \maketitle command is defined. But, don't do that. > > > I completely agree with the second sentence. However, there's an alternative that gives you a little more control whilst ensuring that your document compiles the same wherever it is sent: copy the relevant section from the `article.cls` file into the preamble of your article and make the relevant changes there. Three things to note: 1. There are some `@`s in the definition, so you will need to enclose the definition with `\makeatletter` before and `\makeatother` afterwards. 2. The definition starts `\newcommand\maketitle`. As `\maketitle` will already be a command, you need to change the `\newcommand` to `\renewcommand`. 3. Make sure you get the right one. There are two definitions of `\maketitle` in `article.cls`, depending on whether you send the option `titlepage` to the class or not. I don't recommend this to a beginner, but to someone wanting to learn a little more about how things work, it's a reasonable way to peek under the bonnet [translation: hood].
21
https://tex.stackexchange.com/users/86
598
410
https://tex.stackexchange.com/questions/553
461
I'm getting the impression from reading the answers written by some of the real experts here that there are quite a few little packages that just tweak LaTeX2e's default behaviour a little to make it more sensible here and there. Rather than try to pick these up one by one as I read answers to questions (and thus risk missing them), I thought I'd ask up front what LaTeX2e packages people load by default in (almost) every document. As this is a "big list" question, I'm making it CW. I don't know if there are standard rules across all SE/SO sites for such questions, but on MathOverflow the rule is generally: one thing (in this case, package) per answer. I guess that if a couple of packages really do go together then it would be fine to group them. This is perhaps a little subjective and a little close to the line, so I'll not be offended if it gets closed or voted down! (But *please* explain why in the comments.) Also see our community poll question: [“I have used the following packages / classes”](https://tex.meta.stackexchange.com/a/1574/ "TeX Community Polls")
https://tex.stackexchange.com/users/86
What packages do people load by default in LaTeX?
false
*Edited by doncherry: Removed packages mentioned in separate answers.* ~~The complete header~~ Part of my header for most of my documents looks as follows: ``` \documentclass[ngerman,draft,parskip=half*,twoside]{scrreprt} \usepackage{ifthen} ``` For some things I need `if`-`then`-constructs. This package provides an easy way to realise it. ``` \usepackage{index} ``` For generating an index. ``` \usepackage{xcolor} ``` `xcolor` is needed by several packages. For some historical reason I load it manually. ``` \usepackage{babel} \usepackage{nicefrac} ``` `nicefrac` allows typesetting fractions like 1/2. It is sometimes more readable than `\frac`. ``` \usepackage[T1]{fontenc} \usepackage[intlimits,leqno]{amsmath} \usepackage[all,warning]{onlyamsmath} ``` This package warns if non-`amsmath`-environments are used. ``` \usepackage{amssymb} \usepackage{fixmath} ``` Provides ISO conform greek letters. ``` \usepackage[euro]{isonums} ``` Defines comma as decimal delimiter. ``` \usepackage[amsmath,thmmarks,hyperref]{ntheorem} ``` for Theorems, definitions and stuff. ``` \usepackage{paralist} ``` Improves enumerate and itemize. Also provides some compact environments. ``` \usepackage{svn} ``` I work with VCS and svn displays some informations (keywords) from SVN. ``` \usepackage{ellipsis} ``` corrects `\dots` ``` \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \DeclarePairedDelimiter{\norm}{\lVert}{\rVert} ``` These are the definitions for absolute value and norm. ``` \SVN $LastChangedRevision$ \SVN $LastChangedDate$ ```
20
https://tex.stackexchange.com/users/201
599
411
https://tex.stackexchange.com/questions/588
136
Sometimes the margins need to be changed for a particular page, paragraph, or other section of text. For example, if I'm writing a letter and want the left margin to be almost at the right side of the page for the four lines of my address, or if I am combining prose with poetry and want the poems to be indented relative to the rest of the work. What is the best way to change both left and right margins on the fly?
https://tex.stackexchange.com/users/32
How can I change the margins for only part of the text?
false
Here is how you can do it. Put the following in the preamble (before `\begin{document}`) ``` \def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]} \let\endchangemargin=\endlist ``` then in the text you can use ``` \begin{changemargin}{<arg>}{<arg>} \end{changemargin} ``` where `<arg>` is the distance you want to include on the margin (the first one defines the right-hand side margin, and the second defines the left-hand side one). So, for example, to add 0.5 cm to the margins on either side, you would have: ``` \begin{changemargin}{0.5cm}{0.5cm} %your text here \end{changemargin} ``` This is exactly how the command ``` \begin{quote} \end{quote} ``` is defined, but with the set to 1cm. The command quote can be used without having to load any packages, by the way.
121
https://tex.stackexchange.com/users/14
600
412
https://tex.stackexchange.com/questions/341
385
I want to create posters for my poster presentation on a conference. What tools or LaTeX classes are available for preparing posters ?
https://tex.stackexchange.com/users/183
How to create posters using LaTeX
false
Previously, I wasted a lot of time trying to get sufficiently large paper sizes, sufficiently large fonts, etc. And even when I was successful, I had difficulties with PDF previewers that e.g. waste ridiculous amounts of memory if you open an A0 document. Finally I realised that I can simply **create my poster in A4 size**. Then you just ask that it's printed in A0 size (a single click in Adobe Reader printing dialog; in most cases, even your local university press *can* do it). You can easily preview your poster by simply printing it on an A4 printer. I usually use 8pt fonts (`\footnotesize`) in my A4 posters. It translates to 32pt fonts when scaled to A0, which seems to be a suitable size for a typical conference poster. Nowadays I'm simply using the `article` class and settings such as ``` \pagestyle{empty} \setlength{\parindent}{0pt} \raggedright ``` You can use the `textpos` package to place "text boxes" using absolute coordinates. Other useful packages include `color`, `titlesec`, `enumitem`, and `psnfss`. For very large fonts (e.g. poster title), you can use something like `\fontsize{26}{30}\selectfont` – alternatively, you can use the `\scalebox` command. For layout tweaks: `\hspace`, `\vspace`, `\makebox`, `\parbox`, `\raisebox`. For drawing lines and boxes: `\rule`.
32
https://tex.stackexchange.com/users/100
609
414
https://tex.stackexchange.com/questions/605
24
I keep hearing people on this site talking about "semantic" vs "syntactic" commands and that the "semantic" ones are somehow better. I don't really get what they are talking about, could you explain and give some examples that show the difference. Should I care about this at all?
https://tex.stackexchange.com/users/169
What is the deal about these semantic vs syntactic commands?
false
Semantic is defined as "Of or relating to meaning". Syntactic is defined as "described by grammatical structure." When expressions are simple, it's fairly easy to read either structure. When they're complex, it's much easier to read things which are defined by the meaning of their expressions rather than by the order of their symbols. `\set{a, b, c}` is semantic, it tells you there is a set of three things: a, b, and c. Instead, `\{a, b, c\}` tells you there is an opening left brace, followed by some symbol a, followed by some coma, followed by ..., but who knows what those symbols mean? Both expand to the same thing, assuming a properly defined 'set' macro, but the former is easier to read, understand, and debug in source code.
18
https://tex.stackexchange.com/users/186
610
415
https://tex.stackexchange.com/questions/611
24
Context: I'm working on my thesis, and the formatting requirements are pretty godawful. In addition to the version I submit to the grad school, I would like to also create a properly formatted version for everyone else. In particular, my document begins: ``` \documentclass[twoside]{book} ``` Is it possible to later countermand the *twoside* option?
https://tex.stackexchange.com/users/27
Setting class options after \documentclass
true
Yes, but like many of the kernel class options it was not exactly designed for this. You'd by much better off simply having two potential document class lines, or something as simple as ``` \documentclass[ twoside ]{book} ``` so you can comment out the option as necessary.
18
https://tex.stackexchange.com/users/73
613
416
https://tex.stackexchange.com/questions/611
24
Context: I'm working on my thesis, and the formatting requirements are pretty godawful. In addition to the version I submit to the grad school, I would like to also create a properly formatted version for everyone else. In particular, my document begins: ``` \documentclass[twoside]{book} ``` Is it possible to later countermand the *twoside* option?
https://tex.stackexchange.com/users/27
Setting class options after \documentclass
false
I did the same thing for my dissertation. Crappy copies for the University library, decent copies for myself and the committee. The easiest thing to do might be to have two versions of the master `tex` file, which then `\input` individual chapters. This lets you tweak each one, while using the same content. BTW: Playing with LaTeX formatting is a great way to procrastinate, while maintaining the illusion that you are doing something useful.
35
https://tex.stackexchange.com/users/16
614
417
https://tex.stackexchange.com/questions/576
64
I have heard about PDF [subsets](http://en.wikipedia.org/wiki/Portable_Document_Format#Subsets) PDF/A (for archival) and PDF/X (for printing). How to generate LaTeX documents like that? I'm also interested in answers with plain TeX and ConTeXt, and hopefully with both pdfTeX and XeTeX engines.
https://tex.stackexchange.com/users/137
How to generate PDF/A and PDF/X?
false
This is not just a question of 'use the right package', as you also have to watch what you do with your input. For LaTeX, take a look at [pdfx](http://www.ctan.org/pkg/pdfx). For plain TeX, you probably need to look over the LaTeX stuff, code your own bits and away you go! I'm not sure about ConTeXt: undoubtedly it can include the same data that LaTeX can, as ultimately the engine is the same.
29
https://tex.stackexchange.com/users/73
616
418
https://tex.stackexchange.com/questions/611
24
Context: I'm working on my thesis, and the formatting requirements are pretty godawful. In addition to the version I submit to the grad school, I would like to also create a properly formatted version for everyone else. In particular, my document begins: ``` \documentclass[twoside]{book} ``` Is it possible to later countermand the *twoside* option?
https://tex.stackexchange.com/users/27
Setting class options after \documentclass
false
Joseph's answer is the most pragmatic one -- there's no need to complicate things. Answering the question you didn't quite ask, however.... In some circumstances, it can be useful to exercise some control over LaTeX from 'outside' – perhaps you want to be able to produce two different versions of a document from a Makefile. One way to do that is to create a file containing some LaTeX and `\input` it at some strategic point. The other is to use a not very well known feature of the TeX program (at least on Unix systems, but probably on Windows ones, too). The `\documentclass` doesn't have to be the first thing in the file. Consider this: ``` \providecommand\pointsize{10pt} \documentclass[\pointsize]{article} \begin{document} Here is some text. \end{document} ``` That defines `\pointsize` to be `10pt` if it's not defined already. How could it be defined before the beginning of the file? Easy! If this file is `doc.tex`, then you can do: ``` % latex '\def\pointsize{12pt}\input{doc}' ``` Voilà! This is an *occasionally* useful escape hatch. I suspect it's also very easy to get carried away, and start writing something horribly obfuscated. **Edited** to use `\providecommand` rather than TeX arcana (thanks to comments from @user1129682)
19
https://tex.stackexchange.com/users/96
617
419
https://tex.stackexchange.com/questions/602
7
I'm working on a big document, 100-200 pages. It's getting quite big mostly because of the images and that's a problem because I need to share it by email with my supervisors. The draft mode doesn't insert images, instead blank zones where the image should be. That solves part of my problem. For the sections, I am actively working on, I kind of need to see the images. Is there a way to tell LaTeX that such section and such section should be non-draft, when I specified draft in the `\documentclass` statement? Otherwise I guess I could just compile the section I am working on, having only the relevant section with images. But that would screw my references and they can come in handy sometimes.
https://tex.stackexchange.com/users/10
Can I specify non-draft sections in a draft document?
true
I don't think you can switch draft mode on and off like that (well, not un-hackily). As a general point, this is the sort of thing that the `\include` mechanism is for. You `\include` sections (in the thesis case, most naturally single chapters), and then at the top of the file have `\includeonly{chapter3}` (or whatever chapter you're working on). That will input only that chapter, but, crucially, keep your references working correctly.
8
https://tex.stackexchange.com/users/96
618
420
https://tex.stackexchange.com/questions/615
18
I'd like to be able to make a datasheet for a module that I'm building. By datasheet, I mean a document containing: 1. A title page, with the primary features, applications, and an application block diagram 2. A table with electrical characteristics (Which might have multiple sections or span multiple pages). 3. A set of graphs conveying the information in the table(s) in a graphical manner 4. One or more pages with large images describing a schematic view of the device 5. A section which defines abbreviations used in the schematic views 6. A section which describes the use of the device's hardware 7. A section which describes the protocol for interacting with the device in software 8. And finally, a (possibly long) section which includes text, equations, source code, and schematics for a variety of applications. Here are some examples of such documents by current manufacturers (all PDFs): * [Linear Technology LT3757 switching regulator][1] * [National LM317 linear regulator][2] * [ON Semi Zener diode listing](http://www.onsemi.com/pub/Collateral/1N5333B-D.PDF) * [TI ADS8330 ADC](http://www.ti.com/lit/gpn/ads8330) * [Atmel ATmega324PA microcontroller](http://www.atmel.com/dyn/resources/prod_documents/doc8272.pdf) [600MB] There are a lot of these documents! Does anyone here have experience creating them, or a document class or package which would be useful in making one? With that high quantity and that much mathematical and technical writing involved, I can't help but imagine that they're using LaTeX, or at least they should be. However, a google search for "[LaTeX datasheet class](http://lmgtfy.com/?q=LaTeX+datasheet+class)" turns up nothing but datasheets for rubber-like compounds. **Are there any giveaways in these documents that tell what was used to create them?** Are they (or are they not) LaTeX? It's easy to see when the small companies use Word. [1]: (link broken) <http://www.google.com/url?sa=t&source=web&cd=2&ved=0CBsQFjAB&url=http%3A%2F%2Fcds.linear.com%2Fdocs%2FDatasheet%2F3757fb.pdf&ei=4-RRTILsDMmmnQePnKXTAw&usg=AFQjCNGmFMvXCejoEkvup_2PovnfecIcZw&sig2=h6DGWJhC5HEy1TjR0qnRwg> [2]: (link broken) <http://www.national.com/ds/LM/LM117.pdf>
https://tex.stackexchange.com/users/186
Where can I find a `datasheet' document class or a tutorial on how to create one?
true
How about the [papertex](http://www.ctan.org/tex-archive/macros/latex/contrib/papertex/) class? This is designed for a making a [newspaper](http://mirror.ctan.org/macros/latex/contrib/papertex/example/example.pdf), but that only allows you to do more than what you want. After a quick scan of one of the data-sheets you linked, it seems that it would be rather painless to subvert papertex to your liking. Hope it works for you!
4
https://tex.stackexchange.com/users/117
620
421