{formatting} is for general questions about formatting document elements. Use this tag in addition to other tags specifying what should be formatted. For questions about font attributes (e.g., {bold}, {italic}, {small-caps}, {sans-serif}, {typewriter}), use the appropriate tag instead.

learn more… | top users | synonyms

132
votes
4answers
5k views

Pretty Table of Contents

I would like to know if it's possible to have a Table of Contents looking like the following, where the number of the page is the big number on the left. The sections could look like in the ...
98
votes
6answers
25k views

What's the quickest way to write “2nd” “3rd” etc in LaTeX?

If I want to use abbreviations for second, third and so on in my LaTeX documents, I am currently doing this: 2$^{nd}$ which seems unsatisfactory. Is there a macro I'm missing? I'm sure I could define ...
89
votes
3answers
4k views

Consistent typography

When working with large documents, or even across multiple (smaller) documents, I often find that I forget which typographical consistencies I should stick to. With TeX being inherently consistent in ...
84
votes
8answers
13k views

Compile a LaTeX document into a PNG image that's as short as possible

I need to convert my LaTeX documents into PNG. The problem is, I also need the resulting image to be as short as possible (height-wise). I've tried latex followed by dvipng, but the result is always ...
74
votes
6answers
7k views

Prettiest way to typeset “C++” (cplusplus)?

Writing "C++" in plain text results in an ugly setting, as the '+' signs are too big and too spaced: I've seen around the web several marcos for typesetting the "C++" symbol, ranging from mild ...
67
votes
1answer
36k views

What's the correct use of \author when multiple authors?

Working on a project, the article we are writing is written by me and someone else. How should I fill the \author? What about \author{LASTNAME1, FIRSTNAME1 \& LASTNAME2, FIRSTNAME2}? It doesn't ...
63
votes
3answers
10k views

Does it matter if I use \textit or \it, \bfseries or \bf, etc

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?
54
votes
4answers
1k views

underline omitting the descenders

I'm very well aware that it is considered best practice not to use underlining other than on typewriters and in handwriting. But sometimes it is needed nonetheless. In my opinion the typographically ...
53
votes
7answers
4k views

How to add some visual style and pizzazz to course notes?

LaTeX is wonderful for writing mathematical papers, but while the output is perfectly typeset it is not visually very exciting. And although it may just be "familiarity breeds contempt", I am ...
51
votes
11answers
63k views

Make MS Word document look like it has been typeset in LaTeX

A few years back, I used to use LaTeX for writing reports and such, and I really liked the look of them. However, nowadays I am forced to use MS Word to write my reports, but that does not hinder me ...
46
votes
2answers
8k views

Creating Kindle-friendly versions of existing LaTeX documents

So let's say I have a large amount of documents (from ArXiv.org, suppose) that I have the LaTeX source for, and for which I would like to compile particularly Kindle-friendly versions. In particular, ...
42
votes
3answers
7k views

When to use bold, italics, small caps, typewriter etc.?

I'm a little confused on the purposes of each kind of text in LaTeX. I know the function of some of them, but sometimes people use each for different reasons. For example: \texttt is for code (no ...
41
votes
7answers
17k views

Long underscore in LaTeX

In LaTeX, how would I make a long underscore? For example, Name _______ Signature _______
37
votes
2answers
2k views

Styleguide for LaTeX similar to the Google styleguides?

Even though I don't work at Google, the Google Styleguides have been very helpful for me in adopting consistent, readable style conventions for my code. Unfortunately, there is no Google Styleguide ...
36
votes
4answers
13k views

Make first row of table all bold

I'm trying to do something that I thought would be relatively simple but seems to be quite hard. I have a table with a number of columns, and I'd like to make all of the titles appear in bold text. ...
34
votes
3answers
61k views

How can I underline a single word with LaTeX?

