ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to use my own BibTeX style (bst)?
@ 2009-03-06 17:22 Wei-Wei Guo
       [not found] ` <436429714.24327@zju.edu.cn>
  0 siblings, 1 reply; 16+ messages in thread
From: Wei-Wei Guo @ 2009-03-06 17:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030"; Format="flowed", Size: 916 bytes --]

Dear all,

I have both English and Chinese citations in my paper. Because Chinese citation
has some special requirements, such as using "µÈ" instead of "et al". I made a
bst file to solve the localization problem. But after reading the manual of
t-bib and searched in garden and mailing list, I find it might be tricky to
make t-bib use my own bst file. Could you tell my how to do it?

Thanks a lot!

Best wishes,
Wei-Wei Guo


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: How to use my own BibTeX style (bst)?
       [not found]       ` <49B5363D.4060700@elvenkind.com>
@ 2009-03-12 16:38         ` Wei-Wei Guo
  2009-03-12 18:29           ` Taco Hoekwater
  0 siblings, 1 reply; 16+ messages in thread
From: Wei-Wei Guo @ 2009-03-12 16:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thank you, Mojca and Taco. I finally get my t-bib working. Now I can
continue working on my bibl style.

Taco Hoekwater 写道:
>> I don't know those styles get adapted automatically when language is
>> changed. Taco should answer (I should take a closer look, but no time
>> now).
> 
> They do not. You have to give a setup command like
> 
>   \setuppublications[alternative=my-zh] % for bibl-my-zh.tex
> 
>> I'm not sure if you can use different style for different books based
>> on language the book was written in (maybe possible, but tedious, the
>> style would have to be rewritten completely).
> 
> With a suitable \setuppublicationlayout this should be possible:
> you can decide based on the value of the current language, which is
> set from the bibtex language field automatically. But I have never
> actually tried to do this, so I have no example code available for you.
> 

I'm still confused. Is it possible to use different bibl based on the value
of \lang. Or I can only implement it with bunch of \if in *one* bibl file?

Best wishes,
Wei-Wei
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: How to use my own BibTeX style (bst)?
  2009-03-12 16:38         ` Wei-Wei Guo
@ 2009-03-12 18:29           ` Taco Hoekwater
  2009-03-13  1:15             ` Wei-Wei Guo
  0 siblings, 1 reply; 16+ messages in thread
From: Taco Hoekwater @ 2009-03-12 18:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wei-Wei Guo wrote:
>>
> 
> I'm still confused. Is it possible to use different bibl based on the value
> of \lang. 

I am not sure what \lang is now, but you cannot get a different bibl
file based on the current \language or \mainlanguage in the document.

I was talking about influencing one (or more) of the entries in the
bibliography list based on the language of that actual entry. With
quite some trickery, that could be made to work (but not easy either).

Best wishes,
Taco






___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: How to use my own BibTeX style (bst)?
  2009-03-12 18:29           ` Taco Hoekwater
@ 2009-03-13  1:15             ` Wei-Wei Guo
  2009-03-13  8:09               ` Taco Hoekwater
  0 siblings, 1 reply; 16+ messages in thread
From: Wei-Wei Guo @ 2009-03-13  1:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Taco Hoekwater 写道:
> Wei-Wei Guo wrote:
>>>
>>
>> I'm still confused. Is it possible to use different bibl based on the 
>> value
>> of \lang. 
> 
> I am not sure what \lang is now, but you cannot get a different bibl
> file based on the current \language or \mainlanguage in the document.
> 

The \lang that I said is the entry field in \startpublications. It is listed
in the t-bib manual.

> I was talking about influencing one (or more) of the entries in the
> bibliography list based on the language of that actual entry. With
> quite some trickery, that could be made to work (but not easy either).
> 

