Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lstset #11

Merged
merged 1 commit into from
Apr 27, 2020
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
5 changes: 5 additions & 0 deletions examples/example.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <stdio.h>

int main(void) {
printf("Hello World\n");
}
2 changes: 2 additions & 0 deletions examples/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ <h1 id="マークダウン記法"><span class="header-section-number">7</span>
<a class="sourceLine" id="cb1-3" title="3"><span class="dt">int</span> main(<span class="dt">void</span>) {</a>
<a class="sourceLine" id="cb1-4" title="4"> printf(<span class="st">&quot;Hello World</span><span class="sc">\n</span><span class="st">&quot;</span>);</a>
<a class="sourceLine" id="cb1-5" title="5">}</a></code></pre></div>
<p>listingsパッケージ</p>

<section class="footnotes" role="doc-endnotes">
<hr />
<ol>
Expand Down
5 changes: 5 additions & 0 deletions examples/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,8 @@ int main(void) {
printf("Hello World\n");
}
```


listingsパッケージ

\lstinputlisting[language=c, caption = ソースコード ,label = source]{example.c}
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,
}

4 changes: 2 additions & 2 deletions scripts/mdtopdf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
str=$1
pandoc -s -N ${str%.*}.md -o ${str%.*}.pdf -V documentclass=ltjarticle --pdf-engine=lualatex \
-F pandoc-crossref \
-F pandoc-crossref \
-M "crossrefYaml=/config/crossref_config.yaml" \
-V geometry:margin=1in
-V geometry:margin=1in -H /config/listings-setup.tex
2 changes: 1 addition & 1 deletion scripts/mdtotex
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ 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 -H /config/listings-setup.tex