<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 27 January 2016 at 22:52, Igor Liferenko <span dir="ltr"><<a href="mailto:igor.liferenko@gmail.com" target="_blank">igor.liferenko@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
Following are three occurrences of using \pdfoutline in cwebmac.tex<br>
<br>
    \pdfoutline goto name {NOS} count -\secno {\outsecname}<br>
<br>
    \pdfoutline goto num \the\toksA \expandafter{\the\toksE}}<br>
<br>
    \pdfoutline goto num #3 count -\expnumber{chunk#2.#3} {#5}}}<br>
<br>
Why \expandafter is used in the second case specifically (in<br>
comparison with other cases)?<br>
</blockquote></div><br><br></div><div class="gmail_extra">without looking at the context in cwebmac, the difference is that<br></div><div class="gmail_extra">without \expandafter the outline will contain the (unexpanded)<br></div><div class="gmail_extra">tokens from the token register as \the on a token register<br></div><div class="gmail_extra">suppresses further expansion.<br><br></div><div class="gmail_extra">With the \expandafter the token register is expanded before being passed<br></div><div class="gmail_extra">to the whatsit so the resulting tokens are then fully expanded as in<br></div><div class="gmail_extra">edef or write. The other two cases are not involving \the so \expandafter<br></div><div class="gmail_extra">would make no difference there<br><br></div><div class="gmail_extra">You can see this in the following plain (pdf)tex file<br><br>\pdfcompresslevel=0<br>\newtoks\toksE<br>\toksE{\foo}<br>\def\foo{bar}<br>\pdfoutline goto num 2 \expandafter{\the\toksE}<br>x<br>\pdfoutline goto num 3 {\the\toksE}<br>x<br>\bye<br><br><br><br></div><div class="gmail_extra">The resulting pdf is<br><br>% 1 0 obj<br><< /S /GoTo /D 3 0 R >><br>% 5 0 obj<br>(bar)<br>% 6 0 obj<br><< /S /GoTo /D 7 0 R >><br>% 9 0 obj<br>(\foo )<br>% 11 0 obj<br><br><br></div><div class="gmail_extra">note how the first outline is (bar) but the second is (\foo) as \foo did not expand<br></div><div class="gmail_extra">while writing the outline.<br><br></div><div class="gmail_extra">David<br><br></div><div class="gmail_extra"><br><br></div></div>