[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] Italicizing user macros
From: |
Arash Esbati |
Subject: |
Re: [AUCTeX] Italicizing user macros |
Date: |
Wed, 27 Jul 2016 14:51:04 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 |
Ognjen Maric <address@hidden> writes:
> I'd like AUCTeX to render a particular macro I define (called inldef) the
> same way that it renders \emph. Looking through the documentation, I tried:
>
> (setq font-latex-match-italic-command-keywords '(("inldef" "{")))
>
> But this doesn't seem to affect the rendering (both the macro name and the
> argument are rendered as for any other user macro).
>
> My macro is defined simply as:
>
> \newcommand{\inldef}{\emph}
>
> This doesn't change anything either:
>
> \newcommand{\inldef}[1]{\emph{#1}}
AUCTeX can parse defintions and add them to completion list, but
automatic catering for fontification is not possible.
You can tell font-latex about your macro with a file local variable:
--8<---------------cut here---------------start------------->8---
\documentclass[10pt,a4paper]{article}
\begin{document}
\inldef{Test}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% eval: (font-latex-add-keywords '(("inldef" "{" )) 'italic-command)
%%% End:
--8<---------------cut here---------------end--------------->8---
Best, Arash