# doc package: multiple macros with one definition

I'm writing class documentation with the doc package (well, via ltxdoc documentclass). I have several similar options like font sizes and line spacing, that I want to group together in one macro environment, listing the names in a vertical stack at left, where there is usually just one name.

I'm fine to hardcode the number of names to stack (e.g. 3) and leave unused blank, but the definition should be aligned with the first name.

### MWE

\documentclass{article}
\usepackage{doc}
\begin{document}
\begin{macro}{foo}
the definition of foo
\end{macro}
\begin{macro}{bar}
the definition of bar
\end{macro}
% \begin{macros}{foo}{bar}{}
%   the definition of foo and bar
% \end{macros}
\end{document}


### Desired output

You just use multiple macro environments:

\documentclass{article}
\usepackage{doc}

\usepackage{lipsum}

\begin{document}

\begin{macro}{foo}
\begin{macro}{bar}
\lipsum[1][1-4]
\end{macro}
\end{macro}

\begin{macro}{baz}
the definition of baz
\end{macro}

\end{document}


• Thanks. Is this intended behaviour of the macro environment? I would not have expected this to work. Aug 26 at 16:48
• @jessexknight Yes, that's the expected behavior. Aug 26 at 17:20

\documentclass{l3doc}

\begin{document}
\begin{macro}{foo}
the definition of foo
\end{macro}
\begin{macro}{bar}
the definition of bar
\end{macro}
\begin{macro}{foo,bar}
the definition of foo and bar
\end{macro}
\end{document}


• Thanks! I look forward to full release of LaTeX3 :) In the mean time, I don't like these "(End definition for ..." and it seems there's no way to disable it, so I prefer egreg's solution for now. Aug 26 at 16:50