New answers tagged color
1
vote
How to highlight text containing citation and figure referencing?
You could use the lua-ul package for highlighting. This way you don't have to worry about citations or cross-references in your text:
% !TeX TS-program = lualatex
\documentclass{article}
\usepackage{...
0
votes
How to highlight text containing citation and figure referencing?
You can use the soul package (\usepackage{soul}), and make the reference or the citation between curly braces inside of the \hl command:
\hl{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ...
0
votes
How to make circle of text in latex?
The wheelchart package can be used.
\documentclass[border=6pt]{standalone}
\usepackage{listofitems}
\readlist\WCcolors{darkbrown,darkred,darkgreen,darkorange,darkyellow,darkblue}
\usepackage{...
6
votes
Accepted
Incompatibility between beamer and pdfrender packages?
To work around the problem, you could switch to an older version of the latex kernel:
\RequirePackage[2023/11/10]{latexrelease}
\documentclass{beamer}
\usepackage{pdfrender}
\begin{document}
\begin{...
4
votes
LaTeX Command for Simultaneous Text Coloring and Highlighting
The xcolor package provides a macro called \colorbox, which can be combined with \textcolor to generate the desired effect.
In the following example, the utility macro \highlight takes three arguments ...
2
votes
LaTeX Command for Simultaneous Text Coloring and Highlighting
Try this:
\documentclass{article}
\usepackage{xcolor} % For text color
\usepackage{soul} % For highlighting
% Define the command for coloring and highlighting
% This will color the text in dark red
...
1
vote
Option clash for package xcolor
If you used tikz related package, then one way that works for my computer is to load the xcolor before tikz. Example:
Correct:
\documentclass[]{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{...
6
votes
How to color math symbols?
In sufficiently new version of LaTeX, simply load xcolor package and use \mathcolor. Refer to texdoc mathcolor for documentation.
\documentclass{article}
\usepackage{xcolor}
\begin{document}
$\...
4
votes
Accepted
Define simple color for both draw and fill
You could define a new colour using \colorlet:
\documentclass{standalone}
\usepackage{tikz}
\colorlet{mycolor}{black!45}
\begin{document}
\begin{tikzpicture}
\draw[mycolor] (0,0) rectangle (1,1);
\...
1
vote
Accepted
Change math color except in block titles in beamer
You could redefine the block begin template like this:
\documentclass{beamer}
\usetheme{Warsaw}
\setbeamercolor{math text}{fg=blue}
\setbeamertemplate{block begin}{%
\par\vskip\medskipamount%
\...
4
votes
Rainbow-colored text strings
Here's a TikZ solution adapted from an earlier answer of mine, which might be of interest in relation to Beamer, for example.
\documentclass[border=10pt,multi,tikz]{standalone}
% ateb: https://tex....
4
votes
Accepted
Change command depending on the tcolorbox it's in
You can define \kw to select a custom color for the text which you can then (re-)define inside the relevant tcolorbox using the code option:
\documentclass{article}
\usepackage{tcolorbox}
\...
2
votes
Accepted
Color coding with versions package
Instead of creating new macros, you could use hooks to add some colour to the existing environments:
\documentclass{article}
\usepackage{xcolor}%to use the colors
\usepackage{versions}
\AddToHook{...
2
votes
Color coding with versions package
The documentation states (p. 2)
However, \begin{〈version〉}...\end{〈version〉} breaks inside macro arguments, e.g. of \footnote (it is even fragile). So there is \processifversion{〈version〉}{〈code〉} ...
7
votes
Accepted
Rainbow-colored text strings
You could use this adaptation of the gradient-text package:
\documentclass{article}
% rainbow text (based on the gradient-text package)
\makeatletter
\ExplSyntaxOn
\clist_new:N\l_gtext_First_clist
\...
8
votes
Accepted
#1# signature in macro definition
\def\foo#1#{xxx [#1]}
is primitive syntax that makes the first argument everything up to a (mandatory) { so
\foo hello world{}
would produce xxx [hello world]
It's used here to save the higher level ...
3
votes
Why do optional arguments of commands affect spacing of \mathcolor
The similar problem is in OpTeX, but not with regards to the next parameter given by an un-expandable macro. Simply
$ {\Blue a^b}_c $
gives c after a^b (i.e. with space, wrong position) because the {...
3
votes
Accepted
Why do optional arguments of commands affect spacing of \mathcolor
You can use \NewExpandableDocumentCommand that doesn't suffer from the problem of the check for the optional argument in the legacy \newcommand.
\documentclass{article}
\usepackage{xcolor}
%MINIMAL ...
1
vote
Table with overlaping colors
The package nicematrix has tools to address that kind of problems.
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{cc}[hvlines]
\CodeBefore
\rowlistcolors{3}{...
2
votes
Tikz symbols over colors in table
Here is a way to construct that table with {NiceTabular} of nicematrix.
\documentclass{article}
\usepackage{nicematrix}
\usepackage{booktabs}
\usepackage{tikz}
\usepackage{siunitx}
\definecolor{...
5
votes
Can I use \substitutecolormodel{hsb}{rgb} rather than \selectcolormodel{rgb} to draw PGF/TikZ paths with a hsb-defined colour series?
Well the problem is that xcolor doesn't support stroke and fill colors. pgf has therefore its own backend commands for stroke and fill which write the correct literals and this backend doesn't support ...
1
vote
Accepted
Coloured subsection AND text right after the subsection name
I am not sure what you want to achieve eventually, as you did not provide much information. But if you only use the sectsty package for adding color to the subsection title, you should know that you ...
4
votes
Tikz symbols over colors in table
A simple solution would be to move the checkmarks and crosses from the top row to the bottom row using \multirow{-2}{*}{\checkmark} to connect the relevant cells upwards. This way, they won't be ...
1
vote
Colored text along path in TikZ
As described in the manual, the correct option for setting the text color in a decoration with text along path (or related decorations) is text color.
Note that the defintion of options depends on ...
5
votes
Help to draw and hatch a parallelogram
% !TEX TS-program = lualatex
\documentclass{standalone}
\usepackage{tkz-euclide}
\usepackage{tkz-elements}
\usetikzlibrary{patterns,patterns.meta}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{shapes....
6
votes
Accepted
Help to draw and hatch a parallelogram
\documentclass[tikz,border=1mm,usenames,dvipsnames]{standalone}
% ateb https://tex.stackexchange.com/a/700945/: addaswyd o gwestiwn JoudaBouda: https://tex.stackexchange.com/q/700934/
\usepackage{tikz}...
2
votes
Accepted
\colorlet{saved}{.} inside caption produces error
If you really need such constructs you should hide them in a robust command, eg as defined by \NewDocumentCommand
\documentclass{article}
\usepackage{xifthen}
\usepackage{amsmath,xcolor}
\usepackage[...
0
votes
\colorlet{saved}{.} inside \equal produces error
\ifthenelse{\isempty{\colorlet{saved}{.}a}}{empty}{non empty} kind solved my problem, but I would be interested in other solutions as well. Especially solutions changing the \colorlet{saved}{.} rather ...
3
votes
Extract color command
With testcolors environment you can print the color parameters in any format, but unlike \extractcolorspec you cannot assign that values to some command, so translate this to a new definition as:
\...
8
votes
Extract color command
The first method works only for colours defined with xcolor. As Ulrike Fischer pointed out, this is not a general solution. The second works only for colours defined with l3color.
Caveat emptor ...
...
Top 50 recent answers are included
Related Tags
color × 4226tikz-pgf × 550
tables × 539
beamer × 407
pgfplots × 186
listings × 180
hyperref × 159
backgrounds × 139
math-mode × 107
formatting × 105
boxes × 103
sectioning × 100
macros × 99
pdftex × 98
graphics × 94
fonts × 89
tcolorbox × 87
xetex × 85
highlighting × 85
table-of-contents × 84
colortbl × 84
spacing × 71
pdf × 62
errors × 57
environments × 57