Skip to content

Instantly share code, notes, and snippets.

@Teino1978-Corp
Forked from michaelgruenewald/gist:1584374
Created November 1, 2015 23:16
Show Gist options
  • Save Teino1978-Corp/a191eccf883fd2ade0f6 to your computer and use it in GitHub Desktop.
Save Teino1978-Corp/a191eccf883fd2ade0f6 to your computer and use it in GitHub Desktop.
LaTeX emphasize shortcut
% Use /important/ for emphasized text and // for a single slash.
\makeatletter
\newtoggle{inSlashEmph}
\togglefalse{inSlashEmph}
\let\emphslash=/
\catcode`\/=\active
\protected\def/{%
\@ifnextchar/{\emphslash\@gobble}{%
\iftoggle{inSlashEmph}{%
\global\togglefalse{inSlashEmph}%
\egroup\xspace%
}{%
\global\toggletrue{inSlashEmph}%
\bgroup\em%
}%
}%
}
%\protected\def/{\@ifnextchar/{\emphslash\@gobble}{\startStopEmph}}
\makeatother
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment