Git Product home page Git Product logo

phd_thesis_markdown's Introduction

Template for writing a PhD thesis in Markdown Build Status

DOI

This repository provides a framework for writing a PhD thesis in Markdown. I used the template for my PhD submission to University College London (UCL), but it should be straightforward to adapt suit other universities too.

Citing the template

If you have used this template in your work, please cite the following publication:

Tom Pollard et al. (2016). Template for writing a PhD thesis in Markdown. Zenodo. http://dx.doi.org/10.5281/zenodo.58490

Installation

  1. Install pandoc. This repository requires pandoc 3.1+, so if you install pandoc using a package manager (e.g. apt), check that it meets the version requirement. Otherwise, install by following the link.
  2. Install pandoc-crossref, a pandoc filter for numbering and cross-referencing figures, tables, sections and code blocks.
  3. Install the required TeX packages to enable compilation to PDF.

Quickstart for Mac Users

If you're a Mac user and you have conda and brew installed, run the following in your terminal to install pandoc and TeX packages (steps 1 & 3):

# get texlive
brew install --cask mactex

# update tlmgr and packages
sudo tlmgr update --self

# make python venv and install pandoc
conda create -n phd -y python=3.7 pandoc
conda activate phd

# Install required python and texlive packages
make install

Notes for Linux Users

There are several ways to install TeXLive. This guide (written for Ubuntu) may be useful. In short, you can:

  1. Install TeXLive from repositories (for Ubuntu, autocomplete apt install texlive to see all available packages), or;
  2. Install TeXLive manually and use the package manager (tlmgr) to install required packages. If you go down this route, you can run make install to install required TeXLive packages.

Handy references

  • pandoc User Guide for Markdown syntax for figures, tables, lists, etc., as well as information on flags that can be used when calling pandoc
  • pandoc-crossref manual which outlines syntax and customisation options for cross-referencing (e.g. should the figure prefix be "fig,", "Fig." or "Figure")
  • This README for pandoc-crossref-compatible syntax to have shorter captions for figures in the List of Figures (PDF/LaTeX output only)
  • This README for pandoc-crossref-compatible syntax to have shorter captions for tables in the List of Tables (PDF/LaTeX output only)

Should I use this template?

Why write my thesis in Markdown?

Markdown is a super-friendly plain text format that can be easily converted to a bunch of other formats like PDF, Word and LaTeX. You'll enjoy working in Markdown because:

  • it is a clean, plain-text format...
  • ...but you can use LaTeX when you need it (for example, in laying out mathematical formula).
  • it doesn't suffer from the freezes and crashes that some of us experience when working with large, image-heavy Word documents.
  • it automatically handles the table of contents, bibliography etc with pandoc.
  • comments, drafts of text, etc can be added to the document by wrapping them in <!-- -->
  • it works well with Git, so keeping backups is straightforward. Just commit the changes and then push them to your repository.
  • it is able to take advantage of autocompletion capabilities for figures and citations in several text editors (VSCode, Sublime, etc.)
  • there is no lock-in. If you decide that Markdown isn't for you, then just output to Word, or whatever, and continue working in the new format.

Are there any reasons not to use Markdown?

There are some minor annoyances:

  • if you haven't worked with Markdown before then you'll find yourself referring to the style-guide (pandoc User Guide) fairly often at first.
  • Some niche and more complicated requirements will require writing raw LaTeX, which won't appear in other output formats. In the worst case, it will require diving into Haskell or Lua filters for pandoc
  • the style documents in this framework could be improved. The PDF and HTML (thanks @ArcoMul) outputs are acceptable, but HTML and Word needs work if you plan to output to this format.
  • ... if there are more, please add them here.

Detailed template information

How is the template organised?

  • README.md => these instructions.
  • License.md => terms of reuse (MIT license).
  • Makefile => contains instructions for using pandoc to produce the final thesis.
  • output/ => directory to hold the final version.
  • source/ => directory to hold the thesis content. Includes the references.bib file.
  • scratch/ => directory to hold tables which can be converted between different formats.
  • source/figures/ => directory to hold the figures.
  • style/ => directory to hold the style documents.

