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

learn more… | top users | synonyms (1)

6
votes
1answer
2k views

Cell coloring (highlighting) with in-out effects in a table in beamer

I need cell coloring (or highlight effect) in a cell of a table in beamer after a click (I mean, I am planning to talk about something in that frame and I will emphasize just a number in a cell at the ...
6
votes
3answers
2k views

Alternating row color two at a time in tables

How can I achieve alternating row colors in tables for two rows at a time? So two rows should have the same color, then two other rows, and so on. In the following example Bla1 & reference1 \\ ...
6
votes
1answer
8k views

\colorbox{color}{text} without increasing the height and width of the cell in a table

When using \colorbox{color}{text} to put background color for the text in a table, the text with background color seems to take more space and makes the respective cell higher and wider. Is there a ...
22
votes
2answers
639 views

How to divide document for black and color printing?

Most of my document is black text, but there is a color figure here and there. I would like to print the text on a black and white printer, and the figures on a color printer. I know i could just ...
15
votes
2answers
324 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
603 views

XeLaTeX and TikZ - how do I ensure my PDFs are using the CMYK color model?

The place I want to print my document at needs the PDF to be provided in CMYK. The document is mostly text, except for a few graphs and plots which are done in TikZ or pgfplots. As suggested in this ...
13
votes
3answers
14k 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 ...
12
votes
2answers
451 views

Print zeroes in a sparse matrix in a lighter color

For a report I need to print some sparse matrices as full matrices, so that means that there are a lot of zeroes. If I print them in the same color as the meaningful entries, it doesn't look very ...
11
votes
1answer
751 views

Error when using colour in \author

I am getting an error when I try to use \color{} in the the author field with beamer, even though the file compiles and I get the the words I want coloured in the author field. This is the error ...
10
votes
3answers
1k views

Recommended color for hyperlinks in a CV

I'm using the hyperref package, and I'm curious if there is a recommended color for hyperlinks. At the moment I am using urlcolor=BlueViolet which looks great onscreen, but when printed in b&w it ...
10
votes
4answers
2k views

How to color a region?

The following code \documentclass{article} \usepackage{tikz} \usetikzlibrary{intersections,positioning} \begin{document} \begin{tikzpicture}[radius=5] \draw (0,0) rectangle (5,5); \draw[name ...
9
votes
1answer
11k views

How do I add syntax coloring to my C++ source code in beamer

I have just learned how to insert source code into beamer with the listings package. However I dont know how to go about adding any syntax coloring on the C++ source code. How do I do that? Here ...
8
votes
2answers
1k views

Invert Background and Text Colours across Whole Document with pdflatex

When using pdflatex is there a simple way to invert the colors to give white text on a black background across the whole document? I'd like the colours to be inverted whilst I write and edit the ...
7
votes
2answers
777 views

How to define a random number with xcolor and tikz/pgf

I tried to get a random color with xcolor and tikz: \documentclass{article} \usepackage[xetex, rgb]{xcolor} \usepackage{tikz} \begin{document} \pgfmathsetseed{1} \begin{tikzpicture} ...
6
votes
0answers
125 views

Does it make sense to convert lightgray into cmyk for more legible printing results? Does this necessitate choosing a (different and) darker colour? [closed]

In my document I'm using the colour lightgray which looks nice on screen, but is barely decipherable when printed (with a BW-laser-printer). Using the xcolor pkg: Would it make sense to try and ...
6
votes
1answer
211 views

Shaded multicols II

In extending a previous question, Shaded multicols, how can I put rounded corners on the multicol environment, for the outer 4 corners (ie the corners directly next to the page margins) This question ...
6
votes
2answers
6k views

LaTeX Error: Option clash for package xcolor

I have an option clash between package xcolor and another package, but I don't know which. Here is my MWE \documentclass[10pt]{beamer} \setbeamertemplate{navigation symbols}{} \usepackage{caption} ...
5
votes
3answers
510 views

Is it possible to define a multicolumn environment with a background colour

EDIT: I should have given a MWE based on memoir (which I am using) where the inner and outer margins are initially different. I would like the margins to be the same in that new environment. (Inner ...
15
votes
2answers
5k 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, ...
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} ...
12
votes
4answers
502 views

Colored box around sentences

I want to have a colored box around the text/sentences and its width will be fixed to be 80% of the page width. I tried \fcolorbox but it can't break lines. It is possible to do it with TikZ or is ...
11
votes
2answers
1k 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 ...
9
votes
3answers
330 views

How to “bubble in”/color fill an item counter ((A),(B),(C),…) in an enumerated list

I'm trying to make an answer explanation guide for a test where the correct answer is "bubbled in". I've tried using the enumitem package and tikz as shown in this post (Enumerated list with blue ...
8
votes
1answer
5k views

Switching color and grayscale mode for \includegraphics

Suppose I have a document that includes a lot of colorful PDFs. Now I'd like to easily switch between "color" version and "greyscale version". I'm aware of \DeclareGraphicsRule, but I think this needs ...
8
votes
2answers
6k views

\cellcolor overwrites table lines

I have a table which I want to fill with multiple colors, each cell possibly different from another. Which means, I can't make use of e.g. \columncolor (as in this post). While the table without any ...
7
votes
1answer
402 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 ...
6
votes
2answers
122 views

Change the color model of an included pdf

Say I have a pdf file foo.pdf that I want to include in my bla.tex document via \includegraphics{foo.pdf}. Say that foo.pdf is a colored document and that I need bla.pdf to be in gray levels. How can ...
6
votes
1answer
3k views

Coloring arrows in \xymatrix

Is there a way to color certain (but not all) arrows using \xymatrix? I wish the following ignorant attempt would work!! \usepackage{xypic,color} \begin{document} \[ \xymatrix { ...
5
votes
4answers
747 views

Color background of chapter headings

I'm trying to change the background color of the chapter headings. I'd like the full top part of the page, including top and right margins to turn gray until the titlerule. Currently they look like ...
5
votes
2answers
6k views

(TikZ or xcolor) lighten color

I am plotting some simple stuff using TikZ like circles and lines. They are colored. I know the color I want to plot with but would like create a new color that is a lighter version of the old. ...
2
votes
1answer
94 views

How to change \headsepline color in KOMA-Scriptclasses

At the moment I am working on a rather big project in which I typeset a lecture note for a professor of mine. I want to use the headsepline the KOMA Script Class offers, but I want it to have the same ...
19
votes
1answer
426 views

Strange disappearing colored rules in beamer

I have received a booktabs bug report of \cmidrules that disappear when coloured rules are used inside beamer (together with colortbl). The problem can be illustrated with the following simple code ...
17
votes
1answer
971 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 ...
13
votes
1answer
344 views

\everymath and author color

Consider the following example: \documentclass[11pt]{paper} \usepackage[usenames]{color} \definecolor{foo}{rgb}{0.75,0.0,0.0} \everymath{\color{foo}} \title{something} \author{someone} ...
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 ...
12
votes
1answer
375 views

Tikz patterns and cmyk color model

Consider the following example. \documentclass{standalone} \usepackage[cmyk]{xcolor} \usepackage{tikz} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \tracingall \draw [pattern = ...
12
votes
2answers
1k views

Tables with colored cells and dashed lines

I would like to draw a table with some colored cells and dashed horizontal lines. Here is my first attempt using the colortbl package and the arydshln package: \documentclass[12pt]{article} ...
11
votes
1answer
456 views

What is the difference between \textcolor and \color?

I would like to define a new command to work as an alert command. If I want to alert some part of my text I would simply write \alert{}. But I want the result in red color. What is the best way to ...
11
votes
2answers
258 views

How to color delimiters

I have some special delimiters that I want to add to a glossary, those get hyperlinks and colors etc. However when i want to use those delimiters, using \left, \right and \middle becomes impossible. I ...
10
votes
1answer
138 views

Use \cellcolor in \tabulary

The \cellcolor command from package colortbl doesn't seem to have any effect in a tabulary environment, though it works in tabular. Here is a minimal example: \documentclass[a4paper]{article} ...
10
votes
1answer
951 views

white text on black background in entire table

I am looking for a way have white text on black background in the PDF output of PDFLaTeX applied to a document containing a basic table with dividing lines and some colored links. Using ...
10
votes
3answers
781 views

How can I ensure all teletype/monospaced text is in a certain color?

I'm trying to include some monospaced text, and I'd like it to be in a different color than the normal text. There will be several (read: hundreds) of instances of monospaced text, and I want it all ...
9
votes
2answers
4k views

\hhline adds white line where no line is intended

In a table, containing colored cells, i want to have a \hline dividing only some cells, similar to \cline but compatible with coloring single cells with \cellcolor, which is possible by using \hhline ...
9
votes
2answers
1k views

How to change color of some particular environment for entire document

I want to change color of particular environment in document. For example wherever I found verbatim environment or equation environment appears in my tex file. With some global settings, I want to ...
9
votes
1answer
8k views

How to define macro for colored text?

I know that it is possible to obtain colored text in Latex by including the color package and writing like \textcolor{red}{This is red text} How could I define a macro which would produce text of a ...
9
votes
2answers
10k views

Setting text color in TikZ without changing line color; conflict with double

I have a certain TikZ style that I would like to use over and over again (so I'd like to use it as a scope). Namely, I want the color of the curves to be red, with white borders (to give a "crossing ...
8
votes
2answers
1k views

Avoid addition of spaces when using colorbox in equations

Colorbox adds some spaces when I use it in equations. E.g. in \documentclass[12pt]{article} \usepackage{xcolor} \begin{document} \colorbox{yellow}{${a^2}+b^2=c^2$} ...
8
votes
1answer
2k views

Coloured equation number (without changing colour of reference using hyperref)

I am working on a file where I am using the package hyperref so that the references to equations are linked and coloured. Here is a MWE: \documentclass{article} \usepackage{amsmath} ...
8
votes
2answers
2k views

Background color for fancyvrb

For reasons unclear to me, fancyvrb doesn't have a background option. However, the minted package, which it is based on, has one, which suggests it should not be too difficult to add. The relevant ...
8
votes
3answers
3k views

Highlight environment by setting a gray background color

The title explains everything. I have a theorem with ntheorem and want to highlight it with a gray background color. What would be the easiest way to achieve this?