Markdown & Math

183 views
Skip to first unread message

Michelle Ramur

unread,
Mar 22, 2020, 6:58:09 AM3/22/20
to TiddlyWiki
Hi,

I am starting to use in higher scale TiddlyWiki and I was very happy to find the plugin for markdown parsing because I was having a lot of troubles with the default Tiddly format, since it a lot of characters are considered as especial, for instance to write something like <a> or a'' I find myself in a lot of trouble. However, another of the needs that I have is to be able to use TeX for math expression and I got the KateX plugin. However, they don't work togethether, or at least that was said 6 years ago (https://groups.google.com/forum/#!topic/tiddlywiki/PhFdqZ_eWLE).

Thus, my doubts are:
  • Do you know any way of rendering math in Markdown?
  • Do you know how to escape a piece of text? So I can write something like    !! a'' + <a>
Thanks in advance!

Mark S.

unread,
Mar 22, 2020, 10:19:22 AM3/22/20
to TiddlyWiki
One work around is to think of your markdown text and latex text as image tiddlers. Then they can both be included in a regular tiddler (not markdown) via transclusion, similar to the way that you would transclude an image tiddler. In this way you can combine the two.

e.g.

{{markdown1}}

{{math1}}

yields

PMario

unread,
Mar 22, 2020, 12:16:46 PM3/22/20
to tiddl...@googlegroups.com
Hi,

If it is this (see image below), what you want. Just use wikitext and the KaTeX plugin. see: https://tiddlywiki.com/plugins/tiddlywiki/katex/

and write

$$
 !! a'' + <a>
$$

IMO it works just fine:


have fun!
mario

Michelle Ramur

unread,
Mar 22, 2020, 5:34:47 PM3/22/20
to TiddlyWiki
Thanks but they are different things. On the one hand I want to write math and on the other to escape any expression, so a'' would be outside of $$. Any idea?

TonyM

unread,
Mar 22, 2020, 5:45:10 PM3/22/20
to TiddlyWiki
Michelle,

I am not sure I understand because of my not using such maths extensions but if you simply want to stop something being evaluated in wikitext there are a number of approaches
`singlebackquote`

"""
Tripple quotes
"""
use button in Editor toolbar

You can also use the https://tiddlywiki.com/#CodeBlockWidget

In fact you could possibly also rely on html `<code>` and make your own styles.

Regards
Tony

Mark S.

unread,
Mar 22, 2020, 6:33:51 PM3/22/20
to TiddlyWiki
Michelle wants to mix Markdown and Katex. Since the katex plugin requires wikitext, it doesn't work in a markdown tiddler, which only understands markdown, not wikitext.

The solution is to mix the two types of mark-up language in a regular TW, using transclusions to bring in the individual markdown texts and math texts as needed.

PMario

unread,
Mar 22, 2020, 7:44:36 PM3/22/20
to TiddlyWiki
On Sunday, March 22, 2020 at 10:34:47 PM UTC+1, Michelle Ramur wrote:
Thanks but they are different things. On the one hand I want to write math and on the other to escape any expression, so a'' would be outside of $$. Any idea?


You could start every tiddler with: \rules except bold html

eg:

\rules except bold html

a'' <a> is different to $$a'' <a>$$

-mario

Mohammad

unread,
Mar 23, 2020, 7:53:02 AM3/23/20
to TiddlyWiki
Michelle

This is not Tiddlywiki, but similar somehow:


You can text in Markdown and math in LaTex

--Mohammad

Michelle Ramur

unread,
Mar 23, 2020, 8:30:04 AM3/23/20
to TiddlyWiki
Hi Tony,

Thank you for the suggestion, it is an option but as you know when you put `` or """ the text is formatted as if it was code, while I just want it to be considered text.

Michelle Ramur

unread,
Mar 23, 2020, 8:32:55 AM3/23/20
to TiddlyWiki
Interesting! Althought it seems a bit tedious it is nice to know at least a way of solving one of the potential syntax conflicts.

Can I create a tiddler that includes all the rules I want to disable and then just include that tiddler any time I want to block all those rules? This way I wouldn't need to specify each rule every time I create a new tiddler.

Michelle Ramur

unread,
Mar 23, 2020, 8:35:01 AM3/23/20
to TiddlyWiki
It looks really promising, but from what I see is not a default plugin. Do you have any link about how to integrate this sort of not "official" plugins?

PMario

unread,
Mar 23, 2020, 11:36:15 AM3/23/20
to TiddlyWiki
On Monday, March 23, 2020 at 1:32:55 PM UTC+1, Michelle Ramur wrote:
Interesting! Althought it seems a bit tedious it is nice to know at least a way of solving one of the potential syntax conflicts.

Can I create a tiddler that includes all the rules I want to disable and then just include that tiddler any time I want to block all those rules? This way I wouldn't need to specify each rule every time I create a new tiddler.

There is a way to disable parsing rules globally. ... BUT ... If you disable too many of them, it's possible to break TW.

So if you can tell us your rules, which conflict with the existing TW syntax, we can check if it is save to disable them globally.

You can create a "New tiddler" template, that contains all rules to be disabled. If you don't need it, you can just delete the line.

OR you could use the "New Journal Tiddler" button and configure it in the ControlPanel : Info : Basic  tab. There you can set the text field of a new journal tiddler.
This would work out of the box.

-mario

Michelle Ramur

unread,
Apr 1, 2020, 4:35:13 AM4/1/20
to TiddlyWiki
Hi, unfortunately I don't know yet how many will I need since every time I find a new pattern that is conflicting. At least I have seen problems with '' and < or >. Is there any reference site where I can see all the available rules?

Ste Wilson

unread,
Apr 1, 2020, 8:10:36 AM4/1/20
to TiddlyWiki
Can't you put the special chars in inline katex?  Or transclude in your equations to your markdown tiddlers?
Reply all
Reply to author
Forward
0 new messages