Graphics, Figures & Tables{multicol} not quite working well enough for my purpose

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

{multicol} not quite working well enough for my purpose

Post by josephcampbell »

I wrote many many examples sections like this (see attachment). I have them in format where they are just listed in succession. I am now trying to make them into two columns, but {multicolor} is reorganizing the list from top to bottom and I need them left to right like in the attachment. So then I have to go and get everything out of order in order for it to appear as if its going right and left. It also creates a big problem when I have an example thats a different size or when I have an odd number of examples. I want two columns listed from left and right, each example. just like a standard math book thanks!
Attachments
Screen Shot 2018-09-09 at 9.17.03 PM.png
Screen Shot 2018-09-09 at 9.17.03 PM.png (28.89 KiB) Viewed 3555 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

{multicol} not quite working well enough for my purpose

Post by Johannes_B »

Welcome to the forum,

i don't understand the problem right now. I neither know what you have so far, nor how you try to achieve what you want. Or what it is exactly you are trying to achieve. Can you give a code example?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

{multicol} not quite working well enough for my purpose

Post by Stefan Kottwitz »

Hi Joseph,

welcome to the forum!

You could use the tasks package, such as:

Code: Select all

\documentclass{article}
\usepackage{tasks}
\DeclareInstance{tasks}{alphabetize}{default}{counter-format = {tsk[a].)},
  label-width = 1.4em}
\begin{document}
\begin{tasks}(2)
  \task First
  \task Second
  \task Third
  \task Fourth
\end{tasks}
\end{document}
tasks.png
tasks.png (7.54 KiB) Viewed 3540 times
Or consider using xsim.

Stefan
LaTeX.org admin
josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

{multicol} not quite working well enough for my purpose

Post by josephcampbell »

this works in some ways, but in others it fails. If my instructions are longer than a single line, then the type goes off the page. Photo attached.




-Joe



\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{tasks}

\newcommand*{\Scale}[2][4]{\scalebox{#1}{$#2$}}%
\newcommand*{\Resize}[2]{\resizebox{#1}{!}{$#2$}}%
\begin{document}



\DeclareInstance{tasks}{alphabetize}{default}{counter-format = {tsk[a].)},
label-width = 1.4em}

\begin{tasks}(2)
\task Firstasdna;lksdn;laksndcl;ansdc;lansdclknaslkcnalskdnclaksndclkansdclkansdl;cnals;dcn
\task Second
\task Third
\task Fourthalksdnflaksndflaksndfl;asnd;lasndl;ansdl;fnasl;dfnasl;dnfal;skdnfla;ksdnfl;asndflasndfalksdjlaksjdlaksdjlkajsdl;kasdl;kasdvl;kansdlvk;ansl;kvnasl;kvnaoishoqwi;lv;alksnv;kasnv;kasdvk;ajns,askd asdv
\task Fifth
\end{tasks}


\end{document}
Attachments
Screen Shot 2018-09-10 at 11.51.42 AM.png
Screen Shot 2018-09-10 at 11.51.42 AM.png (108.18 KiB) Viewed 3537 times
josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

{multicol} not quite working well enough for my purpose

Post by josephcampbell »

wait, I didn't put spaces in my sample text. I might have got it now. I will let you know if I have any more questions
josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

{multicol} not quite working well enough for my purpose

Post by josephcampbell »

ok I got a question. Sometimes I do not want the examples to go a,b,c,d... I would rather them go 1,2,3... or maybe I want them bold or something. I would rather just type those in myself. how do I do this? notice how the first example is double labeled. thanks again, you are a wizard!


\noindent\textbf{Example 2.} Determine if the following numbers appear to be rational or irrational

\begin{tasks}(2)
\task \textbf{a.)} $3.141592653589793\dots$

$irrational$
\task \textbf{b.)} $803.9292929292929292\dots$

$rational$
\task \textbf{c.)} $.3333333333333333\dots$

$rational$
\task \textbf{d.)} $1.414213562373095\dots$

$irrational$

\end{tasks}

\begin{multicols}{2}

\textbf{a.)} $3.141592653589793\dots$

$irrational$

\textbf{c.)} $.3333333333333333\dots$

$rational$

\textbf{b.)} $803.9292929292929292\dots$

$rational$

\textbf{d.)} $1.414213562373095\dots$

$irrational$

\end{multicols}
Attachments
Screen Shot 2018-09-10 at 1.04.57 PM.png
Screen Shot 2018-09-10 at 1.04.57 PM.png (290.92 KiB) Viewed 3534 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

{multicol} not quite working well enough for my purpose

Post by Stefan Kottwitz »

If you would like to do it manually, a simple table or multicol would do. I guess I would prefer a table with tabularx.

Anyway, the example above with emptied label:

Code: Select all

\documentclass{article}
\usepackage{tasks}
\DeclareInstance{tasks}{alphabetize}{default}{counter-format = {},
  label-width = 0em}
\begin{document}
\begin{tasks}(2)
  \task \textbf{a.)} First
  \task \textbf{b.)} Second
  \task \textbf{c.)} Third
  \task \textbf{d.)} Fourth
\end{tasks}
\end{document}
While it's ok for a quick and easy document, I would not recommend manual labeling, and I would not use \textbf and such font commands within a document, as I would use styles that I define in the preamble.

Stefan
LaTeX.org admin
Post Reply