将一个文本块包裹(跳过)到另一个文本块

将一个文本块包裹(跳过)到另一个文本块

背景。这是关于在烹饪书中格式化食谱页面。页面上的元素包括:(1) 食谱名称/产量,(2) 食谱“故事”,以及 (3) 包含配料和说明的两栏部分。要求是项目 (1) 和 (3) 保留在单个页面上。强烈希望项目 (2)开始在项目 (3) 之前。在某些情况下,较长的项目 (2) 故事可能会将项目 (3) 推到下一页。

问题有没有办法将项目 (2) 的故事分解,使其在项目 (3) 之前开始,但(在选定的几行之后)跳过项目 (3) 并继续?

笔记:我希望印刷警察不要再浪费时间了 :-)。我也不确定这是否是个好主意,但目前正在开发它作为一种选择。我找不到任何似乎适用的“文字环绕图像”示例。

\documentclass[10pt]{book}

\usepackage{enumitem, lipsum, changepage, multicol}                       

\begin{document}

\begin{center}
    {\sffamily\bfseries\fontsize{20}{24}\selectfont Chocolate Hazelnut Biscotti}\\
    \textit{Yield:40}
\end{center}

{\rmfamily\fontsize{12}{14.4}\selectfont
\begin{adjustwidth}{17pt}{17pt}
\lipsum[1]
\end{adjustwidth}
}

\begin{multicols}{2}{
    {
    \setlength{\parskip}{2pt}\sffamily\bfseries
    \obeylines\everypar={\hangindent1em}\raggedright 
        4 ounces unsalted butter, room~temperature     
        2 large eggs, room temperature         
        1 cup granulated sugar         
        1 tsp. vanilla extract        
        1 Tbsp. instant espresso powder        
        1/2 cup cocoa powder, sifted if necessary        
        1 1/2 cups flour       
        1/2 cup almond flour  
        1 tsp. baking soda      
        1/2 tsp. salt  
        1 cup toasted hazelnuts, roughly chopped (or pistachios or almonds)      
        3 ounces bittersweet chocolate, coarsely chopped

    }
    \begin{enumerate}[itemsep=0.5pt,leftmargin=*]
        {
        \item Preheat oven to 350\textdegree{} (325\textdegree{} for convection).  
        Spray baking sheets. 

        \item In a medium bowl, whisk together flour, cocoa, baking soda/powder 
        and salt. Beat the butter and sugar on medium-high speed until light and 
        fluffy.  Add the eggs one at a time and mix well.  Beat in vanilla 
        extract and espresso.   Add dry ingredients and mix until combined before 
        adding nuts and chocolate.  Mix just until incorporated.  Dough will be 
        stiff and sticky.   

        \item Divide dough into 2 equal pieces.  Using as little flour as possible, 
        roll each piece into logs that are 18 inches long.  Flatten to 2" wide.  
        Brush with beaten egg white and sprinkle with sugar.  Bake until firm in 
        the center, about 20-25 minutes.  Cool for about 15 minutes before slicing 
        and second bake.   

        \item With a serrated knife, cut logs into 1/2-inch slices.  Lay on the 
        baking sheets.  Bake for 10 minutes.  Turn biscotti over after 5 minutes.  
        These biscotti harden as they cool, so don't over bake. 

        }   
    \end{enumerate}
 }
\end{multicols} 
\end{document}

在此处输入图片描述

答案1

在此处输入图片描述

\documentclass[10pt]{book}
\usepackage{textcomp}%grrr
\usepackage{enumitem, lipsum, changepage, multicol}                       

\newbox\zzz
\begin{document}

\begin{center}
    {\sffamily\bfseries\fontsize{20}{24}\selectfont Chocolate Hazelnut Biscotti}\\
    \textit{Yield:40}
\end{center}

\setbox\zzz\vbox{\rmfamily\fontsize{12}{14.4}\selectfont
\begin{adjustwidth}{17pt}{17pt}
\lipsum[1]
\end{adjustwidth}
}

\vsplit\zzz to 5\dimexpr 14.4pt\relax\relax


\begin{multicols}{2}{
    {
    \setlength{\parskip}{2pt}\sffamily\bfseries
    \obeylines\everypar={\hangindent1em}\raggedright 
        4 ounces unsalted butter, room~temperature     
        2 large eggs, room temperature         
        1 cup granulated sugar         
        1 tsp. vanilla extract        
        1 Tbsp. instant espresso powder        
        1/2 cup cocoa powder, sifted if necessary        
        1 1/2 cups flour       
        1/2 cup almond flour  
        1 tsp. baking soda      
        1/2 tsp. salt  
        1 cup toasted hazelnuts, roughly chopped (or pistachios or almonds)      
        3 ounces bittersweet chocolate, coarsely chopped

    }
    \begin{enumerate}[itemsep=0.5pt,leftmargin=*]
        {
        \item Preheat oven to 350\textdegree{} (325\textdegree{} for convection).  
        Spray baking sheets. 

        \item In a medium bowl, whisk together flour, cocoa, baking soda/powder 
        and salt. Beat the butter and sugar on medium-high speed until light and 
        fluffy.  Add the eggs one at a time and mix well.  Beat in vanilla 
        extract and espresso.   Add dry ingredients and mix until combined before 
        adding nuts and chocolate.  Mix just until incorporated.  Dough will be 
        stiff and sticky.   

        \item Divide dough into 2 equal pieces.  Using as little flour as possible, 
        roll each piece into logs that are 18 inches long.  Flatten to 2" wide.  
        Brush with beaten egg white and sprinkle with sugar.  Bake until firm in 
        the center, about 20-25 minutes.  Cool for about 15 minutes before slicing 
        and second bake.   

        \item With a serrated knife, cut logs into 1/2-inch slices.  Lay on the 
        baking sheets.  Bake for 10 minutes.  Turn biscotti over after 5 minutes.  
        These biscotti harden as they cool, so don't over bake. 

        }   
    \end{enumerate}
 }
\end{multicols} 

\bigskip

\unvbox\zzz

\end{document}

enter image description here

相关内容