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

learn more… | top users | synonyms (1)

10
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 ...
7
votes
1answer
903 views

How to prevent a page break between section title and colored rule?

I use \usepackage[explicit]{titlesec} to customize the design of my sections, subsections... In particular, i have : \titleformat{\section}% {\large\sffamily\bfseries}% {My Section \arabic{section} ...
1
vote
1answer
482 views

Colored sectioning - headings

I am working on some project in pdflatex. I am not an expert in this so I really need your help :). Well what I am trying to do: I (or somebody) will make some common .tex file (with some text) with ...
1
vote
2answers
1k views

Changing background color of external pdf files using pdfpages

The following TeX code is intended to change the background color of an external pdf file by using the pdfpages package, but it does not work for me. Does it work at all? \documentclass{minimal} ...
9
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 ...
2
votes
2answers
169 views

Smaller font sizes in boitecoloriee environment gives bad result

The boites package defines environments that allow page breaks inside framed boxes whose edges may be variously fancy. The bundle includes a few examples (shaded box, box with a wavy line on its side, ...
3
votes
1answer
2k views

Undefined color error for URL, when compiling with XeLaTeX

I've defined a different color for hyperlink using \hypersetup command with urlcolor. When I am compiling it with XeLaTeX I am getting undefined color error for the URL link, but it works fine when I ...
13
votes
1answer
2k views

Glossary link's color

How can I change the color of glossary links when using glossaries along with hyperref? I just want to change glossary link colors not all links.
5
votes
1answer
299 views

Error “Dimension too large” (\@tempdima) when using HTML color 097054 with beamer's \setbeamercovered{transparent} option

The code \documentclass{beamer} \mode<presentation>{\setbeamercovered{transparent}} \begin{document} \begin{frame} \onslide<2>{\textcolor[HTML]{097054}{foo}} \end{frame} ...
19
votes
1answer
1k 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}}} ...
3
votes
1answer
139 views

Changing the color of the typeblock by changing the color of the text

Admittedly a looooooong shot... We're all taught that one of the prime objectives of typesetting is providing a uniform typeblock color (ie. the proportion of ink / no-ink on a page) as that is ...
20
votes
1answer
8k 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 ...
3
votes
2answers
333 views

Having all one single line with black background and text in white

I want to have one line of text with black background and the text in white. The line is alone and so it can be one paragraph. I would like the coloration for the full width of the line and not only ...
8
votes
2answers
2k 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?
17
votes
2answers
2k 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) ...
5
votes
2answers
1k views

How to mark whole line or part of line with background color in a listing (listings package)?

I want to highlight either a whole line of code in a listing, or a part of line (a subexpression) using background color (to not interfere with syntax highlighting). I use lstlistings environment ...
10
votes
3answers
1k 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 ...
8
votes
2answers
425 views

Define a no-op color name which is always the current color

Using xcolor I like to define a named color which actually does not change the current color. So \textcolor{mycolor}{text} should print text in the currently active color. In other words: I'm looking ...
4
votes
1answer
1k views

bug in tabu when rowcolors are defined?

In the following code the vertical separation from cell to the bottom is negative instead of the defined \tabulinesep=5pt when \rowcolor{headcolor} and and \rowfont are defined. ...
9
votes
1answer
2k views

Fancy Theorem Environment and Colors

I'm trying to make a boxed theorem environment with colors. I thought I had done it, but I was mistaken--lists were the wrong colors. In the picture above, I would like the "list" to be the same ...
7
votes
1answer
1k views

How to omit vertical realignment when using cmidrule in different colors?

