Skip to content

Commit

Permalink
Fixed array alignment issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Apr 20, 2016
1 parent 24383b7 commit 28d398f
Show file tree
Hide file tree
Showing 262 changed files with 1,973 additions and 17,089 deletions.
10 changes: 8 additions & 2 deletions src/Text/TeXMath/Writers/OMML.hs
Expand Up @@ -68,16 +68,22 @@ showFraction props ft x y =
where x' = showExp props x
y' = showExp props y

maximum' :: [Int] -> Int
maximum' [] = 0
maximum' xs = maximum xs

makeArray :: [Element] -> [Alignment] -> [ArrayLine] -> Element
makeArray props as rs = mnode "m" $ mProps : map toMr rs
where mProps = mnode "mPr"
[ mnodeA "baseJc" "center" ()
, mnodeA "plcHide" "1" ()
, mnode "mcs" $ map toMc as' ]
as' = take (length rs) $ as ++ cycle [AlignDefault]
as' = take (maximum' $ map length rs) $ as ++ cycle [AlignDefault]
toMr r = mnode "mr" $ map (mnode "e" . concatMap (showExp props)) r
toMc a = mnode "mc" $ mnode "mcPr"
$ mnodeA "mcJc" (toAlign a) ()
[ mnodeA "mcJc" (toAlign a) ()
, mnodeA "count" "1" ()
]
toAlign AlignLeft = "left"
toAlign AlignRight = "right"
toAlign AlignCenter = "center"
Expand Down
51 changes: 10 additions & 41 deletions tests/writers/00000_C0_Controls_and_Basic_Latin.omml
Expand Up @@ -7,91 +7,60 @@
<m:m>
<m:mPr>
<m:baseJc m:val="center" />
<m:plcHide m:val="on" />
<m:plcHide m:val="1" />
<m:mcs>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
</m:mcs>
Expand Down
51 changes: 10 additions & 41 deletions tests/writers/00080_C1_Controls_and_Latin-1_Supplement.omml
Expand Up @@ -7,91 +7,60 @@
<m:m>
<m:mPr>
<m:baseJc m:val="center" />
<m:plcHide m:val="on" />
<m:plcHide m:val="1" />
<m:mcs>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
</m:mcs>
Expand Down
51 changes: 10 additions & 41 deletions tests/writers/00100_Latin_Extended-A.omml
Expand Up @@ -7,91 +7,60 @@
<m:m>
<m:mPr>
<m:baseJc m:val="center" />
<m:plcHide m:val="on" />
<m:plcHide m:val="1" />
<m:mcs>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
</m:mcPr>
</m:mc>
<m:mc>
<m:mcPr>
<m:mcJc m:val="left" />
<m:count m:val="1" />
</m:mcPr>
</m:mc>
</m:mcs>
Expand Down

0 comments on commit 28d398f

Please sign in to comment.