2

When using BibTeX I usually need to fix broken capitalization by surrounding words with brackets (as answered in BibTeX loses capitals when creating .bbl file).

I also use this to fix some issues with author names containing hyphens when writing my .bib file. (Somehow related: How to correctly typeset an author's two-word last name in BibTeX?)

Is there a keyboard shortcut on TeXstudio that surrounds a selected word with brackets? If not, how can I do it with a macro?

Edit: I've been usingTeXstudio to edit the .bib file, but it can probably be done with another editor such as Notepad++.

  • Can it be done on the entire bibtex file for all titles at once? – Hamid Oct 23 '17 at 17:51
3

Here's a TeXstudio macro that I use for exactly the purpose you mention:

%SCRIPT
txt = cursor.selectedText()
editor.write("{"+txt+"}")
cursor.clearSelection()

One you have added this in the Edit Macros window (I used "Braces Around Text" as the Name and left the other fields blank), you can assign it a keyboard shortcut in Configure TeXstudio | Shortcuts. It will be listed under Menus | Macros.

  • Can it be done on the entire bibtex file for all titles at once? – Hamid Oct 23 '17 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.