6

Very new to tex, and trying to use xcookybooky to layout a few recipes for printing. I'd like to print on square pages, specifically 11in by 11in, but when I set paperwidth and paperheight for the geometry package like:

\usepackage[paperwidth=11in,paperheight=11in]{geometry}

I just seem to have extra whitespace on the right when running pdflatex.

I can't seem to find any option in xcookybooky documentation, is there a more "global" tex option I should be setting to get the contents to fill the pagewidth?

EDIT: Adding MWE, mostly taken from the xcookybooky example https://github.com/SvenHarder/xcookybooky/tree/master/example

\documentclass{article}
\usepackage[paperwidth=11in,paperheight=11in]{geometry}

% encoding, font, language
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[ngerman, english]{babel}


\usepackage{nicefrac}

\usepackage[
    nowarnings,
    %myconfig
]
{xcookybooky}

\begin{document}
% Complete recipe example


\begin{recipe}
[% 
    preparationtime = {\unit[1]{h}},
    portion = {\portion{6}},
]
{Rice and Lamb}



    \introduction{%
      Introduction to the dish
    }

    \ingredients{%
        \unit[2]{tbsp} & Vegetable Oil\\
        3 & Onion, chopped\\
        2 pound & Stewing Lamb or Beef\\
        \unit[1]{tbsp} & Minced Garlic\\
        \unit[2]{tsp} & Salt\\
        \unit[8]{cups} & Water\\
        \unit[1.5]{tbsp} & Ground Cardamom\\
    }

    \preparation{%
      \step Do some things
      \step Do some other things
      \step Finish doing things
    }

\end{recipe}

\end{document} 

Thanks

  • 2
    Welcome to TeX.SE! I think you need marginparsep=0pt, marginparwidth=0pt, but please add a minimal working example (MWE). – CarLaTeX Oct 25 '18 at 5:16
  • Thanks CarLaTex, added MWE above. Tried to add marginparsesep and marginparwidth but didn't see any changes. Thanks! – Peck Oct 25 '18 at 15:18
  • @Peck some of the problems can be repaired with \usepackage{xcookybooky} \setlength{\textwidth}{8.5in} \setlength{\textheight}{8.5in}, but the real problem is that xcookbooky has a lot of hard coded stuff... – samcarter_is_at_topanswers.xyz Oct 25 '18 at 15:33
  • ah, thanks @samcarter, I'm open to using anything else, this is just helping a friend out with a charity cookbook project and learning some tex (in a way beyond just pushing to it from Pandoc). I'd be open to using other packages if there are more flexible options that give something similar as far as layout. – Peck Oct 25 '18 at 15:40
  • 1
    @Peck You can find some related package suggestions at ctan.org/recommendations/xcookybooky Personally I find xccokybooky the best looking, but doing non-standard stuff is not easy and it is no longer compatible with up-to-date latex distributions. – samcarter_is_at_topanswers.xyz Oct 25 '18 at 15:44
5

Copy xcookybooky.sty in the working directory and edit it so that the lines

\setlength{\textwidth}{15.5cm}
\setlength{\textheight}{24.0cm}
\setlength{\topmargin}{-0.8cm}
\setlength{\headheight}{14pt} %0cm
\setlength{\headsep}{1cm}
\setlength{\topskip}{0cm}
\setlength{\footskip}{1.4cm}
\setlength{\evensidemargin}{-0.5cm}
\setlength{\oddsidemargin}{0.5cm}
\setlength{\voffset}{0cm}
\setlength{\hoffset}{0cm}

become

\@ifpackageloaded{geometry}{}{%
  \setlength{\textwidth}{15.5cm}%
  \setlength{\textheight}{24.0cm}%
  \setlength{\topmargin}{-0.8cm}%
  \setlength{\headheight}{14pt}%0cm
  \setlength{\headsep}{1cm}%
  \setlength{\topskip}{0cm}%
  \setlength{\footskip}{1.4cm}%
  \setlength{\evensidemargin}{-0.5cm}%
  \setlength{\oddsidemargin}{0.5cm}%
  \setlength{\voffset}{0cm}%
  \setlength{\hoffset}{0cm}%
}

Thus, if geometry is loaded before xcookybooky, the package will set page parameters not according to its own ideas, but the user's.

You also need a fix to avoid a spurious error when using xcookybooky with TeX Live 2018 (that has an updated version of lettrine).

\documentclass{article}
\usepackage[paperwidth=11in,paperheight=11in,margin=1in]{geometry}

% encoding, font, language
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[ngerman, english]{babel}


\usepackage{nicefrac}

\usepackage[
    nowarnings,
    %myconfig
]
{xcookybooky}

% fix from https://tex.stackexchange.com/a/445886/
\renewcommand{\step}
{%
    \stepcounter{step}%
    \lettrine
    [%
        lines=2,
        lhang=0,          % space into margin, value between 0 and 1
        loversize=0.15,   % enlarges the height of the capital
        slope=0em,
        findent=1em,      % gap between capital and intended text
        nindent=0em       % shifts all intended lines, begining with the second line
    ]{\thestep}{}%
}

\begin{document}
% Complete recipe example


\begin{recipe}
[% 
    preparationtime = {\unit[1]{h}},
    portion = {\portion{6}},
]
{Rice and Lamb}



    \introduction{%
      Introduction to the dish
    }

    \ingredients{%
        \unit[2]{tbsp} & Vegetable Oil\\
        3 & Onion, chopped\\
        2 pound & Stewing Lamb or Beef\\
        \unit[1]{tbsp} & Minced Garlic\\
        \unit[2]{tsp} & Salt\\
        \unit[8]{cups} & Water\\
        \unit[1.5]{tbsp} & Ground Cardamom\\
    }

    \preparation{%
      \step Do some things
      \step Do some other things
      \step Finish doing things
    }

\end{recipe}

\end{document} 

enter image description here

| improve this answer | |

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.