我有一个3x12矩阵,我想输入我的LaTeX(带有amsmath)文档,但是当矩阵变得大于3x10时,LaTeX似乎会窒息:
\begin{equation}
\textbf{e} =
\begin{bmatrix}
1&1&1&1&0&0&0&0&-1&-1&-1&-1\\
1&-1&0&0&1&1&-1&-1&0&0&1&-1\\
0&0&1&-1&1&-1&1&-1&1&-1&0&0
\end{bmatrix}
\end{equation}
Run Code Online (Sandbox Code Playgroud)
错误:额外对齐选项卡已更改为\ cr.告诉我,我有更多&的bmatrix环境可以处理.有没有正确的方法来处理这个?似乎1和-1的对齐方式也不同,是否也预期了bmatrix?
我试图在等号周围对齐以下方程.我能做什么?谢谢!我正在使用AMSMath包
$$m\ddot{x}_{1}-K(x_{2}+x_{12})+C(\dot{x}_{12}+\dot{x}_{2})+2C\dot{x}_{1} = fx_{1}$$
$$m\ddot{x}_{2}-K(x_{3}+x_{1})+C(\dot{x}_{1}+\dot{x}_{3})+2C\dot{x}_{2} = fx_{2}$$
$$m\ddot{x}_{3}-K(x_{4}+x_{2})+C(\dot{x}_{2}+\dot{x}_{4})+2C\dot{x}_{3} = fx_{3}$$
Run Code Online (Sandbox Code Playgroud) 当我尝试在 matplotlib 中使用 LaTeX amsmath 包时,我遇到了一系列难以理解的错误。有没有人能够做这样的工作?如果是这样,我很乐意看到一个例子。
这是我尝试过的:
import matplotlib
from matplotlib import pyplot
from numpy import arange
x= arange(5)
y= x**1.5
matplotlib.rc('text', usetex = True)
matplotlib.rc('font', **{'family' : "sans-serif"})
params= {'text.latex.preamble' : [r'\usepackage{amsmath}']}
pyplot.rcParams.update(params)
fig= pyplot.figure(figsize=[10,7], dpi=120, facecolor=[1, 1, 1])
pyplot.plot(x, y, linewidth=2)
pyplot.title(r"""$f(x)=
\begin{cases}
\a*x^\{1.5\}2 + c,& \text{if } -1 \leq x \leq 1\\
0, & \text{otherwise}
\end{cases}""")
pyplot.show()
Run Code Online (Sandbox Code Playgroud)
此代码会产生以下错误:
RuntimeError: LaTeX was not able to process the following string:
' \\\\begin{cases}'
Here is the full report generated by …Run Code Online (Sandbox Code Playgroud) 我需要在两列文档的单列中对齐多个方程。我尝试了 align 和 multiline 的混合,但它不起作用。
\documentclass[12pt,journal,compsoc]{IEEEtran}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\maketitle
\section{Introduction}
\begin{align*}
p(W_{i},T_{n})&=\begin{multline*}
p(W_{i},T_{n})\\+(p(W_{i},T_{n})*k/100)
\end{multline*}\\
p(W_{i},T_{n})&=\begin{multline*}
p(W_{i},T_{n})\\+(p(W_{i},T_{n})*k/100)
\end{multline*}\\
\end{align*}
\end{document}
Run Code Online (Sandbox Code Playgroud)
它给了我错误
Package amsmath Error :\begin{multline*} allowed only in paragraph mode
Run Code Online (Sandbox Code Playgroud)