[NTG-context] Customize citation format of a bibliography (use the short form as reference format)
Hi, I'm trying to customize a cite format in a bibliography. Currently, I'm using the aps style which fits so far, except of the plain number as reference. In concrete, I want to change the following: - Use the first letter of the last name and the year as reference (this should be exactly the short form). It is more less also described here [1]. - Highlight publications of a certain author with an extra char (e.g. '>') Here is a minimal example (lets assume, every occurrence of Knuth should be highlighted): ``` \setupinteraction[state=start] \startbuffer[testdata] @Book{knuth1, author = {Donald E. Knuth}, title = {TEX and METAFONT. New directions in typesetting}, year = {1979}, publisher = {Addison-Wesley}, } @Article{someother, author = {Some Person and Some Otherperson}, title = {Another title}, year = {1900}, } \stopbuffer % enable tracing \enabletrackers[publications, publications.crossref, publications.details, publications.cite, publications.strings] \usebtxdataset[main][testdata.buffer] \usebtxdefinitions[aps] \setupbtx[dataset=main] \definebtxrendering[bibrendering][aps][dataset=main] % this seems to have no effect? \setupbtx[alternative=short] \starttext Knuth developed \TeX \cite[knuth1]. Several persons said something \cite[someother]. \placelistofpublications[bibrendering] \stoptext ``` It should be rendered as: ``` Knuth developed TeX [>Knu79]. Several persons said something [PO00]. [Knu79] D.E. Knuth, TEX and METAFONT. New directions in typesetting (Addison-Wesley, 1979). [PO00] S. Person and S. Otherperson, Another title, (1900). ``` How can I achieve that \cite[something] always renders in the short form by default? How can I customize that references to Knuth contain this extra '>'? How can I customize the APS style to also use the short form in the list of publications instead of numbers? Best Gerion [1] https://tex.stackexchange.com/questions/295444/citation-style-with-first-letters-of-authors-lastname signature.asc Description: This is a digitally signed message part. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / 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 ___
[NTG-context] Re: Most recent context doesn't like synctex?
I made it work with Pulsar and the pdfjs-viewer plugin: The sourcecode of the plugin is broken but easily fixable: https://github.com/allefeld/atom-pdfjs-viewer/issues/15 Then pdf->tex works with synctex from TeX live, "--synctex=repeat" and a right click in the viewer. Sigh, should I learn TypeScript to adopt the viewer plugin and enable my language-context-lmtx* plugin to run ConTeXt and SyncTeX? (I’ve already too many projects and not enough brain capacity.) Hraban *) https://codeberg.org/fiee/language-context-lmtx ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / 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 ___
[NTG-context] Re: [ using horizontal table lines ]
vm via ntg-context schrieb am 15.04.2024 um 13:15: I'm probably using the \starttable incorrectly: with this code I only get only *one* horizontal line in the header [...] with this code I get two horizontal lines, but the second is too short. [...] with this code I get two horizontal lines, with correct length, but above the wrong columns [...] diff: \NC\DC\DC\DC\DL[4]\DL[4]\AR \NC\DC\DC\DC\DL[4]\DL[3]\AR \NC\DC\DC\DL[4]\DL[4]\AR There is (probably) a correct way to solve this. My suggestion is to switch to either natural table or extreme tables but it seems to me there is a problem with the division lines which always leave an empty column afterwards. The following example should add horizontal lines above the first and third column but this setting results in an error. When I omit the last \DC the error disappears but as can be seen in the output the second line appears above the fourth column. \starttext \starttable[||] %\DL \DC \DL \DC \DC \DR \DL[red] \DC \DL[red] \DC \DR \VL 01 \VL 02 \VL 03 \VL 04 \VL 05 \VL\SR \stoptable \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / 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 ___
[NTG-context] Re: Most recent context doesn't like synctex?
Hi, On Sun, Apr 14, 2024 at 12:00 PM Henning Hraban Ramm wrote: > > Am 13.04.24 um 22:28 schrieb Mikael Sundqvist: > > What will work will depend on the viewers. We noticed a few weeks ago > > that synctex (pdf -> editor) was not working in a few viewers (okular) > > while it was working in others. > > Could you please tell us which combinations of viewers and editors you > checked and how to configure them to make it work? I think you shall test them according to what they specify, that should work. I think at Hans' place sumatra worked already with state=start. Here we tried zathura, okular, they work. I think evince did not really work (maybe with some dbus thing, but we did not really try it out). For qpdfview, mupdf, sioyek and maybe some more I do not remember if it worked in the end. But also the viewers change, so at your place they might have different versions of the libraries, and ... a bit messy. I think one should try state=start, and if that is not working, try state=repeat. If that is not working either, I don't know. It was not so easy to understand the format and how it is supposed to work. /Mikael ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / 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 ___
[NTG-context] Re: Most recent context doesn't like synctex?
Hi Mikael (and other synctex users), On Sat, Apr 13, 2024 at 22:28 (+0200), Mikael Sundqvist wrote: > Hi, > On Sat, Apr 13, 2024 at 7:54 PM Jim wrote: >> Thanks for the quick reply. >> On Sat, Apr 13, 2024 at 09:18 (+0200), Hans Hagen wrote: >>> On 4/13/2024 12:39 AM, Jim wrote: Hi, I have both TeXlive 2024 and the stand-alone ConTeXt distribution on my system. Recently, the stand-alone ConTeXt distribution seems to not create a synctex file any more. Specifically, /usr/local/context/tex/texmf-linux-64/bin/context --once --texutil --synctex=1 --nonstop file.tex does not create a .synctex file (and deletes it, if it is there), whereas the TeXlive version /usr/local/texlive/2024/bin/x86_64-linux/context --once --texutil --synctex=1 --nonstop nwg_newsletter_2024_04.tex does create the .synctex file. The ConTeXt distribution version *does* create the file if --nonstop is *not* used. Knowing that, I can work around this for now, although emacs+auctex probably won't be happy without --nonstop. I updated the stand-alone ConTeXt a few minutes ago, so I'm up to date on that. Is this a bug introduced by some recent change? >>> it's more a feature >> I guess one person's bug is another person's feature. :-) >>> - Mikael S and i spend some time with editor/viewer combinations on linux in >>> order to find ways around the different synctex libs that they use >>> - as a result we could make most work ok >> Are these recent changes? And should emacs+auctex+PDFview work now? > What will work will depend on the viewers. We noticed a few weeks ago > that synctex (pdf -> editor) was not working in a few viewers (okular) > while it was working in others. After some debugging, our conclusion > was that different versions of the library/application were used, or > different approaches. We found a way to generate the stuff in the pdf > to make it work for the failing viewers we had. Hans did then not > replace this with the old approach, since then the previously working > viewers might break. He therefore added repeat as a key, so > \setupsynctex[state=repeat] will use the new approach. Thanks for that clarification. >>> - we assume that synctex is set up in the document with >>> \setupsynctex[state=start] >>> \setupsynctex[state=repeat] % less efficient but gets around issue >> I haven't been using either of those, since auctex does The Right Thing for >> me. Or, at least, it used to. >>> - when context is run 'headless' (on a server) it's often done in >>> batchmode because one knows that the style works and in that case synctex >>> makes no sense so we disable it; this avoids the need to patch the style >> I (think I) see what you are saying, but if one explicitly uses --synctex >> on the command line, should that not over-ride the over-ride? Or, put >> another way, would the following not make sense: >> if --synctex is used on the command line >> create synctex file >> else if --nonstop is used on the command line >> do not create the synctex file >> else if \setupsynctex[...] is used in the source file >> create the synctex file >> else >> do not create the synctex file >>> - the manual has been updates > workflows-synctex.tex now suggests: > "When your viewer doesn't return to the editor, you can try > \starttyping > \setupsynctex[state=repeat] > \stoptyping > or > \starttyping > context --synctex=repeat somefile.tex > \stoptyping > This will give a bit larger file that tries to fool the areas resolver in the > library that the viewer uses." Looking at two synctex files, it would seem that the state=repeat version creates a synctex file that has syntax matching the "original" synctex format. And you are right, the file is bigger. In any case, now that I know what is going on, I have convinced auctex to play nicely with the new way of doing things, and so all is now good. Question for anyone who made it down this far: Is there a mailing list or other way that a ConTeXt user can find out about non-backward-compatible changes like this? I wasted a fair amount of time tracking this problem down (*), and if there is some other mailing list I should be subscribed to, I'd love to know about it. (*) Unfortunately, this change to ConTeXt happened around the same time I upgraded emacs from 27.2 to 29.3, and when things didn't work I upgraded auctex from 13. to 14.0.4, and it took me a while to find out where the problem originated. Cheers. Jim ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / 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 :
[NTG-context] Re: Most recent context doesn't like synctex?
Hraban and any emacs users: On Sun, Apr 14, 2024 at 11:56 (+0200), Henning Hraban Ramm wrote: > Am 13.04.24 um 22:28 schrieb Mikael Sundqvist: >> What will work will depend on the viewers. We noticed a few weeks ago >> that synctex (pdf -> editor) was not working in a few viewers (okular) >> while it was working in others. > Could you please tell us which combinations of viewers and editors you > checked and how to configure them to make it work? The --synctex=repeat option outputs a synctex file that works with auctex' epdfinfo program, so (at least when using PDFview) forward and backward search now work with emacs+auctex, at least when you (a) put (setq ConTeXt-texexec-option-nonstop "") in your ConTeXt mode hook (or some other sensible place), and (b) edit the ConTeXt-expand-options defun in auctex' context.el (or redefine the function in some hook) to replace --synctex=1 with --synctex=repeat I have submitted a bug report to auctex about (b) and another item, but I have no idea if/when the fixes will make it into a new release of auctex. Jim ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / 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 ___
[NTG-context] [ using horizontal table lines ]
I'm probably using the \starttable incorrectly: with this code I only get only *one* horizontal line in the header \starttable[|r|r|r|r|r|r|r|l|r|r|r|r|][bodyfont=9pt] \NC step\NC frac\NC ival\NC \NC\Use{4}[cI]{freq (Hz)}\NC~\NC\Use{4}[cI]{wavelength (m)}\AR \NC\DC\DC\DC\DL[4]\DL[4]\AR \NC 0 \NC 0.00 \NC 0.000 \NC 12.50\NC 13.75\NC 15.00\NC 12.25\NC A\ \NC 27.20\NC 24.73\NC 22.67\NC 27.76\AR \NC 1 \NC 0.08 \NC 0.115 \NC 13.94\NC 15.34\NC 16.73\NC 13.66\NC A\#\NC 24.38\NC 22.17\NC 20.32\NC 24.88\AR \NC 2 \NC 0.17 \NC 0.222 \NC 15.28\NC 16.81\NC18.34\NC14.97\NC B\ \NC 22.25\NC 20.23\NC 18.54\NC 22.71\AR \stoptable with this code I get two horizontal lines, but the second is too short. \starttable[|r|r|r|r|r|r|r|l|r|r|r|r|][bodyfont=9pt] \NC step\NC frac\NC ival\NC \NC\Use{4}[cI]{freq (Hz)}\NC~\NC\Use{4}[cI]{wavelength (m)}\AR \NC\DC\DC\DC\DL[4]\DL[3]\AR \NC 0 \NC 0.00 \NC 0.000 \NC 12.50\NC 13.75\NC 15.00\NC 12.25\NC A\ \NC 27.20\NC 24.73\NC 22.67\NC 27.76\AR \NC 1 \NC 0.08 \NC 0.115 \NC 13.94\NC 15.34\NC 16.73\NC 13.66\NC A\#\NC 24.38\NC 22.17\NC 20.32\NC 24.88\AR \NC 2 \NC 0.17 \NC 0.222 \NC 15.28\NC 16.81\NC18.34\NC14.97\NC B\ \NC 22.25\NC 20.23\NC 18.54\NC 22.71\AR \stoptable with this code I get two horizontal lines, with correct length, but above the wrong columns \starttable[|r|r|r|r|r|r|r|l|r|r|r|r|][bodyfont=9pt] \NC step\NC frac\NC ival\NC \NC\Use{4}[cI]{freq (Hz)}\NC~\NC\Use{4}[cI]{wavelength (m)}\AR \NC\DC\DC\DL[4]\DL[4]\AR \NC 0 \NC 0.00 \NC 0.000 \NC 12.50\NC 13.75\NC 15.00\NC 12.25\NC A\ \NC 27.20\NC 24.73\NC 22.67\NC 27.76\AR \NC 1 \NC 0.08 \NC 0.115 \NC 13.94\NC 15.34\NC 16.73\NC 13.66\NC A\#\NC 24.38\NC 22.17\NC 20.32\NC 24.88\AR \NC 2 \NC 0.17 \NC 0.222 \NC 15.28\NC 16.81\NC18.34\NC14.97\NC B\ \NC 22.25\NC 20.23\NC 18.54\NC 22.71\AR \stoptable diff: \NC\DC\DC\DC\DL[4]\DL[4]\AR \NC\DC\DC\DC\DL[4]\DL[3]\AR \NC\DC\DC\DL[4]\DL[4]\AR There is (probably) a correct way to solve this. .Floris___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / 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 ___
[NTG-context] \getmarking for top at the current page
Dear list, I've got a problem. Not the first one, but the first one to contribute to the list. ;) system> ConTeXt ver: 2024.04.01 08:59 LMTX fmt: 2024.4.12 int: english/english system> 'cont-new.mkxl' loaded %== %== \definehead[Datum][subsubsubject] \startsetups[Test] Pr=(\getmarking[Datum][previous])~ Nx=(\getmarking[Datum][next])~ Fi=(\getmarking[Datum][first])~ La=(\getmarking[Datum][last])~ Tp=(\getmarking[Datum][top])~ Bt=(\getmarking[Datum][bottom])~ Cu=(\getmarking[Datum][current])~ \stopsetups \setupheadertexts[text] [\setups{Test}][] [\setups{Test}][] \setuppagenumbering[location=footer] \starttext \startDatum[title={secA}]% \dorecurse{50}{aaa } \pagebreak \dorecurse{50}{aaa } \stopDatum \startDatum[title={secB}]% \dorecurse{630}{bbb } \stopDatum \startDatum[title={secC}]% \dorecurse{50}{ccc } \stopDatum \startDatum[title={secD}]% \dorecurse{50}{ddd } \stopDatum \startDatum[title={secE}]% \dorecurse{50}{eee } \stopDatum \stoptext %== %== I'd like to write the marking of the very first text at the current page to the header. That seems to be a bit tricky, at least for me. (I'm afraid that \getmarking[xxx][top] was intended for that and it is not feasible at all.) At page 1 the header should read "secA", at page 2 again "secA" (because the very first text belongs to "secA"), and at page 3 "secC" (because the very first text (the section title) belongs to "secC"). Unfortunatly \getmarking[][] does not behave like I expacted. I understand the keywords of \getmarking in the wiki (https://wiki.contextgarden.net/Command/getmarking) as listed below: • previous: marking at the bottom of the page BEFORE the current page (no page before then empty) • next: marking at the top of the page AFTER the current page (no page after then bottom of current page) • top: marking at the top of the current page • bottom: marking at the bottom of the current page • first: first marking that starts at the current page (no first than behaving like top) • last: last marking that starts at the current page (no last than behaving like bottom) • current: last stored marking while deciding on pagebreaking between the current page and the (potential) following page • default: first According to these thoughts, I started with \getmarking[Datum][top]. But "top" seems not to work, there is no difference between "top" and "first", "top" behaves like "first". My second thought: Generally \getmarking[Datum][first] would be perfect, so I've thought something like \doifelse{\fetchmark[Datum][next] of the page before the current page}{\fetchmark[Datum][previous]} {\getmarking[Datum][previous]} {\getmarking[Datum][first]} could work. (Honestly I don't know how to do "\fetchmark[Datum][next] of the page before the current page}". The first page would need a special treatment too.) But: At page 2 \getmarking[Datum][next] (Nx) contains "secB" but at top of page 3 is not "secB" but "secC". So \getmarking[Datum][next] does not seem to contain the correct information I need, therefore I don't get any further. Any ideas: How do I write the marking of the very first text at the current page to the header? Thank you in advance, Matthias ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / 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 ___