1 Nov 2004 05:34

### Re: Re: Dash-transformation

[David Goodger]
>> I don't know about inserting a set of predefined substitution
>> definitions into the parser.  But we could certainly include a set
>> of substitution files in Docutils.  Then the author could do:
>>
>>      .. include:: <dashes.txt>

[Felix Wiemann]
> I'm not sure if the benefit is big enough enough to justify the
> effort of adding such a feature and maintaining a set of 'standard'
> substitution files.

I think it may be justified, although it doesn't have to be done right
away.  I'm -1 on adding any built-in substitution definitions; a set
of standard substitution definition files is the closest I'd agree to.

> But what about multi-line unicode definitions?  Recognize the option
> iff the last line is ':trim:'?

That's not an issue.  It's taken care of by the directive parsing
code.  I added a "trim" option to the "unicode" directive; it doesn't
do anything except set an attribute.  Here's the result:

$quicktest.py <<EOF .. |x| unicode:: U+0041 U+0042 :trim: |x| EOF  (Continue reading) 2 Nov 2004 23:20 ### Re: Re: Dash-transformation I just implemented new options for the "unicode" directive: "ltrim", "rtrim", and "trim" (trim whitespace from the left, right, or both sides of substitution references when applied). Example: Insert an em-dash |---| automatically trimming whitespace. Some substitutions |TM| only need trimming on one side. .. |---| unicode:: U+02014 :trim: .. |TM| unicode:: U+02122 :ltrim: See <http://docutils.sf.net/docs/ref/rst/directives.html#unicode>. -- -- David Goodger <http://python.net/~goodger>  3 Nov 2004 08:05 ### Re[2]: multiple arguments for raw directive Alan Isaac wrote: >> it would be nice to be able to provide a comma separated tuple >> as the argument for raw. E.g., >> .. raw:: latex,html >> would be useful. On Tue, 02 Nov 2004, David Goodger apparently wrote: > I don't see how. This would be a stop gap, but I think it provides a pretty good way to respond to a current problem while keeping a clear path to the future. The Problem: how to include math (today!) in reST in way that i. passes the *same* math to LaTeX and to XHTML/MathML. ii. maintains the readability of reST A Proposed Short-Run Solution: allow a comma separated tuple as the argument for raw. E.g., .. raw:: latex,html The Intent: pass the *same* display equation "raw" to HTML and to LaTeX. Why This Apparent Nonsense Makes Good Sense: Note that itex2MML processes HTML+LaTeX (actually, itex) into XHTML+MathML. (See http://pear.math.pitt.edu/mathzilla/itex2mmlFrag.html ) For document generation, this Proposed Short-Run Solution  (Continue reading) 3 Nov 2004 15:37 ### Re: multiple arguments for raw directive [Alan G Isaac] > Hope that's clearer. Yes, thanks. I wasn't aware that itex2mml handled itex embedded in HTML. The "raw" directive now accepts multiple format types, separated by spaces (not commas). For example: .. raw:: latex html $\sum_{n=1}^\infty \frac{1}{n} \text{ etc.}$ It is a stopgap measure, but then so is the "raw" directive itself. Implemented in CVS, and available in the snapshot. -- -- David Goodger <http://python.net/~goodger>  4 Nov 2004 16:24 ### need a :raw:role This is a request for one more stop gap. I believe this is the last real barrier to being able to write math filled documents for multiple formats. In order to pass math *inline* to itex2mml and to LaTeX, I need a supporting text role. For now, it seems natural to allow passing raw text, so I could type :raw:$x^2$ and have those five characters passed raw into my documents. So that is my feature request. Thanks for considering this. Alan Isaac PS I will mention an alternative that may be attractive. It would be very natural and more readable to type that instead as :itex:x^2 and for now to simply write that as$x^2$from both the latex and html writer (i.e., raw except for the surrounding$s).  That looks forward to a future writer
that would interpret the itex (perhaps by drawing on the
Mozilla parser) and directly write XHTML+MathML etc.

-------------------------------------------------------
This SF.Net email is sponsored by:
LinuxWorld Reader's Choice Award Winner for best database on Linux.


4 Nov 2004 18:24

### Re: need a :raw:role


Alan G Isaac wrote:

>This is a request for one more stop gap.
>I believe this is the last real barrier to
>being able to write math filled documents
>for multiple formats.
>
>In order to pass math *inline* to itex2mml
>and to LaTeX, I need a supporting text role.
>For now, it seems natural to allow passing
>raw text, so I could type :raw:$x^2$ and have
>those five characters passed raw into my
>documents.
>
>So that is my feature request.
>Thanks for considering this.
>
>Alan Isaac
>
>PS I will mention an alternative that may be attractive.  It
>would be very natural and more readable to type that instead
>as :itex:x^2 and for now to simply write that as $x^2$
>from both the latex and html writer (i.e., raw except for
>the surrounding $s). That looks forward to a future writer >that would interpret the itex (perhaps by drawing on the >Mozilla parser) and directly write XHTML+MathML etc. > > >  (Continue reading) 4 Nov 2004 18:56 ### Re[2]: need a :raw:role On Thu, 04 Nov 2004, "Colin J. Williams" apparently wrote: > It's not clear to me just what is intended by passing math inline. > Does it mean passing latex code? One of the 'todo' items for reST is to allow inclusion of math in a way that allows generation of documents in many different formats. David recently made it possible to pass itex statements to multiple formats by allowing multiple arguments to the 'raw' directive. If you pass itex raw to HTML documents you can produce XHTML+MathML using itex2mml http://pear.math.pitt.edu/mathzilla/itex2mmlItex.html If you pass it raw to LaTeX documents then you get math in your LaTeX documents. (This requires some qualification for arrays.) This plays to the strengths of reST. "Passing math inline" could mean anything compatible with reST. Until the best way is figured out, I have proposed a stopgap: letting authors use a 'raw' role to pass it as they see fit. This is now working for the 'raw' directive, so adding the role fills a gap very naturally. > LyX offers a WYSIWYG process for entering math statements > (and other stuff), does that offer a more user friendly > approach? There are of course reasons to use reST instead of other types of markup. (E.g., think about doc strings for a math module.) Additionally, itex is quite friendly.  (Continue reading) 4 Nov 2004 19:43 ### Re: need a :raw:role Alan G Isaac wrote: On Thu, 04 Nov 2004, "Colin J. Williams" apparently wrote: It's not clear to me just what is intended by passing math inline. Does it mean passing latex code? One of the 'todo' items for reST is to allow inclusion of math in a way that allows generation of documents in many different formats. David recently made it possible to pass itex statements to multiple formats by allowing multiple arguments to the 'raw' directive. If you pass itex raw to HTML documents you can produce XHTML+MathML using itex2mml http://pear.math.pitt.edu/mathzilla/itex2mmlItex.html If you pass it raw to LaTeX documents then you get math in your LaTeX documents. (This requires some qualification for arrays.) This plays to the strengths of reST. "Passing math inline" could mean anything compatible with reST. Until the best way is figured out, I have proposed a stopgap: letting authors use a 'raw' role to pass it as they see fit. This is now working for the 'raw' directive, so adding the role fills a gap very naturally. Thanks, Itex still seems to require texnician skills. I was hoping that some WYSIWYG way could be added to DocFactory. LyX offers a WYSIWYG process for entering math statements (and other stuff), does that offer a more user friendly approach? There are of course reasons to use reST instead of other types of markup. (E.g., think about doc strings for a math module.) Additionally, itex is quite friendly. This adds various$ and \ characters to the mix and makes the reading of source
code more difficult.

I have the first draft of a matrix related document which I have prepared using LyX,
but would like to have something  which fits in the reST scheme.

Thanks again,

Colin W.
Cheers, Alan Isaac ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Docutils-users mailing list Docutils-users <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/docutils-users

------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

4 Nov 2004 20:49

### Re[2]: need a :raw:role

On Thu, 04 Nov 2004, "Colin J. Williams" apparently wrote:
> Itex still seems to require texnician skills.

As much or little as you wish.

> I was hoping that some WYSIWYG
> way could be added to DocFactory.

WYSIWYG is a different project, for sure.
(I might add that even LyX is WYSIWYM.)

> This adds various $and \ characters to the mix and makes > the reading of source code more difficult. Again, that depends. i. I proposed a 'raw' role, which wd require the$s,
but an alternative would be an 'itex' role, which
would not (leaving it to the writers to write them).
As for the backslashes and braces, I see no way around
this if you want to read math in a plain text
document.  But how hard would it be to read, e.g.,
blah blah  let :itex:f(x)= a_0 + a_1 x + a_2 x^2

> I have the first draft of a matrix related document which
> I have prepared using LyX, but would like to have
> something  which fits in the reST scheme.

Already you can copy any displayed equations *directly*
into a reST document using the 'raw' directive.

hth,
Alan Isaac

-------------------------------------------------------
This SF.Net email is sponsored by:
LinuxWorld Reader's Choice Award Winner for best database on Linux.

5 Nov 2004 03:12

### Re[3]: need a :raw:role

El 04/11/2004 a las 14:56, Alan G Isaac <aisaac <at> american.edu> dijo, en
su mensaje "[Docutils-users] need a :raw:role":

> One of the 'todo' items for reST is to allow inclusion of
> math in a way that allows generation of documents in many
> different formats.  David recently made it possible to
> pass itex statements to multiple formats by allowing
> multiple arguments to the 'raw' directive.

> [...]

> "Passing math inline" could mean anything compatible with reST.
> Until the best way is figured out, I have proposed a stopgap:
> letting authors use a 'raw' role to pass it as they see fit.

Is the final intent a single mathematic representation, *understood*
by a reST parser, and then transformed to the destination math
representation system?

What if the target system has already a math representation
[sub]language, different from TeX? Example: Lout.

--

--
o-=< Marcelo >=-o

ardidlla. Ardilla tramposa.
--Del "Bichonario" (Giménez/Wright)

-------------------------------------------------------
This SF.Net email is sponsored by: