...
 
Commits (2)
......@@ -31,6 +31,7 @@ PANDOC_READER_OPTIONS ?= --metadata-file=config/article-metadata.inc.yml \
ifndef PANDOC_LATEX_OPTIONS
PANDOC_LATEX_OPTIONS = --pdf-engine=xelatex -N
PANDOC_LATEX_OPTIONS += --metadata-file=../../journal-configuration/journal-config/journal-metadata.inc.yml
PANDOC_LATEX_OPTIONS += --lua-filter=../../journal-configuration/lua/smaller-latex-figures.lua
endif
# Configuration of the Hypothesis panel for HTML format
......
local figure_start = [[
\begin{figure}
\begin{adjustwidth}{\mainindent}{} % Indent main article text by 5.5 cm
]]
local figure_end = [[
\end{adjustwidth}
\end{figure}
]]
local function inline_latex(s)
return pandoc.RawInline('latex', s)
end
---
-- Create custom code for figures
function Para (p)
-- this is a figure if it contains an image and nothing else.
local img = p.content[1]
local linebreak = inline_latex '\n'
if img and img.t == 'Image' and #p.content == 1 then
return pandoc.Para{
inline_latex(figure_start),
img, linebreak,
inline_latex('\\caption'), pandoc.Span(img.caption), linebreak,
inline_latex(figure_end)
}
end
end