GeneralFormatting a page with many small math problems

LaTeX specific issues not fitting into one of the other forums of this category.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Formatting a page with many small math problems

Post by Johannes_B »

Did i understand you correct? You want the numbering scheme to be question.task)?



Certainly doable, but it will make everything look crowded and i guess your students will get the grips with current numbering scheme. ;-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Formatting a page with many small math problems

Post by Stefan Kottwitz »

Xiphias wrote:that did not do anything it seems.
I don't have your code so I cannot test it. Your code example from above is different and it doesn't contain a question counter. Perhaps post an updated minimal example with the current status.

Stefan
LaTeX.org admin
Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Formatting a page with many small math problems

Post by Xiphias »

I want the nice environment of tasks in terms of spacing and being able to sort problems without having to change any numbers, but I would like to be able to have the questions be numbered according to sections as this will end up as a longer compendium.

Here is some current minimal code:

Code: Select all

\documentclass[14pt,norsk,a4paper,twoside,article]{memoir}
\usepackage{libertine}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel,graphicx,varioref}
\usepackage{libertine}
\usepackage{exsheets}
\usepackage{amsmath}
\numberwithin{question}{section}
\renewcommand*{\thequestion}{\thesection.\arabic{question}}
\SetupExSheets{headings-format={\normalsize\sffamily}}
\usepackage{tasks}
\settasks{label-format={\sffamily}}
\DeclareSymbolFont{letters}{OML}{ztmcm}{m}{it}
\DeclareSymbolFontAlphabet{\mathrm}{letters}
\title{Oppgaver 2P}
\begin{document}
\chapter{Potenser og tall på Standardform}
\section{Negative tall}
\subsection{Addisjon}
\begin{question}
\begin{tasks}(3)
\task  $2+(-1) $ 
\task $2-3 $
\task $1-3 $ 
\task $-3+4 $
\task $-5+2 $ 
\task $-1-4 $ 
\end{tasks}
\end{question}

\begin{question}
\begin{tasks}(3)
\task $-2+3-2 $ 
\task $5-1-2 $ 
\task $3-4-1 $ 
\task $-5+1-5 $ 
\task $3+2-1-3 $ 
\task $-3+(-1)-2+5 $
\end{tasks}
\end{question}

\subsection{Multiplikasjon}
\begin{question}
\begin{tasks}(3)
\task $3\cdot(-2) $ 
\task $(-2)\cdot 2 $ 
\task $(-4)\cdot (-2) $
\task $(-3)\cdot 2\cdot (-1) $ 
\task $3\cdot 1 \cdot (-1) $ 
\task $(-1)\cdot (-2) \cdot (-3)$
\end{tasks}
\end{question}

\end{document}
(maybe not so minimal after all...)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Formatting a page with many small math problems

Post by Johannes_B »

Like this?

Code: Select all

\documentclass[14pt,norsk,a4paper,twoside,article]{memoir}
\usepackage{libertine}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel,graphicx,varioref}
\usepackage{libertine}
\usepackage{exsheets}
\SetupExSheets{headings-format={\normalsize\sffamily},counter-within=section}
%\DeclareTranslation{Norsk}{exsheets-exercise-name}{}
\usepackage{tasks}
\settasks{label-format={\sffamily}}
\DeclareSymbolFont{letters}{OML}{ztmcm}{m}{it}
\DeclareSymbolFontAlphabet{\mathrm}{letters}
\title{Oppgaver 2P}
\begin{document}
\chapter{math stuff}

\section{Addisjon} Regn ut% \\%Don't do that

\begin{question}
\begin{tasks}(4)
\task  $2+(-1) $ 
\task $2-3 $
\task $1-3 $ 
\task $-3+4 $
\task $-5+2 $ 
\task $-1-4 $ 
\end{tasks}
\end{question}

\begin{question}{6}
\begin{tasks}(3)
\task $-2+3-2 $ 
\task $5-1-2 $ 
\task $3-4-1+1-1+1-1+1-1 $ 
\task $-5+1-5 $ 
\task $3+2-1-3 $ 
\task $-3+(-1)-2+5 $
%\\%Don't do that
\end{tasks}
\end{question}

\section{Multiplikasjon} Regn ut% \\%Argh
\begin{question}
\begin{tasks}
\task $3\cdot(-2) $ 
\task $(-2)\cdot 2 $ 
\task $(-4)\cdot (-2) $
\task $(-3)\cdot 2\cdot (-1) $ 
\task $3\cdot 1 \cdot (-1) $ 
\task $(-1)\cdot (-2) \cdot (-3)$
\end{tasks}
\end{question}

\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.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Formatting a page with many small math problems

Post by cgnieder »

Stefan_K wrote:

Code: Select all

\numberwithin{question}{section}
The exsheets package also has

Code: Select all

\SetupExSheets{
  counter-within = section
}
In order to see the questions/exercises numbered 1.1, 1.2, etc one also needs to set the counter format accordingly:

Code: Select all

\documentclass{article}
\usepackage{exsheets}

\SetupExSheets{
  counter-within = section ,
  counter-format = se.qu
}

\begin{document}

\section{Foo}
\begin{question}
  first one
\end{question}
\begin{question}
  second one
\end{question}

\end{document}
The tasks environment could be used to get sub-questions inside a main question:

Code: Select all

\documentclass{article}
\usepackage{exsheets,tasks}

\SetupExSheets{
  counter-within = section ,
  counter-format = se.qu
}

\begin{document}

\section{Foo}

\begin{question}
  \begin{tasks}(4)
    \task one
    \task two
    \task three
    \task four
  \end{tasks}
\end{question}

\begin{question}
  \begin{tasks}(4)
    \task one
    \task two
    \task three
    \task four
  \end{tasks}
\end{question}

\end{document}
exsheets.png
exsheets.png (12.23 KiB) Viewed 5682 times
Regards
site moderator & package author
Xiphias
Posts: 12
Joined: Thu Aug 13, 2015 9:02 am

Re: Formatting a page with many small math problems

Post by Xiphias »

That worked :)

Thanks for all the help from all of you!
Post Reply