You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(15) |
Oct
(21) |
Nov
(18) |
Dec
(59) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(43) |
Feb
(35) |
Mar
(78) |
Apr
(65) |
May
(163) |
Jun
(169) |
Jul
(137) |
Aug
(77) |
Sep
(47) |
Oct
(27) |
Nov
(43) |
Dec
(68) |
2004 |
Jan
(61) |
Feb
(39) |
Mar
(11) |
Apr
(42) |
May
(86) |
Jun
(82) |
Jul
(24) |
Aug
(26) |
Sep
(37) |
Oct
(62) |
Nov
(131) |
Dec
(43) |
2005 |
Jan
(31) |
Feb
(56) |
Mar
(65) |
Apr
(165) |
May
(106) |
Jun
(97) |
Jul
(65) |
Aug
(150) |
Sep
(78) |
Oct
(115) |
Nov
(41) |
Dec
(26) |
2006 |
Jan
(50) |
Feb
(39) |
Mar
(56) |
Apr
(67) |
May
(89) |
Jun
(68) |
Jul
(116) |
Aug
(65) |
Sep
(58) |
Oct
(103) |
Nov
(28) |
Dec
(52) |
2007 |
Jan
(92) |
Feb
(60) |
Mar
(124) |
Apr
(96) |
May
(69) |
Jun
(79) |
Jul
(25) |
Aug
(22) |
Sep
(7) |
Oct
(17) |
Nov
(27) |
Dec
(32) |
2008 |
Jan
(57) |
Feb
(87) |
Mar
(51) |
Apr
(43) |
May
(56) |
Jun
(62) |
Jul
(25) |
Aug
(82) |
Sep
(58) |
Oct
(42) |
Nov
(38) |
Dec
(86) |
2009 |
Jan
(50) |
Feb
(33) |
Mar
(84) |
Apr
(90) |
May
(109) |
Jun
(37) |
Jul
(22) |
Aug
(51) |
Sep
(93) |
Oct
(86) |
Nov
(31) |
Dec
(62) |
2010 |
Jan
(33) |
Feb
(57) |
Mar
(62) |
Apr
(43) |
May
(30) |
Jun
(49) |
Jul
(20) |
Aug
(40) |
Sep
(152) |
Oct
(38) |
Nov
(15) |
Dec
(32) |
2011 |
Jan
(29) |
Feb
(25) |
Mar
(65) |
Apr
(45) |
May
(27) |
Jun
(11) |
Jul
(14) |
Aug
(8) |
Sep
(13) |
Oct
(117) |
Nov
(60) |
Dec
(19) |
2012 |
Jan
(23) |
Feb
(32) |
Mar
(24) |
Apr
(41) |
May
(56) |
Jun
(24) |
Jul
(15) |
Aug
(11) |
Sep
(26) |
Oct
(21) |
Nov
(12) |
Dec
(31) |
2013 |
Jan
(32) |
Feb
(24) |
Mar
(39) |
Apr
(44) |
May
(44) |
Jun
(8) |
Jul
(9) |
Aug
(12) |
Sep
(34) |
Oct
(19) |
Nov
(5) |
Dec
(9) |
2014 |
Jan
(22) |
Feb
(12) |
Mar
(7) |
Apr
(2) |
May
(13) |
Jun
(17) |
Jul
(8) |
Aug
(10) |
Sep
(7) |
Oct
(4) |
Nov
|
Dec
(39) |
2015 |
Jan
(13) |
Feb
(12) |
Mar
(12) |
Apr
(40) |
May
(5) |
Jun
(22) |
Jul
(3) |
Aug
(42) |
Sep
(5) |
Oct
(10) |
Nov
|
Dec
(10) |
2016 |
Jan
(9) |
Feb
(43) |
Mar
(5) |
Apr
(14) |
May
(17) |
Jun
(5) |
Jul
(5) |
Aug
(22) |
Sep
(5) |
Oct
|
Nov
(4) |
Dec
(18) |
2017 |
Jan
(28) |
Feb
(29) |
Mar
(9) |
Apr
(23) |
May
(48) |
Jun
(5) |
Jul
(32) |
Aug
(9) |
Sep
(13) |
Oct
(13) |
Nov
(6) |
Dec
(4) |
2018 |
Jan
(6) |
Feb
(5) |
Mar
(1) |
Apr
(2) |
May
(5) |
Jun
(17) |
Jul
(12) |
Aug
(15) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
2019 |
Jan
|
Feb
(6) |
Mar
(3) |
Apr
(5) |
May
(10) |
Jun
(6) |
Jul
(6) |
Aug
|
Sep
(11) |
Oct
(18) |
Nov
(10) |
Dec
(7) |
2020 |
Jan
(3) |
Feb
(14) |
Mar
(2) |
Apr
(1) |
May
(5) |
Jun
|
Jul
(1) |
Aug
(11) |
Sep
(8) |
Oct
|
Nov
(1) |
Dec
(14) |
2021 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
(8) |
May
(23) |
Jun
(7) |
Jul
(10) |
Aug
(1) |
Sep
|
Oct
(7) |
Nov
(10) |
Dec
(2) |
2022 |
Jan
|
Feb
(21) |
Mar
|
Apr
(3) |
May
(7) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2023 |
Jan
(18) |
Feb
|
Mar
(1) |
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(2) |
Mar
(3) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
2025 |
Jan
(4) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
1
(1) |
2
|
3
|
4
|
5
(1) |
6
(3) |
7
|
8
(1) |
9
|
10
|
11
|
12
|
13
(4) |
14
|
15
(4) |
16
(2) |
17
(3) |
18
|
19
|
20
(1) |
21
(1) |
22
(7) |
23
|
24
(1) |
25
(3) |
26
(3) |
27
(1) |
28
(1) |
29
|
30
(2) |
31
(4) |
|
From: Brian B. <ex...@gm...> - 2004-12-31 21:37:08
|
Felix Wiemann wrote: > I recommend you use docutils.core.publish_parts, which returns a > dictionary. Example: Thanks! I found the html_parts and html_fragment examples which use what you described in examples.py -- exactly what I need! -- Brian Beck Adventurer of the First Order |
From: David G. <go...@py...> - 2004-12-31 17:27:12
|
[Brian Beck] >> I apologize if this is a common question No need to apologize! Common questions are answered at http://docutils.sf.net/FAQ.html. If your question isn't there, either it's uncommon, or it hasn't been added yet. [Felix Wiemann] > It is, indeed, but it isn't even listed in the FAQ. Sorry. (I > think we should add a FAQ entry.) +1 on adding to the FAQ. Skeletal documentation exists at http://docutils.sf.net/docs/api/publisher.html, which refers to the code in docutils/examples.py (also on the web at http://docutils.sf.net/docutils/examples.py). That documentation needs to be fleshed out too. -- David Goodger <http://python.net/~goodger> |
From: Felix W. <Fel...@gm...> - 2004-12-31 14:26:57
|
Brian Beck wrote: > I apologize if this is a common question It is, indeed, but it isn't even listed in the FAQ. Sorry. (I think we should add a FAQ entry.) > I also realize that I'm not necessarily > using reSTX for its intended purpose. What you're describing is a perfectly valid and intended use for reST! > I'd like to use reSTX for what seems to be a common use of the first > STX in Zope -- rendering articles or pages that are still part of a > larger hierarchy (they aren't necessarily the whole page). Thusly, > I'd only want the HTML encapsulated in the _body_ tag of the rendered > document. I recommend you use docutils.core.publish_parts, which returns a dictionary. Example: >>> from docutils.core import publish_parts >>> parts = publish_parts('A test.\n\nSecond paragraph.', writer_name='html') >>> parts.keys() ['body', 'subtitle', 'title', 'fragment', 'footer', 'header', 'stylesheet', 'meta', 'whole', 'docinfo'] >>> parts['body'] u'<p>A test.</p>\n<p>Second paragraph.</p>\n' >>> Type help(publish_parts) to get more information on the parameters. -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ |
From: Brian B. <ex...@gm...> - 2004-12-31 10:40:45
|
I apologize if this is a common question, I looked through a bit of the archive and I imagine it would be difficult to find a similar phrasing of the request. I also realize that I'm not necessarily using reSTX for its intended purpose. Here we go... In all the examples I've found, generating HTML from a reSTX document was used for generating a stand-alone HTML page with every qualifying tag in the XTML spec. I'd like to use reSTX for what seems to be a common use of the first STX in Zope -- rendering articles or pages that are still part of a larger hierarchy (they aren't necessarily the whole page). Thusly, I'd only want the HTML encapsulated in the _body_ tag of the rendered document. I could use something like the xml.dom.minidom to retrieve the contents of the _body_, but then I'd be parsing a whole reSTX source, then re-parsing the resulting HTML. Is there an option I could set to make the html writer do this, or some simple changes to the existing html writer that I could make? Any help would be appreciated. -- Brian Beck Adventurer of the First Order |
From: Alan G I. <ai...@am...> - 2004-12-30 01:33:35
|
On Wed, 22 Dec 2004, Felix Wiemann apparently wrote: > In the LaTeX rendering, the multi-line equation is numbered as two > equations. But otherwise it looks pretty good. This is a result of Jens's decision to use the eqnarray environment. This is a reasonable minimalist first choice, but it raises important questions. i. Are numbered and unnumbered equations to be supported? ii. If numbered equations are to be supported, what is the best method in HTML documents? (I suggest CSS counters.) iii. Are numbered split equations to be supported? And related to this, is it reasonable for the LaTeX writer to require the amsmath package? (I vote 'yes'.) I selfishly look forward to the end of Jens's vacation. ;-) fwiw, Alan Isaac |
From: Alan G I. <ai...@am...> - 2004-12-30 01:33:33
|
On Wed, 22 Dec 2004, Jens Jorgen Mortensen apparently wrote: > there are currently only two > greek letters: alpha and epsilon. I haven't had time to add them all. Here is the core set, properly formatted. Alan Isaac 'alpha': u'\u03B1', 'beta': u'\u03B2', 'gamma': u'\u03B3', 'delta': u'\u03B4', 'epsilon': u'\u03F5', 'varepsilon': u'\u03B5', 'zeta': u'\u03B6 'eta': u'\u03B7', 'theta': u'\u03B8', 'vartheta': u'\u03D1', 'iota': u'\u03B9', 'kappa': u'\u03BA', 'varkappa': u'\u03F0', 'lambda': u'\u03BB', 'mu': u'\u03BC', 'nu': u'\u03BD', 'xi': u'\u03BE', 'pi': u'\u03C0', 'varpi': u'\u03D6', 'rho': u'\u03C1', 'varrho': u'\u03F1', 'sigma': u'\u03C3', 'varsigma': u'\u03C2', 'tau': u'\u03C4', 'upsilon': u'\u03C5', 'phi': u'\u03D5', 'varphi': u'\u03C6', 'chi': u'\u03C7', 'psi': u'\u03C8', 'omega': u'\u03C9', 'Gamma': u'\u0393', 'Delta': u'\u0394', 'Theta': u'\u0398', 'Lambda': u'\u039B', 'Xi': u'\u039E', 'Pi': u'\u03A0', 'Sigma': u'\u03A3', 'Upsilon': u'\u03D2', 'Phi': u'\u03A6', 'Psi': u'\u03A8', 'Omega': u'\u03A9', |
From: Sameet M. <meh...@vs...> - 2004-12-27 18:55:52
|
test_parsers/test_rst/test_directives/test_include.py: totest['include'][1]; test_parser (DocutilsTestSupport.ParserTestCase) input: Include Test ============ .. include:: /home/sameet/docutils/test/test_parsers/test_rst/test_directives/include1.txt :literal: A paragraph. -: expected +: output <document source="test data"> <section id="include-test" name="include test"> <title> Include Test - <literal_block source="test_parsers/test_rst/test_directives/include1.txt" xml:space="preserve"> + <literal_block source="../test_parsers/test_rst/test_directives/include1.txt" xml:space="preserve"> ? +++ Inclusion 1 ----------- This file is used by ``test_include.py``. <paragraph> A paragraph. F.. test_parsers/test_rst/test_directives/test_include.py: totest['include'][4]; test_parser (DocutilsTestSupport.ParserTestCase) input: Include Test ============ .. include:: /home/sameet/docutils/test/test_parsers/test_rst/test_directives/include1.txt .. include:: /home/sameet/docutils/test/test_parsers/test_rst/test_directives/include1.txt A paragraph. -: expected +: output <document source="test data"> <section id="include-test" name="include test"> <title> Include Test <section dupname="inclusion 1" id="inclusion-1"> <title> Inclusion 1 <paragraph> This file is used by <literal> test_include.py . <section dupname="inclusion 1" id="id1"> <title> Inclusion 1 - <system_message backrefs="id1" level="1" line="2" source="test_parsers/test_rst/test_directives/include1.txt" type="INFO"> + <system_message backrefs="id1" level="1" line="2" source="../test_parsers/test_rst/test_directives/include1.txt" type="INFO"> ? +++ <paragraph> Duplicate implicit target name: "inclusion 1". <paragraph> This file is used by <literal> test_include.py . <paragraph> A paragraph. F test_parsers/test_rst/test_directives/test_include.py: totest['include'][5]; test_parser (DocutilsTestSupport.ParserTestCase) input: Include Test ============ .. include:: /home/sameet/docutils/test/test_parsers/test_rst/test_directives/include1.txt ---------- .. include:: /home/sameet/docutils/test/test_parsers/test_rst/test_directives/include1.txt A paragraph. -: expected +: output <document source="test data"> <section id="include-test" name="include test"> <title> Include Test <section dupname="inclusion 1" id="inclusion-1"> <title> Inclusion 1 <paragraph> This file is used by <literal> test_include.py . <transition> <section dupname="inclusion 1" id="id1"> <title> Inclusion 1 - <system_message backrefs="id1" level="1" line="2" source="test_parsers/test_rst/test_directives/include1.txt" type="INFO"> + <system_message backrefs="id1" level="1" line="2" source="../test_parsers/test_rst/test_directives/include1.txt" type="INFO"> ? +++ <paragraph> Duplicate implicit target name: "inclusion 1". <paragraph> This file is used by <literal> test_include.py . <paragraph> A paragraph. F.................................... test_parsers/test_rst/test_directives/test_raw.py: totest['raw'][1]; test_parser (DocutilsTestSupport.ParserTestCase) input: .. raw:: html :file: /home/sameet/docutils/test/test_parsers/test_rst/test_directives/raw1.txt -: expected +: output <document source="test data"> - <raw format="html" source="test_parsers/test_rst/test_directives/raw1.txt" xml:space="preserve"> + <raw format="html" source="../test_parsers/test_rst/test_directives/raw1.txt" xml:space="preserve"> ? +++ <p>This file is used by <tt>test_raw.py</tt>.</p> F........................................ ====================================================================== FAIL: test_parsers/test_rst/test_directives/test_include.py: totest['include'][1]; test_parser (DocutilsTestSupport.ParserTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 389, in test_parser self.compare_output(self.input, output, self.expected) File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 145, in compare_output self.assertEquals(output, expected) File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 159, in failUnlessEqual raise self.failureException, \ AssertionError: '''\ <document source="test data"> <section id="include-test" name="include test"> <title> Include Test <literal_block source="../test_parsers/test_rst/test_directives/include1.txt" xml:space="preserve"> Inclusion 1 ----------- \n\ This file is used by ``test_include.py``. <paragraph> A paragraph. ''' != '''\ <document source="test data"> <section id="include-test" name="include test"> <title> Include Test <literal_block source="test_parsers/test_rst/test_directives/include1.txt" xml:space="preserve"> Inclusion 1 ----------- \n\ This file is used by ``test_include.py``. <paragraph> A paragraph. ''' ====================================================================== FAIL: test_parsers/test_rst/test_directives/test_include.py: totest['include'][4]; test_parser (DocutilsTestSupport.ParserTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 389, in test_parser self.compare_output(self.input, output, self.expected) File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 145, in compare_output self.assertEquals(output, expected) File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 159, in failUnlessEqual raise self.failureException, \ AssertionError: '''\ <document source="test data"> <section id="include-test" name="include test"> <title> Include Test <section dupname="inclusion 1" id="inclusion-1"> <title> Inclusion 1 <paragraph> This file is used by \n\ <literal> test_include.py . <section dupname="inclusion 1" id="id1"> <title> Inclusion 1 <system_message backrefs="id1" level="1" line="2" source="../test_parsers/test_rst/test_directives/include1.txt" type="INFO"> <paragraph> Duplicate implicit target name: "inclusion 1". <paragraph> This file is used by \n\ <literal> test_include.py . <paragraph> A paragraph. ''' != '''\ <document source="test data"> <section id="include-test" name="include test"> <title> Include Test <section dupname="inclusion 1" id="inclusion-1"> <title> Inclusion 1 <paragraph> This file is used by \n\ <literal> test_include.py . <section dupname="inclusion 1" id="id1"> <title> Inclusion 1 <system_message backrefs="id1" level="1" line="2" source="test_parsers/test_rst/test_directives/include1.txt" type="INFO"> <paragraph> Duplicate implicit target name: "inclusion 1". <paragraph> This file is used by \n\ <literal> test_include.py . <paragraph> A paragraph. ''' ====================================================================== FAIL: test_parsers/test_rst/test_directives/test_include.py: totest['include'][5]; test_parser (DocutilsTestSupport.ParserTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 389, in test_parser self.compare_output(self.input, output, self.expected) File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 145, in compare_output self.assertEquals(output, expected) File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 159, in failUnlessEqual raise self.failureException, \ AssertionError: '''\ <document source="test data"> <section id="include-test" name="include test"> <title> Include Test <section dupname="inclusion 1" id="inclusion-1"> <title> Inclusion 1 <paragraph> This file is used by \n\ <literal> test_include.py . <transition> <section dupname="inclusion 1" id="id1"> <title> Inclusion 1 <system_message backrefs="id1" level="1" line="2" source="../test_parsers/test_rst/test_directives/include1.txt" type="INFO"> <paragraph> Duplicate implicit target name: "inclusion 1". <paragraph> This file is used by \n\ <literal> test_include.py . <paragraph> A paragraph. ''' != '''\ <document source="test data"> <section id="include-test" name="include test"> <title> Include Test <section dupname="inclusion 1" id="inclusion-1"> <title> Inclusion 1 <paragraph> This file is used by \n\ <literal> test_include.py . <transition> <section dupname="inclusion 1" id="id1"> <title> Inclusion 1 <system_message backrefs="id1" level="1" line="2" source="test_parsers/test_rst/test_directives/include1.txt" type="INFO"> <paragraph> Duplicate implicit target name: "inclusion 1". <paragraph> This file is used by \n\ <literal> test_include.py . <paragraph> A paragraph. ''' ====================================================================== FAIL: test_parsers/test_rst/test_directives/test_raw.py: totest['raw'][1]; test_parser (DocutilsTestSupport.ParserTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 389, in test_parser self.compare_output(self.input, output, self.expected) File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 145, in compare_output self.assertEquals(output, expected) File "/home/sameet/docutils/test/DocutilsTestSupport.py", line 159, in failUnlessEqual raise self.failureException, \ AssertionError: '''\ <document source="test data"> <raw format="html" source="../test_parsers/test_rst/test_directives/raw1.txt" xml:space="preserve"> <p>This file is used by <tt>test_raw.py</tt>.</p> ''' != '''\ <document source="test data"> <raw format="html" source="test_parsers/test_rst/test_directives/raw1.txt" xml:space="preserve"> <p>This file is used by <tt>test_raw.py</tt>.</p> ''' ---------------------------------------------------------------------- Ran 872 tests in 28.444s FAILED (failures=4) Elapsed time: 29.565 seconds |
From: Felix W. <Fel...@gm...> - 2004-12-26 19:05:29
|
David Goodger wrote: > Jouni K Seppanen wrote: > >> I wonder if it would make sense to change the error messages to say, >> e.g., "... or the directive content is indented differently from the >> directive options"? > > Perhaps something like "... (check for inconsistent indentation)". The problem is that this pitfall occurs in many different places, so we'd have to redundantly add this hint to quite a lot of error messages, which seems like a bad idea. -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ |
From: David G. <go...@py...> - 2004-12-26 17:44:15
|
[Jouni K Seppanen] > This is probably just a clueless newbie problem, but it took me quite > a while to understand: apparently, the option list of a directive and > the contents of the directive must be indented by the same amount. Correct. Indentation must be consistent. > .. figure:: foo.gif > :alt: foo > > foobar The last 3 lines are seen by the parser like this ("|" is left edge): | :alt: foo | |foobar So it's the option that's seen as indented. > The error messages are somewhat unhelpful: True. > ------------------------------------------------------------------------ > foo.txt:6: (ERROR/3) Image URI contains whitespace. The directive sees the URI as "foo.gif :alt: foo" because of the indentation. > foo.txt:16: (ERROR/3) Error in "compound" directive: > no arguments permitted; blank line required before content block. It doesn't see the ":class:" as an option, but as part of the content block, again because of the indentation. > I wonder if it would make sense to change the error messages to say, > e.g., "... or the directive content is indented differently from the > directive options"? Perhaps something like "... (check for inconsistent indentation)". The directive could explicitly check for text like ":option:", but that may prove more trouble than it's worth. -- David Goodger <http://python.net/~goodger> |
From: Felix W. <Fel...@gm...> - 2004-12-26 15:36:05
|
Colin J. Williams wrote: > I have installed from the Debian package. The files in the ref, api, > dev, howto, user and rst directories are left in the compressed (gz) > form and thus are not browser accessible. Please ask the maintainers at Debian to fix that. > I tries downloading from the docutils site, things seem much the same. Downloading what? If you download the Docutils sources from SF.net and run "./buildhtml.py .." as described in the README, you don't get compressed HTML files, of course. -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ |
From: Colin J. W. <cj...@sy...> - 2004-12-25 17:40:58
|
Felix Wiemann wrote: >Colin J. Williams wrote: > > > >>My intent has been to use reStruct, but it doesn't appear to handle >>the grid table data very well. I haven't found a way to insert blank >>lines. >> >> > >What does that mean, inserting a blank line? I.e. what exactly are you >expecting to get? > > > Felix, Many thanks. This is what I am trying to do: Column 1 Column2 line 1 of code line 2 line 3 The expected response to the screen, from line 3 Continuation of line 3 response line 4 of code The expected response from line 4 line 5 line 6 The expected response from line 6 Colin W. |
From: Felix W. <Fel...@gm...> - 2004-12-25 16:20:09
|
Colin J. Williams wrote: > My intent has been to use reStruct, but it doesn't appear to handle > the grid table data very well. I haven't found a way to insert blank > lines. What does that mean, inserting a blank line? I.e. what exactly are you expecting to get? -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ |
From: Felix W. <Fel...@gm...> - 2004-12-25 16:10:17
|
Jouni K Seppanen wrote: > .. figure:: foo.gif > :alt: foo > > foobar > > .. compound:: > :class: my-compound > > foobar These *are* actually options (visually), aren't they? Maybe the directive parser should be changed to recognize these options. -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ |
From: Colin J. W. <cj...@sy...> - 2004-12-22 23:27:29
|
Beni Cherniavsky wrote: > Colin J. Williams wrote: > >> This seems a long way from what Alan Isaac proposed: >> http://www1.chapman.edu/~jipsen/mathml/asciimath.html >> >> The beauty of that proposal is that the markup intrudes very little >> into the maths. It is largely readable. > > There are problems with that syntax. I'm especially concerned with > the exreme future-incompatibility resulting from the fact that the > parser understands things like ``sqrtsqrtroot3x``. It's impossible to > extend such a language with new names and be sure it doesn't break > anything. But these are small solvable details. The concept is nice. > > The main reason that asciimath is not a satisfactory solution is that > it doesn't convert to beautiful LaTeX. With all due respect to the > WWW, if you can't beatifully typeset your math document (with LaTeX, > Lout, TeXmacs or something of that league), it's a waste of the math > ;-). Of course, it shouldn't be hard to implement an asciimath->LaTeX > converter. > > Also, it's not extendable enough. It's great for 50% percent of one's > math need but what happens when you step outside that area? I > personnaly won't consider any solution that cannot express 99% percent > of all math people ever wrote. LaTeX is good enough. Lout should be > as well and it's nicer. And when I get the time, I will design my > own, better notation. > You make a good case against the adoption of asciimath as the ultimate approach for reST but I hope that someone will be able be able to come up with something like asciimath for short term use. Other approaches are to use the math capability of LyX in the DocFactory environment or to use LyX to generate Latex for the math component and then have a way to import this into reST. Colin W. |
From: Colin J. W. <cj...@sy...> - 2004-12-22 23:15:42
|
Felix Wiemann wrote: >Colin J. Williams wrote: > > > >>This seems a long way from what Alan Isaac proposed: >>http://www1.chapman.edu/~jipsen/mathml/asciimath.html >> >>The beauty of that proposal is that the markup intrudes very little >>into the maths. It is largely readable. >> >> > >Sure. Feel free to implement it. (As long as you call your role >`asciimath` or so, it won't interfere with other math implementations.) >You can publish it as a patch here or check it in to CVS as a branch or >in a sandbox. (If you don't have write access to CVS, send me a mail >with your SF.net user name.) If you don't like working with patches (or >branches), you can wait until plugin support is implemented. (That's >currently highest priority for me, so there may some working plugin >support in less than a month, maybe.) > > > Thanks for this offer. Unfortunately, I'm tied up with another project at this time. >You could also wait until someone else implements it. There seems to be >quite some demand for math markup in general. > > > This seems to be the best option for me at this time. Colin W. |
From: Beni C. <cb...@us...> - 2004-12-22 21:40:39
|
Colin J. Williams wrote: > This seems a long way from what Alan Isaac proposed: > http://www1.chapman.edu/~jipsen/mathml/asciimath.html > > The beauty of that proposal is that the markup intrudes very little into > the maths. It is largely readable. > There are problems with that syntax. I'm especially concerned with the exreme future-incompatibility resulting from the fact that the parser understands things like ``sqrtsqrtroot3x``. It's impossible to extend such a language with new names and be sure it doesn't break anything. But these are small solvable details. The concept is nice. The main reason that asciimath is not a satisfactory solution is that it doesn't convert to beautiful LaTeX. With all due respect to the WWW, if you can't beatifully typeset your math document (with LaTeX, Lout, TeXmacs or something of that league), it's a waste of the math ;-). Of course, it shouldn't be hard to implement an asciimath->LaTeX converter. Also, it's not extendable enough. It's great for 50% percent of one's math need but what happens when you step outside that area? I personnaly won't consider any solution that cannot express 99% percent of all math people ever wrote. LaTeX is good enough. Lout should be as well and it's nicer. And when I get the time, I will design my own, better notation. -- Beni Cherniavsky <cb...@us...>, who can only read email on weekends. |
From: Felix W. <Fel...@gm...> - 2004-12-22 21:11:55
|
Colin J. Williams wrote: > This seems a long way from what Alan Isaac proposed: > http://www1.chapman.edu/~jipsen/mathml/asciimath.html > > The beauty of that proposal is that the markup intrudes very little > into the maths. It is largely readable. Sure. Feel free to implement it. (As long as you call your role `asciimath` or so, it won't interfere with other math implementations.) You can publish it as a patch here or check it in to CVS as a branch or in a sandbox. (If you don't have write access to CVS, send me a mail with your SF.net user name.) If you don't like working with patches (or branches), you can wait until plugin support is implemented. (That's currently highest priority for me, so there may some working plugin support in less than a month, maybe.) You could also wait until someone else implements it. There seems to be quite some demand for math markup in general. -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ |
From: Felix W. <Fel...@gm...> - 2004-12-22 20:26:10
|
You don't have CVS write access, do you? If you'd like to use CVS for working on the math support, please send me your SourceForge.net user name and I'll enable write access for you and send you links to all relevant documents (how to use SF.net CVS etc.). > Have a look a test.txt to see some examples. Thank you. * The MathML rendering is terrible here, but that's because I don't have the necessary fonts installed on my system. I currently don't have time to learn how fonts work on X11, but I expect to get it working in a week or two. * The resulting XHTML file isn't valid, because it's using "math:*" elements. I don't know how to fix that though. * In the LaTeX rendering, the multi-line equation is numbered as *two* equations. But otherwise it looks pretty good. > I will be on vacation the next 11 days Have fun! -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ |
From: Colin J. W. <cj...@sy...> - 2004-12-22 15:38:31
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Jens Jorgen Mortensen wrote: <blockquote cite="mid...@fy..." type="cite">Felix Wiemann wrote: <br> <blockquote type="cite">However, I think that it complicates the writing of the math role, so <br> may I suggest you implement a simple (yet working) prototype first? <br> Then you can later refactor it to use a node tree structure, moving the <br> math parsing from the HTML writer to the reST parser. <br> </blockquote> <br> OK, I have a working prototype. I have attached the code as a patch against docutils-0.3.5. Have a look a test.txt to see some examples. It works like this: <br> <br> rst2html.py test.txt > test.xhtml <br> <br> or <br> <br> rst2latex test.txt > test.tex <br> <br> I would be very happy if someone could try it out - any comments and questions are welcome. If your favorite math equation doesn't parse well (or not at all) then let me know. <br> <br> Note that there are many missing symbols - there are currently only two greek letters: alpha and epsilon. I haven't had time to add them all. <br> <br> I will be on vacation the next 11 days, so I will probably not answer emails before 2005! <br> <br> Jens Jørgen <br> <pre wrap=""> <hr size="4" width="90%"> Testing MathML -------------- Inline math: :latex-math:`\sin(x_n^2)`. And displayed math: .. latex-math:: f(\epsilon) = \frac{1}{1 + \exp\left(\frac{\epsilon}{k_\text{B}T}\right)} .. latex-math:: N = \frac{\text{number of apples}}{7} .. latex-math:: \mathbf{M} = \left(\begin{matrix}a&b\\c&d\end{matrix}\right) We have :latex-math:`|\mathbf{M}| = ad - bc`. .. latex-math:: \int_0^1 x^n dx = \frac{1}{n + 1} .. latex-math:: \sum_{n=1}^m n = \frac{m(m+1)}{2} * tilde: :latex-math:`\tilde{n}` * hat: :latex-math:`\hat{H}` * bar: :latex-math:`\bar{v}` Math split over Two lines: .. latex-math:: g(\alpha) = & (1 + \alpha + \alpha^2 + \alpha^3 + \alpha^4\\ & + \alpha^5) .. latex-math:: f(x) = \left\{ \begin{matrix} 1 - x, & x < 1 \\ 0, & x > 1 \end{matrix}\right. </pre> <pre wrap=""> <hr size="4" width="90%"> diff -urN docutils.0.3.5/nodes.py docutils/nodes.py --- docutils.0.3.5/nodes.py 2004-06-23 04:25:34.000000000 +0200 +++ docutils/nodes.py 2004-12-22 14:16:58.000000000 +0100 @@ -1212,6 +1212,12 @@ class generated(Inline, TextElement): pass +class latex_math(Inline, Text): + tagname = '#latex-math' + def __init__(self, rawsource, latex): + Text.__init__(self, latex, rawsource) + + # ======================================== # Auxiliary Classes, Functions, and Data # ======================================== @@ -1231,7 +1237,7 @@ generated header hint image important info inline - label legend line_block list_item literal literal_block + label latex_math legend line line_block list_item literal literal_block note option option_argument option_group option_list option_list_item option_string organization diff -urN docutils.0.3.5/parsers/rst/directives/__init__.py docutils/parsers/rst/directives/__init__.py --- docutils.0.3.5/parsers/rst/directives/__init__.py 2004-06-23 05:44:06.000000000 +0200 +++ docutils/parsers/rst/directives/__init__.py 2004-12-22 14:17:44.000000000 +0100 @@ -126,7 +126,8 @@ 'unicode': ('misc', 'unicode_directive'), 'class': ('misc', 'class_directive'), 'role': ('misc', 'role'), - 'restructuredtext-test-directive': ('misc', 'directive_test_function'),} + 'restructuredtext-test-directive': ('misc', 'directive_test_function'), + 'latex-math': ('latex_math', 'latex_math')} """Mapping of directive name to (module name, function name). The directive name is canonical & must be lowercase. Language-dependent names are defined in the ``language`` subpackage.""" diff -urN docutils.0.3.5/parsers/rst/directives/latex_math.py docutils/parsers/rst/directives/latex_math.py --- docutils.0.3.5/parsers/rst/directives/latex_math.py 1970-01-01 01:00:00.000000000 +0100 +++ docutils/parsers/rst/directives/latex_math.py 2004-12-22 14:18:20.000000000 +0100 @@ -0,0 +1,19 @@ +""" +Directive for LaTeX math. +""" + +__docformat__ = 'reStructuredText' + + +import sys +from docutils import nodes + + +def latex_math(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + node = nodes.latex_math(block_text, ''.join(content)) + return [node] + +latex_math.arguments = None +latex_math.options = {} +latex_math.content = 1 diff -urN docutils.0.3.5/parsers/rst/roles.py docutils/parsers/rst/roles.py --- docutils.0.3.5/parsers/rst/roles.py 2004-06-16 19:21:56.000000000 +0200 +++ docutils/parsers/rst/roles.py 2004-12-22 14:33:02.000000000 +0100 @@ -287,6 +287,15 @@ register_canonical_role('rfc-reference', rfc_reference_role) +def latex_math_role(role, rawtext, text, lineno, inliner, + options={}, content=[]): + i = rawtext.find('`') +## node = nodes.latex_math(rawtext, text.replace('\x00','\\')) + node = nodes.latex_math(rawtext, rawtext[i+1:-1]) + return [node], [] + +register_canonical_role('latex-math', latex_math_role) + ###################################################################### # Register roles that are currently unimplemented. diff -urN docutils.0.3.5/writers/html4css1.py docutils/writers/html4css1.py --- docutils.0.3.5/writers/html4css1.py 2004-07-26 19:58:01.000000000 +0200 +++ docutils/writers/html4css1.py 2004-12-22 14:20:42.000000000 +0100 @@ -28,6 +28,7 @@ Image = None import docutils from docutils import frontend, nodes, utils, writers, languages +from docutils.writers.mathml import mathml class Writer(writers.Writer): @@ -843,6 +844,15 @@ def depart_label(self, node): self.body.append(']</a></td><td>%s' % self.context.pop()) + def visit_latex_math(self, node): + text = node.astext() + inline = isinstance(node.parent, nodes.TextElement) + mml = mathml(text, inline) + self.body.append(mml) + + def depart_latex_math(self, node): + pass + def visit_legend(self, node): self.body.append(self.starttag(node, 'div', CLASS='legend')) diff -urN docutils.0.3.5/writers/latex2e.py docutils/writers/latex2e.py --- docutils.0.3.5/writers/latex2e.py 2004-07-29 02:27:45.000000000 +0200 +++ docutils/writers/latex2e.py 2004-12-22 14:21:20.000000000 +0100 @@ -1388,6 +1388,17 @@ return self.body.append(']') + def visit_latex_math(self, node): + inline = isinstance(node.parent, nodes.TextElement) + if inline: + self.body.append('$%s$' % node.astext()) + else: + self.body.append('\\begin{eqnarray} %s \\end{eqnarray}\n' % \ + node.astext()) + + def depart_latex_math(self, node): + pass + # elements generated by the framework e.g. section numbers. def visit_generated(self, node): pass diff -urN docutils.0.3.5/writers/mathml.py docutils/writers/mathml.py --- docutils.0.3.5/writers/mathml.py 1970-01-01 01:00:00.000000000 +0100 +++ docutils/writers/mathml.py 2004-12-22 14:29:17.000000000 +0100 @@ -0,0 +1,346 @@ +class math: + nchildren = 1000000 + def __init__(self, children=None): + self.children = [] + if children is not None: + if type(children) is list: + for child in children: + self.append(child) + else: + self.append(children) + + def __repr__(self): + if hasattr(self, 'children'): + return self.__class__.__name__ + '(%s)' % \ + ','.join([repr(child) for child in self.children]) + else: + return self.__class__.__name__ + + def full(self): + return len(self.children) >= self.nchildren + + def append(self, child): + assert not self.full() + self.children.append(child) + child.parent = self + node = self + while node.full(): + node = node.parent + return node + + def delete_child(self): + child = self.children[-1] + del self.children[-1] + return child + + def close(self): + parent = self.parent + while parent.full(): + parent = parent.parent + return parent + + def xml(self): + return self.xml_start() + self.xml_body() + self.xml_end() + + def xml_start(self): + return ['<math:%s>' % self.__class__.__name__] + + def xml_end(self): + return ['</math:%s>' % self.__class__.__name__] + + def xml_body(self): + xml = [] + for child in self.children: + xml.extend(child.xml()) + return xml + +class mrow(math): pass +class mtable(math): pass +class mtr(mrow): pass +class mtd(mrow): pass + +class mx(math): + nchildren = 0 + def __init__(self, data): + self.data = data + + def xml_body(self): + return [self.data] + +class mo(mx): + translation = {'<': '&lt;', '>': '&gt;'} + def xml_body(self): + return [self.translation.get(self.data, self.data)] + +class mi(mx): pass +class mn(mx): pass + +class msub(math): + nchildren = 2 + +class msup(math): + nchildren = 2 + +class msqrt(math): + nchildren = 1 + +class mroot(math): + nchildren = 2 + +class mfrac(math): + nchildren = 2 + +class msubsup(math): + nchildren = 3 + def __init__(self, children=None, reversed=False): + self.reversed = reversed + math.__init__(self, children) + + def xml(self): + if self.reversed: +## self.children[1:3] = self.children[2:0:-1] + self.children[1:3] = [self.children[2], self.children[1]] + self.reversed = False + return math.xml(self) + +class mfenced(math): + translation = {'\\{': '{', '\\langle': u'\u2329', + '\\}': '}', '\\rangle': u'\u232A', + '.': ''} + def __init__(self, par): + self.openpar = par + math.__init__(self) + + def xml_start(self): + open = self.translation.get(self.openpar, self.openpar) + close = self.translation.get(self.closepar, self.closepar) + return ['<math:mfenced math:open="%s" math:close="%s">' % \ + (open, close)] + +class mspace(math): + nchildren = 0 + +class mstyle(math): + def __init__(self, children=None, nchildren=None, **kwargs): + if nchildren is not None: + self.nchildren = nchildren + math.__init__(self, children) + self.attrs = kwargs + + def xml_start(self): + return ['<math:mstyle '] + ['math:%s="%s"' % item + for item in self.attrs.items()] + ['>'] + +class mover(math): + nchildren = 2 + reversed = True + def xml(self): + if self.reversed: + self.children.reverse() + self.reversed = False + return math.xml(self) + +class mtext(math): + nchildren = 0 + def __init__(self, text): + self.text = text + + def xml_body(self): + return [self.text] + + +escaped = {'{': 'lbrace', + '}': 'rbrace'} + +over = {'tilde': '~', + 'hat': '^', + 'bar': '_'} + +special = {'sum': u'\u03A3', + 'int': u'\u222B', + 'times': u'\u00D7', + 'alpha': u'\u03B1', + 'epsilon': u'\u03B5', + 'lbrace': u'\u007B', + 'rbrace': u'\u007D', + 'langle': u'\u2329', + 'rangle': u'\u232A'} + +functions = ['sin', 'exp', 'cos'] + +def parse_latex_math(string, inline=True): + string = ' '.join(string.split()) + + if inline: + node = mrow() + tree = node + else: + node = mtd() + tree = mstyle(mtable(mtr(node)), displaystyle='true') + + while len(string) > 0: + n = len(string) + c = string[0] + skip = 1 + if n > 1: + c2 = string[1] + else: + c2 = '' +## print n, string, c, c2, node.__class__.__name__ + if c == ' ': + pass + elif c == '\\': + if c2 in escaped: + node = node.append(mo(escaped[c2])) + skip = 2 + elif c2 == ' ': + node = node.append(mspace()) + skip = 2 + elif c2.isalpha(): + i = 2 + while i < n and string[i].isalpha(): + i += 1 + name = string[1:i] + node, skip = handle_keyword(name, node, string[i:]) + skip += i + elif c2 == '\\': + entry = mtd() + row = mtr(entry) + node.close().close().append(row) + node = entry + skip = 2 + else: + raise SyntaxError + elif c.isalpha(): + node = node.append(mi(c)) + elif c.isdigit(): + node = node.append(mn(c)) + elif c in '+-/()[]|=<>,.': + node = node.append(mo(c)) + elif c == '_': + child = node.delete_child() + if isinstance(child, msup): + sub = msubsup(child.children[0:2], reversed=True) + else: + sub = msub(child) + node.append(sub) + node = sub + elif c == '^': + child = node.delete_child() + if isinstance(child, msub): + sup = msubsup(child.children[0:2]) + else: + sup = msup(child) + node.append(sup) + node = sup + elif c == '{': + row = mrow() + node.append(row) + node = row + elif c == '}': + node = node.close() + elif c == '&': + entry = mtd() + node.close().append(entry) + node = entry + else: + raise SyntaxError + string = string[skip:] + return tree + + +def handle_keyword(name, node, string): + skip = 0 + if name == 'begin': + assert string.startswith('{matrix}') + skip = 8 + entry = mtd() + row = mtr(entry) + table = mtable(row) + node.append(table) + node = entry + elif name == 'end': + assert string.startswith('{matrix}') + skip = 8 + node = node.close().close().close() + elif name == 'text': + assert string[0] == '{' + i = string.index('}') + node = node.append(mtext(string[1:i])) + skip = i + 1 + elif name == 'sqrt': + sqrt = msqrt() + node.append(sqrt) + node = sqrt + elif name == 'frac': + frac = mfrac() + node.append(frac) + node = frac + elif name == 'left': + if string[0] == ' ': + string = string[1:] + skip = 1 + for par in ['(', '[', '|', '\\{', '\\langle', '.']: + if string.startswith(par): + break + else: + raise SyntaxError + fenced = mfenced(par) + node.append(fenced) + node = fenced + skip += len(par) + elif name == 'right': + if string[0] == ' ': + string = string[1:] + skip = 1 + for par in [')', ']', '|', '\\}', '\\rangle', '.']: + if string.startswith(par): + break + else: + raise SyntaxError + node.closepar = par + node = node.close() + skip += len(par) + elif name == 'mathbf': + style = mstyle(nchildren=1, fontweight='bold') + node.append(style) + node = style + else: + code = special.get(name) + if code is not None: + node = node.append(mi(code)) + else: + if name in functions: + node = node.append(mo(name)) + else: + chr = over.get(name) + if chr is not None: + ov = mover(mo(chr)) + node.append(ov) + node = ov + else: + raise SyntaxError + + return node, skip + + +def mathml(string, inline): + tree = parse_latex_math(string, inline) +## print repr(tree) + xml = ''.join(tree.xml()) + xml = """<math:math xmlns:math=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1998/Math/MathML">"http://www.w3.org/1998/Math/MathML"</a>> + <math:semantics> + %s + </math:semantics> + </math:math> + """ % xml + if inline: + return xml + return xml + '<br/>\n' + + +if __name__ == '__main__': + import sys + tree = parse_latex_math(sys.argv[1], 1) + print repr(tree) + print ''.join(tree.xml()) </pre> </blockquote> <big>This seems a long way from what Alan Isaac proposed: <a class="moz-txt-link-freetext" href="http://www1.chapman.edu/~jipsen/mathml/asciimath.html">http://www1.chapman.edu/~jipsen/mathml/asciimath.html</a><br> <br> The beauty of that proposal is that the markup intrudes very little into the maths. It is largely readable. <br> <br> See excerpt below (with apologies for the HTML):<br> </big><br> <h4>Here are a few more examples: </h4> <table id="examples" border="5" cellpadding="10"> <tbody> <tr> <th>Type this</th> <th>See that</th> <th>Comment</th> </tr> <tr> <td>`x^2+y_1+z_12^34`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><msub><mi>y</mi><mn>1</mn></msub><mo>+</mo><mrow><msubsup><mi>z</mi><mn>12</mn><mn>34</mn></msubsup></mrow><mo></mo></mstyle></math></td> <td>subscripts as in TeX, but numbers are treated as a unit</td> </tr> <tr> <td>`sin^-1(x)`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><msup><mo>sin</mo><mn>-1</mn></msup><mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mstyle></math></td> <td>function names are treated as constants</td> </tr> <tr> <td>`d/dxf(x)=lim_(h->0)(f(x+h)-f(x))/h`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mfrac><mi>d</mi><mrow><mi>d</mi><mi>x</mi></mrow></mfrac><mi>f</mi><mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mo>=</mo><munder><mo>lim</mo><mrow><mi>h</mi><mo>→</mo><mn>0</mn></mrow></munder><mfrac><mrow><mi>f</mi><mrow><mo>(</mo><mi>x</mi><mo>+</mo><mi>h</mi><mo>)</mo></mrow><mo>-</mo><mi>f</mi><mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mrow><mi>h</mi></mfrac><mo></mo></mstyle></math></td> <td>complex subscripts are bracketed, displayed under lim</td> </tr> <tr> <td>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mfrac><mrow><mi>d</mi></mrow><mrow><mrow><mi>d</mi><mi>x</mi></mrow></mrow></mfrac><mi>f</mi><mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mo>=</mo><munder><mo>lim</mo><mrow><mi>h</mi><mo>→</mo><mn>0</mn></mrow></munder><mfrac><mrow><mi>f</mi><mrow><mo>(</mo><mi>x</mi><mo>+</mo><mi>h</mi><mo>)</mo></mrow><mo>-</mo><mi>f</mi><mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mrow><mrow><mi>h</mi></mrow></mfrac></mstyle></math></td> <td>standard LaTeX notation is an alternative</td> </tr> <tr> <td>`f(x)=sum_(n=0)^oo(f^((n))(a))/(n!)(x-a)^n`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mi>f</mi><mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mo>=</mo><mrow><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><mo>∞</mo></munderover></mrow><mfrac><mrow><msup><mi>f</mi><mrow><mrow><mo>(</mo><mi>n</mi><mo>)</mo></mrow></mrow></msup><mrow><mo>(</mo><mi>a</mi><mo>)</mo></mrow></mrow><mrow><mi>n</mi><mo>!</mo></mrow></mfrac><msup><mrow><mo>(</mo><mi>x</mi><mo>-</mo><mi>a</mi><mo>)</mo></mrow><mi>n</mi></msup><mo></mo></mstyle></math></td> <td>f^((n))(a) must be bracketed, else the numerator is only <math><mstyle displaystyle="true" mathcolor="Red"><mi>a</mi></mstyle></math></td> </tr> <tr> <td>$f(x)=\sum_{n=0}^\infty\frac{f^{(n)}(a)}{n!}(x-a)^n$</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mi>f</mi><mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mo>=</mo><mrow><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><mo>∞</mo></munderover></mrow><mfrac><mrow><msup><mi>f</mi><mrow><mrow><mo>(</mo><mi>n</mi><mo>)</mo></mrow></mrow></msup><mrow><mo>(</mo><mi>a</mi><mo>)</mo></mrow></mrow><mrow><mi>n</mi><mo>!</mo></mrow></mfrac><msup><mrow><mo>(</mo><mi>x</mi><mo>-</mo><mi>a</mi><mo>)</mo></mrow><mi>n</mi></msup><mo></mo></mstyle></math></td> <td>standard LaTeX produces the same result</td> </tr> <tr> <td>`int_0^1f(x)dx`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mrow><msubsup><mo>∫</mo><mn>0</mn><mn>1</mn></msubsup></mrow><mi>f</mi><mrow><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mrow><mi>d</mi><mi>x</mi></mrow></mstyle></math></td> <td>subscripts must come before superscripts</td> </tr> <tr> <td>`[[a,b],[c,d]]((n),(k))`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mrow><mo>[</mo><mtable><mtr><mtd><mi>a</mi></mtd><mtd><mi>b</mi></mtd></mtr><mtr><mtd><mi>c</mi></mtd><mtd><mi>d</mi></mtd></mtr></mtable><mo>]</mo></mrow><mrow><mo>(</mo><mtable><mtr><mtd><mi>n</mi></mtd></mtr><mtr><mtd><mi>k</mi></mtd></mtr></mtable><mo>)</mo></mrow></mstyle></math></td> <td>matrices and column vectors are simple to type</td> </tr> <tr> <td>`x/x={(1,if x!=0),(text{undefined},if x=0):}`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mfrac><mi>x</mi><mi>x</mi></mfrac><mo>=</mo><mrow><mo>{</mo><mtable columnalign="left"><mtr><mtd columnalign="left"><mn>1</mn></mtd><mtd columnalign="left"><mrow><mspace width="1ex"></mspace><mo>if</mo><mspace width="1ex"></mspace></mrow><mi>x</mi><mo>≠</mo><mn>0</mn></mtd></mtr><mtr><mtd columnalign="left"><mrow><mtext>undefined</mtext></mrow></mtd><mtd columnalign="left"><mrow><mspace width="1ex"></mspace><mo>if</mo><mspace width="1ex"></mspace></mrow><mi>x</mi><mo>=</mo><mn>0</mn></mtd></mtr></mtable></mrow></mstyle></math></td> <td>piecewise defined function are based on matrix notation</td> </tr> <tr> <td>`a//b`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mi>a</mi><mo>/</mo><mi>b</mi></mstyle></math></td> <td>use // for inline fractions</td> </tr> <tr> <td>`(a/b)/(c/d)`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mfrac><mrow><mfrac><mi>a</mi><mi>b</mi></mfrac></mrow><mrow><mfrac><mi>c</mi><mi>d</mi></mfrac></mrow></mfrac><mo></mo></mstyle></math></td> <td>with brackets, multiple fraction work as expected</td> </tr> <tr> <td>`a/b/c/d`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mfrac><mi>a</mi><mi>b</mi></mfrac><mo>/</mo><mfrac><mi>c</mi><mi>d</mi></mfrac><mo></mo></mstyle></math></td> <td>without brackets the parser chooses this particular expression</td> </tr> <tr> <td>`((a*b))/c`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mfrac><mrow><mrow><mo>(</mo><mi>a</mi><mo>⋅</mo><mi>b</mi><mo>)</mo></mrow></mrow><mi>c</mi></mfrac><mo></mo></mstyle></math></td> <td>only one level of brackets is removed; * gives standard product</td> </tr> <tr> <td>`sqrtsqrtroot3x`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><msqrt><msqrt><mroot><mi>x</mi><mn>3</mn></mroot></msqrt></msqrt></mstyle></math></td> <td>spaces are optional, only serve to split strings that should not match</td> </tr> <tr> <td>`(:a,b:) and {:(x,y),(u,v):}`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mrow><mo>〈</mo><mi>a</mi><mo>,</mo><mi>b</mi><mo>〉</mo></mrow><mrow><mspace width="1ex"></mspace><mtext>and</mtext><mspace width="1ex"></mspace></mrow><mrow><mtable columnalign="left"><mtr><mtd columnalign="left"><mi>x</mi></mtd><mtd columnalign="left"><mi>y</mi></mtd></mtr><mtr><mtd columnalign="left"><mi>u</mi></mtd><mtd columnalign="left"><mi>v</mi></mtd></mtr></mtable></mrow></mstyle></math></td> <td>angle brackets and invisible brackets</td> </tr> <tr> <td>`(a,b]={x in RR : a < x <= b}`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mrow><mo>(</mo><mi>a</mi><mo>,</mo><mi>b</mi><mo>]</mo></mrow><mo>=</mo><mrow><mo>{</mo><mi>x</mi><mo>∈</mo><mo>ℝ</mo><mo>:</mo><mi>a</mi><mo><</mo><mi>x</mi><mo>≤</mo><mi>b</mi><mo>}</mo></mrow></mstyle></math></td> <td>grouping brackets don't have to match</td> </tr> <tr> <td>`abc-123.45^-1.1`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mi>a</mi><mi>b</mi><mi>c</mi><msup><mn>-123.45</mn><mn>-1.1</mn></msup><mo></mo></mstyle></math></td> <td>non-tokens are split into single characters,<br> but decimal numbers are parsed with possible sign</td> </tr> <tr> <td>`hat(ab) bar(xy) ulA vec v dotx ddot y`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mover><mrow><mi>a</mi><mi>b</mi></mrow><mo>^</mo></mover><mover><mrow><mi>x</mi><mi>y</mi></mrow><mo>¯</mo></mover><munder><mi>A</mi><mo>̲</mo></munder><mover><mi>v</mi><mo>→</mo></mover><mover><mi>x</mi><mo>.</mo></mover><mover><mi>y</mi><mo>..</mo></mover></mstyle></math></td> <td>accents can be used on any expression (work well in IE)</td> </tr> <tr> <td>`bb{AB3}.bbb(AB].cc(AB).fr{AB}.tt[AB].sf(AB)`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mstyle fontweight="bold"><mrow><mi>A</mi><mi>B</mi><mn>3</mn></mrow></mstyle><mo>.</mo><mstyle mathvariant="double-struck"><mrow></mrow></mstyle><mo>.</mo><mstyle mathvariant="script"><mrow>ℬ</mrow></mstyle><mo>.</mo><mstyle mathvariant="fraktur"><mrow></mrow></mstyle><mo>.</mo><mstyle fontfamily="monospace"><mrow><mi>A</mi><mi>B</mi></mrow></mstyle><mo>.</mo><mstyle fontfamily="sans-serif"><mrow><mi>A</mi><mi>B</mi></mrow></mstyle></mstyle></math></td> <td>font commands; can use any brackets around argument</td> </tr> <tr> <td>`stackrel"def"= or \stackrel{\Delta}{=}" "("or ":=)`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mover><mo>=</mo><mrow><mtext>def</mtext></mrow></mover><mrow><mspace width="1ex"></mspace><mtext>or</mtext><mspace width="1ex"></mspace></mrow><mover><mrow><mo>=</mo></mrow><mrow><mo>Δ</mo></mrow></mover><mrow><mspace width="1ex"></mspace><mtext></mtext><mspace width="1ex"></mspace></mrow><mrow><mo>(</mo><mrow><mtext>or</mtext><mspace width="1ex"></mspace></mrow><mo>:=</mo><mo>)</mo></mrow></mstyle></math></td> <td>symbols can be stacked</td> </tr> <tr> <td>`{::}_(\ 92)^238U`</td> <td><math><mstyle displaystyle="true" mathcolor="Red"><mrow><msubsup><mrow></mrow><mrow><mo> </mo><mn>92</mn></mrow><mn>238</mn></msubsup></mrow><mi>U</mi></mstyle></math></td> <td>prescripts simulated by subsuperscripts</td> </tr> </tbody> </table> <big><br> The problem with the test.txt is that the math is lost in the markup.<br> <br> I am not advocating that ASCII be adopted as a standard for reST but that it would be very helpful, for those who are not familiar with the detail of Latex and have no wish to become "texnicians", to have a means of integrating such a script into reST.<br> <br> Colin W</big>.<br> </body> </html> |
From: Jens J. M. <je...@fy...> - 2004-12-22 14:01:33
|
Felix Wiemann wrote: > However, I think that it complicates the writing of the math role, so > may I suggest you implement a simple (yet working) prototype first? > Then you can later refactor it to use a node tree structure, moving the > math parsing from the HTML writer to the reST parser. OK, I have a working prototype. I have attached the code as a patch=20 against docutils-0.3.5. Have a look a test.txt to see some examples.=20 It works like this: rst2html.py test.txt > test.xhtml or rst2latex test.txt > test.tex I would be very happy if someone could try it out - any comments and=20 questions are welcome. If your favorite math equation doesn't parse=20 well (or not at all) then let me know. Note that there are many missing symbols - there are currently only two=20 greek letters: alpha and epsilon. I haven't had time to add them all. I will be on vacation the next 11 days, so I will probably not answer=20 emails before 2005! Jens J=F8rgen |
From: Marcelo H. <mg...@sp...> - 2004-12-21 02:37:35
|
El 20/12/2004 a las 15:25, Felix Wiemann <Fel...@gm...> dijo= , en su mensaje "[Docutils-users] Re: math in reST": > Frankly, I do not think anything should become the official math sy= ntax > of reST, because then people would start endless discussions about = how > to improve the math support and why not choose $FANCY_MATH_SYNTAX f= or > Docutils. <fx: claps hands enthusiastically> +1 --=20 o-=3D< Marcelo >=3D-o cancha. Chancha donde se practica un deporte. --Del "Bichonario" (Gim=E9nez/Wright) |
From: Felix W. <Fel...@gm...> - 2004-12-20 18:38:37
|
Jens Jorgen Mortensen wrote: > I did have a look at asciimath and it seems to be very nice work, but > does it qualify to be the official reST math mark-up syntax? Frankly, I do not think anything should become the official math syntax of reST, because then people would start endless discussions about how to improve the math support and why not choose $FANCY_MATH_SYNTAX for Docutils. > For now I would like to have a tex role and a tex directive. If I > implement that for the latex and html writers (using MathML) would > that have a chance of getting into the docutils code? Probably not, because that would mean favoring one math syntax over another. And math support probably isn't a particularly simple thing, so it might very well be too big and complex for a system like Docutils. I suggest you first publish it as a patch (or branch, as you like) and when there is some plugin support in Docutils, it can be turned into a plugin. (I'd be willing to help with that.) Please understand that my objections are against including math support in the Docutils core, not against math support in general. The math plugin(s) could get some well-visible announcement on the Docutils homepage. -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ |
From: Grzegorz A. H. <gr...@ti...> - 2004-12-17 09:25:39
|
On 2004-12-16, gr...@us... wrote: > On Mon, 13 Dec 2004, Grzegorz Adam Hankiewicz wrote: > > ! Bad character code (-1). > > \reserved@c ->\hbox {\char \hyphenchar \font > > }\egroup > > l.80 dar~-c > > ~backup{\underline{~}}file{\underline{~}}without{\underline{~}}ex... > > ``\underline{~}`` fails, the cvs version uses ``{\_}`` and works here > > either you have an older release or your font_encoding is OT1. Indeed, I was using the latest release 0.3.5. I have installed the docutils snapshot and the Spanish .pdf is generated correctly. Thanks for the help. |
From: Jens J. M. <je...@fy...> - 2004-12-17 07:31:02
|
Alan G Isaac wrote: > So it is my belief that a lot of the MathML work has been > done, if you speak C, and the LaTeX work is I believe > relatively trivial. (Of course, the proof is in the > pudding.) Translating WebTeX to LaTeX has already been given > some thought as well, e.g., if you speak perl, > http://www.lib.rpi.edu/dept/acs/rpinfo/filters/GChtml2latex/webtex2late= x.tag=20 > makes a substantial start on this! I have written a parser that transforms LaTeX to MathML in Python - so=20 that is not a problem. It doesn't do all of LaTeX, but it's a start. I am going to ask some questions on the docutils-develop mailing list=20 (Alan: you are not on that list!). Jens J=F8rgen |