[Ipe-discuss] create white box (multiple lines) which adapts to the text width?

Tim Hutt tdhutt at gmail.com
Wed Oct 26 14:18:59 CEST 2011


On 26 October 2011 12:56, M <Elwood151 at web.de> wrote:
>
> And if I use a type: minipage object, I have to define the width by hand
> (that's what I want to avoid).

Yeah... but how else would the paragraph width be defined? Or do you
want the paragraphs to never break and only occupy one line? I
couldn't quite get it to work, but start with something like this:

Preamble:


\newlength{\parawidth}

\newcommand{\whitepara}[1]{
\settowidth{\parawidth}{#1}
\colorbox{white}{\parbox{\parawidth}{#1}}
}

In a paragraph object (minipage type label):

\whitepara{My paragraph \\ another paragraph}

It doesn't really work because \settowidth doesn't split stuff up into
paragraphs. If your latex-foo is strong then you may be able to write
code to split #1 into an array of paragraphs, call \settowidth on each
and select the maximum. I have no idea how though.


More information about the Ipe-discuss mailing list