Created
January 9, 2012 19:01
-
-
Save michaelgruenewald/1584374 to your computer and use it in GitHub Desktop.
LaTeX emphasize shortcut
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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