Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Questions and Answers >> How are the Templates used during exporting?
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1460312897

Message started by Desalegn on Apr 10th, 2016, 2:28pm

Title: How are the Templates used during exporting?
Post by Desalegn on Apr 10th, 2016, 2:28pm

I tried to read in this blog and website. The basics are barely explained.
So, I have to send this paper to the professor. I have to clean it up in Latex.

I have filled up the HTML template as explained in the website.





But, I don't know how TB uses the template during the exporting. I tried all the available options: "Export selected notes" is what I actually want. What I get at the output is "Unable to find this template"

Can sb tell me what mistake I made?

Export & Template are not even mentioned in the "getting started..." document.

Title: Re: How are the Templates used during exporting?
Post by Mark Bernstein on Apr 10th, 2016, 4:06pm

There's a big chapter on Export in Tinderbox Help.

But I sense that you may have a looming deadline, and that the export is likely to be an undemanding and one-time event. In that case, you might be better off using File ▸ Export Text to RTF, and then using whatever LaTeX tool you prefer to convert it to LaTeX.

<hr>

For your question, you want to change the export attribute (such as HTMLParagraphStart) for the exported notes (or for their prototype, rather than for the template.  

Title: Re: How are the Templates used during exporting?
Post by Desalegn on Apr 10th, 2016, 4:27pm

Aha, that is where I am lost. Now, I now assigned the "Template" as a prototype. I get the extension right (.tex), and all the attributes are assigned to the actual notes.  But, the exported file is still  empty. it contains only ""Unable to find this template"

Title: Re: How are the Templates used during exporting?
Post by Mark Anderson on Apr 10th, 2016, 4:50pm

Export selected notes is designed to be used with template based access. If you've not tested export and your deadline looms, I suggest you use export to RTF and ignore the exported files you don't need. Deadline first, clean-up and lessons learned after.

I note from your screen grab that you're trying to export to LaTex and the website you refer to is aTbRef. LaTeX is not a native export format for Tinderbox. The example I wrote in aTbRef was to help an experienced LaTeX user generate output via 'HTML' export by substituting LaTeX markup for the default HTML. The aTbRef article doesn't purport to be a step-by-step tutorial on how to use LaTeX. Thus, as already suggested, this close to a deadline RTF is your best bet and then you can finish in an RTF-capable editor of your choice.

More generally, on formatted export. No note in a v6 [sic] document has an export template until at least one valid template note is selected. You can have one or more template notes. Either add a build-in template via the File menu or set an existing note as a template via the Properties Inspector. As well as being a template note, the the template must contain appropriate export code. Thus for a novice, I'd suggest using built-in template so you understand how export works and how you configure the process for your needs. I'd suggest trying an alternate export mark-up like LaTeX only once you're happy you know how to export default formatted text.

Once you have a LaTeX formatted template you know works, set the selected note you wish to export to use that template. This is most easily done via the HTML Inspector. Then, 'export selected note should work as desired. If you expect the selected note to export content from its children/descendants, you will need to add relevant code in your export template (use the built-in 'HTML page' template as a learning example.

Title: Re: How are the Templates used during exporting?
Post by Mark Bernstein on Apr 10th, 2016, 4:52pm

The $HTMLExportTemplate for the exported notes needs to be set; one typically does this in the HTML Inspector, which has a nice pull-down menu of templates.

Title: Re: How are the Templates used during exporting?
Post by Desalegn on Apr 10th, 2016, 6:47pm

Thank you guys. I submitted the document by converting via RTF as you suggested.


Also, I understood my original problem: I was using the Template both as template and as prototype. There are still a certain issues with the export.

I created a Test Note which contains the following $Text as a sample:



the template contains the following:


Code:
documentclass{article}
title{^title^}

begin{document}
\maketitle
^text^
end{document}



So, I am expecting the following kind of Latex document:


Code:
documentclass{article}
title{Test Note}

begin{document}
\maketitle

\textbf{\Large The test file contains some bigger note}}
The formatting could be \textit{italics}, or \textbf{bold}. \\

So, this is note is going to be exported too:\\
\begin{itemize}
     \item lists
     \item like
     \item this
\end{itemize}

\begin{enumerate}\\
     \item first
     \item second
     \item third
     \item fourth
\end{enumerate}


What I am actually getting after using the above template is:  

Code:

documentclass{article}
title{Test Note}

