Automatical update for new reference in bib file?

I use JabRef, too. But for the specific paper, I usually make a new bib file and copy reference which I need to this file by using JabRef. JabRef save base of my references. If I work with TexStudio or TexMaker I put all my base as \bibliography{} and use JabRef to see the label of references. But now I try to become familiar with TexMacs and improve it.

The integrated bibliography editor certainly still has a few bugs. I tried to reproduce what you describe, pasting a reference and changing the display style from detail to pretty, but I don’t see the same problem. A bug report on Savannah with detailed steps to reproduce would be welcome.

An important thing to note is that the Data -> Open bibliogrpahy editor doesn’t edit a bib file. It edits a global bibliography database that is located in your TEXMACS_HOME_PATH and is shared among documents.

It is another surprise: “Data -> Open bibliogrpahy editor doesn’t edit a bib file”. Then I have a valid question - how can I edit the bib file inside TexMacs and save it?

I will put report in Savannah asap.

Yes, I agree, it can be a bit surprising.

You can open a bib file in TeXmacs via File -> Load.

I use Insert-> Automatic -> Literature. But this is only shown to Texmacs what bib file to use for references. Working with a references database is very important for making articles and editing bib database has to be realized in some way in TexMacs.

TeXmacs has essentially three ways to deal with bibliography: it has an internal database or it can use external BibTeX files, in this last case it can process them internally or can use BibTeX to process them (the difference in these two modes of operation depends on the style file used for the bibliography, for example abbrv uses the external BibTeX while tm-abbrv uses the internal compiler, etc…).

Some (more or less detailed) explanation is in the Help Manual -> Automatic content generation, Section 4. “Compiling a bibliography”. I’m not sure what happens with autocompletion but if you do a \cite and then just write the label you have in your .bib file, then it should work.

TeXmacs will not read the .bib file unless you ask to refresh the bibliography, and even in that case I’m not sure it will read all the labels to allow then autocompletion. In my workflow I just copy and paste the label from the external editor where I edit the .bib file in the \cite tag.

I know however that Joris uses the internal database, TeXmacs manages one and every time it reads a TeXmacs document with some biblio it imports it automatically in the internal database, so I guess that the autocompletion is only active for this database and not for the .bib files.

1 Like

If you want to copy and paste a bibtex record in the internal database then you just to Edit -> Paste from -> BibTeX when you have opened the bibliography database. This last operation can be accomplished by selecting Tools->Database tool and then Data -> Open bibliography.

I’m sure that it must be a more simple solution. A bibliography is needed for any paper. In texstudio, for example, it is realized very well. If it is possible to make it in TExmacs it will be excellent. I have my own collection of references in a special directory. At the end of the file I have \bibliography{/path/to/publ1,/path/to/publ2,/path/to/publ3}. If I need a new reference I use for example JabRef, which can create a bib reference using doi or isbsn. The new reference is added in my collection and at the same time I may use it in the latex file. After finishing the paper I use bibexport. I created buttom in texstudio which makes: bibexport -o %.bib %.aux (in config of texstudio). Just one click and you have a separate bib file with all references used in the paper. And what is important - all references saved in my collection and I may use them in the next papers.

I understand that each scientist has his usual manner to work. I said about my way. Maybe it is possible to realize in Texmacs?

I think the difficult part is to formulate clearly the requirements to be satisfied. What is the objective? What is the problem we would like to address? What is the proposed solution? If I understand correctly the problem is that, given the bib file, TeXmacs cannot autocomplete citations from that file. This is a well defined problem which could be addressed by a developer. Would this solve your complain? You will be able to link your “big” bib file and then able to autocomplete \cite requests. I think this is doable. Also note that TeXmacs do the extraction automatically, in the sense that if you export to LaTeX, then the bibliography is compiled into the resulting TeX file. Would this be enough?

Going back to the first message of @JoePass, which, reading quickly through the thread, maybe was not completely addressed

might mean (here only @JoePass can tell if it is o or not) that he can’t add a reference to a .bib file and then use it in a TeXmacs document where the same bib file had already been used.
Out of curiosity I tried it and it worked in a test document: that is, open a document which had an already-defined bibliography file (I run an update of the bibliography as well just after opening, although this may be redundant), then I added a reference to the .bib file, and next I cited that reference in the document—the reference appears in the bibliography. This with TeXmacs 1.99.19 on Windows.

