logo
Loading...

在CODE CELL執行latex失敗 - Cupoy

執行:%%latex\begin{align}f(x)=\tanh(x)=\frac{(e^x-e^...

cvdl-2,cvdl-2-d02

在CODE CELL執行latex失敗

2020/04/03 下午 00:54
Julia程式語言討論版
Yalan Chang
觀看數:6
回答數:2
收藏數:1
cvdl-2
cvdl-2-d02

執行:

%%latex

\begin{align}

f(x)=\tanh(x)=\frac{(e^x-e^{-x})}{(e^x+e^{-x})}

\end{align}


會出現EXCEPTION

The analogue of IPython's `%%latex` is
```
display("text/latex", """
...latex text...
""")
```
in Julia.  Note, however, that `$` and `\` in the LaTeX text
needs to be escaped as `\$` and `\\` so that they aren't
interpreted by Julia.  See, however, the
[LaTeXStrings package](
https://github.com/stevengj/LaTeXStrings.jl)
for easier input of LaTeX text as
L"""
...latex text...
"""
without requiring any extra backslashes.

回答列表

  • 2020/04/03 下午 10:47
    James Huang
    贊同數:0
    不贊同數:0
    留言數:0

    謝謝您的提問,這個問題是在投影片中未說清楚的,在 IJulia 中無法使用在 Code Cell 中用上面語法寫 LaTeX,但是此語法在 Python Kernel 是被支援的。


    作業的部分請採用 Markdown Cell 以 inline 或是 block 模式撰寫即可。


    抱歉造成困擾,投影片內容會再進行更新。

  • 2020/04/07 上午 11:56
    CUPOY
    贊同數:0
    不贊同數:0
    留言數:0

    Yalan Chang 您好:投影片內容已更新,感謝您的回饋!