Skip to content

Commit

Permalink
Ignore justify blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
yamadapc committed Jun 16, 2017
1 parent 1837289 commit 0ef4cae
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/Text/JaTex/TexWriter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,15 @@ convertElem el@Element {..}
| n == "font" = do
(h, i) <- convertInlineChildren el
let prelude =
case lookupAttr' "size" of
case lookupAttr' "size"
-- Just fz -> do
-- let fz' = read fz * 2
-- comm2
-- "fontsize"
-- (fromString (show fz' <> "pt"))
-- (fromString (show (fz' * 1.2 :: Double) <> "pt"))
-- comm0 "selectfont"
of
_ -> return ()
add $ textell (TeXBraces (runLaTeX (prelude <> h <> i)))
| n == "contrib" = convertChildren el
Expand Down Expand Up @@ -267,16 +268,18 @@ convertElem el@Element {..}
| n == "p" = do
let align = lookupAttr' "align"
(h, inline) <- convertInlineChildren el
add $
begin
(case (Text.pack (fromMaybe "justify" align)) of
"center" -> "Center"
"left" -> "FlushLeft"
"right" -> "FlushRight"
"justify" -> "justify"
_ -> "justify")
(h <> inline)
| n == "break" = add $ newline
add $ do
let ma :: Maybe Text
ma =
case fromMaybe "justify" align of
"center" -> Just "Center"
"left" -> Just "FlushLeft"
"right" -> Just "FlushRight"
_ -> Nothing
case ma of
Just a -> begin a (h <> inline)
_ -> h <> inline
| n == "break" = add newline
| n == "code" || n == "codebold" = do
(h, inline) <- convertInlineChildren el
add $ h <> texttt inline
Expand Down

0 comments on commit 0ef4cae

Please sign in to comment.