2

I'm trying to recreate the below image where the defining of the variables is kind of like a horizontal list but without labels. I have tried using tasks and multicols but can't quite figure this out.

enter image description here

\documentclass[11pt, letterpaper]{article}
\usepackage{multicol}

\begin{document}

Consider the following intervals:
\begin{multicols}{2}
A = (1,5] \\
C = [4,7) 
\columnbreak
B = [1,4) \\
D = (2,5) 
\end{multicols}

\end{document}

Which results in this:

enter image description here

Sebastiano
  • 54,118
dylanjm
  • 207
  • Please post compilable code rather than fragments. It's maths: use amsmath with the environments it provides for alignment. – cfr Dec 22 '17 at 04:07
  • Welcome to TeX.SX. When you post a question, please provide a "Minimal Working Example" (MWE) that starts with \documentclass, includes all relevant \usepackage commands, ends with \end{document} and compiles without errors, even if it does not produce your desired output. – Sandy G Dec 22 '17 at 04:08

3 Answers3

4

Since it is maths, use one of the environments provided by amsmath for such things. For example:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Consider the following intervals:
\[
\begin{aligned}
  A &= (1,5] & B &= [1,4) \\
  C &= [4,7) & D &= (2,5) \\
\end{aligned}
\]
\end{document}

aligned things

cfr
  • 198,882
1

Well, this is precisely what align does.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Consider the following intervals:
\begin{align*}
A &= (1,5]&
B &= [1,4) \\
C &= [4,7) &
D &= (2,5) 
\end{align*}
\end{document}

enter image description here

  • Looks like you just beat me. I shouldn't have spent time typing in the second line! I'll delete my (nearly identical) post. – Sandy G Dec 22 '17 at 04:18
  • What is the difference between using \begin{aligned} vs. using begin{align*}? I notice the answer from @cfr puts it inside a math-mode environment but this one does not. – dylanjm Dec 22 '17 at 04:22
  • @dylanjm Your question has an answer here. If one is ever to number the equation, arguably the output is nicer with align and subequations. –  Dec 22 '17 at 04:48
1

You also can have full control on the spacing between the columns with alignat:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

Consider the following intervals:
\begin{alignat*}{2}
A &= (1,5]&\hspace{6pc}
B &= [1,4) \\
C &= [4,7) &
D &= (2,5)
\end{alignat*}

\end{document} 

enter image description here

Bernard
  • 271,350