[TxMt] Scope and Preprocessing for personal Markup

Allan Odgaard throw-away-1 at macromates.com
Fri May 11 08:50:50 UTC 2007


On 6. May 2007, at 07:57, J Fischer wrote:

> [...]
> My bundle is called "jmarkup" and I've set most of the scope  
> selectors to
> "text." (BTW, I still don't competely get how to choose scope  
> selectors,
> despite reading that section many times.)

That’s the scope selectors of your snippets (and commands)? If you  
want it to work in all text documents, that’d be fine, although the  
trailing comma is not needed.

You can also use a scope selector e.g. of: “text.tex,  
text.html.markdown, text.jmarkup” to limit it to onky those 3 scopes.

> I'll probably do most of my writing in Latex or Markdown (or MMD), and
> currently I have to go back and forth between syntax coloring for  
> either
> Latex or jmarkup.
>
> 1)  Can I somehow set my scope so that I can see it colored while  
> I'm in
> Latex and MMD?

If I understand you correctly, you have basically done *extensions*  
to LaTeX, but as its own grammar, thus you switch between having your  
extensions colored, or the “native” LaTeX syntax, is that correct?

> 2) Could someone point me to a place explaining how I could process my
> markup before the latex. E.g. So that when I hit the key combo to  
> preview
> the Latex, everything is preprocessed to replace my [[note  
> syntax ]] with
> Latex markup for left and right margin notes.

While not rocket science, this is not trivial either.

LaTeX works with files on disk, that means, if you want to preprocess  
your files before giving them to pdflatex,but still retain the non- 
preprocessed version (for further editing), you would effectively  
need to either copy your latex files to a temporary build location,  
where you run pdflatex on your master file, or alternatively, backup  
all your latex files, then preprocess them, and restore again after  
having called pdflatex.

With LaTeX, I think it’s better to define new commands in the  
language, than use preprocessing.

> 3) Referring to #2 above, could I have separate processing- 
> replacements set
> up for whether I was making an output for myself (e.g. working  
> draft with
> all notes and markup) or for my advisor (e.g. print draft without  
> notes and
> hiding my in-line styles, like "revise" or "check facts")?

You can, yes. Though I think LaTeX has packages for “drafts”, so it’d  
probably be better to learn that system, than setting up this tool  
chain.

> 4) What would the best bundle be to use as an example of how to  
> gather all
> "action" markups in to a separate document? For example, I might  
> have a fact
> that is suffixed with [!check this!] and I want to gather all lines  
> that
> have that [!...!] in them. I assume this might be similar to the  
> TODO or
> GTDalt bundles but haven't checked them out yet.

Yes, this is effectively what the TODO bundle does. Probably you’d be  
better off with using markup such as: % TODO check this, and simply  
run the Show TODO List action from the TODO bundle (it has a help  
file with details about the markup).






More information about the textmate mailing list