Superscripts in html export

Hello everybody,

The possibility in Tinderbox 9.5 to select notes, view them as a continuous document, and edit them directly in that continuous document prompted me to explore whether I could write manuscripts and other long documents directly in Tinderbox.

I love rich text, so I thought I could write in rich text in Tinderbox, export as html, and then use Pandoc to convert html into docx1 using the relevant reference.docx files, which I already have.

But before I go any further in this exploration, I was wondering whether there’s a way in Tinderbox to export superscripts in html without having to use the <sup></sup> tags in the text pane: I have to use a lot of those superscripts in my documents and the text becomes unreadable. Thank you for your consideration.

Best regards,
Enrico

1 docx files are required for collaborators to comment on the document and by the journals to which we normally submit.

To the best of my understanding, RTF superscript/subscript text is not honoured for HTML export without explicit HTML mark-up. In short: No. Sorry! :slight_smile:

Thank you very much for the prompt and helpful reply!

Best regards,
Enrico

1 Like

If you really need this, I can do it. But do you really, really need it? Please advise.

Thank you very much for your response. I do need it — I’m a developmental biologist, and I work on an organism for which mutations are indicated with a superscript. You’re very kind to propose to help, but I’m reluctant to ask you to add a feature for a single user if that’s what you’re proposing. Perhaps if other people needed it…

1 Like

I’m going to second the value of this – any kind of science writing is full of super/subscripts and this would smooth out a common pain point.

Hello Mark B,
There is a more general requirement that would enable Tinderbox for academic writing and that is footnotes, of which superscripts may be just one aspect. I would express the requirement as an easy, pre-made mechanism for adding footnotes to text in $Text that is exportable using one of the Export options off the File menu. Perhaps a built-in export template would do it along with some other conventions or connections.

At the moment, I use text-anchored linked notes with a distinctive link-type for footnotes. My export workflow essentially spits just these link-types out, in batches tied to the page they’re on which is the note they’re linked from. Then I manually transfer them into the manuscript using the footnote mechanism in the WP software (e.g. Word, or in my case Mellel) I’m using.

1 Like

The problem with exporting as footnotes is (a) Microsoft Word is the obvious target, (b) Word’s footnote interchange ability has broken for a decade — it may still be broken for all I know, and (c) as you observe yourself, Word alone isn’t enough — and the people most likely to explore Tinderbox are those least engaged with Word.

That said, I could be persuaded.

I myself write papers with exceptional (for computer science) numbers of footnotes and absurd numbers of references. Yet, I fancy that I could transfer all 100 references in one of these things by hand in an afternoon, just with copy and paste. Now, I only do 2 or 3 of these a year. But if I were routine publishing 10 or 20 papers a year, I fancy I’d have plenty of expendable graduate students to fix the footnotes.

Well, yes and no. For light use, there’s a ton you can do with linear notation: KMnO4 or CH3COOH Cs137. I’m actually surprised we haven’t gone further in this direction over the past 25 years! On the other hand, there’s stuff like tensors that’s surprisingly tricky to typeset.

Does MathML have traction ? Is there something else?

If you’re looking to do this for calling out Chicago style footnote the answer is yes! I do this every day all day. Likewise, if you’re using pandoc to introduce your citations and references, I’ve found the secret is to do this in a two-step process. You first have tinderbox produce a draft of your entire document, you then have tinderbox export out the consolidated draft and process that. This gives you one long document. The alternative is to have Tidnerbox produce chapters for each of your documents and then process those (I do this for my textbooks). In your TBX template, you have Tinderbox introduce the tags as you toggle between Chicago styling and apa styling formatting when you produce your draft, that way you don’t muddy up the text. You do this by transforming the reference anchor tag on the flow. I’ve spent months streamlining this.

I’d be happy to hop on a private zoom call to show you this process, I’m not ready to make it public.

Yes, that’s generally fine. I guess I am happy enough with pandoc/TeX for all the fancy academic formatting/footnote/citation needs, but just having something where it’s not necessary to have wayward <sup> and <sub> tags would be nice. Seems like parsing the rtf to get those and adding to html wouldn’t be too bad (or perhaps I am mistaken)?

The tedium of having to write html code for frequently used superscripts or subscripts can be alleviated with a text expander program and the text will show up nicely in the preview pane. For example, if I have a text expander snippet O2 that puts in the code to produce O₂, then typing CO₂ will just automatically display the 2 as a subscript, as it did here as I typed. That strategy can can be used for all sorts of superscript or subscript coding.

However, I’ll guess that genetic coding of mutations is not something that frequently repeats. If that’s the case, then automating superscript code with a text expander app would not be helpful.

Hi Michael,

I don’t know if you replied to me – I don’t need footnotes, but I do use Pandoc (though not for references).

If you replied to me, thank you very much for the generous offer – very gracious of you – but as mentioned I don’t use footnotes.

