8
votes
3answers
84 views

Spacing for subscripts in mathmode with \textcolor

It is possible to use \textcolor in math-mode; however, it changes the spacing of subscripts. \documentclass{article} \usepackage[usenames]{xcolor} \begin{document} $Y_i$ vs $\textcolor{red}{Y}_i$ vs ...
3
votes
2answers
45 views

color environments influence spacing

I would like to mark revised parts of a large document in color, and up to now always used \usepackage{xcolor} \newcommand\rev[1]{\textcolor{red}{#1}} to then do Lorem ipsum dolor \rev{git} amet, ...
5
votes
1answer
124 views

Problem with spacing after \[…\] environment when using the \textcolor{} command

I'm getting odd spacing/indentation behavior when the \textcolor command is combined with the \[ ... \] environment. I did find a fix by putting % in a couple places, as outlined below, but I'd like ...
6
votes
2answers
93 views

Getting extra space with this combination of \color and \label

If I type {\bfseries\color{red}Theorem 1. }{\itshape\label{two} This is a test.}, I get too much space between "1." and "This". Here's a file that shows what I mean: \documentclass{article} ...
3
votes
1answer
104 views

\rowcolor truncating cells in table

I am working on formatting a table a coauthor originally created for publication, and running into a problem when trying to color-code rows. The degree symbol in the first data row is formatted in an ...
3
votes
0answers
29 views

Restore standard horizontal spacing for colored symbols in mathmode [duplicate]

I have to highlight some symbols in red, something like this: \documentclass{article} \begin{document} $2+2+2=6 \textcolor{red}{\to} 4+2=6$ \end{document} However the colored formula horizontal ...
3
votes
1answer
48 views

Use of the color package changes the height of the text block

Here is the packages in my documents: \documentclass[12pt,twoside]{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{color} \renewcommand{\baselinestretch}{1} ...
3
votes
1answer
194 views

How to create a table where one cell spans all the columns and the text wraps properly?

I need to create a table like this: table with two columns and width equal to width of the page; border around whole table; first row spanning two columns; with background color, bold font and ...
0
votes
1answer
105 views

Whitespace as wide as a character [duplicate]

I would like to produce whitespace as wide as a particular character. One trick I have figured out is to use {\color{white} x} (if for example this would produce whitespace as wide as the character x) ...
3
votes
2answers
162 views

Making a table-like structured information block in LaTeX

I want to layout some information in a structured, table-like, or form-like manner. Basically, each 'block' has multiple fields like Title, Description, and other things, and I want to display them ...
1
vote
1answer
375 views

Changing font color in a table adding unwanted extra spacing

I haven't been able to find a solution, so I'm hoping for any suggestions. When I try to change the font color in my table, I get extra spacing above and below the lines with the color-changed font. ...
8
votes
1answer
773 views

Change text color in table, preserve ability

I'm having difficulty creating a new command for \rowstyle that allows me to color the text of different rows in a table and preserve my ability to space out the columns and not induce space between ...
6
votes
1answer
203 views

Strange vertical space before the caption of a longtable with KOMA-Script classes when xcolor is loaded

When using one of the main KOMA-Script classes — scrartcl, scrreprt, scrbook but not scrlttr2 —, the vertical position of the caption in a longtable environment changes when one loads or unloads the ...
6
votes
2answers
174 views

Using \only<#> to change text color causes spacing issues

Hello and thank you in advance for your help! I'm comparing the following two commands: This is a \only<1>{test}\only<2>{\textcolor{red}{test}}. ...
3
votes
1answer
211 views

How to extend the horizontal line and colored box all the way?

I want to extend the horizontal line and the colored box all the way to the end of the page, however using \hrulefill (instead of \hline, screws up the format.) This is my code: ...
8
votes
2answers
276 views

How can I use color in a mathematical expression without losing horizontal spacing?

How can I use color in a mathematical expression without losing horizontal spacing? \documentclass{article} \usepackage{xcolor} \definecolor{red}{HTML}{dd0000} \begin{document} \[3+(-5)-2+3\] ...
11
votes
1answer
172 views

Extra space added after equation when it is coloured

For some reason space is added after my equation when I colour it. This does not happen if the colour is added to text. Is there a simple way to prevent this from happening, like a global setting (I ...
8
votes
1answer
771 views

How to make a perfect colour filled threeparttable table?

A three line table is used for my report. I want to fill lightgray background color to the whole table, but there is white space between rows, how to eliminate this issue? Without \addlinespace: ...
1
vote
1answer
234 views

Color lines tabularx add padding? [duplicate]

Possible Duplicate: Color changes cell height in tabular The following latex table contains two rows. The rows are identical, except for the greeen color in the first cell in the second ...
4
votes
2answers
991 views

Remove space before colorbox

I've made the command \newcommand{\pink}[1]{\colorbox{red!20}{#1}} to highlight in pink. It works fine for words and sentences, but if I want to highlight a subpart of a word, e.g. laugh\pink{ing} ...
5
votes
0answers
48 views

How to put a blank space having dimensions equal to some text [duplicate]

Possible Duplicate: How to replace a large block of text by an empty block of the same size? A friend of mine is preparing some teaching materials. In the version for the lecturer there ...
0
votes
1answer
706 views

Convert my CV to LaTeX: how to stretch text blocks vertically to fill page and color the headings

I am trying to convert my CV below to latex. Currently I have manually created it in Inkscape. I have already managed to get the headings and footers right: Code: \usepackage{xcolor} ...
2
votes
1answer
632 views

vertical space around horizontal rules between tabu rows while maintaining color

I would like to increase the vertical space before and after a horizontal rule in a tabu table but want the color that is in the cells below and above the rule to not be broken but continue right ...
3
votes
1answer
805 views

vertical align and color in table with multirow

I have the following table: \documentclass[a4paper]{report} \usepackage{booktabs} \usepackage{multirow} \usepackage[table]{xcolor} \begin{document} \begin{table}[htbp] \centering ...
6
votes
1answer
394 views

Using color before flushleft adds vertical space

A \color command before a \begin{flushleft} adds spurious vertical space when compiled using pdflatex (see MWE). The documentation (texdoc color) mentions issues with spacing. Similar issues might ...
3
votes
2answers
2k views

Padding/spacing with \cellcolor

I have a working table with cell colors: \newcommand{\ye}{\cellcolor{yellow}} \newcommand{\re}{\cellcolor{red}} \begin{tabular}{l l l} & A & B\\ Test1 & \gr Good & ...
7
votes
1answer
369 views

How does changing colour affect spacing?

In the following example, the space after the red equation is much larger than the space after the black one. \documentclass[12pt]{article} \usepackage{xcolor} \begin{document} \[ a = b \] The quick ...
28
votes
7answers
1k views

How to replace a large block of text by an empty block of the same size?

I know there exists the \phantom command, but does it work on large blocks of text (containing several paragraphs or even several pages)? What I want is to have some commands, call them \hide and ...
8
votes
1answer
1k views

Strange behaviour of titlesec, with colored titlerule

With the following MWE, i get the Section title underlined in black : \documentclass[12pt]{article} \usepackage[explicit]{titlesec} \usepackage[dvipsnames]{xcolor} \titleformat{\section}% ...
5
votes
1answer
363 views

Color changes cell height in tabular

The following code shows that a \color{red} command increases the height of a tabular cell. I want to use a switch, not a command as \textcolor{red}{text}. \documentclass{article} ...
9
votes
2answers
1k views

How do I backcolor in verbatim?

I have some code I want to typeset as verbatim (lstlisting would be ok as well) - but I want to highlight some parts of it via a different background color, i.e. something like this: \begin{verbatim} ...
10
votes
1answer
5k views

Relative padding of a minipage's paragraph

Background Created a custom command for rendering quotations (epigraphs). Problem The text in the following image has no space at the border: The word "and" is flush with the right margin. Code ...
1
vote
1answer
346 views

Moving a framed environment to the left

I want to move the following remark environment, which nicely splits over pages :), towards the left so that it is not centered anymore. I have been unsuccessfully trying for a while: would you please ...