LaTeX forum ⇒ GeneralInternal vs external macros Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
erwann
Posts: 26
Joined: Thu Aug 25, 2016 2:24 am

Internal vs external macros

Postby erwann » Fri Feb 09, 2018 6:47 pm

Novice question on programming.

  1. \newcommand{\foo}{\ohmy@foo}


If I run this, I get undefined control sequence \foo->ohmy@foo. External/Internal macros live in totally separate worlds? Ins't there a wormhole? I another words, why am I missing about about this aspect of LaTeX programming?
OS X 10.11
pdfTeX 3.14159265-2.6-1.40.17

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3615
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Feb 09, 2018 7:42 pm

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8665
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Fri Feb 09, 2018 8:27 pm

Hello Erwann!

The @ is to prevent accidental use of internal macros. Thorsten gave a good summary:

localghost wrote:The \makeatletter command temporarily defines »@« as a normal character to enable changes to internal LaTeX macros outside packages (STY) or classes (CLS). With \makeatother this process is reversed and the »@« is set to its original character category (other). The »@« is used to protect the internal LaTeX macros. Hence you should be very careful when using these two commands.


Then:


From here.

Stefan
Site admin

erwann
Posts: 26
Joined: Thu Aug 25, 2016 2:24 am

Postby erwann » Sun Feb 11, 2018 7:53 pm

Than u. My bad, I shld have specified within a *.dtx. Solved: I forgot to run *.ins.
OS X 10.11
pdfTeX 3.14159265-2.6-1.40.17


Return to “General”

Who is online

Users browsing this forum: No registered users and 5 guests