Subject: Re: [Cellar] math in IETF specifications

From: Dave Rice <[email-masked]>
Date: Sat, 18 Mar 2017 13:25:27 -0400

Hi all,

> On Dec 2, 2015, at 11:48 PM, Timothy B. Terriberry <[email-masked]> wrote:
> 
> Dave Rice wrote:
>> Thanks, it’s good to see the options in action. Given what is available in the timeline of the project it may be easiest to leave the math in LaTeX form and cite the PDF version for reference. The ASCII Art equations of RFC 6716 are impressive but I’d worry that in this effort that it would compromise legibility. In the current FFV1 LaTeX there are some examples with subscripts of subscripts of subscripts.
> 
> Yes, in 6716 we probably would have done that as C-style arrays (our syntax closer to C than traditional mathematical notation, on the whole). But doing that conversion for a bunch of existing equations would be a lot of work.

[…]

I’ve prepared a patch at https://github.com/FFmpeg/FFV1/pull/50 <https://github.com/FFmpeg/FFV1/pull/50>. This adds a method to the markdown draft to store alternatives of the same expression for use in the current PDF output (a non-RFC output used by FFmpeg) and for use in the RFC output. This is primarily because the PDF output supports LaTex but the RFC output must be in much simpler ASCII. So the patch proposes expressions such as:

PDF:$$Q_{i}[a-b]=Table_{i}[(a-b)\&255]$$      
RFC:```      
RFC:Q_{i}[a − b] = Table_{i}[(a − b)&255]      
RFC:```

And then the Makefile strips the prefixes (PDF: and RFC:) and uses the appropriate lines for the appropriate output. This comment on the PR, https://github.com/FFmpeg/FFV1/pull/50#issuecomment-287559570 <https://github.com/FFmpeg/FFV1/pull/50#issuecomment-287559570>, demonstrates what the most complex equations of the FFV1 specification look like in the RFC output of this patch. It was a challenge to replicate the PDF’s use of multi-level subscripting to depict complex sequences within an RFC. In the PR I accommodate that in a single-line expression using a locally defined syntax that is similar to how subscripts are used in LaTeX. I also worked with text alignment in the equations of the RFC to better imply line-wrapping since many of the equations are far too long to fit on a single RFC line.

   a_{b} the b-th value of a sequence of a
   a_{b,c} the 'b,c'-th value of a sequence of a

A fully rendered output of the PR is available at https://gist.github.com/dericed/273ce52640b716d763d49bc955b4bead <https://gist.github.com/dericed/273ce52640b716d763d49bc955b4bead>.
Comments?

Best Regards,
Dave Rice