2

Im trying to use the venndiagram package but i want to change the colour it fills in the areas. Currently if you use the code for example

\begin{venndiagram2sets}
\fillOnlyA \fillNotAorB \fillA
\end{venndiagram2sets}

enter image description here

It will give a venn diagram with some bits filled in as gray. However i wish to make it a bit more colourful, maybe red. so im wishing to change a little bit in the package.

\begin{macro}{\@venn@shade}
% The colour used to shade regions.
\begin{macrocode}
\newcommand*{\@venn@shade}{lightgray}
\end{macrocode}
\end{macro}

So it will be red instead of light gray and i cant work it out. I have tried

\renewcommand{\@venn@shade}{red}

but it just comes up with a error.

  • 3
    Please -- as usual here -- make your code snippet compilable ... And add the error you got to your question, copy the complete message from the log file ... – Mensch Jul 14 at 1:35
4

You were on the right track trying to renew \@venn@shade but to do that you need to wrap the \renewcommand in \makeatletter \makeatother. See What do \makeatletter and \makeatother do?

You can also modify aspects of the tikzpicture environment used to draw the venn diagram by using the option tikzoptions=. In this way you can modify the colour of the lines used to draw the sets, the line thickness and so on.

\documentclass[border=3pt]{standalone}
\usepackage{venndiagram}

\makeatletter
\renewcommand*{\@venn@shade}{red!20}
\makeatother

\begin{document}
\begin{venndiagram2sets}[tikzoptions={draw=blue,thick}]
\fillOnlyA \fillNotAorB \fillA
\end{venndiagram2sets}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.