Search code examples
emacslatex

How to create an inline latex block in emacs (like \emph{...})


This SO question here asks for an emacs shortcut for creating a latex block, and one solution (proposed by me, but just coming from the emacs documentation) is to use C-c C-t.

Is there something similar that would create an 'inline' block without creating any new lines, like for turning

blah blah Hello World blah blah

into

blah blah \emph{Hello World} blah blah

for example?


Solution

  • Here's what I do. With cursor before the "Hello World" I type: \emph C-M-SPC C-M-SPC {

    The closing brace is inserted together with the opening brace, because I use electric-pair-mode.

    You might be able to use completion to speed up typing the \emph, tho it's sufficiently short that it's probably not work the trouble.