Skip to content

Commit cfbc274

Browse files
committed
Text.TeXMath.Shared: expose isRLSequence.
[API change, non-breaking]
1 parent e7ada90 commit cfbc274

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Text/TeXMath/Shared.hs

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module Text.TeXMath.Shared
3535
, handleDownup
3636
, isUppercaseGreek
3737
, toPrimes
38+
, isRLSequence
3839
) where
3940

4041

@@ -375,3 +376,8 @@ toPrimes (ESymbol ty s) | ty == Pun || ty == Ord = go s
375376
Just ('\x2057', t') -> ("''''" <>) <$> go t'
376377
_ -> Nothing
377378
toPrimes _ = Nothing
379+
380+
isRLSequence :: [Alignment] -> Bool
381+
isRLSequence [AlignRight, AlignLeft] = True
382+
isRLSequence (AlignRight : AlignLeft : as) = isRLSequence as
383+
isRLSequence _ = False

src/Text/TeXMath/Writers/TeX.hs

+1-6
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ writeExp (EStyled ttype es) = do
287287
tell [ControlSeq txtcmd]
288288
tellGroup (mapM_ writeExp $ everywhere (mkT (fromUnicode ttype)) es)
289289
writeExp (EArray as rows)
290-
| isRLSequence as = do
290+
| S.isRLSequence as = do
291291
env <- asks mathEnv
292292
if "amsmath" `elem` env
293293
then table "aligned" [] rows
@@ -298,11 +298,6 @@ writeExp (EArray aligns rows) = do
298298
then table "matrix" [] rows
299299
else table "array" aligns rows
300300

301-
isRLSequence :: [Alignment] -> Bool
302-
isRLSequence [AlignRight, AlignLeft] = True
303-
isRLSequence (AlignRight : AlignLeft : as) = isRLSequence as
304-
isRLSequence _ = False
305-
306301
table :: T.Text -> [Alignment] -> [ArrayLine] -> Math ()
307302
table name aligns rows = do
308303
tell [ControlSeq "\\begin", Grouped [Literal name]]

0 commit comments

Comments
 (0)