LaTeX How do I fix this generated LaTex code for a matrix?

  • Thread starter Thread starter PainterGuy
  • Start date Start date
  • Tags Tags
    Code Latex Matrix
AI Thread Summary
The discussion centers on issues with LaTeX code generated by Scientific Workplace for a matrix, which appears to use non-standard macros. Users are advised to check for associated style or class files (.sty or .cls) that may be required to compile the code correctly. For those seeking a simpler, more standard formatting approach, alternative LaTeX code snippets are provided, including the use of the bmatrix and array environments to create a matrix with or without borders. These alternatives offer a straightforward solution for formatting matrices in LaTeX without extensive modifications to the generated code.
PainterGuy
Messages
938
Reaction score
72
Hi,

I'm using Scientific Workplace to write LaTex and it generates the code shown below for the given matrix. I don't think the generated code is standard LaTex in this particular instance. How can I fix it without making too many modifications? I mean if there is a simple way to fix it. Thank you for your help, in advance!

1618472829295.png


Generated code:
$M_{1}=\left[ \MATRIX{2,2}{c}\VR{,,c,,,}{,,c,,,}{,,,,,}\HR{,,}\CELL{3.0}\CELL{914.\,\allowbreak 5}\CELL{1434.\,\allowbreak 5}\CELL{4.\,\allowbreak 151\,4\times 10^{5}}\right] $

Trying to compile the generated code:
M_{1}=\left[ \MATRIX{2,2}{c}\VR{,,c,,,}{,,c,,,}{,,,,,}\HR{,,}\CELL{3.0}\CELL{914.\,\allowbreak 5}\CELL{1434.\,\allowbreak 5}\CELL{4.\,\allowbreak 151\,4\times 10^{5}}\right]Helpful link:
https://www.physicsforums.com/threads/introducing-latex-math-typesetting.8997/
 
Last edited:
Physics news on Phys.org
Yes, it looks like it uses non-standard macros. Probably there is a style or class file somewhere (look for extensions .sty or .cls) that you can load into your ##\LaTeX##-document to ensure these macros work. If you want to use the generated code, it may be best to look into that.

Alternatively, a more standard way of formatting would be
$$
\begin{bmatrix}
3.0& 914.5\\
1434.5& 4.1514 \times 10^5
\end{bmatrix}
$$
To see the code, right click on the above expression, then Show Math As - TeX Commands. If you insist on including the table bars, you could try something like
$$
\left[
\begin{array}{|c|c|}
\hline
3.0& 914.5\\
\hline
1434.5& 4.1514 \times 10^5\\
\hline
\end{array}
\right]
$$
 
Last edited:
  • Like
Likes PainterGuy and FactChecker

Similar threads

Replies
3
Views
2K
Replies
3
Views
2K
Replies
3
Views
3K
Replies
8
Views
3K
Replies
15
Views
25K
Replies
766
Views
737K
Back
Top