#724 Support bibtex: {P}rotect {C}apital {L}etters

None
closed
nobody
None
1
2015-06-29
2014-06-09
Anonymous
No

TXS offers basic functionality regarding bibliography, which is very helpful in many cases. Long titles sometimes required to tag capitals letters, e.g. The Art of Computer Programming should become {T}he {A}rt of {C}omputer {P}rogramming. It would be great, if TXS could automatically add the surrounding braces to all capital letters as given in a text selection (of course, for a book's bibliography covering dozens or hundrets of citations, an external software may be preferable, but sometimes one has to add only a few sources and does not want to switch).

Discussion

  • Tim Hoffmann
    Tim Hoffmann
    2014-06-09

    You can achieve this by a script (Macros -> Edit Macros). The following code capitalizes and protects the word under the cursor:

    %SCRIPT
    c = cursor
    c.movePosition(1, cursorEnums.StartOfWord)
    c.insertText('{')
    c.movePosition(1, cursorEnums.NextCharacter, cursorEnums.KeepAnchor)
    c.replaceSelectedText(c.selectedText().toUpperCase())
    c.clearSelection()
    c.insertText('}')
    

    You may extend it to work on selections and/or complete titles. For more information, see the documentation in the manual and the examples in the wiki.

     
  • Tim Hoffmann
    Tim Hoffmann
    2015-06-29

    • status: open --> closed
    • Group: -->