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

learn more… | top users | synonyms (1)

4
votes
1answer
1k views

lstlisting in a box?

My problem is that I am trying to write a document with coloured sections for examples. Examples can contain code listings. Somehow I can't seem to combine a background colouring with a listing, or ...
3
votes
0answers
286 views

Regular expressions in listings [closed]

I'm looking for a possibility to use regular expression in listings. I'd like to highlight each N thats followed by 4 decimal numbers for example N1234. How can I achieve that? Here is an example: ...
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 ...
2
votes
0answers
219 views

RGB EPS figures appear as CMYK in LaTeX [closed]

When I make EPS figures in Matlab and/or Illustrator, they look RGB, however, in the DVI file and in the subsequent PDF or PS file it appears CMYK. When I open up the figures outside of LaTeX, they ...
15
votes
5answers
10k views

How to draw a square of 1cm in LaTeX filled with color?

How to draw a square of 1cm in LaTeX filled with colour? I found mdframed and framebox does this, but there need to write text inside it. I just need to draw a box.
6
votes
2answers
168 views

Highlighting code like one would in a SE post

When posting on SE, users can "highlight" code by using the ` symbol. Is there any way to get that in LaTeX? My intention is to highlight segments of code or particular functions. To be clear, I'm ...
3
votes
2answers
142 views

Background color for existing floats (e.g. w/o defining a new environment)?

I'm trying to make all my figures (including caption) backgrounded with a decent color. I already found these questions with some nice answers: How to set a background color of figure environment? ...
6
votes
1answer
1k views

Adding words to lstlisting for Python langaue

I wish to add a few keywords to some python code inserted into a latex document. I want to make 'True' & 'False' appear yellow and also some module calls such as 'ttk' appear red. I have tried ...
1
vote
1answer
266 views

lstlisting: how to align highlighted code

I want to define a couple of new commands in order to highlight parts of my code (this is actually for a trace dump, not for a programming language). My problem is that I can't seem to make the ...
4
votes
1answer
211 views

Redefining formatting commands to add colors

I'm writing a document, and I'd like for all bold text to be red. I was wondering how I could renewcommand the textbf command so that it would be wrapped in \textcolor{red}? 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), ...
0
votes
1answer
546 views

Rowcolors and tabularx: Colors not reset in each new table [duplicate]

I'm having an issue with rowcolors from the xcolor package. Whenever I use rowcolors before a table, it seems that the row counter does not reset with each tabularx environment. I read that ...
4
votes
2answers
7k views

Set background color of a box with predefined width

I would like to have something like a minipage with colored background, i.e. a box where you can predefine the width and the background color. My attempt \colorbox{green}{\begin{minipage}{\slwidth} ...
0
votes
0answers
54 views

How to put a legend for \cellcolor{blue!25} in my table caption? [duplicate]

I would like to put a reference to \cellcolor{blue!25} in the table's caption. Is it possible? Also why is the table so massive even in a makebox? I don't want to use resize, looks unprofessional. ...
8
votes
1answer
1k views

cancel with different colors

I have equations with a lot of terms and I would like to be able to specify the reason of the cancelation of those terms using a color code (for example : red if the term is null, blue if it cancels ...
6
votes
1answer
268 views

Included PDF gets corrupted after Acrobat’s color conversion

I found a strange error … I’m typesetting a musical score with Sibelius 7. And to add some text and notes I use LaTeX (i.e. xelatex but the error is the same with pdflatex). To get a complete PDF of ...
17
votes
2answers
371 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 ...
14
votes
4answers
870 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? ...
4
votes
1answer
261 views

Using Coloured Dots for References

I'm writing a document which contains multiple copied entries of several online dictionaries. In order to make the references simple enough, I thought of assigning each dictionary a colour and to put ...
1
vote
1answer
3k views

Undefined control sequence with Color Package in Custom LaTeX document class

I have the following class file shown here: % \NeedsTeXFormat{LaTeX2e} \ProvidesClass{puseniorthesis} [2008/05/02 v1.4.1 Princeton University Thesis class] \RequirePackage{setspace} ...
7
votes
1answer
393 views

Does anyone have a “\newrgbcolor{colourname}{x.x.x}” list?

When I want to use colours in LaTeX, I normally use this colour chart of predefined colours that LaTeX knows by name: However, I've recently needed to use pstricks (I think it's called) and to use ...
1
vote
1answer
266 views

revtex4-1 and colortbl doesn't fill cells

The MWE below shows that the \cellcolor command doesn't properly fill a table cell in revtex4-1 where it would do so in a simple article. Can anyone help me get fills that extend to the boundaries of ...
2
votes
0answers
825 views

Is it possible to reorganize coloring/highlighting priority in Texmaker? [closed]

I want to be able to see latex commands in Texmaker while in mathmode, but the settings file does not seem to account for priority via line rearrangement, so I was wondering if there was a way to make ...
6
votes
1answer
546 views

RGB colour macro: is it possible to divide by 255 in Latex?

I'm fiddling with source code display (Objective-C) and the listings package. I want to colour comments the same green that appears in XCode. I determined that it has an RGB value of 67, 133, 34. To ...
8
votes
2answers
436 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\] ...
4
votes
0answers
447 views

Why \nointerlineskip if background of Beamer-color frametitle is empty?

I'm trying to read the source of Beamer default outer theme (the file beamerouterthemedefault.sty). In line 144 there is this code: \defbeamertemplate*{frametitle}{default}[1][left] { ...
2
votes
1answer
173 views

Add some text on an inserted PDF

I had inserted a pdf file in latex use this code \documentclass[a4paper,12pt]{book} \usepackage{mdframed} \begin{document} \includepdfmerge{hello.pdf,1} \end{document} I want to insert some text ...
2
votes
1answer
658 views

Colorbox inside Multicols

So I am using the multicols environment and I want to have the background of some portions of the column colored. However, I see that multicols does not play well with xcolor and colored sentences ...
7
votes
1answer
172 views

Why is pdflatex automatically loading a ConTeXt package and crashing

If I process the following MWE with pdflatex (TeXLive 2012, Linux) \documentclass{article} \usepackage{color} \def\mymacro#1{#1} \begin{document} \pdfinfo{/Title (Some text \textbf{This macro causes ...
2
votes
1answer
1k views

How to color citation brackets using hyperref?

I want to color the brackets of inline citation like: some text[9] where it is written in latex like this some text\cite{9}. Now hyperref only colors the number "9" without the brackets "[]". Is there ...
1
vote
1answer
826 views

\autoref with links that include only the number, but not the text, and have counter-dependent colors

I would like the functionality of hyperref's \autoref, but in a way that the link border box covers only the number and not the preceding text (e.g. "section"). This is normally possible with the ...
32
votes
3answers
3k views

Best practice for hyperref link colours?

I'm using the hyperref package with the option colorlinks=true. However, I'm not happy with the default link colours: for instance, citation links appear in a flamboyantly bright green that hurts my ...
7
votes
3answers
678 views

Use of shaded box for section numbering only?

I have been wondering "how to get shaded box for section numbers only"? Also, How to get grey square in between left mark and page number in the header? In code below I can get solid black square. I ...
4
votes
1answer
142 views

Re-color alphabets in mathmode

In user700902's answer to this thread, the following code is suggested to color alphabets A-Z green: \makeatletter \def\colorizemath #1#2{% \expandafter\mathchardef\csname ...
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. ...
4
votes
2answers
202 views

Colored “sum” in display math mode

The line \[ \textcolor{green}{\sum}_{k=0}^n \] makes the k=0 and n parts go to the right of Sigma instead of at the top and bottom, as it should be. Can we retain k=0 and n at the top and bottom?
5
votes
1answer
935 views

Robust colored background for parts of the document

I would like to set off certain parts of my document by giving them a colored background. With the help of adjustbox I was able to write an environment that does more or less what I want: It puts its ...
6
votes
1answer
716 views

Uncovering items with changing bullet color

In this case consecutive items get covered. How could I change this behaviour so that all items would be black and only bullets would get different colours? \documentclass{beamer} ...
14
votes
1answer
381 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} ...
4
votes
1answer
265 views

Placing text at random positions on the screen in beamer

I am creating a presentation and for the Q&A session slide, I want to show question marks (?) in various colors and sizes in random locations on the screen. Is this possible in beamer?
4
votes
1answer
650 views

Why keywordstyle is not taken into consideration no bold, no red color?

When I have this code with .sty file from here \begin{lstlisting}[language=Go, firstnumber=1, captionpos=b, caption=Golang, label=amb] // You can edit this code! // Click here and start typing. ...
6
votes
1answer
324 views

PDFLaTeX Color Space

Background Am using TeX Live 2012, pdflatex, and latexmk to produce the document, on Ubuntu Linux. Problem In the following image, Okular is shown on the left and Adobe Acrobat Reader is shown on ...
5
votes
1answer
220 views

Automatically choosing preset color schemes in pgfplots based on number of entries

This is really more of a question to satisfy personal curiosity than to solve a real problem. When choosing the colour schemes for my plots, I try to select colours that will work well with the ...
8
votes
1answer
517 views

Is there a way to assign different colors to different authors in fixme?

I use fixme in multiuser mode, and would like different authors to have different colors (like the track changes feature in word). I know that I can use todonotes, but I like the fixme interface (and ...
5
votes
1answer
141 views

Problem with \rowcolor and monochrome option

I have a document that I wish to distribute both in color and monochrome. It contains tables and makes use of colored rows. Problem is, when I use the monochrome option for the xcolor package the ...
1
vote
0answers
218 views

How do I debug the message “Argument of \XC@definec@lor has an extra }” [closed]

Can anyone provide me with some intuition about what might cause an error like this? Argument of \XC@definec@lor has an extra } I am unable to produce an MWE that demonstrates the error, as it ...
1
vote
0answers
40 views

why are table lines are not black? [duplicate]

my problem is that the lines of my tables (not all but most of them) are not really black but gray. Furthermore, the gray lines are also thinker than the other, which makes my tables look really bad. ...
0
votes
1answer
109 views

How to color the ToC and the references with a different color?

As the title reads, I'd like to color my ToC in let's say red and the references in my document with another color let's say blue. here's a MWE of my document : \documentclass{report} ...
3
votes
2answers
299 views

link size and color (nameref)

I create a link with \nameref: \section*{\Huge {\color{DarkRed}This is a headline}} \label{sec:headline} When I reference to this section with \nameref{sec:headline} The link is displayed the ...
2
votes
1answer
67 views

Automate replacement of `\not` when in `\bm` mode

Hendrik Vogt has provided a \longnot macro to alleviate the issues related to Interaction of \boldmath and \not. This seems to work fine, but I run into a snag when I try to automatically use ...