begin{document}
\maketitle
<h3>\textbf{The test file contains some bigger note}</h3>
The formatting could be \textit{italics}, or \textbf{bold}.\\


So, this is note is going to be exported too:\\
     -      lists
     -      like
     -      this

And ordered numbers like:\\
     1      first
     2      second
     3      third
     4      fourth

end{document}



The numerations, lists and headings are not recognized even if I assigned these attributes as shown in Mark Anderson's file.
Here is the file https://www.dropbox.com/s/hm1kre0sj33ome9/LatexExport.tbx?dl=0if you want to look at.

Title: Re: How are the Templates used during exporting?
Post by Mark Anderson on Apr 11th, 2016, 4:34am

As the aTbRef page, the LaTeX code for the mark-up (e.g. to denote a bold section) goes in the note itself**. The template tell TB what elements of the current note (and/or other notes) is to go in the exported page to be created. Thus ^text^ in the template says "insert here the processed $Text of the current note". TB does this, using the mark-up stored in the note's $HTML... series of system attributes you can edit this via a UI using either Get Info or the Export Inspector's sub-tabs.

** You've wisely used a prototype here as that means you only need to customise all the HTML-related mark-up attributes once.  Using the pLatex prototype, the ordinary note inherits the LaTeX-valued $HTMLBoldStart, etc.

The <h3> is due to the auto-headings feature (explained here). My understanding is you can't customise that process - or disable ti (without affecting (HTML) export overall. Bottom line - in this scenario, keep all your text the same size and use inline LaTeX to indicate headings.  This is a good example of why I stated that LaTeX isn't a native form of export.

Your bulleted lists don't work for export, because TB doesn't know they are lists. You need to do either of:
  • Use RTF lists, set via Format menu > Text >List…. But, at at v6.5.0, I think this only works for RTF bulleted lists.  Other list item marker types and numbered lists are not detected as such during formatted (HTML) export.
  • Use Tinderbox list mark-up.
    • Starting a paragraph with an asterisk (*) tells TB to render that paragraph (and contiguous ones with the same start) as an unordered list (HTML bulleted list).
    • Using a hash symbol (#) to start paragraphs tell Tinderbox to make an ordered (numbered list).
Using the first method I can get the LaTeX mark-up for  only a bulleted list. Using the second method, I can get LaTeX bulleted and numbered list types, so I'd suggest using the latter and avoid RTF-style lists for now. The notes from your TBX, as amended for my test, look like this:

Code:
So, this is note is going to be exported too:
*lists
*like
*this
And ordered numbers like:
#first
#second
#third
#fourth

It is up to you whether you put any space after the asterisk or bullet (or before/after the first list item - it doesn't affect the creation of list output, just the ouptut white space.

I've also updated the aTbRef page to clarify a few of these points.

Title: Re: How are the Templates used during exporting?
Post by Desalegn on Apr 11th, 2016, 4:54am

That is interesting. I didn't know that TB treats the stars as lists; and the Hash as ordered numbers. That is almost Markdown. ::)---both worries and possibilities strike me here--- :P

And, one more correction  once you are in that page, replace start with begin. The native Latex doesn't seem to  understands Start.

Thank you Mark. That was helpful

Title: Re: How are the Templates used during exporting?
Post by Mark Anderson on Apr 11th, 2016, 6:00am

I was using 'begin' in the general sense of the work and not as a LaTeX command. However, I've revised the aTbRef page "Working with LaTeX" even further to hopefully make things more clear.

I've also made it plain that this isn't a built-in feature but rather a an opportunity arising from the HTML Export customisation features.  As such, a number of features, e.g. link and auto-heading mark-up, are beyond the users control. Thus such features should be avoided (or no LaTeX output expected from them).

Additions to the article are welcome, but please note aTbRef is not - by intent** - a 'how-to' tutorial. The aim here is to describe necessary setting changes to achieve LaTeX output. Use of LaTeX seems to have a useful public forum at http://tex.stackexchange.com.

** The resource is already large and takes care to maintain without breaking. Expanding to 'how-to's is best left for a separate resource.

~~~~~~~
As a sidenote, it's worth noting that Tinderbox's use of 'quicklist' markup pre-dates Gruber's MarkDown by a few years. Markdown is not supported within $Text, though it is a feature that has been requested (for HTML output, though by the means discussed here it might go to other formats/mark-up). A bigger implementation issue is opening up the mark-up for links and images as without this such support is limited in what it can do. IOW, the harder part of any such implementation is less obvious to the user.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.