[liblouis-liblouisxml] Re: Where is the code for formatting mtable

  • From: Michael Whapples <mwhapples@xxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Fri, 21 Mar 2014 15:37:39 +0000

I think this is what I am puzzling over. Reading code in transcribe_math.c I find nothing specific for processing tables.


By the time we are in doAlignColumns/utd_doAlignColumns in transcriber.c it seems like one is dealing with a processed linear text format rather than XML.

I have just realised why this is not quite matching up, its the semantic action file defining the escape sequences for end column and end row which doAlignColumns is using. So may be there is no table handling code in transcribe_math.c for processing table XML.

So this means that probably counting rows and columns can only occur in doAlignColumns/utd_doAlignColumns, but by that point all information like columnspan and rowspan will be lost. Also is it possible to raise an error to stop translation at that point?

I could insert some custom code in transcribe_math.c to inspect the XML structure, but then that really will be embedding document structure knowledge in the code. At the moment only MathML is used for math in LibLouisUTDML, but there is no real reason to restrict ourselves to that (eg. Office Math ML as found in newer versions of word's docx XML format).

I think we are going to have to choose the least evil option here, as things stand there seems no really good way to do it. Any thoughts?

Michael Whapples
On 21/03/2014 14:34, John J. Boyer wrote:
The place to detect errors would be in transcribe_math.c .

John

On Fri, Mar 21, 2014 at 01:19:37PM +0000, Michael Whapples wrote:
Thanks, the problem of using search in an editor, it only finds the
exact match.

My guess based on other function names is that utd_doAlignColumns will
be for UTD output formatting where as doAlignColumns is probably for
other outputs.

More of a case why I say that might not be the place to provide a fix as
it would need applying in multiple places.

Michael Whapples
On 21/03/2014 13:16, Brandon Roller wrote:
I think there are two methods.  One is doAlignColumns and another is
utd_doAlignColumns.  I'm not sure of the difference.


On Fri, Mar 21, 2014 at 9:13 AM, Michael Whapples <mwhapples@xxxxxxx
<mailto:mwhapples@xxxxxxx>> wrote:

    Doing a search in transcriber.c gives no results. However I do
    find doAlignColumns. My feeling though looking at that, it may not
    be the best place to fix LibLouisUTDML, it probably should be done
    whilst processing the XML and that function does not seem to be
    dealing with the XML.

    Michael Whapples
    On 20/03/2014 14:07, John J. Boyer wrote:

        In transcriber.c look at the function utd_alignColumns .
        Putting out an error message is certainly a good idea.

        John

        On Thu, Mar 20, 2014 at 12:46:38PM +0000, Michael Whapples wrote:

            Hello,
            I am puzzling over where the formatting of mtable code is
            in LibLouisUTDML.

            I want to adjust LibLouisUTDML so that in a mtable should
            the number of
            mtd differ then it will raise an error inline with the
            MathML 2.0 standard.

            Michael Whapples
            For a description of the software, to download it and links to
            project pages go to http://www.abilitiessoft.com


    For a description of the software, to download it and links to
    project pages go to http://www.abilitiessoft.com



For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: