Created
December 4, 2013 05:16
-
-
Save y-yu/7782707 to your computer and use it in GitHub Desktop.
code inside section
This file contains 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
\makeatletter | |
\def\code{% | |
\@ifnextchar{|}% | |
{\code@sect}% | |
{\code@inline}% | |
} | |
\def\code@inline#1{% | |
\lstinline[style=ocaml, basicstyle=\small\tt, keywordstyle=\small\sl, columns={fullflexible,keepspaces}, mathescape]|#1| } | |
\def\code@sect|#1|{% | |
\lstinline[style=ocaml, basicstyle=\tt, keywordstyle=\sl, columns={fullflexible,keepspaces}, mathescape]|#1| } | |
\makeatother | |
\code{if e1 then e2 else e3} | |
\code|if e1 then e2 else e3| |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment