{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

11
votes
2answers
575 views

Package for more creative text formatting in latex

What is a reasonable package to be used for realizing something like the following example (including image altered): The source is ...
11
votes
5answers
8k views

Makeindex - Styling the \printindex?

I have two questions: Is it possible to change the titel of the printindex command? It is "Index" by default. How can I format the index as a multi column, alphabetic sorted list?
11
votes
3answers
895 views

Reusing LaTeX code to achieve a consistent layout

What is the best approach to reusing the same layout for numerous tables, paragraphs etc. which share the same structure but different content? Is the best method to use custom commands/macros?
11
votes
3answers
2k views

bad formating of ff in math mode

I'm trying to write something like: $affinity(x)$, but in the PDF I see some small spacing between the two f's. I tried $af{}firm(x)$ or $aff{}irm(x)$, but nothing works.
11
votes
5answers
2k views

How to use siunitx with non numerical values?

I understand that something like \SI{5}{\meter\per\second} defines a certain space between the number (5) and units (m/s). What should I use if instead of a numerical quantity I want a variable: R ...
11
votes
5answers
995 views

Formatting Decimals

Suppose I have a long decimal (assume it is ~6 inches long when written out in 12 point font in LaTeX when I center it, so something like ...
11
votes
2answers
402 views

Non-trivial table in LaTeX

I want to convert this OO table into latex: This is what I have so far: \begin{table} \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|} %p{4cm} \hline \multicolumn{7}{|c|}{Czas ...
11
votes
1answer
331 views

Text in an equation

This is best explained by example. Suppose I have the following: \[ \begin{align*} C_3 \rightarrow 6 automorphisms\\ C_4 \rightarrow 8 automorphisms\\ C_5 \rightarrow 10 automorphisms ...
11
votes
2answers
210 views

Is there such thing as “p{height}”

I am making a table right now and it's really annoying that items in my cell are getting crunched \begin{center} \begin{tabular}{|c| c | c|} Critical Points $P_0$ & $f(P_0)$ & Conclusion \\ ...
11
votes
2answers
6k views

How to add a navigation window to a LaTeX generated PDF document?

Some ( if not most ) pdf ebooks have the option to view the table of contents in a left navigation window. I would like to add this option to my document as well. Question: How to add a navigation ...
11
votes
3answers
5k views

Two column code listings in appendix in a one column report

How do I place a two column appendix in a single column report? I want it so that at the beginning of the appendix I'm in single column mode, then I want to place some source code listings in 2 column ...
11
votes
4answers
187 views

Aligning the long equations

I have read all of the different solutions for fitting long formulas in a page, yet I am still not satisfied with the output I get. The formulas are right aligned which does not look good. Would you ...
11
votes
3answers
386 views

How to draw a border around character in a formula?

So far everything I found on the matter of borders only applies to the text mode. I want to be able to do something like $x_i = y$ so the result will be like the ordinary "xi = z" formula with the ...
11
votes
1answer
348 views

Is it OK to use \tt etc. in latex2e if you don't want the text to inherit the font of the containing text?

I want some words to always be in upright teletype (they are defined to be something specific). If the sentence is emphasised and this word appears I do not want the text to be italic teletype, but ...
11
votes
1answer
489 views

siunitx and engineering 'E' notation

Is it possible to use the siunitx package to typeset numbers with the "E" notation so that the output might look like 1E3 instead of 1 x 10^3
11
votes
1answer
615 views

Language sensitive italicized quotation with csquotes

In what follows: \documentclass[fontsize=11pt]{book} \usepackage{microtype} \usepackage{times} \usepackage{csquotes} \usepackage[frenchb]{babel} \frenchbsetup{IndentFirst=false} \begin{document} text ...
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) ...
11
votes
3answers
2k views

How can I make a set of latex flashcards that I can print to write my answers on one side?

I want to adapt the code from the answer to latex flashcard problem so that the right hand side has a question and the left has the answer rather than on the bottom of the page. This is so that I ...
11
votes
2answers
4k 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 ...
11
votes
5answers
211 views

Best way to have two kinds of formattings for my documents?

I would like to produce two kinds of formattings for my documents. The 1st formatting will use colors. This is typically for reading on a screen. The 2nd formatting will use gray colors for ...
11
votes
2answers
2k views

Options and suggestions for hyperref font?

Background I am interested in finding and implementing a more aesthetically pleasing style for the hyperlinks in my document. I have read through the documentation, but I find both the colored text ...
11
votes
1answer
134 views

Defining a particular environment in LaTeX

I need help writing an Example environment. I just want it to look like the figure below which I took from an old book I have in my library. This is what I have done. ...
11
votes
1answer
763 views

Algorithm as figure and without italic and bold formatting?

I want to include an algorithm in my latex document, however without printing most of it in italic and all the keywords in bold font like it's done by default by e.g. the algorithmicx package. I like ...
11
votes
1answer
260 views

How does one implement drop caps in plain TeX?

How might one implement a simple drop cap in plain TeX without additional packages?
11
votes
3answers
183 views

Not breaking the start of an environment for solution of exercises

Let suppose that I have an environment \begin{sol} ... \end{sol} for writing solutions of exercises in a test. For practical reasons, I would like that two or more solutions can be put in the same ...
11
votes
1answer
354 views

When should math be upright?

Is there any standards for when math is supposed to be upright? E.g. The f in f(x) is in italics but cos in \cos x is upright. As I see it, both are functions? \int f(x) \, dx OR \int f(x) \, ...
11
votes
1answer
324 views

New list environment: automatic enumeration with “a posteriori” format

This is a follow-up question to Nested enumerate labels with parent label appended plus a single set of enclosing parentheses First and foremost, sorry for my English, I'm learning it currently. ...
10
votes
5answers
2k views

I just want to have the text in my pdf the same way I have it in my editor

I want to paste from the clipboard a plain text copied from a text editor (line wordpad++, vim, notepad etc), and I want TeX to respect the same line break formatting that the editor has. This works ...
10
votes
3answers
339 views

“Escaping” Linux kernel version in latex

I'm trying to include a kernel version info (i.e. \texttt{2.6.40.4-5.fc15.x86_64}) in my LaTeX document. However, LaTeX keeps trying to put it into "math-text" ("Missing $ inserted" and so on). How ...
10
votes
2answers
702 views

Replacing all dots in a document

I want to replace all dots in a LaTeX document with a call to a macro. Just doing a search and replace on '.' won't help as this will not replace the dots generated by LaTeX, e.g. in section numbers, ...
10
votes
3answers
2k views

University's logo

How to put the logo before the date and after my name in the title? I write it as \begin{document} \title{} \author{} \titlepic{ \includegraphics[width=0.5\textwidth]{logo} \date{} but ...
10
votes
3answers
3k views

Mirror effect in documents

The following example (links to pdf) in the TeX Showcase has no provided source. The book Fearless Symmetry by Ash and Gross seems to use a similar style. Where can I find hints for typesetting ...
10
votes
2answers
7k views

Code Snippet IN Text

How do I show a code snippet directly in my text? I dont want to have an extra box for it like lstlisting or verbatim provide it. My example may should look like this: The class List.class is... ...
10
votes
1answer
228 views

How to create Windows-8-styled menus?

I'm writing a technical documentation and I want to explain step-by-step how to go through various menus. For example I used to write Open with > VLC media player. That's how it looks in Windows ...
10
votes
3answers
3k views

How can I create a Chicago Manual of Style formatted document in LaTeX?

I have an assignment which requires me to use CMS formatting, double spaced, in 12pt font. I'd rather avoid using the much inferior "Word" or "Writer" programs -- in particular I like how LaTeX ...
10
votes
3answers
267 views

How to customize enumeration to implement Brazilian law texts?

This is a standard model of a Brazilian contract: http://www.consultta.com/modelos_contratos/modelos_contrato/0215.htm It more or less follow the way Brazilian laws are written: as you can see, the ...
10
votes
1answer
411 views

How can I mimic Griffiths' electrodynamics textbook?

This is such a beautiful textbook; very dear to me. I think it has a great font - which I know is Times New Roman. But somehow, I can't even get close to it. One of the main obstacles is making the ...
10
votes
1answer
1k views

Format section titles as white text on black background

I would like to redefine the \section and \section* to produce section titles that look roughly like this: that is, text in white over a black bar that extends from left to right margin. I don't ...
10
votes
1answer
1k views

What are the standard styles to format LaTeX source code?

In any other programming languages, we have several ways to format our source code. For example, some of the standard styles are: Allman(ANSI) K&R GNU .... Within LaTeX, I couldn't find a neat ...
10
votes
1answer
429 views

Specific section format

I'd like to use titlesec to typeset a section header that would look like this: --------- Name of Section ------------ (the ---- would be a rule, and the entire section header would be centered) ...
10
votes
1answer
623 views

How to mark book paragraphs as note, warning, tip etc.?

In my text I have some paragraphs that should be denoted as "note", "caution", "tip", "story". These paragraphs should be rendered with darker background and an icon on the left side. I was not able ...
10
votes
2answers
2k views

Why are \listof{}{} and \listoffigures styled differently?

I'm writing my thesis and I have certain code-snippets to show. I'm using the the listings package embedded in a custom float environment to display them. To list them in an index at the beginning of ...
10
votes
1answer
356 views

Color box issue

Here is my MWE (minimal working example): \documentclass[]{article} \usepackage{fancyhdr} \usepackage{graphicx} \usepackage[usenames,dvipsnames]{color} \begin{document} \begin{center} ...
10
votes
2answers
1k 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 ...
10
votes
1answer
845 views

Code readability

I'm getting my head around LaTeX, and I find really awesome the fact that the documents are completely editable with a plain text editor, while getting a really neat and professional output. I'm ...
10
votes
1answer
2k views

how to define inparaenum in the preamble

I'm using both \inparaenum and \enumerate in my thesis and I would like them to set them in the preamble so that each item is set off with a). I used \setenumerate[0]{\itshape a\upshape)} in the ...
10
votes
1answer
212 views

xindy: formatting the first letter of the first entry of a letter group

How do I format the first letter of the first entry of a letter group in an index generated with xindy? The result should look something like this: ... \indexspace \item \textbf{b}athroom\quad{}1 ...
10
votes
3answers
10k 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 ...
10
votes
1answer
508 views

Styling very long index entries to look more aesthetic

I wrote the following style for makeindex: headings_flag 1 heading_prefix "{\\bfseries " heading_suffix "}\\nopagebreak\n" delim_0 " \\dotfill " delim_1 " \\dotfill " delim_2 " \\dotfill " which ...
10
votes
1answer
193 views

Adding a dictionary definition

Does anyone know of a package that supports dictionary definitions? I was thinking of something like this: Source: Luscombe et al (2001), Yearbook of Medical Informatics. A) the easiest would ...