Graphics, Figures & Tables$A\setminus(B\cap C)=(A\setminus B)\cup(A\setminus C)$

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
christianmaurer
Posts: 1
Joined: Wed Aug 18, 2021 6:54 pm

$A\setminus(B\cap C)=(A\setminus B)\cup(A\setminus C)$

Post by christianmaurer »

How to code a graphic, consisting of three partially overlapping circles, in which the area of the subject is filled with some color?

An example for $A\setminus(B\cup C)=(A\setminus B)\cap(A\setminus C)$ is the following:

Code: Select all

% !TEX latex
\documentclass{article}
\usepackage{amsmath}
\usepackage{pst-all}

\begin{document}

\newdimen\r\r 12mm
\newdimen\y\y 1.866\r
\newdimen\yy\yy\y \advance\yy by 0.3\r

\begin{figure}\centering
\pspicture(90mm,3\r)
\pscircle*[linecolor=gray,fillstyle=solid](\r,\y){\r}
\pscircle*[linecolor=white,fillstyle=solid](\y,\y){\r}
\pscircle*[linecolor=white,fillstyle=solid](1.5\r,\r){\r}
\pscircle(\r,\y){\r}
\pscirlcle(\y,\y){\r}
\pscircle(1.5\r,\r){\r}
\rput(0.6\r,\yy){$A$}
\rput(2.4\r,\yy){$B$}
\rput(1.r\r,0.5\r){$C$}
\endpspicture
\end{figure}

\end{document}
But I have no idea, how to "psclip" (?) the example $A\setminus(B\cap C)=(A\setminus B)\cup(A\setminus C)$.

Any sort of help is highly appreciated!

Kind regards, Christian
Last edited by Stefan Kottwitz on Sat Aug 21, 2021 12:42 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10310
Joined: Mon Mar 10, 2008 9:44 pm

$A\setminus(B\cap C)=(A\setminus B)\cup(A\setminus C)$

Post by Stefan Kottwitz »

Hi Christian,

welcome to the forum!

I fixed the code formatting for you. There are some issues in the code though, such as \pscirlcle undefined (just a typo I guess) and \r is not working with \rput. Click on "Run LaTeX here" below your code to see that.

So that's perhaps not the real code? At least I cannot test that. Perhaps edit your post if you like.

Btw. I would use TikZ for this, such as here: Stefan
LaTeX.org admin
Post Reply