{color} is about using color in (La)TeX documents. Popular packages are color and xcolor.

learn more… | top users | synonyms (1)

10
votes
1answer
352 views

Shaded Multicols

Does anyone know how to shade the background and put a border around a multicol environment, where page breaks are needed. There is a couple of posts around, most notably, multicols within colorbox, ...
10
votes
2answers
2k views

Color entire table

How do I get an entire table to get a background color. I dont mean the indivual cells but the entire table to get a gray shade. Something like this:
7
votes
1answer
1k views

Coloured math in beamer

I have a question: Is there any way to have math (everything between $s) in different colour than text (for example, green) in beamer?
4
votes
1answer
218 views

Can the listings package be set up to highlight Prolog code like minted does?

I am interested to know how listings can be customized to mimic the Pygments's Prolog lexer (i.e. make Prolog code represented by listings look the same as it is done with minted) I previously asked ...
4
votes
4answers
3k views

How do I globally set the text color in XeLaTeX

With pdfLaTeX I typically used the following code to globally set the text color for all text in the document: \documentclass{scrreprt} \usepackage{xcolor} \begin{document} \color{red} \section{A ...
17
votes
1answer
532 views

Defining a Color using another

I know how to define a color using \definecolor with literals to describe the color. How can I define a color using an already defined color? In other words: How can I make a color accessible under ...
6
votes
1answer
1k views

Fading a path in TikZ

I want to draw a path/plot in TikZ whose shade depends on the coordinate. For example, I want say something like \draw[color=black!\x] plot coordinates{ coord1 ... coord100}; i.e. the shade of the ...
4
votes
1answer
582 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, ...
3
votes
1answer
970 views

\RequirePackage without option clashes because of the package loading order?

I am writing a package which requires the xcolor package with table option. It is loaded in the package with \PassOptionsToPackage{table}{xcolor} \RequirePackage{xcolor} which works if my package ...
37
votes
1answer
65k views

How to change color for a block of texts?

I am editing a LaTeX paper with Emacs. Sometimes, just for myself, I want to make a block of texts less obvious (or less important to see). Instead of totally hide them, I still want them to be there. ...
16
votes
2answers
9k views

beamer: change individual bullet color for pros and cons list

Is there a "nice" way to change the color of individual bullet points? For example imagine a list like this: \begin{itemize} \item A \begin{itemize} \item pro 1 \item con 1 \item pro ...
16
votes
1answer
16k views

Custom beamer blocks for pros and cons?

I want to be able to define custom block environments in Beamer. That is, where for now I use alertblock and exampleblock I would rather use problock and conblock for a pro/con discussion. This just ...
6
votes
1answer
3k views

Colored strings by listings package

I'm trying to type my C++ homework by LaTeX in order to prepare it as a pdf file. I want to have my keywords in blue, my numbers in violet and my strings in reddish brown. I could do the two first by ...
15
votes
1answer
5k views

colors and legend in groupplots

In order to create a nice plot for the comparison of three different sites I'm using the groupplot command. Now for every site I have seven different criterias to compare. So far the plot looks like ...
13
votes
1answer
2k views

Background color gradient for entire document

Is anyone aware if it's possible to change an entire document's background to a fading color? In other words, can you take silver and slowly fade it to white from left to right and have this same ...
15
votes
1answer
2k views

coloring every other row of a table, with vertical lines

I am making a table that needs every other row colored. I thought to use this. \usepackage[table,svgnames]{xcolor} \rowcolors{1}{white}{gray!15} But my table has vertical bars ...
12
votes
1answer
3k views

How to get a colored box as the header?

I want to produce this particular template in LaTeX. With no page numbering, and rectangles in colours in a a4paper.
8
votes
1answer
8k views

Further customize color of hyperref links

I have tried to find a way to customize how internal links are colored, but I don't yet have the expertise in finding and redefining commands. In the LaTeX example below, I describe how I would like ...
16
votes
3answers
7k views

Can \includegraphics be used to change an image color?

I'm including a number of PDF images in my document using \includegraphics. I'm wondering if there's a way for LaTeX to adjust their color profile, hopefully the same way it can flip images upside ...
11
votes
2answers
5k views

Getting the color from a beamer theme?

How do I find out what color a beamer theme uses? In particular, what is the color that the Singapore theme uses? I'd like to grab this color so that I can color my tables with it and remain ...
7
votes
1answer
1k views

Add colors that depend on chapters to the TOC

I'would like to add different colors in my TOC, depending on the chapter. I've a color for the header, section subsection of each chapter (red chapter one, blue chapter two etc...). With this code I ...
17
votes
3answers
2k views

Can I have the \overfullrule rule colored in pdfLaTeX?

I know that I can use \overfullrule=5pt to get overfull lines marked with a black marker. I am using pdfLaTeX. Is there a way I can get this marker or something similar in magenta instead?
14
votes
1answer
3k views

Option clash for package xcolor

Im doing a report, and having a rather large table in my appendix. And want to emphasize some specific values by coloring some single cells. I'm trying to do it with xcolor. But receiving the error: ...
12
votes
2answers
918 views

how to create PDF in grayscale mode or TikZ figure only?

how to create PDF in grayscale mode? convert PDF color in PDF grayscale. I need the PDF in grayscale color. Or in TikZ figure only.
8
votes
2answers
272 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\] ...
7
votes
2answers
7k views

How to highlight table rows by colors in Beamer

I would like to highlight rows in tables, in rowwise, that is I would like to highlight row 1 in red, then make row 1 in black but row 2 in red, etc. How can I manage to do so in Beamer?
6
votes
2answers
2k views

