{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.
50
votes
3answers
7k 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?
25
votes
3answers
2k 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 ...
70
votes
3answers
2k 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 ...
61
votes
6answers
7k 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 ...
16
votes
1answer
901 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 ...
35
votes
7answers
9k views
Long underscore in LaTeX
In LaTeX, how would I make a long underscore?
For example,
Name _______ Signature _______
20
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 ...
15
votes
2answers
1k 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 ...
10
votes
3answers
9k 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?
17
votes
2answers
14k 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 ...
7
votes
2answers
774 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 ...
74
votes
5answers
11k 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 ...
25
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?
101
votes
3answers
3k 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 ...
44
votes
2answers
7k 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, ...
66
votes
6answers
5k 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
4answers
8k 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. ...
22
votes
5answers
2k 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 ...
24
votes
1answer
823 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 ...
20
votes
1answer
913 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 |
...
12
votes
2answers
863 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 ...
10
votes
1answer
642 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 ...
14
votes
3answers
1k 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 ...
9
votes
4answers
3k 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 \\
...
48
votes
7answers
3k 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 ...
41
votes
10answers
33k 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 ...
30
votes
2answers
2k 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, ...
13
votes
3answers
4k views
How to change the way theorems are displayed?
I am in the process of writing a large document containing some theorems, lemma, and propositions. Currently, I am using packages amsmath and amsthm. I defined my own environment for theorems by ...
18
votes
2answers
4k 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"
...
10
votes
3answers
1k 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?
7
votes
3answers
3k 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) ...
18
votes
5answers
689 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 ...
18
votes
5answers
1k 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 ...
18
votes
3answers
1k 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 ...
11
votes
3answers
1k 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 ...
5
votes
2answers
223 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 ...
3
votes
1answer
1k 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}
...
8
votes
1answer
431 views
mdframed-Put something on the start of one vertical left rule
I would like to obtain something like in the following picture (I've put Z! instead of the danger symbol).
In the following code, I would like to put the danger symbol on the vertical rule.
I ...
7
votes
1answer
2k views
How can I get \maketitle to create a separate title page with the article class?
I am working on a maths assignment and new to using LaTeX. I have written the assignment up but I would like the title page to be its own page. Currently my title page is a few lines generated by ...
5
votes
3answers
1k 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 ...
4
votes
5answers
1k 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, ...
3
votes
1answer
322 views
How to color digits with the listings package
For my project, I've been using the listings package in order to color the keywords, comments, strings, and digits in the code.
The thing is, I've managed to color the keywords, comments and strings, ...
14
votes
3answers
1k views
Making a LaTeX document appear as though it were typeset in MS Word
I am typesetting a document in LaTeX for which I have been given exact specifications that are intended for an MS Word-processed document (single-sided, single-spaced, 0.75 inch margins, no more than ...
23
votes
1answer
1k 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 ...
8
votes
2answers
1k views
How do I get “et al.” to appear in italics when using \textcite or \citeauthor with biblatex
I'm using biblatex with the chem-rsc package option. I sometimes make use of the \textcite{<key>} or \citeauthor{<key>} commands to put the authors' name into text. When there are many, ...
7
votes
2answers
9k 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. ...
9
votes
1answer
477 views
Typesetting email with internet-style quoting using LaTeX?
I'm wandering 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 ...
7
votes
3answers
3k views
Formatting the title of the TOC
I would like for example to have a bold Arial like font and a red color for the title of the table of contents, and also I would like to change this title to for example "Another title for the table ...
6
votes
2answers
1k views
KOMA-Script: change font of sectioning headings to serif
How to change the default KOMA-Script font that is used for chapter/section headings etc. to the Computer Modern font that is used in text body?
5
votes
1answer
387 views
Listings language definition keyword suffixes
I'm trying to create a listings language definition for ARM assembly and many of the instructions have prefixes/suffixes (i.e. BGT, BLE, BNE, BEQ branch instructions).
Is there a way to define B with ...