On Sunday, June 6, 2021 at 5:56:54 AM UTC-7 Pak wrote: > Suppose I have 3 tiddlers: tid-thm-a, tid-thm-b, tid-thm-c I would like to > transclude them in a tiddler so that it displays the following: > Theorem 1. (optional caption) (...contents in tid-thm-a... displayed in > block mode, but the first line should be on the same line as Theorem 1} > Theorem 2. (optional caption) (...contents in tid-thm-b... displayed in > block mode, but the first line should be on the same line as Theorem 2} > Theorem 3. (optional caption) (...contents in tid-thm-c... displayed in > block mode, but the first line should be on the same line as Theorem 3} > > 1. How do I make x run as a counter? > 2. The contents of transcluded tiddlers appear on the next line, not after > the word Theorem x. > > Give this a try: <style> .theorems { counter-reset: num; } .theorem::before { counter-increment: num; content: "Theorem " counter(num) "."; } </style> <div class="theorems"> <$list filter="tid-thm-a tid-thm-b tid-thm-c"> <div class="theorem"> <$view field=caption/> <blockquote><$transclude mode="block"/></blockquote> </div> </$list> </div>
Notes: * The "theorems" class resets the counter named "num" to 0 * The "theorem" class increments the num counter and displays the "Theorem X." text * I put the transcluded content within a blockquote just to make it look nicer enjoy, -e -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a9323570-8e3b-4c6c-a09c-d0c5f521ebf0n%40googlegroups.com.