Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
Update Render.hs
Browse files Browse the repository at this point in the history
Add special case to rendering TeXSeq to insert spaces after TeXCommS when necessary.
  • Loading branch information
rpglover64 committed Feb 13, 2015
1 parent 9495907 commit 8928b73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Text/LaTeX/Base/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ instance Render LaTeX where
in if null xs then "%\n"
else Data.Text.unlines $ fmap ("%" <>) xs

render (TeXSeq l1@(TeXCommS _) l2) = let r2 = render l2 in
render l1 <> (case uncons r2 of
Just (c,_) | isIdentChar c -> " "
_ -> "") <> r2
where isIdentChar = isAlpha
render (TeXSeq l1 l2) = render l1 <> render l2
render TeXEmpty = mempty

Expand Down

0 comments on commit 8928b73

Please sign in to comment.