Local bibliography (Jolly Writer)

In the Jolly Writer sec. 6.5.7 a procedure is described for adding a “local bibliography” to a document.
I cannot make this work with TeXmacs 2.1.4.

  1. I add my “global” .bib file, everything is fine, all the citations in my document are shown in the Bibliography
  2. I do Document -> Bibliography …, TeXmacs shows the entries corresponding to the citations in the document.
  3. I add a new citation in the document, and a corresponding new entry in the bib buffer, and save the buffer.
  4. I do Document -> Update -> Bibliography.
    once or twice, and I get an error “I didn’t find a database entry for …”
  5. When I re-do Document -> Bibibliography …, the entry I added is no longer there.

Has anybody encountered this issue?

TeXmacs has two mechanisms to handle bib. One is the bib file, usual, as in TeX. So you need to modify the bib file if you want. Other strategy is to use the internal bibliography database, which is not a bib file. It seems to me that you are trying to mix the two methods (or I didn’t understood exactly what you are doing). Anyway, if you have a view on the internal database, then this is not a file, so you cannot save it, to enter a new bibliography item you have to insert it in the database view and then click the button with the green check mark on the mode toolbar.

I didn’t know this, but it is possible for documents to have an internal bibliography database. They get saved inside the .tm file itself and they can be edited separately from the global database or a .bib file.

I was also initially confused by the way databases are saved. After editing you get the * indicator in the window name, and it disappears after pressing Ctrl-S, so you would think the changes have been saved, but they are not.

Yes, I know all that you are saying. What I am trying to do is described in sec. 6.5.7 of the Jolly Writer.
It is a procedure for `tweaking’ your global .bib file for a particular document, by adding references that you do not want to add to the global .bib file (for some reason).
As @jeroen says below, this works (or should work) by creating a bib database specific to the document, and internal to it (in the .tm file), which contains only the added items.

What @mgubi explains is important, you need to press the green check mark to save changes. For me this works with a local database.

I do not think this is possible. There is a global database (and this is NOT a .bib file, is a database, different thing, it is a bit confusing if you conflate the two concepts), and any item added with a \cite to a document will result in the bibliography entry to be exported in the local database of the given document. The reason is that it should be possible for another user to open the file and rebuild the bibliography. When the file is opened in another TeXmacs instance, the items local to the document are analysed and automatically imported in the global database of the TeXmacs instance (i.e. TeXmacs learns of new bibliography items). This can be disabled via a preference.

Also you cannot use at the same time both a .bib file and the bibliography database. If when you add a bibliography section to a document you specify a .bib file, then TeXmacs will only look in that file for bibliography. If you want to modify the .bib file, try to open it directly from the “Open” command, then “Save” should work.
If you do not put any .bib file name in the bibliography section, then TeXmacs will use the internal bibliography.
I’m sorry if the things I say above do not apply to your situation because I misunderstood. In that case try to explain a bit more clearly and make a difference between .bib files and bibliography database, because at the moment I’m confused about what really you are trying to achieve.

I believe that @ko56 wants to add bibliographic items from a .bib file to the local in-file database of a .tm file and then edit the local in-file database, including adding new entries, with the possibility to then cite the new local-only items from the .tm file.

What does seem possible is making changes to existing items in the local database (for example changing a title or name of an item). If I cite an item (either from .bib or from the global database), it is added to the local database. The local database can then be opened via Document->Bibliography . Once edited and saved, there can be two different versions of the same item, one global either in the global database ( Data->Open bibliography ) or the .bib file, and one local in the in-file database ( Document->Bibliography ).

What does not seem possible is adding new items exclusively to the local database, although the editor of the local database does have a menu item for this. It does not, however, have any menu items to confirm entries, like the global database has. This may be the reason why new local items do not get saved. New items are shown in the interface and saving appears to be happening, but it does not.

Somewhat confusingly, the icon for confirming entries in the global database is re-used in the local database to import entries from the local to the global database. Earlier I thought that adding new entries to the local database did work, but now I think that I simply imported them into my global database instead.

Note: while not recommended, it seems technically possible to mix items from a .bib file and the global database in one document.

I believe that @ko56 wants to add bibliographic items from a .bib file to the local in-file database of a .tm file and then edit the local in-file database, including adding new entries, with the possibility to then cite the new local-only items from the .tm file.

Yes, exactly.

I also agree with what you say below, about the absence of a button to save the modified local database ( Document->Bibliography ). That has caused me some frustration …

Now the Jolly Writer in sec. 6.5.7 describes exactly the procedure in my original post (except now I see that in no. 3 I said “bib buffer” whereas I should have said “local db buffer”).
Should it be considered a bug that this procedure doesn’t work? It would be a nice feature if it did work.

1 Like

I consider it a bug. Either the button to add items should not be there or it should be possible to save them. Do you have an account on Savannah? Could you file a report?

1 Like

I have an account. I’ll file a bug report, hopefully it will be understood.
I’ll post the bug id here, and you will be welcome to comment on it.

1 Like

https://savannah.gnu.org/bugs/index.php?66841

I now see one more thing that may be useful: when I save the local db buffer, the following appears in the minibuffer:

Saved tmfs://biblio/bib/file/home/ko/papers/INDIGO/ai-planner-paper.tm

Maybe this is what is not working.

2 Likes