5

The leaflet documentation explicitly mentions TeX, pdfTeX and VTeX; documents (e.g., leaflet-manual.tex included in TeXLive2016) don't compile properly with lualatex. Any chance to use leaflet with lualatex? I'd rather avoid to install the otf fonts and style files for pdflatex on my box but really need a leporello/flyer.

To make things really strange, my file compiles fine with lualatex under TeXLive2015, but fails under TeXLive2016: Instead of a full leporello, the following minimum example leads to just two columns of text instead of six columns evenly spaced on two A4 pages. Strange, isn't it?

This is an example:

\documentclass{leaflet}
\usepackage{lipsum}
\begin{document}
\lipsum

\lipsum

\lipsum

\lipsum

\lipsum

\lipsum

\lipsum

\lipsum
\end{document}
  • 2
    I’ve often used leaflet with luatex. Have you tried removing lines like \usepackage[T1]{fontenc} from the manual? – Thérèse Aug 31 '16 at 9:33
  • 2
    Hmmm. It seems to keep overwriting the first two pages. As a work-around, you can get a flyer by using the nocombine option of the leaflet class, and then making another document, using the article class and the landscape option, with \usepackage{pdfpages} and \includepdf[nup=3x1, pages={5,6,1}]{output.pdf}, \includepdf[nup=3x1, pages={2,3,4}]{output.pdf}. – Thérèse Aug 31 '16 at 19:21
  • 1
    Option nocombine leads to a pdf with all columns of the leporello on their own pages, as expected. Older versions of leaflet.cls also cause the wrong output otherwise with current TeXLive, so this looks like a regression in lualatex (or one of the packages included by leaflet.cls ...). – Ernst M. Sep 1 '16 at 9:06
3

Obsolete with actual leaflet version

This answer became obsolete with the actual leaflet 1.1b (2017-03-17) on CTAN.

Please update your leaflet to use it with luaLaTeX.

Old answer

I found a patch to use leaflet.cls with lualatex in TeXlive 2016.

Below a MWE.

It redefine a part of leaflet.cls (version v1.1a), my modification is marked with insertion start to insertion end

\documentclass[english]{leaflet}
\makeatletter
\@ifundefined{Gin@driver}{}%
{%
  \ifx\Gin@driver\@empty\else%
    \filename@parse{\Gin@driver}\@tempswafalse%
    \def\reserved@a{dvips}%
    \ifx\filename@base\reserved@a\@tempswatrue\fi%
    \def\reserved@a{dvipdfm}%
    \ifx\filename@base\reserved@a\@tempswatrue\fi%
    \if@tempswa
      \ClassInfo{leaflet}{Generating code for dvips}%
      \def\LL@pagesize@specials#1#2{%
        \@tempdima=#1\@tempdimb=#2%
        \AtBeginDvi{\special{papersize=\the\@tempdima,\the\@tempdimb}}}%
    \fi
    \def\reserved@a{pdftex}%
    \ifx\filename@base\reserved@a
      \ClassInfo{leaflet}{Generating code for pdfTeX}%
      \def\LL@pagesize@specials#1#2{%
        \@tempdima=#1\@tempdimb=#2%
        \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}%
    \fi
    \def\reserved@a{xetex}%
    \ifx\filename@base\reserved@a
      \ClassInfo{leaflet}{Generating code for XeTeX}%
      \def\LL@pagesize@specials#1#2{%
        \@tempdima=#1\@tempdimb=#2%
        \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}%
    \fi
%% insertion start %%%%%%%%%    
    \def\reserved@a{luatex}%
    \ifx\filename@base\reserved@a
      \RequirePackage{luatex85}
      \ClassInfo{leaflet}{Generating code for LuaTeX}%
      \def\LL@pagesize@specials#1#2{%
        \@tempdima=#1\@tempdimb=#2%
        \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}%
    \fi
%% insertion end %%%%%%%%%    
    \def\reserved@a{vtex}%
    \ifx\filename@base\reserved@a
      \ClassInfo{leaflet}{Generating code for VTeX}%
      \def\LL@pagesize@specials#1#2{%
        \@tempdima=#1\@tempdimb=#2%
        \mediawidth\@tempdima\mediaheight\@tempdimb}%
    \fi
  \fi
}
\makeatother
%%And here follows your code
\usepackage{lipsum}
\begin{document}
\lipsum

\lipsum

\lipsum

\lipsum

\lipsum

\lipsum

\lipsum

\lipsum
\end{document}

It works in my installation, but I don't really know what I made :)

The author of leaflet.cls was informed about this patch and the leaflet-package is updated.

  • Thank you loads. Indeed, with the current version of leaflet.cls, things work like a charm. Surprinsingly, the current leaflet reports to be "leaflet 2015/12/27 v1.1a LaTeX document class (JS,WaS,RN,HjG)" which made me look things up to find tlmgr has done a perfect job of keeping my local TeXLive up-to-date. Again, thank you very much. – Ernst M. Mar 20 '17 at 17:20
  • Yes, the version number didn't update. There is an internal remark, that the version changes if the documentation changes. Can you please accept the answer (or your answer)? Then the question is marked as "solved" – knut Mar 20 '17 at 19:12
0

With the current version of leaflet, things work like a charm together with lualatex. Many thanks to the maintainers of these fine tools.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.