Re: [NTG-context] Different author rendering in entry citation vs. list

2021-08-26 Thread Joey McCollum via ntg-context
Nevermind, it looks like there's an even more deliberate and succinct way
to handle this! In publ-ini.mkiv, the \currentbtxciteauthorbyfield command
shows how to print the author field mapped according to the cite style:

```
\unexpanded\def\currentbtxciteauthorbyfield
  {\begingroup
   %\setbtxparameterset\s!cite\s!author
   % the alternatives inherit from cite:author
   % and APA distinguishes authoryears from authoryear ("and" vs. "&")
   \setbtxparameterset\s!cite\currentbtxcitealternative
   \clf_btxauthor
{\currentbtxdataset}%
{\currentbtxtag}%
{\currentbtxauthorfield}%
{%
combiner{\btxparameter\c!authorconversion}%
kind{cite}%
etallimit   {\btxparameter\c!etallimit}%
etaldisplay {\btxparameter\c!etaldisplay}%
etaloption  {\btxparameter\c!etaloption}%
symbol  {\btxparameter{\c!stopper:initials}}%
}%
  \relax
  \endgroup}
```

The snippet above might offer some guidance on how to handle this problem
more generally, but for my specific use case, it suffices to invoke the
\currentbtxciteauthorbyfield command:

```
\doifelse {\currentbtxcitealternative} {entry} {
% Normal order for in-text citations
 \currentbtxciteauthorbyfield
} {
% Inverted order for list citations
% TODO: need to print the first name inverted, with all subsequent
names in normal order
\btxflush{author}
}
```

I get the feeling that there are more relevant commands in publ-ini.mkiv
that are intended to help with this kind of thing, but I've just been
unaware of most of them. The existing bibliography documentation only
covers the tip of the iceberg!

Anyway, I realized that a couple months ago, Ágoston Volcz raised a similar
issue in another thread. I think this approach should solve that problem,
so when I get a chance, I can send an e-mail about that.

Joey

On Thu, Aug 26, 2021 at 3:38 PM Joey McCollum 
wrote:

> Okay, I've made some progress! Thankfully, the authorconversion rules can
> be overridden using some of the methods defined in publ-ini.mkiv. I now
> have something like this in my rendering's .mkvi file:
>
> ```
> \doifelse {\currentbtxcitealternative} {entry} {
> % Normal order for in-text citations
> \btxflushauthornormal{author}
> } {
> % Inverted order for list citations
> % TODO: need to print the first name inverted, with all subsequent
> names in normal order
> \btxflushauthorinverted{author}
> }
> ```
>
> This fixes the citation alternative-dependent authorconversion, but I
> still have to do the same for the etallimit and etaldisplay settings, and
> unfortunately, it doesn't look like there are similar commands for
> overriding this locally.
>
> Digging a bit more in publ-imp-chicago.lua and publ-imp-chicago.mkvi, I
> notice that it deals with a similar problem for the "editor" field: if the
> editor occurs in the "author" position (i.e., at the start of the citation,
> which happens when a book has an editor but no author), then the
> authorconversion should be inverted, but if the editor occurs after the
> author position (which happens when a book also has an author), then its
> authorconversion should be normalshort. The publ-imp-chicago.lua file
> addresses this by specifying an "ineditor" set containing only the "editor"
> field (essentially making it an alias to be used later), and then
> publ-imp-chicago.mkvi defines a style specifically for this field. I could
> solve the authorconversion, etallimit, and etaldisplay problems using an
> "entryauthor" field, but is this actually the recommended way to do this?
> Using this approach, I would have to have duplicate sets for nearly all
> "author"-type fields to ensure that they have different formatting in entry
> citations than they do in the list.
>
> Joey
>
> On Wed, Aug 25, 2021 at 5:45 PM Joey McCollum 
> wrote:
>
>> Hi,
>>
>> I'm trying to implement a custom bibliography rendering where in-text
>> citations (specifically, citations with alternative=entry) are not
>> identical to the entries in the bibliography list. Following a pattern I've
>> seen in publ-imp-chicago.mkvi, I've been able to implement most of the
>> features I'm interested in by using conditional formatting with a mode that
>> is specifically set for citations with the "entry" alternative. I'd also
>> like for author names in entry citations to be different author names in
>> list entries, in the following ways:
>>
>>- In entry citations, authorconversion should be normal, while in
>>list entries, authorconversion should be inverted (more specifically, the
>>first name should be inverted, while all subsequent names should be in
>>normal order...but if this is too complicated, then it may be an issue for
>>another e-mail thread, and we can just focus on normal vs. inverted for
>>now).
>>- In entry citations, "et al." should be used for any names after the
>>third name, while in list 

