On 29 May 2014 07:06, Dan Allen <[email protected]> wrote:
> Eduardo,
>
> The explicit use of the latexmath inline macro isn't technically necessary.
> You should just be able to type the escaped sequence for MathJax and it will
> pick up the math. Thus, there would be no reason to introduce another set of
> delimiters to use for shorthand.

Eduardo is also using the PDF toolchains as well as mathjax, so it
needs to be wrapped in <*equation> for them.  So a simple passthrough
won't work.


>
> Asciidoctor simplifies this even further by allowing you to associate the
> math inline macro with either latexmath or asciimath. Here's an example:
>
> :math: latexmath
>
> math:[R_x = 10.0 \times \sin(R_\phi)]

A macro that does this can certainly be defined for both HTML and
Docbook backends.  Could just as well use the @@ as the delimiter.


>
> Notice that you don't need the delimiters around the equation inside the
> macro body. That's because Asciidoctor adds them automatically. AsciiDoc
> Python could do the same thing. There's absolutely no reason AsciiDoc Python
> should be requiring you to include the math delimiters inside the macro
> body.
>
> Instead of using the math inline macro, you can just use the escaped round
> brackets as delimiters:
>
> \(R_x = 10.0 \times \sin(R_\phi)\)

I'm wary about escaped parens as delimeters, are you *sure* they can't
occur elsewhere?  At least @@ is likely to be more rare (except for
the guy documenting roff of course :)

>
> The downside of this shorthand is that it's not treated as passthrough
> content, so you run the risk of getting unwanted substitutions. Personally,
> I find the math inline macro without the math delimiters around the equation
> (first example above) to be a reasonable compromise.

In asciidoc you can define limit substitution in macros by capturing
content in (?P<passtext>pattern) instead of as attributes see
http://asciidoc.org/userguide.html#_macro_definitions.


>
> wdyt?
>
> Although Asciidoctor deviates from the AsciiDoc Python behavior, I don't see
> any reason why AsciiDoc Python can't be enhanced to align with this
> enhancement.
>

I guess latexmath:[] was invented for documents with occasional maths
in it.  A more compact form would be good for more math heavy
documents.  Pity the $$ is already used as a passthrough.
Unfortunately changing that to an <equation> now is going to break
documents that use it.  With Python Asciidoc Eduardo should be able to
define his own macros and experiment with the most appropriate
delimiters.

Cheers
Lex


> -Dan
>
>
> On Wed, May 28, 2014 at 1:07 PM, Eduardo Santana <[email protected]>
> wrote:
>>
>> asciidoc is really great when you are writing programing books, so you can
>> use do `monospace` all the time:
>>
>>     The variable `i`, `j` and `k` are often used for integers.
>>
>> But not that good when you are writting a book with a lot of math:
>>
>>     The variable latexmath:[$i$], latexmath:[$j$] and latexmath:[$k$] are
>> often used for integers.
>>
>> This just an example. When you have a equation, you often have to explain
>> then in paragraphs and it's annoying have to write latexmath all the time,
>> it should be more simple, something like:
>>
>>     The variable @@i@@, @@j@@ and @@k@@ are often used for integers.
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "asciidoc" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/asciidoc.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Dan Allen | http://google.com/profiles/dan.j.allen
>
> --
> You received this message because you are subscribed to the Google Groups
> "asciidoc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/asciidoc.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc.
For more options, visit https://groups.google.com/d/optout.

Reply via email to