How do I get started?

  1. Install the software outlined above, as well as:
    • A text editor, like Sublime, which is what you'll use write the thesis.
    • Git, for version control.
  2. Fork the repository on Github
  3. Clone the repository onto your local computer (or download the Zip file).
  4. (Skip this step to use default UCL style) Configure style for your institution. See instructions below
  5. Navigate to the directory that contains the Makefile and type "make pdf" (or "make html") at the command line to update the PDF (or HTML) in the output directory.
    In case of an error (e.g. make: *** [pdf] Error 43), consult this article for possible fixes. Most importantly, make sure tlmgr is properly installed, then run ```install.sh``
  6. Edit the files in the 'source' directory, then goto step 5.

How does it work?

The universal document converter pandoc does all the heavy lifting. For example:

  • make pdf (the code under pdf: ... in Makefile) runs pandoc which takes as input
    1. the markdown files which contain the writing content: input/*.md
    2. a yaml file with metadata: input/metadata.yml
    3. a LaTeX template: style/template.tex
    4. a LaTeX header: style/preamble.tex
    5. a BibTeX file of your references: input/references.bib
    6. a csl style file for citations: style/ref_format.csl
    7. a bunch of options which change the output e.g. --number-sections
  1. the output produced is:
    1. the generated pdf: output/thesis.pdf
    2. logs (which contain the .tex which was compiled): pandoc.pdf.log

Put simply, pandoc uses the latex template provided to create a .tex file, then compiles it. In detail, pandoc processes the input files in the following way (the file names in quotes aren't visible to you, but are named for the purpose of understanding):

  1. Make replacements within the markdown files input/*.md e.g.:
    • references to figures, captions, and sections are handled: @fig:my_fig -> \ref{fig:my_fig}
    • equations are converted to LaTeX and numbered: $$f(x) = ax^3 + bx^2 + cx + d$$ {#eq:my_equation} -> \begin{equation}f(x) = ax^3 + bx^2 + cx + d\label{eq:my_equation}\end{equation}
    • citations are handled: [@Cousteau1963] -> (Cousteau Jacques & Dugan James 1963)
    • see input/*.md for more examples!
  2. Create "body.tex" by:
    • converting all the *.md files in the order that they were stated in the pandoc call
  3. Create "main.tex" from style/template.tex by running code wrapped in $ signs. The important things to note are:
    • this populates style/template.tex with metadata from input/metadata.yml and the arguments from the pandoc call
    • "body.tex" is pasted in verbatim in place of $body$
  4. Create "references.tex" by converting ./input/references.bib
  5. Concatenate files together to create the final thesis.tex = style/preamble.tex + "main.tex" + "references.tex"
  6. Compile thesis.tex (you can see the logs for this process, and what "thesis.tex" would look like in pandoc.pdf.log)
    • TIP: You can also generate and view output/thesis.tex by running make tex - this follows all the above steps, bar the final compilation

What else do I need to know?

Some useful points, in a random order:

  • if you only care about generating thesis.pdf you can always fall back on writing LaTeX within the markdown files (but note that thesis.html and other outputs will not be able to render this)
  • the markdown files you write (i.e. your chapters) will be compiled in alphabetical order, so keep the filenames sorted in the order you want them to appear e.g. 01_chapter_1.md, 02_chapter_2.md, etc. This is required because of the way we have written make pdf. You can change this behaviour by writing a custom pandoc command instead of using make pdf.
  • each chapter must finish with at least one blank line, otherwise the header of the following chapter may not be picked up.
  • add two spaces at the end of a line to force a line break.
  • PDFs are generated using the LaTeX templates in the style directory. Fonts etc can be changed in the TeX templates.
  • To change the citation style, just overwrite ref_format.csl with the new style. Style files can be obtained from citationstyles.org/
  • For fellow web developers, there is a Grunt task file (Gruntfile.js) which can be used to 'watch' the markdown files. By running $ npm install and then $ npm run watch the PDF and HTML export is done automatically when saving a Markdown file.
  • You can automatically reload the HTML page on your browser using LiveReload with the command $ npm run livereload. The HTML page will automatically reload when saving a Markdown file after the export is done.

Troubleshooting

  1. The first thing to try if the make * command fails is a simpler build, e.g. if make pdf failed, try make tex to see if that fails too.
  2. If tex compilation is failing (i.e. make tex works but make pdf fails), try updating tex live and/or packages. For example, if you get the error make: *** [pdf] Error 43, have a look in pandoc.pdf.log for the error. If it is something like
`l3backend-xdvipdfmx.def' not found

