Created
November 18, 2013 14:53
-
-
Save ajchemist/7529055 to your computer and use it in GitHub Desktop.
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
\documentclass[nanum,amsmath,adjustmath,kosection]{oblivoir} | |
\usepackage{expl3} | |
\usepackage{l3regex} | |
\ExplSyntaxOn | |
\tl_new:N \l_demo_tl | |
\cs_new:Npn \demo #1 { | |
\tl_set:Nn \l_demo_tl {#1} | |
\regex_replace_all:nnN { ==(.*?)== } { \c{subsection}\cB\{ \1 \cE\} } \l_demo_tl | |
\regex_replace_all:nnN { =(.*?)= } { \c{section}\cB\{ \1 \cE\} } \l_demo_tl | |
\regex_replace_all:nnN { \*\*(.*?)\*\* } { \c{textbf}\cB\{ \1 \cE\} } \l_demo_tl | |
\regex_replace_all:nnN { \*(.*?)\* } { \c{emph}\cB\{ \1 \cE\} } \l_demo_tl | |
\tl_use:N \l_demo_tl | |
} | |
\ExplSyntaxOff | |
\begin{document} | |
\demo{ | |
= 마크다운이란 무엇인가? = | |
마크다운이란 것은 **간단한 몇 가지 규약**을 이용하여 풍부한 문서 속성을 가진 출력을 | |
얻어내려는 마크업 규칙이다. | |
== 멀티마크다운이란 무엇인가? == | |
멀티마크다운(*multimarkdown*)은 마크다운을 확장한 것이다. | |
} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
original page: http://doeun.blogspot.kr/2013/11/latex-regexp.html