Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DndMonsterAttack does not support macros in attack modifier #343

Open
rittermarc opened this issue Jun 6, 2022 · 1 comment
Open

DndMonsterAttack does not support macros in attack modifier #343

rittermarc opened this issue Jun 6, 2022 · 1 comment

Comments

@rittermarc
Copy link

rittermarc commented Jun 6, 2022

The \DndMonsterAttack macro breaks if macros such as \emph are used in the attack modifier.

I encountered this issue with an attack modifier that is dependent on a spell being active, in this case shillelagh. I tried to insert the following text:

+2 (+6 with shillelagh) to hit

using the following code:

\documentclass[letterpaper,twocolumn,openany,nodeprecatedcode]{dndbook}

\begin{document}
    \DndMonsterAttack[
        name=Club,
        mod=+2 (+6 with shillelagh),
        reach=5,
        dmg=\DndDice{1d4},
        dmg-type=bludgeoning,
        or-dmg=\DndDice{1d8+4},
        or-dmg-when=with \emph{shillelagh},
    ]
\end{document}

This breaks if you try to set shillelagh in cursive text using \emph{shillelagh} or \textit{shillelagh} in the mod parameter. If you try {\itshape shillelagh}, the latex code is set verbatim into the attack modifier (which surprised me quite a lot). Wrapping the text in braces does not help. As you can see, it does work fine in the or-dmg-when parameter.

Error messages:

.../dndmonster-mwe.tex:12: Argument of \reserved@a has an extra }.
<inserted text> 
                \par 
l.12     ]
          
Runaway argument?
{\unexpanded {shillelagh}}\ifx \reserved@a \@empty \let \check@icl \@empty \ETC.
.../dndmonster-mwe.tex:12: Paragraph ended before \reserved@a was complete.
<to be read again> 
                   \par 
l.12     ]
          
.../dndmonster-mwe.tex:12: Undefined control sequence.
\reserved@a ->\@nil 
                    
l.12     ]
          
.../dndmonster-mwe.tex:12: Undefined control sequence.
\reserved@a ->\@nil 
                    
l.12     ]
          
.../dndmonster-mwe.tex:12: Undefined control sequence.
\reserved@a ->\@nil 
                    
l.12     ]
          
.../dndmonster-mwe.tex:12: Undefined control sequence.
\reserved@a ->\@nil 
                    
l.12     ]
          
.../dndmonster-mwe.tex:12: Undefined control sequence.
\reserved@a ->\@nil 
                    
l.12     ]
          
.../dndmonster-mwe.tex:12: Undefined control sequence.
\reserved@a ->\@nil 
                    
l.12     ]
          
.../dndmonster-mwe.tex:12: Undefined control sequence.
\reserved@a ->\@nil 
                    
l.12     ]
          
.../dndmonster-mwe.tex:12: Undefined control sequence.
\reserved@a ->\@nil 
                    
l.12     ]

This is my first time opening an issue, so apologies if I did anything wrong.

@BrianCriswell
Copy link
Member

Try surrounding the entirety of the argument (everything after "mod=") in curly braces. If that doesn't work, please post an MWE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants