Re: Bibliography: 2 works by same author
jbf <[email protected]>
| Newsgroups | gmane.comp.tex.context |
|---|---|
| Message-ID | <[email protected]> |
I realise that for the test t work I also needed to add in the bibliography at the end, so here is the fully working test file and its result Julian On 21/8/26 12:28, Jean-Pierre Delange via ntg-context wrote: > > Julian, > > I think the two issues you are seeing may be related less to the > individual bibliography commands than to the overall structure of the > thesis. > > For a 400-page document, ConTeXt’s structural context matters quite a > lot. In particular, method=localmay be something of a false friend > here: what we really need to know is how the chapter scope is being > established, where the bibliography rendering is placed in relation to > the chapter boundaries, and how already-rendered entries are > subsequently reused in the final bibliography. > > Could you therefore show us the basic architecture you are using for > the thesis? In particular: > > * are you using a project/product/component structure, or a single > main file? > * do you have a separate \environmentfile? > * how are chapters and sections actually opened and closed > (\chapter, \startchapter...\stopchapter, etc.)? > * where exactly does > \placebtxrendering[chapterlist][method=local]occur in relation to > \stopchapter? > * and where are the btx definitions and renderings set up: in the > environment, the product, or the main text? > > We do not need the whole thesis, of course. The environment file (or > the relevant parts of it), the main project/product skeleton, and the > beginning/end of Chapters 1 and 2 should probably be enough. > > My suspicion is that we need to separate three things more carefully: > the structural scope of the chapter, the method by which references > are collected/rendered, and whether entries already rendered in a > chapter may be rendered again later in the final bibliography. > > Once we see your document structure, it should also be possible to > make a small two- or three-chapter test that reproduces exactly what > you need: > > Chapter 1 → local bibliography > Chapter 2 → local bibliography > … > End of thesis → complete bibliography containing everything. > > That may also help explain why the Rogers example works correctly in > the small MWE but not inside the full thesis. > > Best wishes, > > JP > > > >> Le 21 août 2026 à 02:57, jbf <[email protected]> a écrit : >> >> >> >> Okay, JP, I solved the second problem (no chapter-level bibliography >> for Chapter 2) easily enough: had forgotten to include repeat=yes >> >> \placebtxrendering >> [chapterlist] >> [method=local, >> repeat=yes] >> >> Now let's see if I can solve the first problem! >> >> Julian >> >> On 20/8/26 23:08, Jean-Pierre Delange via ntg-context wrote: >>> >>> Hi Julian, >>> >>> I tested your suggestion with the current LMTX APA specification, >>> and it turns out that the grouping logic is already there. >>> >>> With: >>> >>> |\cite[authoryear][beiser1987,beiser1990] | >>> >>> ConTeXt produces: >>> >>> |(Beiser, 1987, 1990) | >>> >>> whereas two different authors give: >>> >>> |(Beiser, 1987; Jacobi, 1785) | >>> >>> There is also the |authoryears| variant, which produces the >>> narrative form: >>> >>> |Beiser (1987, 1990) | >>> >>> So your suggestion is still very useful: this would make a good >>> additional example for the Garden page, since the existing simple >>> example does not show that APA already handles repeated authors this >>> way. >>> >>> I attach the small MWE I used for the test. >>> >>> Best, JP >>> >>> JP >>> >>> >>> >>> >>>> Le 20 août 2026 à 07:39, jbf <[email protected]> a écrit : >>>> >>>> It just occurs to me, looking at one of the simple examples >>>> inhttps://wiki.contextgarden.net/Creating_a_bibliography_and_citing_sources, >>>> that it might be a good idea to include an example of two works by >>>> the same author, as well as 2 works involving different authors. >>>> >>>> The example provided is >>>> >>>> \cite >>>> [authoryear] >>>> [beiser1987,jacobi1785] >>>> >>>> and that will produce, in-text, (Beiser, 1987; Jacobi, 1785). >>>> >>>> But let's say Beiser wrote a second work in 1990. >>>> >>>> \cite >>>> [authoryear] >>>> [beiser1987,beiser1990] >>>> >>>> will produce (Beiser, 1987; Beiser, 1990). It might look better if >>>> we could get (Beiser, 1987, 1990). At the moment I can't quite see >>>> how to get that. >>>> >>>> Julian >>>> >>> >>> >>> ___________________________________________________________________________________ >>> If your question is of interest to others as well, please add an entry to the Wiki! >>> >>> maillist :[email protected] /https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl >>> webpage :https://www.pragma-ade.nl /https://context.aanhet.net (mirror) >>> archive :https://github.com/contextgarden/context >>> wiki :https://wiki.contextgarden.net >>> ___________________________________________________________________________________ >> ___________________________________________________________________________________ >> If your question is of interest to others as well, please add an >> entry to the Wiki! >> >> maillist : [email protected] / >> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl >> webpage : https://www.pragma-ade.nl / https://context.aanhet.net >> (mirror) >> archive : https://github.com/contextgarden/context >> wiki : https://wiki.contextgarden.net >> ___________________________________________________________________________________ > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist :[email protected] /https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage :https://www.pragma-ade.nl /https://context.aanhet.net (mirror) > archive :https://github.com/contextgarden/context > wiki :https://wiki.contextgarden.net > ___________________________________________________________________________________ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________
test-jbf-bib-01.pdf
(application/pdf, 31.1 KB) - not displayed
test-jbf-bib-01.tex
(text/x-tex, 12.5 KB)
\useMPlibrary[dum]
\setupbackend
[format=PDF/X-1a:2001,
intent={Coated FOGRA39 (ISO 12647-2:2004)}]
%%%
%%% PAPER/PAGE LAYOUT
%%%
%\showframe
\definepapersize
[USTrade][width=6in,height=9in]
\setuppapersize[USTrade][A4]
\setuplayout
[backspace=0.875in,
cutspace=0.60in,
topspace=0.5in,
bottomspace=0.65in,
header=0.23in,
headerdistance=0.2in,
footer=0.31in,
location=middle,
height=fit,
width=fit,
marking=on] % This sets up crop marks.
\setuppagenumbering
[alternative=doublesided,location={footer,middle}]
%%%
%%% MAKEUP
%%%
\setupmakeup[standard][page=yes,doublesided=no]
%%%
%%% FIGURES
%%%
\setupexternalfigures[directory={pics}]
%%%
%%% FONTS Choose suitable fonts from below
%%%
\definefontfeature[default][default][onum=no]%We can change to yes if we want
\definefontfamily[mainface][rm][EB Garamond]
%\definefontfamily [mainface] [ss] [alegreyasans]
\definefontfamily [mainface][ss] [Cabin]
\definefontfamily [mainface] [mm] [Tex Gyre Pagella Math]
\setupbodyfont[mainface]
\setupbodyfont[11.5pt]
%%%
%%% FONTS OTHER THAN LATIN-BASED
%%%
\enabletrackers[fonts.missing]
\replacemissingcharacters
%%%
%%% HEADER
%%%
%And if using roman numerals for frontmatter, any pagenumber needs to become userpagenumber for conversion to work in header.
\startsetups[parttitle:header]
\setupheadertexts
[{\hfill\getmarking[part]\hfill}][] % recto
[{\hfill\documentvariable{metadata:title}\hfill}][] % verso
\stopsetups
%%% HEADER SETUPS - CHAP-TITLE
\setupheadertexts
[{\hfill\getmarking[chapter]\hfill}][] % recto
[{\hfill\documentvariable{metadata:title}\hfill}][] % verso
%%% HEADER STYLE (we could also choose sc depending on font we are using. Some typefaces do not include small caps)
\setupheader [style={\switchtobodyfont[9pt,ss]}]
\setupheads[indentnext=no]
%%%
%%%PAGE NUMBERING. If we only want pn, then: \setuppagenumbering[location=]
%%%
%Note: if we want roman numerals for frontpart and arabic numerals for bodypart, then:
\startsectionblockenvironment [frontpart]
\setupuserpagenumber [numberconversion=romannumerals]
\setcounter [userpage] [5] %or adapt as appropriate
\stopsectionblockenvironment
\startsectionblockenvironment [bodypart]
\setcounter [userpage] [1]
\stopsectionblockenvironment
%%% PAGE NUMBER IN FOOTER (comment out if we want header)
\setuppagenumbering[alternative=doublesided,location=footer]
%%%
%%% ENDNOTES
%%%
\setupnote
[footnote]
[location=text]
%\setupnotation %to ensure vertical alignment with text
% [footnote]
% [alternative=left,
% numbercommand=\hskip.03em]
\setupsectionblock[frontpart][page=yes] %means start section block on a new page. If we said 'right' it would mean start on recto.
\setupsectionblock[bodypart] [page=yes]
\setupsectionblock[backpart] [page=yes]
\definepagebreak[firstpagebreak][yes,header,footer,right]
%%%
%%%HEADS
%%%
\setuphead[chapter][page=firstpagebreak]
\definehead[mychapter][chapter]
\setuphead[mychapter][page=yes]
\definehead[title] % Only using title for Contents head
\setuphead[title][page=yes]
\setuphead[mytitle][page=yes]
\definehead[chapterspec][chapter]
\setuphead[chapterspec][page=yes]
\defineresetset
[jbfreset] [] [0] %The name given to it can be anything. I chose jbfreset
%%% Parts (have removed other options here and just chosen part:named)
\startsetups[part:named]
\define[2]\MyChapterCommand%
{\framed[frame=on,bottomframe=on,leftframe=off,rightframe=off,topframe=off,align=middle]
{\vbox{\headtext{chapter} ##1\blank[small]##2}}}
\setuphead
[part][
header=empty,
placehead=yes,
bodypartlabel=part,
number=yes,
textcommand=Word,
alternative=middle,
style={\ssd},
textcommand=\crlf,
]
\setuphead[chapter][
header=empty,
alternative=middle,
style={\ssc},
after=\blank,
command=\MyChapterCommand,
sectionsegments=chapter,
sectionresetset=jbfreset,
number=yes,
after={\blank[1cm]}
]
\definehead[special][chapter]
\setuphead[special][
number=no,
incrementnumber=list]
\setuplabeltext[chapter=CHAPTER ,list:chapter=Chapter ,]
\setuplabeltext[part=PART ]
\definehead[mychapter][chapter]
\setuphead[mychapter][page=yes]
\setuphead
[section]
[number=no, style={\bf},before={\blank}]
\definehead[specsection][section]
\setuphead
[specsection]
[number=no,style={\it}]
\setuphead
[subsection]
[number=no,style={\ss\bf}]
\definehead[mytitle][title]
\setuphead[mytitle][page=yes]
\stopsetups
%CALL
%---------------------------
\setups[part:named]
%----------------------------
%%%
%%% Paragraph matters
%%%
\startsetups[narrow]
\setupindenting[no]
\stopsetups
\setupdelimitedtext[blockquote][style={\tf},before={\blank \setupinterlinespace[line=2.6ex]},after={\blank},indenting=no]
\definelines[poem]
\setuplines[poem][before={\blank \setupinterlinespace[line=2.6ex]},after={\blank},indenting=first,align=middle]
\definelines[mylines]
\setuplines[mylines][indenting={yes,1cm}] %Another option might be [indenting=no, style={\tf}]
%\setupfootnotes[location=text] %
\setupnotation
[footnote]
[alternative=left,
numbercommand=\hskip.03em]
\setupindenting
[medium,yes,next] % by default there is no indentation. Our choices are: never none not no yes always first next small medium big normal odd even, or DIMENSION of our own choice. The command \noindent can be placed before a para we don’t want indented. ’first’ means we also want paras after a header to be indented. Note that we can shift indentation of narrower by adding, e.h. [+5*left]
\setupnarrower
[middle=1cm,before={\blank},after={\blank}]
% could be left or right as well, or we could have a DIMENSION of our own choice for right and left, e.g. [3*left,2*right] We can shift indentation by adding e.g. [+5*left]
\setupalign
[hz, nothyphenated,stretched,verytolerant] % Normal would give us justified text. ’width’ or ’yes’ would do the same. hz enables slight stretching of characters, thus making use of ’font expansion’: see above. I am opting for no hyphenation, but if this produces ugly paras it can be omitted.
\setupwhitespace[small] % This is for space between paras: none small medium big line fixed fix DIMENSION are the choices. 'none' is default so doesn’t need mentioning. If we need more, vertical whitespace between some paras, we can do so with \blank.
\setupblank %leave at default
%%%
%%% TABLE OF CONTENTS
%%%
% to get blanks in a long list in order to separate groups, one possibility is e.g. \setinjector[list][11,21,31,41,51,61][{\blank[2*big]}] or for a break,
%\setinjector[list][10][\page]
\startsetups[parts]
\setupcombinedlist
[content]
[list={part,title,mytitle,special,chapter,mychapter,specsection}]
\setuplist[chapter][label=list:chapter,distance=1.3cm,style=,alternative=c,margin=.5cm,stopper={: },before=,after=]
\setuplist[title][distance=1.3cm,style=,alternative=c,margin=.5cm,stopper={: },before=,after=]
\setuplist[part][alternative=b,style=bold,number=yes,after=]
\setuplist[section][margin=.5cm]
\setuplist[specsection][margin=1cm]
%\setinjector[list][34][\page]
\stopsetups
\setups[parts]
%%%
%%% COLOUR
%%%
\definecolor[gray][s=.6]
\definecolor[darkgray][s=.4]
\definecolor[lightgray][s=.98]
\setupinitial[color=darkgray,font=fontinbold at 48pt,distance=3pt,n=3]
\setupexternalfigures[directory={pics}]
%%%
%%% SPACING
%%%
\setuplanguage[en][spacing=packed]
\setupwhitespace[none]
%%%
%%%OTHER
%%%
\setupcaptions[number=no, style={\tfx\setupinterlinespace[line=10pt]}]
% style={\tfx\setupinterlinespace[line=10pt]},
% headstyle=\rm,
% numberstopper={:},
% before=\blank,
% after=\blank]
%%%HYPHENATED URLS
\startsetups url
\setupalign[hyphenated]
\stopsetups
\sethyphenatedurlafter {:/.}
%It can then be called with \setup[url]\hyphenatedurl{}, e.g. at the beginning of a bibliography section, where it will work for all the URLs there. If we want to restrict it, we can place it inside a \start...\stop environment.
%%% \SwelledRule can be called in to provide a swelled rule divider
\setupMPvariables[SwelledRule]
[height=2pt,breadth=.5\localhsize]
\startuniqueMPgraphic{SwelledRule}%
{height,breadth}
x1 = 0;
x2 = x6 = .333x4; x3 = x5 = .667x4;
x4 = \MPvar{breadth};
y1 = y4 = \MPvar{height}/2;
y2 = y3 = \MPvar{height};
y5 = y6 = 0;
fill z1--z2--z3--z4--z5--z6--cycle;
\stopuniqueMPgraphic
\def\SwelledRule{%
\setlocalhsize
\midaligned{%
\reuseMPgraphic{SwelledRule}}}
\setupinterlinespace[line=3ex]
\definesymbol
[smallbullet]
[$\cdot$] %call it with \cdot
%%% DIVIDERS. Call with \setup[]. Or for swelled rule, \SwelledRule, or just use something like \star
\startsetups[diamonds]
\blank
\midaligned{\diamondsuit \diamondsuit \diamondsuit}
\blank
\stopsetups
%%% LAYERS (background)
\startsetups[movie] %Obviously replace movie in each case, and offsets
\definelayer[movie] % name of the layer
[x=0mm, y=0mm, % from upper left corner of paper
width=\paperwidth, height=\paperheight] % let the layer cover the full paper
\setlayer[movie] % name of the layer
[hoffset=.19\textwidth, voffset=1.8cm] % placement (from upper left corner of the layer)
{\externalfigure[movie.jpg][scale=645]} % the actual contents of the layer
\setupbackgrounds[page][background=movie]
\stopsetups %Call with \setups[movie]
%%% Two different layers on same page: Define two different setups as above (to adjust different positioning, names of images etc., e.g. 'movie' and 'other') and then be sure to include both in the final \setupbackgrounds[page][background={movie,other}] in both cases.
%%% ABBREVIATIONS e.g. \abbrev{}
\definedescription[abbrev]
\setupdescription[alternative=left, width=2.6cm, headstyle=normal]
%%% EPIGRAPH
\defineuserdataalternative [epigraph] [renderingsetup=userdata:epigraph]
\startsetups [userdata:epigraph]
\startframedtext [location=middle,frame=off,align={flushleft,broad},style=\tfx,offset=.25ex,width=.9\textwidth]
\begstrut\getinlineuserdata\endstrut
\crlf
\wordright{\userdataparameter{author}}
\stopframedtext
\stopsetups
\defineuserdata
[epigraph]
[alternative=epigraph]
%%% INITIALS (DROP CAPS)
%Change whatever is needed. To use, \placeinitial{}. \setupinitial[n=2,continue=yes]: the continue key where para is short
\setupinitial[font=semplicitapro at 48pt,distance=1pt,n=3,voffset=10mm]
%%% FRAMED TEXT call with \setups[] Note that framedtext does not break over pages
\startsetups[framed1]
\setupframed[location=middle,offset=.4cm]
\startframedtext[width=.77\makeupwidth,corner=round]
text here
\stopframedtext
\stopsetups
\startsetups[information]
\usesymbols[mvs]
\startuseMPgraphic{information}
draw textext.top("\tfb\symbol[martinvogel 2][Info]") shifted (-EmWidth,OverlayHeight-StrutHeight) ;
draw leftboundary OverlayBox topenlarged -StrutHeight shifted (-EmWidth,0) ;
setbounds currentpicture to OverlayBox ;%to remove vertical rule comment 2nd line
\stopuseMPgraphic
\defineoverlay[information][\useMPgraphic{information}]
\defineframedtext
[information]
[frame=off,
rulethickness=0pt,
offset=0pt,
background=information,
width=max]
\stopsetups
%%%BIBLIOGRAPHY
\usebtxdataset
[main]
[references.bib]
\usebtxdefinitions
[apa]
\definebtxrendering
[chapterlist]
[apa]
[dataset=main,
sorttype=authoryear]
\definebtxrendering
[finallist]
[apa]
[dataset=main,
sorttype=authoryear]
\definebtx
[apa:cite:shorthand]
[apa:cite]
[left={(},
right={)}]
\startsetups btx:cite:shorthand
\btxdirect{shorthand}%
\ifx\currentbtxrighttext\empty\else
\btxspace
\currentbtxrighttext
\fi
\stopsetups
%%%SPECIAL LAYOUT to fit more in (e.g. endorsements page)
\definelayout
[smallheader]
[headerdistance=1mm]
%Abbreviations page
\definedescription[abbrev]
\setupdescription[alternative=left, width=2cm, headstyle=normal,after={\blank[small]},before={\blank[small]}]
%% end preamble
\starttext
\startchapter[title={Chap 1 title}]
Psychotherapy and counselling can become important places of such encounter. At their best, they offer a disciplined relationship in which experience may be approached with honesty, safety, challenge and compassion. Carl Rogers’ person-centred tradition emphasised empathy, congruence and unconditional positive regard \cite[authoryear][main::rogers1951client, rogers1961person]. These qualities do not suspend moral judgement or make dignity dependent upon approval. They describe a way of meeting another person in which something painful, shameful or destructive can be faced without the person being discarded.
\stopchapter
\startchapter[title={Bibliography}]
\placebtxrendering
[finallist]
[method=global,
repeat=yes]
\stopchapter
\stoptext