REditorSupport / sublime-ide-r

R-IDE: Make Sublime Text a perfect IDE for R
MIT License
113 stars 7 forks source link

Academic support for ide-r #2

Closed albertostefanelli closed 5 years ago

albertostefanelli commented 6 years ago

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.

randy3k commented 6 years ago

We are using the new syntax format .sublime-syntax. Add citation highlight is easy. Though I am not sure about centering.

albertostefanelli commented 6 years ago

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
jokorn commented 5 years ago

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
randy3k commented 5 years ago

It looks fine. Feel free to submit a PR.