LaTeX forum ⇒ GeneralFormatting a page with many small math problems Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Formatting a page with many small math problems

Postby Xiphias » Thu Aug 13, 2015 9:07 am

Hello!

Sorry if this topic already has been covered and I could not find it.

I am currently making a math problem compendium for a lower level high school class. It consists of many smaller problems and I am having some issues in making it look good in terms of spacing and lining up problems without having to manually space out every single line.

Here is a part of my code:

  1. \documentclass[14pt,norsk,a4paper,twoside]{memoir}
  2. \usepackage[utf8]{inputenc}
  3. \usepackage[T1]{fontenc}
  4. \usepackage{babel,graphicx,varioref}
  5. \DeclareSymbolFont{letters}{OML}{ztmcm}{m}{it}
  6. \DeclareSymbolFontAlphabet{\mathrm}{letters}
  7. \title{Oppgaver 2P}
  8. \begin{document}
  9.  
  10. \maketitle
  11.  
  12. \chapter{Potenser og tall på standardform}
  13. \section{Negative tall}
  14. \subsection{Addisjon} Regn ut \\
  15. \textbf{1.10 a)} $2+(-1) $ \: \: \: \textbf{b)} $2-3 $ \: \: \: \textbf{c)} $1-3 $ \: \: \: \textbf{d)} $-3+4 $ \: \: \: \textbf{e)} $-5+2 $ \: \: \: \textbf{f)} $-1-4 $ \\
  16.  
  17. \noindent \textbf{1.11 a)} $-2+3-2 $ \: \: \: \textbf{b)} $5-1-2 $ \: \: \: \textbf{c)} $3-4-1 $ \: \: \: \textbf{d)} $-5+1-5 $ \: \: \: \textbf{e)} $3+2-1-3 $ \: \: \: \textbf{f)} $-3+(-1)-2+5 $ \\
  18.  
  19. \subsection{Multiplikasjon} Regn ut \\
  20. \noindent \textbf{1.12 a)} $3\cdot(-2) $ \: \: \: \textbf{b)} $(-2)\cdot 2 $ \: \: \: \textbf{c)} $(-4)\cdot (-2) $ \: \: \: \textbf{d)} $(-3)\cdot 2\cdot (-1) $ \: \: \: \textbf{e)} $3\cdot 1 \cdot (-1) $ \: \: \: \textbf{f)} $(-1)\cdot (-2) \cdot (-3)$
  21.  
  22. \end{document}


How could this be organized to look better and also be less work? Would having an entire set of problems in math mode and allign it somehow be better?

Thanks in advance :)

Tags:

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

Postby Johannes_B » Thu Aug 13, 2015 11:18 am

Welcome, you are dealing with LaTeX, manually adjusting stuff is seldomly needed. There shouldn't be any real work for this kind of document.

Have a look at the example below, using dedicated packages, you can easily do what you want. Using chapters might be a bit overkill here, personally i would probably go one level lower.

  1. \documentclass[14pt,norsk,a4paper,twoside,article]{memoir}
  2. \usepackage{libertine}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage[T1]{fontenc}
  5. \usepackage{babel,graphicx,varioref}
  6. \usepackage{libertine}
  7. \usepackage{exsheets}
  8. \SetupExSheets{headings-format={\normalsize\sffamily}}
  9. %\DeclareTranslation{Norsk}{exsheets-exercise-name}{}
  10. \usepackage{tasks}
  11. \settasks{label-format={\sffamily}}
  12. \DeclareSymbolFont{letters}{OML}{ztmcm}{m}{it}
  13. \DeclareSymbolFontAlphabet{\mathrm}{letters}
  14. \title{Oppgaver 2P}
  15. \begin{document}
  16. \chapter{math stuff}
  17.  
  18. \subsection{Addisjon} Regn ut% \\%Don't do that
  19.  
  20. \begin{question}
  21. \begin{tasks}(4)
  22. \task $2+(-1) $
  23. \task $2-3 $
  24. \task $1-3 $
  25. \task $-3+4 $
  26. \task $-5+2 $
  27. \task $-1-4 $
  28. \end{tasks}
  29. \end{question}
  30.  
  31. \begin{question}{6}
  32. \begin{tasks}(3)
  33. \task $-2+3-2 $
  34. \task $5-1-2 $
  35. \task $3-4-1+1-1+1-1+1-1 $
  36. \task $-5+1-5 $
  37. \task $3+2-1-3 $
  38. \task $-3+(-1)-2+5 $
  39. %\\%Don't do that
  40. \end{tasks}
  41. \end{question}
  42.  
  43. \setcounter{question}{23}%just for demonstration
  44. \subsection{Multiplikasjon} Regn ut% \\%Argh
  45. \begin{question}
  46. \begin{tasks}
  47. \task $3\cdot(-2) $
  48. \task $(-2)\cdot 2 $
  49. \task $(-4)\cdot (-2) $
  50. \task $(-3)\cdot 2\cdot (-1) $
  51. \task $3\cdot 1 \cdot (-1) $
  52. \task $(-1)\cdot (-2) \cdot (-3)$
  53. \end{tasks}
  54. \end{question}
  55.  
  56. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Postby Xiphias » Thu Aug 13, 2015 11:38 am

Perfect! This is exactly what I needed. Thank you so much! Had no idea there was a task environment.

I use chapters because the memoir environment has sections start at "0.1"

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

Postby Johannes_B » Thu Aug 13, 2015 12:13 pm

Memoir is primarily used for reports and books, but you can use global option article to get into article-mmode.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Postby Xiphias » Thu Aug 13, 2015 12:19 pm

I used memoir to get bigger font size by default. This is also probably possible in article environment, but I did not know how.

Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Postby Xiphias » Fri Aug 14, 2015 9:11 am

A small follow up question. Is it possible to have questions be numbered with "1.1 , 1.2 ..." instead of "1, 2, 3 ..."?

User avatar
Stefan Kottwitz
Site Admin
Posts: 8453
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Fri Aug 14, 2015 9:35 am

Sure, with

  1. \usepackage{amsmath}


which should be used for math in any case, and

  1. \numberwithin{question}{section}


or the same with chapter or any sectioning.

Stefan
Site admin

Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Postby Xiphias » Fri Aug 14, 2015 10:30 am

Hmmm, that is having an effect. I did \numberwithin{question}{section} which reset the counter per section. But it did not change the numbering of questions from "1, 2, 3,..." to "1.1, 1.2, 1.3..." It just started as "1, 2, 3..." for the next section.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8453
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Fri Aug 14, 2015 11:29 am

Ok, then you may also need

  1. \renewcommand*{\thequestion}{\thesection.\arabic{question}}


Stefan
Site admin

Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Postby Xiphias » Fri Aug 14, 2015 12:31 pm

I don't want to be naggy, but that did not do anything it seems.


Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 9 guests