Maybe it is better to provide a simple example. For example, I have try.bbl
as following.


   \startpublication[k=article-full,t=article,
   a={{Aamport},{}},y=1986,
   n=1,s=AAAA86]
   \artauthor[]{Leslie~A.}[L.~A.]{}{Aamport}
   \artauthor[]{Leslie~A.}[L.~A.]{}{Aamport}
   \artauthor[]{Leslie~A.}[L.~A.]{}{Aamport}
   \artauthor[]{Leslie~A.}[L.~A.]{}{Aamport}
   \pubyear{1986}
   \arttitle{The gnats and gnus document preparation system}
   \journal{\mbox{G-Animal's} Journal}
   \volume{41}
   \issue{7}
   \pages{73--83}
   \month{7}
   \note{This is a full ARTICLE entry}
   \stoppublication

   \startpublication[k=c-article-full,t=article,
   a={{姓名一},{}},y=1986,
   n=2,s=XXXX86]
   \lang{chinese}
   \artauthor[]{}[]{}{姓名一}
   \artauthor[]{}[]{}{姓名二}
   \artauthor[]{}[]{}{姓名三}
   \artauthor[]{}[]{}{姓名四}
   \pubyear{1986}
   \arttitle{一篇文章的名字}
   \journal{一本杂志的名字}
   \volume{41}
   \issue{7}
   \pages{73--82}
   \month{7}
   \note{This is a full ARTICLE entry}
   \stoppublication


And I cite those two entries in my main text.


   English Bibliogrphy \cite[article-full].

   中文文献 \cite[c-article-full]。


I want to get


   English Bibliogrphy (Aamport, et al.,1986).
   中文文献(姓名一, 等, 1986)。


Could you give some clues about how to implement it?

Another question: How to get "Hoekwater(2009)" instead of "(Hoekwater, 2009)"?
I mean the equal command of \citet in LaTeX.


Best wishes,
Wei-Wei
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: How to use my own BibTeX style (bst)?
  2009-03-13  1:15             ` Wei-Wei Guo
@ 2009-03-13  8:09               ` Taco Hoekwater
  2009-03-13 10:27                 ` Wei-Wei Guo
  0 siblings, 1 reply; 16+ messages in thread
From: Taco Hoekwater @ 2009-03-13  8:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

Wei-Wei Guo wrote:
>>
> 
> Maybe it is better to provide a simple example. For example, I have try.bbl
> as following.

In mkiv (and xetex also, I assume), that just works, assuming you have a
working typescript for the combination of scripts. Example attached (the
example uses AdobeMingStd-Light)

I have absolutely no idea how to make this work in pdftex.

Best wishes,
Taco


[-- Attachment #2: runme.tex --]
[-- Type: application/x-tex, Size: 2088 bytes --]

[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: How to use my own BibTeX style (bst)?
  2009-03-13  8:09               ` Taco Hoekwater
@ 2009-03-13 10:27                 ` Wei-Wei Guo
  2009-03-13 17:30                   ` Taco Hoekwater
  0 siblings, 1 reply; 16+ messages in thread
From: Wei-Wei Guo @ 2009-03-13 10:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Taco Hoekwater 写道:
> 
> In mkiv (and xetex also, I assume), that just works, assuming you have a
> working typescript for the combination of scripts. Example attached (the
> example uses AdobeMingStd-Light)
> 

You might misunderstand. I was providing an example to you in my previous email,
not asking you to give me an example file. But it is fine since I can describe
my problem clear based on the PDF file generated from 'runme.tex'.

Here is what I want:

   English Bibliogrphy (Aamport, et al.,1986).
   中文文献(姓名一, 等, 1986)。

   Aamport, L. A., Aamport, L. A., Aamport, L. A. and Aamport, L. A. (1986).
      The gnats and gnus document preparation system. G-Animal's Journal, 41(7),
      73-83. This is a full ARTICLE entry.
   姓名一, 姓名二, 姓名三 和 姓名四(1986).一篇文章的名字.一本杂志的名字, 41(7),
      73-82. This is a full ARTICLE entry.


Here is what 'runme.tex' provides:

   English Bibliogrphy (Aamport, et al.,1986).
   中文文献(姓名一, etal, 1986)。

   Aamport, L. A., Aamport, L. A., Aamport, L. A. and Aamport, L. A. (1986).
      The gnats and gnus document preparation system. G-Animal's Journal, 41(7),
      73-83. This is a full ARTICLE entry.
   姓名一,姓名二,姓名三and姓名四(1986).一篇文章的名字.一本杂志的名字, 41(7),
      73-82. This is a full ARTICLE entry.


Compare those two results:

- Chinese citation uses '等' instead of 'et al'.
- Chinese bibliography uses '和' instead of 'and'.

Of course, the comparison is not complete.

My question: Since I can write 'bibl-my-en.tex' for English entries and
'bibl-my-zh.tex' for Chinese entries, can I use both of them when I have both
English and Chinese citations in one paper? If not, could you give some advises
about how to implement it?

Hope I made it clear this time.


Best wishes,
Wei-Wei


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: How to use my own BibTeX style (bst)?
  2009-03-13 10:27                 ` Wei-Wei Guo
@ 2009-03-13 17:30                   ` Taco Hoekwater
  2009-03-14  4:23                     ` Wei-Wei Guo
  2009-03-14  4:32                     ` What does "\c!" means? Wei-Wei Guo
  0 siblings, 2 replies; 16+ messages in thread
From: Taco Hoekwater @ 2009-03-13 17:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 3241 bytes --]

Wei-Wei Guo wrote:
> Compare those two results:
> 
> - Chinese citation uses '等' instead of 'et al'.
> - Chinese bibliography uses '和' instead of 'and'.
> 
> Of course, the comparison is not complete.
> 
> My question: Since I can write 'bibl-my-en.tex' for English entries and
> 'bibl-my-zh.tex' for Chinese entries, can I use both of them when I have 
> both English and Chinese citations in one paper? If not, could you give some 
> advises about how to implement it?

The short answer is no.

The long answer: although you cannot make it depend on the language
of the citation, you can make it change depending on an explicit
language switch. This takes a bit of work, but it is better than
nothing, I guess.

Here is how:

* first, edit the bibl-my file so that it contains calls to
   \labeltext{} instead of literal tests, for example:

    \setupcite
        [authoryears]
        [andtext={ \labeltext{and} },
         otherstext={ \labeltext{etal}},
         .... % many more are needed, of course

   you can invent wnatever you like in the argument of \labeltext,
   because you will define them in the next step.

* second, define all the label texts you used in the previous
   step for the all languages you need.  Short example:

   \setuplabeltext[en][etal={et al.}, and={and}]
   \setuplabeltext[cn][etal={等},and={和}]

* third, you now need to do a \mainlanguage switch before every \cite
   that does not use the main language of your paper. So assuming
   your paper is uses \mainlanguage[cn], then you need to create
   a definition like this for the english citations:

     \def\encite[#1]{{\mainlanguage[en]\cite[#1]}}

   and you have to use \encite[article=full] in your paper.

that takes care of the citations in the running text of your paper.
For the publication list:

* first, you have to redefine one of the t-bib macros.
   The new definition of \lang (to be put in your setup) should become

   \unprotect
   \def\lang#1%
    {\def\biblanguage{#1}%
     \ifcsname \??pb @lang@#1\endcsname
         \expanded{\mainlanguage[\getvalue{\??pb @lang@#1}]}%
         \expanded{\language[\getvalue{\??pb @lang@#1}]}%
      \fi \ignorespaces}
    \protect

* two, you have to a language field to each bibtex data item.


* three, you need a \setbiblanguage command for every language name
   that appears in your bib file. This will connect \lang arguments
   to context language keys.

   For example:

     \setbiblanguage{chinese}{cn}
     \setbiblanguage{english}{en}

   you may need a few of those, depending on how consistent your
   bibtex data is.


After all of that, it will probably work, in most cases. Incidentally,
one of the reasons why the bib modules doesn't do this is because all
of that mucking about with \mainlanguage not very nice. Another is that
a simple string replacement is usually not sufficient to have proper
localization. A third reason is that many publishers want to have
citation data in the language of the paper, regardless of the
language of the cited publications.

For completeness' I have attached my example again, with all these
points applied.

Best wishes,
Taco




[-- Attachment #2: runme.tex --]
[-- Type: application/x-tex, Size: 2956 bytes --]

[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: How to use my own BibTeX style (bst)?
  2009-03-13 17:30                   ` Taco Hoekwater
@ 2009-03-14  4:23                     ` Wei-Wei Guo
  2009-03-14  4:32                     ` What does "\c!" means? Wei-Wei Guo
  1 sibling, 0 replies; 16+ messages in thread
From: Wei-Wei Guo @ 2009-03-14  4:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thank you very much!

Best wishes,
Wei-Wei


Taco Hoekwater 写道:
> The long answer: although you cannot make it depend on the language
> of the citation, you can make it change depending on an explicit
> language switch. This takes a bit of work, but it is better than
> nothing, I guess.
> 
> Here is how:
> 
> * first, edit the bibl-my file so that it contains calls to
>   \labeltext{} instead of literal tests, for example:
> 
>    \setupcite
>        [authoryears]
>        [andtext={ \labeltext{and} },
>         otherstext={ \labeltext{etal}},
>         .... % many more are needed, of course
> 
>   you can invent wnatever you like in the argument of \labeltext,
>   because you will define them in the next step.
> 
> * second, define all the label texts you used in the previous
>   step for the all languages you need.  Short example:
> 
>   \setuplabeltext[en][etal={et al.}, and={and}]
>   \setuplabeltext[cn][etal={等},and={和}]
> 
> * third, you now need to do a \mainlanguage switch before every \cite
>   that does not use the main language of your paper. So assuming
>   your paper is uses \mainlanguage[cn], then you need to create
>   a definition like this for the english citations:
> 
>     \def\encite[#1]{{\mainlanguage[en]\cite[#1]}}
> 
>   and you have to use \encite[article=full] in your paper.
> 
> that takes care of the citations in the running text of your paper.
> For the publication list:
> 
> * first, you have to redefine one of the t-bib macros.
>   The new definition of \lang (to be put in your setup) should become
> 
>   \unprotect
>   \def\lang#1%
>    {\def\biblanguage{#1}%
>     \ifcsname \??pb @lang@#1\endcsname
>         \expanded{\mainlanguage[\getvalue{\??pb @lang@#1}]}%
>         \expanded{\language[\getvalue{\??pb @lang@#1}]}%
>      \fi \ignorespaces}
>    \protect
> 
> * two, you have to a language field to each bibtex data item.
> 
> 
> * three, you need a \setbiblanguage command for every language name
>   that appears in your bib file. This will connect \lang arguments
>   to context language keys.
> 
>   For example:
> 
>     \setbiblanguage{chinese}{cn}
>     \setbiblanguage{english}{en}
> 
>   you may need a few of those, depending on how consistent your
>   bibtex data is.
> 
> 
> After all of that, it will probably work, in most cases. Incidentally,
> one of the reasons why the bib modules doesn't do this is because all
> of that mucking about with \mainlanguage not very nice. Another is that
> a simple string replacement is usually not sufficient to have proper
> localization. A third reason is that many publishers want to have
> citation data in the language of the paper, regardless of the
> language of the cited publications.
> 
> For completeness' I have attached my example again, with all these
> points applied.
> 
> Best wishes,
> Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* What does "\c!" means?
  2009-03-13 17:30                   ` Taco Hoekwater
  2009-03-14  4:23                     ` Wei-Wei Guo
@ 2009-03-14  4:32                     ` Wei-Wei Guo
  2009-03-14  7:22                       ` Alan Stone
  1 sibling, 1 reply; 16+ messages in thread
From: Wei-Wei Guo @ 2009-03-14  4:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear all,

I'm reading the source file of t-bib. I find there are lots of '\c!', '\s!', and
'\v!'. What do they mean? I searched in wiki, TeXBook, ConTeXt manual, TeX impatient,
and mail list. Those commands appear some times, but no explanation.

Another question is related the following codes from Taco (thank you, Taco). There
are tokens like '\??pb @lang@`. What does it mean? Could you tell me, to get deep
understanding, what to read or which part to read in TeXBook or some other manuals.
I don't know what to search to find related topics.

>   \unprotect
>   \def\lang#1%
>    {\def\biblanguage{#1}%
>     \ifcsname \??pb @lang@#1\endcsname
>         \expanded{\mainlanguage[\getvalue{\??pb @lang@#1}]}%
>         \expanded{\language[\getvalue{\??pb @lang@#1}]}%
>      \fi \ignorespaces}
>    \protect
> 

Best wishes,
Wei-Wei
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: What does "\c!" means?
  2009-03-14  4:32                     ` What does "\c!" means? Wei-Wei Guo
@ 2009-03-14  7:22                       ` Alan Stone
  2009-03-14  7:25                         ` Taco Hoekwater
  0 siblings, 1 reply; 16+ messages in thread
From: Alan Stone @ 2009-03-14  7:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1022 bytes --]

On Sat, Mar 14, 2009 at 5:32 AM, Wei-Wei Guo <wwguocn@gmail.com> wrote:

> Dear all,
>
> I'm reading the source file of t-bib. I find there are lots of '\c!',
> '\s!', and
> '\v!'. What do they mean? I searched in wiki, TeXBook, ConTeXt manual, TeX
> impatient,
> and mail list. Those commands appear some times, but no explanation.


http://archive.contextgarden.net/message/20080629.104105.40e28a70.el.html



> Another question is related the following codes from Taco (thank you,
> Taco). There
> are tokens like '\??pb @lang@`. What does it mean? Could you tell me, to
> get deep
> understanding, what to read or which part to read in TeXBook or some other
> manuals.
> I don't know what to search to find related topics.
>
>  \unprotect
>>  \def\lang#1%
>>   {\def\biblanguage{#1}%
>>    \ifcsname \??pb @lang@#1\endcsname
>>        \expanded{\mainlanguage[\getvalue{\??pb @lang@#1}]}%
>>        \expanded{\language[\getvalue{\??pb @lang@#1}]}%
>>     \fi \ignorespaces}
>>   \protect
>>
>>
> Best wishes,
> Wei-Wei

[-- Attachment #1.2: Type: text/html, Size: 1690 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: What does "\c!" means?
  2009-03-14  7:22                       ` Alan Stone
@ 2009-03-14  7:25                         ` Taco Hoekwater
  2009-03-14 14:44                           ` Wei-Wei Guo
  2009-03-15 15:15                           ` Wei-Wei Guo
  0 siblings, 2 replies; 16+ messages in thread
From: Taco Hoekwater @ 2009-03-14  7:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Alan Stone wrote:
> On Sat, Mar 14, 2009 at 5:32 AM, Wei-Wei Guo <wwguocn@gmail.com> wrote:
> 
>> Dear all,
>>
>> I'm reading the source file of t-bib. I find there are lots of '\c!',
>> '\s!', and
>> '\v!'. What do they mean? I searched in wiki, TeXBook, ConTeXt manual, TeX
>> impatient,
>> and mail list. Those commands appear some times, but no explanation.
> 
> 
> http://archive.contextgarden.net/message/20080629.104105.40e28a70.el.html

Also generally helpful for a low-level understanding of context are
these wiki pages:

   http://wiki.contextgarden.net/System_Macros

Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: What does "\c!" means?
  2009-03-14  7:25                         ` Taco Hoekwater
@ 2009-03-14 14:44                           ` Wei-Wei Guo
  2009-03-15 15:15                           ` Wei-Wei Guo
  1 sibling, 0 replies; 16+ messages in thread
From: Wei-Wei Guo @ 2009-03-14 14:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thank you, Taco and Alan.


Best wishes,
Wei-Wei

Taco Hoekwater 写道:
> Alan Stone wrote:
>> On Sat, Mar 14, 2009 at 5:32 AM, Wei-Wei Guo <wwguocn@gmail.com> wrote:
>>
>>> Dear all,
>>>
>>> I'm reading the source file of t-bib. I find there are lots of '\c!',
>>> '\s!', and
>>> '\v!'. What do they mean? I searched in wiki, TeXBook, ConTeXt 
>>> manual, TeX
>>> impatient,
>>> and mail list. Those commands appear some times, but no explanation.
>>
>>
>> http://archive.contextgarden.net/message/20080629.104105.40e28a70.el.html
> 
> Also generally helpful for a low-level understanding of context are
> these wiki pages:
> 
>   http://wiki.contextgarden.net/System_Macros
> 

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: What does "\c!" means?
  2009-03-14  7:25                         ` Taco Hoekwater
  2009-03-14 14:44                           ` Wei-Wei Guo
@ 2009-03-15 15:15                           ` Wei-Wei Guo
  2009-03-15 15:38                             ` Wolfgang Schuster
  2009-03-15 16:01                             ` Hans Hagen
  1 sibling, 2 replies; 16+ messages in thread
From: Wei-Wei Guo @ 2009-03-15 15:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Taco,

I just finished reading the 'System_Macros'. I still don't get the meaning
of '\??pb @lang@' in the following codes:

   \def\lang#1%
    {\def\biblanguage{#1}%
     \ifcsname \??pb @lang@#1\endcsname
         \expanded{\mainlanguage[\getvalue{\??pb @lang@#1}]}%
         \expanded{\language[\getvalue{\??pb @lang@#1}]}%
      \fi \ignorespaces}

In \lang[zh], for example, '\??pb @lang@' will be expanded to \@@pblangen,
will it? Is \??pb a command? Is '\??pb @lang@' a command? Why can there be
a whitespace in '\??pb @lang@'?

Sorry for some many questions. I'm so confused and don't know what to
search in wiki, manuals, etc..


Best wishes,
Wei-Wei

Taco Hoekwater 写道:
> Also generally helpful for a low-level understanding of context are
> these wiki pages:
> 
>   http://wiki.contextgarden.net/System_Macros
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: What does "\c!" means?
  2009-03-15 15:15                           ` Wei-Wei Guo
@ 2009-03-15 15:38                             ` Wolfgang Schuster
  2009-03-15 16:01                             ` Hans Hagen
  1 sibling, 0 replies; 16+ messages in thread
From: Wolfgang Schuster @ 2009-03-15 15:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 15.03.2009 um 16:15 schrieb Wei-Wei Guo:

> I just finished reading the 'System_Macros'. I still don't get the  
> meaning
> of '\??pb @lang@' in the following codes:
>
>  \def\lang#1%
>   {\def\biblanguage{#1}%
>    \ifcsname \??pb @lang@#1\endcsname
>        \expanded{\mainlanguage[\getvalue{\??pb @lang@#1}]}%
>        \expanded{\language[\getvalue{\??pb @lang@#1}]}%
>     \fi \ignorespaces}
>
> In \lang[zh], for example, '\??pb @lang@' will be expanded to  
> \@@pblangen,
> will it? Is \??pb a command? Is '\??pb @lang@' a command? Why can  
> there be
> a whitespace in '\??pb @lang@'?

\lang{zh} forms in the \ifcsname ... \endcsname the command  
\@@pp@lang@zh
and looks if the commands is defined, if this is true the language is
switched to chinese.

> Sorry for some many questions. I'm so confused and don't know what to
> search in wiki, manuals, etc..

The \??bp at the begin of the macro is ConTeXt's system to create a  
namespace.

To understand I have to go a little bit away from the above macro and  
will
explain it on ConText's command to create key-val list. With the  
internal
command \getparameters is used to create key-val-lists, this is done  
with

   \getparameters[mycommand][width=1cm,height=2cm,align=right]

This creates the commands \mycommandwidth with the value 1cm,  
\mycommandheight
with the value 2cm and \mycommandalign with the value right. The text  
in the
first brace is the namespace which is used as prefix for each created  
command.
To optimize this operation and save a little bit of TeX's register we  
replace
'mycommand' with '\mycommand' which expand itself \mycommand, to make  
this
system more consystem ConTeXt use the convetion to use namespaces with  
two
question marks and two (or more) letter like the above \??bp, you can  
more
of this tricks in a article from Hans [1].

The space after '\??bp' and the \lang macro above is necessary because  
TeX
thinks otherwise '@lang@' is a part of the '\??bp' command and to  
prevent
this Taco puts the space there.

As a normal user you don't want to write macros or as beginner in  
ConTeXT
programming you don't have to care about this but it's good to know  
why are
things done in this way to understand system macros.

[1] http://www.ntg.nl/maps/22/27.pdf

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: What does "\c!" means?
  2009-03-15 15:15                           ` Wei-Wei Guo
  2009-03-15 15:38                             ` Wolfgang Schuster
@ 2009-03-15 16:01                             ` Hans Hagen
  2009-03-16  5:13                               ` Wei-Wei Guo
  1 sibling, 1 reply; 16+ messages in thread
From: Hans Hagen @ 2009-03-15 16:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wei-Wei Guo wrote:
> Hi Taco,
> 
> I just finished reading the 'System_Macros'. I still don't get the meaning
> of '\??pb @lang@' in the following codes:
> 
>   \def\lang#1%
>    {\def\biblanguage{#1}%
>     \ifcsname \??pb @lang@#1\endcsname
>         \expanded{\mainlanguage[\getvalue{\??pb @lang@#1}]}%
>         \expanded{\language[\getvalue{\??pb @lang@#1}]}%
>      \fi \ignorespaces}
> 
> In \lang[zh], for example, '\??pb @lang@' will be expanded to \@@pblangen,
> will it? Is \??pb a command? Is '\??pb @lang@' a command? Why can there be
> a whitespace in '\??pb @lang@'?

\??pb creates a namespace so you cannot mess with it in your document 
easily

\??pb is just a macro and the ?? makes it kind of private (hidden)

there has to be a whitespace otherwise you'd call for \??pb@lang@

> Sorry for some many questions. I'm so confused and don't know what to
> search in wiki, manuals, etc..

this is not stuff most users want to know or see; add a few 
\expandafter's, \futurelet's and \afterassignments and one wonders in 
what universe one has ended up

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: What does "\c!" means?
  2009-03-15 16:01                             ` Hans Hagen
@ 2009-03-16  5:13                               ` Wei-Wei Guo
  0 siblings, 0 replies; 16+ messages in thread
From: Wei-Wei Guo @ 2009-03-16  5:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks, Wolfgang and Hans.


Best wishes,
Wei-Wei


Hans Hagen 写道:
> 
> this is not stuff most users want to know or see; add a few 
> \expandafter's, \futurelet's and \afterassignments and one wonders in 
> what universe one has ended up
> 
> Hans
> 
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2009-03-16  5:13 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-06 17:22 How to use my own BibTeX style (bst)? Wei-Wei Guo
     [not found] ` <436429714.24327@zju.edu.cn>
     [not found]   ` <49B2ACE1.5010800@gmail.com>
     [not found]     ` <6faad9f00903090800v44877263te205e056cb28d282@mail.gmail.com>
     [not found]       ` <49B5363D.4060700@elvenkind.com>
2009-03-12 16:38         ` Wei-Wei Guo
2009-03-12 18:29           ` Taco Hoekwater
2009-03-13  1:15             ` Wei-Wei Guo
2009-03-13  8:09               ` Taco Hoekwater
2009-03-13 10:27                 ` Wei-Wei Guo
2009-03-13 17:30                   ` Taco Hoekwater
2009-03-14  4:23                     ` Wei-Wei Guo
2009-03-14  4:32                     ` What does "\c!" means? Wei-Wei Guo
2009-03-14  7:22                       ` Alan Stone
2009-03-14  7:25                         ` Taco Hoekwater
2009-03-14 14:44                           ` Wei-Wei Guo
2009-03-15 15:15                           ` Wei-Wei Guo
2009-03-15 15:38                             ` Wolfgang Schuster
2009-03-15 16:01                             ` Hans Hagen
2009-03-16  5:13                               ` Wei-Wei Guo

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).