GeneralInternal vs external macros

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

Internal vs external macros

Post by erwann »

Novice question on programming.

Code: Select all

\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?
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Internal vs external macros

Post by Johannes_B »

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: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Internal vs external macros

Post by Stefan Kottwitz »

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
LaTeX.org admin
erwann
Posts: 75
Joined: Thu Aug 25, 2016 2:24 am

Internal vs external macros

Post by erwann »

Than u. My bad, I shld have specified within a *.dtx. Solved: I forgot to run *.ins.
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)
Post Reply