Felix S
Felix S

Reputation: 1819

Textmate 2 scope: Increase font size for section in latex document

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?

Upvotes: 3

Views: 1330

Answers (1)

Jonathan Komar
Jonathan Komar

Reputation: 3086

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.

Upvotes: 2

Related Questions