HaTeX 3.7.0.0 → 3.8.0.0
raw patch · 38 files changed
+254/−80 lines, 38 filesbinary-addedPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- HaTeX.cabal +11/−14
- README.md +5/−1
- Text/LaTeX/Base/Commands.hs +37/−1
- Text/LaTeX/Base/Parser.hs +22/−26
- Text/LaTeX/Base/Syntax.hs +139/−5
- Text/LaTeX/Packages/AMSMath.hs +9/−1
- Text/LaTeX/Packages/Beamer.hs +27/−29
- Text/LaTeX/Packages/TikZ/Simple.hs +2/−2
- Text/LaTeX/Packages/TikZ/Syntax.hs +2/−0
- Text/LaTeX/Packages/Trees.hs +0/−1
- docfiles/beamers/previewAnnArbor.png binary
- docfiles/beamers/previewAntibes.png binary
- docfiles/beamers/previewBergen.png binary
- docfiles/beamers/previewBerkeley.png binary
- docfiles/beamers/previewBerlin.png binary
- docfiles/beamers/previewBoadilla.png binary
- docfiles/beamers/previewCambridgeUS.png binary
- docfiles/beamers/previewCopenhagen.png binary
- docfiles/beamers/previewDarmstadt.png binary
- docfiles/beamers/previewDresden.png binary
- docfiles/beamers/previewFrankfurt.png binary
- docfiles/beamers/previewGoettingen.png binary
- docfiles/beamers/previewHannover.png binary
- docfiles/beamers/previewIlmenau.png binary
- docfiles/beamers/previewJuanLesPins.png binary
- docfiles/beamers/previewLuebeck.png binary
- docfiles/beamers/previewMadrid.png binary
- docfiles/beamers/previewMalmoe.png binary
- docfiles/beamers/previewMarburg.png binary
- docfiles/beamers/previewMontpellier.png binary
- docfiles/beamers/previewPaloAlto.png binary
- docfiles/beamers/previewPittsburgh.png binary
- docfiles/beamers/previewRochester.png binary
- docfiles/beamers/previewSingapore.png binary
- docfiles/beamers/previewSzeged.png binary
- docfiles/beamers/previewWarsaw.png binary
- docfiles/tikz/spiral.png binary
- docfiles/tikz/tikzsimple.png binary
@@ -1,5 +1,5 @@ Name: HaTeX -Version: 3.7.0.0 +Version: 3.8.0.0 Author: Daniel Díaz Category: Text, LaTeX Build-type: Simple @@ -21,27 +21,24 @@ See the @examples@ directory in the source distribution to look some simple examples. It would be good to get you started. The HaTeX User's Guide is available at <https://github.com/Daniel-Diaz/hatex-guide>. -Cabal-version: >= 1.6 +Cabal-version: >= 1.10 Extra-source-files: ReleaseNotes README.md -- Examples - Examples/fibs.hs - Examples/comments.hs - Examples/simple.hs - Examples/tree.hs - Examples/beamer.hs - Examples/matrices.hs - Examples/texy.hs - Examples/tikz.hs - Examples/tikzsimple.hs - Examples/fancyhdr.hs + Examples/*.hs +Extra-doc-files: + -- TikZ + docfiles/tikz/*.png + -- Beamer + docfiles/beamers/*.png Source-repository head type: git location: git@github.com:Daniel-Diaz/HaTeX.git Library + Default-language: Haskell2010 Build-depends: base == 4.* , bytestring >= 0.9.2.1 && < 0.11 , transformers >= 0.2.2 && < 0.4 @@ -83,6 +80,6 @@ Text.LaTeX.Packages.TikZ.Simple Text.LaTeX.Packages.TikZ.Syntax Other-modules: Paths_HaTeX - Extensions: OverloadedStrings - , CPP + Default-extensions: OverloadedStrings + Other-extensions: CPP ghc-options: -Wall -fno-warn-orphans
@@ -1,6 +1,6 @@ # HaTeX ReadMe -HaTeX is a Haskell library that implements the LaTeX syntax. +HaTeX is a Haskell library that implements the *LaTeX syntax*. Check a list of examples of usage in the [examples](Examples/) directory. A good starting point may be [simple.hs](Examples/simple.hs). @@ -24,6 +24,10 @@ However, note that the API may be unstable and is subject to any kind of change. In the other hand, this package follows the [_Package Versioning Policy_](http://www.haskell.org/haskellwiki/Package_versioning_policy), so it is unlikely to suffer from API breakages if you follow it too when importing the library. + +## Travis automatic build + +[](https://travis-ci.org/Daniel-Diaz/HaTeX) ## HaTeX User's Guide
@@ -195,6 +195,9 @@ , hyphenation , hyp , qts+ -- * External files+ , input+ , include ) where import Data.String@@ -218,6 +221,8 @@ -- | Calling 'between' @c l1 l2@ puts @c@ between @l1@ and @l2@ and -- appends them.+--+-- > between c l1 l2 = l1 <> c <> l2 between :: Monoid m => m -> m -> m -> m between c l1 l2 = l1 <> c <> l2 @@ -232,7 +237,7 @@ -- -- Since you are writing in Haskell, you may not need to output comments -- as you can add them in the Haskell source. I added this feature--- for completeness.+-- for completeness. It may be useful for debugging the output as well. (%:) :: LaTeXC l => l -> Text -> l (%:) l = (l <>) . comment @@ -290,15 +295,19 @@ section :: LaTeXC l => l -> l section = liftL $ \s -> TeXComm "section" [FixArg s] +-- | Start a new subsection. subsection :: LaTeXC l => l -> l subsection = liftL $ \sub -> TeXComm "subsection" [FixArg sub] +-- | Start a new sub/sub/section. subsubsection :: LaTeXC l => l -> l subsubsection = liftL $ \sub -> TeXComm "subsubsection" [FixArg sub] +-- | Start a paragraph. paragraph :: LaTeXC l => l -> l paragraph = liftL $ \p -> TeXComm "paragraph" [FixArg p] +-- | Start a subparagraph (minimal level of sectioning). subparagraph :: LaTeXC l => l -> l subparagraph = liftL $ \p -> TeXComm "subparagraph" [FixArg p] @@ -310,25 +319,34 @@ appendix :: LaTeXC l => l appendix = comm0 "appendix" +-- | An item of a list (see 'enumerate' or 'itemize').+-- The optional argument sets the design of the item. item :: LaTeXC l => Maybe l -> l item Nothing = commS "item " item (Just opt) = liftL (\opt_ -> TeXComm "item" [OptArg opt_]) opt +-- | Environment of ordered lists. Use 'item' to start each list+-- item. enumerate :: LaTeXC l => l -> l enumerate = liftL $ TeXEnv "enumerate" [] +-- | Environment of unordered lists. Use 'item' to start each list+-- item. itemize :: LaTeXC l => l -> l itemize = liftL $ TeXEnv "itemize" [] description :: LaTeXC l => l -> l description = liftL $ TeXEnv "description" [] +-- | Left-justify the argument. flushleft :: LaTeXC l => l -> l flushleft = liftL $ TeXEnv "flushleft" [] +-- | Right-justify the argument. flushright :: LaTeXC l => l -> l flushright = liftL $ TeXEnv "flushright" [] +-- | Center-justify the argument. center :: LaTeXC l => l -> l center = liftL $ TeXEnv "center" [] @@ -355,6 +373,7 @@ figure Nothing = liftL $ TeXEnv "figure" [] figure (Just p) = liftL $ TeXEnv "figure" [ OptArg $ TeXRaw $ render p ] +-- | Abstract section. abstract :: LaTeXC l => l -> l abstract = liftL $ TeXEnv "abstract" [] @@ -520,6 +539,7 @@ openany :: ClassOption openany = OpenAny +-- | The 'document' environment contains the body of the document. document :: LaTeXC l => l -> l document = liftL $ TeXEnv "document" [] @@ -614,15 +634,19 @@ fbox :: LaTeXC l => l -> l fbox = liftL $ \l -> TeXComm "fbox" [FixArg l] +-- | Render the date at compilation time. today :: LaTeXC l => l today = comm0 "today" +-- | Render the current page. thePage :: LaTeXC l => l thePage = comm0 "thepage" +-- | TeX logo. tex :: LaTeXC l => l tex = comm0 "TeX" +-- | LaTeX logo. laTeX2 :: LaTeXC l => l laTeX2 = comm0 "LaTeX" @@ -912,3 +936,15 @@ pageref :: LaTeXC l => l -> l pageref = liftL $ \l -> TeXComm "pageref" [FixArg $ TeXRaw $ render l]++-- Exteral files++-- | Import an external file and insert its content /as it is/.+input :: LaTeXC l => FilePath -> l+input fp = fromLaTeX $ TeXComm "input" [FixArg $ TeXRaw $ fromString fp]++-- | Similar to 'input', but forces a page break.+--+-- /Note: the file you are including cannot include other files./+include :: LaTeXC l => FilePath -> l+include fp = fromLaTeX $ TeXComm "include" [FixArg $ TeXRaw $ fromString fp]
@@ -26,6 +26,7 @@ import qualified Data.Attoparsec.Text as A (takeTill) import Data.Char (toLower) import Data.Monoid + import Data.Maybe (fromMaybe) import Data.Text (Text) import qualified Data.Text as T @@ -93,8 +94,8 @@ -- text2 handles it, starting with ']' ------------------------------------------------------------------------ block :: Parser LaTeX - block = choice [text, dolMath, comment, environment, command, text2] - + block = foldr1 (<|>) [text, dolMath, comment, text2, command, environment] + ------------------------------------------------------------------------ -- Text ------------------------------------------------------------------------ @@ -119,7 +120,7 @@ -- Environment ------------------------------------------------------------------------ environment :: Parser LaTeX - environment = choice [anonym, env] + environment = anonym <|> env anonym :: Parser LaTeX anonym = char '{' >> @@ -129,7 +130,7 @@ env = do _ <- char '\\' n <- envName "begin" - as <- cmdArgs + as <- fmap (fromMaybe []) cmdArgs b <- envBody n return $ TeXEnv (T.unpack n) as b @@ -138,13 +139,20 @@ _ <- string k _ <- char '{' n <- A.takeTill (== '}') - _ <- char '}' -- Is not this brace already taken by the takeTill? + _ <- char '}' return n envBody :: Text -> Parser LaTeX - envBody n = mconcat <$> block `manyTill` endenv + envBody n = mconcat <$> (bodyBlock n) `manyTill` endenv where endenv = try $ string ("\\end{" <> n <> "}") + bodyBlock :: Text -> Parser LaTeX + bodyBlock n = do + c <- peekChar + case c of + Just _ -> block + _ -> fail $ "Environment '" <> T.unpack n <> "' not finalized." + ------------------------------------------------------------------------ -- Command ------------------------------------------------------------------------ @@ -158,27 +166,20 @@ then special else do c <- A.takeTill endCmd - as <- cmdArgs - if null as - then return $ TeXCommS (T.unpack c) - else return $ TeXComm (T.unpack c) as + if c `elem` ["begin","end"] + then fail $ "Command not allowed: " ++ T.unpack c + else maybe (TeXCommS $ T.unpack c) (TeXComm $ T.unpack c) <$> cmdArgs ------------------------------------------------------------------------ -- Command Arguments ------------------------------------------------------------------------ - cmdArgs :: Parser [TeXArg] - cmdArgs = try (whitespace >> string "{}" >> return [FixArg TeXEmpty]) - <|> many1 cmdArg - <|> return [] + cmdArgs :: Parser (Maybe [TeXArg]) + cmdArgs = try (string "{}" >> return (Just [])) + <|> fmap Just (many1 cmdArg) + <|> return Nothing cmdArg :: Parser TeXArg cmdArg = do - -- A space after the command name indicates the end of the command. - -- I comment this line to prevent buggy parsings like "\cap [j_n, \omega)" - -- being interpreted as if "[" were the beginning of an argument, when the - -- space after "\cap" clearly indicates the opposite. - -- - -- whitespace c <- char '[' <|> char '{' let e = case c of '[' -> "]" @@ -190,11 +191,6 @@ '{' -> return $ FixArg b _ -> error "this cannot happen!" - whitespace :: Parser () - whitespace = try (do _ <- char ' ' - whitespace) - <|> return () - ------------------------------------------------------------------------ -- Special commands (consisting of one char) ------------------------------------------------------------------------ @@ -290,7 +286,7 @@ -- Helpers ------------------------------------------------------------------------ isSpecial :: Char -> Bool - isSpecial = (`elem` specials) -- ['\\', '[', '(', '{', '}'] + isSpecial = (`elem` specials) endCmd :: Char -> Bool endCmd c = notLowercaseAlph && notUppercaseAlph
@@ -14,11 +14,24 @@ -- * Escaping reserved characters , protectString , protectText + -- * Syntax analysis + , matchCommand + , lookForCommand + , matchEnv + , lookForEnv + , texmap + , texmapM + -- ** Utils + , getBody + , getPreamble ) where -import Data.Text (Text,concatMap) +import Data.Text (Text) +import qualified Data.Text import Data.Monoid import Data.String +import Control.Applicative +import Data.Functor.Identity (runIdentity) -- | Measure units defined in LaTeX. Use 'CustomMeasure' to use commands like 'textwidth'. -- For instance: @@ -39,7 +52,7 @@ -- | Different types of syntax for mathematical expressions. data MathType = Parentheses | Square | Dollar - deriving (Eq,Show,Ord) + deriving (Eq,Show) -- | Type of @LaTeX@ blocks. data LaTeX = @@ -65,10 +78,10 @@ -- | An argument for a 'LaTeX' command or environment. data TeXArg = - OptArg LaTeX -- ^ Optional argument. - | FixArg LaTeX -- ^ Fixed argument. + FixArg LaTeX -- ^ Fixed argument. + | OptArg LaTeX -- ^ Optional argument. | MOptArg [LaTeX] -- ^ Multiple optional argument. - | SymArg LaTeX -- ^ An argument enclosed between @\<@ and @\>@. + | SymArg LaTeX -- ^ An argument enclosed between @\<@ and @\>@. | MSymArg [LaTeX] -- ^ Version of 'SymArg' with multiple options. deriving (Eq,Show) @@ -113,3 +126,124 @@ protectChar '\\' = "\\textbackslash{}" protectChar '_' = "\\_{}" protectChar x = [x] + +-- Syntax analysis + +-- | Look into a 'LaTeX' syntax tree to find any call to the command with +-- the given name. It returns a list of arguments with which this command +-- is called. +-- +-- > lookForCommand = (fmap snd .) . matchCommand . (==) +-- +-- If the returned list is empty, the command was not found. However, +-- if the list contains empty lists, those are callings to the command +-- with no arguments. +-- +-- For example +-- +-- > lookForCommand "author" l +-- +-- would look for the argument passed to the @\\author@ command in @l@. +lookForCommand :: String -- ^ Name of the command. + -> LaTeX -- ^ LaTeX syntax tree. + -> [[TeXArg]] -- ^ List of arguments passed to the command. +lookForCommand = (fmap snd .) . matchCommand . (==) + +-- | Traverse a 'LaTeX' syntax tree and returns the commands (see 'TeXComm' and +-- 'TeXCommS') that matches the condition and their arguments in each call. +matchCommand :: (String -> Bool) -> LaTeX -> [(String,[TeXArg])] +matchCommand f (TeXComm str as) = + let xs = concatMap (matchCommandArg f) as + in if f str then (str,as) : xs else xs +matchCommand f (TeXCommS str) = if f str then [(str,[])] else [] +matchCommand f (TeXEnv _ as l) = + let xs = concatMap (matchCommandArg f) as + in xs ++ matchCommand f l +matchCommand f (TeXMath _ l) = matchCommand f l +matchCommand f (TeXOp _ l1 l2) = matchCommand f l1 ++ matchCommand f l2 +matchCommand f (TeXBraces l) = matchCommand f l +matchCommand f (TeXSeq l1 l2) = matchCommand f l1 ++ matchCommand f l2 +matchCommand _ _ = [] + +matchCommandArg :: (String -> Bool) -> TeXArg -> [(String,[TeXArg])] +matchCommandArg f (OptArg l ) = matchCommand f l +matchCommandArg f (FixArg l ) = matchCommand f l +matchCommandArg f (MOptArg ls) = concatMap (matchCommand f) ls +matchCommandArg f (SymArg l ) = matchCommand f l +matchCommandArg f (MSymArg ls) = concatMap (matchCommand f) ls + +-- | Similar to 'lookForCommand', but applied to environments. +-- It returns a list with arguments passed and content of the +-- environment in each call. +-- +-- > lookForEnv = (fmap (\(_,as,l) -> (as,l)) .) . matchEnv . (==) +-- +lookForEnv :: String -> LaTeX -> [([TeXArg],LaTeX)] +lookForEnv = (fmap (\(_,as,l) -> (as,l)) .) . matchEnv . (==) + +-- | Traverse a 'LaTeX' syntax tree and returns the environments (see +-- 'TeXEnv') that matches the condition, their arguments and their content +-- in each call. +matchEnv :: (String -> Bool) -> LaTeX -> [(String,[TeXArg],LaTeX)] +matchEnv f (TeXComm _ as) = concatMap (matchEnvArg f) as +matchEnv f (TeXEnv str as l) = + let xs = concatMap (matchEnvArg f) as + ys = matchEnv f l + zs = xs ++ ys + in if f str then (str,as,l) : zs else zs +matchEnv f (TeXMath _ l) = matchEnv f l +matchEnv f (TeXOp _ l1 l2) = matchEnv f l1 ++ matchEnv f l2 +matchEnv f (TeXBraces l) = matchEnv f l +matchEnv f (TeXSeq l1 l2) = matchEnv f l1 ++ matchEnv f l2 +matchEnv _ _ = [] + +matchEnvArg :: (String -> Bool) -> TeXArg -> [(String,[TeXArg],LaTeX)] +matchEnvArg f (OptArg l ) = matchEnv f l +matchEnvArg f (FixArg l ) = matchEnv f l +matchEnvArg f (MOptArg ls) = concatMap (matchEnv f) ls +matchEnvArg f (SymArg l ) = matchEnv f l +matchEnvArg f (MSymArg ls) = concatMap (matchEnv f) ls + +-- | The function 'texmap' looks for subexpressions that match a given +-- condition and applies a function to them. +-- +-- > texmap c f = runIdentity . texmapM c (pure . f) +texmap :: (LaTeX -> Bool) -- ^ Condition. + -> (LaTeX -> LaTeX) -- ^ Function to apply when the condition matches. + -> LaTeX -> LaTeX +texmap c f = runIdentity . texmapM c (pure . f) + +-- | Version of 'texmap' where the function returns values in a 'Monad'. +texmapM :: (Applicative m, Monad m) + => (LaTeX -> Bool) -- ^ Condition. + -> (LaTeX -> m LaTeX) -- ^ Function to apply when the condition matches. + -> LaTeX -> m LaTeX +texmapM c f = go + where + go l@(TeXComm str as) = if c l then f l else TeXComm str <$> mapM go' as + go l@(TeXEnv str as b) = if c l then f l else TeXEnv str <$> mapM go' as <*> go b + go l@(TeXMath t b) = if c l then f l else TeXMath t <$> go b + go l@(TeXOp str l1 l2) = if c l then f l else liftA2 (TeXOp str) (go l1) (go l2) + go l@(TeXBraces b) = if c l then f l else TeXBraces <$> go b + go l@(TeXSeq l1 l2) = if c l then f l else liftA2 TeXSeq (go l1) (go l2) + go l = if c l then f l else pure l + -- + go' (FixArg l ) = FixArg <$> go l + go' (OptArg l ) = OptArg <$> go l + go' (MOptArg ls) = MOptArg <$> mapM go ls + go' (SymArg l ) = SymArg <$> go l + go' (MSymArg ls) = MSymArg <$> mapM go ls + +-- | Extract the content of the 'document' environment, if present. +getBody :: LaTeX -> Maybe LaTeX +getBody l = + case lookForEnv "document" l of + ((_,b):_) -> Just b + _ -> Nothing + +-- | Extract the preamble of a 'LaTeX' document (everything before the 'document' +-- environment). It could be empty. +getPreamble :: LaTeX -> LaTeX +getPreamble (TeXEnv "document" _ _) = mempty +getPreamble (TeXSeq l1 l2) = getPreamble l1 <> getPreamble l2 +getPreamble l = l
@@ -128,12 +128,13 @@ mathDisplay = liftL $ TeXMath Square ------------------------------------------------------- --- Numeric instances for LaTeX and LaTeXT -- +------- Numeric instances for LaTeX and LaTeXT -------- ------------------------------------------------------- ----------- LaTeX instances -- | Careful! Method 'signum' is undefined. Don't use it! +-- This instance is defined in the "Text.LaTeX.Packages.AMSMath" module. instance Num LaTeX where (+) = TeXOp "+" (-) = TeXOp "-" @@ -145,11 +146,13 @@ signum _ = error "Cannot use \"signum\" Num method with a LaTeX value." -- | Division uses the LaTeX 'frac' command. +-- This instance is defined in the "Text.LaTeX.Packages.AMSMath" module. instance Fractional LaTeX where (/) = frac fromRational = rendertex . (fromRational :: Rational -> Double) -- | Undefined methods: 'asinh', 'atanh' and 'acosh'. +-- This instance is defined in the "Text.LaTeX.Packages.AMSMath" module. instance Floating LaTeX where pi = pi_ exp = (texp <>) @@ -174,14 +177,17 @@ ----------- LaTeXT instances -- | Warning: this instance only exists for the 'Num' instance. +-- This instance is defined in the "Text.LaTeX.Packages.AMSMath" module. instance Monad m => Eq (LaTeXT m a) where _ == _ = error "Cannot use \"(==)\" Eq method with a LaTeXT value." -- | Warning: this instance only exists for the 'Num' instance. +-- This instance is defined in the "Text.LaTeX.Packages.AMSMath" module. instance Monad m => Show (LaTeXT m a) where show _ = error "Cannot use \"show\" Show method with a LaTeXT value." -- | Careful! Method 'signum' is undefined. Don't use it! +-- This instance is defined in the "Text.LaTeX.Packages.AMSMath" module. instance Monad m => Num (LaTeXT m a) where (+) = liftOp (+) (-) = liftOp (-) @@ -193,11 +199,13 @@ signum _ = error "Cannot use \"signum\" Num method with a LaTeXT value." -- | Division uses the LaTeX 'frac' command. +-- This instance is defined in the "Text.LaTeX.Packages.AMSMath" module. instance Monad m => Fractional (LaTeXT m a) where (/) = liftOp (/) fromRational = fromLaTeX . fromRational -- | Undefined methods: 'asinh', 'atanh' and 'acosh'. +-- This instance is defined in the "Text.LaTeX.Packages.AMSMath" module. instance Monad m => Floating (LaTeXT m a) where pi = pi_ exp = liftFun exp
@@ -91,43 +91,41 @@ -- THEMES -- ---TODO: Add a short description of each theme. - -- | A 'Theme' of a presentation. See 'usetheme'. -- A preview of each one is given below. data Theme = - AnnArbor -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewAnnArbor.png>> - | Antibes -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewAntibes.png>> - | Bergen -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewBergen.png>> - | Berkeley -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewBerkeley.png>> - | Berlin -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewBerlin.png>> - | Boadilla -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewBoadilla.png>> - | CambridgeUS -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewCambridgeUS.png>> - | Copenhagen -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewCopenhagen.png>> - | Darmstadt -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewDarmstadt.png>> - | Dresden -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewDresden.png>> - | Frankfurt -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewFrankfurt.png>> - | Goettingen -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewGoettingen.png>> - | Hannover -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewHannover.png>> - | Ilmenau -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewIlmenau.png>> - | JuanLesPins -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewJuanLesPins.png>> - | Luebeck -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewLuebeck.png>> - | Madrid -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewMadrid.png>> - | Malmoe -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewMalmoe.png>> - | Marburg -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewMarburg.png>> - | Montpellier -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewMontpellier.png>> - | PaloAlto -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewPaloAlto.png>> - | Pittsburgh -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewPittsburgh.png>> - | Rochester -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewRochester.png>> - | Singapore -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewSingapore.png>> - | Szeged -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewSzeged.png>> - | Warsaw -- ^ <<http://daniel-diaz.github.io/projects/hatex/beamer/previewWarsaw.png>> + AnnArbor -- ^ <<docfiles/beamers/previewAnnArbor.png>> + | Antibes -- ^ <<docfiles/beamers/previewAntibes.png>> + | Bergen -- ^ <<docfiles/beamers/previewBergen.png>> + | Berkeley -- ^ <<docfiles/beamers/previewBerkeley.png>> + | Berlin -- ^ <<docfiles/beamers/previewBerlin.png>> + | Boadilla -- ^ <<docfiles/beamers/previewBoadilla.png>> + | CambridgeUS -- ^ <<docfiles/beamers/previewCambridgeUS.png>> + | Copenhagen -- ^ <<docfiles/beamers/previewCopenhagen.png>> + | Darmstadt -- ^ <<docfiles/beamers/previewDarmstadt.png>> + | Dresden -- ^ <<docfiles/beamers/previewDresden.png>> + | Frankfurt -- ^ <<docfiles/beamers/previewFrankfurt.png>> + | Goettingen -- ^ <<docfiles/beamers/previewGoettingen.png>> + | Hannover -- ^ <<docfiles/beamers/previewHannover.png>> + | Ilmenau -- ^ <<docfiles/beamers/previewIlmenau.png>> + | JuanLesPins -- ^ <<docfiles/beamers/previewJuanLesPins.png>> + | Luebeck -- ^ <<docfiles/beamers/previewLuebeck.png>> + | Madrid -- ^ <<docfiles/beamers/previewMadrid.png>> + | Malmoe -- ^ <<docfiles/beamers/previewMalmoe.png>> + | Marburg -- ^ <<docfiles/beamers/previewMarburg.png>> + | Montpellier -- ^ <<docfiles/beamers/previewMontpellier.png>> + | PaloAlto -- ^ <<docfiles/beamers/previewPaloAlto.png>> + | Pittsburgh -- ^ <<docfiles/beamers/previewPittsburgh.png>> + | Rochester -- ^ <<docfiles/beamers/previewRochester.png>> + | Singapore -- ^ <<docfiles/beamers/previewSingapore.png>> + | Szeged -- ^ <<docfiles/beamers/previewSzeged.png>> + | Warsaw -- ^ <<docfiles/beamers/previewWarsaw.png>> -- | Boxes | Default -- | CustomTheme String - deriving Show + deriving (Eq,Show) instance Render Theme where render (CustomTheme str) = fromString str
@@ -14,7 +14,7 @@ -- contains a complete example of usage of this module with several pictures. -- Below you can see a picture along with the code it came from. ----- <<http://daniel-diaz.github.com/projects/hatex/tikzsimple.png>>+-- <<docfiles/tikz/tikzsimple.png>> -- -- > myFigure :: Figure -- > myFigure = Scale 2 $ Figures@@ -108,7 +108,7 @@ -- -- Here is an example with a logarithmic spiral. ----- <<http://daniel-diaz.github.io/projects/hatex/spiral.png>>+-- <<docfiles/tikz/spiral.png>> -- -- > spiral :: Figure -- > spiral = LineWidth (Pt 2) $
@@ -185,6 +185,7 @@ startingPoint (Circle x _) = startingPoint x startingPoint (Ellipse x _ _) = startingPoint x startingPoint (Grid x _ _) = startingPoint x+startingPoint (Node x _) = startingPoint x -- | Calculate the last point of a 'TPath'. lastPoint :: TPath -> TPoint@@ -195,6 +196,7 @@ lastPoint (Circle x _) = lastPoint x lastPoint (Ellipse x _ _) = lastPoint x lastPoint (Grid _ _ p) = p+lastPoint (Node x _) = lastPoint x -- Path builders
@@ -9,7 +9,6 @@ import Data.Foldable import Data.Traversable import Control.Applicative -import Data.String -- | Tree datatype. data Tree a =
binary file changed (absent → 6286 bytes)
binary file changed (absent → 4981 bytes)
binary file changed (absent → 5287 bytes)
binary file changed (absent → 5187 bytes)
binary file changed (absent → 5135 bytes)
binary file changed (absent → 5077 bytes)
binary file changed (absent → 6496 bytes)
binary file changed (absent → 5195 bytes)
binary file changed (absent → 5107 bytes)
binary file changed (absent → 5195 bytes)
binary file changed (absent → 5034 bytes)
binary file changed (absent → 5367 bytes)
binary file changed (absent → 5179 bytes)
binary file changed (absent → 5253 bytes)
binary file changed (absent → 5405 bytes)
binary file changed (absent → 4890 bytes)
binary file changed (absent → 5903 bytes)
binary file changed (absent → 4333 bytes)
binary file changed (absent → 5968 bytes)
binary file changed (absent → 5048 bytes)
binary file changed (absent → 5539 bytes)
binary file changed (absent → 4047 bytes)
binary file changed (absent → 4610 bytes)
binary file changed (absent → 5099 bytes)
binary file changed (absent → 5107 bytes)
binary file changed (absent → 13651 bytes)
binary file changed (absent → 14451 bytes)
binary file changed (absent → 1332 bytes)