Math & ScienceSystem of Equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
User avatar
Mohsen Avaji
Posts: 16
Joined: Mon Aug 27, 2012 12:06 am

System of Equations

Post by Mohsen Avaji »

Hi
I am trying to write a few system of equations, and I want the terms to be similar as attached file "Part_of_a_book.png", but in my output number of items isn't similar to it.

Thanks in advance,
Mohsen Avaji.

Code: Select all

‎\documentclass{report}‎
‎\usepackage{mathtools}‎
‎\usepackage{systeme}‎
‎\usepackage{multicol}‎
‎‎\makeatletter‎
‎\@ifundefined{Umathcode}{\let\Umathcode\XeTeXmathcode}{}‎
‎\@ifundefined{Umathchardef}{\let\Umathchardef\XeTeXmathchardef}{}‎
‎\makeatother‎

‎\begin{document}‎
‎
‎\begin{multicols}{2}‎
‎\begin{enumerate}‎
‎\item‎
‎$\sysdelim..\systeme{x+y+3z=5,2x-y+4z=11,-y+z=3.}$‎
‎\item‎
‎$\sysdelim..\systeme{3x+2y+z=1,5x+3y+3z=2,x+y-z=1.}$‎
‎\item‎
‎$\sysdelim..\systeme{3x+2y+z=1,5x+3y+3z=2,7x+4y+5z=3.}$‎
‎\item‎
‎$\sysdelim..\systeme{3x+2y+z=1,5x+3y+3z=2,7x+4y+5z=3,x+y-z=0.}$‎
‎\item‎
‎$\sysdelim..\systeme[xyzu]{3x-2y+5z+u=1,x+y-3z+2u=2,6x+y-4z+3u=7.}$‎
‎\item‎
‎$\sysdelim..\systeme[xyzu]{x+y-3z+u=5,2x-y+z-2u=2,7x+y-7z+3u=3.}$‎
‎\item‎
‎$\sysdelim..\systeme[xyzuv]{x+y+2z+3u+4v=0,2x+2y+7z+11u+14v=0,3x+3y+6z+10u+15v=0.}$‎
‎\item‎
‎$\sysdelim..\systeme[xyzu]{x-2y+z+2u=-2,2x+3y-z-5u=9,4x-y+z-u={}5,5x-3y+2z+u={}3.}$‎
‎\end{enumerate}‎
‎\end{multicols}‎

‎\end{document}‎

Attachments
system.pdf
My output
(4.99 KiB) Downloaded 442 times
system.tex
My document
(919 Bytes) Downloaded 499 times
Part_of_a_book.png
Part_of_a_book.png (178.65 KiB) Viewed 9859 times
Yours faithfully,
Mohsen Avaji.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

System of Equations

Post by cgnieder »

I don't know about the vertical alignment but two other points: you don't need to put \systeme{} in math mode and it is sufficient to call \sysdelim.. once:

Code: Select all

\documentclass{report}
\usepackage{mathtools}
\usepackage{systeme}
\sysdelim..
\usepackage{multicol}

\begin{document}

\begin{multicols}{2}
\begin{enumerate}
  \item \systeme{x+y+3z=5,2x-y+4z=11,-y+z=3.}
  \item \systeme{3x+2y+z=1,5x+3y+3z=2,x+y-z=1.}
  \item \systeme{3x+2y+z=1,5x+3y+3z=2,7x+4y+5z=3.}
  \item \systeme{3x+2y+z=1,5x+3y+3z=2,7x+4y+5z=3,x+y-z=0.}
  \item \systeme[xyzu]{3x-2y+5z+u=1,x+y-3z+2u=2,6x+y-4z+3u=7.}
  \item \systeme[xyzu]{x+y-3z+u=5,2x-y+z-2u=2,7x+y-7z+3u=3.}
  \item \systeme[xyzuv]{x+y+2z+3u+4v=0,2x+2y+7z+11u+14v=0,3x+3y+6z+10u+15v=0.}
  \item \systeme[xyzu]{x-2y+z+2u=-2,2x+3y-z-5u=9,4x-y+z-u={}5,5x-3y+2z+u={}3.}
\end{enumerate}
\end{multicols}

\end{document}
Regards
site moderator & package author
User avatar
Mohsen Avaji
Posts: 16
Joined: Mon Aug 27, 2012 12:06 am

Re: System of Equations

Post by Mohsen Avaji »

Dear Cgnieder, thank you for your time and cooperation.
But I don't know why in both cases, number of items is at the beginning of the second line, while I want the numbers be at beginning of fist line similar attached file (Part_of_a_book.png).
Yours faithfully,
Mohsen Avaji.
User avatar
Mohsen Avaji
Posts: 16
Joined: Mon Aug 27, 2012 12:06 am

System of Equations

Post by Mohsen Avaji »

Hi
I found the answer of my question.

Code: Select all

\documentclass{report}
\usepackage{mathtools}
\usepackage{systeme}
\usepackage{multicol}
\makeatletter
\@ifundefined{Umathcode}{\let\Umathcode\XeTeXmathcode}{}
\@ifundefined{Umathchardef}{\let\Umathchardef\XeTeXmathchardef}{}
\makeatother

\begin{document}

\begin{center}
\begin{tabular}{lp{1.5cm}l}
\sysdelim..\systeme{1.\quad x+y+3z=5,2x-y+4z=11,-y+z=3.} &&
\sysdelim..\systeme[xyzu]{5.\quad 3x-2y+5z+u=1,x+y-3z+2u=2,6x+y-4z+3u=7.} \\
&&\\
\sysdelim..\systeme{2.\quad 3x+2y+z=1,5x+3y+3z=2,x+y-z=1.} &&
\sysdelim..\systeme[xyzu]{6.\quad x+y-3z+u=5,2x-y+z-2u=2,7x+y-7z+3u=3.} \\
&&\\
\sysdelim..\systeme{3.\quad 3x+2y+z=1,5x+3y+3z=2,7x+4y+5z=3.} &&
\sysdelim..\systeme[xyzuv]{7.\quad x+y+2z+3u+4v=0,2x+2y+7z+11u+14v=0,3x+3y+6z+10u+15v=0.} \\
&&\\
\sysdelim..\systeme{4.\quad 3x+2y+z=1,5x+3y+3z=2,7x+4y+5z=3,x+y-z=0.} &&
\sysdelim..\systeme[xyzu]{8.\quad x-2y+z+2u=-2,2x+3y-z-5u=9,4x-y+z-u={}5,5x-3y+2z+u={}3.} \\
\end{tabular}
\end{center}

\end{document}
Attachments
system.tex
(959 Bytes) Downloaded 498 times
Yours faithfully,
Mohsen Avaji.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

System of Equations

Post by cgnieder »

Thanks for posting you solution!

May I repeat myself nonetheless (emphasis added):
it is sufficient to call `\sysdelim..` once
Regards
site moderator & package author
Post Reply