ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: esoteric macro expansion bug in t-bib?
@ 2005-10-10  1:22 Idris Samawi Hamid
  0 siblings, 0 replies; 7+ messages in thread
From: Idris Samawi Hamid @ 2005-10-10  1:22 UTC (permalink / raw)


You will need to add the following macro to the example file ibar-bib.tex. 
Once the expansion bug is fixed the file will compile.

\def\h#1{{\oalign{\relax#1\crcr\hidewidth\SHIFT{34}%
    \vbox to.2ex{\hbox{\char'25}\vss}\hidewidth}}}

Best
Idris

===============================================
===============================================

Dear Taco,

There is some esoteric macro expansion bug in the bib module (beyond my
capability to understand). For example, the \Ibar macro works fine outside of
the a= context. \getcommacommandsize can't seem to figure out that ## stands
for an alignment preamble. Is there a way to protect the argument of a= ?

Please try the following :

================ibar-bib.bbl====================
\startpublication[k=amini93,
                  t=book,
                  a=al-Am\={i}n\~i,
                  y=1993,
                  s=]
\author[]{Mu\.hammad H\=ad\=i}[]{}{Al-Am\=in\=i}
\title{Mu\`allimu \~a\~l-\v S\=i\`ah: a~l-\v Say\h h al-Muf\=id}
%\pubname{}
\city{Beirut}
\pubyear{{1993}}
\stoppublication
===========================================

================ibar-bib.tex====================
% output=pdf interface=en

\usemodule[bib]

\def\SHIFT#1{\dimen0=.00#1ex \multiply\dimen0 by\fontdimen1\font
    \kern-.0156\dimen0} % compensate for slant/italic in lower accents

\def\USHIFT#1{\dimen0=.00#1ex \multiply\dimen0 by\fontdimen1\font
             \kern.0156\dimen0} % compensate for slant/italic in upper accents

\def\IBAR%
{\leavevmode\vbox{\offinterlineskip\lineskip0.295ex%
\ialign{##\cr\USHIFT{120}\hfill\hbox to .21243em{\leaders\hrule
height .07ex\hfill}\hfill\SHIFT{1}\cr\i\cr}}}

\definecharacter imacron          {\IBAR} % ConTeXt-dependent!

\setupwhitespace[big]

\starttext

\cite[amini93]

M\=irz\=a

\section{References}{\tfx\setupinterlinespace
{\leavevmode\placepublications}}

\stoptext
===========================================

I get the following error

===========================================
systems         : begin file ibar-bib at line 20
! Illegal parameter number in definition of \commacommand.
<to be read again>
                   \cr
\IBAR ...lineskip \lineskip 0.295ex\ialign {##\cr
                                                  \USHIFT {120}\hfill \hbox
..

\dohandleaccent ... #1\string #2\empty \endcsname
                                                  \else \ifcsname
\accentpre...

\thebibauthors ->{al-Am\={i}
                            n\~i}
\getcommacommandsize [#1]->\edef \commacommand {#1
                                                  }\scratchtoks
\expandafter...

\dobibauthoryear ...acommandsize [\thebibauthors ]
                                                  \@EA \processcommalist
\@E...
..
===========================================

Please advise-)

Best
Idris

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: esoteric macro expansion bug in t-bib?
@ 2005-10-10 17:33 Idris Samawi Hamid
  2005-10-11  6:44 ` Taco Hoekwater
  0 siblings, 1 reply; 7+ messages in thread
From: Idris Samawi Hamid @ 2005-10-10 17:33 UTC (permalink / raw)


>===== Original Message From Taco Hoekwater <taco@elvenkind.com> =====
>Christopher Creutzig wrote:
>> Idris Samawi Hamid wrote:
>>>\def\IBAR%
>>>{\leavevmode\vbox{\offinterlineskip\lineskip0.295ex%
>>>\ialign{##\cr\USHIFT{120}\hfill\hbox to .21243em{\leaders\hrule
>>>height .07ex\hfill}\hfill\SHIFT{1}\cr\i\cr}}}
>>
>>
>>  Could you try
>> \unexpanded\def\IBAR% ...
>>
>
>That was my first thought as well.

That finally ocurred to me after you all were sleep yesterday-) Yes, the 
\unexpanded solves things.

I'm curious: how exactly does \unexpanded work? Is this an eTeX primitive?

Best
Idris

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 7+ messages in thread
* esoteric macro expansion bug in t-bib?
@ 2005-10-10  0:18 Idris Samawi Hamid
  2005-10-10  7:15 ` Christopher Creutzig
  0 siblings, 1 reply; 7+ messages in thread
From: Idris Samawi Hamid @ 2005-10-10  0:18 UTC (permalink / raw)


esoteric macro expansion bug.

Dear Taco,

There is some esoteric macro expansion bug in the bib module (beyond my 
capability to understand). For example, the \Ibar macro works fine outside of 
the a= context. \getcommacommandsize can't seem to figure out that ## stands 
for an alignment preamble. Is there a way to protect the argument of a= ?

Please try the following :

================ibar-bib.bbl====================
\startpublication[k=amini93,
                  t=book,
                  a=al-Am\={i}n\~i,
                  y=1993,
                  s=]
\author[]{Mu\.hammad H\=ad\=i}[]{}{Al-Am\=in\=i}
\title{Mu\`allimu \~a\~l-\v S\=i\`ah: a~l-\v Say\h h al-Muf\=id}
%\pubname{}
\city{Beirut}
\pubyear{{1993}}
\stoppublication
===========================================

================ibar-bib.tex====================
% output=pdf interface=en

\usemodule[bib]

\def\SHIFT#1{\dimen0=.00#1ex \multiply\dimen0 by\fontdimen1\font
    \kern-.0156\dimen0} % compensate for slant/italic in lower accents

\def\USHIFT#1{\dimen0=.00#1ex \multiply\dimen0 by\fontdimen1\font
             \kern.0156\dimen0} % compensate for slant/italic in upper accents

\def\IBAR%
{\leavevmode\vbox{\offinterlineskip\lineskip0.295ex%
\ialign{##\cr\USHIFT{120}\hfill\hbox to .21243em{\leaders\hrule
height .07ex\hfill}\hfill\SHIFT{1}\cr\i\cr}}}

\definecharacter imacron          {\IBAR} % ConTeXt-dependent!

\setupwhitespace[big]

\starttext

\cite[amini93]

M\=irz\=a

\section{References}{\tfx\setupinterlinespace
{\leavevmode\placepublications}}

\stoptext
===========================================

I get the following error

===========================================
systems         : begin file ibar-bib at line 20
! Illegal parameter number in definition of \commacommand.
<to be read again>
                   \cr
\IBAR ...lineskip \lineskip 0.295ex\ialign {##\cr
                                                  \USHIFT {120}\hfill \hbox 
...

\dohandleaccent ... #1\string #2\empty \endcsname
                                                  \else \ifcsname 
\accentpre...

\thebibauthors ->{al-Am\={i}
                            n\~i}
\getcommacommandsize [#1]->\edef \commacommand {#1
                                                  }\scratchtoks 
\expandafter...

\dobibauthoryear ...acommandsize [\thebibauthors ]
                                                  \@EA \processcommalist 
\@E...
...
===========================================

Please advise-)

Best
Idris

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-10-11 10:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-10  1:22 esoteric macro expansion bug in t-bib? Idris Samawi Hamid
  -- strict thread matches above, loose matches on Subject: below --
2005-10-10 17:33 Idris Samawi Hamid
2005-10-11  6:44 ` Taco Hoekwater
2005-10-11 10:59   ` Christopher Creutzig
2005-10-10  0:18 Idris Samawi Hamid
2005-10-10  7:15 ` Christopher Creutzig
2005-10-10  7:53   ` Taco Hoekwater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).