coloring the page numbers in the table of contents

I try to color the page numbers of my table of contents. I'm using the package hyperref along with the options : \hypersetup{ colorlinks, linkcolor=wine-stain % custom color } Here's the ...
4
votes
1answer
1k views

How to put color gradient to “Desired Text Only”

I was looking to apply a color gradient to some text (i.e. Chapter / section headings) and I searched through the Internet but was unable to find a minimum working example. Is it something that can be ...
4
votes
1answer
1k views

Page border coloured

How to create a coloured page border for a document using KOMA-Script scrbook class? Something like this: (image taken from the memoir tutorial)
4
votes
2answers
1k views

How to highlight operators and brackets in a C listing?

How can I apply a certain style to C (or, well, any other programming language) operators? So that when I write \begin{lstlistings}[language=C++] int i = 0; if(i > 1) { // do ...
12
votes
2answers
7k views

How to color the font of a single row in a table?

I have a table and I want to make the font color red for just one row (not the background). How do I do that? Here's my table: \begin{tabular}{ l | l l l l } & 1 & 2 & 3 & 4 ...
9
votes
1answer
528 views

Heatmap of a triangular matrix (or a sparse matrix)

So let me first of all shamelessly steal heatmap code from this answer to Drawing heatmaps using TikZ \documentclass{standalone} \usepackage{colortbl} \usepackage{pgfplots} \usepackage{pgfplotstable} ...
8
votes
1answer
415 views

Filling the arrow tip and not the path using two different colors

I have a small problem with some arrows but I can't seem to find a solution. Please note that this question is different from Setting fill color for TikZ arrow tips only (and not the path itself), ...
8
votes
2answers
1k views

LaTeX color setting for math mode

I'm wondering if it's possible to do something like this in LaTeX: For all numbers (0, 1, ..., 9) in math mode, color it red. For alphabets (a, b, ..., z, A, B, ..., Z) in math mode, color it green. ...
8
votes
1answer
1k views

On using beamer's colors in a Tikz picture

For once, my question is short and simple: How do I use a beamer defined color in a tikz picture. For instance, as beamer's documentation states, using beamer's colors is done as follows: This text ...
6
votes
3answers
702 views

Different background colors for lstinline

In the following code, I've decided to use the code from Colored background in inline listings so as to redefine \verb to have the possibility to use colors for the text and the background of the ...
5
votes
3answers
1k views

Change color and background behind text of all 'description' environments

I'm new with LaTeX and like to change some parameters of the description environment throughout the document. As minimum, I like to have two arguments: color of text of item and background-color ...
5
votes
1answer
2k views

How to apply alternate row coloring in a longtable in LyX?

In attempting to apply an alternate table row coloring (using xcolor) in a longtable, one confronts, sooner or later, problems in compiling a PDF. In xcolor's documentation it is clearly stated, ...
5
votes
2answers
1k views

Background overflows when using rounded corners for listings (package: `listings`)

I'm using listings to list code in my document, and I want the code to be displayed in a frame with rounded corners and a grey background color. But the background overflows the frame, as if the frame ...
4
votes
1answer
330 views

wrapping inline long lines and adding background color

Objective I'm trying to achieve the following output. Here's the code I used to produce it. I had to hack it \begin{document} \begin{description} \item In ...
4
votes
1answer
6k views

lstlisting: how to set code color and frame color

I am using lstlisting to show some code in my PDF. The problem is that when I use: basicstyle=\fontfamily{pcr}\selectfont\footnotesize\color{red}, to change the code color (not only the language ...
3
votes
1answer
293 views

Why does adding color to a table row increase the height?

I'm trying to make a beamer slide containing a table with the text in a row styled in a different color. However, the row's height increases when colored, as opposed to the default. The same problem ...
19
votes
1answer
854 views

Caption parbox 6.0 pt too wide

For my listings, I use this caption setup: \usepackage{caption} \DeclareCaptionFont{white}{\color{white}} \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}} ...
9
votes
1answer
1k views

Is it possible to have multiple paragraphs inside a multicolumn using xcolor or a replacement?

I am getting information written by users in many lines, paragraphs, and I have to put those inside a table, I would like to know if it is possible to instruct LaTeX to accept paragraphs inside a ...
8
votes
2answers
2k views

Undefined color error, if have symbol in Chapter Title

I am getting an Package xcolor Error: Undefined color 'RED' if I use a red symbol in the Chapter title. In the MWE below, commenting the last \chapter results in an error. There seems to be no ...
8
votes
5answers
2k views

Set \strut height

I'm using quite a few \colorbox and \colorfbox in a document but they weren't sitting at the same heights (because some words contained g and this seemed to push the box down. The solution I found ...
8
votes
2answers
5k views

Section and subsection colors using titlesec

Im trying to alter the colors on my section, subsection and subsubsection. I do so using the titlesec page: \titleformat*{\section}{\Large\bfseries\sffamily\color{red}} ...
6
votes
2answers
360 views

Beamer: Strange behavior when changing background color

Using \setbeamercolor{background canvas}{bg=black} works fine if I want to change the background color. However once I used \setbeamertemplate{background canvas}{} it doesn't work anymore: ...
6
votes
2answers
855 views

How do I get fontspec to work with text color white in XeLaTeX

In a previous question ( How do I globally set the text color in XeLaTeX ), I've asked how to globally set a text colour in XeLaTeX and got some excellent answers. However, while the proposed ...
5
votes
2answers
545 views

Colored text with dcolumn

I want to typeset a table where certain numbers are going to appear red. In order to achieve the correct alignment I am using the dcolumn package. The problem is that the parsing that dcolumn does, ...