LaTeX forum ⇒ Math & Science ⇒ Custom matrix border Topic is solved

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
JoelSjogren
Posts: 3
Joined: Tue Jul 22, 2014 9:43 pm

Custom matrix border

Hi, I want to create a matrix with a custom border. I'm pretty new to latex. This is what I have in mind: <polynum.png>.

I found a reference http://www.tex.ac.uk/ctan/info/math/vos ... thmode.pdf, in which section 5 discusses how to use \bordermatrix to get [ ] or { } instead of the regular ( ) border. Maybe the implementation given there could be used as a starting point; however it looks very complicated to me. Before I start trying to understand that wall of commands, I want to hear someone's comment on this whole matter.

Also I found these symbols: \urcorner, \llcorner.
Attachments
polynum.png (1.03 KiB) Viewed 4627 times

Tags:

esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm
Here is a suggestion using tikz

\documentclass{article}\usepackage{amsmath} \usepackage{tikz}\newcommand\mborder[2][]{%   \tikz[anchor=base,baseline]{     \node[inner sep=1pt,#1](h){$\displaystyle#2\mathstrut$};     \draw([xshift=.25em]h.south west)--(h.south west)--(h.north west)        --(h.north east)--([yshift=-.25em]h.north east);   }%} \begin{document}   \begin{align*}     A & = \mborder{\begin{matrix}x_1 &x_2\\ y_1&y_2\end{matrix}}   \end{align*}\end{document}

matrixborder.png (3.06 KiB) Viewed 4615 times

Best regards
Elke

JoelSjogren
Posts: 3
Joined: Tue Jul 22, 2014 9:43 pm
It looks great!

Stefan Kottwitz
Posts: 9602
Joined: Mon Mar 10, 2008 9:44 pm
Hi JoelSjogren,

welcome to the forum!

Yes, Elke is a TikZ wizard, I often see her TikZ magic where basic LaTeX is not enough.
TikZ is a package with really a lot of capabilities, but don't hesitate to use it also for such small things.

Stefan

JoelSjogren
Posts: 3
Joined: Tue Jul 22, 2014 9:43 pm
I'll look into that package some more. I heard of it before when I needed to draw intervals and it seems useful

Who is online

Users browsing this forum: No registered users and 3 guests