My question is similar to the one here How do I eliminate the vertical realignment when using arrayrulecolor with cmidrule? but can not be solved with the suggested answer (because the lines are ...
3
votes
2answers
364 views

Centering text in tables problems with colortabs

I am trying to produce a basic color table as shown below \documentclass{article} \usepackage{booktabs} \usepackage[dvipsnames*,svgnames]{xcolor} \usepackage{colortbl} \usepackage{array} ...
1
vote
1answer
998 views

Problem with dtx code: rowcolors unknown

I get the following error in my .dtx file: ) (./test.dtx ! Undefined control sequence. l.35 % \rowcolors {1}{colorrow}{colorbody} which I do not understand since xcolor and colortbl are loaded and ...
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 ...
4
votes
1answer
758 views

Fixed marginpars with gray background in KOMA-Script

I am an newbie looking to achieve a sort of two column effect with my LaTeX report - I am using LaTeX KOMA-script as a base. I want my margin to appear in a different background color, (say) gray, ...
15
votes
2answers
2k 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 ...
12
votes
2answers
7k views

Understanding xcolor color mixing model

I fail to understand the color mixing of xcolor. I want to have a lighter and a darker version of a color defined as \definecolor{BlueLUH}{cmyk}{1.0,0.7,0,0} My approach of lighter and darker is ...
20
votes
2answers
4k 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 ...
9
votes
3answers
7k views

Best way to create colored text boxes

I am retyping some old exams into LaTeX, and I encountered the page below Now with some clever commands, and whatnot I was able to create something almost identical. Though the spacing is a tad ...
7
votes
1answer
15k 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 ...
7
votes
4answers
1k views

Background color for the caption of a listing

I'm considering this piece of code \lstinputlisting[ language=C, breaklines=true, basicstyle=\scriptsize\ttfamily, numbers=none, ...
8
votes
2answers
1k views

Screen friendly/easy on the eyes background

Do you have suggestions on how to make a PDF file easier to read on a computer screen? By this I mean anything which isn't changing the format and layout, as this has been discussed in other questions ...
9
votes
3answers
3k views

Is it possible to invert/substitute the colors of included graphics?

I want to use the beamer package with a white on black style to create presentations. I included a simple switch to choose black on white for printout. Is there any possibility to also invert the ...
5
votes
1answer
6k views

Fortran syntax highlighting in listings

I've got some Fortran 90 source code I want to put into my thesis appendix. For this I'm using the listings package. Is it possible to have colored syntax highlighting for the Fortran code?
6
votes
3answers
479 views

Force auto-pst-pdf or pst-pdf to work with xetex

Is it possible to force auto-pst-pdf or pst-pdf to create PDF images and include them if I’m using xelatex? Background I have to typset a Book that needs OpenType fonts so I choose xelatex. The ...
20
votes
2answers
12k 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 ...
3
votes
1answer
535 views

Highlight entries in Table of Contents with coloured rectangles using TikZ an tocloft

The solution presented in How to highlight specific entries in a tocloft-formatted ToC did not work for colored background. There is a problem when using color because the colored rectangles are ...
12
votes
3answers
8k views

A version of colorbox that works inside math environments

I'd like to highlight particular parts of an amsmath environment. Here's a minimal working example: \documentclass{article} \usepackage{amsmath,color} \newcommand{\abs}[1]{\lvert#1\rvert} ...
13
votes
1answer
5k 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
3answers
2k 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 ...
6
votes
1answer
8k views

Color text in LyX?

I'm trying to color specific text in LyX, wondering how to do that with the graphical user interface (shortcut or something of sorts).
11
votes
2answers
5k views

Changing Enumerate Colors using Beamer Theme Berlin

I am trying to figure out how to change the coloring of enumerations in Beamer using the Theme 'Berlin'. I was able to change the color of the Itemize environment by: \setbeamercolor{itemize ...
4
votes
2answers
5k views

Draw box with colored background and linebreaks which adjusts to the text width?

I want to draw labels on a photograph. The labels will only contain 1..3 words, and sometimes there shall be a linebreak, e. g. Big House \newline (empty) Is it possible to create a box which draws ...
25
votes
2answers
2k views

Can I alias a color?

I would like to define some colors and then define some aliases to them. For instance, if I define the following color: \definecolor{MyColorA}{rgb}{0.1,0.2,0.3} and then want to define an alias ...
6
votes
3answers
569 views

Color page inside of the set height and width

I am trying to make a colored page in LaTeX. But so far, what I have tried colors the entire page. Which I think does not look that good. \documentclass[10pt,a4paper]{article} \usepackage{xcolor} ...
1
vote
1answer
865 views

tikz color changing path

I have tried to answer the question from TikZ: changing colour of a path half way along with decorations - unsuccessfully. Maybe it is not possible!? Can someone tell me why scoped path color change ...
14
votes
1answer
2k 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 ...
3
votes
1answer
2k views

Change Text Colour in LyX

I am using LyX (module: report). I would like to change the colour of my title from black (wich is default) to another colour but I don't know how. From what I saw from LyX's menu, colours are ...
4
votes
1answer
443 views

LaTeX color package: wrong spacing

I'm making a simple drawing, on which high school students have to complete the drawing.It's a drawing in R², so I also made a raster. If I use black lines for my raster, it is too dark, so I loaded ...
7
votes
1answer
532 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} ...