Given a simple paragraph, how do I underline a word in that paragraph? (Note: I post this here because it wasn't really obvious using google or this site and my TexNicCenter is somehow missing this ...
34
votes
3answers
4k views

Make one author's name bold every time it shows up in the bibliography

I'm working on a CV. I'd like to highlight my name in every entry in the bibliography. I've tried simply replacing {myname} with {\bf myname} or {{\bf myname}}, but they fail with various errors, ...
33
votes
3answers
532 views

Strategies for corrections in book typeset with TeX

I have typeset a long book using TeX and now it is time to re-print it. This is an opportunity to incorporate corrections to the errata discovered in the initial printing. Unfortunately TeX may ...
32
votes
4answers
9k views

Multiple footnotes at one point

I'm trying to create multiple footnotes referencing from one point, that look like this: lorem1,2 Searching for "multiple footnotes" shows up almost exclusively solutions for multiple references ...
31
votes
3answers
2k views

How to typeset large numbers

I need to typeset some very large numbers that span a number of lines, is there a way in LaTeX to do this?
30
votes
3answers
3k views

Will two-letter font style commands (\bf , \it , …) ever be resurrected in LaTeX?

I understand that \bf and \it are now obsolete in LaTeX and that \textbf and \textit are proper, as they produce more sophisticated (in particular, cumulative and properly kerned) changes to font ...
29
votes
2answers
15k views

\bfseries is to \textbf as WHAT is to \textsf

Neither of \sfseries nor \sfshape seem to work. So what is the command I'm looking for to change the current group to sans serif? \bfseries, \scshape and \itshape work, but I can't find the sans serif ...
28
votes
3answers
1k views

Date format: YYYY-MM-DD

Currently I put the date in my document using: \date{\today} How do I display the date in the YYYY-MM-DD format?
28
votes
1answer
1k views

Adding a per-chapter image along with group of entries in ToC

Friends, I have an old analytic geometry book with an unusual table of contents: for every group of entries based on the current chapter, there is an image along with it. Well, let me show some actual ...
27
votes
6answers
1k views

How do I typeset morse code with LaTeX

I am writing an article regarding the history of the Morse code and I am having difficulties printing the dots and dashed (they get combined when the document is printed). Is it also possible to ...
27
votes
2answers
14k views

Footnote without a marker

I am new to LaTeX. I am trying to write a paper using latex. I want a footnote about the funding source of my work in the first page without marker. I tried below approaches: \footnotetext{text ...
27
votes
1answer
2k views

Why Different Commands for Seemingly Similar Tasks?

Take a look at the following list: \textit, \it, \emph, \itshape, \mathit \textbf, \bf, \bfseries, \mathbf ... One might say, for instance, that: \mathbf and \mathit are for math mode, while the ...
25
votes
5answers
3k views

How to output a counter with leading zeros?

I can output the value of a counter in a LaTeX document via: \setcounter{mycounter}{1} \arabic{mycounter} Which inserts a 1. But how do I format the output by, for example, adding a leading zero if ...
25
votes
4answers
2k views

Stickers on Thesis paper

I want to put a sticker "Examiners Copy" on the the front page of the thesis. How to do this?
25
votes
7answers
1k views

How long does it take to format a book in LaTeX?

I am new to this website and I hope this is not considered off topic but how long does it take to format a book in LaTeX? I understand this is a subjective question but maybe the "specs" of the book ...
25
votes
2answers
26k views

Change caption name of figures

How can I modify the caption name of a figure? For example I have \caption{This is a figure.} and by default the caption appears as Figure 1: This is a figure. However I want Fig.1 - This ...
25
votes
2answers
2k views

What is the canonical way to redefine the \emph command

Question says it all. What is the best way to redefine the \emph command to be bold font and upright?
25
votes
2answers
7k views

number format in pgfplots axis

How can I change the type of the decimal/thousand separator from the american one to the european one? More precisely, I want: "1000" to be written as is, instead of "1,000" "0,1" instead of "0.1" ...
24
votes
5answers
8k views

How to display numbers using comma as a thousands separator?

I want numbers like 5.5 million to be displayed using a comma as a thousands separator as "5,500,000". Is there a way to do this automatically, without having to manually put commas?
24
votes
1answer
2k views

Book layout Contents, Chapter, Section,

my goal is to get new style of Table of Contents, new style of Chapter and new style of section. I there is one more: how to change itemize native symbol for a black square? Table of Contents: text ...
24
votes
4answers
2k views

How to separate table content and table style

I want to know if there is a way to separate table / content for table style (think CSS). Like to have only data specification \begin{tabular} H1 & H2 & H3 & h4 \\ V1 & V2 & V3 ...
23
votes
2answers
572 views

Add a rule underneath “Figure 1”

I want to add a line beneath the figure caption such as Figure 1 Figure caption text here.... I managed to include a newline, change the color and look of the caption via caption package: ...
22
votes
1answer
16k views

Can a table include a horizontal dashed line?

In a normal table, you can use the \hline command to draw a horizontal line. I am trying to make this line a dashed horizontal line. I have found the package dashrule via this answer, but this only ...
22
votes
1answer
1k views

How to place a shaded box around a section label and name

In working with a publisher, I need to format section headings like this (using ASCII art): +-----+-------------------------------------+ | 1.2 | Section name | ...
22
votes
1answer
2k views

CSS based LaTeX formatting?

I've done ab bit of web-searching and found nothing. Are there any attempts on using CSS for LaTeX formatting? For example: body { font-family: Helvetica,Arial,sans-serif; } section { font-size: ...
21
votes
3answers
539 views

Why are text format commands used inside braces?

Most commands in Latex are written with the arguments inside braces following the command: \command{arguments}. But text formatting options, like \em, or \scriptsize are usually written inside the ...
21
votes
1answer
223 views

Two Columns whose content is positioned relative to each other

In theatre (and film) there's a tendency for actors to let each other finish what they're saying, possibly even making a small pause before starting their turn. But that is not how real life ...
21
votes
2answers
4k views

How to type a Backus-Naur form in LaTeX

I need to type Backus-Naur form in LaTeX document. I found several packages on CTAN: ebnf seems to not work with TeXLive 2009 latex-bnf does not align the declaration, etc. There is a module for ...
20
votes
3answers
13k views

How can I make a horizontal dashed line?

How can I make a horizontal dashed line in LaTeX? Just writing lots of single dashes results in a continuous horizontal line.
20
votes
3answers
2k views

German language: use of comma in numbers

In German the comma rather than the period is used as a decimal separator and the dot is used as a thousands separator: 12.345,67. The comma creates some unwanted space when used as in $12.345,67$. Is ...
20
votes
1answer
338 views

Sloppy \left and \right?

The \left and \right commands often produce improvidently large delimiters. It almost always looks better to use delimiters that are just slightly too small than delimiters that are too large. With ...
20
votes
6answers
2k views

Paragraph breaks with asterisks

In many books—mostly novels—often some paragraphs will have a blank line between them to indicate a sort of 'pause' in the narration. If one of these blank lines appears at the top or bottom of the ...
20
votes
1answer
276 views

How to I force a word to move to the end of the line?

How do I force my document to pull selected words to the end of each line (and to hyphenate them as well, if needed)? I have an old document. I know the page size and I think I've found the ...
20
votes
1answer
540 views

Elisions in mathematics

Knuth incorporated many of the typographical rules for mathematics in the TeX engine. However some rules were left out. One such case is the use of elisions in equations. Sometimes \cdots are used and ...
19
votes
5answers
864 views

typesetting different characters with different colors in a DNA sequence

I have created a macro which I used to format DNA sequences, as they should be in the monospaced font and uppercased: \newcommand{\DNA}[1]{\texttt{\uppercase{#1}}} Now I have a column with some ...