이 이 springer 형식을 사용했습니다. 라텍스 문서를 작성하고 종이에 매트릭스를 추가하고 싶었는데 지금까지이 오류가 발생했습니다.
\documentclass[a4paper]{article} \usepackage{pdfpages} \usepackage{graphicx} \graphicspath{ {./imgs/} } \usepackage{changepage}% http://ctan.org/pkg/changepage \usepackage{lipsum}% http://ctan.org/pkg/lipsum \usepackage{booktabs} \makeatletter \renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{% \hskip -\arraycolsep \let\@ifnextchar\new@ifnextchar \array{#1}} \renewenvironment{bmatrix} {{\ifnum`}=0 \fi\left[\env@matrix} {\endmatrix\right]\ifnum`{=0 \fi}} \makeatother \usepackage{amsmath, xparse} \usepackage{mathtools} \newlength{\extratrim} \setlength{\extratrim}{10mm} \newcommand*{\trimexpr}[1]{\dimexpr(#1)+\extratrim\relax} gsave newpath 20 20 moveto 20 220 lineto 220 220 lineto 220 20 lineto closepath 2 setlinewidth gsave .4 setgray fill grestore stroke grestore \end{filecontents*} % \RequirePackage{fix-cm} % %\documentclass{svjour3} % onecolumn (standard format) %\documentclass[smallcondensed]{svjour3} % onecolumn (ditto) \documentclass[smallextended]{svjour3} % onecolumn (second format) %\documentclass[twocolumn]{svjour3} % twocolumn % \smartqed % flush right qed marks, e.g. at end of proof % \usepackage{graphicx} % \usepackage{mathptmx} % use Times fonts if available on your TeX system % % insert here the call for the packages your document requires %\usepackage{latexsym} % etc. % % please place your own definitions here and don"t use \def but % \newcommand{}{} % % Insert the name of "your journal" with % \journalname{myjournal} % \begin{document} \title{Random titl} \author{me \& him } \institute{x x of x, \at Institute of x Technology and Electronics \\ {} % \\ % \and x x x, yy \and \\ x x x, yy } \date{May 15th 2020} % The correct dates will be entered by the editor \maketitle \[ \begin{bmatrix} 1 2 \\ 2 3 \end{bmatrix} \] \section{Summary} \section{Appendix} %\begin{acknowledgements} %If you"d like to thank anyone, place your comments here %and remove the percent signs. %\end{acknowledgements} % Authors must disclose all relationships or interests that % could have direct or potential influence or impart bias on % the work: % % \section*{Conflict of interest} % % The authors declare that they have no conflict of interest. % BibTeX users please use one of %\bibliographystyle{spbasic} % basic style, author-year citations %\bibliographystyle{spmpsci} % mathematics and physical sciences %\bibliographystyle{spphys} % APS-like style for physics %\bibliography{} % name your BibTeX data base % Non-BibTeX users please use \begin{thebibliography}{} % % and use \bibitem to create references. Consult the Instructions % for authors for reference list style. % \bibitem{RefJ} % Format for Journal Reference Author, Article title, Journal, Volume, page numbers (year) % Format for books \bibitem{RefB} Author, Book title, page numbers. Publisher, place (year) % etc \end{thebibliography} \end{document} % end of file template.tex
오류가 발생합니다. Environment bmatrix undefined. \begin{bmatrix}
. amsmath 패키지도 추가했지만 도움이되지 않는 것 같습니다. 문제가 무엇일까요?
댓글
Answer
amsmath
패키지도 추가했지만 도움이되지 않는 것 같습니다. 무엇이 문제일까요?
지침
\usepackage{amsmath, xparse}
이전 . \usepackage{booktabs}
늦어도 직후에 실행되어야합니다.
이유가 무엇입니까? 프리앰블은 재 매크로 \env@matrix
및 환경 bmatrix
. 둘 다 amsmath
패키지에 정의되어 있습니다. 당연히 LaTeX는 “아직 정의되지 않은 것을 재정의하라는 지시를 받으면 충돌합니다.
\documentclass
명령이 있어서는 안되며filecontents*
환경이 열리지 않습니다. 또한renewcommand*\env@matrix
및renewenvironment{bmatrix}
로 무엇을 하시겠습니까?