Skip to content

latexstring in markdown not working #1215

Discussion options

You must be logged in to vote

I'm currently doing the following:

  1. First paste the following code into a cell:

    begin
    	function m(xs...; env=:none)
    		if env==:none
    			_latex(xs...) |> Markdown.LaTeX
    		else
    			wrapenv(env, xs...) |> Markdown.LaTeX
    		end
    	end
    	mm(xs...; kw...) = m(xs...; kw...) |> Markdown.MD
    	wrapenv(e, xs...) = _latex("\\begin{$e}\n", xs..., "\n\\end{$e}")
    
    	align(xs...) = m(env="align", xs...)
    	gather(xs...) = m(env="gather", xs...)
    
    	_latex(xs...) = replace(join(_latex.(xs), " "), r"^ +|(?<!\\) +$"m => "")
    
    	if @isdefined SymPy
    		_latex(x::SymPy.SymbolicObject) = sympy.latex(x)  # mode="plain"
    	end
    
    	_latex(x::AbstractString) = strip(x,'$')  # for LaTeXString
    
    	function _latex(x::Rational)
    		n, d = n…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by fonsp
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants