New answers tagged

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, ...
user avatar
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} \[ \...
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} \...
user avatar
  • 444k
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 ...
user avatar
  • 1,689
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 ...
user avatar
  • 26.6k
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{...
user avatar
  • 26.6k
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{...
user avatar
  • 258k
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[...
user avatar
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 နဲ့ မစောင်းပဲပေါ်အောင် \...
user avatar
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}=...
user avatar
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}}...
user avatar
  • 26.6k
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=...
user avatar
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{\...
user avatar
  • 425
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 ...
user avatar
  • 54.2k
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}...
user avatar
  • 26.6k
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 ...
user avatar
  • 87.8k
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. (...
user avatar
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 ...
user avatar
  • 30.6k
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 ...
user avatar
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. ...
user avatar
  • 26.6k
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 ...
user avatar
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
user avatar
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); ...
user avatar
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 ...
user avatar
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 ...
user avatar
  • 26.6k
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 ...
user avatar
  • 26.6k
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....
user avatar
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 ...
user avatar
  • 101
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 ...
user avatar
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 &.
user avatar
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} \...
user avatar
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 ...
user avatar
  • 588
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{...
user avatar
  • 54.2k
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 ...
user avatar
  • 1,734
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]{\...
user avatar
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{...
user avatar
  • 26.6k
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} ...
user avatar
  • 1,672
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 ...
user avatar
  • 1,672
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}} \...
user avatar
  • 26.6k
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} ...
user avatar
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}{\...
user avatar
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 ...
user avatar
  • 26.6k
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} \...
user avatar
  • 258k
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 &...
user avatar
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}}}
user avatar
  • 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[...
user avatar
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 ...
user avatar

Top 50 recent answers are included