How to solve the problem that the spacing between lines of mathematical formulas is too small

Hello, friends.

Use the syntax of the tiddlywiki table to center the asciimath formulas in the table, but for the formulas of the matrix class next to each other, the outer brackets of the matrix are too close to the outer brackets


I’ve come up with a solution, and it doesn’t seem to be optimal,Not pure line, line character “.” Still visible

|tc-center|k
|tc-table-no-border|k
| $am$[[2,4,8],[4,8,16],[1,1,1]] = 0$$ |
| . |
| $am$[[2,4,0],[4,8,0],[8,16,0]] = 0$$ |

In this case, the elements in the matrix are matrix, the spacing between elements and elements is also very close, perhaps it is necessary to add “|. |” in the formula, but it is easy to confuse when looking at the public source code

|tc-center|k
|tc-table-no-border|k
| $am$[[(-1)^(1+1)[[5,9],[6,5]],(-1)^(1+2)[[1,9],[2,5]],(-1)^(1+3)[[1,5],[2,6]]],[(-1)^(2+1)[[1,4],[6,5]],(-1)^(2+2)[[3,4],[2,5]],(-1)^(2+3)[[3,1],[2,6]]],[(-1)^(3+1)[[1,4],[5,9]],(-1)^(3+2)[[3,4],[1,9]],(-1)^(3+3)[[3,1],[1,5]]]]$$ |

Any reply would be greatly appreciated

Would a \\ at line end inside the $$ $$ do the job?


$am$[[2,4,8],[4,8,16],[1,1,1]] = 0 \\
$am$[[2,4,0],[4,8,0],[8,16,0]] = 0$$

Or

$am$&[[2,4,8],[4,8,16],[1,1,1]] = 0 \\
$am$&[[2,4,0],[4,8,0],[8,16,0]] = 0$$

The & used to keep things aligned.

Not going well

1 Like

Using just KaTeX

$$\begin{bmatrix}
   2 & 4 & 8 \\
   4 & 8 & 16 \\
   1 & 1 & 1
   
\end{bmatrix}
=0 \\ $$

$$\begin{bmatrix}
   2 & 4 & 0 \\
   4 & 8 & 0 \\
   8 & 16 & 0
   
\end{bmatrix}
=0 \\ $$

Which is more complicated than the asci maths…

$am${:([[2,4,8],[4,8,16],[1,1,1]] = 0),
([[2,4,0],[4,8,0],[8,16,0]] = 0):}$$

Is a cleaner asci maths code but still doesn’t leave enough space between the matrices. Not sure what the asci maths line break is.

This css style works for a single matrix block with multiple up-down relationships, but it doesn’t work for a large matrix where every element is a small matrix

<style>
  .text-with-spacing {
    line-height: 6.0; /* 这里的1.5是一个比例因子,表示行间距是字体大小的1.5倍 */
    text-align: center;
  }
</style>

<p class="text-with-spacing">
  $am$[[2,4,0],[4,8,0],[8,16,0]] = 0$$<br>
  $am$[[2,4,0],[4,8,0],[8,16,0]] = 0$$<br>
  $am$[[2,4,0],[4,8,0],[8,16,0]] = 0$$<br>
</p>

How about

<center>
$am$[[2,4,8],[4,8,16],[1,1,1]] = 0$$<br><br>

$am$[[2,4,0],[4,8,0],[8,16,0]] = 0$$
</center>

For a single piece of a small matrix it’s much simpler than mine


Nested large matrices are not applicable

Have you looked at special Unicode characters ?

  • There are special spaces and other invisible characters and all you need to formate your way out of anything.

Are you using the katext plugin which is designed for this?

I have considered using Spaces to represent empty lines with nothing, but even if I type multiple Spaces, the spacing between the matrices of the upper and lower relations will not change

The plugins I use are $:/plugins/tiddlywiki-scss-com-au/asciimath4katex and $:/plugins/tiddlywiki/katex where: the dependency of plugin $:/plugins/tiddlywiki-scss-com-au/asciimath4katex is $:/plugins/tiddlywiki/katex

there is a special code for this:
|&nbsp;|

like @TW_Tones suggested, using html entities for simple cases should work:

|tc-center|k
|tc-table-no-border|k
| $am$[[2,4,8],[4,8,16],[1,1,1]] = 0$$ |
| &nbsp; |
| $am$[[2,4,0],[4,8,0],[8,16,0]] = 0$$ |

Note I replaced your multiple spaces | | by a single entity |&nbsp;|.

It probably won’t work for nested matrices though.

Fred

You were faster! :wink:

Fred

It seems that for an ordinary matrix with multiple upper and lower relations, in order to achieve the ". "that can be ignored in the split row. To type more characters

It’s a hack, but inserting an empty row between original rows in your nested matrices example kind of works:

$am$[[(-1)^(1+1)[[5,9],[6,5]],(-1)^(1+2)[[1,9],[2,5]],(-1)^(1+3)[[1,5],[2,6]]],[\ ,\ ,\ ],[(-1)^(2+1)[[1,4],[6,5]],(-1)^(2+2)[[3,4],[2,5]],(-1)^(2+3)[[3,1],[2,6]]],[\ ,\ ,\ ],[(-1)^(3+1)[[1,4],[5,9]],(-1)^(3+2)[[3,4],[1,9]],(-1)^(3+3)[[3,1],[1,5]]]]$$

Asciimath code for an empty space is \ , so in a 3-column matrix an empty line is [\ ,\ ,\ ].

Fred

2 Likes

Thank you so much. It’s like magic.It works very well!





asciimath’s symbolic system is a mystery

1 Like

Yes, I can’t remember where I learned this, it’s not even listed on asciimath.org :thinking:

[EDIT] Got it, it’s here: ASCIIMath Tutorial

3 Likes