-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make/Sync bibliography should remove entries #22
Comments
Re-calculation: numbering starts with the first appearance in the text. Thus, if I swap two citations, the numbers are swapped, too. |
Okay, understood. This is a big one. |
I think, it covers numeric citations only. - I saw that you track the numbers at citation inserting (see It is only about updating
The only "hard" part is 2.b - but this can be done using regex, since you know the format is |
Questions:
|
|
We have the JabRef_ text markers marking the areas of the citation, don't we? These text markers mark the start and the end of the citation string. Don't they? - If both assumptions are true, one can iterate through all text marks and work on their content.
All of them have in common that numbers are used for the citation number and other strings for some citation sugar. Thus, searching for the first match of \d+ matches the first number, the next search the next number etc. |
Does that have all citation keys? If yes: Good; If not: we need to modify the CslRefernceMark class accordingly. Maybe first implement the refresh for non-grouped only. If that works, one can think about extending it to grouped citations. |
Reference markers don't give us the location of text in the document. They are just used to annotate text in an invisible way. What we are looking forward to are "anchors" and "page info" information. Implementing them can be a starting point.
This is assuming we have used numbers in our document only in citation text and nowhere else. Search will not work on the basis of citation text. If we search on the basis of reference markers, we will be able to update the number in the reference mark but not the text, as they don't give us the location of text. I will not attempt this as of now, maybe after merging PR-D (preferably if any two of us work together on this). @Siedlerchr can attest how difficult it is to even trace and manipulate a newline in a "marked" (even anchored) area of the document. Whenever cursors come into play, they take a lot of experimentation which can be done when we have time. For future reference - me or anybody who wants to try this
OR (B)
To the reader - more things to ponder on: How to update an existing reference marker text (A.6 or B.5)? We can update text, we can read existing reference marks, but how to change them, as they are not a part of the primary text. We need to find a way to remove the old reference mark and insert a new one. More reference on anchors: https://stackoverflow.com/questions/69500141/how-do-i-iterate-over-an-entire-document-in-openoffice-libreoffice-with-uno |
Idea: If we only have the CID available, but no wrapper around the citation, then maybe the following could work: We cite the first time: Nothing shall happen:
Now, what we should have are numerically correctly ordered citations, but wrong (old) reference marks.
Now, what we should have are correctly orderd citations and new correctly ordered reference marks. Here the German translation: Eine Idee: Wenn wir nur die CID zur Verfügung haben, aber keine Anführungs und Endzeichen, dann könnte vielleicht folgendes funktionieren: Wir zitieren das erste Mal: Es soll nichts passieren:
Was wir nun haben sollten, sind numerisch korrekt geordnete Zitate, aber falsche (alte) Referenzmarken.
Jetzt sollten die Zitate und neuen Verweiszeichen sowohl vorhanden, als auch richtig geordnet sein. |
I played around with Chocolate.bib. I added [3], but removed it later.
When pressing the bibliography-refresh-button, that number needs to go, too.
Maybe, all text markes need to be scanned and all numbers re-adjusted?
The text was updated successfully, but these errors were encountered: