[OS X TeX] Staggering

Jeffrey J Weimer weimerj at email.uah.edu
Wed Mar 7 14:37:08 EST 2007


On Mar 7, 2007, at 11:05 AM, Alain Schremmer wrote:

> ....

> 3) What I would like to do is to use the exponent as third  
> parameter instead of the value of the power, say
>
>    \brmultiply{17}{2}{6}
>    \brmultiply{3}{3}{4}
>
> instead of
>
>    \brmultiply{17}{2}{1088}
>    \brmultiply{3}{3}{243}
>
> (The usual story: you give them a hand and they ask for an arm and  
> a leg!)

Here's the arm. Unfortunately, both of my legs have already been  
taken by other projects :-)

\newcommand{\brmultiplypwr}[3]{%
	\setcounter{myc}{#1}%
	\begin{center}%
	\forloop{ic}{0}{\value{ic} < #3}{%
		\hspace{\mlen}$\underbrace{\themyc\times#2}$ \\%
		\setcounter{myc}{#2*\value{myc}}%
		\addtolength{\mlen}{20pt}}%
	\addtolength{\mlen}{-20pt}%
	\hspace{\mlen}\themyc\end{center}%
	}%

\brmultiplypwr{17}{2}{6} is equal to \brmultiply{17}{2}{1088}

--
J. J. Weimer, Chemistry / Chemical & Materials Engineering
University of Alabama in Huntsville, MSB 125, 301 Sparkman Dr
Huntsville, AL 35899                phone: 256-824-6954



------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list