Tag Info

New answers tagged

0

Another option with no particular advantage, except if 1) you already have loaded colortbl and 2) you don't care that the result is not 100% the same as fbox's. \documentclass[]{article} \usepackage{colortbl} \begin{document} text 1 \begin{tabular}{|c|} \arrayrulecolor{red}\hline text2 \\\hline \end{tabular} \fbox{text3} text4 \\ text text text ...


0

\documentclass[11pt]{article} \usepackage[table]{xcolor} \usepackage{hhline} \begin{document} %\setlength\arrayrulewidth{1pt} % No need for this in your final version \newcommand{\VLINE}{\multicolumn{1}{l !{\color{gray}\vline}}} \begin{table} \centering \caption{My caption} \label{my-label} \medskip \begin{tabular}{l|l|l|l|l|l|l|} \hhline{~|------} ...


0

This is a solution using hhline and defining a new column type to replace the | separators between column, heavily inspired by the boldline package (from the shipunov bundle). I'm not too sure if some vertical lines also had to be gray, but this can be changed. In addition, I loaded the caption package, to have a better vertical spacing between caption and ...


4

Like this? \documentclass{article} \usepackage[table]{xcolor} \begin{document} \begin{table}[] \centering \caption{My caption} \label{my-label} \begin{tabular}{l|l|l|l|l|l|l|} \cline{2-7} & \multicolumn{6}{l|}{\cellcolor[HTML]{6195C9}Something} ...


4

Sure you can do it. The xcolor package offers a very sofisticated extended syntax for mixing colors (refer to pages 14-16 of the xcolor documentation for details): \documentclass[]{article} \usepackage[]{xcolor} \begin{document} \colorbox{rgb:red,0.70;green,0.05;blue,0.65}{A} % this turns to be dark violet, how to ...


2

