사용자 도구

사이트 도구


pandoc:template

문서의 이전 판입니다!


Pandoc Template

pandoc의 템플릿에 대한 정리.

Format의 기본 뼈대

-s/--standalone 으로 문서를 변환ᅟ할 때 기본 템플릿 보기.

pandoc -D FORMAT
# FORMAT은 html 등이다.

문단

기본적으로 새 줄이 있어도 이어서 보여준다. 새 줄기호 자체는 두 개 이상의 공백(문단 나누기) 혹은 백슬래시 후 새 줄 하나(새 줄 내리기)로 표현.

헤더

settext style

  • Level 1 : =를 아래에 둔 텍스트
    a level one header
    ==================
  • Level 2 : -를 아래에 둔 텍스트
    a level two header
    -------------------

Atx style

  • # 갯수를 1~6개로 조정하여 지정
    # A level one header
    ### a level three header ###
  • Pandoc 마크다운은 헤더 시작시에 바로 직전에 새줄이 있어야 한다.(원래 markdown은 그렇지 않다)
  • 헤더들은 인라인 텍스트 포매핑도 포함할 수 있다.

Identifiers

  • 헤더에는 HTML등의 ID값이 지정된다. 기본으로도 지정됨.
  • 명시적 지정. 아래는 모두 foo로 ID 지정.
    # My header {#foo}
    ## My header ## {#foo}
    My other header {#foo}
    ----------------------
  • 숫안 안 붙이기
    # My Header {-}
    # My header {.unnumbered}
  • 이 ID 들은 --toc|--table-of-contents 옵션 사용시 이용됨.
  • 특정 헤더를 향한 링크
    # My Header {#foo}
    
    go to header [Header title](#foo).
    or go to header [My Header]. <- 헤더 텍스트에 중복에 없을 경우

Block Quotation

  • 인용하기는 이메일 형식을 따른다.
  • 인용 기본
    > 이것은
    > 이용된 것이다.
  • 게으른 인용. 문단 시작 부분만 >
    > 이것은
    인용된 것이여.
    > 이것도
    인용된 것이여.
  • 이중 인용. 한 칸 띄어서 다시 >를 해 준다.
    > 인용이고
    >
    > > 이중 인용이지

Code Block

인덴트된 코드 블럭

  • 4칸 공백 혹은 Tab으로 시작하는 블럭은 자동으로 코드 블럭으로 인식된다.
  • 시작시의 공백은 무시된다.
  • 코드 블럭의 빈 줄도 네칸 인덴트로 시작해야만 한다.

감싸진 코드 블럭

  • ~ 혹은 ` 세 글자 이상으로 감싸진 코드 블럭은 인덴트 없이도 코드 블럭으로 간주된다.
    ~~~
    if (a > 3) {
        moveShiep(5 * gravity, DOWN);
    }
    ~~~
  • 코드 블럭안에서 ~`를 사용할 경우에는 코드 블럭 감싸개를 더 많은 글자로 만들어주면된다.
  • 코드 종류 명시하기 ```haskell 형태로 시작하면 haskell 코드 블럭임을 나타낸다.

라인 블럭

  • |으로 시작하는 줄들은 합쳐서 코드 블럭으로 간주. 내부 공백 유지됨.
    | The limerick...
    | In space
    |    But the good
    |    So seldoc
    | 200 Main st.
    | Berkeley, CA 94718

페이지 나눔

\newpage, \pagebreak는 페이지를 나누는 작용을 한다. 하지만 PDF와 Latex에만 적용된다.

http://tex.stackexchange.com/questions/131562/adding-page-breaks-to-pandoc-latex-template-when-converting-markdown

pandoc –chapters, or pandoc -V documentclass=memoir or pandoc -V documentclass=book will tell pandoc to treat level 1 headers as chapters rather than sections. In both the book and memoir document classes, chapters are preceded by page breaks.
I'm not sure exactly what you need to set in your header to get page breaks before sections. Have you read the documentation for the memoir class? It includes a \setbeforesectionskip{} command that might a place to start.
pandoc/template.1407572175.txt.gz · 마지막으로 수정됨: 2014/08/09 17:16 저자 kwon37xi