如何让文本流至页面的另一部分?

如何让文本流至页面的另一部分?

我有一个包含表格、长数学和枚举的烦人的段落,我想让它们在页面的两个区域之间流动。以下是我想要实现的示例:

不连贯的文本流

我想我可以通过小型页面来做到这一点,但我不知道如何将两者关联起来。

答案1

以下是使用的示例parshape

在此处输入图片描述

代码:

\documentclass{article}

\begin{document}
\parshape=13
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0pt \textwidth
\noindent
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. 
Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer 
id, vulputate a, magna. 
Donec vehicula augue eu neque. 
Pellentesque habitant morbi tristique senectus et netus et malesuada 
fames ac turpis egestas.
\end{document}

如果您希望在文本周围添加方框,那么我只知道如何使用以下方法tikz

在此处输入图片描述

笔记:

  • \lipsum我需要添加文本以\sloppy使 TeX 在 的范围内换行\parshape。如您在上面的版本中看到的,第二个框中的一些文本突出到右侧。

代码:

\documentclass{article}

\usepackage{xparse}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

\newcommand*{\TopTweak}{0.7\baselineskip}
\newcommand*{\BotTweak}{0.3\baselineskip}
\newcommand*{\RightTweak}{1pt}
\newcommand*{\LeftTweak}{1pt}
\newcommand*{\InnerSep}{3pt}
\NewDocumentCommand{\DrawBoxes}{%
   O{}% #1 = options for first box
   O{}% #2 = options for second box
   m %  #3 = top mark
   m %  #4 = total number of lines in parshape
   m %  #5 = number of lines in first box
   m %  #6 = offset of first section
   m %  #7 = width of first section
   m %  #8 = offset of second section
   m %  #9 = width of second section
}{%
    \begin{tikzpicture}[overlay, remember picture]
        \coordinate (First Box Top Left) at 
                ($(#3)+
                (-\LeftTweak,\TopTweak) + 
                (-\InnerSep,\InnerSep)$);
        \coordinate (First Box Bottom Right) at 
                ($(#3) +
                (\RightTweak,-\numexpr#5-1\relax*\baselineskip)+
                (#7,-\BotTweak)+
                (2*\InnerSep,-\InnerSep)$);
                
        \draw [#1] (First Box Top Left) rectangle (First Box Bottom Right);
        
        \coordinate (Second Box Top Left) at 
                ($(#3)+
                (#8,-\numexpr#5\relax*\baselineskip)+
                (-\LeftTweak,\TopTweak)+ 
                (-\InnerSep,\InnerSep)$);
        \coordinate (Second Box Bottom Right) at 
                ($(Second Box Top Left) + 
                (#9,0)+
                (2*\RightTweak,-\numexpr#4-#5-1\relax*\baselineskip)+
                (2*\InnerSep,-\InnerSep)$);
                
        \draw [#2] (Second Box Top Left) rectangle (Second Box Bottom Right);
    \end{tikzpicture}%
}


\begin{document}
\parshape=14
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0pt \textwidth
\noindent\tikzmark{top mark}\sloppy%
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. 
Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer 
id, vulputate a, magna. 
Donec vehicula augue eu neque. 
Pellentesque habitant morbi tristique senectus et netus et malesuada 
fames ac turpis egestas.
\DrawBoxes[draw=red, thick][draw=blue, thick]
    {top mark}{14}{6}
    {0pt}{0.4\textwidth}
    {0.6\textwidth}{0.35\textwidth}%
\end{document}

答案2

在此处输入图片描述

并不是真正的纯乳胶标记但是......

\documentclass{article}

\begin{document}

\setbox0\vbox{\hsize=3cm\raggedright
1 The quick brown fox jumps over the lazy dog.
2 The quick brown fox jumps over the lazy dog.
3 The quick brown fox jumps over the lazy dog.
4 The quick brown fox jumps over the lazy dog.
5 The quick brown fox jumps over the lazy dog.
6 The quick brown fox jumps over the lazy dog.
7 The quick brown fox jumps over the lazy dog.
8 The quick brown fox jumps over the lazy dog.
}

\setbox2\vsplit0 to 3cm

\fbox{\begin{picture}(250,300)


\put(10,200){\fbox{\box2}}

\put(120,30){\fbox{\box0}}


\end{picture}}

\end{document}

答案3

这是一个使用输出例程的版本。它几乎是人们能得到的最基本的框架,因此缺少一些粘合和适当的\hsize处理等等。但想法是存在的。

\catcode`\@=11
\newdimen\gutter
\def\pagebody{
  \setbox0\vsplit\@cclv to.5\vsize % split the box no. 255 half into box0
  \vbox to\vsize{
    \unvbox0 \vfil
    \kern-2\baselineskip % back up a little to display vertical overlap
    \moveright\dimexpr\hsize+\gutter\box\@cclv \vfil}}
\catcode`\@=12

\gutter=1cm
\hsize=\dimexpr.5\hsize-\gutter
\pdfpageheight=.3\pdfpageheight % just to keep it shorter
\vsize=.5\pdfpageheight % ditto

\input knuth \par\input knuth
\bye

在此处输入图片描述

相关内容