{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

67
votes
3answers
13k 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?
102
votes
5answers
5k 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 ...
36
votes
3answers
4k 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 ...
98
votes
8answers
18k 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 ...
36
votes
2answers
36k 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 ...
22
votes
2answers
2k views

Chapter Title in rotated vertical box at the margin

I am using the book document class. I would like to have Chapter name (Interduction, Results, Discussion, ...conclusion...) to appear in every page, in the right side small vertical (color filled) box ...
51
votes
7answers
24k views

Long underscore in LaTeX

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

Changing the apperance of equation numbers with amsmath

For equations in my document, I use the facilities of the amsmath package. In order to make the equation numbers more eye-catching, I want them to be in boldface and a little bit indented to the ...
148
votes
4answers
7k 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 ...
25
votes
4answers
3k 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 ...
32
votes
2answers
21k 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 ...
17
votes
2answers
3k views

How typeset a numeric table from a CSV file

I have a CSV file (db.txt)like this: 30.0, 0.0, 0.0 60.0, 1.9098, 5.8779 90.0, 6.9098, 9.5106 120.0, 13.09, 9.5106 150.0, 18.09, 5.8779 180.0, 20.0, 0.0 I need to typeset it. My ...
13
votes
3answers
16k views

How to format the chapter heading?

How can I change the chapter heading of the book class to typeset centered chapter names as shown in the image above?
115
votes
6answers
40k 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 ...
17
votes
3answers
2k views

How to Create Comparison Tables in LaTeX?

I am a new user (both to LaTeX & this forum). I want to create a Comparison Table for an Article (like the one shown here): Can someone please help me with this.
8
votes
2answers
2k views

Chapter formatting

I use report document class and the thing is that I would like to remove Chapter x phrase, add chapter number before chapter title and remove blank place between chapter name and top of page. For ...
46
votes
2answers
9k 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, ...
76
votes
6answers
9k 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 ...
32
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?
17
votes
3answers
2k views

How to set superscript footnote mark in the text body but normalsized in the foot?

I want the footnote mark to be superscripted in the text body (e.g. Footnote mark²), but normalsize in the foot, to be shown like: ________________ 2. Some footnote text Also, it would be nice if ...
21
votes
2answers
8k views

How to style text in hyperref \url?

I want to set color, font and similar style attributes for the text in a \url from the hyperref package. How do I go about doing it? All I have found are comments saying that I probably don't want to ...
43
votes
4answers
19k 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. ...
21
votes
3answers
16k views

Non italic text in theorems, definitions, examples

What package should I use, or what setting can I make to the font in theorems so that the text wouldn't be italic. I use amsmath, and from default, everything I write in theorem environments becomes ...
8
votes
1answer
3k views

hyperref: how to format text in a forms text-field

I would like to pre-format the text in a form text-field, e.g. make it bold, italic or use a specific font. The following code generates a simple text-field: \documentclass{scrreprt} ...
28
votes
5answers
4k 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 ...
21
votes
3answers
16k 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.
6
votes
2answers
443 views

Is it possible to change text color for all headings?

I want to change only the color (not font size, etc.) of all headings in my documents (\section, \subsection, \subsubsection, ...). I want to keep all other settings fixed. Is there a way to do ...
55
votes
7answers
5k 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 ...
32
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 ...
38
votes
4answers
5k 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, ...
56
votes
4answers
2k 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 ...
17
votes
2answers
4k views

\listings code style for HTML5 (CSS, HTML, JavaScript)

I would like to create a code style for HTML5 that can be used with the \listings package. An HTML5 document consists of three languages: CSS, HTML and JavaScript. That makes the whole thing a bit ...
16
votes
3answers
3k views

Underline my name in the bibliography

For several documents I'm preparing, I need to highlight (or underline) occurences of my name within the bibliography. Is there an easy way of doing this?
29
votes
2answers
10k 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" ...
11
votes
4answers
6k views

Adding parentheses around subfig references

Say I have a figure with two subfloats inserted using the subfig package. When I reference them with \ref{myLabel} I get this Figure 3.5a and 3.5b. But what I want is this: Figure 3.5(a) ...
25
votes
3answers
4k 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 ...
13
votes
2answers
860 views

Typesetting email with internet-style quoting using LaTeX?

I'm wondering if there exists a package, that would take so-called Internet-Style Quoted plain text of an email, and format it accordingly for a PDF output. Internet-style quoting is discussed on the ...
4
votes
6answers
4k views

How can I auto adjust a equation to appear in the entire page? (Scale to equations, is this exist?)

If I have a document like this: \documentclass[landscape, 12pt]{report} \usepackage[landscape]{geometry} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath, amssymb, ...
60
votes
12answers
88k 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 ...
42
votes
3answers
9k 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 ...
23
votes
1answer
2k 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 | ...
29
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 ...
12
votes
1answer
3k views

Formatting back references in bibliography

I would like to change the way the back references are shown in the bibliography, such that they are all shown within parentheses. So I would like to see (page x, y, z) after my bibitems. This ...
12
votes
2answers
24k views

set the font family for lstlisting

I have the following set up for my listings : \lstset{basicstyle=\footnotesize,breaklines=true} \lstset{framextopmargin=50pt,frame=bottomline} I would like to change the font family to Courier. ...
22
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 ...
14
votes
3answers
3k views

Footnote number in braces / parentheses

I have written my dissertation with LaTeX, but my teacher has suggested to put the number of footnotes in braces / parentheses. I thought it would be easy, but I haven't found the answer anywhere! I ...
14
votes
4answers
8k views

Diagonal dots spanning multiple lines/columns of a matrix

I'm filling in large sparse matrices, for example \begin{bmatrix} 0 & -2 & 1 & & -1 & 2 \\ 2 & \ddots & \ddots & \ddots & & -1 \\ ...
8
votes
2answers
5k views

Changing the TOC style of an Article document-class

When typesetting an article documentclass, the sections appear as bold in the table of contents, with no leading dots. I would like to change these to non-bold, and insert some leading dots. I tried ...
5
votes
3answers
3k views

How do I insert a border below text?

I want to emulate a feature from a few word processing programs (e.g. Microsoft Word, LibreOffice Writer) where I could (somewhat) arbitrarily insert a bottom border below any text/paragraph. How can ...
32
votes
2answers
19k 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 ...