0

Often, I start with a BibTeX entry:

@book{,
    author = {Person, Some},
    title = {Book},
    publisher = {Publisher},
    year = {2015}
}

Then, I discover that the editor is called "Editor" and add the appropriate field:

     @book{,
    author = {Person, Some},
    title = {Book},
    publisher = {Publisher},
    year = {2015}
    editor = {Editor}
}

Which of course causes problems because I forgot the comma after the year entry. Can this be fixed with Vim, either automatically or by marking the error?

2 Answers2

1

I'm not sure how often you want to do this, but this will do the trick.

:%s/year = {\(....\)}\n/year = {\1},\r/

As I understand it

  • s/search/replace/ means search and replace
  • % means over the whole document
  • \(....\) takes those 4 characters and put them in the place of \1
  • \r is a newline
jazzabeanie
  • 425
  • 4
  • 15
0

You can try JabRef. It has all the functionalities you will ever need to manage bibliography. It is not in the cloud but you can keep your .bib files in dropbox and install Jabref on all your devices for portability.

Community
  • 1
  • 1
XtrimA
  • 143
  • 11