Re: [NTG-context] Indexing redux

2021-08-26 Thread Rik Kabel via ntg-context


On 8/26/2021 03:26, Taco Hoekwater wrote:

Hi Rik,


On 26 Aug 2021, at 03:14, Rik Kabel via ntg-context  wrote:

List,

I am trying to create an index with both "see" and "see also" cross-reference entries.[1] At this 
point, ConTeXt provides basic support for "see" entries via the \seeREGISTER command (it does not properly 
support references to sub-entries) and it provides no support at all for "see also" entries.

Can somebody suggest a way to generate these entries? Perhaps a way of 
inserting entries into the index before it is formatted, in the manner of 
\writetolist or \writebetweenlist? (MkII has \writetoregister, but that did not 
carry forward and I do not know if it would have helped here.)


Since strc-reg.mkiv starts with a number of ’todo’ comments, I think your best 
bet is to create an
actual functional example along with an explanation of what you want the 
typeset result to look
like in the cases where it is not doing what you want.

Generally, explicit examples / test files are the best way to get replies to 
questions
(either by Hans or anyone else).


The following produces what I am looking for, and a bit more. Page 3 of 
the output shows what I would like to see, page 4 is the generated 
index. I don't really need the "see under" and "see also under" 
variants, but they would be nice to have. I am indifferent to having 
stops before "see also"s. I would like to be able to turn checking on or 
off, so that generic directives (in the example, see also specific 
breeds) will not generate an error, while the Ford Prefect example will 
generate an error.



   \defineprocessor[also][color=blue]
   \defineprocessor[under][color=green]
   \defineprocessor[alsounder][color=orange]
   \define\seealsoindex\seeindex
   \define\seealsounderindex\seeindex
   \define\seeunderindex\seeindex
   \setupinteraction [state=start]
   \setupregister    [index][balance=no,check=no]

   %% seeindex entries may start on the same line as their head entry
   \seeindex {dog breeds+Wiener dog}{dog breeds+Dachshund}
   %%  The next example should not work,
   %%    since there is no main entry /Adams, Douglas/
   \seeindex {Prefect, Ford}{Adams, Douglas}

   %%  When referring to a subentry, the target must be a subentry,
   %%    but should display as if a main entry. The next example
   %%    should point to the /Adams+Douglas/ subentry, but it
   %%    should be formatted as if it were /Adams, Douglas/
   \seeindex {Dent, Arthur}{Adams+Douglas}

   %% The following two work as expected
   \seeindex {Matilda effect}{obliteration}
   \seeindex {Marut, Ret}{Traven, B.}

   %% seealso should be placed after as a subentry after real page
   references
   %% seealso should have an appropriate label (default English /see also/)
   \seealsoindex {pseudepigraphy}{also->obliteration}
   \seealsoindex {dog breeds}{also->breeding programs}
   \seealsoindex {dog breeds}{also->specific breeds}
   %% seealsounder is like seealso except that it refers to a main entry
   \seealsounderindex{Coton de Tulear}{alsounder->dog breeds}
   %% seeunder also is like seealso except that it refers to a main entry
   \seeunderindex    {Weimaraner}{under->dog breeds}
   \starttext
 Stuff
 \index{obliteration}
 \index{Adams+Douglas}\index{Adams+John}
 \index{Beagle}
 \index{dog breeds+Beagle}
 \index{dog breeds+Coton de Tulear}
 \index{dog breeds+Dachshund}
 \index{dog breeds+Weimaraner}
   \page
 More stuff
 \index{Adams+John Quincy}
 \index{misquotation}
 \index{pseudepigraphy}
 \index{Traven, B.}
 \index{Beagle}
 \index{Coton de Tulear}
 \index{breeding programs}
   \page
   \definedescription[Index][headstyle=bold,alternative=top,inbetween=]
   \startIndex{a}
 Adams\par
 \quad \reference[AdamsDouglas]{Adams, Douglas}Douglas\quad 1\par
 \quad John\quad 1\par
 \quad John Quincy\quad 2\par
   \stopIndex
   \startIndex{b}
 Beagle\quad 1, 2\par
 \reference[breedingprograms]{breeding programs}breeding
   programs\quad 2
   \stopIndex
   \startIndex{c}
 Coton de Tulear\quad 2.\par
 \quad {\em See also under} \in[dogbreeds]
   \stopIndex
   \startIndex{d}
 \reference[DentArthur]{Dent, Arthur}Dent, Arthur {\em see}
   \in[AdamsDouglas]\par
 \reference[dogbreeds]{dog breeds}dog breeds\par
 \quad \reference[dbBeagle]{dog breeds, Beagle}Beagle\quad 1\par
 \quad \reference[dbCoton]{dog breeds, Coton}Coton de
   Tulear\quad 1\par
 \quad \reference[dbDachshund]{dog breeds,
   Dachshund}Dachshund\quad 1\par
 \quad \reference[dbWeimaraner]{dog breeds,
   Weimaraner}Weimaraner\quad 1\par
 \quad Wiener dog\quad {\em see} \in[dbDachshund]\par
  

