3

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++.

Aleph
  • 33

1 Answers1

4

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.

Jason Zentz
  • 4,158