mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] equivalent to kbordermatrix?


Chronological Thread 
  • From: Michael Shea <address@hidden>
  • To: Rudolf Sykora <address@hidden>
  • Cc: texmacs-users <address@hidden>
  • Subject: Re: [TeXmacs] equivalent to kbordermatrix?
  • Date: Tue, 5 Dec 2017 15:38:01 -0600

Here is a first approximation solution for you.

  1. Create a 2\times 2 centered table (alt-t)  inside a math environment . For reference I label the cells of this table as below.
    Inline image 1
  2. Cell 1 will be left blank, put you matrix in cell 4. If your matrix has dimensions n\times m , then put a 1 \times m centered table in cell 2 for your column labels and a n \times 1 centered table in cell 3 for your row labels.  
    Inline image 1
  3. Notice the row labels are no problem, but the column labels are not aligned with the matrix. This is because the two tables have differing automatically generated column widths. If we set the cell width for all cells in the matrix to 1.5fn we can get them aligned
    Inline image 2
  4. This method has the disadvantage of the user having to experiment with cell widths in the matrix or the column label table. For instance below, the matrix cells widths are set to automatic and the column label table widths to 2.5fn.
    Inline image 3
I am not sure if there is a way to write a macro of this. I am not sure if there is a way to determine and store the max cell width in a table and use that info to set the cell widths in another table. 

Any ideas out there?


On Tue, Dec 5, 2017 at 8:37 AM, Rudolf Sykora <address@hidden> wrote:
Hello,

is there a reasonably easy way to typeset a matrix with a "border" like this:

https://tex.stackexchange.com/questions/59517/label-rows-of-a-matrix-by-characters

?

Thanks
Ruda

PNG image

PNG image

PNG image

PNG image

<TeXmacs|1.99.5>

<style|generic>

<\body>
  Original <math|5\<times\>5.>

  <\equation*>
    <tabular*|<tformat|<table|<row|<cell|>|<cell|<tabular*|<tformat|<table|<row|<cell|c<rsub|1>>|<cell|c<rsub|2>>|<cell|c<rsub|3>>|<cell|c<rsub|4>>|<cell|c<rsub|5>>>>>>>>|<row|<cell|<tabular*|<tformat|<table|<row|<cell|r<rsub|1>>>|<row|<cell|r<rsub|2>>>|<row|<cell|r<rsub|3>>>|<row|<cell|r<rsub|4>>>|<row|<cell|r<rsub|5>>>>>>>|<cell|<tabular*|<tformat|<table|<row|<cell|<matrix|<tformat|<table|<row|<cell|1>|<cell|0>|<cell|0>|<cell|0>|<cell|0>>|<row|<cell|0>|<cell|1>|<cell|0>|<cell|0>|<cell|0>>|<row|<cell|0>|<cell|0>|<cell|1>|<cell|0>|<cell|0>>|<row|<cell|0>|<cell|0>|<cell|0>|<cell|1>|<cell|0>>|<row|<cell|0>|<cell|0>|<cell|0>|<cell|0>|<cell|1>>>>>>>>>>>>>>>
  </equation*>

  Matrix cell widths set to 1.5fn, column table widths automatic.

  <\equation*>
    <tabular*|<tformat|<table|<row|<cell|>|<cell|<tabular*|<tformat|<table|<row|<cell|c<rsub|1>>|<cell|c<rsub|2>>|<cell|c<rsub|3>>|<cell|c<rsub|4>>|<cell|c<rsub|5>>>>>>>>|<row|<cell|<tabular*|<tformat|<table|<row|<cell|r<rsub|1>>>|<row|<cell|r<rsub|2>>>|<row|<cell|r<rsub|3>>>|<row|<cell|r<rsub|4>>>|<row|<cell|r<rsub|5>>>>>>>|<cell|<tabular*|<tformat|<table|<row|<cell|<matrix|<tformat|<cwith|1|-1|1|-1|cell-width|1.5fn>|<cwith|1|-1|1|-1|cell-hmode|exact>|<table|<row|<cell|1>|<cell|0>|<cell|0>|<cell|0>|<cell|0>>|<row|<cell|0>|<cell|1>|<cell|0>|<cell|0>|<cell|0>>|<row|<cell|0>|<cell|0>|<cell|1>|<cell|0>|<cell|0>>|<row|<cell|0>|<cell|0>|<cell|0>|<cell|1>|<cell|0>>|<row|<cell|0>|<cell|0>|<cell|0>|<cell|0>|<cell|1>>>>>>>>>>>>>>>
  </equation*>

  \;

  Matrix cell widths set to automatic, column table widths set to 2.5fn.

  <\equation*>
    <tabular*|<tformat|<table|<row|<cell|>|<cell|<tabular*|<tformat|<cwith|1|-1|1|-1|cell-width|2.5fn>|<cwith|1|-1|1|-1|cell-hmode|exact>|<table|<row|<cell|c<rsub|1>>|<cell|c<rsub|2>>|<cell|c<rsub|3>>>>>>>>|<row|<cell|<tabular*|<tformat|<table|<row|<cell|r<rsub|1>>>|<row|<cell|r<rsub|2>>>|<row|<cell|r<rsub|3>>>>>>>|<cell|<tabular*|<tformat|<table|<row|<cell|<matrix|<tformat|<cwith|1|-1|1|-1|cell-width|>|<cwith|1|-1|1|-1|cell-hmode|auto>|<cwith|1|3|1|3|cell-width|>|<cwith|1|3|1|3|cell-hmode|auto>|<table|<row|<cell|100>|<cell|100>|<cell|2343>>|<row|<cell|23>|<cell|10>|<cell|300>>|<row|<cell|51>|<cell|0>|<cell|200>>>>>>>>>>>>>>>
  </equation*>

  \;

  \;

  \;

  \;

  \;

  <\equation*>
    \;
  </equation*>
</body>

<\initial>
  <\collection>
    <associate|page-type|letter>
    <associate|preamble|false>
  </collection>
</initial>



Archive powered by MHonArc 2.6.19.

Top of page