Tinderbox v10 Icon

Working with LaTeX

Working with LaTeX

Tinderbox can export, via custom templates and HTML Export, data that includes LaTeX mark-up. The limitations discussed below reflect the fact that alternate mark-up types are a by-product of the export design rather than a deliberate feature. Tinderbox does not claim, as a standard feature, to export LaTeX.

Obtaining LaTeX output involves consideration of the template used and per-note attribute values:

  • Template. This tells Tinderbox what data from the current note (or other transcluded notes) to place into the exported file. It is thus a good place to put LaTeX code such as that needed to mark the beginning or end of a file. Exactly what then gets output from ^title^ and ^text^, etc., is controlled at note level.
  • Note-level attributes. By default, when exporting marked-up data, HTML is the presumed mark-up type. To use an alternate mark-up, many note-level system attributes from the HTML group need customisation, as listed below, to generate LaTeX output. It is important to note that not all HTML export features can be customised for LaTeX use.

Given the number of attributes that may require customisation, it may prove useful to employ prototypes to set up for this process. Thus, just as HTML and LaTeX export templates can be swapped over with ease, so too can LaTeX mark-up customisations be swapped by setting a prototype and letting the customisations inherit to the note(s).

Tinderbox's ^text^ export operator can manage the following $Text features as LaTeX mark-up

  • bold
  • italic
  • underline
  • strikethrough
  • paragraphs (all except 'first paragraph', as explained below)
  • indented paragraph (blockquote)
  • lists: unordered (bulleted) and ordered (numbered) quicklists

But, do be aware that some $Text features are not suitable for LaTeX export. This is because the user does not have full control of the mark-up generation for some features:

  • links, both internal and web links
  • font size ▸ heading mapping (you cannot control this even for HTML)
  • inline images.
  • other RTF-like styling such as inline font changes, text colour, highlighting, sub/superscript are completely ignored for HTML/formatted mark-up export purposes.

Do not be tempted to turn off $HTMLMarkup as that then disables all $Text mark-up generation.

^text^ auto-markup you can re-set for LaTeX use

LaTeX coding for Underline & Strikethrough require presence of the non-default 'normalelem' package and header declaration: \usepackage[normalem]{ulem}. If planning to export underlined or struck-through text, remember to add this declaration in your template(s). Further detail is beyond the scope of aTbRef and should be research in LaTeX documentation.

As the changes below are set in attributes, these need only be altered only for those notes exporting to LaTeX thus allowing it to mix with default HTML export (or other export formats). If the same note may need to export to different format depending on need, it would make sense to set the attribute customisations and switch in the LaTeX values by setting the exporting note(s) to use the prototype and thus inherit its customisations.

Edit the following attributes (the quotes are not part of the code you must enter):

$HTMLBoldStart: "\textbf{"

$HTMLBoldEnd: "}"

$HTMLItalicStart: "\textit{"

$HTMLItalicEnd: "}"

$HTMLUnderlineStart: "\uline{"

$HTMLUnderlineEnd: "}"

$HTMLStrikeStart: "\sout{"

$HTMLStrikeEnd: "}"

$HTMLEntities: false (un-ticked)

$HTMLExportExtension: might best be set to ".tex"

All tags using \begin, \end and \item must include a trailing single space character. The quotes around values listed below are not part of the value and only indicate where extra white space may occur. This affects these attributes:

$HTMLIndentedParagraphStart: "\begin{quote} "

$HTMLIndentedParagraphEnd: "\end{quote} "

$HTMLListStart: "\begin{itemize} "

$HTMLListEnd: "\end{itemize} "

$HTMLOrderedListStart: "\begin{enumerate}

$HTMLOrderedListEnd: "\end{enumerate} "

$HTMLListItemStart: "\item "

Set to no value (remove any existing value): $HTMLListItemEnd, $HTMLImageStart, $HTMLImageEnd.

Paragraphs. Paragraph initial indenting, and first-vs.-subsequent differences is handled in general LaTeX setup (i.e. in the template) so no paragraph start tag is needed. So set to no value: $HTMLParagraphStart, $HTMLFirstParagraphStart. However, $Text should either use line-spaced paragraphs or both $HTMLParagraphEnd and $HTMLFirstParagraphEnd should use an (invisible) line break character as the closing tag. Do not use "\n", but copy the line return from some $Text and paste this invisibly character into the appropriate input boxes. An alternative strategy (but with different effects on LaTeX paragraph spacing is to set end paragraphs tags to "\\", as illustrated.

Tag clouds. The text size chosen is left to the user but these are suggested values:

$HTMLCloud1Start: "{\scriptsize"

$HTMLCloud1End: "}"

$HTMLCloud2Start: "{\normal"

$HTMLCloud2End: "}"

$HTMLCloud3Start: "{\Large"

$HTMLCloud3End: "}"

$HTMLCloud4Start: "{\huge"

$HTMLCloud4End: "}"

$HTMLCloud5Start: "{\Huge"

$HTMLCloud5End: "}"