Search found 2 matches

by dappergreet
Thu Feb 25, 2021 6:03 pm
Forum: Math & Science
Topic: Nested macro expansion for math calculation
Replies: 2
Views: 4932

Nested macro expansion for math calculation

[cmd]\def[/cmd] doesn't expand the macro [cmd]\hitspherediscriminant[/cmd] until [doc]\res[/doc] is expanded, meaning the [doc]\edef[/doc] macros inside it get expanded at that time.

Yes I see, isn't there a way to force the expansion inside the \edef\hitspherediscriminant because it should have ...
by dappergreet
Thu Feb 25, 2021 12:32 pm
Forum: Math & Science
Topic: Nested macro expansion for math calculation
Replies: 2
Views: 4932

Nested macro expansion for math calculation

Hello!

I am trying to learn more about macros and expansion rules in LaTeX, by writing some nested macros to do various math operations.

Here is a small code snippet:

\documentclass{article}
\usepackage{xfp}

\def\getx(#1,#2,#3){#1}
\def\gety(#1,#2,#3){#2}
\def\getz(#1,#2,#3){#3}

% Vector ...