I have realized I can do a workaround with a series of ternary statements like the refer manual says: `expr1?expr2:expr3` Where I use fields I am unlikely to use for anything else in `expr1` and another ternary in `expr3`
E.g., `O?case:S?statute:G?rule:journal` Then, make sure that the .ref has %O in the cases, %S in the statutes, and %G in the rules. This feels inelegant though, and I'd like to figure out a way to just have one type field and a label for each, so I will play around in the refer.tmac and refer-ms.tmac file to see what I can do with that. Any advice on creating the %Y field? Thanks On Sat, Dec 2, 2023 at 1:00 AM <groff-requ...@gnu.org> wrote: > Send groff mailing list submissions to > groff@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/groff > or, via email, send a message with subject or body 'help' to > groff-requ...@gnu.org > > You can reach the person managing the list at > groff-ow...@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of groff digest..." > > > Today's Topics: > > 1. Help with citations in groff (Darris Hawks) > 2. Re: Long Heading lines using mom (Heinz-Jürgen Oertel) > 3. Re: Why does groff require psutils? (Alexis) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 1 Dec 2023 15:31:15 +0800 > From: Darris Hawks <dar...@hawkslegal.com> > To: groff@gnu.org > Subject: Help with citations in groff > Message-ID: > <CAG7YL7us5aRfiVa= > l34z6xjirstgoq94vexgppyc8ase76j...@mail.gmail.com> > Content-Type: text/plain; charset="UTF-8" > > There are a couple of things that are unclear to me after reading the > manual for GNU refer. I have been toying with it with limited success. > > So these are my questions: > 1. How do I change the label expression conditionally? > 2. How do I make the citation appear in the footnotes with only a > superscript number in the text? > 3. Is it possible to modify the references section to include a page number > for every time a reference was cited? > 4. How do I delete the parentheses surrounding citations to more than one > source? > > *Conditional label expressions.* > > In the refer documentation, there are five types of citation: > > Type 0: if the reference doesn't trigger the other types > > Type 1: If it has a J field > > Type 2: if it has an I field > > Type 3: if it has a B field > > Type 4: if it has a G or R field > > > And the label command between .R1 and .R2 applies to every citation beneath > it until the next .R1/.R2 block. > > *Conditional based on type.* > I generally only cite two or three types of reference (cases, court rules, > and statutes), but there are *many *types of reference in the law, and they > all have particular styles. There are also rules about citation styles when > citing to a source that has already been cited. Therefore, I would like to > have another field, %Y(type), in the .ref file, and have refer choose the > label expression based on the content of that field. Is that doable? > > *Conditional based on repetition.* > I know that I can use the # flag to trigger the short style of the citation > with refer, but the rule in my citation style is to use the long style the > first time a reference is cited and the short style or ibid style for every > subsequent reference. How can I trigger the short style or ibid style > programmatically? > > *Citation footnotes* > > Another thing I could not find in the documentation is how to make a > footnote of the reference with a superscript number as the label in the > text and the full citation as the label in the footnote, kind of like how > Wikipedia does it. I've tried a couple things, but I could not figure out > how to get that behavior > > *Parentheses around multiple citations in text* > > For some reason, when I do multiple citations in a row, if I do not add my > own argument to .[ or .], groff puts parentheses around the label. Because > the delimiter for US legal citations is a semicolon, I can suppress that by > just putting a semicolon after the .] of all but the last citation. > However, that is inconvenient for moving things around later because I will > not want a semicolon after every citation. So how do I stop the ( citation) > and make it use only ;? > > *The references section* > > *Changing the label style in the references section.* > If I do not do the no-label-in-references command, the references section > has a completely different label style from the style I defined in the > label expression. How do I change the style used in that REFERENCES > section? > > *Putting page numbers in the references section.* > In legal briefs, in the references section, we put each page number on > which a reference was cited. I also like to break that down into a cases > section, a rules section, and a statutes section (another reason for the %Y > field, I think). Is it possible to have refer add a reference for page > numbers to be collected and placed by groff in the references section for > every citation in text? > > > ------------------------------ > > Message: 2 > Date: Fri, 01 Dec 2023 12:42:36 +0100 > From: Heinz-Jürgen Oertel <hj.oer...@t-online.de> > To: groff-Liste <groff@gnu.org> > Cc: Peter Schaffter <pe...@schaffter.ca> > Subject: Re: Long Heading lines using mom > Message-ID: <2685322.BddDVKsqQX@heinz> > Content-Type: text/plain; charset="utf-8" > > Hello Peter, > > I just saw, that a new mom version, 2.6, should solve my problem with > large heading lines. > But unfortunately, it doesn't work for me. I'm sure I did update om.tmac. > Can I see the used mom version somewhere in the output text? > What else can I check? May be print some mom variables while generating > the output file? > > Greetings > Heinz > > > Am Dienstag, 29. August 2023, 10:57:27 CET schrieb Heinz-Jürgen Oertel: > > Hello, > > > > I'm translating from English to German so I have to overtake more ore > less the long heading lines from a book. > > Using mom i can split the text like > > > > .HEADING 2 "Splitting this very long heading" "in two or more parts" > > > > So far this works within the text part of the PDF document. But if > generating the TOC, the long lines will not break. > > What can I do? > > > > > > > > > -- > mit freundlichen Grüßen aus Halle (Saale) > Heinz-Jürgen Oertel > > > > > > ------------------------------ > > Message: 3 > Date: Fri, 1 Dec 2023 17:35:09 +0100 > From: Alexis <surryh...@gmail.com> > To: groff@gnu.org > Subject: Re: Why does groff require psutils? > Message-ID: > <fja5yswh5cmlu64zmj3w7jkb6xcyohaedfebbxaw564hhmlwnh@cbrohsqy33io> > Content-Type: text/plain; charset="utf-8" > > Hi all, > > following up on my previous email I'd like to test the attached patch > (replace_psselect.patch) with groff, but am uncertain how to trigger > the patched code path. > > If I read src/preproc/html/html.am correctly then pre-html.cpp is > compiled into pre-grohtml. I'm uncertain how pre-grohtml is invoked > in a common groff pipeline or can be invoked manually for testing > purposes. > > Anyone willing to share some insights or ideas? > > > Best > Alexis > -------------- next part -------------- > diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp > index cbcc2ccda..1668c9f67 100644 > --- a/src/preproc/html/pre-html.cpp > +++ b/src/preproc/html/pre-html.cpp > @@ -918,7 +918,7 @@ int imageList::createPage(int pageno) > fprintf(stderr, "creating page %d\n", pageno); > #endif > > - s = make_string("psselect -q -p%d %s %s\n", > + s = make_string("ps2ps -dFirstPage=%1$d -dLastPage=%1$d %s %s\n", > pageno, psFileName, psPageName); > html_system(s, 1); > assert(strlen(image_gen) > 0); > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > groff mailing list > groff@gnu.org > https://lists.gnu.org/mailman/listinfo/groff > > > ------------------------------ > > End of groff Digest, Vol 230, Issue 1 > ************************************* >