Closed albertostefanelli closed 5 years ago
We are using the new syntax format .sublime-syntax
. Add citation highlight is easy. Though I am not sure about centering.
Don't know how to get this with the .sublime-syntax but this chunk of code is used by Academic Markdown for the citation keys.
<key>citekeys</key>
<dict>
<key>comment</key>
<string>This should highlight citekeys and @refs</string>
<key>match</key>
<string>@[\w:-]+</string>
<key>name</key>
<string>string.other.link.description.title.markdown</string>
</dict>
About centring: I've tried to understand how it works but without any success.
EDIT: centring might be easier than i thought with
// Draws text centered in the window rather than left aligned
"draw_centered": true
Not sure if this is the right way to do it but I added highlighting of references similar to AcademicMarkdown to the syntax by editing a copy of "R Markdown.sublime-syntax" and then adding the following to the meta_scope: meta.paragraph.markdown
section:
- match: '@[\w:-]+'
scope: string.other.link.description.title.markdown
It looks fine. Feel free to submit a PR.
It would be great if the package includes some features to ease the writing of scientific papers present in other packages such as AcademicMarkdown. I believe the 2 most import are:
I tried to adapt the code from the AcademicMarkdown package but this package seems to have a different approach to highlights since it lacks a .tmLanguage file.