ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: bib module: \setupcite macro
@ 2005-10-02 23:12 Idris Samawi Hamid
  0 siblings, 0 replies; 8+ messages in thread
From: Idris Samawi Hamid @ 2005-10-02 23:12 UTC (permalink / raw)


I thought it was my macro but the following fails also:

==========================================
\starttext

\dots as Afghani points out \cite[year][afghani60].

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

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

Best
Idris

==========================================
==========================================
Another issue:

My definition for \citeyear crashes. This used to work-)

\def\citeyear[#1]{%
  {\cite[year][#1]%
  }%
}

log:

==========================================
! You can't use `macro parameter character #' in horizontal mode.
\p!doifinstringelse ...tringelse \@EA ##\@EA 1#1##
                                                  2##3\war {\unless \if
##2@...

\rawdodoifinsetelse ...ingelse \@@@instring {,#1,}
                                                  \@EA \firstoftwoarguments
..

\addtocommalist #1#2->\rawdoifinsetelse {#1}#2
                                              \resetglobal {\dodoglobal
\ede...

\donormalbibauthoryear ...yauthor }\thebibauthors
                                                  \@EA \doglobal \@EA
\addto...

\next1 #1,->\donormalbibauthoryear {#1}
                                       \doprocesscommaitem
\doprocesscommalist ...item \gobbleoneargument #1,
                                                  ]\relax \global \advance
\...
..
l.24 \dots as Afghani points\citeyear[afghani60]
==========================================

See attached test file test-bib-year.tex.

Best
Idris

=============test-bib-year.tex===============
% output=pdf interface=en

\setupwhitespace[big]

\usemodule[bib]

\setuppublications[alternative=apa]
\setuppublications[autohang=yes]
\setuppublications[numbering=no]
\setuppublications[criterium=cite]
\setuppublications[sorttype=bbl]

\setuppublicationlist[totalnumber={},samplesize=,author={\invertedauthor}]

\def\citeyear[#1]{%
  {\cite[year][#1]%
  }%
}

\input test-bib.bbl

\starttext

\dots as Afghani points out\citeyear[afghani60].

\cite[afghani60]

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

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

==============test-bib.bbl==============
\startpublication[k=afghani60,
                  t=book,
                  a=Afgh\=an\=i,
                  y=1960,
                  s=]
\author[]{Sa\high{c}\=id}[]{}{Al-Afgh\=an\=i}
\title{Asw\=aqu \~al-\high{c}Arab f\=i
    \~al-J\=ahiliyya\~h wa \~al-Isl\=am}
\pubname{D\=aru \~al-Fikr}
\city{Damascus}
\pubyear{1960}
\stoppublication
========================================

============================
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] 8+ messages in thread

* RE: bib module: \setupcite macro
@ 2005-10-03 13:23 Idris Samawi Hamid
  0 siblings, 0 replies; 8+ messages in thread
From: Idris Samawi Hamid @ 2005-10-03 13:23 UTC (permalink / raw)


>===== Original Message From Taco Hoekwater <taco@elvenkind.com> =====
>> Please forgive my cluelessness, but what is "year compression" and how do I
>> turn it on?
>
>   \setupcite[year][compress=yes]

Great, it works now! Thnx for the full explanation as well-)

>PS I've seen the rest of your comments as well, but no chance
>of doing something with them today.

