TW5 - An environment with LaTeX and Markdown?

797 views
Skip to first unread message

radu....@gmail.com

unread,
Apr 6, 2015, 8:57:57 AM4/6/15
to tiddl...@googlegroups.com
I started using tiddlywiki about one week ago, on the third attempt. The thing that made it viable for me was the TexZilla plugin. It works great, providing most notably the "aligned" environment which is missing in KaTeX.

This makes TW5 almost perfect as a math notebook. What is missing is Markdown. Besides making the notes look much better, having them written in markdown syntax would make sharing one's work on (virtually all) online forums seamless.
Unfortunately, the Markdown plugin doesn't work together with the LaTeX plugin (one has to designate the content type as text/x-markdown and as a consequence the LaTeX rendering is inactivated).

Are there any solutions of having markdown and LaTeX rendering functional at the same time?

Thank you

Jeremy Ruston

unread,
Apr 6, 2015, 4:09:07 PM4/6/15
to TiddlyWiki
Hi Radu

Are there any solutions of having markdown and LaTeX rendering functional at the same time?

Not at the moment, I'm afraid. It would need some hacking to the Markdown parser to make it parse the $$ markers. The Markdown.js parser that we use is not particularly actively developed:


We may be better off using a new alternative such as:


It seems to be superior in a few ways (eg inclusion of "smarty pants" quote handling).

Best wishes

Jeremy.


 

Thank you

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e6a8e640-5526-4ddb-894d-ec6afd8b4553%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

radu....@gmail.com

unread,
Apr 7, 2015, 2:37:59 AM4/7/15
to tiddl...@googlegroups.com, jeremy...@gmail.com
Thank you Jeremy for the quick reply.
I'm probably just showing my ignorance here, but is there any chance this would work if the order in which the parsers act would be swapped? If the TeXZilla plugin does the correct job for the '$$' delimited blocks (i.e. produces html output for them while ignoring the rest of the text), is it possible that the Markdown plugin would just work if applied after that?

Thanks again
Radu

Jeremy Ruston

unread,
Apr 7, 2015, 2:47:40 AM4/7/15
to radu....@gmail.com, TiddlyWiki
Hi Radu

I'm probably just showing my ignorance here, but is there any chance this would work if the order in which the parsers act would be swapped? If the TeXZilla plugin does the correct job for the '$$' delimited blocks (i.e. produces html output for them while ignoring the rest of the text), is it possible that the Markdown plugin would just work if applied after that?

Sadly not. Parsers in TW5 convert a stream of text into a parse tree which is a hierarchical structure that represents the logical structure of the text. The parse tree can't be fed back into another parser because the parser will be expecting text.

Best wishes

Jeremy.

Lluis Pamies-Juarez

unread,
Jun 3, 2015, 12:17:19 AM6/3/15
to tiddl...@googlegroups.com, jeremy...@gmail.com, radu....@gmail.com
Jeremy,

In https://github.com/llpamies/texdown there is a simple tiddlywiki plugin that combines Marked and TeXZilla engines as Radu was requesting. The fancy options available in Marked are not enabled, but it is easy to add, even configure it from the  tiddly wiki GUI.

Is there any option to get that into the main tree?

Best,
Lluis

Matabele

unread,
Jun 4, 2015, 1:08:35 AM6/4/15
to tiddl...@googlegroups.com
Hi

Perhaps it would be advantageous to switch to a multi-markdown plugin: http://fletcherpenney.net/multimarkdown/features/

Or it may be possible to create an EpicEditor plugin -- this would allow a choice of parsers (Marked comes standard): http://oscargodson.github.io/EpicEditor/

regards

Jeremy Ruston

unread,
Jun 7, 2015, 8:24:32 AM6/7/15
to Lluis Pamies-Juarez, TiddlyWiki, Radu Grosu
Hi Lluis

In https://github.com/llpamies/texdown there is a simple tiddlywiki plugin that combines Marked and TeXZilla engines as Radu was requesting. The fancy options available in Marked are not enabled, but it is easy to add, even configure it from the  tiddly wiki GUI.

Is there any option to get that into the main tree?

Great, well done. I think this would be useful for the core, the only issue is that you've implemented it as a parser module where I'd have expected it to be a widget that works along the same lines as the current KaTeX plugin. Was there a particular reason that you took this approach?

Assuming we resolve that, there are a few other things to be done:

* You'll need to sign the Contributors License Agreement, as described in contributing.md in the TW5 repo
* Add a readme to the plugin
* Create a pull request that adds the plugin to `plugins/tiddlywiki`
* It would be useful to add a "LaTeX" tiddler to the tw5.com edition that compares the capabilities of KaTeX and TeXZilla to help people choose which is best for them

Best wishes

Jeremy.

Victor Santos

unread,
Jun 11, 2015, 2:42:57 PM6/11/15
to tiddl...@googlegroups.com, radu....@gmail.com, jeremy...@gmail.com
Hi Lluis,


On Wednesday, June 3, 2015 at 1:17:19 AM UTC-3, Lluis Pamies-Juarez wrote:
Jeremy,

In https://github.com/llpamies/texdown there is a simple tiddlywiki plugin that combines Marked and TeXZilla engines as Radu was requesting. The fancy options available in Marked are not enabled, but it is easy to add, even configure it from the  tiddly wiki GUI.
I've tried a similar approach in https://github.com/padawanphysicist/tw5-mathdown, but using markdown-it as the Markdown parser. Do you think it would be possible to integrate the plugin to use MathJax as the LaTeX renderer in browsers where MathML is not available?

Best,
vct.

Jeremy Ruston

unread,
Jun 15, 2015, 11:50:20 AM6/15/15
to Victor Santos, TiddlyWiki, Radu Grosu
Hi Victor
 
I've tried a similar approach in https://github.com/padawanphysicist/tw5-mathdown, but using markdown-it as the Markdown parser. Do you think it would be possible to integrate the plugin to use MathJax as the LaTeX renderer in browsers where MathML is not available?

I think a parser is the right way to go for handling Markdown. The advantage of packaging the math support as a widget is just so that it can be re-used with different parsers.

The trouble with MathJax, as you've probably discovered, is that it's entirely DOM-based, and it wouldn't be possible to, say, use it to generate static math markup on the server. But you could certainly still use it within those limitations,

Best wishes

Jeremy

Roving Richard

unread,
Mar 27, 2017, 7:34:32 PM3/27/17
to TiddlyWiki, radu....@gmail.com
Sorry for the necrobump, but does anyone know if anyone figured out a way to parse LaTeX in markdown?
Message has been deleted
Message has been deleted

Diego Mesa

unread,
Sep 7, 2018, 1:05:45 PM9/7/18
to TiddlyWiki
Another bump!
Reply all
Reply to author
Forward
0 new messages