3

I'm sorry I know this question has been asked several times.

I would like to get a 2 pages on 1 using pgfpages as shown by the following:

\documentclass[french, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[landscape]{geometry}
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}[a4paper,border shrink = 5mm]

But I only get that :

2 pages, one above the other

instead of getting the two pages side by side.

What's wrong ?

\documentclass[french, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage[margin = 1.5cm]{geometry}
\usepackage{babel}
\usepackage{float}
\usepackage{graphicx}
\addto\captionsfrench{\def\figurename{{\textsc{Figure}}}}
\addto\captionsfrench{\def\tablename{{\textsc{Tableau}}}}
\usepackage[official]{eurosym}
\usepackage{color}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{pifont}
\usepackage{fancyhdr}
\usepackage{fancyheadings}
\pagestyle{fancy}
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}[a4paper, border shrink = 5mm, landscape]

%\usepackage{multicol}
%\usepackage{fancybox}
%\usepackage{amsthm}
%\usepackage{amsmath}
%\usepackage{tabvar}
%\usepackage{wrapfig}
%\usepackage[unicode=true,pdfusetitle,%
% bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,%
% breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=true]%
%{hyperref}
\usepackage{hyperref}
\begin{document}
\lipsum


\end{document}
Alan Munn
  • 218,180
imotep81
  • 165

1 Answers1

5

You need to add landscape to the \pgfpagesuselayout command

\pgfpagesuselayout{2 on 1}[a4paper,border shrink = 5mm,landscape]

And remove the [landscape] option from your \usepackage{geometry}.

Here's a minimal document that shows the correct output:

\documentclass[french, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}[a4paper,border shrink = 5mm,landscape]
\begin{document}
\lipsum
\end{document}

output of code

Alan Munn
  • 218,180
  • Sorry Alan and thank you but I obtain the two pages side by side on an a4 portrait – imotep81 Feb 17 '18 at 15:30
  • @imotep81 But then you need to add a compilable minimal document like the one I've added to my answer that shows exactly what you're doing. – Alan Munn Feb 17 '18 at 15:42
  • In fact it's totally correct when I compile with the Texlive of my debian distribution. When I compile with TeXwriter on Android the result is not the one I hoped. Thanks – imotep81 Feb 17 '18 at 16:09
  • Wrong....With your minimal document I get the same also with TeXwriter but with my initial document it doesn't work...Because I use this : \usepackage [unicode=true,pdfusetitle, bookmarks =true, bookmarksnumbered =false, bookmarksopen =false, breaklinks =false, pdfborder= {0 0 0},backref =false, colorlinks =true ] {hyperref } and when I remove it I get what I want – imotep81 Feb 17 '18 at 16:46
  • @imotep81 Again, without you providing a minimal document that shows the problem, it's hard to diagnose. Adding hyperref to my example document doesn't change anything for me. – Alan Munn Feb 17 '18 at 16:49
  • And more...it works if I remove hyperref package. .. – imotep81 Feb 17 '18 at 16:49
  • `\documentclass[french, a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lipsum} \usepackage[margin = 1.5cm]{geometry} \usepackage{babel} \usepackage{float} \usepackage{graphicx}

    \usepackage[official]{eurosym} \usepackage{color} \usepackage{colortbl} \usepackage{xcolor} \usepackage{pifont} \usepackage{fancyhdr} \usepackage{fancyheadings} \pagestyle{fancy} \usepackage{pgfpages} \pgfpagesuselayout{2 on 1}[a4paper, border shrink = 5mm, landscape] \usepackage{ hyperref} \begin{document} \lipsum

    \end{document}`

    – imotep81 Feb 17 '18 at 17:01
  • @imotep81 Don't add it in comments, edit your question. (But this compiles onto a landscape page for me too.) – Alan Munn Feb 17 '18 at 17:01
  • Well...it works if the hyperref is placed before the call of the pgfpages package – imotep81 Feb 17 '18 at 17:23