Skip to content

Instantly share code, notes, and snippets.

@ajchemist
Created November 18, 2013 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajchemist/7529055 to your computer and use it in GitHub Desktop.
Save ajchemist/7529055 to your computer and use it in GitHub Desktop.
\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}
@ajchemist
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment