You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
also something like the following could work for formatting:
\documentclass{scrartcl}
\usepackage{enumitem}
\usepackage{xparse}
\NewDocumentCommand{\eitem}{ o o }{
\IfNoValueTF{#2}{%\IfNoValueTF{#1}{ \item (U) }{ \item (#1) }%
}{%\IfNoValueTF{#1}{ \item[#2] (U) }{ \item[#2] #1 }%
}
}
\begin{document}
\begin{enumerate}
\eitem This should be (U).
\eitem This should be (U).
\eitem[A] This should be (A).
\eitem[D//E] This should be (D//E).
\eitem[(D)][3.] This should be 3. (D).
\eitem[(E)][99.] This should be 99. (E).
\end{enumerate}
\end{document}
producing (with slight spacing issues):
1. (U) This should be (U).
2. (U) This should be (U).
3. (A) This should be (A).
4. (D//E) This should be (D//E).
3. (D) This should be 3. (D).
99. (E) This should be 99. (E).
It would be nice to figure out how to redefine \item itself to make it easier on the user. It's a little tricky because I'd want the class to be the first optional argument before the item number. But I'll have to figure out how to make the \@ifnextchar [ check for optional args work for multiple arguments? rewrite that as xparse, or dig into \@item...
\makeatletter
\let\@markitem\item%
\newcommand*{\setdefaultportionmark}[1]{\AddToHook{cmd/item/after}{(#1)~}}
\newcommand*{\markitem}[1]{\@markitem (#1)}
\makeatother
\setdefaultportionmark{U}
% and then override as needed with
\markitem{XXX}
re #36
comments moved from PR to issue:
also something like the following could work for formatting:
producing (with slight spacing issues):
It would be nice to figure out how to redefine \item itself to make it easier on the user. It's a little tricky because I'd want the class to be the first optional argument before the item number. But I'll have to figure out how to make the
\@ifnextchar [
check for optional args work for multiple arguments? rewrite that as xparse, or dig into\@item
...Potentially useful references:
The text was updated successfully, but these errors were encountered: