美文网首页
Jupyternotebook download as pdf

Jupyternotebook download as pdf

作者: 离宫2 | 来源:发表于2019-12-10 21:20 被阅读0次

当使用Jupyternotebook download as pdf via LaTex报错时。
Jupyter
500 : Internal Server Error
The error was:

nbconvert failed: PDF creating failed, captured latex output:
Failed to run "xelatex .\notebook.tex -quiet" command:
This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/W32TeX) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
! Undefined control sequence.
<*> .\notebook
              .tex -quiet
? 
! Emergency stop.
<*> .\notebook
              .tex -quiet
No pages of output.
Transcript written on ?.
报错页面

使用宏包

\documentclass[11pt]{ctexart}   %将download as tex得到的文件做修改,将article更改以支持中文

对公式做处理。

%导言区
\documentclass{ctexart}

%导入宏包
\usepackage{amsmath}
\usepackage{amssymb}

%正文区
\begin{document}
    %多行公式--带编号
    \begin{gather}
        a + b +c = b + a \\
        1+2 = 2 + 1
    \end{gather}
    %多行公式--不带编号1
    \begin{gather*}
        a + b = b + a \\
        1+2 = 2 + 1
    \end{gather*}
    
    %多行公式--带编号2 \notag 阻止编号
    \begin{gather}
    a + b = b + a \notag \\
    1+2 = 2 + 1 \notag
    \end{gather}
    
    % 按&号对齐,--带编号
    \begin{align}
        a+b &= b+a \\
        1+2= & 2+1
    \end{align}
    
    % 按&号对齐,--不带编号
    \begin{align*}
    a+b &= b+a \\
    1+2 &=2+1
    \end{align*}
    
    %一个公式的多行排版--带编号
    \begin{equation}
        \begin{split}
        \cos 2x &= \cos^2 x - \sin^2x \\
        &=2\cos^2x-1
        \end{split} 
    \end{equation}
    
    %一个公式的多行排版--不带编号
    \begin{equation*}
    \begin{split}
    \cos 2x &= \cos^2 x - \sin^2x \\
    &=2\cos^2x-1
    \end{split} 
    \end{equation*}
    
    %case环境, text{}在数学模式中处理中文-带编号
    \begin{equation}
        D(x)=\begin{cases}
        1, & \text{如果} x \in \mathbb{Q};\\
        0, & \text{如果} x \in \mathbb{R}\setminus\mathbb{Q}
        \end{cases}
    \end{equation}
    
    %case环境, text{}在数学模式中处理中文-不带编号
    \begin{equation*}
    D(x)=\begin{cases}
    1, & \text{如果} x \in \mathbb{Q};\\
    0, & \text{如果} x \in \mathbb{R}\setminus\mathbb{Q}
    \end{cases}
    \end{equation*}

\end{document}

参考文献:
16LaTeX学习系列之---LaTeX数学公式的补充 - 简书

相关文章

网友评论

      本文标题:Jupyternotebook download as pdf

      本文链接:https://www.haomeiwen.com/subject/zdhngctx.html