| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Ltml.ToLaTeX.GlobalState
Description
Provides the GlobalState and everything to mutate it.
Synopsis
- data GlobalState = GlobalState {
- _counterState :: CounterState
- _flagState :: FlagState
- _formatState :: FormatState
- _enumPosition :: [Int]
- _labelToRef :: Map Label Text
- _labelToFootNote :: Map Label Footnote
- _toc :: DList PreLaTeX
- _appendixHeaders :: DList PreLaTeX
- _preDocument :: PreLaTeX
- data DocType
- nextSupersection :: State GlobalState Int
- nextSection :: State GlobalState Int
- nextInsertedSection :: State GlobalState Int
- nextParagraph :: State GlobalState Int
- nextSentence :: State GlobalState Int
- nextFootnote :: State GlobalState Int
- nextAppendix :: State GlobalState Int
- resetCountersHard :: State GlobalState ()
- resetCountersSoft :: State GlobalState ()
- insertRefLabel :: Maybe Label -> Text -> State GlobalState ()
- nextEnumPosition :: State GlobalState [Int]
- descendEnumTree :: State GlobalState a -> State GlobalState a
- addTOCEntry :: Int -> Int -> KeyFormat -> IdentifierFormat -> PreLaTeX -> State GlobalState PreLaTeX
- addAppendixHeaderEntry :: Int -> KeyFormat -> IdentifierFormat -> PreLaTeX -> State GlobalState ()
- addHeaderFooter :: HeaderFooterFormat -> HeaderFooterFormat -> Text -> Text -> Text -> State GlobalState ()
- counterState :: Lens' GlobalState CounterState
- flagState :: Lens' GlobalState FlagState
- formatState :: Lens' GlobalState FormatState
- supersectionCTR :: Lens' CounterState Int
- sectionCTR :: Lens' CounterState Int
- insertedSectionCTR :: Lens' CounterState Int
- paragraphCTR :: Lens' CounterState Int
- sentenceCTR :: Lens' CounterState Int
- footnoteCTR :: Lens' CounterState Int
- appendixCTR :: Lens' CounterState Int
- tocLabelCTR :: Lens' CounterState Int
- enumPosition :: Lens' GlobalState [Int]
- enumIdentifierFormat :: Lens' FormatState IdentifierFormat
- appendixFormat :: Lens' FormatState AppendixElementFormat
- docHeadingFormat :: Lens' FormatState MainHeadingFormat
- sectionFormat :: Lens' FormatState SectionFormat
- onlyOneParagraph :: Lens' FlagState Bool
- flaggedParent :: Lens' FlagState Bool
- flaggedChildren :: Lens' FlagState Bool
- docType :: Lens' FlagState DocType
- labelToRef :: Lens' GlobalState (Map Label Text)
- labelToFootNote :: Lens' GlobalState (Map Label Footnote)
- toc :: Lens' GlobalState (DList PreLaTeX)
- appendixHeaders :: Lens' GlobalState (DList PreLaTeX)
- preDocument :: Lens' GlobalState PreLaTeX
- initialGlobalState :: GlobalState
- initialCounterState :: CounterState
- initialFlagState :: FlagState
Documentation
data GlobalState Source #
State for generating and keeping track of context
Constructors
| GlobalState | |
Fields
| |
Instances
| Show GlobalState Source # | |
Defined in Language.Ltml.ToLaTeX.GlobalState Methods showsPrec :: Int -> GlobalState -> ShowS # show :: GlobalState -> String # showList :: [GlobalState] -> ShowS # | |
introduced a datatype instead of using bool to make it easily extensible
resetCountersHard :: State GlobalState () Source #
resetCountersSoft :: State GlobalState () Source #
insertRefLabel :: Maybe Label -> Text -> State GlobalState () Source #
nextEnumPosition :: State GlobalState [Int] Source #
Get the path to the current level
descendEnumTree :: State GlobalState a -> State GlobalState a Source #
Go one enum level deeper for the required action
addTOCEntry :: Int -> Int -> KeyFormat -> IdentifierFormat -> PreLaTeX -> State GlobalState PreLaTeX Source #
the state uses a dlist to keep track of the toc. so we render the (mostly) heading, wrap it in a hyperlink, to make the final pdf interactive. returns the corresponding hypertarget.
addAppendixHeaderEntry :: Int -> KeyFormat -> IdentifierFormat -> PreLaTeX -> State GlobalState () Source #
since the toc is emptied for each document, but we need the headings of the appendices in the main document, we collect it with this function as well
addHeaderFooter :: HeaderFooterFormat -> HeaderFooterFormat -> Text -> Text -> Text -> State GlobalState () Source #
function to fill the header and footer with the required content
counterState :: Lens' GlobalState CounterState Source #
flagState :: Lens' GlobalState FlagState Source #
formatState :: Lens' GlobalState FormatState Source #
supersectionCTR :: Lens' CounterState Int Source #
sectionCTR :: Lens' CounterState Int Source #
insertedSectionCTR :: Lens' CounterState Int Source #
paragraphCTR :: Lens' CounterState Int Source #
sentenceCTR :: Lens' CounterState Int Source #
footnoteCTR :: Lens' CounterState Int Source #
appendixCTR :: Lens' CounterState Int Source #
tocLabelCTR :: Lens' CounterState Int Source #
enumPosition :: Lens' GlobalState [Int] Source #
enumIdentifierFormat :: Lens' FormatState IdentifierFormat Source #
appendixFormat :: Lens' FormatState AppendixElementFormat Source #
docHeadingFormat :: Lens' FormatState MainHeadingFormat Source #
sectionFormat :: Lens' FormatState SectionFormat Source #
onlyOneParagraph :: Lens' FlagState Bool Source #
flaggedParent :: Lens' FlagState Bool Source #
flaggedChildren :: Lens' FlagState Bool Source #
labelToRef :: Lens' GlobalState (Map Label Text) Source #
labelToFootNote :: Lens' GlobalState (Map Label Footnote) Source #
toc :: Lens' GlobalState (DList PreLaTeX) Source #
appendixHeaders :: Lens' GlobalState (DList PreLaTeX) Source #
preDocument :: Lens' GlobalState PreLaTeX Source #
initialGlobalState :: GlobalState Source #
state with everything set to 0 or mempty. only the staticDocumentFormat (which is used to build the final pdf) is preset in Format.hs
initialCounterState :: CounterState Source #
initialFlagState :: FlagState Source #