tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: [PATCH] Understand EQ/EN blocks.
Date: Sat, 5 Feb 2011 15:25:02 +0100	[thread overview]
Message-ID: <20110205142502.GA22129@iris.usta.de> (raw)
In-Reply-To: <4D4A82E6.9090402@bsd.lv>

Hi Kristaps,

> Enclosed is a patch that sets us down the road of understanding
> EQ/EN blocks.

From reading, merging and running it, this makes sense to me.

[...]
> The equations themselves are thrown away.  This is only because I
> wanted to float a patch early with the libroff framework.  It's
> trivial to put an addspan() style routine to both libmdoc and libman
> that at least print out the data.  I'll do that with an Ok or two.

That is indeed the logical next step.

> Thoughts?

I guess i would merge it for release if we get at least a bit
added value compared to just ignoring the .EQ lines with an ERROR,
as we currently do.  After looking at

  http://heirloom.sourceforge.net/doctools/eqn.1b.html

i think the easiest and most useful bits that could make rendering
better are:

 * remove "left" and "right"
 * pass through strings enclosed in double quotes "..."
   untouched, removing the quotes
 * convert "over" to "/"
 * convert "x sub i" to "x_i" and "x sup n" to "x^n"
 * replace ~ and ^ by a space, and collapse multiple spaces,
   tabs, and/or newlines to become a single space
 * remove spaces after ({[ and before )}]

A bit less important:

 * remove "size [+|-]n", roman, italic, bold, "font n",
 * remove "mark" and "lineup"

Much less important:

 * implement roman, italic, bold
 * implement under

Everything else should probably just be passed through, at least
for now:

 * Let braces { } be braces, converting them to parentheses ( )
   would just make the eqn text harder to grok, having lots of
   adjacent, similar tokens in some formulae.
 * just keep keywords like: sqrt, from, to, pile, matrix, ccol,
   dot, hat, tilde, bar, vec, sum, int, inf
 * leave "define" untouched
 * don't worry about GNU extensions for now

> By the way, we'll be able to fully support "delim", as libroff
> allows us to chop up its input lines and send them to the other
> backends, so
> 
>  foo $a + b$ bar
> 
> assuming `$$' are the EQN delimiters, would be passed back as
> 
>  foo
>  EQN:a + b
>  bar

That does seem worthwhile, too, maybe even more useful than the
two items marked "less important" above.

Thanks for getting this started,
  Ingo
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

      reply	other threads:[~2011-02-05 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 10:26 Kristaps Dzonsons
2011-02-05 14:25 ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110205142502.GA22129@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).