tompollard / phd_thesis_markdown Goto Github PK
View Code? Open in Web Editor NEWTemplate for writing a PhD thesis in Markdown
License: MIT License
Template for writing a PhD thesis in Markdown
License: MIT License
Hi there,
Great project!
I have problems running the make pdf
(error 43) although I installed the requirements from the README.md
. It actually worked directly without having to run these requirements but since I did them, error 43 appears... (only updates changed something). When looking at the logs :
$ cat pandoc.log
! Forbidden control sequence found while scanning use of \__cs_generate_from_si
gnature:nnNNNn.
<inserted text>
\par
l.1767 \int_case:nnn
pandoc: Error producing PDF
Any idea on this ?
To cross-reference figures, display equations, tables and sections.
I test a lot of settings, but it isn't possible to color hyperlinks with urlcolor = blue
Any ideas why?
Thanks
Andreas
Is it possible to change the default code highlighting and use, let's say, something like the github markdown (light grey box included)?
E.g.
mood = 'happy'
if mood == 'happy':
print("I am a happy robot")
Not an issue per-se, more of a query about functionality...
Is it possible to use roman numbering in the {.unnumbered} sections and then re-start arabic numbering in the normal chapters?
In template.tex I tried including:
\pagenumbering{roman} after \begin{document}
then:
\pagenumbering{arabic} before
but all this does is give me arabic page numbers throughout the whole document.
I then tried including sections for \mainmatter and \frontmatter in template.tex with the different numbering styles but this didn't work either.
No probs if you don't have time to respond, but if you have any ideas about where I'm going wrong that would help me out a lot!
Normally I'd fix them by adding
\clubpenalty10000
\widowpenalty10000
\displaywidowpenalty=10000
but this screws with the references.
Any other options ? Any idea why this messes with citations ?
Edit: using \usepackage[all]{nowidow}
results in the same behavior.
In latex I can use \thispagestyle{empty}
below the page content, then latex will know don't put this page in table of contents, even skip the page numbering.
However, I use this command in markdown, It only hide the page number.
Any instructions ?
From the wallpaper manual, I see that there's the possibility to offset the logo by some amount away from the margin (I want the logo of my uni to be in the top left of the page, but with a bit of space).
I've changed the following line:
\ThisULCornerWallPaper{1.0}{style/univ_logo.eps}
to
\ThisULPositionWallPaper{0.55}{1}{1}{style/univ_logo.eps}
But doing make pdf
gives back the following error:
make: *** [pdf] Error 43
Actually, this error shows up very frequently whenever I change any command in the preamble.tex
file too: for example, to enable coloring of the citation links using \hyperref
, although that is unrelated to the issue that I present here.
Thanks for any help!
Hello!
Thank you for the package, I'm really excited to start using it. I downloaded MacTex from homebrew casks with brew cask install mactex
and followed the sudo commands in step 4 after getting the error described in the install instructions. My problem is that make pdf
produces the message No pages of output.
and a few other warnings and notifications but I can't find a specific error message.
Make html
and make docx
successfully produce output (yay!) The messages I get for make pdf
are really long and I don't want to overwhelm this comment, so here is a subset I think might be useful.
! Undefined control sequence.
<argument> \c_sys_engine_xetex_bool
or this?
*** you should *not* be loading the inputenc package
*** XeTeX expects the source to be in UTF8 encoding
*** some features of other encodings may conflict, resulting in poor output.
I also wonder if the issue could be due to installing MacTex via homebrew. This is the return from which tex
: /Library/TeX/texbin/tex
I would greatly appreciate help figuring out what the issue is with producing the pdf. Thanks in advance!
Hi,
You said "it isn't possible to add a short caption to tables", however this is now possible with the pandoc-crossref filter. Note that it only works if codeBlockCaptions
are set to True in header (I prefer most of my options in an external YAML file though).
For more see the demo at https://github.com/lierdakil/pandoc-crossref/tree/master/docs/demo
Hi,
I'm curious to know which image format you guys chose so that it works both for HTML and LaTeX displays.
I tried a few formats (the content is a python matplotlib figure)
image format | on LaTeX | on HTML |
---|---|---|
.pdf |
ok | embedded display.. not the best |
.eps |
ok | doesn't display |
.svg |
not ok | ok |
.png |
ok | ok |
But .png
doesn't suit perfectly (heavy, not very adapted for graphics).
Maybe you guys have an idea ? I've been through that Stack thread that goes for a high-res .jpeg
..
Thanks !
Sweet idea! I'm wondering if it's possible to inline TikZ and PGFPlots in the markdown?
I get a lot of
Underfull \hbox (badness 10000) in paragraph at lines 2386--2389
\EU1/lmr/m/n/10 Verfügbar unter: [][]$[][][][][] [] [] [] [][]\OML/lmm/m/it/10
:[][][][][][][][][]:[][][] [] [] [] [][][][][]:[][][][][][][][][] [] [][][][][]
[][][][][][][][][][][][][][][][] []
[87]
Overfull \vbox (2919.13782pt too high) has occurred while \output is active
88
and only have half my sources shown, as well as strange breaks in the middle of the page and text reaching into the page number.
Any ideas ?
Hi there,
Is it possible to force the figure to be exactly where we code it should be for the latex pdf
export? Rather than putting all of them in the end of the chapter ? For me, seems like figures appear at the right spot only for the .html
export :)
Thanks a lot,
Page numbers are not shown (nor counted) on the table of contents.
I am using this for my dissertation at uni and love it. Just one quick issue I have with it is that I am attempting to reduce the empty space above the new Chapter Header. I attempted to change
% \newcommand{\hsp}{\hspace{20pt}}
in the preamble.tex but with no luck.
Would love to know if this is possible.
Thanks
Some Universities require you to hand in your document in a format that's readable by Word (looking at you, University of Rotterdam).
Hi,
Is there a possibility to change the font size and line spacing of code blocks when generating them through markdown?
Thanks & best,
Tobias
When I insert a figure it scales to the width of the PDF, this makes some of my images too large. Is it possible to change the scale / size of the image using markdown or LaTex, although I'm not too familiar with LaTex.
Nice job setting this up, I hate word and am much more productive in markdown 👍
Hi there,
Just wanted to know whether it was normal or expected that the build time for the LaTeX (make pdf
) is taking ~5 minutes to be done.
In your experience, are there good habits to overcome this ? I have quite a few attachments that may be heavy (36Mo of images) maybe that's the issue ?
Thanks
It seems that the \ref{} command isn't resolving when making HTML or DOCX files. I have \label{} in all of my figures and I use \ref{*} to reference them in the body of the text. When I make PDF, the \ref resolves correctly (I see Figure 10 or Figure 5, etc.). However, when I make HTML or make DOCX, the \ref just resolves blank. Is there a way to fix this? Below is a sample of what I'm doing:
In \ref{fig-similarity}, the solid colour diamonds appear to be related to each other in a way that they are not to the transparent diamonds.
![Use of similarity to group objects. \label{fig-similarity}](/users/shanemcgarry/Dropbox/Maynooth/PhD/Writing/Dissertation/source/figures/gestalt_similarity_1.png)
Would it be possible to add an option to add references from references.bib
into the bibliography without having them cited in the body of the document? Supposedly \nocite{*}
should take care of this, but it doesn't seem to be working for me.
I'm having trouble getting the make pdf command to work. I downloaded the Zip file to my computer, replaced the template bibliography and csl files with my own, and tried to run the make pdf command just to see if I had all the components I needed. I encountered a *** [pdf] Error 2. Running the various sudo commands Tom indicated didn't clear the error. Got this output:
Tom suggested I run pandoc in verbose mode, which I did; I also replaced references to --latex-engine with --pdf-engine.
Running the command now yields this in Terminal:
Last login: Mon Dec 4 16:11:32 on ttys000
Justins-MacBook:~ elodin$ cd Dropbox/Citation/proposal
Justins-MacBook:proposal elodin$ make pdf
pandoc "/Users/elodin/Dropbox/Citation/proposal/source"/*.md
-o "/Users/elodin/Dropbox/Citation/proposal/output/thesis.pdf"
-H "/Users/elodin/Dropbox/Citation/proposal/style/preamble.tex"
--template="/Users/elodin/Dropbox/Citation/proposal/style/template.tex"
--bibliography="/Users/elodin/Dropbox/Citation/proposal/source/references.bib" 2>pandoc.log
--csl="/Users/elodin/Dropbox/Citation/proposal/style/ref_format.csl"
--highlight-style pygments
-V fontsize=12pt
-V papersize=a4paper
-V documentclass:report
-N
--pdf-engine=xelatex
make: *** [pdf] Error 43
Justins-MacBook:proposal elodin$
and this in pandoc.log:
pandoc-citeproc: reference Cousteau1963 not found
Error producing PDF.
! Undefined control sequence.
\LaTeX3 error:
Erroneous variable \c__fontspec_shape_n_n_tl used!
l.3806 \emfontdeclare{ \emshape, \eminnershape }
Any advice?
I'm relatively new to this, so entirely possible I'm missing something obvious.
Many thanks,
JQ
The syntax highlighting in markdown is quite nice, but I'm keen to improve a few other features as outlined below. As I haven't worked with pandoc yet, I'm not sure what the interplay is between LaTeX and the former. Hence, what would be the best way to tackle the below?
Code Block Improvements
Hi,
Great tool. I'm using it to write my PhD thesis as well.
I noticed a problem however:
9 mL.min^-1^
Does not render well. The minus symbol does not seem to be in the subscript when rendering to pdf, with the xelatex engine. It does render correctly in html though. Do you have the same behaviour ?
EDIT:
My bad, it does that if I try to change the font:
\usepackage{fontspec}
\setmainfont{Calibri}
Hello, I was wondering if it was possible to use .Rmd files (to include R code) instead of .md. I figured I would ask before trying to do it on my own in case you had any insight that might save me time. Thanks in advance.
Hi,
I would like to add references at the end of each chapter.
Please let me know how I can do this?
with regards,
Ram
Hi Tom,
Great package you put together here. Thanks. I have a question though, I've read throughout the code and I couldn't quite understand how are you rendering tables. It seems the main culprit is the threeparttable package, but there aren't instructions on how to design these in markdown. Sure, there is one example, but I can't make it align the numeric columns to right. Is it possible? Could you shed some light on how you are rendering the tables?
Best,
Is it possible to reduce font size of bibliography? I've tried to do it by adding "\renewcommand*{\bibfont}{\footnotesize}" into preamble.tex, but afterwards it is not possible to comple pdf.
I played around with the template.tex file and want to change the font for the PDF Output, but setmainfont and some other test always failed with Error 43.
Is there a simple solution changing the font, i.e. to Proxima Nova or Noto serif?
Andreas
Hi there,
I cloned the repo and went through the instructions, yet when I run:
pandoc "/Users/admin/Documents/school/thesis/markdown_thesis/source"/*.md \
-o "/Users/admin/Documents/school/thesis/markdown_thesis/output/thesis.pdf" \
-H "/Users/admin/Documents/school/thesis/markdown_thesis/style/preamble.tex" \
--template="/Users/admin/Documents/school/thesis/markdown_thesis/style/template.tex" \
--bibliography="/Users/admin/Documents/school/thesis/markdown_thesis/source/references.bib" 2>pandoc.log \
--csl="/Users/admin/Documents/school/thesis/markdown_thesis/style/ref_format.csl" \
--highlight-style pygments \
-V fontsize=12pt \
-V papersize=a4paper \
-V documentclass:report \
-N \
--latex-engine=xelatex
I still get
make: *** [pdf] Error 43
I tried to run sudo tlmgr update
on the dependencies, but that didn't do the trick either. What is weird, however, is that I am able to create pdf's with pandoc -o foo.pdf bar.md
. Other output formats like html work fine.
Any idea what could be the issue? Thanks!
As said, the labels get stripped and it is not possible to reference a figure. See the output PDF.
Hey,
this is probably just me, not knowing anything about bibtex, but I'd love some examples !
There is a @book{Cousteau1963} entry in the references.bib, but I can't figure out how to reference it.
Uncommenting the "Chapter header" block and modifying \titleformat
seems to have no effect - would it be possible to support centring etc. of chapters?
Hello Tom,
thanks to share your work about your phd_thesis_markdown.
I am adapting your template for my thesis in Spanish and I would like to ask how is possible to change titles like "Chapter", "Table", "Figure" for other similar works but in Spanish ;)
Any clue will be welcome!
Thanks again,
Paco
I noticed that the template uses Arabic numerals in the TOC, however, as per convention, it would be nice to use Roman numerals for the Abstract, Acknowledgements etc.
We would then need to start the page count from the Introduction page instead. Can we control the page count directly through LaTeX or does this need to be done via pandoc i.e. the makefile
and template.tex
?
At some point, I recommend that a Docker image be created and added to Docker Hub. Thanks to Docker, it's no longer necessary for users to install megabytes of supporting software such as pandoc and LaTeX in order to use your project on a local machine. Let me know if I can help. Thanks!
I'm thinking about archiving a copy of this repo in Figshare. For more detail see: https://figshare.com/blog/Working_with_Github_and_Mozilla_to_enable_Code_as_a_Research_Output_/117
To everyone who has contributed, please let me know if you would like to be listed on the Figshare project and, if so, what name you would like to be displayed.
(@therealmarv, @davidsan, @ArcoMul, @wcaleb, @Nowosad, @matthewgthomas, @dennisweissmann, @DeastinY)
Thanks!
Tom
Hi
While make I am getting following error:
pandoc "/tmp/phd_thesis_markdown/source"/*.md
-o "/tmp/phd_thesis_markdown/output/thesis.pdf"
-H "/tmp/phd_thesis_markdown/style/preamble.tex"
--template="/tmp/phd_thesis_markdown/style/template.tex"
--bibliography="/tmp/phd_thesis_markdown/source/references.bib" 2>pandoc.log
--csl="/tmp/phd_thesis_markdown/style/ref_format.csl"
--highlight-style pygments
-V fontsize=12pt
-V papersize=a4paper
-V documentclass:report
-N
--latex-engine=xelatex
Makefile:28: recipe for target 'pdf' failed
make: *** [pdf] Error 41
Please let me know what I am doing wrong.
My system is Ubuntu 16.04.
Let me know if you need more information.
with regards,
Ram
I am truly not technical, but I have taken the challenge to write my (Bachelor) thesis in markdown by using this template and found this work-flow so pleasant I do not want to go back to Word.
For my study I need to have Japanese characters incorporated into the thesis and this is where problems arose. My thesis is fully written, however in the generated pdf all the Japanese characters are missing. I presumed it had something to do with the font. I tried changing the font to MS Mincho in the template.tex but when that didn't work I tried changing it in the preamble.tex via this:
Fonts and typesetting
\setmainfont[Scale=1.1]{MS Mincho}
Like I said, I am a true beginner at this stuff so I am sure I must be doing something wrong. Hopefully there is someone who can help me with this issue. I'll be much obliged.
What I basically need to know is:
how to get Japanese characters into the thesis (pdf file)?
p.s. if I generate to .html or .docx the Japanese characters do appear.
More a question then an issue but is it possible to apply syntax highlighting to a code block? Also can you set a figure on the code block?
Thanks
I've been able to successfully run the make docx command, but 'make pdf' consistently throws errors. At the moment I'm getting
make: *** [pdf] Error 43
The Readme suggests that if I receive this error, I should run a series of commands beginning with sudo tlmgr install truncate.
When I do this, however, I receive warning:
tlmgr itself needs to be updated.
Please do this via either
tlmgr update --self
or by getting the latest updater for Unix-ish systems:
http://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh
and/or Windows systems:
http://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.exe
Then continue with other updates as usual.
...and trying to run the tlmgr update --self yields the complaint that I don't have administrator privileges. I've tried running the command while logged in as root, to no avail.
Any advice would be appreciate. Happy to add further Terminal output, screenshots, etc.
--Justin Quam
I'm trying to use the template in my thesis. Love both the idea and the template, but I'm stack with this error:
Unknown reader: pdf
Pandoc can convert to PDF, but not from PDF.
make: *** [pdf] Error 1
I've updated the make script as --latex-engine
isn't supported anymore and (listening to pandoc own logging) --pdf-engine
should be used. Final Makefile's pdf script looks like this:
pdf:
pandoc $(INPUTDIR)/*.md \
-o $(OUTPUTDIR)/thesis.pdf \
-H $(STYLEDIR)/preamble.tex \
--template $(STYLEDIR)/template.tex \
--bibliography=$(BIBFILE) \
--csl=$(STYLEDIR)/ref_format.csl \
-V fontsize=12pt \
-V papersize=a4paper \
-V documentclass:report \
-N \
--pdf-engine=xelatex
I've installed every package required by the preamble.tex file and I can't get the script up and working.
Any ideas? Thanks.
preamble.tex
contains this block for handling the colour of URLs in the body of the text:
% Set colour of links to black so that they don't show up when printed
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=black}
This doesn't seem to affect links specified using the BibTeX URL field.
Here's the output when exec make pdf
:
pandoc "/Users/kwanyu/Downloads/phd_thesis_markdown-master/source"/*.md \
-o "/Users/kwanyu/Downloads/phd_thesis_markdown-master/output/thesis.pdf" \
-H "/Users/kwanyu/Downloads/phd_thesis_markdown-master/style/preamble.tex" \
--template="/Users/kwanyu/Downloads/phd_thesis_markdown-master/style/template.tex" \
--bibliography="/Users/kwanyu/Downloads/phd_thesis_markdown-master/source/references.bib" 2>pandoc.log \
--csl="/Users/kwanyu/Downloads/phd_thesis_markdown-master/style/ref_format.csl" \
--highlight-style pygments \
-V fontsize=12pt \
-V papersize=a4paper \
-V documentclass:report \
-N \
--latex-engine=xelatex \
--verbose
make: *** [pdf] Error 85
And the pandoc.log:
pandoc: Filter pandoc-citeproc not found
To solve this in OSX, just install the missing package:
brew install pandoc-citeproc
Hi Tom,
I tried a bunch of things to change the margin on the page, but nothing seems to work. Any headsup on how I can accomplish a little less white on the sides ?
Regards,
Richard
Hi all :-)
I am facing troubles with some mathematic equations that are probably not understood by pandoc and the html
doesn't display them (e.g. $$\frac{a}{b}$$
doesn't work and literally stays $$\frac{a}{b}$$
)
I found a workaround by leveraging MathJax which is a JS reader for math equations. Indeed just adding that snippet in the <head>
of the .html
file :
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"></script>
</script>
And equations are rendered. 👌
I have two issues though :
template.html
I get an error :pandoc: "template" (line 16, column 57):
unexpected "'"
expecting letter
CallStack (from HasCallStack):
error, called at src/Text/Pandoc/Templates.hs:73:35 in pandoc-1.19.2.1-J1nmFBg9ln971v0RrPbKLJ:Text.Pandoc.Templates
make: *** [html] Error 1
so I just add it to the thesis.html
which works... but not very clean, I'd rather avoid adding it every time !
template.html
, is there a way I can deactivate the equation rendering from pandoc ?Thank you very much for your help !
I really like this template and will also use it for my diploma thesis.
Only one thing is questionable for me: Why are two spaces also needed after every paragraph even when I have a blank new line in between of two paragraphs?
It seems a littlebit extra work and most/all of the markdown I've seen do not need a both of them: Double spacing AND empty new line.
I will maybe fix that for me but I have not looked too deep into the templates and outputs (the pdf output seems to have an extra indention when two spaces are missing).
Hi there,
First of all, thanks for uploading the template, I am using it to write my thesis and I love it!
I have found an issue with figure location in the pdf output. It seems that location is not consistent, depending on the size and space available in the output page.
If I reduce the image size enough for the image to fit by fiddling with { widht=xx% }
, then the image will be displayed at the bottom of the current page. Otherwise, it is plotted at the end of the chapter.
The desired output here would be the image to be displayed in-place between paragraphs, or am I missing something?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.