Tinderbox has quite a few features I wish I could leverage when writing manuscripts, grants, and other long academic/scientific documents, but for me the ability to export superscripts is a priority. Too bad, but I’ll continue to use Tinderbox for other purposes.

Thanks again.

Best regards,
Enrico

You’re right, of course — I use KM for a number of other repetitive actions — so thank you for the suggestion. But as mentioned, mutant alleles and protein variants are mentioned very often in our MSs, enough that the html tags become distracting for me. Plus, as mentioned, I’m one of those who love rich text. I realize I may be one of the few, so I’ll continue writing MSs and other documents the way I’ve been doing it, but I thought asking in this venue wouldn’t harm. Thanks again for the suggestion.

Best regards,
Enrico

Mark, I agree that it is about an afternoon’s work to transfer the footnotes by hand. And if it were c. 6 papers a year that is tolerable. (For some countries, for some disciplines, there is no tradition of RAs or PGs to do this donkey work for us.) That supposes that it needs to be done once per paper. The process of sharing drafts, preparing versions for talks, etc. requires that this be done more than once per paper. It is the repeating of low-value work that is irksome.

What I am seeking is the ability to keep my “source” in Tinderbox until the absolutely final version (that version after which I will revise no more). In the meantime, I’d like to be able to export on a regular basis.

When I author a paper in Ulysses, this is straightforward, but Ulysses lacks the affordances that makes Tinderbox an intellectual workspace. Also, Ulysses is Markdown-based. I could obviously create texts using Markdown in Tinderbox, but the footnote functionality does not interconnect with Tinderbox’s linked notes. It is also true that for some projects I like the fact that Tinderbox supports styled text.

I note that Tinderbox supports .doc Word export functionality. Would an export based on the .docx format help with exporting footnotes?

My sense that almost all the pieces are in Tinderbox to permit creating an export template that would give user’s considerable power in simulating or exporting footnotes. The key is some ability to get a hold of text-based links. Some ideas: a) perhaps a data structure could be made available for each $Text that allowed iterating over the text-based links from it, each with the the run of linked text, and the link-type, and the id or similar of the linked note–this would facilitate an export template; b) perhaps add native support to the styled text implementation for embedding a footnote that is a linked note, then i) the built-in export tools could make use of it, ii) there could be a flag/field for how to represent the footnote in copy operations (e.g. no representation, “fn”, etc., and another, iii) for use by export templates.

Anyway, those are a few meagre efforts to persuade you.

(I appreciate that I’ve semi-hijacked a discussion of superscripts in pursuit of footnotes. I hope no one minds too much.)

Commenting on the angle of footnotes, it’s often overlooked that Tinderbox has a footnote mechanism (also see here). The selected text for the link could be a footnote marker symbol rather than actual $Text.

The challenge in exporting footnotes is where they end up in the export, how they are marked (at source) and if the footnotes can have link back to source. The latter is moot in real page notes (as you are already on the right page) but often overlooked in endnotes with only a pointer to a page range being offered.

In Tinderbox even if the foot/endnote marker style (number letter) is known, numbering in sequence across numerous notes is not easy (possible?). not the order of note in the outline and text within a note may change between a footnote being first created and it being exported/printed.

Whilst I don’t think HTML-exporting super-/sub-script text with <sup> or <sub> tags moves the needle on exporting footnotes, I do think it is a useful completion of exporting from RTF source rather than from plain text (where such text styling is not supported).

On footnotes again, if you need style footnotes, @satikusala’s methods hold good, albeit at the stylistic cost of having to use Markdown & pandoc. Markdown is essentially a plaintext markup system. So if you like writing in true RTF it’s less helpful and any superscript styling of footnote markers is done in pandoc not Tinderbox. In short, if you like to write/read RTF with no Markdown or inline HTML, that method worn’t help. In fairness though, Tinderbox is a noting tool not a word processor, so exportable footnotes is note something I’d see as core functionality.

Yes, it can…my problem with this strategy however is that it pollutes the pure text, it mixes content with structure and appearance. I prefer to keep content as pure as possible so as to optimize reusability and repurposability. So, I keep the anchors in the text and purse as possible and only perform the transformations in templates.

@enricoscarpella, I was not simply referring to footnotes or references. introducing a superscript pattern can EASILY be done in templates. At this point, I think a quite zoom call could get us there VERY quickly. DM me an let’s setup a call.

Thank you for your generous offer, Michael. I’ll message you privately.

Best regards,
Enrico

1 Like

Good point on separating content and formatting! It prompted me to look at your videos on exporting using templates.

Meanwhile, an aspect of text expansion which I didn’t mention before is that most (not all) characters have ascii superscript and subscript variants. Text expansions using those ascii characters show up nicely in the text pane and export without having to set up Tinderbox automations.

But, it sounds like what Enrico wants can best be accomplished with the template/anchor approach you are suggesting.