then try:

sudo tlmgr update --self
sudo tlmgr l3backend
# Full nuclear option - update *all* the packages! (takes about 10m)
# sudo tlmgr update --all
  1. Try reinstalling everything from scratch (tip: check out .travis.yml)
  2. Search the github issues and pull requests in this repo

Contributing

Contributions to the template are encouraged! There are lots of things that could be improved, like:

  • cleaning up the LaTeX templates, which are messy at the moment.
  • improving the style of Word and TeX outputs.

Please fork and edit the project, then send a pull request.

phd_thesis_markdown's People

Contributors

arcomul avatar clbarnes avatar davidsan avatar davidverweij avatar dendrondal avatar dennisweissmann avatar henryfung3a27 avatar ianbenlolo avatar jamesowers avatar krueschi avatar matthewgthomas avatar nowosad avatar prakaa avatar therealmarv avatar tobiasbueschel avatar tompollard avatar wandmalfarbe avatar wcaleb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phd_thesis_markdown's Issues

How do I ignore specific page in Table of Contents ?

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 ?

Example on .bib references

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.

Reduce Space Above chapter heading

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

[pdf] Error 2 / Error 43

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:

unnamed

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

Change Margins

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

Make pdf failed: Error 85

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

Best image format for HTML & LaTeX

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 !

Reduce font size of bibliography

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.

Equation support with LaTeX - MathJax

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 :

  1. When trying to add this to the 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 !

  1. I would find more consistent (and aesthetically clean) to only rely on one math formatter. Personally, I even think MathJax renders better. So assuming I could add it to my template.html, is there a way I can deactivate the equation rendering from pandoc ?

Thank you very much for your help !

Make pdf fails, undefined control sequence error

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!

improve code block snippets

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

  • code block background
  • line numbers
  • max line length (e.g. 80 characters)
  • line spacing

Example:

Use .Rmd files instead of .md

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.

Docker image

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!

Roman numbering in {.unnumbered} sections

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 $body$

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!

Power -1

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}

Sources break strange, Underfull \hbox

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 ?

(Very) slow build for LaTeX

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

Question: Why are two spaces needed after paragraphs?

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).

urlcolor=blue doesn't work...

I test a lot of settings, but it isn't possible to color hyperlinks with urlcolor = blue
Any ideas why?

Thanks
Andreas

ability to scale images in markdown

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 👍

Links in bibliography are coloured blue

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.

Figure location in output pdf

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!

Fixing title page logo position

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!

Ref and Label commands Not working with HTML / DOCX

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)

Error code 41

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

Table with numeric values aligned to right

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,

include roman numerals & start page count at introduction page

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.

Here is an example:

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?

Syntax highlighting

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

Changing the font of the PDF output

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

[pdf] Error 43

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

Widows and orphans

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.

PDF ISSUE: Japanese characters (fonts)

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.

Error 43 even after running installation script

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!

Change the default code highlighting ?

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")

Figure position

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,

Header capitalised

Hi, I just noticed that when h3 headers are output they are capitalise by default, where can I change this. Thanks

# Introduction
## Introduction
### Introduction
#### Introduction
##### Introduction
###### Introduction

Outputs this

screen shot 2016-03-27 at 15 08 52

Provide ODT/DOCX template

Some Universities require you to hand in your document in a format that's readable by Word (looking at you, University of Rotterdam).

References without citations

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.

Chapters, tables and figures

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

Error 43 persists!

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 ?

make: *** [pdf] Error 1

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.