I'm currently using the package "xcookybooky" and it uses the wraptable environment for the ingredients list. Now the problem is: if the recipe starts near the end of the page, the wraptable ignores the margin and pagebreak and "disappears" into the latter. I've found a workaround for it at Wrapfig w/ Non-Ugly Page Breaks but unfortunately I'm too much of a noob in LaTeX to be able to adjust the solution given for wraptable (and I don't have enough reputation to make a comment with my question there).
Can someone please help me adjust the solution to work for wraptable?
example:
\documentclass{article}
% !TEX encoding = UTF-8
\usepackage[T2A,T1]{fontenc}
\usepackage[german]{babel}
\usepackage{xcookybooky}
\usepackage[utf8]{inputenc}
\begin{document}
a
\vspace{18cm}
\begin{recipe}[bakingtime={\unit[15]{min}},
bakingtemperature={\protect\bakingtemperature{topbottomheat=\unit[220]{$^\circ$C}}}]{Flammkuchen}
\ingredients[5]{
\unit[]{} & \textbf{Für den Teig}\
\unit[200]{g} & Mehl\
\unit[2]{EL} & Öl\
\unit[1]{TL} & Salz\
\unit[125]{ml} & Wasser\
\unit{} & \textbf{Für den Belag}\
\unit[400]{g} & Crème fraîche \
\unit{} & weiterer Belag
}
\preparation{
}
\end{recipe}
\begin{recipe}[bakingtime={\unit[15]{min}},
bakingtemperature={\protect\bakingtemperature{topbottomheat=\unit[220]{$^\circ$C}}}]{Flammkuchen}
\ingredients[5]{
\unit[]{} & \textbf{Für den Teig}\
\unit[200]{g} & Mehl\
\unit[2]{EL} & Öl\
\unit[1]{TL} & Salz\
\unit[125]{ml} & Wasser\
\unit{} & \textbf{Für den Belag}\
\unit[400]{g} & Crème fraîche \
\unit{} & weiterer Belag
}
\preparation{
}
\end{recipe}
\end{document}
ingredients is coded in the following way in xcookybooky:
\newcommand*{\ingredients}[2][\empty]
{% The optional argument contains the number of lines
\def\xcb@ingredientslines{#1}
\def\xcb@ingredients
{%
\xcb@name@inghead
\\[1em]
{\xcb@fontsize@ing\color{\xcb@color@ing}
\begin{tabulary}{\xcb@ingredientswidth}{rL}
#2
\end{tabulary}}
}
}
and
\begin{wraptable}[\xcb@ingredientslines]{r}{\xcb@ingredientswidth}
{% Use the given line number by the user
\vspace{-1em} % same height of ingredients and preparation
\xcb@hook@preingredients
\xcb@ingredients
\xcb@hook@postingredients
}
\end{wraptable}
I've tried changing \RequirePackage{wrapfig} to \RequirePackage{wrapfig} which is given in the link above. It didn't help.
wraptableis in total\def\wraptable{\wrapfloat{table}}any changes to thewrapfigurepackage made there would apply towrapfigureandwraptableIf you have an example that does not work, you should show it otherwise I don't know what answer can be given here. – David Carlisle Mar 11 '22 at 16:20