Re: create white box (multiple lines) which adapts to the text width?

Tim Hutt <[email protected]>
Newsgroups gmane.comp.graphics.ipe.general
Message-ID <CAKuVd4AyYXLV9+9Oj_BABMXuxafQwb+SJYda+dQtNcVGAZTK+Q@mail.gmail.com>
On 26 October 2011 12:56, M <Elwood151-S0/[email protected]> 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.