3

Q: When editing a .tex file in Textmate 2: How can you print latex sections in a bigger font size?

I added following grammar to the Latex bundle:

{   patterns = (
    {   begin = 'section\{';
        end = '\}';
        name = 'markup.heading.1.latex';
    },
);
}

And additionally I added following Setting that is applied to the newly defined markup.heading.1.latex scope:

{   fontName = 'Baskerville';
fontSize = '2.25em';
}

The problem: it only matches sections without a leading :

enter image description here

... and when I change the scope definition to the following (adding \\ in front of "section"):

{   patterns = (
    {   begin = '\\section\{';
        end = '\}';
        name = 'markup.heading.1.latex';
    },
);
}

.. the scope is not applied.

Any ideas?

Felix S
  • 1,769
  • 2
  • 13
  • 17
  • I asked a similar question on tex.stackexchange due to the lack of response here: http://tex.stackexchange.com/questions/98574/textmate-2-how-can-increase-font-size-of-sections-in-the-markup-code – Jonathan Komar Feb 17 '13 at 10:40

1 Answers1

2

The answer to your question is to edit the theme bundle.

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)

answer taken from here Please give the original author credit.

Community
  • 1
  • 1
Jonathan Komar
  • 2,678
  • 4
  • 32
  • 43