Bug 159137 - Add "previous/next note" functionality to cross-references (conditional mix of "referenced text" and "above/below")
Summary: Add "previous/next note" functionality to cross-references (conditional mix o...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: Fields-Cross-Reference
  Show dependency treegraph
 
Reported: 2024-01-11 17:01 UTC by William Friedman
Modified: 2024-01-18 15:15 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Friedman 2024-01-11 17:01:42 UTC
Description:
It is very common in academic writing to need two different systems for cross-referencing footnotes from a footnote: if the cross-referenced note is adjacent to the current note, one writes "see previous/next note", and if it is non-adjacent, one writes "see n. X." As far as I can tell this is impossible to achieve in LO at the moment. One can either insert a reference to the number of the footnote, or use above/below, but there is no option as far as I can tell for customizing the language of the cross-reference or for making the form of cross-reference conditional.

To be clear, the feature I am requesting would allow customizing both the wording leading up to the reference and allowing the form of the reference itself to be conditional, e.g.:

If reference is adjacent: "see previous/next note"
If reference is non-adjacent: "see n. X."

Steps to Reproduce:
1. Go to Insert | Cross-reference | Cross-references | Type: Footnotes.
2. See that "refer using" does not allow selecting multiple types.

Actual Results:
Feature not available.

Expected Results:
Feature should be available.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 1 Stéphane Guillou (stragu) 2024-01-11 22:59:16 UTC
Although automating this process makes perfect sense to me, it is quite advanced and I could not find an earlier report requesting it.

See for example the use of Ibid.[1]:

> Ibid. may also be used in the Chicago (name-date) system for in-text
> references where there has been a close previous citation from the same
> source material. The previous reference should be immediately
> visible, e.g. within the same paragraph or page.

"Ibid." could be the displayed text for "cross-reference is directly above, on the same page", whereas "see footnote x" would be the alternative.

Here's a question related to creating such conditional fields: https://unix.stackexchange.com/questions/575371/using-macros-or-cross-references-for-the-condition-of-conditional-text-in-libreo
I could not find a way to create something of the sort.

UX/design team, do you think creating this kind of custom, conditional/mixed field should be made easier?

In practice, this would be a mix between "Above/Below" (for the relative position) and "Referenced text" (for the footnote number).

[1]: https://en.wikipedia.org/wiki/Ibid.
Comment 2 Heiko Tietze 2024-01-15 15:01:37 UTC
(In reply to William Friedman from comment #0)
> ...if the cross-referenced note is adjacent to the current note,
> one writes "see previous/next note"...
Do you have a reference for this, something like CMAS or APA?

Before/after a strong relative references, same as Ibid., and moving text around would have to turn this into into absolute and variable references. It's not like "before" which is always true. For example, if the page break occurs after some editing between the two items, would "previous" become a hard reference?

I think it's better to manually type these words as they are niche use cases. Ultimately we are bound to ODF and such enhancement would need to be defined first.
Comment 3 William Friedman 2024-01-15 16:47:15 UTC
(In reply to Heiko Tietze from comment #2)
> (In reply to William Friedman from comment #0)
> > ...if the cross-referenced note is adjacent to the current note,
> > one writes "see previous/next note"...
> Do you have a reference for this, something like CMAS or APA?

In the style guides I consulted (CMOS, MLA, APA, OSCOLA), the broader issue of internal cross-references is not addressed explicitly, only references to other works mentioned in the immediately preceding footnote (see CMOS 17, 14.34). The use of "see next/previous note" is quite common in academic writing; go to scholar.google.com and search for "see next note" (5K hits) and "see previous note" (9K hits).

In response to Stephane's suggestion, however, I need to stress that I'm not talking only about cross-referencing previous references to other works, but to *internal cross-referencing*. E.g. (in the text below, <> refers to what is shaded as the field reference and [] describes what the reference points to).

fn1: I am discussing issue X.
fn2: I am discussing issue Y; for a discussion of issue X, see <the previous note> [xref to fn1]. I will address issue Z in <the next note> [xref to fn3].
fn3: I am discussing issue Z. For a discussion of issue X, see <n. 1> [xref to fn1]; for a discussion of issue Y, see <the previous note> [xref to fn2].

Were this to be implemented, the wording would need to be customizable (so that it could be used for internal cross-referencing as described, or for ibid. or whatever).

> Before/after a strong relative references, same as Ibid., and moving text
> around would have to turn this into into absolute and variable references.
> It's not like "before" which is always true. For example, if the page break
> occurs after some editing between the two items, would "previous" become a
> hard reference?

I don't understand what you mean here. My request is specifically for referencing one footnote/endnote from another footnote/endnote, so page breaks wouldn't be relevant. It would have no relevance in the body of the text, just like "above/below" is, AFAICT, meaningless in the body of the text now, even though I can insert it.

I also don't understand what you mean when you write that "it's not like 'before' which is always true." (Do you mean "above"/"below" when you write 'before'?) Isn't that also by definition a relative reference?

> I think it's better to manually type these words as they are niche use
> cases.

To understand the problem, consider my example above. Let's say that I put fn2 before fn1. Properly updated, it would read as follows:

fn1: I am discussing issue Y; for a discussion of issue X, see <the next note> [xref to fn2]. I will address issue Z in <n. 3> [xref to fn3].
fn2: I am discussing issue X.
fn3: I am discussing issue Z. For a discussion of issue X, see <the previous note> [xref to fn2]; for a discussion of issue Y, see <n. 1> [xref to fn1].

As currently constituted, all of this would need to be manually updated. Repeat over thousands of footnotes and changes of this nature, and you see the problem.

I guess one question is how to define "niche." Are 14K hits on Google Scholar niche use cases?
Comment 4 Heiko Tietze 2024-01-16 09:51:53 UTC
(In reply to William Friedman from comment #3)
> In the style guides I consulted (CMOS, MLA, APA, OSCOLA)...
Okay, the use case has a clear relevance (thanks for the elaboration).

The cross-reference seems to be inserted as bookmarks and any text (here "above" replaced with "previous") is going to be replaced with before/after, depending on the text language.

   <text:h text:style-name="P5" text:outline-level="1"><text:bookmark-start text:name="__RefHeading___Toc395_2509047920"/>Test<text:bookmark-end text:name="__RefHeading___Toc395_2509047920"/></text:h>
   <text:p text:style-name="P16"><text:bookmark-ref text:reference-format="direction" text:ref-name="__RefHeading___Toc395_2509047920">previous</text:bookmark-ref></text:p>

If I read all this correctly, using Above/Below fails because of localization. 

Miklos, would it be possible to introduce an additional text:reference-format="static_direction" with user-defined labels for the text:ref-name that wont be replaced one language changes?

William, do you think a second reference type Previous/After (in addition to Below/Above) solves the use case?
Comment 5 William Friedman 2024-01-16 15:56:37 UTC
(In reply to Heiko Tietze from comment #4)
> (In reply to William Friedman from comment #3)
> > In the style guides I consulted (CMOS, MLA, APA, OSCOLA)...
> Okay, the use case has a clear relevance (thanks for the elaboration).

Thank you, Heiko, for sticking with this!

> William, do you think a second reference type Previous/After (in addition to
> Below/Above) solves the use case?

Well, I think there needs to be two additional levels of customization for a Previous/After (or, in my preferred naming scheme, Previous/Next; the usual pairs are Before/After and Previous/Next [or: Previous/Following]). The first would be to customize the text for "Previous" *and* "After/Next"; in the example I gave in comment 3, that was "the previous note" and "the next note" (but some might prefer "the following note" and some might want to omit the definite article, etc.). So that's two customization options for the first level. The second level of customization would be for what to write if the referenced note *isn't* immediately before/after the current note, in my example, "see n. X." 

When I look at the current layout under Fields | Cross-references, I see that under "selection" there are two fields, both grayed out no matter which "refer using" type is selected: Name and Value. Name corresponds to the full text of the selected footnote, including its number. Value is empty. In order for this new option to work as I imagine it, we'd need additional editable fields:

Previous Note Text:       ________
Next/Following Note Text: ________
Non-Adjacent Note Text:   ________

I *imagine* that the "non-adjacent note text" could assume that the cross-referenced note number would appear immediately after whatever text in the "non-adjacent note text" field, although someone might want to be able to customize this further. For example, I could imagine wanting the non-adjacent note text to include *two* reference types: "see n. X, above/below." This is something that is also currently a pain to do, requiring inserting two separate cross-references; perhaps if the feature I am proposing is implemented it would pave the way for a more general solution allowing fully customizing cross-reference text, allowing the insertion of *multiple* forms of reference in a single cross-reference, e.g., "see chapter X, n. Y, above/below" -- which would currently requires three *separate* cross-references!

Thank you for your consideration of this feature request!
Comment 6 Heiko Tietze 2024-01-18 15:15:06 UTC
I wonder if adding prev/next type of references is possible with other tools. And how it's done in this case.

An alternative to hi-jacking the text:reference-format="direction" with some static label is an extension of the file format. Which would solve missing links, as pointed out in comment 5.