maehr/academic-pandoc-template

15.04.21: [Change font style in template]

mauriziopassariello opened this issue · 8 comments

I am new to pandoc and conversion of MD files to PDF. I was really amazed by the conversion of the template with typademic! So I am not sure this is a bug or that I just am inexperienced. I tried to modify the template here and there and I noticed that if I uncomment the mainfont and change it to another one (taken from https://tug.org/FontCatalogue/sansseriffonts.html) in the PDF the font style doesn't change.

Great work I am really amazed by the simplicity of Typademic. Thanks!

Desktop (please complete the following information):

  • OS: 11.2
  • Browser Chrome
  • Version 89

Hi there! Thanks for opening your first issue!

I just realised that no matter what changes I make to the template.md file (except for tile and author) these don’t reflect in the pdf file. Surely I am doing something wrong...

maehr commented

Hi @mauriziopassariello
I tested the template with https://typademic.ch with the following settings and everything seems to work fine. Did you remove the # in # mainfont: to uncomment the mainfont settings? And did you hit the reset button before uploading a new version of the template?

# Front matter
lang: de-CH # Use language codes like de, de-DE, en, en-UK, en-US, fr, it, ...
title: Test
subtitle: "ein wundervoller Untertitel"
author: "Petra Muster"
date: 2021
abstract: "Hier Vorgang ihm als reiße. Ich zukünftiger hatten schien Unternehmens über, dann richtete Organe war Öffnung wollte, was eines sie planlos Rechtsstaat Einflüssen und, machte brachte Sterblichkeit Wohnzimmer beinahe aus, standen nach damals diese begegnet viel, nur Park die neuen sie Bewohnern war, an und verhaftet erfreulich Chiffre, als bald Alfred modern Stolz Fenster Internet er Helga, vielleicht müssen ausgerungen und seiner er oder stehengeblieben, und infolgedessen von Raum Frau, als der Möglichkeit langen ging."
keywords: "Schlagworte, Worte"
thanks: "Herzlichen Dank an Gabriela Muster für die wertvollen Kommentare."

# Bibliography
csl: https://www.zotero.org/styles/chicago-note-bibliography # See https://www.zotero.org/styles for more styles.
bibliography: references.bib # See https://github.com/jgm/pandoc-citeproc/blob/master/man/pandoc-citeproc.1.md for more formats.
suppress-bibliography: false
link-citations: true
color-links: true # See https://ctan.org/pkg/xcolor for colors
linkcolor: black
urlcolor: black
citecolor: black
endnote: false

# Formatting
toc-title: "Inhaltsverzeichnis"
toc: true # Table of contents
toc_depth: 2
lof: true # List of figures
lot: true # List of tables
fontsize: 12pt
linestretch: 1.5
# Uncomment and check https://tug.org/FontCatalogue/ and https://fonts.google.com/ for fonts
mainfont: "Merriweather"
sansfont: "Raleway"
# monofont: "IBM Plex Mono"
# mathfont:
documentclass: report # See https://en.wikibooks.org/wiki/LaTeX/Document_Structure#Document_classes for more classes and options
classoption: [notitlepage, onecolumn, openany]
geometry: [a4paper, bindingoffset=0mm, inner=30mm, outer=30mm, top=30mm, bottom=30mm] # See https://ctan.org/pkg/geometry for more options
header-includes:
  - \linepenalty=10 # the penalty added to the badness of each line within a paragraph (no associated penalty node) Increasing the value makes tex try to have fewer lines in the paragraph.
  - \interlinepenalty=0 # value of the penalty (node) added after each line of a paragraph.
  - \hyphenpenalty=50 # the penalty for line breaking at an automatically inserted hyphen
  - \exhyphenpenalty=50 # the penalty for line breaking at an explicit hyphen
  - \binoppenalty=700 # the penalty for breaking a line at a binary operator
  - \relpenalty=500 # the penalty for breaking a line at a relation
  - \clubpenalty=150 # extra penalty for breaking after first line of a paragraph
  - \widowpenalty=150 # extra penalty for breaking before last line of a paragraph
  - \displaywidowpenalty=50 # extra penalty for breaking before last line before a display math
  - \brokenpenalty=100 # extra penalty for page breaking after a hyphenated line
  - \predisplaypenalty=10000 # penalty for breaking before a display
  - \postdisplaypenalty=0 # penalty for breaking after a display
  - \floatingpenalty = 20000 # penalty for splitting an insertion (can only be split footnote in standard LaTeX)
  - \raggedbottom # or \flushbottom
  - \usepackage{float} # keep figures where there are in the text
  - \floatplacement{figure}{H} # keep figures where there are in the text
# if you use RStudio uncomment these lines
# output:
#   word_document:
#     path: academic-pandoc-template.docx
#   pdf_document:
#     path: academic-pandoc-template.pdf

Hi Moritz thank you for getting back to me so quickly! I think my browser got "stuck" and was giving me the same pdf over and over again. Now that I have relaunched it it works! The only issue is still with images. I have tried but I get this error. What is my mistake?

Screenshot 2021-04-15 at 21 09 18

I hope I can fix the images issue, but this is soooo cool I am so impressed!

Thanks again,

Maurizio

maehr commented

Hi @mauriziopassariello
You are very welcome. You need to change the reference from absolute ![](/Users/maurizio/.../Avalon2.jpg) to relative ![](Avalon2.jpg). Then it is supposed to work.
If it's ok with you I will now close this issue.
Best,
Moritz

Thanks Morits, yes it works indeed! Thanks!

Hi Moritz, I'm not sure you still receive these comments.
I wanted to ask you: let's say I want numbered sections. How do I change that? Where can I learn how to make templates myself?
Thank you in advance for your help.

maehr commented

I highly recommend you to read the documentation of Pandoc and the document classes you intend to use. I prefer KOMA script classes.