Automatical update for new reference in bib file?

I use bib file for the bibliography. I need to add a new entry to bib file. I have a whole bib reference, for example,
@book{DeWitt,
author = {DeWitt, B S},
pages = {377},
publisher = {Gordon and Breach, New York},
title = {{Dynamical Theory of Groups and Fields}},
year = {1965},
}
I open my bib file with a simple text editor and add this new reference. But it does not appear in Texmacs and I can not add it to text by \cite command. Texmacs does not see a new reference. I verify by Data->Open Bibliography - a new reference does not appear. Document -> Update -> All does not help. To enforce Texmacs to see a new reference I have to make Data->Open Bibliography -> Import -> my.bib. Only after this long procedure, a new reference appears. This is not convenient to make this way for each new reference. How do I make this adding automatically?

It is possible to add new references directly by opening bib file in Texmacs by Data->Open Bibliography. In this case, I have to put information in each line like author, pages etc. But I already have this reference as a whole and using text editor is preferable.

You could update-all twice (or thrice) to do so. Pressing the shortcut Ctrl-Shift-R twice is more convenient.

If you want to use this method you could also use “Edit -> Paste from -> BibTeX” or “Data -> Import” to add existing references.

The setting “Edit->Preferences->Other->Document updates run” can also be convenient. There you can choose to have updates run more than once for every time you request an update. Saves you one (or two) Ctrl-Shift-R presses :slight_smile:

I made 10 times without a result! After 10 times I write \cite then right-click and search in the database and a new reference does not appear in the list. Then another experiment: I use Edit -> Paste from -> BibTeX as suggested @jeroen and put a reference in the file. I made 10 times update all without any result. But if I do Data -> Open bibliography I see a new reference. But what is more surprising - I open the bib file by an external editor and I see that there is no new reference in the file. In fact, the Texmacs show this reference but really there is no new reference in the file.

I observe more surprising things. I added new reference by doing Edit -> Paste from -> BibTeX. But if I change the form of view (right down corner) from detail to pretty, then a new reference disappears from the list! And it does not appear never if I change to detail.

I’ve never used TeXmacs to manage the bibliography. I use JabRef.

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.

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.