You could define a wrapper command e.g. \rgbbox[<optional proportion>]{<rgb specification>}{<contents>}. For example: \documentclass{article} \usepackage{xcolor} \newcommand\rgbbox[3][100]{% \definecolor{rgbboxcolour}{rgb}{#2}% \colorbox{rgbboxcolour!#1}{#3}% } \begin{document} \colorbox[rgb]{0.70,0.05,0.65}{A} % this turns to be dark ...


4

Typically this is done by defining the colour first, after which you can shade (or merge it): \documentclass{article} \usepackage{xcolor} \definecolor{violet}{rgb}{0.70,0.05,0.65} \begin{document} \colorbox[rgb]{0.70,0.05,0.65}{A} % this turns to be dark violet, how to get something like {violet!25} \colorbox{violet}{A} \colorbox{violet!25}{A} ...


2

I've modified Christian's code a bit (basically destroyed visually and converted to a style) to limit the effective range of the macros defined. Otherwise string type columns also pick up the cell content setting directives. This allows to selectively enable the cell coloring. \documentclass[border=5mm]{standalone} \usepackage{pgfplotstable,colortbl} ...


1

If your colours are hard-coded then the best you can do is to redefine \color to do nothing in handout mode. \mode<handout>{% \def\color<#1>[#2]#3{} } This is risky as it assumes all uses have both the <...> and [...] arguments: a more sophisticated approach is possible. I'd strongly recommend giving each colour a name, as you can then ...


1

Here’s your example, with xecolor instead of xcolor, to support bidirectional text: \documentclass[a4paper]{article} \usepackage{xecolor} \usepackage{polyglossia} \usepackage{fontspec} \definergbcolor{titlecolor}{750000} \setmainlanguage{arabic} \setmainfont[Ligatures=TeX]{Amiri} ...


2

The basic format is: \columncolor[<color model>]{<color>} [<left overhang>][<right overhang>] The first argument (or first two if the optional argument is used) are standard color package arguments, as used by \color. \color[<model>]{<specification>} E.g. you could choose RGB. But have a look here. The last two ...


2

Once you load the xcolor package, you have access to all the color specifications this package allows; in particular, you can use the hundredths of predefined colors it provides, to the ! modifier for mixing colors, to the - for complements, etc.; using \definecolor{<name>}{<model>}{<specification>} you can build your own colors in the ...


6

Here's one possibility: \documentclass{article} \usepackage{xcolor} \usepackage{xparse} \usepackage{shadethm} \newshadetheorem{env1}{Theorem} \newshadetheorem{env2}{Lemma} \newshadetheorem{env3}{Proposition} \NewDocumentEnvironment{lemma}{o} {\definecolor{shadethmcolor}{RGB}{244,156,124}% \IfNoValueTF{#1} {\begin{env2}} ...


2

Note that in the following comparisons, I have filtered out perfect matches i.e. I only show lines where my output differs from yours. My results for the MWE case with TL 2015: report.cls 2014/09/29 v1.4h Standard LaTeX document class size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) multicol.sty 2015/03/31 v1.8m multicolumn ...


0

You could do something like this. However, note that LaTeX has no way to know when the heading ends. So if there is text apart from the heading, you will need to set the colour switch manually for that case. This is because you are not marking the headings up as headings i.e. it is non-semantic mark-up. \documentclass[12pt,letterpaper]{article} ...


0

To change the colour locally for one frame, put the commands inside e.g. {} in order to keep the changes within this group. \documentclass{beamer} \usepackage[style=verbose]{biblatex} \usepackage{filecontents}% to embed the file `myreferences.bib` in your `.tex` file \begin{filecontents*}{myreferences.bib} @online{foo12, year = {2012}, title = ...


3

\documentclass{article} \usepackage[table]{xcolor} \usepackage{array} \begin{document} \rowcolors{2}{}{gray} \begin{tabular}{@{}>{\columncolor{white}[0pt][\tabcolsep]}lll>{\columncolor{white}[\tabcolsep][0pt]}l@{}} \hline 1 & 2 & 3 & 4\\ 5 & 6 & 7 & 8\\ 1 & 2 & 3 & 4\\ 5 & 6 & 7 & 8\\ \end{tabular} ...


8

Update I simplified the code using a \pic for the fundamental domain. For the color, I present three options: Randomly selecting shades of a fixed color (red, in my example), gives different coloring for each piece: \documentclass[tikz]{standalone} \usetikzlibrary{calc} \tikzset{ fundamental/.pic={ \draw[,scale=0.4,black,fill=red!\tmp,rotate ...


2

It's a bug in KOMA-Script (2015/07/02 v3.18). The chapter uses the command \usefontofcomafont{chapter} which disables the color commands by assigning \color to \relax. This way, the argument of \color remains and the underscore in the name is typeset as text, causing trouble, because _ is not in math mode. Workarounds: A color name, which is can be ...


5

It seems like you are already able to customize the color. I am not quiet sure what is your problem. So I would just explain everything. What is the 6th argument of \tdplotsphericalsurfaceplot? (I am talking about the blank you filled by colorFunc(\tdplottheta*2)) This blank allows you to fill in a math expression which is based on \tdplotr, \tdplottheta, ...


5

An empty value disables the color, the example of egreg, simplified without the need for xcolor and without explicit color settings for links: \documentclass{article} \usepackage{color} \usepackage[colorlinks,linkcolor={}]{hyperref} \begin{document} \section{Section title}\label{test} This is an autoref to \autoref{test} \textcolor{red}{This is an ...


4

With xcolor you can refer to the current color with . \documentclass{article} \usepackage{xcolor} \usepackage[colorlinks,linkcolor=.]{hyperref} \begin{document} \section{Section title}\label{test} This is an autoref to \autoref{test} \textcolor{red}{This is an autoref to \autoref{test}} \end{document}


1

Ok, I did it. \documentclass{article} \usepackage[rgb]{xcolor} \usepackage{tikz} \begin{document} \pgfmathsetmacro{\n}{20} \begin{tikzpicture}[scale=5/\n] \draw[help lines,step=\n/10] (-\n+0.1,-\n+0.1) grid (\n-0.1,\n-0.1); \draw[very thick,->] (-\n,0) -- (\n,0) node[above]{$x$}; \draw[very thick,->] (0,-\n) -- (0,\n) ...


7

A solution with TikZ: The size adapts to the current math style. The example uses the size of letter A. The line width decreases with smaller line styles. Full example: \documentclass{article} \usepackage{tikz} \makeatletter \newcommand*{\twohalfcircle}[2]{% \ensuremath{% \mathord{% change accordingly to the symbol type ...


3

An addition to Martin Scharrer's answer. \textcolor has a side effect in math, that the contents is put in curly braces (see definition of \@textcolor). The color implementation of package color is based on groups (the color is restored at the end of the group automatically), but curly braces also make a subformula in math. This affects the horizontal ...


4

having found david's inquiry about this while cleaning out old files, i have finally investigated. while there is indeed extra (unwanted) space when two display environments are adjacent, and this space increases when color is added, the amsmath display environments are not designed to be used in this manner. all display material between two blocks of text ...


0

mesh/interior colormap allows to use a different colormap. \documentclass{standalone} \usepackage{tikz} \usepackage{tikz-3dplot} \usepackage{amssymb} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[% width=0.8\textwidth, axis equal, axis lines = center, x label style={at={(axis ...


2

The package sets the colour without using it and this is not enough in this case. You can workaround the bug by telling Beamer to activate the colours yourself: \documentclass{beamer} \usepackage{colourchange} \useoutertheme{shadow} \useinnertheme{rectangles} \title{Changing the Colours of Individual Slides} \begin{document} \frame{\titlepage} ...


4

The following also works for included eps images. RGB to CMYK Put the following code into your preamble if you cannot change the PostScript code yourself. \AtBeginDocument{\special{ps: /setrgbcolor { 1 sub neg /Y exch def 1 sub neg /M exch def 1 sub neg /C exch def /K 1 def C K lt { /K C def } if M K lt { /K M def } if Y K lt { /K Y def } ...


6

Thanks to John Kormylo, I found a simple solution: just add these two lines at the Document preamble: \usepackage{xcolor} \selectcolormodel{gray} Note that this changes only the colors generated internally in the document (including pspictures). It does not change the colors of included external graphic images.


0

It looks like in newer version of LyX one can simply change the command under Tools / Preferences / File handling / Converters / LyX Preview -> PNG to: python -tt $$s/scripts/lyxpreview2bitmap.py --png --fg="ccffff" Where in this example #ccffff was chosen as the foreground color.


3

The macro \labelitemi contains the symbol for the first level of itemize, it can be redefined to: \renewcommand*{\labelitemi}{\textcolor{gray}{\textbullet}} Full example: \documentclass{article} \usepackage{xcolor} \usepackage{blindtext} \renewcommand*{\labelitemi}{\textcolor{gray}{\textbullet}} \begin{document} \blinditemize \end{document}


2

The fastest way to fix it is to replace dvipsnames by svgnames. Comment by percusse is roughly right. The actual problem is, RoyalBlue in dvipsnames is defined using CMYK model. While we expect linear interpolation in color blending, CMYK model is handled, according to PDF standard, by the following: The C, M, and Y components shall be converted to ...


1

The root cause is that your colormap definition is invalid and pgfplots failed to complain: the colormap contains multiple values for the same offset. The problem can be reduced to the following minimal example: \documentclass{standalone} \usepackage[dvipsnames]{xcolor} \usepackage{pgfplots} \pgfplotsset{colormap={blueColormap}{%[2pt]% ...



Top 50 recent answers are included