Skip to main content
23 votes
Accepted

Is it possible to change the color of the text according to the background color?

The idea is simple: use some nontrivial blending mode. You might want to tune the colors, so that "blue" minus "yellow" is "white" modify the background, so that the lower right corner looks right. ...
Symbol 1's user avatar
  • 37k
22 votes
Accepted

TIKZ: only fill 75% of the node-background with color

You can use path picture and path picture bounding box: \documentclass[tikz,margin=5mm]{standalone} \usetikzlibrary{calc} \begin{document} \tikz \node[draw] [path picture={ \fill[gray!30](path ...
esdd's user avatar
  • 86k
21 votes

Let's get fancy: Text like tag?

Here's an alternative solution with Tikz. Output Code \documentclass[margin=10pt]{standalone} \usepackage{tikz} \definecolor{backg}{RGB}{225,236,244} \definecolor{tagtxt}{RGB}{88,115,159} \...
Alenanno's user avatar
  • 37.5k
19 votes

Change the background color of a frame in Beamer

Here's a suggestion to add a bg option to the frame environment, such that background color can be invoked simply by adding the [bg] option to frame. I have not tested this beyond the template below, ...
PatrickT's user avatar
  • 3,013
18 votes
Accepted

Setting a custom RGB background color in beamer

The code contains two little mistakes. First of all, commas are missing between values. And second, RGB model is defined with values between 0 and 255, while rgb model uses values between 0 and 1. ...
Ignasi's user avatar
  • 137k
17 votes
Accepted

Chalkboard background to write on

One option could be to desig a chalkboard with tcolorbox help. \documentclass{article} \usepackage[T1]{fontenc} \usepackage{emerald} \usepackage{tikz} \usepackage{lipsum} \usepackage{simpsons} \...
Ignasi's user avatar
  • 137k
15 votes
Accepted

how to create a pdf with a transparent background

\nopagecolor of pdftex.def (and LuaTeX) disables the page color, it does not use any other color like white. Compare and look closely at the cropped images: \documentclass{article} \usepackage{xcolor}...
Heiko Oberdiek's user avatar
14 votes
Accepted

Wrap a text in a triangle

It is always appreciated if you show a bit of compilable code that shows the effort you already put into finding a solution. If you have nothing, maybe put at least a bit like: \documentclass{...
sheß's user avatar
  • 3,672
14 votes

TIKZ: only fill 75% of the node-background with color

Doing the fill in a separate step might be an option. \documentclass[tikz,margin=5mm]{standalone} \usetikzlibrary{calc,backgrounds,scopes} \begin{document} \begin{tikzpicture} \node[draw] (a) {Some ...
Torbjørn T.'s user avatar
13 votes
Accepted

Beamer: change header background color

As Andrew Swann already said in his comment, you want to modify the frametitle colour and not the headline colour (as far as I can see, the metropolis theme does not have a headline). The next problem ...
samcarter_is_at_topanswers.xyz's user avatar
12 votes
Accepted

Color in Love Heart

You can use the pagecolor package to do this: \documentclass[border=12pt,pstricks]{standalone} \usepackage{graphicx} \newsavebox\IBox \savebox\IBox{\includegraphics{duck}} \usepackage{pst-plot} \...
Alan Munn's user avatar
  • 220k
11 votes

Wrap a text in a triangle

Quick demonstration with TikZ: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \begin{document} \begin{tikzpicture} \node[ draw, align=center, regular polygon, ...
Torbjørn T.'s user avatar
11 votes
Accepted

ConTeXt: xtables zebra stripe

With natural tables this would have been easy because the environment let you set different values for even and odd rows. \startsetups [tablebackground] \setupTABLE [row] [odd] [background=color,...
Wolfgang Schuster's user avatar
9 votes

Let's get fancy: Text like tag?

You could use \colorbox{red}{text} from the standard latex color package.
David Carlisle's user avatar
9 votes

Circled text with tikz Black background and white text?

Use the fill key to set the background colour and the text key to set the text colour; in your application this means fill=black, text=white. \documentclass[border=1mm]{standalone} \usepackage{tikz} \...
gernot's user avatar
  • 49.9k
9 votes
Accepted

How to randomly assign background picture in Beamer?

The following uses pgf/tikz to generate a random number out of 1, 2 and 3. In the mwe package (which is included with xcolor) there are the image files example-image-a, example-image-b, and example-...
Skillmon's user avatar
  • 61.3k
9 votes

Change background colour to black and text to white?

Another approach could be to simply choose one of the dark colour themes \documentclass{beamer} \usepackage[brazil]{babel} \usepackage[utf8]{inputenc} \usepackage{fancybox} \title[short version]{...
samcarter_is_at_topanswers.xyz's user avatar
9 votes
Accepted

ConTeXt: Frame a Sentence

\start...\stoptextbackground is the correct thing to do but you have to set location=text. To collapse interword spaces, I define a new spacing method collapse and use it in \setuptype. I also add a ...
Henri Menke's user avatar
9 votes
Accepted

How to add background colours to a four-quadrant power diagram?

A possibility is to completely draw the regions contour with lines and arcs. Also, you can use \foreach and scope commands to simplify the task. In this case it's convenient to pre-define the needed ...
Juan Castaño's user avatar
8 votes

Matrix change row or column background

Within {pNiceMatrix} of nicematrix, you have a command \Block which may be used for highlighting a part of the matrix. \documentclass{article} \usepackage{nicematrix} \begin{document} $\begin{...
F. Pantigny's user avatar
  • 42.4k
8 votes

Changing background color of text in Latex

Just to add to the last comment. One can use the `minipage' environment to extend over several lines: \colorbox{blue!10}{ \begin{minipage}{\textwidth} \color{RoyalBlue} One line. Another line. ...
Krzysztof Podgorski's user avatar
8 votes
Accepted

TikZ: Node fill which is opaque to entities in tikzpicture but transparent to background color/image?

As @cfr said, this is viewer dependent. \documentclass[tikz]{standalone} \usepackage{pagecolor}\pagecolor{red!30} \begin{document} \begin{tikzpicture}[transparency group=knockout] \node(A)...
Symbol 1's user avatar
  • 37k
8 votes

TIKZ: only fill 75% of the node-background with color

I propose something similar: shading \documentclass[tikz,margin=5mm]{standalone} \begin{document} \tikz\node[draw, top color=gray!30,bottom color=white]{Some Text}; \end{document} EDIT Since it was ...
Moriambar's user avatar
  • 11.5k
8 votes
Accepted

Make sure the back cover of a book ends on a even page

To solve, I had to get rid of the titlepage environment, since it seems to put its contents always onto an odd page. To mimic the titlepage environments proper centering, I'm using the geometry ...
Wiebke's user avatar
  • 923
8 votes

How can I insert a background image in mdframed

I would drop mdframed. With tcolorbox it is much easier to insert such a background image: \documentclass{article} \usepackage{graphicx,tikz} \usepackage{lipsum} \usepackage[many]{tcolorbox} \begin{...
Ulrike Fischer's user avatar

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