New answers tagged color
3
votes
Accepted
chemplants: fill the default pictures with TikZ options
The majority of elements provided by the chemplants package is defined as \pic. You cannot style a \pic in the same way like a node, because a \pic is, so to say, a scoped mini tikzpicture.
(In fact, ...
3
votes
Colored "sum" in display math mode
With a recent version of LaTeX (2022-06-01) you can use \mathcolor: you just need to activate color support.
\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor}
\begin{document}
\[
\...
Community wiki
3
votes
Coloring the exponent a different color than the base number
You asked,
Is there something wrong in the way I've bracketed for the color of the exponent?
You should replace
\textcolor{blue}{^{4}}
with
^{\textcolor{blue}{4}}
\documentclass{article}
\...
2
votes
Coloring the exponent a different color than the base number
I'm not entirely certain what you mean regarding your screenreader issue, but unless you have some compelling reason not to, you ought typeset this in math mode. I suspect that this might also resolve ...
0
votes
Background colour for cells with padding
By using the environment {NiceTabular} instead of the environment {tabular} and the key colortbl-like (the syntax of colortbl will be using even though colortbl itself won't be used), we have directly ...
1
vote
Table with colored rows alternating every n rows
With {NiceTabular} of nicematrix, here what you can do if you want n rows of a color followed by n rows of another color.
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{...
1
vote
A single row background colour
By use of tabularray package which is by library booktabs (which call package of the same name) compatible with booktabs rules. For units is used siunitx package:
\documentclass{article}
\usepackage{...
0
votes
xltabular colors the table caption when using rowcolors
The caption package makes the caption stick out of the width of the table. Here is a changed version of the example with the caption package commented out:
\documentclass{article}
\usepackage[...
1
vote
How to get chapter title in header the same color when chapter title itself is in multiple fonts with different colors?
You could make \myCodePar do nothing inside the header.
\NewDocumentCommand{\NotmyCodePar}{om}{#2}
\renewcommand{\chaptermark}[1]{%
% header မှာ အခန်း ၁ ကို boldfont နဲ့ မစောင်းပဲပေါ်အောင်
\...
3
votes
Are beamer, hhline, and [table]{xcolor} incompatible?
A variant with the tabularray package:
\documentclass{beamer}
\usepackage{tabularray}
\begin{document}
\begin{frame}
\centering
\begin{tblr}{
colspec={ccc},
row{1-2}={bg=gray,fg=white},
row{1}=...
1
vote
Problems in table using \hhline
Here is a way to construct that table with {NiceTabular} of nicematrix.
\documentclass{article}
\usepackage{xcolor}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{cc>{\hspace*{-2mm}}...
5
votes
Accepted
How to make a striped, colored circle in Tikz?
\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{patterns.meta}
\begin{document}
\begin{tikzpicture}
\fill[orange!50!yellow, postaction={pattern={Lines[angle=-45, distance=2mm, line width=...
1
vote
Problems in table using \hhline
Working on it, I solved my problem.
I post the solution in case someone else need it.
\documentclass{standalone}
\usepackage{multirow}
\usepackage[table]{xcolor}
\usepackage{hhline}
\newcommand{\...
2
votes
How to make a striped, colored circle in Tikz?
You need not Tikz, if you are using OpTeX. You can do something like this:
\hbox{\clipincircle 5mm 5mm 10mm 10mm{%
\pdfsave\pdfrotate{-45}%
\rlap{\kern-5mm
\vbox{\fornum 1..10\do {\hrule ...
2
votes
Are beamer, hhline, and [table]{xcolor} incompatible?
With {NiceTabular} of nicematrix, you have a key hvlines-except-borders to draw all the rules, excepted on the borders and in the blocks (created by \Block).
\documentclass{article}
\usepackage{xcolor}...
4
votes
Accepted
How to use xcolor color names in tikzpicture style?
The package tikz (by way of package pgfcore) loads the xcolor package.
In your case, the standalone class with the option tikz also loads the tikz package (and configurates other settings so that it ...
2
votes
Accepted
How to define a color that matches inserted PNG
The problem you are facing is that you use the extended color expression rgb:red,0;green,0;blue,0 that mixes colors is a very specific way that differs from more broadly used color mixing mechanisms. (...
2
votes
Coloring a world map
You can use the color syntax colorone!number!colortwo as described in the xcolor manual (see examples on page 33), in this case fill=orange!#2!violet. This causes a color gradient from violet to ...
1
vote
Bright Colors in Latex
Use the package xcolor, palettes such as dvipsnames or x11names may contain the bright colours you would like.
\usepackage[dvipsnames,x11names,table]{xcolor}
\usepackage{hyperref} % style the ...
0
votes
How to make background in tabular cell (vertical lines)?
Here is a solution with {NiceTabular} of nicematrix. That environment is similar to the classical environment {tabular} (of array) but creates also PGF/Tikz nodes under the cells, rows and columns.
...
1
vote
How do you go over the [0,1] range for Colors
The best thing to avoid the error is not to use such an invalid value. These mix values should be integers between 0 and 100.
The error is actually not from xcolor but from the backend code of the ...
0
votes
How do you go over the [0,1] range for Colors
I found out that you can work around this by defining orange!130 yourself and using it.
\colorlet{orangething}{orange!130}
Which doesn't create an error for
rowcolor{orangething}
Problem Solved
2
votes
Selecting colors which are evenly spaced around a color wheel
The same than Jasper bur on a weel:
\documentclass[border=10pt]{standalone}
\usepackage[rgb]{xcolor}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[dotted] (0,0) circle(2);
...
1
vote
How do you go over the [0,1] range for Colors
I don't think it's possible because in the xcolor documentation, it specifically states on page 13 that the percentage must be in the interval [0,100], so you're always going to get that error unless ...
1
vote
Color and style conflicts in table
Here is what you can do with {NiceTabular} of nicematrix.
The key hvlines of {NiceTabular} draws all the rules (in black).
Then, I use Tikz to draw the green rules by using the PGF/Tiks nodes created ...
2
votes
Colouring lines in table when using multicolumn
Here is a solution with {NiceTabular} of nicematrix.
In {NiceTabular}, you merge cells both horizontally and vertically with the command \Block. Then, the key hvlines will draw all the rules excepted ...
3
votes
Accepted
Selecting colors which are evenly spaced around a color wheel
You can use the hsb color model and increase the hue by 144 degrees for each row. But you need to load the xcolor package with the rgb option before loading the tikz package on order to make this work....
0
votes
Getting verbatim with soft grey background, as in tex.stackexchange
\usepackage{framed,color,verbatim}
\definecolor{shadecolor}{rgb}{.9, .9, .9}
\newenvironment{code}%
{\snugshade\verbatim}%
{\endverbatim\endsnugshade}
\begin{document}
text
\begin{code}
line ...
2
votes
Accepted
Change color in Prerex, chart
The package prerex uses different approaches to set the default appearance of the nodes. Some values are stored in variables that you cound redefine (such as \background for the background color which ...
6
votes
Accepted
Compilation error when using &
This is a bug, fixed for the next release see
https://github.com/latex3/latex2e/issues/901
There is a full patch there or simply guard the & with a \relax before the &.
2
votes
Accepted
How to Underline (with Linebreaking) within Contiguously Highlighted Text Using Soul
soul can't nest such commands, at least not if you want to allow linebreaks also in the inner command. With lualatex and the lua-ul package it would work:
\documentclass[12pt,openany]{book}
\...
3
votes
What beamer environment is text within a frame?
The question asks what Beamer styling commands to use to change the default color of text within a frame. Locally setting the text color as suggested works, but isn't quite what is being asked (as ...
3
votes
Spacing before and after \color{}
Your second attempt is almost correct. But the LaTeX's \color{...} runs \ignorespaces primitive at its end. You have to deactivate it, for example by \relax:
\newcommand{\makered}[1]{\colorlet{...
13
votes
Accepted
Spacing before and after \color{}
Are you sure that you really want to use color? This macro is a toggle, which is maybe not the best option here.
Simply use \textcolor{red}{some text} in text mode, and \mathcolor{red}{some math} in ...
0
votes
Underline text, change underline colors in consecutive sentences
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{soul}
\usepackage[dvipsnames]{xcolor} % for expanded colour set
\setul{0.5ex}{0.3ex}
\newcommand{\ulcolor}[2][Red]{\...
0
votes
Table Background color with toprule
With {NiceTabular} of nicematrix.
\documentclass{book}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{nicematrix}
\begin{document}
\begin{table}
\begin{...
2
votes
Table Background color with toprule
In order to achieve the effect, you have to do the following
reset length names that control space above and below rules in booktabs
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
...
0
votes
Color or Colour Table Based on the Cell Value for a Specific Column Only
It can be relatively easy to achieve with a couple of extra packages: etoolbox for string comparison among many other useful additions; and tabularray, which adds an option to run macros per each cell
...
0
votes
Color or Colour Table Based on the Cell Value for a Specific Column Only
With the help of the package collcell.
\documentclass{article}
\usepackage{collcell}
\usepackage[table]{xcolor}
\newcolumntype{H}{>{\collectcell\HighLightCell}l<{\endcollectcell}}
\...
1
vote
Beamer: How to change the color of itemized bullet points inside alert blocks, but not the color of alerted text?
You can update the local structure colour:
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{alertblock}{Beware!}
\setbeamercolor{local structure}{fg=structure.fg}
...
1
vote
Accepted
Transparent color in beamercolorbox
Beamer uses pgf to draw these boxes. So you can influence their opacity by changing the \pgfsetfillopacity
\documentclass[11pt]{beamer}
\usetheme{bjeldak}
\addtobeamertemplate{footline}{\...
0
votes
How to use multiple colours in a single vertical line of a table?
{NiceTabular} of the package nicematrix behaves as the classical environment {tabular} (of array) but creates also PGF/Tikz nodes under the cells, columns and rows. You can use Tikz do draw whatever ...
1
vote
How to use multiple colours in a single vertical line of a table?
Like this?
As I mentioned in the my comment, this can be relative simple done by use of tabularray package (I use version 2022C):
\documentclass[margin=3mm]{standalone}
\usepackage{xcolor}
\...
2
votes
How to use multiple colours in a single vertical line of a table?
Example solution based on @Zarko comment:
\documentclass{book}
\usepackage{colortbl}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{
vlines = {1,3,5}{red},
vlines = {2,4}{blue},
}
Alpha &...
0
votes
Change color of deleted text in changes package
This worked for me. Don't set anything for added if you want the default to stay blue, but you can change the deleted. Add command to your main file.
\setdeletedmarkup{\sout{\textcolor{red}{#1}}}
2
votes
Is it possible to reference the bullet/definition color in Beamer in a theme-independent way?
You can use the example text.fg colour:
\documentclass{beamer}
\usetheme{Berkeley}
\begin{document}
\begin{frame}
\begin{exampleblock}{Nuclear semiotics}
\begin{description}
\item[...
2
votes
Accepted
Beamer Change Formatting of Notes
\documentclass{beamer}
\setbeameroption{show notes on second screen=right}
\setbeamerfont{note page}{series=\bfseries}
\setbeamercolor{note page}{fg=red}
\begin{document}
\begin{frame}
Frame
...
Top 50 recent answers are included
Related Tags
color × 3948tikz-pgf × 517
tables × 509
beamer × 388
pgfplots × 176
listings × 175
hyperref × 153
backgrounds × 133
boxes × 103
math-mode × 98
formatting × 98
sectioning × 97
macros × 91
graphics × 91
pdftex × 87
fonts × 84
xetex × 82
colortbl × 80
table-of-contents × 79
highlighting × 77
tcolorbox × 75
spacing × 68
pdf × 58
header-footer × 57
tabularx × 53