在 Optex 中混合文本和图像

在 Optex 中混合文本和图像

我曾尝试在 Optex 中混合文本和图像,但解决方案远非完美。它会抛出错误 -- Missing } inserted。此外,我不确定使用\valign\vtop(毫不掩饰地从这里) 是这种情况下的最佳选择。

在此处输入图片描述

\putpic 10cm -4.2cm 6cm \nospec {S10.jpg}

\hangindent=-6.5cm \hangafter=0  
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget pretium urna, id congue tortor. Praesent sit amet malesuada est. Curabitur ut euismod libero. Morbi quis turpis eget tortor faucibus accumsan sed non dolor. Sed eu enim gravida, maximus dui a, ornare leo. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent scelerisque lectus metus, tempus maximus elit auctor vel. Ut tincidunt quam quis scelerisque venenatis. Suspendisse non vulputate sem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Curabitur odio magna, venenatis vitae hendrerit eu, laoreet quis sem.

\puttext 9.9cm -1.5\baselineskip{
\valign{%
    \vtop{%
    \hsize60mm
    \raggedright\parindent0pt\tolerance9999
    #
    }
\cr
    \caption/f A colorful bird bathing in the rain.\cr}
}

\hangindent=-6.5cm \hangafter=-2
Cras urna ante, dictum vitae convallis eu, imperdiet pellentesque enim. Mauris lectus elit, dapibus ut augue nec, consectetur interdum justo. Proin sed auctor tellus. Proin in mauris nulla. Praesent tempor lectus nisi, at feugiat lectus dapibus vitae. Donec aliquam eu mi ut consectetur. Proin id consectetur lacus, quis condimentum diam. 


\bye

答案1

恕我直言,\vadjust这里不需要,你只需要把它放在\vtop想要的地方。

问题出在文本的结尾。它必须由或或等\caption来结束。但是显式现在不起作用(我很快就会删除这个错误),所以用作文本分隔符。\cskip\vskip...\_par\_par\puttext\cskip\caption

%\putpic 10cm -4.2cm 6cm \nospec {S10.jpg} % I have no your picture of the bird.

\hangindent=-6.5cm \hangafter=0  
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget pretium urna, id

\puttext 10cm -1\baselineskip{%
    \vtop{
    \hsize60mm
    \raggedright\parindent0pt\tolerance9999
    \caption/f A colorful bird bathing in the rain.
    \cskip}%
}

\hangindent=-6.5cm \hangafter=-2
Cras urna ante, dictum vitae convallis eu, imperdiet pellentesque enim. Mauris lectus elit,

\bye

\puttext更好的解决方案是将图片和标题一起使用。我创建了\vtopstarted by,\kern0pt以便通过图片顶部设置 y 位置(参见参数中的 0pt \puttext)。

\puttext 10cm 0cm {\vtop{\kern0pt
   \hsize=6cm \picw=\hsize
   \inspic {example-image.pdf}  % use your bird here.
   \medskip
   \iindent=0pt  % we don't want to have caption narrower
   \caption/f A colorful bird bathing in the rain.
   \cskip
}}
\nobreak

\hangindent=-6.5cm \hangafter=0  
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget pretium urna, id

\hangindent=-6.5cm \hangafter=-2
Cras urna ante, dictum vitae convallis eu, imperdiet pellentesque enim. Mauris lectus elit,

\bye

如果您不想要居中格式,您可以\let\_narrowlastlinecentered=\ignoreit在之前说。\caption

相关内容