LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Phelype Oleinik <[log in to unmask]>
Thu, 4 Mar 2021 11:35:12 -0300
text/plain (38 lines)
On Thu, Mar 4, 2021 at 11:19 AM Pieter van Oostrum
<[log in to unmask]> wrote:
> I am working on a new implementation of my 'extramarks' package, based on the '\marks' command.
> To get a clean namespace, I would prefix all internal commands with '\extramarks@', or \extramarks_' in expl3 syntax (which I am slowly learning now). However, this causes the names to get quite long.

Hi Pieter,

Someone else can give you a better accounting of the current status of
xmarks.  Regarding the length, if you're using l3doc+docstrip you can

    %    \begin{macrocode}
    %    \end{macrocode}

at the beginning of the implementation, then for internal commands you
can use the @@ syntax instead:

    %    \begin{macrocode}
    \int_new:N \l_@@_some_int
    \cs_new_protected:Npn \@@_internal_command: { ... }
    %    \end{macrocode}

then the docstripped code will read

    \int_new:N \l__extramarks_some_int
    \cs_new_protected:Npn \__extramarks_internal_command: { ... }

(for public commands like \extramarks_command: you will need to type the
full name, but these are usually a small percentage of the code.)

For a few examples you can look at the sources of some expl3 packages
like kantlipsum.dtx, siunitx.dtx, or namedef.dtx: all use the @@ syntax.