It works for me too, but I can’t get tab completion to work for .bib files, only for the internal bibliographic database. Does that work for you @pireddag?

Do not worry. I just wrote about what I’d like to see in Texmacs. I work with latex already 25 years or more and I see that the Texmasc is sometimes very useful. I’d like to make it better. It is indeed the question for maintainers. My question was simple “Texmacs does not see a new reference.”. I add a new reference in bib file by using a simple text editor, save this file but it does not appear in the list of references. To enforce Texmacs to see it I have to do some additional steps which I wrote above. I expected that it must appear automatically. In my case - not. In any case, I may use this way each time, but it is really not comfortable.

No, that does not work for me as well (tested on Windows).

I am under the impression that it should work without additional steps (I am not able to identify the steps you refer to, b/c the whole thread is a bit complex), and I am under the impression as well that there may be something else not working if it does not work for you.

I just repeat it once more. All experiments step by step:

  1. My tm file uses ref.bib file. I print \cite, then right-click and select search in database and see all references in file ref.bib
  2. I open ref,bib file with xed, and add a new reference in bib format and save it.
  3. I print \cite, then right-click and select search in database and see that a new reference does not appear.
  4. Then I make Document - Update - All 3 times
  5. I repeat item 3) and note a new reference does not appear.
  6. Then Data - Open bibliography and I see the content of ref.bib file without a new reference.
  7. Again Data - Import and select ref.bib.
  8. Vu a la - a new reference appears!

In my case, I have to make steps 6-7 after adding each new reference in bib file. I expected that new reference will appear automatically.

I use Linux Mint Mate 20 (based on the Ubuntu 20). Version on Texmacs 1.99.19.

Another experiment.

  1. Data - Open bibliography. I see content of the ref.bib file.
  2. Copy reference in the bib format and then insert as Bibtex and save.
  3. The reference appears in data base and I can see it in \cite right-click search in database.

This way is shorter because I do not need to open ref.bib by an external editor.

Let us close this thread. My wishes I will put in Savannah as suggestions.

1 Like

This is expected behavior due to the differences between the TeXmacs’ internal bibliographic database and an external .bib file (see the earlier posts by @mgubi). search in database only searches the internal database.

In step 2 of experiment 1 you are adding the reference to an external .bib file, while in step 3 you are searching the internal database. Since you did not add the new element to the internal database, it is not found there by TeXmacs. Once you insert them in the internal database in step 7, it does work, because now the new element has been imported.

In the second experiment you import the new bibliography to the internal database in step 2, so then its contents are also searchable. Note that in step 1 of experiment 2, you are not seeing the contents of ref.bib. You are seeing the contents of the internal database, which in this case just happen to mirror ref.bib.

Thank you for the detailed explanation. I understand now. What is the reason for two databases - internal and external? Occam’s razor - “entities should not be multiplied without necessity”. It is difficult to find this explanation in the guide.

I am not sure about the reason. We’d have to ask the author. One reason may be convenience: the internal database is always activated, so you don’t need to first select a .bib file for every new document.

I guess the menu items could be made clearer to indicate when the internal or external bibliography is searched.

1 Like

BTW thanks a lot for the detailed description, before this discussion I did not know that there is a bibliographic database, I had used only the external BibTeX (will probably continue to do so at least until I figure how to have multiple bibliographic databases).

1 Like

Thanks to @jeroen for the clear explanation of the situation. TeXmacs has two ways to deal with bibliography (as I’ve also written in a previous post in this thread). The reason is flexibility wrt. to the user: any particular solution has technical tradeoffs. The internal database can be managed easily from within TeXmacs while external bib files could change without notice, being incorrect, etc… I agree however that we should be able to autocomplete from external bib files also, maybe monitoring them or just reading all the definitions when we scan them for typesetting the bibliography. I think the current behaviour is that (like in TeX, the only relevant bibliography items used from a bib file are those explicitly mentioned in the document). However if the user ask for autocompletion we should be able to rapidly scan eventual bib files mentioned in the document to find suitable matches.

1 Like