GithubHelp home page GithubHelp logo

Highlight Julia code about vscode-latex-basics HOT 6 CLOSED

jlelong avatar jlelong commented on September 24, 2024
Highlight Julia code

from vscode-latex-basics.

Comments (6)

jlelong avatar jlelong commented on September 24, 2024

@JamieMair Can you post the tex content of your example? What packages are defining the environments juliaconsole and juliaverbatim?

from vscode-latex-basics.

JamieMair avatar JamieMair commented on September 24, 2024

I am using a copy of this template - https://github.com/sisl/tufte_algorithms_book

In the introduction.TeX file in the chapters, you can find examples of the Julia related environments working (there a few different ones).

I believe they use a version of the pythontex package with a custom lexer to do the syntax highlighting in the PDF. As far as I can tell, the Julia latex environments are defined in pythontex.sty

Maybe it would be useful to have an optional setting in which you can specify the syntax highlighting for different environments. For example:

"vscode-latex-basics.syntax.environments": {
    "juliaverbatim": ".jl"
    "juliaconsole": ". jl"
... Etc
}

from vscode-latex-basics.

JamieMair avatar JamieMair commented on September 24, 2024

Perhaps this line

"begin": "((?:\\s*)\\\\begin\\{((?:julia|jl)code(?:\\*)?)\\}(?:\\[.*\\])?)",
needs to be modified to be like
"begin": "((?:\\s*)\\\\begin\\{((?:(?:(?:py|pylab|sympy)(?:code|verbatim|block|concode|console|converbatim))|sageblock|sagesilent|sageverbatim|sageexample|sagecommandline)(?:\\*)?)\\}(?:\\[.*\\])?(?:\\{.*\\})?)",

Which has support for pythontex environments.

from vscode-latex-basics.

JamieMair avatar JamieMair commented on September 24, 2024

#15 - The proposed changed seemed to work fine.

from vscode-latex-basics.

jlelong avatar jlelong commented on September 24, 2024

Close by #15

from vscode-latex-basics.

jlelong avatar jlelong commented on September 24, 2024

Maybe it would be useful to have an optional setting in which you can specify the syntax highlighting for different environments. For example:

"vscode-latex-basics.syntax.environments": {
    "juliaverbatim": ".jl"
    "juliaconsole": ". jl"
... Etc
}

Unfortunately, it is not possible to use configuration variables in TextMate grammars. Only semantic highlighting can be configured by the user but for the time being we consider it out of the scope of the extension.

from vscode-latex-basics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.