[Date Index]
[Thread Index]
[Author Index]
Re: Question about typesetting
*To*: mathgroup at smc.vnet.net
*Subject*: [mg124176] Re: Question about typesetting
*From*: Fred Simons <f.h.simons at tue.nl>
*Date*: Wed, 11 Jan 2012 17:22:00 -0500 (EST)
*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com
*References*: <jeh5ku$r48$1@smc.vnet.net> <201201110920.EAA11280@smc.vnet.net>
Dear Albert,
Yes, I was aware of your CellPrint solution. However, that could not be
used in my problem, where the Row is an element of a Column, something like
Framed[Column[{CellPrint[TextCell[Row[{Button["Buttontext",Null],"
","These sentences form a very long text. These sentences form a very
long text. These sentences form a very long text. These sentences form a
very long text. These sentences form a very long text. These sentences
form a very long text. These sentences form a very long text. These
sentences form a very long text. These sentences form a very long
text."}],"Text"]]}]]
But your solution made me think it over once again, and it turned out
that the following variant does what I am looking for:
Framed[Column[{TextCell[Row[{Button["Buttontext",Null]," ","These
sentences form a very long text. These sentences form a very long text.
These sentences form a very long text. These sentences form a very long
text. These sentences form a very long text. These sentences form a very
long text. These sentences form a very long text. These sentences form a
very long text. These sentences form a very long text."}],"Text"]},
BaseStyle->{FontFamily->"Times"}, ItemSize->60]]
Nevertheless, I do not feel quite happy with this solution. Mathematica
uses some built-in rules on how strings are displayed, Usually they work
fine, but, as in my original question, not always. I was looking for
some techniques to control the way Mathematica displays strings, and I
could only find the LineIndent option, not an option for having line
wrapping as far as possible to the right, or for the second element of a
Row not starting at a new line. The solution as we have it now is simply
to replace the expression by a text cell. In my more than 20 years of
experience with Mathematica I never needed to use a cell in an
expression! I think this solution is pretty rude and lacking the
standard elegance of Mathematica. But it works, and that is fine.
Many thanks and kind regards,
Fred
Op 11-1-2012 10:20, A Retey schreef:
> Hi,
>
>
>> When we have a text cell with a few lines of text and when we insert a
>> button in the very beginning, then of course the text starts immediately
>> behind the button and wraps without indention over the lines of the
>> cell, as far to the right as possible.
>>
>> I want to achieve the same layout by means of a kernel command. The best
>> I could find is
>>
>> In[4]:= Style[Row[{Button["Buttontext",Null]," ","These sentences form a
>> very long text. These sentences form a very long text. These sentences
>> form a very long text. These sentences form a very long text. These
>> sentences form a very long text. These sentences form a very long text.
>> These sentences form a very long text. These sentences form a very long
>> text. These sentences form a very long text."}], LineIndent->0]
>>
>> There is no indention at the left hand side of the output cell. But the
>> soft line breaks in the string are not as far to the right as possible,
>> and the display of the string starts at a new line instead of straight
>> after the button.
>>
>> It seems to me that it must be possible to arrive at the same layout as
>> a text cell. Maybe there is a simple solution, but I cannot find it. Can
>> someone give me a hint?
>>
> Not sure whether I fully understand your problem, but this should do
> what you describe (note that my or your mailer will probably add some
> line breaks to the long string, you need to get rid of them before
> trying the code below...):
>
> CellPrint[
> TextCell[Row[{Button["Buttontext", Null], " ",
> "These sentences form a very long text. These sentences form a \
> very long text. These sentences form a very long text. These \
> sentences form a very long text. These sentences form a very long \
> text. These sentences form a very long text. These sentences form a \
> very long text. These sentences form a very long text. These \
> sentences form a very long text."}], "Text"]]
>
> hth,
>
> albert
>
>
>
> -----
> Geen virus gevonden in dit bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 2012.0.1901 / Virusdatabase: 2109/4735 - datum van uitgifte: 01/10/12
>
>
> .
>
Prev by Date:
**Re: The domain parameter of Reduce[]**
Next by Date:
**import issue**
Previous by thread:
**Re: Question about typesetting**
Next by thread:
**Memory usage of a Sierpinski triangle algorithm**
| |