Skip to content

Commit

Permalink
Added pandoc xnos compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dendrondal committed Nov 23, 2019
1 parent c5466cc commit 3b7c67c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 39 deletions.
21 changes: 3 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ INPUTDIR=$(BASEDIR)/source
OUTPUTDIR=$(BASEDIR)/output
TEMPLATEDIR=$(INPUTDIR)/templates
STYLEDIR=$(BASEDIR)/style
SCRATCHDIR=$(BASEDIR)/scratch

BIBFILE=$(INPUTDIR)/references.bib

Expand Down Expand Up @@ -35,7 +36,7 @@ pdf:
-V fontsize=12pt \
-V papersize=a4paper \
-V documentclass=report \
-N \
--pdf-engine=xelatex \
--verbose

tex:
Expand Down Expand Up @@ -71,21 +72,5 @@ html:
mkdir "$(OUTPUTDIR)/source"
cp -r "$(INPUTDIR)/figures" "$(OUTPUTDIR)/source/figures"

pdf_from_html:
pandoc \
--filter=pandoc-xnos \
"$(INPUTDIR)"/*.md \
-t html \
--standalone \
--template="$(STYLEDIR)/template.html" \
--bibliography="$(BIBFILE)" \
--csl="$(STYLEDIR)/ref_format.csl" \
--include-in-header="$(STYLEDIR)/style.css" \
--toc \
--pdf-engine=wkhtmltopdf \
-o "$(OUTPUTDIR)/thesis.pdf" \
--number-sections
rm -rf "$(OUTPUTDIR)/source"
mkdir "$(OUTPUTDIR)/source"

.PHONY: help pdf docx html tex pdf_from_html
.PHONY: help pdf docx html tex
Binary file modified output/thesis.pdf
Binary file not shown.
1 change: 0 additions & 1 deletion source/01_title_page.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ and add the centred logo

% Delete the following line
% to remove the UCL header logo
\ThisULCornerWallPaper{1.0}{style/univ_logo.eps}
\vspace*{2.5cm}
Expand Down
5 changes: 0 additions & 5 deletions source/06_list_of_figures.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# List of figures

<!--
For me, this was the only drawback of writing in Markdown: it is not possible to add a short caption to figures and tables. This means that the \listoftables and \listoffigures commands will generate lists using the full titles, which is probably isn't what you want. For now, the solution is to create the lists manually, when everything else is finished.
-->

\listoffigures

Expand Down
11 changes: 4 additions & 7 deletions source/07_list_of_tables.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# List of tables {.unnumbered}
\listoftables

<!--
For me, this was the only drawback of writing in Markdown: it is not possible to add a short caption to figures and tables. This means that the \listoftables and \listoffigures commands will generate lists using the full titles, which is probably isn't what you want. For now, the solution is to create the lists manually, when everything else is finished.
-->

Table 5.1 This is an example table . . . \hfill{pp}
Table x.x Short title of the figure . . . \hfill{pp}
\pagenumbering{roman}
\setcounter{page}{4}

\newpage



5 changes: 0 additions & 5 deletions source/11_chapter_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ if mood == 'happy':
print("I am a happy robot")
```

Alternatively, you can also use LaTeX to create a code block as shown in the Java example below:
\lstinputlisting[style=javaCodeStyle, caption=Main.java]{source/code/HelloWorld.java}

If you use `javaCodeStyle` as defined in the `preamble.tex`, it is best to keep the maximum line length in the source code at 80 characters.

### Subsection 2

This is the second part of the methodology. Proin tincidunt odio non sem mollis tristique. Fusce pharetra accumsan volutpat. In nec mauris vel orci rutrum dapibus nec ac nibh. Praesent malesuada sagittis nulla, eget commodo mauris ultricies eget. Suspendisse iaculis finibus ligula.
Expand Down
9 changes: 7 additions & 2 deletions source/12_chapter_4.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
lof: True

---

# Research containing a figure

## Introduction
Expand Down Expand Up @@ -35,13 +40,13 @@ to **Fig. number: mylabel** by prefixing with @ for mid-sentence references and

<!--
Figures can be added with the following syntax:
![my_caption ](source/figures/my_image.pdf){#fig:mylabel}{ width=50% }
![main_text_caption](source/figures/my_image.pdf, "short_caption(optional)"){#fig:mylabel}{ width=50% }
For details on setting attributes like width and height, see:
http://pandoc.org/MANUAL.html#extension-link_attributes
-->

![RV Calypso is a former British Royal Navy minesweeper converted into a research vessel for the oceanographic researcher Jacques-Yves Cousteau. It was equipped with a mobile laboratory for underwater field research.](source/figures/example_figure.pdf){ width=100% }{#fig:my_fig}
![RV Calypso is a former British Royal Navy minesweeper converted into a research vessel for the oceanographic researcher Jacques-Yves Cousteau. It was equipped with a mobile laboratory for underwater field research.](source/figures/example_figure.pdf "It's a boat"){ width=100% }{#fig:my_fig}

## Conclusion

Expand Down
2 changes: 1 addition & 1 deletion source/13_chapter_5.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Row 4 0.5 0.6

---------------------------------------------------------------------------

Table: This is the table caption. Suspendisse blandit dolor sed tellus venenatis, venenatis fringilla turpis pretium. {#tbl:my_table}
Table: This is the table caption. {#tbl:my_table}


## Discussion
Expand Down

0 comments on commit 3b7c67c

Please sign in to comment.