Am folosit acest acest format springer document din latex și am vrut să adaug o matrice în hârtie și „mă lovesc de această eroare de ceva timp.
\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 
 Am primit o eroare Environment bmatrix undefined. \begin{bmatrix}. Am adăugat și pachetul amsmath, dar asta nu pare să fie de ajutor. Care ar putea fi problema? 
Comentarii
Răspuns
Am adăugat și pachetul
amsmath, dar care nu părea să ajute. Care ar putea fi problema?
Instrucțiunea
\usepackage{amsmath, xparse} 
 trebuie să  mai devreme  în preambul. Ar trebui să fie executat imediat după \usepackage{booktabs}  cel târziu . 
 De ce? Deoarece preambulul atunci  re  definește macro \env@matrix și mediul bmatrix. Ambele sunt definite în pachetul amsmath. În mod surprinzător, LaTeX se blochează dacă i se spune să redefinim ceva care încă nu a fost definit. 
\documentclassși închideți unfilecontents*mediu care nu se deschide niciodată. De asemenea, ce intenționați curenewcommand*\env@matrixșirenewenvironment{bmatrix}?