1

I've seen answers as to how to make multiple columns, but I have Venn diagrams that go with each item in the list, and I want to make two columns of two items and their diagrams rather than one column. I've included images of what I have and the format that I would like to have. The issue I'm having is that it works when it's completely by itself, but adding anything at all to sections before it causes issues. The code I've included has a test line in a section prior to the Venn section, but without the word "Test" everything works fine, as you can see in the two images.

Here is the code I've tried. The first image is this exact code without the word "Test" in the first section. The second image is with the word "Test" in the first section.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{parskip}
\usepackage{amsmath}
\usepackage{venndiagram}
\usepackage{multicol}

\title{Test Venn Lists}
\author{James Baldwin}
\date{June 2022}

\begin{document}

\maketitle

\section{}
Test
\section{Introduction}
Draw the Venn diagrams for each of these combinations of the sets $A,B,C$:

\begin{multicols}{2}
\begin{enumerate}
% 4(i)
\item[(i)] $A\cap (B\cup C)$

\begin{venndiagram3sets}
\fillACapB \fillACapC
\end{venndiagram3sets}
% 4(ii)
\item[(ii)] $C\cup (A\cap B)$

\begin{venndiagram3sets}
\fillC \fillACapB
\end{venndiagram3sets}
% 4(iii)
\item[(iii)] $(B\cup C)\setminus A$

\begin{venndiagram3sets}
\fillBNotA \fillCNotA
\end{venndiagram3sets}
% 4(iv)
\item[(iv)] $B\cup (C\setminus A)$

\begin{venndiagram3sets}
\fillB \fillCNotA
\end{venndiagram3sets}
\end{enumerate}
\end{multicols}
\end{document}

Without "Test"

With "Test"

4
  • Absent any code to play around with on my own, I would suggest loading the multicol package and adding a a short \begin{multicols}{2} ... \end{multicols} environment. That may not work though for certain document classes or set ups, but I don't know what yours is.
    – frabjous
    Commented Jun 15, 2022 at 1:42
  • This works to get two columns of list elements, but it doesn't work when I try and put the venn diagrams within their respective items Commented Jun 15, 2022 at 2:46
  • Thre's no way to understand why it isn't working for you if you don't post any code: please provide a minimal working example.
    – frabjous
    Commented Jun 15, 2022 at 4:42
  • Updated with code I've tried. Commented Jun 15, 2022 at 13:12

2 Answers 2

1

You just need to put in line/paragraph breaks after the formulas so the diagrams aren't on the same line as them.

\documentclass[12pt]{article}
\usepackage{venndiagram}
\usepackage{multicol}

\usepackage{enumitem}
\setenumerate{label=(\roman*)}

\begin{document}

\begin{multicols}{2}
\begin{enumerate}

\item $A\cap (B\cup C)$

\begin{venndiagram3sets}
\fillACapB \fillACapC
\end{venndiagram3sets}
% 4(ii)
\item $C\cup (A\cap B)$

\begin{venndiagram3sets}
\fillC \fillACapB
\end{venndiagram3sets}
% 4(iii)
\item $(B\cup C)\setminus A$

\begin{venndiagram3sets}
\fillBNotA \fillCNotA
\end{venndiagram3sets}
% 4(iv)
\item $B\cup (C\setminus A)$

\begin{venndiagram3sets}
\fillB \fillCNotA
\end{venndiagram3sets}
\end{enumerate}
\end{multicols}

\end{document}

venn diagram list

This is unrelated, but I also loaded the enumitem package to make it easy to set the style for the list numbers.

6
  • This is still not working properly. It looks like this ibb.co/RDzg7Pn . I tried commenting out parskip package (which I need) but it is still not right. It feels closer, though. Commented Jun 15, 2022 at 14:49
  • Adding the parskip package has no effect whatsoever on this code. You're using different code than what you posted and not telling us what it is. You haven't even said what document class you're using. I had to google "venndiagram3sets" to figure out you were using the venndiagram package. Don't make us guess everything! We are not mind readers. Read the advice on creating a minimal working example. (Really read it this time.) We can't fix a problem we can't recreate.
    – frabjous
    Commented Jun 15, 2022 at 15:33
  • I've updated my original question. Thank you. I am new to Latex and this forum, so I am doing my best. The weird thing now is that it actually works just fine if I comment out all my other code, but I can't imagine it would be efficient or helpful to post every line in my document before this particular section. Commented Jun 15, 2022 at 16:28
  • There's a reason I keep trying to get you to read the mwe link. Make a copy of your current project so you can mess with it freely. Go through each line of the code and remove lines one by one. Keep going until the problem disappears. When it does then restore the line you just removed. Do something similar with intermediate lines. Whittle it down to exactly those lines needed to replicate the issue. The code you just added to the question still doesn't allow me to replicate the issue, so I can't help.
    – frabjous
    Commented Jun 15, 2022 at 17:23
  • Yes, I started doing this as soon I left the last comment. It seems that putting anything at all into a section above the Venn section causes issues. For example I made an empty section above it with no issues, but adding a single line of text caused it to go all haywire. Commented Jun 15, 2022 at 18:17
0

Using the options within the package, I was able to change the size of the circles, which allowed them to fit properly.

\begin{multicols}{2}
\begin{enumerate}
% 4(i)
\item[(i)] $A\cap (B\cup C)$

\begin{venndiagram3sets}[radius = 1cm]
\fillACapB \fillACapC
\end{venndiagram3sets}
% 4(ii)
\item[(ii)] $C\cup (A\cap B)$

\begin{venndiagram3sets}[radius = 1cm]
\fillC \fillACapB
\end{venndiagram3sets}
% 4(iii)
\item[(iii)] $(B\cup C)\setminus A$

\begin{venndiagram3sets}[radius = 1cm]
\fillBNotA \fillCNotA
\end{venndiagram3sets}
% 4(iv)
\item[(iv)] $B\cup (C\setminus A)$

\begin{venndiagram3sets}[radius = 1cm]
\fillB \fillCNotA
\end{venndiagram3sets}
\end{enumerate}
\end{multicols}
2
  • The problem was just that there wasn't enough space left on the page for the diagrams, so they were wrapping to the next page. If you don't use the \raggedcolumns column inside the multicol environment, it'll try to fill the vertical space with what does fit on that page by putting in gaps where it can, creating the ugliness you saw. Shrinking them to fit is one way of solving this, of course. If you want the group to be able to span pages you could also consider putting each formula and diagram combo inside a parbox; that way the formula can't be on a different page from the diagram either.
    – frabjous
    Commented Jun 15, 2022 at 19:31
  • E.g.,\item \parbox[t]{\linewidth}{$A\cap (B\cup C)$ \par \begin{venndiagram3sets} \fillACapB \fillACapC \end{venndiagram3sets}}
    – frabjous
    Commented Jun 15, 2022 at 19:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .