[TW5] Using Maths in a Slider

92 views
Skip to first unread message

Chong

unread,
May 18, 2015, 1:55:31 PM5/18/15
to tiddl...@googlegroups.com
Hi I just have a quick question about sliders. 

I want to have something like a story that starts as a plot summary, just a list of the major plot points. Then if the reader wants more details on a particular plot point, they can "zoom in" on that with a slider. The zoomed in section is another list of plot points, and they can zoom in even further on the details that they're interested in. 

The problem is, I want to have maths equations in this story (it's a maths story), and at the moment the only way I can get maths to render inside a slider is if I transclude it from another tiddler. (I'm using the Texzilla plugin for maths.) So I have to create a separate tiddler for every single possible place there is to zoom. Is there a way to do this while keeping all the content inside one tiddler? 

Thanks in advance!

Eric Shulman

unread,
May 18, 2015, 2:35:24 PM5/18/15
to tiddl...@googlegroups.com
Are you using TW5 or TWClassic?

TW5 doesn't have "sliders". Instead it uses the <$reveal> widget, in combination with a "state tiddler" to control what content is shown, and when.

The TW5 documentation for RevealWidget shows how to create a 'simple slider' that provides a single button to toggle the content display.  However, the <$reveal> widget displays *any* content it encloses, so you aren't limited to just using separate tiddlers.

In TWC, the <<slider>> macro does a similar job, but *does* require the content to be in separate tiddlers (this is why I asked which version of TiddlyWiki you are using... your question sounds like it's about TWClassic)

In TWC, if you want to define both the slider buttons *and* the content in the same tiddler, install this plugin from my TiddlyTools site:

enjoy,
-e
Eric Shulman
ELS Design Studios
TiddlyTools - "Small Tools for Big Ideas!"
InsideTiddlyWiki: The Missing Manuals

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:

Chong

unread,
May 18, 2015, 11:41:03 PM5/18/15
to tiddl...@googlegroups.com
I'm using TW5. My problem is that I don't know how to render maths with the reveal widget. For example, the following code will render the $$mathbb{Z}$$ correctly:

<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="show">Show me</$button>
</$reveal>
<$reveal type="match" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="hide">Hide me</$button>
$$\mathbb{Z}$$
</$reveal>


But when I try to use a macro to get rid of all the extra baggage, it doesn't work:

\define showme(go)
<$reveal type="nomatch" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="show">Show me</$button>
</$reveal>
<$reveal type="match" state="$:/state/SampleReveal2" text="show">
<$button set="$:/state/SampleReveal2" setTo="hide">Hide me</$button>
$go$
</$reveal>
\end

<<showme $$\mathbb{Z}$$>>


This will just give me the string "$\mathbb{Z}$" (one set of dollar signs), unrendered. My question is: how do I get the maths to render in the second case?

Thanks for your help. 

Chong

unread,
May 19, 2015, 2:51:41 AM5/19/15
to tiddl...@googlegroups.com
Also, I can't nest the reveal buttons inside each other without having other tiddlers with more reveal buttons. 
I want be to able to do something like this

I went to store. 
<<moredetail "
it was raining so I decided to drive instead of walk
<<moredetail "
 the car took a while to start since it was so cold
">>
I arrived at 5pm
<<moredetail "
It was Sunday so they were just closing up
">>
">>
Then I bought a tomato
<<more detail "...">>

The NestedSlidersPlugins seems to be exactly this - is there any way to do it in TW5?

PMario

unread,
May 19, 2015, 3:16:47 AM5/19/15
to tiddl...@googlegroups.com
Hi Chong,

The reveal widget removes the invisible DOM elements, for performance reasons. So if you show it, your library may not be aware, that it should render the elements again. ...

see: http://tiddlywiki.com/#RevealWidget ... there is the retain option.

Try to set it to yes and have an other try. ... but be prepared, that your tiddler may be slow, since the browser will keep the whole story in the DOM.

hope that helps
-mario

PMario

unread,
May 19, 2015, 3:21:02 AM5/19/15
to tiddl...@googlegroups.com
uups,
I should have read your post to the end :/ .. you have a macro substitution problem.

Within a macro variables are uses with $varName$  ... so there is a problem with your math formular $$\mathbb{Z}$$  .. So TW thinks it is a macro variable. see. http://tiddlywiki.com/#Macros

Is there a second way, that you can define math content, so your library knows, that it should render it?

-mario

Jeremy Ruston

unread,
May 19, 2015, 3:29:00 AM5/19/15
to tiddl...@googlegroups.com
Hi Mario

It should be possible to use the <$latex> widget here?

Best wishes

Jeremy


On Tue, May 19, 2015 at 8:21 AM, PMario <pmar...@gmail.com> wrote:

uups,
I should have read your post to the end :/ .. you have a macro substitution problem.

Within a macro variables are uses with $varName$  ... so there is a problem with your math formular $$\mathbb{Z}$$  .. So TW thinks it is a macro variable.

Is there a second way, that you can define math content, so your library knows, that it should render it?

-mario

--
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/d0226b90-ff92-4c48-8336-fed4ccb69329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PMario

unread,
May 19, 2015, 3:32:45 AM5/19/15
to tiddl...@googlegroups.com
On Monday, May 18, 2015 at 7:55:31 PM UTC+2, Chong wrote:
...I'm using the Texzilla plugin for maths.

I could search it on my own, but what is Texzilla? and how do you use it?
-m

Chong

unread,
May 19, 2015, 5:22:41 AM5/19/15
to tiddl...@googlegroups.com
It can be found here: http://tw5-texzilla.tiddlyspot.com/ 

I've got a workaround to this - it works with triple dollar signs, ie $$$\mathbb{Z}$$$, but this messes up my highlighting in edit mode. The latex widget doesn't seem to work. 

Is there a way to get nested sliders in TW5?
Reply all
Reply to author
Forward
0 new messages