Nanoc filter to compile .tex
files to pdf using the latexmk
command. Supports both pdflatex
and xelatex
.
You need everything to build your LaTeX file manually, so latexmk
, pdflatex
and xelatex
need to be installed on your system.
To use this filter, add nanoc-latexmk to your Gemfile
.
gem 'nanoc-latexmk'
Then require this project in your Rules
:
require 'nanoc/latexmk'
First, be sure to add tex
to the text_extensions
in your nanoc.yaml
.
With a basic file in content/file.tex
:
---
title: Hello
---
\section{World}
And a layout in layouts/default.tex.erb
\documentclass{article}
\title{<%= item[:title] %>}
\begin{document}
\maketitle
<%= yield %>
\end{document}
You can add this to your Rules
compile '/**/*.tex', rep: :pdf do
layout '/default.tex.erb'
filter :latexmk
write ext: 'pdf'
end
See the UNLICENSE for details.
Rien Maertens maertensrien@gmail.com
See the CHANGELOG for details.