LoginSignup
1
1

More than 1 year has passed since last update.

[Markdown]MarkdownのラフさでTeXの見栄えが欲しい

Last updated at Posted at 2022-03-24

目的

ドキュメントの作成をすることになったけどW〇rdは触りたくない
MarkDownの気軽さで見栄えのいいPDFドキュメントを作成したい

環境

OS: Windows 10
Editor: VSCode(任意のもので可)

環境構築

  1. 下記インストール

  2. Pathが通っていることを確認

    C:\texlive\2021\bin\win32
    
  3. ビルド
    template.tex: 既定テンプレートファイル
    input.md: 入力ファイル(Markdown)
    output.pdf: 出力ファイル(pdf)
    使用するファイルはすべてUTF-8である必要があるので注意

    //  テンプレートファイルを生成(出力時は UTF-16 BOM付?)
    > pandoc -D latex > template.tex
    
    //  pdf出力
    > pandoc input.md -o output.pdf --pdf-engine=lualatex --template=template.tex -N -V documentclass=bxjsarticle -V 
    classoption=pandoc
    

    サンプル (' ->` に置換)

    サンプル.md
    md2tex.md
    \begin{titlepage}
        \begin{center}
    
            \vspace*{180truept}
    
            {\huge MarkDown}\\
    
            \vspace{10truept}
    
            {\huge MarkDownのラフさでTeXの見栄えが欲しい}\\
    
            \vspace*{260truept}
    
            {\Large Date: 2022/03/25}\\
    
            \vspace{5truept}
    
            {\Large Author: やまとら。}\\
    
        \end{center}
    \end{titlepage}
    
    # 目的
    ~~ドキュメントの作成をすることになったけどW〇rdは触りたくない~~
    MarkDownの気軽さで見栄えのいいPDFドキュメントを作成したい
    
    # 環境
    OS: Windows 10
    Editor: VSCode(任意のもので可)
    
    # 環境構築
    1. 下記インストール
        - [**Pandoc**](https://github.com/jgm/pandoc/releases/)  
        - [**TeX Live**](https://tug.org/texlive/acquire-netinstall.html)  
    2. path
    3. ビルド
    `template.tex`: 既定テンプレートファイル
    `input.md`: 入力ファイル(Markdown)
    `output.pdf`: 出力ファイル(pdf)
    使用するファイルはすべて`UTF-8`である必要があるので注意
    '''
    //  テンプレートファイルを生成(出力時は UTF-16 BOM付?)
    > pandoc -D latex > template.tex
    '''
    '''
    //  pdf出力
    > pandoc input.md -o output.pdf --pdf-engine=lualatex --template=template.tex -N -V     
    documentclass=bxjsarticle -V classoption=pandoc
    
    ## 目次
    
    ## 番号なし目次 {-}
    
    | KEY  | VALUE  |
    | ---- | ------ |
    | key1 | value1 |
    | key2 | key2   |
    
    詳しい文法等は`参考ページ`を参照のこと
    

image.png

メモ

Markdownをいじる際には基本的にVSCodeでプレビューを開きながら作業するのですが、PowerShellもタブとして追加できるので1つのウィンドウで完結していい感じな気がします
RMarkdownなるものがあるらしいので軽く調べてみる予定

*タイトル通りの軽いモチベーションの為、各コマンドの動作等を完全に理解していません

参考ページ

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1