[BUG] \endorsementpage Error #56

Closed
opened 2025-05-10 10:29:14 +00:00 by nuluh · 2 comments
nuluh commented 2025-05-10 10:29:14 +00:00 (Migrated from github.com)

Bug Description

In LaTeX (and TeX), any macro that starts with \end is potentially dangerous or reserved, because:

  • \end{...} is a core LaTeX primitive for ending environments.
  • When you define something like \endorsementpage, TeX may confuse it during parsing or try to match it as part of an environment end sequence.

Steps to Reproduce

Try to define new macros naming start with 'end':

\newcommand{\endorsementpage}{...}
\newcommand{\endorsementsadfdasf}{...}

Expected Behavior

The \endorsementpage or \endorsement should be fine

Actual Behavior

The compiling error when using \end... prefix macros naming

Error Logs

Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.104 ...ttersection{#1}{Pengesahan}{endorsement}}
                                                  
Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

Component

LaTeX Document

Version/Commit

d13dfdc34e

Environment

No response

Additional Context

No response

### Bug Description In LaTeX (and TeX), any macro that starts with \end is potentially dangerous or reserved, because: - \end{...} is a core LaTeX primitive for ending environments. - When you define something like \endorsementpage, TeX may confuse it during parsing or try to match it as part of an environment end sequence. ### Steps to Reproduce Try to define new macros naming start with 'end': ```tex \newcommand{\endorsementpage}{...} \newcommand{\endorsementsadfdasf}{...} ``` ### Expected Behavior The \endorsementpage or \endorsement should be fine ### Actual Behavior The compiling error when using `\end...` prefix macros naming ### Error Logs ```shell Or name \end... illegal, see p.192 of the manual. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.104 ...ttersection{#1}{Pengesahan}{endorsement}} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. ``` ### Component LaTeX Document ### Version/Commit d13dfdc34ef604ef5464ddd5c78bb98e712788a4 ### Environment _No response_ ### Additional Context _No response_
nuluh commented 2025-05-10 10:31:20 +00:00 (Migrated from github.com)

I think elegant way to solve is use an @ in the name (internal macro):

% thesis.cls
\makeatletter
\newcommand{\endorsement@page}{\input{frontmatter/endorsement}}
\newcommand{\endorsementpage}{\endorsement@page}
\makeatother

Then:

\newcommand{\endorsementPage}{\input{frontmatter/endorsement}}
I think elegant way to solve is use an @ in the name (internal macro): ```tex % thesis.cls \makeatletter \newcommand{\endorsement@page}{\input{frontmatter/endorsement}} \newcommand{\endorsementpage}{\endorsement@page} \makeatother ``` Then: ```tex \newcommand{\endorsementPage}{\input{frontmatter/endorsement}} ```
nuluh commented 2025-05-10 10:33:29 +00:00 (Migrated from github.com)

Turns out that using at (@) still gives same error. Proceed to add prefix 'the'

Turns out that using at (@) still gives same error. Proceed to add prefix 'the'
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nuluh/thesis#56