0

I was taking a look at the post Why do LaTeX internal commands have an @ in them? and one of the answers says:

Others have mentioned the protection against user definition / redefinition.

And I want to know if that is true, with a source if possible. Is it possible to modify a command that starts with the "at" sign?

More specifically, I am using the jmlr2e.sty file. I want to modify the \bf Editor on the line that starts with \def\@starteditor, but I want to modify it on the .tex file, instead of modifying it in the jmlr2e.sty file.

\def\maketitle{\par
 \begingroup
   \def\thefootnote{\fnsymbol{footnote}}
   \def\@makefnmark{\hbox to 0pt{$^{\@thefnmark}$\hss}}
   \@maketitle \@thanks
 \endgroup
\setcounter{footnote}{0}
 \let\maketitle\relax \let\@maketitle\relax
 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax}

\def\@startauthor{\noindent \normalsize\bf}
\def\@endauthor{}
\def\@starteditor{\noindent \small {\bf Editor:~}}
\def\@endeditor{\normalsize}
\def\@maketitle{\vbox{\hsize\textwidth
 \linewidth\hsize \vskip \beforetitskip
 {\begin{center} \Large\bf \@title \par \end{center}} \vskip \aftertitskip
 {\def\and{\unskip\enspace{\rm and}\enspace}%
  \def\addr{\small\it}%
  \def\email{\hfill\small\sc}%
  \def\name{\normalsize\bf}%
  \def\AND{\@endauthor\rm\hss \vskip \interauthorskip \@startauthor}
  \@startauthor \@author \@endauthor}

  \vskip \aftermaketitskip
  \noindent \@starteditor \@editor \@endeditor
  \vskip \aftermaketitskip
}}

\def\editor#1{\gdef\@editor{#1}}
  • 2
    Either copy the code from the .sty package and change it in your .tex file or apply a patch with etoolbox or xpatch packages; regardless what you do however, you need a \makeatletter...\makeatother pair embracing your code changes –  Nov 05 '17 at 14:05
  • I tried using etoolbox but it didn't do the job, so I thought it was because the commands that start with @ are not patchable. If that's not true, I think I can try it again and see If I did somthing wrong; but I'm still curious about the redefinition question – evaristegd Nov 05 '17 at 14:07
  • I tried to copy the code and to use toolbox, but in one of those cases I got Missing \begin{document} even though that line was already there on the tex file – evaristegd Nov 05 '17 at 14:09
  • 1
    But you did use \makeatletter...\makeatother, right? – TeXnician Nov 05 '17 at 14:10
  • @TeXnician Actually no, I didn't. What is that for? – evaristegd Nov 05 '17 at 14:12
  • 2
    https://tex.stackexchange.com/questions/8351/what-do-makeatletter-and-makeatother-do – Torbjørn T. Nov 05 '17 at 14:13
  • 1
    It's a safety mechanism so that users do not change commands that are used in packages ;) But this enables you to use @ as a letter within commands (letter cat code). – TeXnician Nov 05 '17 at 14:14
  • Sweet! The responses were pretty fast, thank you all of you! Now, should I delete this question? Now that I look at it, it seems like a duplicate – evaristegd Nov 05 '17 at 14:18
  • You should not delete it, but it's probably a duplicate (even of the linked question, because the answer already contains the \makeatletter approach). – TeXnician Nov 05 '17 at 14:48
  • 1
    Did you know that the jmlr2e.sty package has been replaced by the jmlr class? If you're planning on submitting an article with it, it will have to be changed to the new class before publication. – Nicola Talbot Nov 05 '17 at 19:27
  • 1
    @evaristegd: I clearly wrote that you need a \makeatletter ... \makeatother pair -- no wonder ,it failed .... –  Nov 06 '17 at 14:00
  • @ChristianHupfer yeah, sorry I missed that – evaristegd Nov 07 '17 at 14:42

0 Answers0