Can I have
\newcommand{A}{This}
and then
do \newcommand{B}{\A\A} to get \B = ThisThis ??
I tried but it won't work. How can I do to solve this problem? I would like to have a hierarchical way of defining new commands.
Thanks!!
General ⇒ Use a predefined newcommand in another newcommand.
NEW: TikZ book now 40% off at Amazon.com for a short time.

Use a predefined newcommand in another newcommand.
This works as requested:
Code: Select all
\documentclass{article}
\newcommand{\A}{This}
\newcommand{\B}{\A\A}
\begin{document}
\B
\end{document}
Re: Use a predefined newcommand in another newcommand.
Great phi !! It is working now.
As someone who always wonder what went wrong, I guess
I have goofed up when I tried something like
\newcommand{\PDF}{A}
\newcommand{\PDFa}{\PDF/a}
I think..
Thanks for the reply ! If not, I would have an ugly layout in my document!
As someone who always wonder what went wrong, I guess
I have goofed up when I tried something like
\newcommand{\PDF}{A}
\newcommand{\PDFa}{\PDF/a}
I think..
Thanks for the reply ! If not, I would have an ugly layout in my document!
Re: Use a predefined newcommand in another newcommand.
Actually I goofed up again..
\PDFa is working fine. I must have used \PDF1a (which broke the newcommand, I thought the little 'a' will
make LaTeX view PDF1a as a whole unit, but apparently not.), and I believe the true reason is that the newcommand does not like weird
characters. Thanks for the patience if you have followed so far...
\PDFa is working fine. I must have used \PDF1a (which broke the newcommand, I thought the little 'a' will
make LaTeX view PDF1a as a whole unit, but apparently not.), and I believe the true reason is that the newcommand does not like weird
characters. Thanks for the patience if you have followed so far...
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: Use a predefined newcommand in another newcommand.
(La)TeX command names are made up of letters, so trying to create anything with a number in will tend to cause problems.
--
Joseph Wright
--
Joseph Wright
Joseph Wright