Skip to content

Instantly share code, notes, and snippets.

@Nymphium
Created February 6, 2020 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nymphium/21615a9e331485ab584e8e9fe19f6132 to your computer and use it in GitHub Desktop.
Save Nymphium/21615a9e331485ab584e8e9fe19f6132 to your computer and use it in GitHub Desktop.
\documentclass[landscape,a4paper]{article}
\usepackage{luacode}
\usepackage{pdfpages}
\begin{document}
\begin{luacode*}
local options = [==[
pages= -,
nup = 2x2,
width = 0.49\paperwidth,
offset = 0.1cm 0cm,
delta = 0.2cm 0.7cm
]==]
local target = os.getenv('PAGINATION_TARGET') or 'main.pdf'
if not target:match('%.pdf$') then
target = target..'.pdf'
end
options = options:gsub('\n', '')
tex.print(([==[\includepdf[%s]{%s}]==]):format(options, target))
\end{luacode*}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment