Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error when defining reaction network in Jupyter notebook #595

Closed
jonathanfischer97 opened this issue Feb 10, 2023 · 26 comments · Fixed by #609
Closed

Parse error when defining reaction network in Jupyter notebook #595

jonathanfischer97 opened this issue Feb 10, 2023 · 26 comments · Fixed by #609

Comments

@jonathanfischer97
Copy link
Contributor

image

Running Julia 1.8.5 within VSCode Jupyter notebook, and always receive this parse error when defining a new reaction network. Anybody know what's going on?

@isaacsas
Copy link
Member

isaacsas commented Feb 10, 2023

Yup, Katex and Mathjax are incompatible in how they handle the chemical notation package (mhchem). We currently output Latex that works with the latter as it should work with Documenter and Pluto. It doesn't work with Jupyter which uses Katex.

If anyone knows how to add a path for detecting Latexify is being called within a Jupyter environment we can try to hardcode different Latex output in that case, but I don't know how to do this.

@TorkelE
Copy link
Member

TorkelE commented Feb 10, 2023

Would it be possible to add an option to latexify changing the output between the two forms? That way people that uses the "wrong" environment (like me) could still access the feature, even though in a bit klanky way.

@isaacsas
Copy link
Member

@TorkelE there is an option, mathjax = false, see

function chemical_arrows(rn::ReactionSystem; expand = true,
double_linebreak = LATEX_DEFS.double_linebreak, mathjax = true,
starred = LATEX_DEFS.starred, kwargs...)
(get_constraints(rn) !== nothing) &&
(@warn "Latexify currently ignores constraint equations.")
any_nonrx_subsys(rn) &&
(@warn "Latexify currently ignores non-ReactionSystem subsystems.")
rxs = reactions(rn)
if isempty(rxs)
latexstr = Latexify.LaTeXString("ReactionSystem $(nameof(rn)) has no reactions.")
Latexify.COPY_TO_CLIPBOARD && clipboard(latexstr)
return latexstr
end
str = starred ? "\\begin{align*}\n" : "\\begin{align}\n"
eol = double_linebreak ? "\\\\\\\\\n" : "\\\\\n"
mathjax && (str *= "\\require{mhchem}\n")

Maybe when Catalyst is initialized we can detect if it is running within Jupyter somehow, and then set mathjax = false boolean within this global variable?

Base.@kwdef mutable struct CatalystLatexParams
double_linebreak::Bool = false
starred::Bool = true
end
const LATEX_DEFS = CatalystLatexParams()

(The default would be mathjax = true.)

Then we could modify

double_linebreak = LATEX_DEFS.double_linebreak, mathjax = true,

so that the mathjax keyword arg defaults to the global value.

That should make it automatic if there is a way to detect we're running within Jupyter.

@TorkelE
Copy link
Member

TorkelE commented Feb 10, 2023

So I seem to get error with both options?
image

@isaacsas
Copy link
Member

isaacsas commented Feb 10, 2023

Ahh, this is even worse than I imagined. @jonathanfischer97 this is the same issue you posted on Discourse right?

https://discourse.julialang.org/t/testing-whether-a-function-is-executing-in-a-jupyter-notebook/222

As I said there, Latex display kinds works in Jupyter for me, but that was in the web-browser interface, which I guess uses Mathjax.

It seems VS Code uses an entirely different display stack, I guess Katex-based, and so it doesn't work at all.

You'd need to somehow extend VSCode's Jupyter install to load the mhchem Katex extension, and then we'd need to add code here to output Katex-compatible Latex if we detect we are running in Jupyter within VSCode. Unfortunately, it seems Microsoft is not interested in adding this compatibility themselves:

microsoft/vscode#131874

@isaacsas
Copy link
Member

isaacsas commented Feb 10, 2023

Alternatively, we could try to detect if we are in Jupyter here and write a non-mhchem Latex path. @TorkelE I'd be fine with dropping mhchem for everything and just using the extensible Latex reaction arrows with over and under bars instead of mhchem. mhchem was just what Latexify has always used, but it is kinda a pain on the web...

@TorkelE
Copy link
Member

TorkelE commented Feb 10, 2023

