Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Now that TextMate 2 has gone open-source, I have a reason to move from TeXShop to TextMate 2.

There is a great feature in the markdown bundle (markdown.tmbundle), which makes the headings in code look like:

Textmate 2: Markdown Header

The very same thing in using the latex bundle (latex.tmbundle) results in:

Textmate 2: Latex Header (Section)

Question: How can I implement the larger text size (perhaps even colors) in code for sections/subsections/subsubsections in the latex bundle?

The original question was posted on stackoverflow, where I have even put a bounty on it to no avail. Perhaps the community here will be more helpful.

share|improve this question
1  
Did you ask the question here: github.com/textmate/textmate/issues –  Marco Daniel Feb 17 '13 at 10:56
1  
No, because this is not an issue with the program that needs fixing. It is merely an extension of the latex bundle, which already exists. Thanks for tip though. –  macmadness86 Feb 17 '13 at 12:00
    
Update: I asked the question there and it was denied for the reason I expected. It is not a problem with the program. –  macmadness86 Feb 22 '13 at 16:50
    
Thanks for the feedback. I am interested in a solution, too. –  Marco Daniel Feb 22 '13 at 16:59
    
It makes sense why it would be rejected from the main textmate github issues section, but why they didn't refer you to: github.com/textmate/latex.tmbundle/issues is beyond me. I can open up an issue over there if you wish. –  Bret Feb 25 '13 at 20:05

1 Answer 1

up vote 6 down vote accepted
+200

The procedure to change the appearance of section in Texmate 2 is the following:

In the Bundle editor menu, select Edit bundles ....

Then select the bundle Themes.

From menu File, select New, and when prompted select Setting

Give a name to the setting.

In the Scope Selector field use meta.function.section.latex

Then you can edit the setting, for example:

{   
    fontName = 'Courier';
    fontSize = 36;
}

Then save (in the usual way, e.g, command-s).

You can repeat for other sectioning command (to identify the scope, move the cursor on the appropriate place and then use the following key combination control-shift-P)


Update: There was a feature request to give the different kinds of section tags unique tags so that be given different sizes. The scopes are now:

  • meta.function.section.section.latex
  • meta.function.section.subsection.latex
  • meta.function.section.subsubsection.latex
  • meta.function.section.chapter.latex
  • meta.function.section.part.latex
  • meta.function.section.addpart.latex
  • meta.function.section.addchap.latex
  • meta.function.section.addsec.latex
  • meta.function.section.minisec.latex

You can create multiple setting items to target different items, if you want multiple scopes to share the same size you can separate the scopes with a comma in the scope field.

The user that requested this feature has created a bundle that does this.

enter image description here

share|improve this answer
    
Absolutely wonderful! I would not have figured that out as I was looking in the Latex bundle and trying to customize it that way. All attempts have failed. I assume this same functionality can be mimicked in Sublime Text 2. –  macmadness86 Feb 26 '13 at 23:12
    
I'm not sure that the function is available in Sublime Text 2. It may be worth to request such a feature. –  Guido Feb 27 '13 at 0:16
    
pushing control-shift-p in sublime text 2 reveals the scope as meta.function.section.latex (same). I just need to apply formatting to it properly. –  macmadness86 Feb 27 '13 at 2:15
    
Just to followup, Greg from stackoverflow.com/questions/14136024/… says it is not possible with Sublime Text 2, because there is no setting for fontSize, just the ability to set bold, italic, or background color (and perhaps others, excluding size). It looks like I will stick with Textmate 2! –  macmadness86 Feb 27 '13 at 11:09
    
I just noticed these extra scopes and will update the bundle accordingly. –  Bret Aug 25 at 20:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.