2

I am trying to print out a cheatsheet of sorts with the content of multiple recitations. pdfpages should be able to do exactly what I need, with the 'nup' setting of the \includepdf tag.

However, I'm having a layout issue since the recitations are written in Hebrew, which requires a right-to-left sort of layout (meaning, the included PDF pages should appear from right to left).

So for example, achieving a "right-to-left" sort of behavior in columns, would look something like this:

\includepdf[pages={7-9,4-6,1-3}, column=true, nup=3x3,landscape=true, pagecommand=\subsection*{}]{Recitation 1 - Complexity.pdf}

and a regular RTL layout would look like this:

\includepdf[pages={3-1,6-4,9-7}, nup=3x3,landscape=true, pagecommand=\subsection*{}]{Recitation 1 - Complexity.pdf}

as opposed to just writing "pages={1-9}".

I have no idea how to automate this, and using the regular LTR layout would make this cheatsheet annoying to use for Hebrew native speakers (I guess a proper solution would also be useful for all RTL language speakers).

How could the proper RTL behavior be achieved? Is there some sort of workaround?

Thank you in advance!

Here's a sketch of what the total RTL layout should look like: RTL Layout 3x3

2
  • Can you make a sketch where each page number should end up? Commented Jan 24, 2023 at 12:22
  • Thank you for your assistance! I added the sketch to my question.
    – Hitori
    Commented Jan 24, 2023 at 12:42

1 Answer 1

0

A possible workaround could be to use the pdfpages package to include the full size pages and then use the pgfpages package to arrange 9 pages per page.

The pgfpages package allows to define arbitrary layouts, so you could create ones for LTR rows and columns. Here an example:

\documentclass{article}

\usepackage{pdfpages}

\usepackage{pgfpages}
  
\pgfpagesdeclarelayout{9 on 1 RTL columns}
{
  \edef\pgfpageoptionheight{\the\paperheight} % landscaped by default
  \edef\pgfpageoptionwidth{\the\paperwidth}
  \def\pgfpageoptionborder{0pt}
}
{
  \pgfpagesphysicalpageoptions
  {%
    logical pages=9,%
    physical height=\pgfpageoptionheight,%
    physical width=\pgfpageoptionwidth%
  }
  \pgfpageslogicalpageoptions{1}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.833\pgfphysicalwidth}{0.833\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{4}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.5\pgfphysicalwidth}{0.833\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{7}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.166\pgfphysicalwidth}{0.833\pgfphysicalheight}%
  }%  
  \pgfpageslogicalpageoptions{2}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.833\pgfphysicalwidth}{0.5\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{5}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.5\pgfphysicalwidth}{0.5\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{8}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.166\pgfphysicalwidth}{0.5\pgfphysicalheight}%
  }%    
  \pgfpageslogicalpageoptions{3}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.833\pgfphysicalwidth}{0.166\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{6}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.5\pgfphysicalwidth}{0.166\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{9}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.166\pgfphysicalwidth}{0.166\pgfphysicalheight}%
  }%    
}
    
\pgfpagesdeclarelayout{9 on 1 RTL rows}
{
  \edef\pgfpageoptionheight{\the\paperheight} % landscaped by default
  \edef\pgfpageoptionwidth{\the\paperwidth}
  \def\pgfpageoptionborder{0pt}
}
{
  \pgfpagesphysicalpageoptions
  {%
    logical pages=9,%
    physical height=\pgfpageoptionheight,%
    physical width=\pgfpageoptionwidth%
  }
  \pgfpageslogicalpageoptions{1}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.833\pgfphysicalwidth}{0.833\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{2}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.5\pgfphysicalwidth}{0.833\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{3}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.166\pgfphysicalwidth}{0.833\pgfphysicalheight}%
  }%  
  \pgfpageslogicalpageoptions{4}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.833\pgfphysicalwidth}{0.5\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{5}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.5\pgfphysicalwidth}{0.5\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{6}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.166\pgfphysicalwidth}{0.5\pgfphysicalheight}%
  }%    
  \pgfpageslogicalpageoptions{7}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.833\pgfphysicalwidth}{0.166\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{8}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.5\pgfphysicalwidth}{0.166\pgfphysicalheight}%
  }%
  \pgfpageslogicalpageoptions{9}
  {%
    border shrink=\pgfpageoptionborder,%
    resized width=.33\pgfphysicalwidth,%
    resized height=.33\pgfphysicalheight,%
    center=\pgfpoint{0.166\pgfphysicalwidth}{0.166\pgfphysicalheight}%
  }%    
}    
  



\begin{document}

\pgfpagesuselayout{9 on 1 RTL columns}[landscape]

\includepdf[pages=1-]{example-image-a4-numbered}

\pgfpagesuselayout{9 on 1 RTL rows}

\includepdf[pages=1-]{example-image-a4-numbered}
  
\end{document}

enter image description here

2
  • Thank you so much for your solution! It works great.
    – Hitori
    Commented Jan 30, 2023 at 22:26
  • @Hitori You're welcome! Commented Jan 30, 2023 at 22:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .