7

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?

  • \usepackage[straightbraces]{mtpro2} should do. – egreg May 29 '14 at 12:14
  • Thanks but I wanted the 2nd to look like the 1st which is curly! – mac May 29 '14 at 15:14
6

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}
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.