Syntax recognition for biblatex citation commands in TextMate

by Fr. on August 31st, 2008
The LaTeX bundle that comes with TextMate will identify, and therefore colour, the syntax of citations commands passed to BibTeX, as long as they comply with the standard or natbib conventions; hence cite, citep, citet, footcite and other commands get appropriately coloured, as show below using the Cobalt syntax theme: Standard cite commands in Cobalt syntax colours for TextMate. If you are using biblatex, you might want to get the autocite and textcite commands coloured too. The following edits should lead you there:
  1. Go to your Bundle Editor through the following menu selection: Bundles → Bundle Editor → Edit Languages.
  2. Start by duplicating your LaTeX Language item, and rename the copied version to something different than LaTeX copy, indicating that this copy reflects the original LaTeX bundle. That will be your backup copy if something goes wrong with the rest of the editing.
  3. To make sure your backup copy does not interfere with the new one, edit its scopeName variable from text.tex.latex to NULL.
The final results of Steps 1–3 should look like this: Bundle editor ready for edits in TextMate. Using TextEdit, copy the content of the LateX Language item into a plain text document window, then search for meta.citation.latex. The code should start by reading: name = 'meta.citation.latex'; begin = '(?x) ( (\\) # Marker (?:foot)?(?:full)?(?:no)?(?:short)? # Function Name [cC]ite (?:al)?(?:t|p|author|year(?:par)?|title)?[ANP]* ... Append the Function Name line by adding (?:text)?(?:auto)? at the beginning of the list: name = 'meta.citation.latex'; begin = '(?x) ( (\\) # Marker (?:text)?(?:auto)?(?:foot)?(?:full)?(?:no)?(?:short)? # Function Name [cC]ite (?:al)?(?:t|p|author|year(?:par)?|title)?[ANP]* ... Copy-paste the text back into the Bundle Editor. Click the Test to see the front window document in TextMate show the new colouring for the LaTeX bundle. Happy biblatex editing! biblatex cite commands in Cobalt syntax colours for TextMate.

Sur le même sujet :

  1. A bibliographic workflow using CiteULike and BibDesk I am currently testing the following CiteULike + BibDesk workflow combination: CiteULike is a social bookmarking system oriented towards academic...
  2. Indispensable Applications: A Commentary This post comments Kieran Healy’s list [copy] of indispensable applications. I do not present my list as better, just...
  3. A Better Acronym Replacer for WordPress I use the now defunct Acronym Replacer by Joel Bennett of Huddled Masses. Since I do not need any text...

From Varia

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS