Skip to content

Commit

Permalink
Removed hardcoded spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
spockz committed Dec 16, 2011
1 parent b9d9c58 commit 4c16e35
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
36 changes: 18 additions & 18 deletions src/Language/LaTeX.hs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ makeLatexSafe = replace ">" "\\textgreater"
{- This part is to conserve some lhs2TeX behaviour. Really shouldn't be here... -} {- This part is to conserve some lhs2TeX behaviour. Really shouldn't be here... -}
. replace "=" "\\ = \\ " . replace "=" "\\ = \\ "
-- . replace "_" "\\ \\anonymous\\ " -- . replace "_" "\\ \\anonymous\\ "
. replace "$" "\\ \\mathbin{\\$}\\ " . replace "$" "{\\$} "
. replace "&&" "\\ \\mathrel{\\wedge}\\ " . replace "&&" "\\mathrel{\\wedge}"
. replace "||" "\\ \\mathrel{\\vee}\\ " . replace "||" "\\mathrel{\\vee}"
. replace "<-" "\\ \\leftarrow\\ " . replace "<-" "\\leftarrow"
. replace "->" "\\ \\to\\ " . replace "->" "\\to"
. replace "=>" "\\ \\Rightarrow\\ " . replace "=>" "\\Rightarrow"
. replace "==" "\\ \\equiv\\ " . replace "==" "\\equiv"
. replace "++" "\\ \\plus\\ " . replace "++" "\\plus"
. replace "/=" "\\ \\not\\equiv\\ " . replace "/=" "\\not\\equiv"
. replace "<=" "\\ \\leq\\ " . replace "<=" "\\leq"
. replace ">=" "\\ \\geq\\ " . replace ">=" "\\geq"
. replace ">>" "\\ \\sequ\\ " . replace ">>" "\\seq"
. replace ">>>" "\\ \\ggg\\ " . replace ">>>" "\\ggg"
. replace "<<<" "\\ \\lll\\ " . replace "<<<" "\\lll"
. replace ">>=" "\\ \\bind\\ " . replace ">>=" "\\bind"
. replace "=<<" "\\ \\rbind\\ " . replace "=<<" "\\rbind"
. replace "undefined" "\\bot\\ " . replace "undefined" "\\bot"
. replace "not" "\\ \\neg " . replace "not" "\\neg"




-- %format _ = "\anonymous " -- %format _ = "\anonymous "
Expand Down
2 changes: 1 addition & 1 deletion src/Literate/Haskell.hs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ mapping = [


mtypes :: SimpleInfo -> [(String, String)] mtypes :: SimpleInfo -> [(String, String)]
mtypes SimpleInfo{types} = map dp types mtypes SimpleInfo{types} = map dp types
moperators SimpleInfo{operators} = map (\ a -> (a, "\\ \\mathbin{"++ makeLatexSafe a++"}\\ ")) moperators SimpleInfo{operators} = map (\ a -> (a, "\\mathbin{"++ makeLatexSafe a++"}"))
operators operators
mconstructors SimpleInfo{constructors} = map dp constructors mconstructors SimpleInfo{constructors} = map dp constructors
mfunctions SimpleInfo{functions } = map dp functions mfunctions SimpleInfo{functions } = map dp functions
Expand Down
2 changes: 1 addition & 1 deletion src/LiterateHighlighter.hs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ main = do args <- cmdArgsRun standard
else else
printFormatting args printFormatting args


where printFormat keyword (seek, rep) = "%format " ++ seek ++ " = \" {\\lhsCH" ++ keyword ++ "{" ++ rep ++ "}}\"" where printFormat keyword (seek, rep) = "%format " ++ seek ++ " = \"{\\lhsCH" ++ keyword ++ "{" ++ rep ++ "}}\""
writeOutput output mapping si = writeOutput output mapping si =
mapM_ (\(keyword, f) -> mapM_ (hPutStrLn output . printFormat keyword) mapM_ (\(keyword, f) -> mapM_ (hPutStrLn output . printFormat keyword)
(filter lhs2TeXSafe (f si)) (filter lhs2TeXSafe (f si))
Expand Down

0 comments on commit 4c16e35

Please sign in to comment.