David Abrahams | 1 Jan 2004 17:47
Picon
Picon
Favicon
Gravatar

Re: supercript?

David Goodger <goodger <at> python.org> writes:

> David Abrahams wrote:
>  > The only syntactic element thats *seriously* missing from book I'm
>  > writing using docutils are superscripts.
>
> You can have them now as: 2 x 10\ :sup:`6`.  Ugly, yes, but possible.

Oh, Wonderful!!!

Not so wonderful; the latex writer doesn't know about it:

  visiting unknown node type: superscript
  Exiting due to error.  Use "--traceback" to diagnose.
  Please report errors to <docutils-users <at> lists.sf.net>.
  Include "--traceback" output, Docutils version (0.3.1),
  Python version (2.3), your OS type & version, and the
  command line used.
  make: *** [dsl.tex] Error 1
  Traceback (most recent call last):
    File "generate.py", line 18, in ?
      syscmd('make %s' % all)
    File "c:\etc\mpl\syscmd.py", line 9, in syscmd

:(

I'll try to figure out how to fix that; in the meantime I'm checking
in the following patch to improve diagnostic output:

(Continue reading)

David Abrahams | 1 Jan 2004 18:37
Picon
Picon
Favicon
Gravatar

Re: supercript?

David Abrahams <dave <at> boost-consulting.com> writes:

> Not so wonderful; the latex writer doesn't know about it:
>
>   visiting unknown node type: superscript
>   Exiting due to error.  Use "--traceback" to diagnose.
>   Please report errors to <docutils-users <at> lists.sf.net>.
>   Include "--traceback" output, Docutils version (0.3.1),
>   Python version (2.3), your OS type & version, and the
>   command line used.
>   make: *** [dsl.tex] Error 1
>   Traceback (most recent call last):
>     File "generate.py", line 18, in ?
>       syscmd('make %s' % all)
>     File "c:\etc\mpl\syscmd.py", line 9, in syscmd
>
> :(
>
> I'll try to figure out how to fix that; in the meantime I'm checking
> in the following patch to improve diagnostic output:

I was trying to do something like this:

      (*x*\ :sup:`|a|`)(*x*\ :sup:`|b|`) == *x* :sup:`|sum|`

.. |a| replace:: *a*

.. |b| replace:: *b*

.. |sum| replace:: (*a* + *b*)
(Continue reading)

engelbert.gruber | 2 Jan 2004 12:52
Picon

Re: supercript?

On Thu, 1 Jan 2004, David Abrahams wrote:

> David Abrahams <dave <at> boost-consulting.com> writes:
>
> > I'll try to figure out how to fix that; in the meantime I'm checking
> > in the following patch to improve diagnostic output:
>
> I was trying to do something like this:
>
>       (*x*\ :sup:`|a|`)(*x*\ :sup:`|b|`) == *x* :sup:`|sum|`
>
> .. |a| replace:: *a*
>
> .. |b| replace:: *b*
>
> .. |sum| replace:: (*a* + *b*)
>
>
> That is, (x^a^) (x^b^) == x^(a + b)^   with all letters italicized.
>
> Unfortunately, substitutions don't work within the interpreted text.
> Fortunately (?) LaTeX only does superscripts in "math" mode, which
> forces the letters to be italicized (by default, anyway).

seams to be some typesetting rule to make letters italic.

see mathfonts in the latex documentation.

i am unsure what you want to approach/express ?

(Continue reading)

David Abrahams | 2 Jan 2004 18:30
Picon
Picon
Favicon
Gravatar

Re: supercript?

engelbert.gruber <at> ssg.co.at writes:

> On Thu, 1 Jan 2004, David Abrahams wrote:
>
>> David Abrahams <dave <at> boost-consulting.com> writes:
>>
>> > I'll try to figure out how to fix that; in the meantime I'm checking
>> > in the following patch to improve diagnostic output:
>>
>> I was trying to do something like this:
>>
>>       (*x*\ :sup:`|a|`)(*x*\ :sup:`|b|`) == *x* :sup:`|sum|`
>>
>> .. |a| replace:: *a*
>>
>> .. |b| replace:: *b*
>>
>> .. |sum| replace:: (*a* + *b*)
>>
>>
>> That is, (x^a^) (x^b^) == x^(a + b)^   with all letters italicized.
>>
>> Unfortunately, substitutions don't work within the interpreted text.
>> Fortunately (?) LaTeX only does superscripts in "math" mode, which
>> forces the letters to be italicized (by default, anyway).
>
> seams to be some typesetting rule to make letters italic.

Yes, that's the usual rule in LaTeX equations

(Continue reading)

David Abrahams | 2 Jan 2004 22:59
Picon
Picon
Favicon
Gravatar

Re: supercript?

engelbert.gruber <at> ssg.co.at writes:

> seams to be some typesetting rule to make letters italic.
>
> see mathfonts in the latex documentation.

It looks as though the truly right answer for docutils is to use the
\raisebox or \textsuperscript LaTeX commands, possibly along with
something to make the font smaller.

--

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
David Goodger | 3 Jan 2004 00:21
Favicon

Re: supercript?

David Abrahams wrote:
 > I was trying to do something like this:
 >
 >       (*x*\ :sup:`|a|`)(*x*\ :sup:`|b|`) == *x* :sup:`|sum|`
 >
 > .. |a| replace:: *a*
 >
 > .. |b| replace:: *b*
 >
 > .. |sum| replace:: (*a* + *b*)
 >
 > That is, (x^a^) (x^b^) == x^(a + b)^   with all letters italicized.

It looks like what you really need is support for math markup.  See
question 2.14 of the FAQ (http://docutils.sf.net/FAQ.html) and the new
entry in the to-do list
(http://docutils.sf.net/spec/notes.html#math-markup).

 > Unfortunately, substitutions don't work within the interpreted text.

No nested inline markup works.  It's also on the to-do list, with a
discussion here:
<http://docutils.sf.net/spec/rst/alternatives.html#nested-inline-markup>.

 > It might be interesting if you could do:
 >
 >   :role:|substitution|

Seems a bit of a stretch to me.  Better to properly implement nested
inline markup than add a kludge.
(Continue reading)

David Abrahams | 3 Jan 2004 02:42
Picon
Picon
Favicon
Gravatar

Re: supercript?

David Goodger <goodger <at> python.org> writes:

> David Abrahams wrote:
>  > I was trying to do something like this:
>  >
>  >       (*x*\ :sup:`|a|`)(*x*\ :sup:`|b|`) == *x* :sup:`|sum|`
>  >
>  > .. |a| replace:: *a*
>  >
>  > .. |b| replace:: *b*
>  >
>  > .. |sum| replace:: (*a* + *b*)
>  >
>  > That is, (x^a^) (x^b^) == x^(a + b)^   with all letters italicized.
>
> It looks like what you really need is support for math markup.  See
> question 2.14 of the FAQ (http://docutils.sf.net/FAQ.html) and the new
> entry in the to-do list
> (http://docutils.sf.net/spec/notes.html#math-markup).

In the long run, you're probably right, but I'm looking for
something relatively easily accomplished in the meantime.

>  > Unfortunately, substitutions don't work within the interpreted text.
>
> No nested inline markup works.  

I know it, when you phrase it that way.  It's just not always clear
to me what qualifies as "nested inline markup."

(Continue reading)

David Goodger | 3 Jan 2004 04:27
Favicon

Re: supercript?

David Abrahams wrote:
 > In the long run, you're probably right, but I'm looking for
 > something relatively easily accomplished in the meantime.

Easily accomplished won't cut it if it isn't also correct (robust &
complete).  I suspect "easily accomplished" and "correct" won't come
hand-in-hand.

 > It's just not always clear to me what qualifies as "nested inline
 > markup."

Inline markup inside inline markup.  E.g., "*emphasis with
``literal text`` inside*".

 >     *Emphasis enclosing **strong** in the middle.*
 >     ***Strong** inside emphasis.*
 >
 > It seems to me (though I don't know docutils' parsing internals)
 > that this is easily solved.  If you have a problem with the first
 > example, it must mean that you're not doing "maximal munch
 > tokenization."

The parser isn't doing tokenization at all, that's the problem.  In
some respects it's a naive parser that may need rewriting before
anything complex becomes possible.  The way the "outer" inline markup
is identified now is, the open-markup is identified and then the
corresponding close-markup is found.  Intervening open- or
close-markup is ignored.

 > Shouldn't '**' always indicate a strong open/close delimiter (except
(Continue reading)

David Abrahams | 3 Jan 2004 15:22
Picon
Picon
Favicon
Gravatar

Re: supercript?

David Goodger <goodger <at> python.org> writes:

> David Abrahams wrote:
>  > In the long run, you're probably right, but I'm looking for
>  > something relatively easily accomplished in the meantime.
>
> Easily accomplished won't cut it if it isn't also correct (robust &
> complete).  I suspect "easily accomplished" and "correct" won't come
> hand-in-hand.

You may be right.

>  > It's just not always clear to me what qualifies as "nested inline
>  > markup."
>
> Inline markup inside inline markup.  E.g., "*emphasis with
> ``literal text`` inside*".

I'm sorry; what I meant was that it wasn't always clear to me what
qualified as "inline markup".  It's probably just what it sounds
like, and I'm making it too complicated.

>  >     *Emphasis enclosing **strong** in the middle.*
>  >     ***Strong** inside emphasis.*
>  >
>  > It seems to me (though I don't know docutils' parsing internals)
>  > that this is easily solved.  If you have a problem with the first
>  > example, it must mean that you're not doing "maximal munch
>  > tokenization."
>
(Continue reading)

David Abrahams | 10 Jan 2004 18:04
Picon
Picon
Favicon
Gravatar

rst cross-references?


I'm generating several multi-document packages in several formats
using ReST.  For example, I may end up with a package of .htmls, and
another package of .pdfs (after running rst2latex and generating pdfs
from the TeX).  When I generate cross-reference links between
documents, it would be nice to have the pdfs reference other pdfs,
and have the html files reference other html files.  Is there a
convenient way to achieve this?

--

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

Gmane