Numbering Sequential Objects Within a Tiddler

162 views
Skip to first unread message

stevesuny

unread,
Oct 28, 2016, 1:03:31 PM10/28/16
to TiddlyWiki
Hi folks,
I'm working with a colleague to introduce TiddlyWiki as a possible platform on which to create notes for her lectures in Mathematics. For example, see https://zmath.updog.co/De-demo.html, tiddler [[Lecture Reduction of order]].

My question: how can she number her equations within a tiddler, so that the familiar Equation 1, Equation 2, Equation 3 etc. can be shown. This would have to be dynamic, within a tiddler. The equations themselves can be transcluded into named (not numbered) tiddlers...

Thanks,

//steve.

Message has been deleted

Tobias Beer

unread,
Oct 28, 2016, 2:15:27 PM10/28/16
to TiddlyWiki
Hi Steve,

I have an idea for the whole thing
and it will be a widget possibly called $ref
that will equally cater for footnotes.

Not sure when I get to it,
but you'll love it. ;-)

Best wishes,

Tobias.

stevesuny

unread,
Oct 28, 2016, 4:10:48 PM10/28/16
to TiddlyWiki
Well, then, ok! And yes, footnotes would be another use. Generally, any kind of sequential numbering within (and, presumably, within transcluded) tiddlers...

And I promise I'll love it :)

//steve.

Thomas Elmiger

unread,
Oct 28, 2016, 4:31:57 PM10/28/16
to tiddl...@googlegroups.com
Hi Steve,
My example for TextStretch here shows how to use CSS to number elements within a single tiddler or throughout the story river:
http://tid.li/tw5/hacks.html#TextStretch%20Variant%20Footnote

With this concept you/she could place a neutral marker (e.g. <<eqnr>>) in the text. The numbers would be calculated according to the CSS rules by the browser when the page is rendered. Hope you will love this too ;–)

Good luck!
Thomas

Tobias Beer

unread,
Oct 29, 2016, 2:16:55 AM10/29/16
to TiddlyWiki
Hi Thomas,
 
With this concept you/she could place a neutral marker (e.g. <<eqnr>>) in the text. The numbers would be calculated according to the CSS rules by the browser when the page is rendered. Hope you will love this too ;–)

I thought about this too, but then again it solves only half the puzzle. ;-)
The other piece to the puzzle would be to reference a numbered item, however, not by its number.

Best wishes,

Tobias. 

Thomas Elmiger

unread,
Oct 29, 2016, 2:28:34 AM10/29/16
to TiddlyWiki
Hi Tobias,

could you explain the meaning of the term “reference” to me?
Me too, I have ideas to develop the concept a bit further and add one or two pieces.

Have a nice weekend!
Thomas

Tobias Beer

unread,
Oct 29, 2016, 3:42:43 AM10/29/16
to tiddl...@googlegroups.com
Hi Thomas:
 
could you explain the meaning of the term “reference” to me?

a = b + x (1)

Now we replace x in (1) according to:

x = c (2)

and get...

a = b + c (3)

The reference you wanted to make would have been: (1)
and with the actual numeric reference (1)
being dynamically generated via css,
you would not know what number it will eventually have,
and so you need some other mechanism
to refer to (1) other than the number.

Best wishes,

Tobias.

Thomas Elmiger

unread,
Oct 29, 2016, 6:18:35 AM10/29/16
to TiddlyWiki
Thank you for the explanation, Tobias, I overlooked that part. So we need some alternative id to reference to. Not numbers but something else … in TextStretch I generate an id from the actual content – that should be appliccable here. If I had the time, I would make a TextStretch derivate, where
– the content is always visible
– the id is used in the surrounding <span> so we could link to it – ah no, bad idea as TW can not have internal #links.

An additional macro could generate the reference. Usage like
<<formula {{formulaTiddler}}>>

Then some text where you need the reference like this <<reference {{formulaTiddler}}>>

The reference could maybe show the formula in a popup …


Jed Carty

unread,
Oct 29, 2016, 6:52:54 AM10/29/16
to TiddlyWiki
Tobias,

If you aren't working on this now I may make this my project for the weekend.

My quick thoughts on this are to make something that can pretty much act like \cite does in latex.

You would have some macro or more likely widget that you put where you want to label something, if you don't mind me using what you said it would be something like

<$ref label=foo/>

which would put the first label, each instance of this would get its own number (assuming it uses numbers for labels) and they would automatically increment.

so this would add the (1) here (from Tobias' example)


a = b + x (1)

then when you want to reference it you would use

<$ref ref=foo/>

Which would put (1) (or whatever number  the reference foo gets)

and if you have a citation you want to list you would use

<$ref cite=foo/>

or

<$ref listCitations=true/>

which would list all of the citations for things used in the open tiddlers.

which would put the citation for foo if you have one.

We could probably make this work with bibtex, which should make a lot of people happy.

I should have something with the most basic parts working in a little bit.

Tobias Beer

unread,
Oct 29, 2016, 7:31:18 AM10/29/16
to tiddl...@googlegroups.com
Hi Jed,

Mhhh, I've been thinking about, experimenting with and actually working on this quite a bit. My goal is to make it all work as sections, footnotes as well as these kinds of references and respective indexes. So if you could hold off and not jump at a quick implementation that would perhaps be good, since eventually we will need permalinking for all this and a whole lot more. So, to have two people try and figure all of this out at the same time with different semantics and features... well, we can try, but it might be quite messy in the end.

For now, let me leave you pondering the last command in my widget:

exports[""] =
exports
["section"] =
exports
["sections"] =
exports["ref"] =
exports
["reference"] =
exports
["references"] =
exports
["fn"] =
exports
["footnote"] =
exports
["footnotes"] =
exports["$"] =
exports
["context"] = ContextWidget;

Having revealed that, I guess the most important bit for me at this point would be that under any circumstances, leave the <$/> widget signature untouched, ideally all of them :D.

Here's what every widget instance will mean:
  • $ or $section
    • a section
    • with <$ ref="ref-id"/> being a pointer to a reference, e.g. for "see (1)" or "see [TW2016]"
  • $sections
    • a section index for a context
  • $ref or $reference
    • a reference definition, e.g. what eventually is (1)
  • $references
    • a reference index for a context
  • $fn or $footnote
    • a footnote, e.g. [1]
  • $footnotes
    • a footnote index for a context
  • $$ or $context
    • a context encapsulating all of the above
So, if you can, please don't try to rush into building (any of) what the above suggests.

Best wishes,

Tobias.

Jed Carty

unread,
Oct 29, 2016, 8:16:41 AM10/29/16
to TiddlyWiki
Ok, it looks like you are doing something much more ambitious than what I did. I just made something that lets you do essentially what the  \label and \ref commands in latex do. I am looking forward to seeing what you make.

Tobias Beer

unread,
Nov 15, 2016, 1:41:24 AM11/15/16
to TiddlyWiki
Hi Jed


Ok, it looks like you are doing something much more ambitious than what I did. I just made something that lets you do essentially what the  \label and \ref commands in latex do. I am looking forward to seeing what you make.

Looks like I was a little busy @work the last two weeks and I'll be on vacation till December. So, if you feel like working on some solution of that nature (or have already), so be it. If you can and get to it, try not find other widget names. Thanks a lot.

Best wishes,

Tobias.
Reply all
Reply to author
Forward
0 new messages