将问题要点放入表格中的括号中

将问题要点放入表格中的括号中

我想将问题的分值与边距对齐,并放在括号内外层封装

梅威瑟:

\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}

所以我想将“10 pont”替换为“(10 pont)”。我该怎么做?

答案1

如果你想放置全部括号中的点(即用\pointssum和朋友创建的点)可以定义一个命令

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

然后设置选项

\SetupExSheets{
  points/format = \pointsformat
}

如果您只想将要点放在括号中的边距中,则需要修改用于问题的标题实例:

\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}

在此处输入图片描述

相关内容