Re: [NTG-context] Different author rendering in entry citation vs. list

2021-08-26 Thread Joey McCollum via ntg-context
Okay, I've made some progress! Thankfully, the authorconversion rules can
be overridden using some of the methods defined in publ-ini.mkiv. I now
have something like this in my rendering's .mkvi file:

```
\doifelse {\currentbtxcitealternative} {entry} {
% Normal order for in-text citations
\btxflushauthornormal{author}
} {
% Inverted order for list citations
% TODO: need to print the first name inverted, with all subsequent
names in normal order
\btxflushauthorinverted{author}
}
```

This fixes the citation alternative-dependent authorconversion, but I still
have to do the same for the etallimit and etaldisplay settings, and
unfortunately, it doesn't look like there are similar commands for
overriding this locally.

Digging a bit more in publ-imp-chicago.lua and publ-imp-chicago.mkvi, I
notice that it deals with a similar problem for the "editor" field: if the
editor occurs in the "author" position (i.e., at the start of the citation,
which happens when a book has an editor but no author), then the
authorconversion should be inverted, but if the editor occurs after the
author position (which happens when a book also has an author), then its
authorconversion should be normalshort. The publ-imp-chicago.lua file
addresses this by specifying an "ineditor" set containing only the "editor"
field (essentially making it an alias to be used later), and then
publ-imp-chicago.mkvi defines a style specifically for this field. I could
solve the authorconversion, etallimit, and etaldisplay problems using an
"entryauthor" field, but is this actually the recommended way to do this?
Using this approach, I would have to have duplicate sets for nearly all
"author"-type fields to ensure that they have different formatting in entry
citations than they do in the list.

Joey

On Wed, Aug 25, 2021 at 5:45 PM Joey McCollum 
wrote:

