{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

14
votes
4answers
11k 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
4k 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 ...
6
votes
2answers
2k views

Formatting each part/section/subsection

Are there some magic lines to be placed in the preamble that would, like in CSS, specify how each generic section or subsection in the whole document should be formatted?
4
votes
1answer
781 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, ...
36
votes
2answers
22k 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 ...
20
votes
3answers
3k 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 ...
15
votes
3answers
10k 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 ...
31
votes
2answers
4k 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?
22
votes
4answers
5k views

How to make the optional title of a theorem bold with amsthm?

I use the code mentioned in Title of the theorem: \begin{theorem}[The title] Some statement \end{theorem} However with amsthm the optional title -- above: "The title" -- is neither bold nor italic, ...
21
votes
5answers
1k 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 ...
11
votes
2answers
2k views

Customizing Chapter style in scrbook

I want to obtain styles like those showed in the next two images (I do not need the picture in the background (parabolas)): My original LaTeX code (to be customized but should keep font as they ...
21
votes
3answers
6k views

Fanciest way to include Mathematica code in LaTeX

I am trying to include a Mathematica code in LaTeX. To obtain the Mathematica code I just exported notebook as PDF. I didn't like the way it was included in my TEX code so I just thought of adding a ...
13
votes
6answers
3k views

Formatting arrows between rows of corresponding matrices

Some material I'm creating requires output that looks like this: (note the position of the arrows). I'm using the following code (with the AMS macros) to generate this, and I'm looking for ...
11
votes
4answers
525 views

Is there a ready solution to typeset a diff file?

In a text about Git I want to typeset diffs similar to this visualization: Commit details on GitHub. Is there any ready-made solution to that, especially the coloring of the diff lines? (In other ...
10
votes
3answers
12k views

Multiple authors in one row with refmark, multiple affiliations in separated columns in another row

I wonder how we can list author names in the following format in LaTeX. I have 5 authors with 3 different affiliations. I am trying to list all author names with refmark in one row, and 3 ...
20
votes
4answers
945 views

What measure can we use by LaTeX to control the print budget

I found there are so much excellent answer to questions about how to product high quality typesetting output. But I wonder how to save ink with LaTeX. What we need to think about to manage cost. page ...
13
votes
2answers
5k 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?
10
votes
2answers
2k views

Footnotes layout in multicols environment

I am using the package multicol to typeset a one-column (spanning the entire text width) heading and a two-column main text block. In order to do so, I begin the multicols environment along with the ...
8
votes
3answers
7k 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 ...
9
votes
1answer
998 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 ...
8
votes
1answer
2k views

Layouting the index-page

I'm using \printindex for my index and I wonder how to have bold page numbers ordering by first character of the indexed word and have dots in between the name and page number like A Apple ...
6
votes
2answers
815 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 ...
4
votes
2answers
450 views

An improved \rowstyle that takes the cell contents as an argument

It is possible to format the column entries of a tabular in an argument-style fashion using the lrbox environment to store the column cell in a box (say) \mybox; and supply \mybox as an argument to ...
13
votes
1answer
10k 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 ...
8
votes
2answers
4k views

siunitx: aligning numbers by decimal points in tables doesn't work for bolded or italicized numbers

This is a follow-up question for Aligning numbers by decimal points in table columns. User lockstep provided this solution: \usepackage{siunitx} \begin{document} \begin{tabular}{S[table-format=3.2]} ...
6
votes
1answer
7k views

Formating captions in longtable tables

I'm typesetting my dissertation using Springer's svmono class. The class defines its own formatting of table and figure captions. I have a couple of multipage tables which I typesetted using longtable ...
1
vote
1answer
843 views

Thesis running problem in KILE

I'm using KILE editor. There is no problem when I run others .tex article in Kile. But problem is when I run a thesis article in KILE. This thesis article is running fine in WinEdt. ...
83
votes
1answer
66k 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 ...
23
votes
1answer
426 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 ...
44
votes
4answers
18k 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 ...
39
votes
4answers
3k views

What is the Necessity of $…$ Around Numbers?

I typed up an assignment with a lot of numbers in LaTeX and turned it in to my adviser. When he returned it to me with some corrections, one of which was a lot of $ around my numbers. I understand ...
14
votes
2answers
7k 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, ...
22
votes
1answer
21k views

Formatting section titles

Forgive the stupid simplicity of this question, and please feel free to refer me to an older answer. I'm not quite familiar enough with LaTeX terminology to have found it. All I want to do is set a ...
17
votes
4answers
935 views

Calculate prices

I want to calculate prices in a LaTex file. This means I want to add two numbers with exactly 2 decimal places and I want to multiply these values by an integer. An other thing is the output format. ...
13
votes
2answers
1k views

Format a verbatim paragraph

How can I format a verbatim paragraph? I.e. break, fill and join input lines to produce globally balanced output with the lengths of each line approaching the target \textwidth as closely as possible. ...
14
votes
2answers
2k views

Why couldn't (La)TeX's layout model be as simple as CSS's layout model?

I feel CSS's layout model is simpler than (La)TeX's layout model. At the time Knuth developed TeX, the idea leading to CSS model is a "difficult" things? Or the CSS layout model is not appropriate to ...
9
votes
2answers
530 views

Automatically bold first sentence of a floats caption

How to bold automatically the first sentence of the float caption and second sentence is normal? \begin{figure}[t] \centering \caption{First sentence. Second sentence.} \end{figure} Output should ...
8
votes
4answers
1k views

How can I automatically abbreviate page ranges in citations (biblatex)

I am using biblatex for my citations, and I was wondering if there was a way to automatically abbreviate the page ranges in citations. (The reason I ask is because I have them all in long-style, and I ...
9
votes
4answers
1k views

Addition and subtraction of chemical equations

Is there a package that supports the addition or subtraction of chemical equations, perhaps with automatic tabbing and a alignment. Whilst it is obvious I could set up tables or use mathmode's align ...
4
votes
3answers
5k views

Using \MakeUppercase in \@startsection

I was toying a bit with the \@startsection command to change the layout of chapter / section headings. More specifically, I wanted my headers to be converted to uppercase. I was following an example ...
3
votes
1answer
2k views

Italic citation reference for author name using natbib

I'm trying to get italics for the author name within the citation using natbib with agsm style. My MWE: \RequirePackage{filecontents} \begin{filecontents}{\jobname.bib} @BOOK{Smith2011, author = ...
14
votes
2answers
2k views

Define an “escape underscore” environment

I am writing a text document in LaTeX where I need a lot a words with underscores: foo_bar_1, more_bar_2_long_expression_3. I know about the underscore package, but for some reason the [strings] ...
9
votes
1answer
1k views

Subsubsection: remove the newline (like paragraph)

Using the article document class, how can one remove the newline at the end of a subsubsection title? I am using \documentclass{article}; I do not currently use titlesec or any of the alternatives; I ...
5
votes
1answer
2k views

Using \scshape and \bfseries together

A very obvious one I suspect, but when I try to do the following the small caps are over-ruled by the boldface, so I get lowercase rhubarb rhubarb. Is there an easy way to get \scshape\bfseries? ...
4
votes
2answers
259 views

bclogo page breaks

I am using the Bclogo package http://www.ctan.org/pkg/bclogo. I have created environments for lemmas and proofs with it. The proof was too big to fit on the bottom of the page, so it just inserted a ...
2
votes
1answer
199 views

How to have bold font in mdframed environment?

I did not find bold word in the manual. My tex is: \documentclass{article} \usepackage[framemethod=tikz]{mdframed} \newtheorem{question}{Question} \mdfdefinestyle{que}{ linecolor=cyan, ...
8
votes
1answer
794 views

Cursive text after _

I would like to write H2O with a small 2 below the H. H_2 O (water) However, all text after _2 becomes cursive. It appear that something obvious is wrong but, I cant find what it is. Anyone how ...
6
votes
2answers
2k views

Modify default memoir chapter style

I'm using memoir and using its default chapter style. what I'm looking to do is to change the format from chapter 1 chapter title to something like this: chapter 1: chapter title I'm ...
4
votes
1answer
110 views

Small caps in section but not in ToC

With LaTeX, I would like to set all my section titles in small capitals but I need the \textsc to be 'cancelled' in my table of content. Is that possible somehow ? I currently do this : ...