[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 ...
Search found 2 matches
- Thu Feb 25, 2021 6:03 pm
- Forum: Math & Science
- Topic: Nested macro expansion for math calculation
- Replies: 2
- Views: 4932
- 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 ...
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 ...