【问题标题】:VSCode LaTeX nicematrixVSCode LaTeX 漂亮矩阵
【发布时间】:2022-11-25 23:56:29
【问题描述】:

我想在 VSCode 中使用包“nicematrix”,但它没有像我尝试的那样工作。

\documentclass{article}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{mathtools,halloweenmath}
\usepackage{stackengine}
\usepackage{nicematrix}
\begin{document}
\begin{vNiceMatrix}[first-row,last-row,first-col,last-col]
(I)&&x-&y+2z=1 \\
(II)-2x-5y+7z=0 & +2 \cdot (I)\\
(III)&5x+&y-3z=-11 & (-5) \cdot (I)
\end{vNiceMatrix}
\end{document}

输出应类似于此图像,但无法生成 pdf 文件。 enter image description here

我收到以下错误:

Fatal Package nicematrix: Outside math mode. LaTeX [line 1, column 1]
(nicematrix) The environment {vNiceMatrix} can be used
(nicematrix) only in math mode (and not in \vcenter).
(nicematrix) This error is fatal.

下一个大问题是无法创建 pdf:

Emergency stop LaTeX [line 256, column 1] 
:256: ==> Fatal error occurred, no output PDF file produced!Latexmk: Getting log file 'ombplus.log' Latexmk: Examining 'ombplus.fls 
Latexmk: Examining 'ombplus.log 
Latexmk: Errors, so I did not complete making targets 
Collected error summary (may duplicate other messages):

如果我单击第 256 行的问题,我会收到以下消息:

The Editor couldn't be open due to an unexpected error: The file "..." can't be read (Unknown (FileSystemError): TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received 'file(...)/\x00'). Button: Try Again

我如何在 VSCode 中使用包“nicematrix”?

我想使用“nicematrix”包,但 VSCode 无法识别“nicematrix”包。 我用 MikTeX 程序下载了它:“miktex-pdftex”,如果我在 VSCode 中包含一个新包,它会自动打开一个“包安装程序”。然后我尝试在 CTAN 中下载这个包。它不是这样工作的。

【问题讨论】:

  • 你能做一个minimal reproducible example让我们重现这个问题吗?
  • \documentclass{article} \usepackage{xcolor} \usepackage{graphicx} \usepackage{amsmath} \usepackage{mathtools,halloweenmath} \usepackage{stackengine} \usepackage{nicematrix} @samcarter_is_at_topanswers.xyz
  • @samcarter_is_at_topanswers.xyz 我的文档中有这些包。
  • 请在评论中创建一个minimal reproducible example,而不仅仅是一个未格式化的包列表。编辑您的问题以包含一个小的测试文档,从一个类开始直到\end{document}
  • @samcarter_is_at_topanswers.xyz 我没有看到“编辑”按钮。我编辑了我的帖子。

标签: visual-studio-code matrix package latex amsmath


【解决方案1】:

该错误是由于您的nicematrix 周围缺少数学环境引起的,例如为未编号的方程添加[...]

我还认为 NiceArray 你会得到更好的对齐:

documentclass{article}
usepackage{xcolor}
usepackage{graphicx}
usepackage{amsmath}
usepackage{mathtools,halloweenmath}
usepackage{stackengine}
usepackage{nicematrix}
egin{document}
[
egin{NiceArray}{l|rlll|l}
  	ext{(I)}   &x    &-y   &+2z  &=1   & \
  	ext{(II)}  &-2x  &-5y  &+7z  &=0   & +2 cdot 	ext{(I)}\
  	ext{(III)} &5x   &+y    &-3z  &=-11 & (-5) cdot 	ext{(I)}
end{NiceArray}
]
end{document}

【讨论】:

  • 我想念哪些数学环境?我在哪里可以找到这些?
  • @Celo 例如我在回答中添加的 [ ... ]
猜你喜欢
  • 2021-04-18
  • 2020-08-10
  • 2021-05-07
  • 2023-03-17
  • 1970-01-01
  • 1970-01-01
  • 2018-12-01
  • 2014-07-17
  • 1970-01-01
相关资源
最近更新 更多