> Hi,
>
> I'm trying to implement a custom bibliography rendering where in-text
> citations (specifically, citations with alternative=entry) are not
> identical to the entries in the bibliography list. Following a pattern I've
> seen in publ-imp-chicago.mkvi, I've been able to implement most of the
> features I'm interested in by using conditional formatting with a mode that
> is specifically set for citations with the "entry" alternative. I'd also
> like for author names in entry citations to be different author names in
> list entries, in the following ways:
>
>- In entry citations, authorconversion should be normal, while in list
>entries, authorconversion should be inverted (more specifically, the first
>name should be inverted, while all subsequent names should be in normal
>order...but if this is too complicated, then it may be an issue for another
>e-mail thread, and we can just focus on normal vs. inverted for now).
>- In entry citations, "et al." should be used for any names after the
>third name, while in list entries, all names should be printed in full.
>
> I thought that the following settings would work:
>
> \definebtx
>   [sbl:\s!list]
>   [sbl]
>   [\c!otherstext=,
>   \c!etallimit=,
>   \c!etaldisplay=,
>   \c!etaloption=,
>   \c!authorconversion=inverted] % TODO: need to print the first name
> inverted, with all subsequent names in normal order
>
> \definebtx
>   [sbl:\s!cite]
>   [sbl]
>   [\c!otherstext={\btxspace\btxlabeltext{others}}, % use et al. for
> truncated author / editor list
>\c!etallimit=3, % don't use et al. for 3 or fewer authors
>\c!etaldisplay=3, %
>\c!authorconversion=\v!normal] % by default, use normal name order for
> in-text citations
>
> But only the "list" settings seem to be used. I suspect this might be
> because the setup for "entry" citations invokes \btxhandleciteentry and
> therefore uses "list" settings everywhere except where I check modes for
> conditional formatting. But is there a command or environment I can use to
> change authorconversion locally, based on the current mode, in the helper
> methods I've defined for rendering bibliography entries?
>
> Thanks!
>
> Joey
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Test for displaying a header

2021-08-26 Thread Wolfgang Schuster via ntg-context

Fabrice Couvreur via ntg-context schrieb am 26.08.2021 um 19:06:

Hi,

Using this (almost what I'm trying to do) without success

[...]

\startsetups[header]
\doifelse{\totalnumberofpages}{1}
{\setupheadertexts[\setups{header}]}
    {}
\stopsetups


This stores the page check in the setups environment  but you never call 
it. The call from within the environment itself can't work because the 
content is never evaluated and even if it would be called you create an 
endless loop.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Test for displaying a header

2021-08-26 Thread Fabrice Couvreur via ntg-context
Hi,
Using this (but it's not exactly what I want) it works

test-1.tex %%

\setuppagenumbering
  [alternative=doublesided,location=]

\definelayout
  [1]
  [header=10mm]

\setuplayout
  [header=0pt,
   height=middle]

\setupbackgrounds
   [header]
   [text]
   [frame=off,bottomframe=on,
 framecolor=lightgray,rulethickness=1pt]


\starttext
\dorecurse{5}{\samplefile{lorem}}
%\dorecurse{1}{\samplefile{lorem}}
\stoptext

%%ù

Using this (almost what I'm trying to do) without success

test-2.tex %
\setuppagenumbering
  [alternative=doublesided,location=]

\setupbackgrounds
  [header]
  [text]
  [frame=off,bottomframe=on,
   framecolor=lightgray,rulethickness=1pt]

\startsetups[header]
  \doifelse{\totalnumberofpages}{1}
{\setupheadertexts[\setups{header}]}
{}
\stopsetups


\starttext
\dorecurse{5}{\samplefile{lorem}}
%\dorecurse{1}{\samplefile[lorem]r}
\stoptext

%%%

Fabrice


Le jeu. 26 août 2021 à 17:56, Wolfgang Schuster via ntg-context <
ntg-context@ntg.nl> a écrit :

> Taco Hoekwater via ntg-context schrieb am 26.08.2021 um 16:34:
> >
> > Hi,
> >
> >> On 26 Aug 2021, at 16:07, Fabrice Couvreur via ntg-context <
> ntg-context@ntg.nl> wrote:
> >>
> >> Hi,
> >> I know I asked the question a few years ago, but I don't remember !
> >> The idea is to test whether the document contains only one page or not.
> >
> > Perhaps not the nicest solution, but this works:
> >
> > \doifvalueelse
> >{\lastpage}
> >{1}
> >{\message{true}}
> >{\message{false}}
>
>
> Same solution but better counter name:
>
> \doifelse{\totalnumberofpages}{1}{...}{...}
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Test for displaying a header

2021-08-26 Thread Wolfgang Schuster via ntg-context

Taco Hoekwater via ntg-context schrieb am 26.08.2021 um 16:34:


Hi,


On 26 Aug 2021, at 16:07, Fabrice Couvreur via ntg-context  
wrote:

Hi,
I know I asked the question a few years ago, but I don't remember !
The idea is to test whether the document contains only one page or not.


Perhaps not the nicest solution, but this works:

\doifvalueelse
   {\lastpage}
   {1}
   {\message{true}}
   {\message{false}}



Same solution but better counter name:

\doifelse{\totalnumberofpages}{1}{...}{...}

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] layer disappears when showframe is set

2021-08-26 Thread Wolfgang Schuster via ntg-context

juh via ntg-context schrieb am 26.08.2021 um 14:46:

Hi,

this sample shows that the image in a layer in header disappears if showframe is
set.

\setupexternalfigures[location=default]
\definelayer[Cow]
[x=0, y=0]

\setlayer[Cow]
[x=10em, y=0mm]
{\externalfigure[cow][height=\lineheight]}
\setupbackgrounds[header][background=Cow]

\showframe

\starttext
\input knuth
\stoptext


The \showframe command is just a wrapper for \setupbackgrounds to enable 
the frames on certain parts of the page.


One of the settings which are passed to \setupbacgrounds when you use 
\showframe is "background=" which resets all previous values of the 
background-key.


To keep the layer setting you have to move \showframe above your own 
\setupbackgrounds command because the reset of the background-key 
happens then before you pass your own value.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Test for displaying a header

2021-08-26 Thread Taco Hoekwater via ntg-context

Hi,

> On 26 Aug 2021, at 16:07, Fabrice Couvreur via ntg-context 
>  wrote:
> 
> Hi, 
> I know I asked the question a few years ago, but I don't remember ! 
> The idea is to test whether the document contains only one page or not. 

Perhaps not the nicest solution, but this works:

\doifvalueelse
  {\lastpage}
  {1}
  {\message{true}}
  {\message{false}}

> If it contains only one page, the header is enabled. 
> If it contains several pages, the header is enabled only on the first page 
> but not on the others. 
> Thanks
> Fabrice
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

— 
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)



___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Test for displaying a header

2021-08-26 Thread Fabrice Couvreur via ntg-context
Hi,
I know I asked the question a few years ago, but I don't remember !
The idea is to test whether the document contains only one page or not.
If it contains only one page, the header is enabled.
If it contains several pages, the header is enabled only on the first page
but not on the others.
Thanks
Fabrice
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] layer disappears when showframe is set

