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

learn more… | top users | synonyms (1)

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 ...
17
votes
1answer
873 views

Retrieve the color definition in HTML

I need to build a table of this type: STUFF | COLOR | PICTURE | COLOR DEFINITION To retrieve the color definition, I tried to use \extractcolorspecs expecting that the third argument { color-cmd ...
17
votes
1answer
934 views

Is it possible to use spot colors in TikZ graphics?

Using ConTeXt and Metapost, it is fairly easy to define spot colors and use them in an image: \starttext \definecolor[MyRed][c=0,m=1,y=1,k=0] \definespotcolor[RedSpot][MyRed][p=1,e=MyRed] ...
17
votes
2answers
355 views

If a letter is white on white background, does a printer see it?

In preparation for press printing, I would like to produce a version of a document for printing a glossy varnish layer, where all the text is "missing", but the images and other elements are at the ...
16
votes
4answers
4k views

How to construct a coloured box with rounded corners

Here is the specs of the box. Color of the bar rule should be: \definecolor{mycolor}{rgb}{0.122, 0.435, 0.698} Radius of the 4 corners of the box: 4pt Thick line = 0.5pt Text should be 6pt ...
16
votes
5answers
5k views

Color underline a formula

I want to underline different parts of a formula with different colors. What is the best possible option? Soul seems only to provide one color per document.
16
votes
2answers
1k views

How to get actual values of colour theme colours in beamer?

How would I go about finding the actual colour (like the RGB/HSV/etc) of a particular element in a given beamer colour theme (e.g., block title bg in orchid)? I would like to use these colours in ...
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
441 views

Shades of colors

I have defined a new color with \definecolor{MyBlue}{rgb}{0.25,0.5,0.75}. Is it possible to define now "derivatives" of this in term of shades? I would like to use the same color in three different ...
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 ...
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 ...
16
votes
1answer
297 views

Color Blind Friendly Mesh Colormap

I have a plot with a mesh and it uses a lovely colormap, however, I can't find a way to make tikzpicture only use colorblind friendly colors. I'm not colorblind, but I know at least some of the people ...
15
votes
2answers
3k views

Why does \color{blue} differ from \color{Blue}?

\documentclass[dvipsnames]{article} \usepackage{xcolor} \begin{document} {\color{Blue}\bf Blue} versus {\color{blue}\bf blue}. \end{document} Why does one of them differ from ...
15
votes
1answer
2k views

Colored symbols

First of all, I apologize if this is a repetitive question. I searched, but couldn't find it. I was wondering if I can change the color of symbols in latex. For example \ast always give me a black ...
15
votes
2answers
4k views

How to use different colors for different \href commands?

I have two different \href{}{} links and I want each to be a different color. In the example below they will both be blue, how can I make each link have a different color? \documentclass{article} ...
15
votes
1answer
4k views

Change color in finished pdf file

Suppose I have a finished PDF file, say a figure generated from some software, where the ink is black. I would include it in a document. Suppose I want to include it in a beamer presentation with ...
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 ...
15
votes
1answer
382 views

xcolor black isn't black enough

I'm making a poster (using baposter) where I wish to include some microscopy images. To make the fluorescent signals stand out better, I changed the background of that cell to "pitchblack", which I ...
15
votes
3answers
2k views

How to draw text-anchored tikz line below text instead of above?

I wish to mark several pairs of from/to anchor locations in text, and use tikz to draw lines between these. The anchors are not in absolute page locations; the text determines where the endpoints of ...
15
votes
1answer
782 views

Pre-defined color cycles à la RColorBrewer?

When I have multiple line plots in pgfplots, the colors of the lines cycle through a few colors (my guess is the colors are blue, red, black and dark khaki) before repeating with different marks. See ...
15
votes
2answers
2k views

Colored background in inline listings

I would like to make inline code more distinguishable from the text surrounding it, and I thought that using a background might work (like it is done on the stackexchange pages.) Since I use the ...
15
votes
2answers
1k views

Coloring chapters and sections with respect to parts

I am using the book document class and I want to produce a document with several parts, chapters, sections, sections and subsections. I would like to make it easier for the reader by coloring ...
15
votes
2answers
314 views

Is it possible to detect the “current color”? (for example in a pgfplot drawing?)

Is there a code to deduce the current color of a PGF plot to which a node is associated? Better yet, is it possible to get the RGB decomposition as well? ... addplot coordinates{ (0,0) (1,1) } node{ ...
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 ...
15
votes
1answer
657 views

Tables: Colouring odd/even mixed up

I have a huge document (around 100 pages) and a lot of tables in it. I used \usepackage[table]{xcolor} \definecolor{lightblue}{rgb}{0.93,0.95,1.0} \rowcolors{1}{white}{lightblue} % odd = white, even ...
14
votes
4answers
811 views

Color the faces of a graph

I want to modify the image (see code below) by shading in the regions formed by the dashed lines that contain a black dot. The goal is to obtain something like How can I shade these regions? ...
14
votes
2answers
26k views

How do I color table columns and rows?

I've found question How do I fill table cells with a background color?, but the link to the documentation isn't helping me at all. I'd like to know how to color a table column given my column code, ...
14
votes
2answers
5k views

How to highlight important parts (with a gray background)

In the below link http://www.math.uiowa.edu/~goodman/algebrabook.dir/bookmt.pdf the author highlights anything which is important using a greyish color background. For example, if you see ...
14
votes
3answers
9k views

Height of colorbox

I'm trying to "highlight" two parts of a sentence by using a \colorbox like so: \colorbox{red}{This is} \colorbox{blue}{a great sentence.} The problem is that in the second part the height colorbox ...
14
votes
2answers
979 views

How do I get different colors for math and for text?

I want to include something in my LaTeX article that will make all mathematical formulae appear in black, while all text (including everything inside \text{}s in the middle of mathematical formulae) ...
14
votes
2answers
312 views

“Drill holes” using glyphs or TikZ's even odd rule for text

I know how to use TikZ even and odd rule, but what I need is to apply it on a node text. Compare I need the text to be punched out such that when I use the resulting pdf on top of a background, the ...
14
votes
2answers
497 views

Color gradient fill between three corners of a triangle

Updates Update1: Tried to implement solution by Harish Kumar (below) Update2: Added a real example of what I would like to get in the end. I have a feeling I tried to leave to many things out. ...
14
votes
2answers
4k views

How do I specify color in RGB using \hypersetup in hyperref?

How do I specify color in RGB using \hypersetup in hyperref? I know that this is the right way to do it with color names: \hypersetup{colorlinks,breaklinks, urlcolor=Maroon, ...
14
votes
2answers
1k views

Figuring out RGB or HEX color from xcolor

I have defined a color using: \definecolor{canvascolor}{rgb}{0.643,0.690,0.843} Then this is used with this command like canvascolor!75!white from xcolor. This is actually done in the beamer theme ...
14
votes
3answers
1k views

Can I change the font and colour of a letter permanently?

For my lectures, I like to colour the symbols in the equations to make it easier to follow what's going on - a bit like syntax highlighting. So all vector spaces are one colour, all sets another, e ...
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: ...
14
votes
2answers
341 views

Creating my first command

I want to create a command that will format code in a certain way. In this case I want code to be italic and red. So instead of doing \textcolor{red}{\textit code} I want to make a function, if you ...
14
votes
2answers
2k views

Coloring digits with the listings package

I'm trying to typeset some python code, and I would like integer literals to be highlighted. I've come up, after about two hours of fighting with the documentation and various other questions here and ...
14
votes
2answers
8k views

Changing style of alert environment in beamer

I would like to specify a background color in the alert environment. I can, for example, use \setbeamercolor{alerted text}{fg=blue} to change the colour of the alterted text to blue, but this ...
14
votes
1answer
5k views

Coloring columns in a table with colortbl and booktabs

I have created a rather complicated table with some columns that I want to color. For the table, I chose the booktabs and tabularx packages. For coloring the columns, I use colortbl. The problem that ...
14
votes
1answer
426 views

Color gradient filling along a path

I want to make the gradient color to follow the pipe curve below rather than to span from the left to the right. The following MWE shows the default behavior which is not what I'm looking for. ...
13
votes
2answers
846 views

Coloring a black and white PDF graphic

I have a graphic in PDF format (originally converted from an SVG) that is monochromatic (black on white). Is it possible using TikZ or PSTricks but not (Illustrator or Inkscape) to include this image ...
13
votes
2answers
665 views

How to create Multilevel Colored Boxes using tcolorbox/any other package?

tcolorbox Manual provides the following example: Can anybody please suggest me how to create exactly this type of box - The no. of rows to add must be flexible(It seems that tcolorbox has no option ...
13
votes
2answers
1k views

coloring entire row of tabular*

I would like to have the first row of all my tables colored with a certain color (below yellow) but somehow below thing is not working as expected This: \documentclass[a4paper, 12pt]{report} ...
13
votes
3answers
13k views

How to draw a colored framebox without filling the background?

I like to draw a \fbox{..} which is colored. The xcolor package gives \fcolorbox{<frame color>}{<background color>}{<text>} But this forces me to set a background color. I like ...
13
votes
3answers
4k views

How to colour multiple paragraphs?

I have a set of commands in my document's preamble that look like this: \newcommand{\nathaniel}[1]{\textcolor{blue}{[#1]}} \newcommand{\anotherAuthor}[1]{\textcolor{darkgreen}{[#1]}} They are to ...
13
votes
1answer
177 views

Spotcolor bleeds into the surrounding

This question led to a new package: xspotcolor I have a problem using spotcolor package. When using the package for redefining headers, titles, \emph etc. the color bleeds into the ...
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 ...
13
votes
1answer
1k views

Listings package: How can I format all numbers?

I want to highlight all the numbers appearing in an input code of a certain program by, for example, coloring them. By numbers I mean integer, rational and floating point numbers. I am trying with the ...
13
votes
4answers
3k views

Why can't I wrap \rowcolor in \only? (Beamer)

See the following minimal example: \documentclass[table]{beamer} \begin{document} \begin{frame}{Boo} \begin{table} \centering \small \begin{tabular}{rcc} \only<1>{\rowcolor{green}}Hey & ...