4

I want align the points value of questions to margin and put inside brackets with exsheets package.

MWE:

\documentclass[a4paper]{article}
\usepackage[load-headings,load-tasks,]{exsheets}
\usepackage{lipsum}
\SetupExSheets{
    points/name = pont,
    points/number-format=\textit,
    headings = margin-nr,
    headings-format = \normalfont,
    counter-within=section,
    solution/name = Megoldás
}
\DeclareInstance{exsheets-heading}{my-no-nr}{default}{
    toc-reversed = true,
    indent-first = true,
    vscale = 2,
    post-code = \rule{\linewidth}{1pt},
    title-format = \Large\scshape,
    join = {
        main[l,vc]title[l,B](0pt,0pt) ;
    },
}
\RenewQuSolPair
  {question}[headings=margin-nr]
  {solution}[headings=my-no-nr]
%
\begin{document}
\begin{question}{10}
    \lipsum[1]
\end{question}
\begin{question}{10}
    \lipsum[2]
\end{question}
\end{document}

So I want replace "10 pont" to "(10 pont)". How can I do this?

1 Answer 1

5

If you want to place all appearances of points in parentheses (i.e. also those created with \pointssum and friends) you can define a command

\newcommand*\pointsformat[1]{(#1)}

and then set the option

\SetupExSheets{
  points/format = \pointsformat
}

If you only want to place the points in the margin in parentheses you need to modify the headings instance you're using for the questions instead:

\documentclass[a4paper]{article}
\usepackage[load-headings,load-tasks,]{exsheets}
\usepackage{lipsum}
\SetupExSheets{
    points/name = pont,
    points/number-format=\textit,
    headings = margin-nr,
    headings-format = \normalfont,
    counter-within=section,
    solution/name = Megoldás
}
\DeclareInstance{exsheets-heading}{my-no-nr}{default}{
    toc-reversed = true,
    indent-first = true,
    vscale = 2,
    post-code = \rule{\linewidth}{1pt},
    title-format = \Large\scshape,
    join = {
        main[l,vc]title[l,B](0pt,0pt) ;
    }
}
\DeclareInstance{exsheets-heading}{margin-nr}{default}{
  runin = true ,
  attach = {
    main[l,vc]number[r,vc](-.333em,0pt) ;
    main[r,vc]points[l,vc](\linewidth+\marginparsep,0pt)
  } ,
  points-pre-code = ( ,  % <= this is different
  points-post-code = ) , % <= this is different
}

\RenewQuSolPair
  {question}[headings=margin-nr]
  {solution}[headings=my-no-nr]
%
\begin{document}
\begin{question}{10}
    \lipsum[1]
\end{question}
\begin{question}{10}
    \lipsum[2]
\end{question}
\end{document}

enter image description here

1
  • Wow! Great and very detailed answer! Thank you very much!
    – uzsolt
    Commented Dec 5, 2013 at 7:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .