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

learn more… | top users | synonyms (1)

17
votes
3answers
9k 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 ...
18
votes
1answer
217 views

Why does a color meant for the first typeset line *only* (with package magaz) affect the *entire* document?

I am trying to make a nice layout that gives a different style to the first line in a section using the package magaz. All examples I have seen feature some variation of small caps {\scshape text} or ...
16
votes
2answers
2k 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 ...
14
votes
2answers
6k 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 ...
11
votes
1answer
2k views

\cancel draws under thing being canceled

I'm trying to use \cancel from the cancel package to strike out some colored text but it is apparent that the diagonal line is drawn first so it doesn't do a very good job of canceling. Minimal ...
10
votes
2answers
3k 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:
6
votes
1answer
3k 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
1answer
396 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} ...
5
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
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 ...
10
votes
1answer
397 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, ...
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?
5
votes
2answers
2k 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
391 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
617 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 ...
7
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
681 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
1k 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 ...
18
votes
3answers
10k 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 ...
18
votes
1answer
17k 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
5k views

Colors and legend in groupplots/barplot

In order to compare three items I use the groupplot command. For each item I have n different criteria to compare. Is it possible to set the color for each criteria itself? Meaning the first bar in ...
6
votes
1answer
4k 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
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 ...
13
votes
1answer
3k 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 ...
9
votes
1answer
13k 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 ...
13
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.
10
votes
2answers
10k 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?
7
votes
3answers
689 views

How can I redefine the \verb|…| command?

I'd like to redefine the \verb|...| command so that it had a light-gray background and a little bit darker border around it, and a little bit of padding to make this background "box" noticable. Anyone ...
12
votes
2answers
7k 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 ...
8
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
1answer
5k views

Option clash for package xcolor

I'm writing a report, and have a rather large table in my appendix. I'd like to emphasize some specific values by coloring some single cells. I'm trying to do it with xcolor. But receiving the error: ...
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?
13
votes
2answers
1k 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.
12
votes
1answer
166 views

Going through permutations of nouns and verbs

My daughter is learning to read; I am learning TeX. So I need your help on this: I have an array/a list of nouns (basically names of people and two mythical creatures called Fara and Fu: noun = ...
10
votes
1answer
843 views

Why is it that coloring in soul in beamer is not visible

\documentclass{beamer} \usepackage{soul,color} \begin{document} \begin{frame} \hl{Hello World} \end{frame} \end{document} I process this with pdflatex and I do not see the expected highlight. ...
9
votes
2answers
2k views

Hyperref: Changing the linkcolor locally in the TOC

I found that the link-color for TOC text is identical to the link-color for Figures and Tables. When I change the color to black in the TOC also the color for Figures/Tables citation etc. is changed. ...
8
votes
2answers
435 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\] ...
6
votes
2answers
3k 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 ...
6
votes
2answers
2k 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 ...
5
votes
1answer
8k 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 ...
19
votes
1answer
943 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}}} ...
16
votes
2answers
6k 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} ...
12
votes
2answers
8k 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 ...
10
votes
1answer
2k 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 ...
10
votes
3answers
368 views

How to color just the `\vec` symbol?

How do I color only the vector symbol in \vec f? I'm using beamer, so xcolor is already loaded. Extra "points" to an answer that also explains how to fish..and not only gives me the fish. Thanks!
9
votes
1answer
494 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), ...
9
votes
1answer
652 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
2answers
2k 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. ...
6
votes
3answers
770 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 ...