:-(

Ok, but I hope/pray that, at least, I don't have to make more clones of the 
t-bib module; journal is due to the publisher next tuesday (or I'm a dead 
man)...

Thnx again for all of your help.

Best
Idris

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

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

* RE: bib module: \setupcite macro
@ 2005-10-03 13:12 Idris Samawi Hamid
  0 siblings, 0 replies; 8+ messages in thread
From: Idris Samawi Hamid @ 2005-10-03 13:12 UTC (permalink / raw)


Hi Thomas,

>===== Original Message From "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de> 
=====
>Just add an extra pair of braces:
>
>\def\citeyear[#1]{%
>   {{\cite[year]}[#1]%
>   }%
>}

Ok, does not crash but now I lose the reference completely in the output-(

Best
Idris

================================================
% output=pdf interface=en

\setupwhitespace[big]

\usemodule[bib]

\setuppublications[alternative=apa]
\setuppublications[autohang=yes]
\setuppublications[numbering=no]
\setuppublications[criterium=cite]
\setuppublications[sorttype=bbl]
%
%\setuppublicationlist[totalnumber={},samplesize=,author={\invertedauthor}]

\def\citeyear[#1]{%
  {{\cite[year]}[#1]%
  }%
}

\input test-bib.bbl

\starttext

\dots as Afghani points out \citeyear[afghani60].

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

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

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

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

* Re: bib module: \setupcite macro
  2005-10-03 13:01 Idris Samawi Hamid
@ 2005-10-03 13:09 ` Taco Hoekwater
  0 siblings, 0 replies; 8+ messages in thread
From: Taco Hoekwater @ 2005-10-03 13:09 UTC (permalink / raw)




Idris Samawi Hamid wrote:
> Hi Taco,
> 
> 
>>===== Original Message From Taco Hoekwater <taco@elvenkind.com> =====
>>
>>>My definition for \citeyear crashes. This used to work-)
>>
>>First: this problem is caused by the fact that year
>>citations are by default uncompressed. if year compression
>>is turned on, then different code is used, and the problem
>>never happens.
> 
> 
> Please forgive my cluelessness, but what is "year compression" and how do I 
> turn it on?

   \setupcite[year][compress=yes]

It is supposed to work similar to compression for author-year
combinations (where it already is turned on by default), so that
if you do \cite[year][johhnson1,smithson2] and both were published
in the same year, you get only one year typeset instead of two.

Whether or not that makes sense is another issue, the feature came
'free' with the author-year variant where it sometimes really does
make sense to compress the typeset data.

Cheers, Taco

PS I've seen the rest of your comments as well, but no chance
of doing something with them today.

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

* RE: bib module: \setupcite macro
@ 2005-10-03 13:01 Idris Samawi Hamid
  2005-10-03 13:09 ` Taco Hoekwater
  0 siblings, 1 reply; 8+ messages in thread
From: Idris Samawi Hamid @ 2005-10-03 13:01 UTC (permalink / raw)


Hi Taco,

>===== Original Message From Taco Hoekwater <taco@elvenkind.com> =====
>> My definition for \citeyear crashes. This used to work-)
>
>First: this problem is caused by the fact that year
>citations are by default uncompressed. if year compression
>is turned on, then different code is used, and the problem
>never happens.

Please forgive my cluelessness, but what is "year compression" and how do I 
turn it on?

Best
Idris

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

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

* Re: bib module: \setupcite macro
  2005-10-02 23:01 Idris Samawi Hamid
  2005-10-03  6:04 ` Thomas A. Schmitz
@ 2005-10-03  8:36 ` Taco Hoekwater
  1 sibling, 0 replies; 8+ messages in thread
From: Taco Hoekwater @ 2005-10-03  8:36 UTC (permalink / raw)




Idris Samawi Hamid wrote:
> Another issue:
> 
> My definition for \citeyear crashes. This used to work-)

First: this problem is caused by the fact that year
citations are by default uncompressed. if year compression
is turned on, then different code is used, and the problem
never happens.

-------

I've made a change to the representation of authors (there is
now one or two extra sets of braces around each author), and
this causes the crash. It turns out to be a problem with the
core macro \addtocommalist, that I don't know how to fix.

Minimal demonstration of problem/bug:

   \def\acommalist{}
   \addtocommalist{{stuff with braces}}\acommalist


Q for Hans: The way my data representation is written now, I
need to be able to add the following three types of elements
as well as stuff without braces:

   {author}               % stands for one author
   {authora},{authorb}    % stands for two authors
   {authora},{}           % stands for author et. al.

is that doable eventually, or should I implement another
presentation altogether?

Cheers, Taco

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

* Re: bib module: \setupcite macro
  2005-10-02 23:01 Idris Samawi Hamid
@ 2005-10-03  6:04 ` Thomas A. Schmitz
  2005-10-03  8:36 ` Taco Hoekwater
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas A. Schmitz @ 2005-10-03  6:04 UTC (permalink / raw)


Just add an extra pair of braces:

\def\citeyear[#1]{%
   {{\cite[year]}[#1]%
   }%
}


Thomas

On Oct 3, 2005, at 1:01 AM, Idris Samawi Hamid wrote:

> My definition for \citeyear crashes. This used to work-)
>
> \def\citeyear[#1]{%
>   {\cite[year][#1]%
>   }%
> }
>

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

* bib module: \setupcite macro
@ 2005-10-02 23:01 Idris Samawi Hamid
  2005-10-03  6:04 ` Thomas A. Schmitz
  2005-10-03  8:36 ` Taco Hoekwater
  0 siblings, 2 replies; 8+ messages in thread
From: Idris Samawi Hamid @ 2005-10-02 23:01 UTC (permalink / raw)


Another issue:

My definition for \citeyear crashes. This used to work-)

\def\citeyear[#1]{%
  {\cite[year][#1]%
  }%
}

log:

==========================================
! You can't use `macro parameter character #' in horizontal mode.
\p!doifinstringelse ...tringelse \@EA ##\@EA 1#1##
                                                  2##3\war {\unless \if 
##2@...

\rawdodoifinsetelse ...ingelse \@@@instring {,#1,}
                                                  \@EA \firstoftwoarguments 
...

\addtocommalist #1#2->\rawdoifinsetelse {#1}#2
                                              \resetglobal {\dodoglobal 
\ede...

\donormalbibauthoryear ...yauthor }\thebibauthors
                                                  \@EA \doglobal \@EA 
\addto...

\next1 #1,->\donormalbibauthoryear {#1}
                                       \doprocesscommaitem
\doprocesscommalist ...item \gobbleoneargument #1,
                                                  ]\relax \global \advance 
\...
...
l.24 \dots as Afghani points\citeyear[afghani60]
==========================================

See attached test file test-bib-year.tex.

Best
Idris

=============test-bib-year.tex===============
% output=pdf interface=en

\setupwhitespace[big]

\usemodule[bib]

\setuppublications[alternative=apa]
\setuppublications[autohang=yes]
\setuppublications[numbering=no]
\setuppublications[criterium=cite]
\setuppublications[sorttype=bbl]
%
%\setuppublicationlist[totalnumber={},samplesize=,author={\invertedauthor}]

\def\citeyear[#1]{%
  {\cite[year][#1]%
  }%
}

\input test-bib.bbl

\starttext

\dots as Afghani points\citeyear[afghani60].

\cite[afghani60]

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

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

==============test-bib.bbl==============
\startpublication[k=afghani60,
                  t=book,
                  a=Afgh\=an\=i,
                  y=1960,
                  s=]
\author[]{Sa\high{c}\=id}[]{}{Al-Afgh\=an\=i}
\title{Asw\=aqu \~al-\high{c}Arab f\=i
    \~al-J\=ahiliyya\~h wa \~al-Isl\=am}
\pubname{D\=aru \~al-Fikr}
\city{Damascus}
\pubyear{1960}
\stoppublication
========================================

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

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

end of thread, other threads:[~2005-10-03 13:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-02 23:12 bib module: \setupcite macro Idris Samawi Hamid
  -- strict thread matches above, loose matches on Subject: below --
2005-10-03 13:23 Idris Samawi Hamid
2005-10-03 13:12 Idris Samawi Hamid
2005-10-03 13:01 Idris Samawi Hamid
2005-10-03 13:09 ` Taco Hoekwater
2005-10-02 23:01 Idris Samawi Hamid
2005-10-03  6:04 ` Thomas A. Schmitz
2005-10-03  8:36 ` 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).