backend-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Language.Ltml.ToLaTeX.GlobalState

Description

Provides the GlobalState and everything to mutate it.

Synopsis

Documentation

data GlobalState Source #

State for generating and keeping track of context

Constructors

GlobalState 

Fields

Instances

Instances details
Show GlobalState Source # 
Instance details

Defined in Language.Ltml.ToLaTeX.GlobalState

data DocType Source #

introduced a datatype instead of using bool to make it easily extensible

Constructors

Main 
Appendix 

Instances

Instances details
Show DocType Source # 
Instance details

Defined in Language.Ltml.ToLaTeX.GlobalState

Eq DocType Source # 
Instance details

Defined in Language.Ltml.ToLaTeX.GlobalState

Methods

(==) :: DocType -> DocType -> Bool #

(/=) :: DocType -> DocType -> Bool #

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 #

sectionFormat :: Lens' FormatState SectionFormat Source #

onlyOneParagraph :: Lens' FlagState Bool Source #

flaggedParent :: Lens' FlagState Bool Source #

flaggedChildren :: Lens' FlagState Bool Source #

docType :: Lens' FlagState DocType Source #

toc :: Lens' GlobalState (DList 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 #