If that would sort out all these issues, it would probably be worth going down that route. If the old one still looks distinctly better (but the new one is not bad) we could try adding it ins as an option. I am happy to look at it sometime in the future. I feel we might be compiling several Latexify stuff (there's also SciML/ModelingToolkit.jl#2069), would make sense to deal with them in one go.

@jonathanfischer97
Copy link
Contributor Author

Ahh, this is even worse than I imagined. @jonathanfischer97 this is the same issue you posted on Discourse right?

https://discourse.julialang.org/t/testing-whether-a-function-is-executing-in-a-jupyter-notebook/222

As I said there, Latex display kinds works in Jupyter for me, but that was in the web-browser interface, which I guess uses Mathjax.

It seems VS Code uses an entirely different display stack, I guess Katex-based, and so it doesn't work at all.

You'd need to somehow extend VSCode's Jupyter install to load the mhchem Katex extension, and then we'd need to add code here to output Katex-compatible Latex if we detect we are running in Jupyter within VSCode. Unfortunately, it seems Microsoft is not interested in adding this compatibility themselves:

microsoft/vscode#131874

Correct! Thank you for being so on top of it, as a relative noobie I'm sorry I don't have more to contribute as far as ideas. But I'd also be in favor of dropping mhchem as its expensive to compile within Overleaf for what it's worth

@isaacsas
Copy link
Member

Sounds good. I think dropping mhchem is probably the best option if both Katex and Mathjax support some extensible arrow type. If we are just going to run into the same issue with a basic set of forward, backward, and reversible extensible arrows then it won't gain us much.

@isaacsas
Copy link
Member

@jonathanfischer97 should hopefully be fixed in v13 (hoping to release it next week).

@jonathanfischer97
Copy link
Contributor Author

@jonathanfischer97 should hopefully be fixed in v13 (hoping to release it next week).

Fantastic, many thanks to both you Professor Isaacson and Mr. Loman. Big fan of you both

@bbantal
Copy link

bbantal commented Jul 2, 2024

Hello, I'm running the Catalyst tutorial through an interactive Jupyter session (in VS Code) and I'm getting a similar error upon defining the example reaction. I'm using Catalyst v13.5.1 and Julia v1.10.4. Is there an existing workaround by any chance?

ParseError: KaTeX parse error: Undefined control sequence: \require at position 17: …\begin{align*} \̲r̲e̲q̲u̲i̲r̲e̲{mhchem} \math...

Screenshot 2024-07-02 at 1 13 46 PM

@isaacsas
Copy link
Member

Hi, sorry for the delayed reply; I was traveling last week. Can you show us the output of running the following codes?

  • Output of using Pkg; Pkg.status()
  • Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
  • Output of versioninfo()

That would help in figuring out your issue.

@bbantal
Copy link

bbantal commented Jul 10, 2024

I appreciate your reply! The outputs are below. Also, I'm not sure if this is relevant, but my Jupyter session is hosted on a remote machine, and I connect to it via SSH within VSCode. The outputs are from the same session.

Output of using Pkg; Pkg.status():

Status `~/neuroblox/Project.toml`
  [479239e8] Catalyst v13.5.1
  [a93c6f00] DataFrames v1.6.1
  [0c46a032] DifferentialEquations v7.13.0
⌃ [7073ff75] IJulia v1.24.2
  [91a5bcdd] Plots v1.40.4
  [d330b81b] PyPlot v2.11.2
Info Packages marked with ⌃ have new versions available and may be upgradable.

Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST):

