Tinderbox and LaTeX

Interesting, but the core use case is someone writing in normal (‘rich’) styled text and Tinderbox inserting LaTeX macros for bold/italics, etc. So are Markdown-like things an advantage— unless one knows these already, else there are now two things to learn in order to get TeX text.

It certainly might be useful to make up a general rubric to Tinderbox+Org mode for TeX, though it would service a different use case to the one at hand. The disadvantaged group we are trying to assist are those with no or little LaTeX expertise who are being required to submit copy/manuscript to a LaTeX process. IOW, write ‘normally’ in Tinderbox but emit TeX (or copy it from the Text:export pane.

Thanks, Mark. Sorry, I wasn’t clear. Mapping Tinderbox rich styled text, including heading/outline structure, to LaTeX seems like a straightforward starting point for requirements in what to do. I wasn’t suggested that Markdown or Org markup be any part of that (although, obviously, handling Markdown that’s already in your Tinderbox notes would make sense, and also seems straightforward.

I’m suggesting that the facilities that Org provides for LaTex are examples of what seems to matter to a large number of people using it for writing documents that get turned into PDFs by LaTeX. So it’s a good place to see what things might be on the todo list. They don’t need to use Org syntax, or duplicate it. But if Tinderbox had roughly equivalent functionality for LaTeX export, in a Tinderbox-like way, that might be sufficient.

And if this isn’t helpful, ignore it! :slightly_smiling_face:

3 Likes

Not at all! Far from it, as I’m sure there will we others who may be doing similar to you. So it’s al useful. The fun is figuring out where/how to document it for them.

Thanks

Chiming in to say I use LaTeX regularly for all sorts of writing, from manuscripts to recommendation letters, making assignments, and sometimes for slides. I either write it directly (in TeXShop or emacs or VS Code), or export from org-mode, or from rmarkdown/quarto. MacTeX is very easy to install, although it is many GB large. Would love for LaTeX export to be smoother for TBX. Would increase its use for me for scholarly writing. I agree pandoc is also a good path (html or md to TeX for example), but also having TBX export settings that understand what html can do vs what TeX can do would be helpful.

Maybe also helpful to note: The way quarto/Rmd handle the fact that LaTeX can do much more than md is that you can include raw TeX in with the md and then the md goes to TeX via pandoc and the LaTeX is just passed through. Maybe TBX could do the same – handling just some basic set of common syntax by default and then if people want to be fancy they could add TeX in directly to notes.

That was the approach I used in my demo TBX above; for instance, using \footnote{} to demonstrate insertion of a LaTeX footnote. The same approach has long been used in Tinderbox by those writing for primary use in HTML by adding inline HTML that cannot be auto-inserted via the export process.

Attribute settings can be set dynamically. In my quick demo, I used a prototype to change HTML Export group values from HTML code to LaTeX code. I could as easily used action code or simply set the doc level defaults to LaTeX values. Thus perhaps the point for consideration here is are there any commonly used/needed LaTeX macros that occur in $Text that aren’t handled by (re-valuing) HTML export attributes.

One aspect of LaTeX writing not covered is citation anchor (\cite{}) insertion and attendant citekey lookup. Most TeX writing environments will—if the document asserts a bib file (or has inline BibTeX)—allow auto-listing/auto-complete of the BIB file’s contents. This may be done via Reference Managers (but not all people have/use those) but inclusion of a note holding BibTeX data might allow this:

The above is from Overleaf, but only as I have a doc open as I write, but my main LaTeX writing app ‘texstudio’ (https://texstudio.org) does the same and I’m sure others such do also. The numeric citekeys above are less helpful as an illustration than something like bernstein:2025:infocity , but the citekeys shown are just what are in the document at hand!

But as much LaTeX writing is probably academic or research and so citation are likely, dealing with this issue add time of writing seems useful, though how many might use these (i.e. ROI) I can’t guess.

Thanks @mwra – the intersection of inline citations with the Zotero/BibTeX features currently being added (and existing Bookends integration) would be quite interesting.

My thought was largely in line with yours (using existing export machinery), but maybe the activation energy could be lowered just a tad with something like a document-level preference to export to TeX instead of html, and then the various export group values could be changed automagically. People who want to use TeX for writing likely already have TeX installed, so Tinderbox’s job would just be to produce the .tex file, not to render it or handle all of the extra things associated with that.

1 Like

FWIW, a quasi-doc level preference can be achieved now, by adding a built-in (‘LaTeX’) prototype and two built-in templates (‘LaTeX document’ and ‘LaTeX’ text). That only requires adding the source data for those ‘notes’ into the app and adding a few menu items. Either the prototype or the template can set attributes like the export file extension and other non-HTML specific export features.

Having taken a deep dive into citation methods and formats it turns out there are not real unifying standards beyond the notion of a citation anchor and a style-text reference to which the former may have an N-to-1 links. Citation practice is mired in the Printocene era and digitally native text has to bend to practices born in a different era of text use. Those who say “there is no problem” turn out generally work in a closed/limited domain so simply never face formatting choices and thus assume standards where none exist.

What, in a post paper era, does ‘print to’ mean? If I export 10 notes in, for instance, as (La)TeX do I want 10 files that are complete TeX documents? Likely no. Indeed, better to copy paste per note TeX into the eventual TeX writing/production tool.

LaTeX is interesting too in a context of citation, as in-$Text citations need to be \cite{citekey} slugs not author-year or such, and the the reference list is needed ideally as a single BibTeX (TeX format) text. For number-based citation, as is common in the Sciences, the number of a given citation can only be assessed/inserted through multiple iterations of the source (find all cites, gather used references, sort into [publisher-style-assigned] order, then use reference sequence number to replace the in-$Text stub. That might be a bit much for Tinderbox to have to manage, but if LaTeX is the target output then a ‘scan’ then cite insertions need to be \cite{citekey} and not [Author Year, UI]. Of course that isn’t useful for non-LateX use.

Footnote-based citations, i.e. where all citations are made as foot-/chapter-/end-notes, are potentially problematic if the narrative uses multiple Tinderbox notes as where to the footnotes go? I each note, in a separate note and if so are thy sorted or simply appended. The latter matters as few people tend to care about the fit/finish of reference info as long as the editors or peer reviewers don’t complain. Of course as consumers of references were care rather more about clarity /correctness. The general vibe is everyone hoping ‘someone else’ is doing the heavy lift but that id rarely the case.

So my 2¢ suggestion here is the prototype+template based approach stated at opening can work for $Text to TeX but LaTeX citation support within Tinderbox might get more complex. I think that aligns with your note:

Thus, each exporting note generating a ‘bare’ .tex TeX file, and the assumption being that all citation work would be done outside Tinderbox

I truly have been reading up on all this. There are c.15 books on citation and copy-editing at my elbow and a plethora of web resources and TeX editiors … none with a clear answer. :frowning:

I’m not sure if this has helped any!

A wrinkle for those using Bookends as their reference manager and if mainly/only using LaTeX for their papers is to do the following in Bookends settings:

  • Select the BibTeX tab of Settings
  • Tick the Enable BibTeX for references and “Copy Citation” copies Citekey field boxes.
  • In the later use \cite in the Precede with: box.
  • Select the Scan & Bib tab of Settings.
  • For Temporary citations select {} option

Now in Bookends menu EditCopy Citation (⌘+Y), will load the selected reference’s citekey to the clipboard, e.g. \cite{bernstein:2025:infocity} which can be pasted into your Tinderbox note $Text as the citation point.

As Bookends’s formatted bibliography/reference list is generated for the ‘Hits’ query, it is a good idea to make a ‘static group’ for references you are using. Then tick all items in that group, the ticked items being what are regarded as ‘hits’. When the final list is needed, use Bookends menu BiblioBibliography… to generate the .bib file for your LaTeX project.

1 Like