1

I am trying to automatically add a decision summary when writing meeting minutes. For each paragraph of the meeting I use a table to organize the paragraph number, name and content, and I use etoolbox and csdef to keep track of the decisions following this answer. I can not get this to work when using the \motion command within a table. Does anyone know why or how to solve this?

MWE:

\documentclass{article}
\usepackage{etoolbox}
\usepackage{float}

\newcommand{\enter}{\vskip 3mm} \newcommand{\decision}[1]{\textbf{The board decided}\ \textit{to(1)} #1} \newcommand{\approve}{approve the motion}

\newcommand{\wrapper}[3]{ \begin{table}[H] {\renewcommand\arraystretch{1.25} \begin{tabular}{p{0.5cm} p{4cm} p{10cm}} #1 & \raggedright{#2} & \raggedright{#3}\ \end{tabular} } \end{table} }

\makeatletter

\newcommand{@showMotion}[1]{% \showMotion{#1}% } \newcommand{\showMotion}[1]{% \csuse{name #1} motions to(1)\\textit{"\csuse{motion #1}"}\enter \decision{\csuse{decision #1}}\enter }%

\newcommand*{\summary}{% Initialize } \newcommand{\addToMotions}[1]{% \g@addto@macro\summary{{#1}}% }

\newcommand{\motion}[3]{% \ifcsdef{name #1}{% \PackageError{\jobname}{Multiple uses of the key: '#1'}{}% }{% \csdef{name #2}{#1}% \csdef{motion #2}{#2}% \csdef{decision #2}{#3}% \addToMotions{{@showMotion{#2}}}% }% #1 motions to(1)\\textit{"#2"}\enter \decision{#3}\enter } \makeatother

\begin{document}

\motion{Test Testersson}{begin testing}{\approve}

\wrapper{§1}{Test}{\motion{Foo bar}{Lorem Ipsum}{\approve}}

\wrapper{§2}{Summary}{\summary{}}

Summary:\\

\summary{} \end{document}

Which results in:

Resulting document

Vigge93
  • 13

1 Answers1

1

I can't say I get the gist of what the OP wants; however, it is clear that the \csdef invocations, when occurring in a tabular cell, will be localized by the scope of the tabular cell. Thus, making them \global gets the information out to other macros that are paying attention.

\addToMotions needs no changes, because it already uses \g@addto@macro, which is a global assignment.

\documentclass{article}
\usepackage{etoolbox}
\usepackage{float}

\newcommand{\enter}{\vskip 3mm} \newcommand{\decision}[1]{\textbf{The board decided}\ \textit{to(1)} #1} \newcommand{\approve}{approve the motion}

\newcommand{\wrapper}[3]{ \begin{table}[H] {\renewcommand\arraystretch{1.25} \begin{tabular}{p{0.5cm} p{4cm} p{10cm}} #1 & \raggedright{#2} & \raggedright{#3} \end{tabular} } \end{table} }

\makeatletter

\newcommand{@showMotion}[1]{% \showMotion{#1}% } \newcommand{\showMotion}[1]{% \csuse{name #1} motions to(1)\\textit{"\csuse{motion #1}"}\enter \decision{\csuse{decision #1}}\enter }%

\newcommand*{\summary}{% Initialize } \newcommand{\addToMotions}[1]{% \g@addto@macro\summary{{#1}}% }

\newcommand{\motion}[3]{% \ifcsdef{name #1}{% \PackageError{\jobname}{Multiple uses of the key: '#1'}{}% }{% \global\csdef{name #2}{#1}% \global\csdef{motion #2}{#2}% \global\csdef{decision #2}{#3}% \addToMotions{{@showMotion{#2}}}% }% #1 motions to(1)\\textit{"#2"}\enter \decision{#3}\enter } \makeatother

\begin{document}

\motion{Test Testersson}{begin testing}{\approve}

\wrapper{§1}{Test}{\motion{Foo bar}{Lorem Ipsum}{\approve}}

\wrapper{§2}{Summary}{\summary{}}

Summary:\

\summary{} \end{document}

enter image description here