11

I am using the systeme package to create an equation system. I am also using the mtpro2 package for mathematical notation.

When I want to create a 2x2 system with a curly bracket, it works just fine by using the command \sysdelim\{.. But, it seems that the curly bracket doesn't look the same in a 3x3 system or above.

\documentclass[b5paper,11pt]{article}
 \usepackage{pgfplots}
 \usepackage{psfrag}
 \usepackage{amsmath}
 \usepackage{mtpro2}
 \usepackage{calc}
 \usepackage{systeme}

\begin{document} \sysdelim{.\systeme{2x+3y=5,x-4y=-3\quad} \sysdelim{.\systeme[xzy]{2x+3y-z=5,x+2z-4y=-3,x+y=2} \end{document}

enter image description here

How can I make the 2nd bracket look like the 1st?

EDIT 2020 - TeXLive issue after update 10/4/2020

I have just updated my TeXLive distribution to TexLive 2020 and tried to run the same code using the patch recommended by egreg at the second part of his answer. Apparently there is a new issue

LaTeX3 Error: '\msg_term:n' deprecated on 2020-01-01. Use '\iow_term:n '. {}{}

Where exactly must I replace that code?

Paul Wintz
  • 402
  • 2
  • 14
mac
  • 1,479

1 Answers1

12

If you don't want those pesky curly braces, load the package with the straightbraces option:

\documentclass[b5paper,11pt]{article}
\usepackage{amsmath}
\usepackage[lite,straightbraces]{mtpro2} % lite because I only have that
\usepackage{systeme}

\begin{document}
\[
\systeme{2x+3y=5,x-4y=-3}      
\quad
\systeme[xzy]{2x+3y-z=5,x+2z-4y=-3,x+y=2}
\]
\end{document}

enter image description here

Note that \sysdelim\{. is the default.

If you prefer the pesky braces, you have to use \LEFTRIGHT, so an indirect path must be followed:

\documentclass[b5paper,11pt]{article}
\usepackage{amsmath}
\usepackage[lite]{mtpro2} % lite because I only have that
\usepackage{systeme,xparse}

\NewDocumentCommand{\csysteme}{som}{%
  \LEFTRIGHT\{.{%
    \sysdelim..
    \IfBooleanTF{#1}
     {\IfNoValueTF{#2}{\systeme*{#3}}{\systeme*[#2]{#3}}}
     {\IfNoValueTF{#2}{\systeme{#3}}{\systeme[#2]{#3}}}%
  }%
}

\begin{document}
\[
\csysteme{2x+3y=5,x-4y=-3}
\quad
\csysteme[xzy]{2x+3y-z=5,x+2z-4y=-3,x+y=2}
\]
\end{document}

enter image description here

With a patch one can avoid changing syntax; the idea is to use \LEFTRIGHT of mtpro2 instead of \left and \right.

\documentclass[b5paper,11pt]{article}
\usepackage{amsmath}
\usepackage[lite]{mtpro2}
\usepackage{systeme,regexpatch}

\makeatletter
% change the definition of \sysdelim not to store `\left` and `\right`
\def\sysdelim#1#2{\def\SYS@delim@left{#1}\def\SYS@delim@right{#2}}
\sysdelim\{. % reinitialize

% patch the internal command to use
% \LEFTRIGHT<left delim><right delim>{<system>}
% instead of \left<left delim<system>\right<right delim>
\regexpatchcmd\SYS@systeme@iii
  {\cB.\c{SYS@delim@left}(.*)\c{SYS@delim@right}\cE.}
  {\c{SYS@MT@LEFTRIGHT}\cB\{\1\cE\}}
  {}{}
\def\SYS@MT@LEFTRIGHT{%
  \expandafter\expandafter\expandafter\LEFTRIGHT
  \expandafter\SYS@delim@left\SYS@delim@right}
\makeatother

\begin{document}
\[
\systeme{2x+3y=5,x-4y=-3}
\quad
\systeme[xzy]{2x+3y-z=5,x+2z-4y=-3,x+y=2}
\]
\end{document}
egreg
  • 1,121,712
  • I want the opposite.The straight bracket to look like the 1st one which is curly. To create curly bracket also for the 3x3 system. – mac May 29 '14 at 15:13
  • @mac I was just adding a more complex solution that should avoid changing syntax. – egreg May 29 '14 at 16:37
  • I can see that the alignment of the variables has changed and x is under z which didnt happen before the new code.Is there any way we can fix that?Thanks. – mac May 29 '14 at 16:42
  • @mac I switched the * position, sorry! I'll fix it immediately! – egreg May 29 '14 at 16:43
  • It works perfect!That was a lot of work!Thanks! – mac May 29 '14 at 17:05