2021-08-26 Thread juh via ntg-context
Hi,

this sample shows that the image in a layer in header disappears if showframe is
set.

\setupexternalfigures[location=default]
\definelayer[Cow]
[x=0, y=0]

\setlayer[Cow]
[x=10em, y=0mm]
{\externalfigure[cow][height=\lineheight]}
\setupbackgrounds[header][background=Cow]

\showframe

\starttext
\input knuth
\stoptext

Mit freundlichen Grüßen
Jan Ulrich Hasecke

-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de




signature.asc
Description: PGP signature
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Indexing redux

2021-08-26 Thread Taco Hoekwater via ntg-context
Hi Rik,

> On 26 Aug 2021, at 03:14, Rik Kabel via ntg-context  
> wrote:
> 
> List,
> 
> I am trying to create an index with both "see" and "see also" cross-reference 
> entries.[1] At this point, ConTeXt provides basic support for "see" entries 
> via the \seeREGISTER command (it does not properly support references to 
> sub-entries) and it provides no support at all for "see also" entries.
> 
> Can somebody suggest a way to generate these entries? Perhaps a way of 
> inserting entries into the index before it is formatted, in the manner of 
> \writetolist or \writebetweenlist? (MkII has \writetoregister, but that did 
> not carry forward and I do not know if it would have helped here.)


Since strc-reg.mkiv starts with a number of ’todo’ comments, I think your best 
bet is to create an
actual functional example along with an explanation of what you want the 
typeset result to look 
like in the cases where it is not doing what you want.

Generally, explicit examples / test files are the best way to get replies to 
questions 
(either by Hans or anyone else).

Best wishes,
Taco

>  
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)



___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___