Advanced Tables Plugin

The Advanced Tables Plugin finally resolved the pain of having to calculate the sum outside of the markdown file. Thank you!

I have a problem on my macOS (Big Sur 11.5.1) that I do not know how to fix. The -- > at the end of the formula is rendered as -->. Even in this post, I had to put a space in between -- and > otherwise it will render as an arrow. Interestingly, Obsidian can still process the formula correctly.

I know it’s not a problem with the plugin, but could not figure out how to turn it off.

@chchen, this is just Obsidian trying to be helpful with displaying those characters together as an arrow. If you open the file in textEdit you’ll see that it is still the expected --> . I don’t think this is something can be turned off, but it also isn’t causing a problem.

This syntax is used because it is an HTML comment, which prevents the formula from being rendered in preview mode.

Thanks for the explanation. When I first tested f(x) and it was not working, I thought the errors were caused by the automatic arrow thing and had to open another editor to be sure.

A suggestion: maybe you can make the HTML comment also monospaced? That will clear the confusion for new comers.

Tables dont work in preview mode (it just remove all spaces, breaks width and view of the table), also tables menu (align, move column etc) dont work. Why?

I use Obsidian and Typora interchangeably, and noticed that the Advanced Tables Plugin somehow knows that edits have been made outside of Obsidian. Formulas no longer work after outside edits, e.g. a row deletion in Typora. This behavior took me a while to figure out as I thought markdown files are plain text and are blind to platforms. Is there a fundamental limit or is it a fixable bug?

By the way, I just found out that the Advanced Tables Plugin can carry out algebra with units in the table. Although it basically ignores the units, it is still better than Excel, which refuses to proceed when numbers are mixed with units. Great job!

1 Like

@chchen : good point. I also use both, and I use Typora mostly for my journal, which is table-rich. The tables in Edit mode in Obsidian drive me nuts, so I am using Typora while eagerly awaiting the WYSIWYG feature in Obsidian before I transfer them all.

In other words, I had not picked up this issue …… yet …… and hope Tony can fix it.

OK, I think I figured out what was going on. Every time when I do some edits in Typora, the formula line (html comment) is automatically reformatted by Typora as the bottom row of the Table. So all that is needed is to delete a few “|” on the formula line. Occasionally, Obsidian (or Advanced Tables) is so confused by the editing that a relaunch is needed, but it’s really not a bug of Advanced Tables.

Like I suggested above, it will help to get rid of the automatic conversion of -- > to an arrow. This unnecessary conversion confuses the formatting of the formula/comment line and makes debugging so much harder.

That can be due to a ligatures-supporting font, like e.g. Obsidian’s default Inter font, or to the Smart Typography plug-in.

@Klaas Thanks for the suggestions. I did not have Smart Typography installed, but installed it after seeing your message. It did not help the automatic arrow conversion with all the options I could try.

Not sure if ligature is the cause but I cannot find the default css (it is quite easy to locate in Typora), so I do not know how to change it.

@chchen Smart Typography will convert -> into an arrow.

Don’t change the default Obsidian CSS, use a snippet instead in which you define a different font if that’s what you want.

Thanks for the tip. I played briefly with css snippets. Because of the arrow conversion, the second half of the formula is no longer taken as part of the HTML comment. For now, the best I can do is to match the comment color with that of the normal text. It’s not ideal, but still easier to notice when table boarders are inadvertently added around the comment. Here is the snippet:

/* html comments in editor */
.cm-s-obsidian span.cm-comment {
  color: var(--text-normal);
}

@Klaas: thanks for putting together the useful snippet collection on GitHub.

1 Like

@chchen I am not sure I understand your 1st paragraph. Going back to your original comment, though, I understand that ligatures, esp. the -> one, pose a problem.

If that is still the case, why not change the font altogether? Obsidian’s default font is Inter, which supports ligatures. If you change the font to a non-supporting one with a snippet, you’re done.

@Klaas, I changed the body font to Menlo, and this indeed solves the artificial arrow conversion. However, the formula line is still messed up in terms of formatting.

@tgrosinger, please pay attention to this screenshot. It looks like the complex formula (not the arrow conversion) is confusing the parsing of html comment, and this is probably fixable within the Advanced Tables Plugin.

Notes added: It’s the $ sign that messes up the comment parsing. Compare the two screenshots, one with $, the other without $:

@chchen Menlo is a very nice monospace font. In fact, recently I came to realize that I find monospace font much easier to read because the letters are relatively widely spaced. So, because I emulate the WYSIWYG feature with various CSS bits and pieces, I am using monospace font in bothe Edit and Preview modes.

My favourites are Monaco and Space Mono. Furthermore, I like dark modes, so in my browser I use the Dark Reader extension, which also allows me to set the font for webpages. The font I use there: Monaco.

Sorry for my off-topic rant, I just thought it might be useful to share.

1 Like

Here is a css snippet that will disable font ligature and stop the automatic arrow conversion. It should work for any font.

* {
	font-variant-ligatures: none;
}

Hey Tony,
Really like your work. Just wanted to mention that the sizing of images doesn’t work inside of the tables.

For example, [[abcd……png|500]] resizes the images to the width of 500 but this doesn’t work inside the tables. This works throughout the markdown file, just not inside the tables. Any way to make that work . Any workarounds maybe ?

1 Like

Is it possible to have a column with a row number? (the numbers should be unaffected by sorting other columns?)

I have been playing with the wonderful Advanced Tables, particularly formulas. I have a cluster of formula listed under a table which will evaluate, but only in stages. The first column based formula, then the total hours, then the cost. The last two depend on earlier formula. Is this what should happen in chaining?
TIA

## Estimate

| Notes         | No. | Hrs     | Total Hrs |
| ------------- | --- | ------- | --------- |
| Pages         | 77  | 1       | 77        |
| Illustrations | 4   | 3       | 12        |
| Other         | 1   | 1       | 1         |
|               |     |         |           |
| **COST**      | 45  | 4050.00 | 90        |
<!-- TBLFM: @2$4=(@2$2*$3) -->
<!-- TBLFM: @3$4=($2*$3) -->
<!-- TBLFM: @4$4=($2*$3) -->
<!-- TBLFM: @>$4=sum(@[email protected]) -->
<!-- TBLFM: @>$3=($4*$2);%.2f -->
3 Likes

I have the same problem with the $ breaking the formula. Any suggestions would be welcome.

I use the following css snippet, so that the html comment takes on the normal text color. Not the best solution, but much easier to edit the formula.

.cm-s-obsidian span.cm-comment {
  color: var(--text-normal);
}