<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 18 Jul2021, at 1:29 PM, Nitecki, Zbigniew H. <<a href="mailto:Zbigniew.Nitecki@tufts.edu" class="">Zbigniew.Nitecki@tufts.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">

<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class="">

<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">What I thought was a simple macro definition is yielding puzzling results.
<div class="">The full testfiles are attached below.  Bottom line:</div>
<div class="">with these definitions</div>
<div class="">
<blockquote type="cite" class="">
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal; min-height:14px">
<br class="">
</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
\newcommand{\dist}[2]{\ensuremath{\operatorname{dist}(#1,#2)}}% distance function</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
\newcommand{\distsub}[1]{\ensuremath{\operatorname{dist}_{#1}}}%subscripted distance name </div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
\newcommand{\dists}[3]{\ensuremath{\distsub{#1}(#2,#3)}}%subscripted distance function</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal; min-height:14px">
<br class="">
</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal; min-height:14px">
<br class="">
</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
\newcommand{\distX}[1]{\ensuremath{\distsub{X}}}</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
\newcommand{\distY}[1]{\ensuremath{\distsub{Y}}}</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal; min-height:14px">
<br class="">
</div>
</blockquote>
<br class="">
<div class=""><span class="x_Apple-style-span" style="border-collapse:separate; font-variant-ligatures:normal; font-variant-east-asian:normal; line-height:normal; border-spacing:0px"><span class="x_Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<div class="" style="word-wrap:break-word"><span class="x_Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<div class="" style="word-wrap:break-word">
<div class="">
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica">why are my closing parentheses (not part of the macro) dropped?</font></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica"><br class="">
</font></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica"><br class="x_Apple-interchange-newline">
Zbigniew Nitecki</font></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px"><br class=""></div><span class="x_Apple-style-span" style="font-size:12px"></span></div>
</div>
</span></div></span></span></div></div></div><div class="" style="word-wrap:break-word; line-break:after-white-space"><div class=""><br class="">
</div>
</div>
</div>

<span id="cid:8AF4A6E719C9BB43AF59FEBAB0437280@namprd05.prod.outlook.com"><disttest-2.tex></span><span id="cid:FC72B108B098DC458340466ADAC2B37D@namprd05.prod.outlook.com"><disttest-2.log></span><span id="cid:f63e51e6-720f-4b24-a0b3-591bc672f691@namprd05.prod.outlook.com"><disttest-2.pdf></span>----------- Please Consult the Following Before Posting —————</div></blockquote><br class=""></div><div>Luis Sequeira alraedy pointed out the source of the error, namely, the spurious “<font face="Courier" class="">[1]</font>” in the definitions of \distX and \disY.</div><div><br class=""></div><div>Here I wanted to point out that you may need to adjust the spacing, since <font face="Courier" class="">(X, \distX) </font>gives, to my eye, too much space before the closing parenthesis. By contrast, something like...</div><div><br class=""></div><div><font face="Courier" class=""><span class="Apple-tab-span" style="white-space:pre">      </span>\newcommand{\distone}{\ensuremath{\distsub{1}}}</font></div><div><br class=""></div><div>…used, say, in "<font face="Courier" class="">$(X,\distone)</font>$”, looks OK to me.</div><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">---<br class="">Murray Eisenberg<span class="Apple-tab-span" style="white-space: pre;">                </span><a href="mailto:murrayeisenberg@gmail.com" class="">murrayeisenberg@gmail.com</a></div><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Mobile (413)-427-5334<br class="">503 King Farm Blvd #101<span class="Apple-tab-span" style="white-space: pre;">             </span><br class="">Rockville, MD 20850-6667<span class="Apple-tab-span" style="white-space: pre;">     </span><br class=""><br class=""><br class=""><br class=""><br class=""></div>
</div>
<br class=""></body></html>