% -*- compile: pdflatex logical_fallacies_for_a4.tex -*-

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Rendering LogicalFallacies infographics as 4xA4 pages PDF which can be
% printed on normal printer and glued together. Before processing download
% http://yourlogicalfallacyis.com/pdf/LogicalFallaciesInfographic_A1.pdf
% and put in the same directory as this file. Then try
%
%    pdflatex logical_fallacies_for_a4.tex
%
% (but read below for possible margin tuning). After printing cut part
% of the margins and glue together.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[a4paper]{article}
\pagestyle{empty}
\usepackage{graphicx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Calculation notes
%
% Original image (A1 version) has no margins and is 
%     2383.94 x 1683.78 pts
% (as for example pdfinfo promptly shows)
% Quarter of it has size
%     1191.97 x 841.89 pts
% (and the same values denote mid-point of the image so appear below as 
%  border points)
%
% A4 landscape page is 297 mm x 210 mm =  842 pt x 595 pt. Therefore
% A4 page minus margin (which we here assume to be 28pt) is
%   (842 - 2 * 28) x (595 - 2 * 28) pt =   786 * 539 pt
%
% Therefore the scaling ratios necessary to fit the image are:
% (horizontal) 786 / 1191.97 = 0.6594...
% (vertical)   539 / 841.89 = 0.6402...
% To avoid skewing we take smaller of those, 0.64 (slightly rounding)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Page margin
\newcommand{\pagemargin}{28pt} % about 1 cm, in points to make calcs easier

% Scaling factor (see above how to calculate it with respect to margin)
\newcommand{\scalingfactor}{0.64}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Remaining code
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Set margins
\usepackage[a4paper,margin=\pagemargin,landscape]{geometry}

% Disable indents and skips
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}

\begin{document}

% Include all 4 quarters of the image, scaling them appropriately

\includegraphics[
   clip=true,
   viewport=0 841.89 1191.97 1683.78,
   scale=\scalingfactor
   ]{LogicalFallaciesInfographic_A1.pdf}

\includegraphics[
    clip=true,
    viewport=0 0 1191.97 841.89,
    scale=\scalingfactor
    ]{LogicalFallaciesInfographic_A1.pdf}

\includegraphics[
    clip=true,
    viewport=1191.97 841.89 2383.94 1683.78,
    scale=\scalingfactor
    ]{LogicalFallaciesInfographic_A1.pdf}

\includegraphics[
    clip=true,
    viewport=1191.97 0 2383.94 841.89,
    scale=\scalingfactor
    ]{LogicalFallaciesInfographic_A1.pdf}

\end{document}
