Latex 使用Sphinx和Mathjax时,数组中\cline的输出错误

Latex 使用Sphinx和Mathjax时,数组中\cline的输出错误,latex,python-sphinx,mathjax,Latex,Python Sphinx,Mathjax,我使用Sphinx(v3.2.1)和LaTeX生成矩阵方程,我想使用\cline和数组。但是,它不会按预期渲染: .. math:: :label: lp \left[ \begin{array}{cc|c} a_{11} &a_{12} &b_1 \\ a_{21} &a_{22} &b_2 \\ a_{31} &a_{32} &b_3 \\ \cline{1-2} c_{1} &c_{2}

我使用Sphinx(v3.2.1)和LaTeX生成矩阵方程,我想使用
\cline
和数组。但是,它不会按预期渲染:

.. math::
  :label: lp

  \left[
  \begin{array}{cc|c}
    a_{11} &a_{12} &b_1 \\
    a_{21} &a_{22} &b_2 \\
    a_{31} &a_{32} &b_3 \\ \cline{1-2}
    c_{1}  &c_{2}  &d \\
  \end{array}
  \right]
呈现为

我的密码是

# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os
import sys

sys.path.insert(1, os.path.abspath("../../"))
from trellis import __version__  # nopep8

import sphinx_rtd_theme  # nopep8

# -- Project information -----------------------------------------------------

project = 'foo'
copyright = 'foo'
author = 'foo'

# The full version, including alpha/beta/rc tags
release = __version__


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.doctest",
    "sphinx.ext.intersphinx",
    "sphinx.ext.todo",
    "sphinx.ext.coverage",
    "sphinx.ext.ifconfig",
    "sphinx.ext.viewcode",
    "sphinx.ext.githubpages",
    "sphinx.ext.autosummary",
    "sphinx.ext.napoleon",
    "sphinx.ext.autosectionlabel",
    "sphinx_rtd_theme",
    "sphinx.ext.mathjax",
]

intersphinx_mapping = {
    "python": ("https://docs.python.org/3", None),
    'numpy': ('http://docs.scipy.org/doc/numpy', None),
    'scipy': ('http://docs.scipy.org/doc/scipy/reference', None),
}

autodoc_default_options = {
    'members': None
}

napoleon_google_docstring = False
napoleon_include_init_with_doc = True
napoleon_include_private_with_doc = True
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = True
napoleon_use_admonition_for_notes = True
napoleon_use_admonition_for_references = True
napoleon_use_rtype = False

latex_elements = {
    "preamble": r'''\usepackage{amsmath}'''
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = ['css/custom.css']

所以我偶然发现了这个问题,因为我有一个非常相似的问题。我不确定您是否在不久前就解决了这个问题,但以下是我的工作:我只是使用了\hline而不是\cline

.. math::

  \left[
  \begin{array}{cc|c}
    a_{11} &a_{12} &b_1 \\
    a_{21} &a_{22} &b_2 \\
    a_{31} &a_{32} &b_3 \\ 
    \hline
    c_{1}  &c_{2}  &d \\
  \end{array}
  \right]

所以我偶然发现了这个问题,因为我有一个非常相似的问题。我不确定您是否在不久前就解决了这个问题,但以下是我的工作:我只是使用了\hline而不是\cline

.. math::

  \left[
  \begin{array}{cc|c}
    a_{11} &a_{12} &b_1 \\
    a_{21} &a_{22} &b_2 \\
    a_{31} &a_{32} &b_3 \\ 
    \hline
    c_{1}  &c_{2}  &d \\
  \end{array}
  \right]
设置
mathjax\u路径=”https://cdn.jsdelivr.net/npm/mathjax@conf.py中的3/es5/tex mml chtml.js“
(MathJax 3)没有帮助。根据,不支持
\cline
。另请参见设置
mathjax\u路径=”https://cdn.jsdelivr.net/npm/mathjax@conf.py中的3/es5/tex mml chtml.js“
(MathJax 3)没有帮助。根据,不支持
\cline
。另请参阅