0

You can easily display the result of yes/no polls during a meeting like this:

\begin{Vote}
    \vote{Next meeting at 11am?}{2}{1}{1}
\end{Vote}

I'm looking for a way to display the result of question with multiple possible options.

e.g.:

Time next meeting?
10am: 2
11am: 4
6pm: 0

Any idea how to specify this in LaTeX?

Thruston
  • 42,268

2 Answers2

1

The vote options in the minutes package are defined using a chain of commands that are called sequentially, called \min@voteI (yes), \min@voteII (no), \min@voteIII (no vote), \min@voteIV (decision) and some more commands to output the table. If you want more options you can modify or add commands in this chain.

A relatively easy way is to put a new command at the start of the chain, for example \min@voteO (note that this is a capital letter o and not the number 0). To minimize the amount of code that needs to be added you can sacrifice a bit of semantic correctness and use this new command to replace \min@voteI, setting the values for the first two vote options as a partial table, and after that skip to \min@voteII. This means that you can leave the rest of the chain unmodified, where it is assumed that there are only three options (yes/no/no vote).

A syntactical issue with this approach is that the label for the first option (and in the MWE below also the second option) cannot be optional as in the normal \vote command (with 'yes' as default) but this is not desired anyway for a multi-option vote.

Adding even more options can be done in the same way by modifying the \min@voteO command to allow for more arguments. With this approach it is not possible to add an arbitrary number of options, for this you would need list parsing functionality (which is certainly possible but it would mean a complete rewrite of the voting code).

MWE, showing both the new and the original command:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{minutes}
\makeatletter
\newcommand{\votethree}[1]{
\gdef\min@voteT{#1}%
\min@voteO
}
\newcommand{\min@voteO}[4]{
\gdef\min@voteTI{%
#1: & #2\\
#3}
\gdef\min@voteVI{#4}
\min@voteII
}
\makeatother

\begin{document}
\begin{Minutes}{Meeting at 9am}
\votethree{Next meeting}{10am}{2}{11am}{4}[6pm]{0}{1}[11am]
\vote{Next meeting}[11am]{2}[12pm]{1}{1}[11am]
\end{Minutes}
\end{document}

Result:

enter image description here

Marijn
  • 37,699
0

Two different macros are needed; I call the first \yeanay, for “yes/no” votes. With \multiplevotes you can have as many subquestions as you like.

\documentclass{article}
\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand{\yeanay}{mmmm}
 {% #1 = question, #2 = yeas, #3 = nays, #4 = no votes
  \par\noindent
  #1\\*
  Yes:~#2\\*
  No:~#3
  \int_compare:nF { #4 = 0 } { \\* No~vote:~#4 }
  \par
 }

\NewDocumentCommand{\multiplevote}{mm}
 {% #1 = question, #2 = list of options with votes
  \par\noindent
  #1
  \clist_map_inline:nn { #2 } { \__arno_vote:nn ##1 }
  \par
 }

\cs_new_protected:Nn \__arno_vote:nn
 {
  \\* #1:~#2
 }

\ExplSyntaxOff

\begin{document}

\yeanay{Next meeting on Monday?}{3}{1}{0}

\bigskip

\yeanay{Next meeting at 11am?}{2}{1}{1}

\bigskip

\multiplevote{Next meeting at?}{{10am}{2},{11am}{4},{6pm}{0}}

\end{document}

enter image description here

egreg
  • 1,121,712