<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<style type="text/css">
/* Quote Levels Colors */
blockquote.cite { color: navy !important; background-color: RGB(245,245,245) !important;
}
blockquote.cite blockquote.cite { color: maroon !important; background-color: RGB(235,235,235) !important;
}
blockquote.cite blockquote.cite blockquote.cite { color: green !important; background-color: RGB(225,225,225) !important;
}
blockquote.cite blockquote.cite blockquote.cite blockquote.cite { color: purple !important; background-color: RGB(215,215,215) !important;
}
blockquote.cite blockquote.cite blockquote.cite blockquote.cite blockquote.cite { color: teal !important; background-color: RGB(205,205,205) !important;
}
</style>
</head>
<body>
Hi Samuel,<br>
<br>
Perhaps attaching scilab scripts to mail is not a good idea. In
combination with the file extension association and the 'host'
command this is prone to misuse.<br>
<br>
Best wishes, <br>
<br>
Jasper.<br>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 8/30/2016 14:11, Samuel Gougeon
wrote:<br>
</div>
<blockquote class=" cite" id="mid_57C57803_6020805_free_fr"
cite="mid:57C57803.6020805@free.fr" type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<div class="moz-cite-prefix">Hi Antoine,<br>
<br>
Le 28/08/2016 09:46, Antoine Monmayrant a écrit :<br>
</div>
<blockquote class=" cite"
id="mid_4390_57c29700_f_92f22b0_135284177"
cite="mid:4390-57c29700-f-92f22b0@135284177" type="cite">
<pre wrap="">Le Samedi, Août 27, 2016 19:24 CEST, philippe <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:rouxph.22@gmail.com"><rouxph.22@gmail.com></a> a écrit:
../..
Thanks Philippe, but nope, it does not work that easily.
It does for "\alpha", but my real use case is a bit more complicated and calling titlepage directly is a mess.
I use titlepage(errormessage) where errormessage is a string array with a lot of starting and trailing " " (white spaces).
I need to preserve these white spaces and use a monospace font to preserve the relative alignment between the different lines in the array.
Doing this is a bit convolved when using titlepage alone:
- add some character at the begining of each line (to prevent titlepage from stripping the white spaces),
- call titlepage,
- get a handle the the create textbox,
- change text justification (middle->lef centered)
- change font style (0 for monospace).
This is what I use now, but titlepage("$\verb| error message |$") would have been more compact and elegant.</pre>
</blockquote>
.<br>
I definitely agree on the fact that xstring() (and xstringb(),
called by titlepage(), <br>
and that are the guilty guys) always trimming all leading spaces
is an issue.<br>
<br>
It should be the user's responsability to use stripblanks()
whenever it is required<br>
before feeding xstring(), and that xstring() does not always do
that in an<br>
irreversible way (text stored in xstring.text is actually
deblanked).<br>
<br>
<font color="#009900">Presently, the text.alignment property can
be either "left", "center" and "right",<br>
the default being "left".<br>
IMO, a new <b>"as_is"</b> or <b>"none"</b> value should be
added, and even become the default.<br>
</font><br>
For the time being, you may test and use the attached version of
titlepage:<br>
As soon as at least one of the strings has a leading space, the
whole matrix<br>
of strings is displayed "as is", in order to preserve any
indentations and so.<br>
To do so, strings are displayed in LaTeX mode. Run<br>
<tt>--> head_comments titlepage // to get details, or see the
header in the script.</tt><tt><br>
</tt><br>
This workaround has 2 drawbacks:<br>
* lines are more compact (IMO too compact). I did not find any
way to tune this in supported LaTeX.<br>
* The font style must be set when calling titlepage(). It can't
be changed with text.font_style,<br>
and must be chosen when calling titlepage(). And only 3 fonts
are available.<br>
But the text.font_foreground attribute works!<br>
<br>
Example:<br>
<tt>t = ["Here are indented nested lists"</tt><tt><br>
</tt><tt>" a) First point"</tt><tt><br>
</tt><tt>" * First item"</tt><tt><br>
</tt><tt>" * Second item"</tt><tt><br>
</tt><tt>" b) Another view"</tt><tt><br>
</tt><tt>" c) For a new titlepage()?"</tt><tt><br>
</tt><tt>]</tt><tt><br>
</tt><tt>clf</tt><tt><br>
</tt><tt>subplot(2,2,1)</tt><tt><br>
</tt><tt>titlepage(t)</tt><tt><br>
</tt><tt>xtitle("Default titlepage(t)")</tt><tt><br>
</tt><tt>subplot(2,2,2)</tt><tt><br>
</tt><tt>// exec() the new titlepage.sci</tt><tt><br>
</tt><tt>titlepage(t)</tt><tt><br>
</tt><tt>subplot(2,2,3)</tt><tt><br>
</tt><tt>titlepage([t ; "" ; t])</tt><tt><br>
</tt><tt>head_comments titlepage<br>
subplot(2,2,4)</tt><tt><br>
</tt><tt>titlepage(t,0)</tt><tt><br>
</tt><tt>e = gce();</tt><tt><br>
</tt><tt>e.font_foreground = color("blue");</tt><tt><br>
clear titlepage // comes back to the default titlepage()<br>
</tt><br>
<b>Results</b>:<br>
<img src="cid:part2.E38093BF.D8372142@amsterchem.com" alt=""
height="347" width="450"><br>
<br>
This can be proposed as is to upgrade the present titlepage(),<br>
even if it would be better to implement ASAP an "as_is" value for
xstring.alignment.<br>
<br>
Cheers<br>
Samuel<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>