GeneralSearch for Documentation of Macro Code

LaTeX specific issues not fitting into one of the other forums of this category.
wcw
Posts: 20
Joined: Thu Mar 08, 2012 12:35 pm

Search for Documentation of Macro Code

Post by wcw »

Hi everyone,

I am learning the macro of my CTeX and I want to know the explanation of the code in the sample TeX file. How can I get the detailed information of the code? For example:

Code: Select all

\global\let\myempty=\@empty
I know that \global is for defining a global variable and \let is for assigning \empty to \myempty. Then what is \empty? Can I get into \empty for detailed information?

I need your help.
Last edited by localghost on Sun Mar 11, 2012 10:32 am, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Search for Documentation of Macro Code

Post by localghost »

Assumed that CTeX also uses the LaTeX2e kernel commands, you should find some helpful explanations in the documented kernel sources listed in the source2e document.


Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Search for Documentation of Macro Code

Post by Stefan Kottwitz »

Hi,

while source2e is good for learning about LaTeX commands, there are TeX books and documentation which can be useful if you encounter TeX commands which don't belong to LaTeX.

Btw. don't overlook the @ in the command name. This special character is commonly used for internal commands to distinguish them from author commands. So \@empty is an internal LaTeX command, you will find the definition in source2e if you use the PDF reader search box:

Code: Select all

\def\@empty{}
\empty is a lower level TeX command, but similarly defined, as can be seen for example in TeX by Topic page 25:

Code: Select all

\def\empty{}
Often source2e and texbytopic are already installed on the computer and can be opened locally by texdoc at the command prompt:

Code: Select all

texdoc source2e

Code: Select all

texdoc texbytopic
Stefan
LaTeX.org admin
wcw
Posts: 20
Joined: Thu Mar 08, 2012 12:35 pm

Search for Documentation of Macro Code

Post by wcw »

localghost wrote:Assumed that CTeX also uses the LaTeX2e kernel commands, you should find some helpful explanations in the documented kernel sources listed in the source2e document.


Thorsten
Your reply is quite amazing. I am fascinated by source2e. Can you also tell me the anme of the macro for "beamer?" I also want to look into it.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Search for Documentation of Macro Code

Post by localghost »

wcw wrote:[…] Can you also tell me the anme of the macro for "beamer?" […]
beamer is a document class. Find out its location in the TeX installation tree on the command line.

Code: Select all

kpsewhich beamer.cls
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Search for Documentation of Macro Code

Post by Stefan Kottwitz »

And for the very good 240 pages beamer user guide:

Code: Select all

texdoc beamer
or click: beamer.

Stefan
LaTeX.org admin
wcw
Posts: 20
Joined: Thu Mar 08, 2012 12:35 pm

Search for Documentation of Macro Code

Post by wcw »

Stefan_K wrote:Hi,

while source2e is good for learning about LaTeX commands, there are TeX books and documentation which can be useful if you encounter TeX commands which don't belong to LaTeX.

Btw. don't overlook the @ in the command name. This special character is commonly used for internal commands to distinguish them from author commands. So \@empty is an internal LaTeX command, you will find the definition in source2e if you use the PDF reader search box:

Code: Select all

\def\@empty{}
\empty is a lower level TeX command, but similarly defined, as can be seen for example in TeX by Topic page 25:

Code: Select all

\def\empty{}

Often source2e and "TeX by Topic" are already installed on the computer and can be opened locally by texdoc at the command prompt:

Code: Select all

texdoc source2e

Code: Select all

texdoc texbytopic
Stefan
Hi Stefan,

Your reply is quite nice. Thanks for your help.
wcw
Posts: 20
Joined: Thu Mar 08, 2012 12:35 pm

Search for Documentation of Macro Code

Post by wcw »

localghost wrote:
wcw wrote:[…] Can you also tell me the anme of the macro for "beamer?" […]
beamer is a document class. Find out its location in the TeX installation tree on the command line.

Code: Select all

kpsewhich beamer.cls
Is it right that all of the .cls files contain the macro for "document class?"
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Search for Documentation of Macro Code

Post by localghost »

wcw wrote:Is it right that all of the .cls files contain the macro for "document class?"
What is in your understanding a "macro for document class"?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Search for Documentation of Macro Code

Post by Stefan Kottwitz »

wcw wrote:Is it right that all of the .cls files contain the macro for "document class?"
(The meaning of this English sentence is a bit hard to understand...) If you would like to learn something about classes, have a look at the clsguide on CTAN or type texdoc clsguide at the command prompt.

Stefan
LaTeX.org admin
Post Reply