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

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

{multicol} not quite working well enough for my purpose

Postby josephcampbell » Mon Sep 10, 2018 4:22 am

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 95 times

User avatar
Johannes_B
Site Moderator
Posts: 3825
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Sep 10, 2018 6:27 am

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: 9019
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Sep 10, 2018 5:06 pm

Hi Joseph,

welcome to the forum!

You could use the tasks package, such as:

  1. \documentclass{article}
  2. \usepackage{tasks}
  3. \DeclareInstance{tasks}{alphabetize}{default}{counter-format = {tsk[a].)},
  4. label-width = 1.4em}
  5. \begin{document}
  6. \begin{tasks}(2)
  7. \task First
  8. \task Second
  9. \task Third
  10. \task Fourth
  11. \end{tasks}
  12. \end{document}


tasks.png
tasks.png (7.54 KiB) Viewed 80 times


Or consider using xsim.

Stefan
Site admin

josephcampbell
Posts: 4
Joined: Mon Sep 10, 2018 4:12 am

Postby josephcampbell » Mon Sep 10, 2018 6:53 pm

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 77 times

josephcampbell
Posts: 4
Joined: Mon Sep 10, 2018 4:12 am

Postby josephcampbell » Mon Sep 10, 2018 6:56 pm

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: 4
Joined: Mon Sep 10, 2018 4:12 am

Postby josephcampbell » Mon Sep 10, 2018 8:06 pm

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 74 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 9019
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Tue Sep 11, 2018 11:50 am

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:

  1. \documentclass{article}
  2. \usepackage{tasks}
  3. \DeclareInstance{tasks}{alphabetize}{default}{counter-format = {},
  4. label-width = 0em}
  5. \begin{document}
  6. \begin{tasks}(2)
  7. \task \textbf{a.)} First
  8. \task \textbf{b.)} Second
  9. \task \textbf{c.)} Third
  10. \task \textbf{d.)} Fourth
  11. \end{tasks}
  12. \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
Site admin


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests