ben-xD / ImperialCollegeLatexTheme

Instead of writing in LaTex, you write in Markdown and generate a PDF using Pandoc and this theme.
3 stars 1 forks source link

Awesome Template #1

Open PhilKohn opened 3 years ago

PhilKohn commented 3 years ago

Hi, I found your blog post about how to write academic papers with pandoc. I'm also hoping to write my thesis in Markdown and using Pandoc to produce a nice pdf. Unfortunately, I'm not a computer science student, so I have little knowledge of Latex.

The default template pandoc is using doesn't work in my case. It has the wrong formatting. So I figured I would use your Imperial template. I'm able to replicate your example document and also compile my own markdown document. However, I still need to make some changes to the formatting. Could you help me? I can't seem to figure out how to apply indentation to each paragraph. I also need to increase the space between lines.

I can't imagine this being too difficult. Would you be able to help me?

FYI: with the newer versions of pandoc, your imperial.tex file isn't working anymore. You need to add the following.

$if(csl-refs)$
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
 {% don't indent paragraphs
  \setlength{\parindent}{0pt}
  % turn on hanging indent if param 1 is 1
  \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
  % set entry spacing
  \ifnum #2 > 0
  \setlength{\parskip}{#2\baselineskip}
  \fi
 }%
 {}
\usepackage{calc} % for calculating minipage widths
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$

I believe this also means that the csl you're using doesn't work anymore.

fleongg commented 2 years ago

@PhilKohn Thank you so much for the work around! But there is still a problem, if I add the codes you post at the top of imperial.tex, it shows "! LaTeX Error: \usepackage before \documentclass.". If I add it after document class, it shows "! LaTeX Error: Environment CSLReferences undefined."

Could you specify where to put the codes? I am using pandoc 2.18 and I change the filter option in create_report.sh to “--citeproc” to match the newer pandoc version.

Also @ben-xD I read your blog and it's great work!