LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Thu, 4 Mar 2021 11:35:12 -0300
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
MIME-Version:
1.0
Message-ID:
In-Reply-To:
Content-Type:
text/plain; charset="UTF-8"
From:
Phelype Oleinik <[log in to unmask]>
Parts/Attachments:
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
write

    %    \begin{macrocode}
    %<@@=extramarks>
    %    \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.

Best,
Phelype

ATOM RSS1 RSS2