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

multiline TeX equations with dollar signs in html #166

Closed
chiyahn opened this issue Jan 25, 2019 · 3 comments
Closed

multiline TeX equations with dollar signs in html #166

chiyahn opened this issue Jan 25, 2019 · 3 comments

Comments

@chiyahn
Copy link

chiyahn commented Jan 25, 2019

I have found that

$x^2 &= x \cdot x \\ &= \beta x$

or

$$x^2 &= x \cdot x \\ &= \beta x$$

both can be compiled in .html using the default weave commands, but whenever I try to compile

$ 
x^2 &= x \cdot x \\ &= \beta x
$

or

$$
x^2 &= x \cdot x \\ &= \beta x
$$

I get the following errors:

ERROR: MethodError: no method matching show(::Base.GenericIOBuffer{Array{UInt8,1}}, ::MIME{Symbol("text/plain")}, ::Symbol)
You may have intended to import Base.show
Closest candidates are:
  show(::IO, ::MIME{Symbol("text/html")}, ::Markdown.MD) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\Markdown2HTML.jl:230
Stacktrace:
 [1] #sprint#325(::Nothing, ::Int64, ::Function, ::Function, ::MIME{Symbol("text/plain")}, ::Vararg{Any,N} where N) at .\strings\io.jl:101
 [2] sprint(::Function, ::MIME{Symbol("text/plain")}, ::Vararg{Any,N} where N) at .\strings\io.jl:97
 [3] tohtml(::Base.GenericIOBuffer{Array{UInt8,1}}, ::MIME{Symbol("text/plain")}, ::Symbol) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\Markdown2HTML.jl:12
 [4] tohtml(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Symbol) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\Markdown2HTML.jl:34
 [5] html(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Symbol) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\Markdown2HTML.jl:164
 [6] html(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Array{Any,1}) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\Markdown2HTML.jl:87
 [7] html(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Markdown.MD) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\Markdown2HTML.jl:92
 [8] #sprint#325(::Nothing, ::Int64, ::Function, ::Function, ::Markdown.MD) at .\strings\io.jl:101
 [9] sprint at .\strings\io.jl:97 [inlined]
 [10] html(::Markdown.MD) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\Markdown2HTML.jl:227
 [11] format_chunk(::Weave.DocChunk, ::Dict{Symbol,Any}, ::Weave.JMarkdown2HTML) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\format.jl:132
 [12] format(::Weave.WeaveDoc) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\format.jl:33
 [13] #weave#10(::Symbol, ::Symbol, ::Symbol, ::Dict{Any,Any}, ::Symbol, ::String, ::Nothing, ::String, ::Symbol, ::Bool, ::Nothing, ::Nothing, ::Nothing, ::Array{String,1}, ::String, ::typeof(weave), ::String) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\Weave.jl:112
 [14] weave(::String) at C:\Users\Chiyoung Ahn\.julia\dev\Weave\src\Weave.jl:100
 [15] top-level scope at none:0

I tried the change made in #165, but seems like the equations are not still displayed properly although compilation can completed without any error. FYI I am using Windows 10, Julia 1.0.2 with Weave version of 0.6.1

@chiyahn
Copy link
Author

chiyahn commented Jan 28, 2019

I just have tried the new change made in #165 and checked out the most up-to-date repo -- compilation can be done successfully, but seems like equations are not displayed properly.

Compiling the following file in HTML

---
title: Testing Weave.jl
author: chiyahn
date: 28th January 2019
---

## All star

Hey now, you're an all-star, get your game on, go play -- *all that glitters is gold*

$$
x^2 = 2 \beta x
$$

will give something like

image

Note that raw equations are placed between :$ and $

@mpastell
Copy link
Collaborator

That is the expected behavior with Julia Markdown, you either have to type the $ signs as in your first examples or use a math block https://docs.julialang.org/en/v1/stdlib/Markdown/#Display-equations-1.

@mpastell
Copy link
Collaborator

Support for multiline equations with

$$
x^2 &= x \cdot x \\ &= \beta x
$$

has been added

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

No branches or pull requests

2 participants