Hot answers tagged

17

I interpreted the question a bit differently: cycle the colors of the dots and let the color in the left graph at a certain angle correspond to the color in the right plot at that angle. For this I wrote a small color cycle command that goes through a predefined list of colors. It uses two counters, one global counter for the current color index and one ...


6

You need to account for the depth of the text below the baseline. \documentclass{article} \usepackage{xcolor,calc,trimclip} \begin{document} \newlength\myl \newlength\myh \newlength\myd \newcommand{\bicolor}[1]{ \setlength{\myl}{0pt-\widthof{#1}}% \setlength{\myh}{\heightof{#1}}% \setlength{\myd}{\depthof{#1}}% \raisebox{0.5\myh}{\color{red}\clipbox{0pt {0....


6

How about this? I clean your code a bit, and use \pgfdeclareverticalshading{rainbow} from the newest PGF manual (page 1202) There are other kinds of shading: \pgfdeclarehorizontalshading, \pgfdeclareradialshading, \pgfdeclarefunctionalshading. For more details, see Section 114.2 Declaring Shadings in the above-mentioned PGF manual. Note: \shade and \fill can ...


5

To get the correct result, in the hyperref option of your first code, remove the space between = and {: \documentclass[ xcolor = svgnames, hyperref ={colorlinks = true, urlcolor = cyan}, ]{beamer}


4

To use a color by its RGB components directly in TikZ, see https://tex.stackexchange.com/a/343680/38080 and use for example: \tikz \fill [color={rgb,255:red,165;green,95;blue,157}] (0,0) rectangle (1,1); Alternatively, you can define a color or use a model directly: RGB is the model with red, blue, and green with range 0...255. \documentclass{article} \...


4

It is pretty clear that you cannot do this using listings alone, unless you are willing to devote a huge amount of time to it. External tools will always be helpful. If you insist on not using minted, I would say you can still benefit from Pygments. For example, you can process your Python code with the following Python script, which tries to apply different ...


4

With xetex the background color is created with a \special. In your case this is inserted in the output: \special{background gray 1} Normally this creates a second content stream with a rectangle filled with the color, but if the value is 1 (or 1,1,1 if rgb is used), xetex (xdvipdfmx) seems to optimize this away. It is probably not a bug but intended, but ...


2

You can use the solution from here and use the qr code command instead of text as input for the newly created fadingtext command \documentclass{article} \usepackage{qrcode}[] \usepackage{tikz} \usetikzlibrary{fadings, shadings} \newcounter{fadcnt}\setcounter{fadcnt}{0} \newcommand\fadingtext[3][]{% \stepcounter{fadcnt} \begin{tikzfadingfrompicture}[name=...


2

Menu Tools → Preferences → Look & Feel → Colors → ▒ bottom area


2

With {NiceTabular} of nicematrix and its built-in tools to color rows, cells and columns, you have directly the expected result. However, in order to be able to use {NiceTabular} within {threeparttable}, one has to use first the dedicated hook of threeparttable: \makeatletter \AddToHook{env/threeparttable/begin} {\TPT@hookin{NiceTabular}\TPT@hookin{...


2

You could mix it with white (or any other color really), for instance, using Dandelion!20!white ("20" here means 20% Dandelion, with the rest being white): \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{enumerate} \usepackage{graphicx} \usepackage[dvipsnames]{xcolor} \begin{document} \pagecolor{Dandelion!20!white} \color{Violet} \...


2

Here is a way, with \clines and \cellcolor. Note it is not a good idea to denote a new column type as w; this specifier is defined in recent versions of the array package. \documentclass{article} \usepackage{array} \usepackage{multirow} \usepackage[table]{xcolor} \definecolor{NbaBlue}{RGB}{181, 191, 245} \definecolor{NbaRed}{RGB}{245,...


2

Another possibility: adding supplementary c columns for the bullets and a modified \dotsep command: \documentclass{article} \usepackage{array} \usepackage[table]{xcolor} \newcommand{\dotsep}{\makebox[2\tabcolsep]{\footnotesize\raisebox{0.2pt}{\textbullet}}} \begin{document} \rowcolors{1}{}{gray!30} \begin{tabular}{p{1cm}|p{0.5cm}@{\!}>{\dotsep}c@{\,}...


2

With {NiceTabular} of nicematrix. \documentclass{article} \usepackage{nicematrix} \usepackage{xcolor} \newcommand{\dotsep}{\footnotesize\raisebox{0.2pt}{\textbullet}} \newcommand{\row}[6][]{ #1#2 & \centering #1#3 & \centering #1#4 & \centering #1#5 & #1#6 } \begin{document} \begin{NiceTabular}{p{1cm}|p{0.5cm}!{\dotsep}p{0.5cm}!{\...


2

You just need color (or xcolor) package and \newenvironment{smallredtext}{\small\color{red}}{\par}


1

As @Marijn suggested by pointing to Github there is an issue with the default.latex template, meaning that instead of \PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor} currently, template has: \PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor} Pandoc version 2.13 has this issue, but the template is fixed on GitHub therefore will be ...


1

With {NiceTabular} of nicematrix. \documentclass{article} \usepackage{xcolor} \usepackage{caption} \usepackage{nicematrix,tikz} \begin{document} \begin{table}[h] \centering \begin{NiceTabular}{>{\arabic{iRow}.}clp{6cm}} \CodeBefore \rowcolors[RGB]{1}{245, 187, 181}{181, 191, 245}[cols={1,2}] \tikz \draw [white,very thick] (1-|2) -- (...


1

Here an option with lualatex engine and babel package (you need a recent distribution) \documentclass{article} \usepackage[bidi=basic]{babel} \babelprovide[import=ar,main]{arabic} \babelfont{rm}{Amiri} \usepackage{luacode} \usepackage{luacolor} \newcommand\colr[2]{% \protect\leavevmode \begingroup \color{#1}% #2% \endgroup } \begin{luacode} ...


1

Add a % after \end{tabular}. I removed the begingroup \endgroup which is unnecessary inside an environment such as table, and simplified a bit the table preamble. \documentclass{article} \usepackage[svgnames, table]{xcolor} \usepackage{float, hhline, multirow} \begin{document} \begin{table}[H] \renewcommand{\arraystretch}{1.5} \centering \setlength{\...


1

I suggest using \columncolor because you have optional arguments for the colour overhangs on each side of the cells, combined with a \rowcolors{2}{white}{white} to neutralise colouring after the column heads: \documentclass[12pt]{article} \usepackage[labelsep=period, tableposition=top, labelfont=bf]{caption} \usepackage[table]{xcolor} %for cell colour \...


1

Here is a starting code which is a small adaptation of the code in this post. % Source: https://tex.stackexchange.com/a/444278/6880 \documentclass[11pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage[tikz]{bclogo} \newcounter{deftheoandco} \counterwithin{deftheoandco}{section} \newenvironment{definition}{ \...


1

You can do as @daleif is suggesting. The default color is orange; another color can be selected as e.g. \defi[blue]{Bleu} for a text in blue. I also added \theoremstyle{definition} before defining the definition theorem-style. \documentclass[12pt,a4paper]{report} \usepackage{amsfonts,amsthm} \usepackage{xcolor} \usepackage[francais]{babel} \theoremstyle{...


1

Your code does not work, because the font element disposition is used for the headings, too. Default setting for disposition is \normalcolor\sffamily\bfseries and the \normalcolor overwrites your color setting. You could use the hooks in the headings which are provided by the KOMA-Script classes: \documentclass{scrartcl} \usepackage{xcolor} \newcommand*\...


1

I would use \addtokomafont inside a group: \begingroup \addtokomafont{section}{\color{red}} \section{Capybara} \endgroup MWE \documentclass{scrartcl} \usepackage{xcolor} \begin{document} \tableofcontents \begingroup \addtokomafont{section}{\color{red}} \section{Capybara} \endgroup \section{title} \end{document}


1

The problem is that dinbrief overwrites core commands and so destroys the LaTeX hooks. If you do e.g. this with a current LaTeX \documentclass{dinbrief} \AtBeginDocument{\newcommand\blub{Hallo!}} \begin{document} \blub \end{document} then you get an undefined control sequence error: ! Undefined control sequence. l.14 \blub With other classes, e.g. article ...


1

Here is a way to do that with {NiceArray} of nicematrix. \documentclass{article} \usepackage{nicematrix} \usepackage{tikz} \begin{document} \[\renewcommand\arraystretch{1.5} \begin{NiceArray}{*{6}{c}}[first-row,first-col,hvlines,rules={width=0.2pt,color=white}] \CodeBefore \foreach \x in {1,...,\arabic{iRow}} \foreach \y in {1,...,\arabic{...


1

In {NiceTabular} of nicematrix, you have commands in the \CodeBefore to color the cells, rectangles, rows or columns you want. You won't have the thin white lines you see in some PDF viewers at some levels of zoom. \documentclass{article} \usepackage{xcolor} \usepackage{nicematrix} \begin{document} \begin{NiceTabular}{lllllll} \CodeBefore \rectanglecolor{...


1

The environment {NiceTabular} of nicematrix have built-in tools to color rows, columns and cells and it is directly compatible with booktabs. \documentclass{article} \usepackage{ragged2e} \usepackage{nicematrix} \usepackage{booktabs} \usepackage[per-mode=symbol]{siunitx} \begin{document} \begin{table} \centering \begin{NiceTabular}{cS[table-format=4.4]} \...


Only top voted, non community-wiki answers of a minimum length are eligible