Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN wget https://github.com/jgm/pandoc/releases/download/2.7.2/pandoc-2.7.2-1-am

COPY scripts/ /usr/local/bin/
COPY crossref_config.yaml /config/crossref_config.yaml
COPY listings-setup.tex /config/listings-setup.tex

VOLUME /workdir
WORKDIR /workdir
4 changes: 2 additions & 2 deletions examples/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ PDFに変換できるマークダウンの記法を学ぶ。

### インライン数式

インライン数式はドル記号`$`で囲って、 $V = R \times I$のようにTeXと同じ書き方で書くことができる。
インライン数式はドル記号\$で囲って、$V = R \times I$のようにTeXと同じ書き方で書くことができる。

### 番号付きディスプレイ数式モード

数式ブロックはドル記号2つ`$$`で囲む。`{#eq:equation}`を最後につけることでラベルを貼れる。
数式ブロックはドル記号2つ \$\$で囲む。`{#eq:equation}`を最後につけることでラベルを貼れる。
参照は`[@eq:equation]`のように書くことができる。

不純物濃度の深さ方向分布は[@eq:equation]の拡散方程式を解くことで得られる。
Expand Down
Binary file modified examples/example.pdf
Binary file not shown.
29 changes: 29 additions & 0 deletions listings-setup.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
\usepackage{listings}
\usepackage{xcolor}

\lstset{
basicstyle=\ttfamily,
keywordstyle=\color[RGB]{33,74,135}\bfseries,
stringstyle=\color[RGB]{79,153,5},
commentstyle=\color[RGB]{143,89,2}\itshape,
numberstyle=\footnotesize,
numbers=left,
stepnumber=1,
numbersep=15pt,
backgroundcolor=\color[RGB]{251,251,251},
frame=single,
frameround=ffff,
framesep=5pt,
rulecolor=\color[RGB]{148,150,152},
breaklines=true,
breakautoindent=true,
breakatwhitespace=true,
breakindent=25pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
captionpos=b,
linewidth=\textwidth,
}

13 changes: 9 additions & 4 deletions scripts/mdtopdf
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
str=$1
pandoc -s -N ${str%.*}.md -o ${str%.*}.pdf -V documentclass=ltjarticle --pdf-engine=lualatex \
-F pandoc-crossref \
-M "crossrefYaml=/config/crossref_config.yaml" \
-V geometry:margin=1in
mdtotex $str
sed -i -e 's/\\passthrough{\\lstinline\!\([^!]*\)\!}/\\texttt{\1}/g' \
-e 's/\\passthrough{\\lstinline"\([^"]*\)"}/\\texttt{\1}/g' \
-e 's/\\passthrough{\\lstinline'"'"'\([^'"'"']*\)'"'"'}/\\texttt{\1}/g' \
-e 's/\\passthrough{\\lstinline\*\([^*]*\)\*}/\\texttt{\1}/g' \
-e 's/\\passthrough{\\lstinline,\([^,]*\),}/\\texttt{\1}/g' \
${str%.*}.tex
lualatex ${str%.*}.tex > /dev/null
rm ${str%.*}.aux ${str%.*}.log ${str%.*}.tex
3 changes: 2 additions & 1 deletion scripts/mdtotex
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ str=$1
pandoc -s -N ${str%.*}.md -o ${str%.*}.tex -V documentclass=ltjarticle --pdf-engine=lualatex \
-F pandoc-crossref \
-M "crossrefYaml=/config/crossref_config.yaml" \
-V geometry:margin=1in
-V geometry:margin=1in \
--listings -H /config/listings-setup.tex