�[32m�[1mStatus�[22m�[39m `~/neuroblox/Manifest.toml`
  �[90m[47edcb42] �[39mADTypes v1.5.2
  �[90m[1520ce14] �[39mAbstractTrees v0.4.5
  �[90m[7d9f7c33] �[39mAccessors v0.1.36
  �[90m[79e6a3ab] �[39mAdapt v4.0.4
  �[90m[66dad0bd] �[39mAliasTables v1.1.3
  �[90m[ec485272] �[39mArnoldiMethod v0.4.0
  �[90m[4fba245c] �[39mArrayInterface v7.11.0
  �[90m[4c555306] �[39mArrayLayouts v1.10.0
  �[90m[aae01518] �[39mBandedMatrices v1.7.2
  �[90m[e2ed5e7c] �[39mBijections v0.1.7
  �[90m[d1d4a3ce] �[39mBitFlags v0.1.9
  �[90m[62783981] �[39mBitTwiddlingConvenienceFunctions v0.1.6
  �[90m[764a87c0] �[39mBoundaryValueDiffEq v5.9.0
  �[90m[fa961155] �[39mCEnum v0.5.0
  �[90m[2a0fbf3d] �[39mCPUSummary v0.2.6
  �[90m[00ebfdb7] �[39mCSTParser v3.4.3
  �[90m[49dc2e85] �[39mCalculus v0.5.1
  �[90m[479239e8] �[39mCatalyst v13.5.1
  �[90m[d360d2e6] �[39mChainRulesCore v1.24.0
  �[90m[fb6a15b2] �[39mCloseOpenIntervals v0.1.13
  �[90m[944b1d66] �[39mCodecZlib v0.7.4
  �[90m[35d6a980] �[39mColorSchemes v3.25.0
  �[90m[3da002f7] �[39mColorTypes v0.11.5
  �[90m[c3611d14] �[39mColorVectorSpace v0.10.0
  �[90m[5ae59095] �[39mColors v0.12.11
  �[90m[861a8166] �[39mCombinatorics v1.0.2
  �[90m[a80b9123] �[39mCommonMark v0.8.12
  �[90m[38540f10] �[39mCommonSolve v0.2.4
  �[90m[bbf7d656] �[39mCommonSubexpressions v0.3.0
  �[90m[34da2185] �[39mCompat v4.15.0
  �[90m[b152e2b5] �[39mCompositeTypes v0.1.4
  �[90m[a33af91c] �[39mCompositionsBase v0.1.2
  �[90m[2569d6c7] �[39mConcreteStructs v0.2.3
  �[90m[f0e56b4a] �[39mConcurrentUtilities v2.4.1
  �[90m[8f4d0f93] �[39mConda v1.10.2
  �[90m[187b0558] �[39mConstructionBase v1.5.5
  �[90m[d38c429a] �[39mContour v0.6.3
  �[90m[adafc99b] �[39mCpuId v0.3.1
  �[90m[a8cc5b0e] �[39mCrayons v4.1.1
  �[90m[9a962f9c] �[39mDataAPI v1.16.0
  �[90m[a93c6f00] �[39mDataFrames v1.6.1
  �[90m[864edb3b] �[39mDataStructures v0.18.20
  �[90m[e2d170a0] �[39mDataValueInterfaces v1.0.0
  �[90m[bcd4f6db] �[39mDelayDiffEq v5.47.3
  �[90m[8bb1440f] �[39mDelimitedFiles v1.9.1
  �[90m[2b5f629d] �[39mDiffEqBase v6.151.5
�[33m⌅�[39m �[90m[459566f4] �[39mDiffEqCallbacks v2.37.0
  �[90m[77a26b50] �[39mDiffEqNoiseProcess v5.21.0
  �[90m[163ba53b] �[39mDiffResults v1.1.0
  �[90m[b552c78f] �[39mDiffRules v1.15.1
  �[90m[0c46a032] �[39mDifferentialEquations v7.13.0
  �[90m[a0c0ee7d] �[39mDifferentiationInterface v0.5.7
  �[90m[b4f34e82] �[39mDistances v0.10.11
  �[90m[31c24e10] �[39mDistributions v0.25.109
  �[90m[ffbed154] �[39mDocStringExtensions v0.9.3
�[33m⌅�[39m �[90m[5b8099bc] �[39mDomainSets v0.6.7
  �[90m[fa6b7ba4] �[39mDualNumbers v0.6.8
�[33m⌅�[39m �[90m[7c1d4256] �[39mDynamicPolynomials v0.5.7
  �[90m[4e289a0a] �[39mEnumX v1.0.4
  �[90m[f151be2c] �[39mEnzymeCore v0.7.6
  �[90m[460bff9d] �[39mExceptionUnwrapping v0.1.10
  �[90m[d4d017d3] �[39mExponentialUtilities v1.26.1
  �[90m[e2ba6199] �[39mExprTools v0.1.10
  �[90m[c87230d0] �[39mFFMPEG v0.4.1
  �[90m[9d29842c] �[39mFastAlmostBandedMatrices v0.1.3
  �[90m[7034ab61] �[39mFastBroadcast v0.3.4
  �[90m[9aa1b823] �[39mFastClosures v0.3.2
  �[90m[29a986be] �[39mFastLapackInterface v2.0.4
  �[90m[1a297f60] �[39mFillArrays v1.11.0
  �[90m[6a86dc24] �[39mFiniteDiff v2.23.1
  �[90m[53c48c17] �[39mFixedPointNumbers v0.8.5
  �[90m[1fa38f19] �[39mFormat v1.3.7
  �[90m[f6369f11] �[39mForwardDiff v0.10.36
  �[90m[069b7b12] �[39mFunctionWrappers v1.1.3
  �[90m[77dc65aa] �[39mFunctionWrappersWrappers v0.1.3
  �[90m[d9f16b24] �[39mFunctors v0.4.11
  �[90m[46192b85] �[39mGPUArraysCore v0.1.6
  �[90m[28b8d3ca] �[39mGR v0.73.6
  �[90m[c145ed77] �[39mGenericSchur v0.5.4
  �[90m[c27321d9] �[39mGlob v1.3.1
  �[90m[86223c79] �[39mGraphs v1.11.1
  �[90m[42e2da0e] �[39mGrisu v1.0.2
  �[90m[cd3eb016] �[39mHTTP v1.10.8
  �[90m[3e5b6fbb] �[39mHostCPUFeatures v0.1.17
  �[90m[34004b35] �[39mHypergeometricFunctions v0.3.23
�[32m⌃�[39m �[90m[7073ff75] �[39mIJulia v1.24.2
  �[90m[615f187c] �[39mIfElse v0.1.1
  �[90m[d25df0c9] �[39mInflate v0.1.5
  �[90m[842dd82b] �[39mInlineStrings v1.4.1
  �[90m[8197267c] �[39mIntervalSets v0.7.10
  �[90m[3587e190] �[39mInverseFunctions v0.1.14
  �[90m[41ab1584] �[39mInvertedIndices v1.3.0
  �[90m[92d709cd] �[39mIrrationalConstants v0.2.2
  �[90m[82899510] �[39mIteratorInterfaceExtensions v1.0.0
  �[90m[1019f520] �[39mJLFzf v0.1.7
  �[90m[692b3bcd] �[39mJLLWrappers v1.5.0
  �[90m[682c06a0] �[39mJSON v0.21.4
  �[90m[98e50ef6] �[39mJuliaFormatter v1.0.56
  �[90m[ccbc3e58] �[39mJumpProcesses v9.11.1
  �[90m[ef3ab10e] �[39mKLU v0.6.0
  �[90m[ba0b0d4f] �[39mKrylov v0.9.6
  �[90m[b964fa9f] �[39mLaTeXStrings v1.3.1
  �[90m[2ee39098] �[39mLabelledArrays v1.16.0
  �[90m[984bce1d] �[39mLambertW v0.4.6
  �[90m[23fbe1c1] �[39mLatexify v0.16.3
  �[90m[10f19ff3] �[39mLayoutPointers v0.1.17
  �[90m[5078a376] �[39mLazyArrays v2.1.0
  �[90m[2d8b4e74] �[39mLevyArea v1.0.0
  �[90m[d3d80556] �[39mLineSearches v7.2.0
  �[90m[7ed4a6bd] �[39mLinearSolve v2.30.2
  �[90m[2ab3a3ac] �[39mLogExpFunctions v0.3.28
  �[90m[e6f89c97] �[39mLoggingExtras v1.0.3
  �[90m[bdcacae8] �[39mLoopVectorization v0.12.171
  �[90m[d8e11817] �[39mMLStyle v0.4.17
  �[90m[1914dd2f] �[39mMacroTools v0.5.13
  �[90m[d125e4d3] �[39mManualMemory v0.1.8
  �[90m[a3b82374] �[39mMatrixFactorizations v3.0.0
  �[90m[bb5d69b7] �[39mMaybeInplace v0.1.3
  �[90m[739be429] �[39mMbedTLS v1.1.9
  �[90m[442fdcdd] �[39mMeasures v0.3.2
  �[90m[e1d29d7a] �[39mMissings v1.2.0
�[33m⌅�[39m �[90m[961ee093] �[39mModelingToolkit v8.76.0
  �[90m[46d2c3a1] �[39mMuladdMacro v0.2.4
  �[90m[102ac46a] �[39mMultivariatePolynomials v0.5.6
  �[90m[d8a4904e] �[39mMutableArithmetics v1.4.5
  �[90m[d41bc354] �[39mNLSolversBase v7.8.3
  �[90m[2774e3e8] �[39mNLsolve v4.5.1
  �[90m[77ba4419] �[39mNaNMath v1.0.2
  �[90m[8913a72c] �[39mNonlinearSolve v3.13.1
  �[90m[6fe1bfb0] �[39mOffsetArrays v1.14.0
  �[90m[4d8831e6] �[39mOpenSSL v1.4.3
  �[90m[429524aa] �[39mOptim v1.9.4
  �[90m[bac558e1] �[39mOrderedCollections v1.6.3
  �[90m[1dea7af3] �[39mOrdinaryDiffEq v6.84.0
  �[90m[90014a1f] �[39mPDMats v0.11.31
  �[90m[65ce6f38] �[39mPackageExtensionCompat v1.0.2
  �[90m[d96e819e] �[39mParameters v0.12.3
  �[90m[69de0a69] �[39mParsers v2.8.1
  �[90m[b98c9c47] �[39mPipe v1.3.0
  �[90m[ccf2f8ad] �[39mPlotThemes v3.2.0
  �[90m[995b91a9] �[39mPlotUtils v1.4.1
  �[90m[91a5bcdd] �[39mPlots v1.40.4
  �[90m[e409e4f3] �[39mPoissonRandom v0.4.4
  �[90m[f517fe37] �[39mPolyester v0.7.15
  �[90m[1d0040c9] �[39mPolyesterWeave v0.2.2
  �[90m[2dfb63ee] �[39mPooledArrays v1.4.3
  �[90m[85a6dd25] �[39mPositiveFactorizations v0.2.4
  �[90m[d236fae5] �[39mPreallocationTools v0.4.22
  �[90m[aea7be01] �[39mPrecompileTools v1.2.1
  �[90m[21216c6a] �[39mPreferences v1.4.3
  �[90m[08abe8d2] �[39mPrettyTables v2.3.2
  �[90m[43287f4e] �[39mPtrArrays v1.2.0
  �[90m[438e738f] �[39mPyCall v1.96.4
  �[90m[d330b81b] �[39mPyPlot v2.11.2
  �[90m[1fd47b50] �[39mQuadGK v2.9.4
  �[90m[74087812] �[39mRandom123 v1.7.0
  �[90m[e6cf234a] �[39mRandomNumbers v1.5.3
  �[90m[3cdcf5f2] �[39mRecipesBase v1.3.4
  �[90m[01d81517] �[39mRecipesPipeline v0.6.12
  �[90m[731186ca] �[39mRecursiveArrayTools v3.23.1
  �[90m[f2c3362d] �[39mRecursiveFactorization v0.2.23
  �[90m[189a3867] �[39mReexport v1.2.2
  �[90m[05181044] �[39mRelocatableFolders v1.0.1
  �[90m[ae029012] �[39mRequires v1.3.0
  �[90m[ae5879a3] �[39mResettableStacks v1.1.1
  �[90m[79098fc4] �[39mRmath v0.7.1
  �[90m[7e49a35a] �[39mRuntimeGeneratedFunctions v0.5.13
  �[90m[94e857df] �[39mSIMDTypes v0.1.0
  �[90m[476501e8] �[39mSLEEFPirates v0.6.43
  �[90m[0bca4576] �[39mSciMLBase v2.41.3
  �[90m[c0aeaf25] �[39mSciMLOperators v0.3.8
  �[90m[53ae85a6] �[39mSciMLStructures v1.3.0
  �[90m[6c6a2e73] �[39mScratch v1.2.1
  �[90m[91c51154] �[39mSentinelArrays v1.4.3
  �[90m[efcf1570] �[39mSetfield v1.1.1
  �[90m[992d4aef] �[39mShowoff v1.0.3
  �[90m[777ac1f9] �[39mSimpleBufferStream v1.1.0
  �[90m[727e6d20] �[39mSimpleNonlinearSolve v1.10.1
  �[90m[699a6c99] �[39mSimpleTraits v0.9.4
  �[90m[ce78b400] �[39mSimpleUnPack v1.1.0
  �[90m[b85f4697] �[39mSoftGlobalScope v1.1.0
  �[90m[a2af1166] �[39mSortingAlgorithms v1.2.1
  �[90m[47a9eef4] �[39mSparseDiffTools v2.19.0
  �[90m[0a514795] �[39mSparseMatrixColorings v0.3.3
  �[90m[e56a9233] �[39mSparspak v0.3.9
  �[90m[276daf66] �[39mSpecialFunctions v2.4.0
�[33m⌅�[39m �[90m[aedffcd0] �[39mStatic v0.8.10
  �[90m[0d7ed370] �[39mStaticArrayInterface v1.5.1
  �[90m[90137ffa] �[39mStaticArrays v1.9.5
  �[90m[1e83bf80] �[39mStaticArraysCore v1.4.3
  �[90m[82ae8749] �[39mStatsAPI v1.7.0
  �[90m[2913bbd2] �[39mStatsBase v0.34.3
  �[90m[4c63d2b9] �[39mStatsFuns v1.3.1
�[32m⌃�[39m �[90m[9672c7b4] �[39mSteadyStateDiffEq v2.0.1
  �[90m[789caeaf] �[39mStochasticDiffEq v6.65.1
  �[90m[7792a7ef] �[39mStrideArraysCore v0.5.7
  �[90m[892a3eda] �[39mStringManipulation v0.3.4
  �[90m[c3572dad] �[39mSundials v4.24.0
  �[90m[2efcf032] �[39mSymbolicIndexingInterface v0.3.22
  �[90m[19f23fe9] �[39mSymbolicLimits v0.2.1
�[33m⌅�[39m �[90m[d1185830] �[39mSymbolicUtils v1.5.1
�[32m⌃�[39m �[90m[0c5d862f] �[39mSymbolics v5.28.0
  �[90m[3783bdb8] �[39mTableTraits v1.0.1
  �[90m[bd369af6] �[39mTables v1.11.1
  �[90m[62fd8b95] �[39mTensorCore v0.1.1
  �[90m[8290d209] �[39mThreadingUtilities v0.5.2
  �[90m[a759f4b9] �[39mTimerOutputs v0.5.24
  �[90m[0796e94c] �[39mTokenize v0.5.29
  �[90m[3bb67fe8] �[39mTranscodingStreams v0.10.10
  �[90m[d5829a12] �[39mTriangularSolve v0.2.0
  �[90m[410a4b4d] �[39mTricks v0.1.8
  �[90m[781d530d] �[39mTruncatedStacktraces v1.4.0
  �[90m[5c2747f8] �[39mURIs v1.5.1
  �[90m[3a884ed6] �[39mUnPack v1.0.2
  �[90m[1cfade01] �[39mUnicodeFun v0.4.1
  �[90m[1986cc42] �[39mUnitful v1.20.0
  �[90m[45397f5d] �[39mUnitfulLatexify v1.6.3
  �[90m[a7c27f48] �[39mUnityper v0.1.6
  �[90m[41fe7b60] �[39mUnzip v0.2.0
  �[90m[3d5dd08c] �[39mVectorizationBase v0.21.70
  �[90m[81def892] �[39mVersionParsing v1.3.0
  �[90m[19fa3120] �[39mVertexSafeGraphs v0.2.0
  �[90m[c2297ded] �[39mZMQ v1.2.6
  �[90m[6e34b625] �[39mBzip2_jll v1.0.8+1
  �[90m[83423d85] �[39mCairo_jll v1.18.0+2
  �[90m[2702e6a9] �[39mEpollShim_jll v0.0.20230411+0
  �[90m[2e619515] �[39mExpat_jll v2.6.2+0
�[33m⌅�[39m �[90m[b22a6f82] �[39mFFMPEG_jll v4.4.4+1
  �[90m[a3f928ae] �[39mFontconfig_jll v2.13.96+0
  �[90m[d7e528f0] �[39mFreeType2_jll v2.13.2+0
  �[90m[559328eb] �[39mFriBidi_jll v1.0.14+0
  �[90m[0656b61e] �[39mGLFW_jll v3.3.9+0
  �[90m[d2c73de3] �[39mGR_jll v0.73.6+0
  �[90m[78b55507] �[39mGettext_jll v0.21.0+0
  �[90m[7746bdde] �[39mGlib_jll v2.80.2+0
  �[90m[3b182d85] �[39mGraphite2_jll v1.3.14+0
  �[90m[2e76f6c2] �[39mHarfBuzz_jll v2.8.1+1
  �[90m[1d5cc7b8] �[39mIntelOpenMP_jll v2024.1.0+0
  �[90m[aacddb02] �[39mJpegTurbo_jll v3.0.3+0
  �[90m[c1c5ebd0] �[39mLAME_jll v3.100.2+0
�[33m⌅�[39m �[90m[88015f11] �[39mLERC_jll v3.0.0+1
  �[90m[1d63c593] �[39mLLVMOpenMP_jll v15.0.7+0
  �[90m[dd4b983a] �[39mLZO_jll v2.10.2+0
�[33m⌅�[39m �[90m[e9f186c6] �[39mLibffi_jll v3.2.2+1
  �[90m[d4300ac3] �[39mLibgcrypt_jll v1.8.11+0
  �[90m[7e76a0d4] �[39mLibglvnd_jll v1.6.0+0
  �[90m[7add5ba3] �[39mLibgpg_error_jll v1.49.0+0
  �[90m[94ce4f54] �[39mLibiconv_jll v1.17.0+0
  �[90m[4b2f31a3] �[39mLibmount_jll v2.40.1+0
�[33m⌅�[39m �[90m[89763e89] �[39mLibtiff_jll v4.5.1+1
  �[90m[38a345b3] �[39mLibuuid_jll v2.40.1+0
  �[90m[856f044c] �[39mMKL_jll v2024.1.0+0
  �[90m[e7412a2a] �[39mOgg_jll v1.3.5+1
  �[90m[458c3c95] �[39mOpenSSL_jll v3.0.14+0
  �[90m[efe28fd5] �[39mOpenSpecFun_jll v0.5.5+0
  �[90m[91d4177d] �[39mOpus_jll v1.3.2+0
  �[90m[30392449] �[39mPixman_jll v0.43.4+0
  �[90m[c0090381] �[39mQt6Base_jll v6.7.1+1
  �[90m[f50d1b31] �[39mRmath_jll v0.4.2+0
�[33m⌅�[39m �[90m[fb77eaff] �[39mSundials_jll v5.2.2+0
  �[90m[a44049a8] �[39mVulkan_Loader_jll v1.3.243+0
  �[90m[a2964d1f] �[39mWayland_jll v1.21.0+1
  �[90m[2381bf8a] �[39mWayland_protocols_jll v1.31.0+0
  �[90m[02c8fc9c] �[39mXML2_jll v2.12.7+0
  �[90m[aed1982a] �[39mXSLT_jll v1.1.34+0
  �[90m[ffd25f8a] �[39mXZ_jll v5.4.6+0
  �[90m[f67eecfb] �[39mXorg_libICE_jll v1.1.1+0
  �[90m[c834827a] �[39mXorg_libSM_jll v1.2.4+0
  �[90m[4f6342f7] �[39mXorg_libX11_jll v1.8.6+0
  �[90m[0c0b7dd1] �[39mXorg_libXau_jll v1.0.11+0
  �[90m[935fb764] �[39mXorg_libXcursor_jll v1.2.0+4
  �[90m[a3789734] �[39mXorg_libXdmcp_jll v1.1.4+0
  �[90m[1082639a] �[39mXorg_libXext_jll v1.3.6+0
  �[90m[d091e8ba] �[39mXorg_libXfixes_jll v5.0.3+4
  �[90m[a51aa0fd] �[39mXorg_libXi_jll v1.7.10+4
  �[90m[d1454406] �[39mXorg_libXinerama_jll v1.1.4+4
  �[90m[ec84b674] �[39mXorg_libXrandr_jll v1.5.2+4
  �[90m[ea2f1a96] �[39mXorg_libXrender_jll v0.9.11+0
  �[90m[14d82f49] �[39mXorg_libpthread_stubs_jll v0.1.1+0
  �[90m[c7cfdc94] �[39mXorg_libxcb_jll v1.17.0+0
  �[90m[cc61e674] �[39mXorg_libxkbfile_jll v1.1.2+0
  �[90m[e920d4aa] �[39mXorg_xcb_util_cursor_jll v0.1.4+0
  �[90m[12413925] �[39mXorg_xcb_util_image_jll v0.4.0+1
  �[90m[2def613f] �[39mXorg_xcb_util_jll v0.4.0+1
  �[90m[975044d2] �[39mXorg_xcb_util_keysyms_jll v0.4.0+1
  �[90m[0d47668e] �[39mXorg_xcb_util_renderutil_jll v0.3.9+1
  �[90m[c22f9ab0] �[39mXorg_xcb_util_wm_jll v0.4.1+1
  �[90m[35661453] �[39mXorg_xkbcomp_jll v1.4.6+0
  �[90m[33bec58e] �[39mXorg_xkeyboard_config_jll v2.39.0+0
  �[90m[c5fb5394] �[39mXorg_xtrans_jll v1.5.0+0
  �[90m[8f1865be] �[39mZeroMQ_jll v4.3.5+0
  �[90m[3161d3a3] �[39mZstd_jll v1.5.6+0
  �[90m[35ca27e7] �[39meudev_jll v3.2.9+0
�[33m⌅�[39m �[90m[214eeab7] �[39mfzf_jll v0.43.0+0
  �[90m[1a1c6b14] �[39mgperf_jll v3.1.1+0
  �[90m[a4ae2306] �[39mlibaom_jll v3.9.0+0
  �[90m[0ac62f75] �[39mlibass_jll v0.15.1+0
  �[90m[2db6ffa8] �[39mlibevdev_jll v1.11.0+0
  �[90m[f638f0a6] �[39mlibfdk_aac_jll v2.0.2+0
  �[90m[36db933b] �[39mlibinput_jll v1.18.0+0
  �[90m[b53b4c65] �[39mlibpng_jll v1.6.43+1
  �[90m[a9144af2] �[39mlibsodium_jll v1.0.20+0
  �[90m[f27f6e37] �[39mlibvorbis_jll v1.3.7+1
  �[90m[009596ad] �[39mmtdev_jll v1.1.6+0
  �[90m[1317d2d5] �[39moneTBB_jll v2021.12.0+0
  �[90m[1270edf5] �[39mx264_jll v2021.5.5+0
  �[90m[dfaa095f] �[39mx265_jll v3.5.0+0
  �[90m[d8fb68d0] �[39mxkbcommon_jll v1.4.1+1
  �[90m[0dad84c5] �[39mArgTools v1.1.1
  �[90m[56f22d72] �[39mArtifacts
  �[90m[2a0f44e3] �[39mBase64
  �[90m[ade2ca70] �[39mDates
  �[90m[8ba89e20] �[39mDistributed
  �[90m[f43a241f] �[39mDownloads v1.6.0
  �[90m[7b1f6079] �[39mFileWatching
  �[90m[9fa8497b] �[39mFuture
  �[90m[b77e0a4c] �[39mInteractiveUtils
  �[90m[4af54fe1] �[39mLazyArtifacts
  �[90m[b27032c2] �[39mLibCURL v0.6.4
  �[90m[76f85450] �[39mLibGit2
  �[90m[8f399da3] �[39mLibdl
  �[90m[37e2e46d] �[39mLinearAlgebra
  �[90m[56ddb016] �[39mLogging
  �[90m[d6f4376e] �[39mMarkdown
  �[90m[a63ad114] �[39mMmap
  �[90m[ca575930] �[39mNetworkOptions v1.2.0
  �[90m[44cfe95a] �[39mPkg v1.10.0
  �[90m[de0858da] �[39mPrintf
  �[90m[3fa0cd96] �[39mREPL
  �[90m[9a3f8284] �[39mRandom
  �[90m[ea8e919c] �[39mSHA v0.7.0
  �[90m[9e88b42a] �[39mSerialization
  �[90m[1a1011a3] �[39mSharedArrays
  �[90m[6462fe0b] �[39mSockets
  �[90m[2f01184e] �[39mSparseArrays v1.10.0
  �[90m[10745b16] �[39mStatistics v1.10.0
  �[90m[4607b0f0] �[39mSuiteSparse
  �[90m[fa267f1f] �[39mTOML v1.0.3
  �[90m[a4e569a6] �[39mTar v1.10.0
  �[90m[8dfed614] �[39mTest
  �[90m[cf7118a7] �[39mUUIDs
  �[90m[4ec0a83e] �[39mUnicode
  �[90m[e66e0078] �[39mCompilerSupportLibraries_jll v1.1.1+0
  �[90m[deac9b47] �[39mLibCURL_jll v8.4.0+0
  �[90m[e37daf67] �[39mLibGit2_jll v1.6.4+0
  �[90m[29816b5a] �[39mLibSSH2_jll v1.11.0+1
  �[90m[c8ffd9c3] �[39mMbedTLS_jll v2.28.2+1
  �[90m[14a3606d] �[39mMozillaCACerts_jll v2023.1.10
  �[90m[4536629a] �[39mOpenBLAS_jll v0.3.23+4
  �[90m[05823500] �[39mOpenLibm_jll v0.8.1+2
  �[90m[efcefdf7] �[39mPCRE2_jll v10.42.0+1
  �[90m[bea87d4a] �[39mSuiteSparse_jll v7.2.1+1
  �[90m[83775a58] �[39mZlib_jll v1.2.13+1
  �[90m[8e850b90] �[39mlibblastrampoline_jll v5.8.0+1
  �[90m[8e850ede] �[39mnghttp2_jll v1.52.0+1
  �[90m[3f19e933] �[39mp7zip_jll v17.4.0+2
�[36m�[1mInfo�[22m�[39m Packages marked with �[32m⌃�[39m and �[33m⌅�[39m have new versions available. Those with �[32m⌃�[39m may be upgradable, but those with �[33m⌅�[39m are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`

Output of versioninfo():


Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 64 × AMD EPYC 7532 32-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver2)
Threads: 1 default, 0 interactive, 1 GC (on 64 virtual cores)

@isaacsas
Copy link
Member

I can't seem to reproduce this locally. Can you try making a new notebook and running the following code (which creates a new, blank environment and just installs Catalyst)?

using Pkg
Pkg.activate(; temp = true)
Pkg.add("Catalyst")

using Catalyst
rn = @reaction_network begin
    α, S + I --> 2I
    β, I --> R
end

Do you still have the issue? Do you have the Julia and Jupyter extensions installed?

If this example fails can you run those Pkg commands above again within the notebook and double check it is actually Catalyst 13.5.1 they report?

@isaacsas
Copy link
Member

If that still fails for you I will try installing via a remote Linux server to see if I have the problem there (but it will take some time to do, so would be helpful if you can check my example first).

@bbantal
Copy link

bbantal commented Jul 11, 2024

I created a blank environment and the code above runs in a vanilla julia shell, but once I add IJulia,
start up a jupyter session, and connect to it remotely, it throws the same KaTeX parse error.

Screenshot 2024-07-11 at 10 48 27 AM

@bbantal
Copy link

bbantal commented Jul 11, 2024

I appreciate your help but I wouldn't want to take up too much of your time. I can work around this issue. I wanted to use a remote Jupyter session since it allows me to keep it alive indefinitely and reconnect as needed, but I'll manage with a remote REPL.

@isaacsas
Copy link
Member

Just to confirm, you don't see this issue with a non-remote session?

@bbantal
Copy link

bbantal commented Jul 11, 2024

The remote server is command line only so I'm unable to run an interactive shell locally there. At least I don't know how to do so, so I can't test it.

@isaacsas
Copy link
Member

OK, one last thing. Are you using a Jupyter session in a web browser or the builtin VSCode Jupyter Notebook viewer / extension? The latter works remotely for me too (though I have only been able to test via connecting from Mac to Mac and not on Linux).

You shouldn't need to install IJulia in any way if using the VSCode Jupyter extension to view your notebook within VSCode (remotely or locally).

@bbantal
Copy link

bbantal commented Jul 12, 2024

I'm using the Jupyter extension for VSCode. I start the jupyter session within Julia on the remote server, then I start VSCode locally, and I connect to the remote session via the "Jupyter: Create Interactive Window" option.

@isaacsas
Copy link
Member

I see. I haven't ever used that workflow -- I usually just use VSCode's builtin remote-ssh extension to connect to a server and open notebooks on it. In that workflow I'm not seeing any issues.

@bbantal
Copy link

bbantal commented Jul 12, 2024

Yes, that makes sense, thank you. The only reason I did it this way is because it's the only method I know to keep the remote session alive, even if I disconnect for a couple of days. I'll explore if there's a way to achieve this directly through VSCode. If not, it's not a dealbreaker. It's good to know there are similar workflows where Catalyst works well.

@isaacsas
Copy link
Member

Thinking about this some, what is probably happening is that the logic in Catalyst to detect if the notebook is being displayed in VSCode vs Jupyter is not correctly detecting that displaying is being done in VSCode. They require separate Latex codegen as VSCode uses Katex and Jupyter Mathjax, and only in the later could we get mhchem to work for reaction display.

@isaacsas
Copy link
Member

Unfortunately, I don’t know how to better detect who is rendering the notebook, or if there is a way to instead detect Mathjax vs Katex as the renderer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants