latex3 / latex2e

The LaTeX2e kernel
https://www.latex-project.org/
LaTeX Project Public License v1.3c
1.95k stars 267 forks source link

overlapping environment and macro names in source2e #1526

Closed mbertucci47 closed 3 weeks ago

mbertucci47 commented 3 weeks ago

Brief outline of the bug

Several environments that are defined as commands (\envname...\endenvname) have overlapping names in source2e. This happens when the dtx looks like

% \begin{environment}{list}
% \begin{macro}{\list}
%    \begin{macrocode}
\def\list#1#2{<code>}
%    \end{macrocode}
% \end{macro}
% \end{environment}

I see this happening in source2e for

Here's what it looks like for array and tabular:

overlap

Minimal example showing the bug

Unfortunately I can't reproduce it with a simple doc example. This looks fine:

\documentclass{article}
\usepackage{doc}

\begin{document}

\begin{environment}{list}
\begin{macro}{\list}
Stuff
\end{macro}
\end{environment}

\end{document}

But clearly there's an issue just by inspecting source2e.

FrankMittelbach commented 3 weeks ago

It's a class issue (but I think there is already an issue for it somewhere). Problem is, this has lowest priority, because the whole class (and l3doc) would need to be redone which is a lot of work and there are really more important things to tackle.

muzimuzhi commented 3 weeks ago

It's a class issue (but I think there is already an issue for it somewhere).

It's

mbertucci47 commented 3 weeks ago

Ah thanks @muzimuzhi. Will close here