From 8fcf66453cc4f9d1cf9413aa466477e56290d733 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 27 Aug 2017 17:01:24 -0700 Subject: RST reader: Fixed `..include::` directive. Closes #3880. --- test/command/3880.md | 6 ++++++ test/command/3880.txt | 1 + 2 files changed, 7 insertions(+) create mode 100644 test/command/3880.md create mode 100644 test/command/3880.txt (limited to 'test') diff --git a/test/command/3880.md b/test/command/3880.md new file mode 100644 index 000000000..b8edaf08f --- /dev/null +++ b/test/command/3880.md @@ -0,0 +1,6 @@ +``` +pandoc -f rst -t native +.. include:: command/3880.txt +^D +[Para [Str "hi"]] +``` diff --git a/test/command/3880.txt b/test/command/3880.txt new file mode 100644 index 000000000..45b983be3 --- /dev/null +++ b/test/command/3880.txt @@ -0,0 +1 @@ +hi -- cgit v1.2.3 From 05bb8ef4aa6faa6a4da3c54a0483d42b846733ca Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 28 Aug 2017 17:48:46 +0300 Subject: RST reader: handle blank lines correctly in line blocks (#3881) Previously pandoc would sometimes combine two line blocks separated by blanks, and ignore trailing blank lines within the line block. Test is checked to be consisted with http://rst.ninjs.org/ --- src/Text/Pandoc/Parsing.hs | 2 +- test/Tests/Readers/RST.hs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index 9ed18d4e0..2543f11f0 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -838,7 +838,7 @@ blankLineBlockLine = try (char '|' >> blankline) lineBlockLines :: Monad m => ParserT [Char] st m [String] lineBlockLines = try $ do lines' <- many1 (lineBlockLine <|> ((:[]) <$> blankLineBlockLine)) - skipMany1 $ blankline <|> blankLineBlockLine + skipMany $ blankline return lines' -- | Parse a table using 'headerParser', 'rowParser', diff --git a/test/Tests/Readers/RST.hs b/test/Tests/Readers/RST.hs index 61a2673f5..928fc1a99 100644 --- a/test/Tests/Readers/RST.hs +++ b/test/Tests/Readers/RST.hs @@ -136,6 +136,19 @@ tests = [ "line block with blank line" =: para "but must stop here") , "line block with 3 lines" =: "| a\n| b\n| c" =?> lineBlock ["a", "b", "c"] + , "line blocks with blank lines" =: T.unlines + [ "|" + , "" + , "|" + , "| a" + , "| b" + , "|" + , "" + , "|" + ] =?> + lineBlock [""] <> + lineBlock ["", "a", "b", ""] <> + lineBlock [""] , "quoted literal block using >" =: "::\n\n> quoted\n> block\n\nOrdinary paragraph" =?> codeBlock "> quoted\n> block" <> para "Ordinary paragraph" , "quoted literal block using | (not a line block)" =: "::\n\n| quoted\n| block\n\nOrdinary paragraph" -- cgit v1.2.3 From 14f813c3f294739f3965058e27eb228ab3ed90d5 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 29 Aug 2017 22:40:34 +0300 Subject: Muse reader: parse verse markup (#3882) --- src/Text/Pandoc/Readers/Muse.hs | 22 +++++++++++++++++++++- test/Tests/Readers/Muse.hs | 24 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 2947c50d6..a4512cdd7 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -32,7 +32,6 @@ TODO: - {{{ }}} syntax for - Page breaks (five "*") - Headings with anchors (make it round trip with Muse writer) -- Verse markup (">") - Org tables - table.el tables - Images with attributes (floating and width) @@ -181,6 +180,7 @@ blockElements = choice [ comment , rightTag , quoteTag , verseTag + , lineBlock , bulletList , orderedList , definitionList @@ -298,6 +298,26 @@ noteBlock = try $ do blocksTillNote = many1Till block (eof <|> () <$ lookAhead noteMarker) +-- +-- Verse markup +-- + +lineVerseLine :: PandocMonad m => MuseParser m String +lineVerseLine = try $ do + char '>' + white <- many1 (char ' ' >> pure '\160') + rest <- anyLine + return $ tail white ++ rest + +blanklineVerseLine :: PandocMonad m => MuseParser m Char +blanklineVerseLine = try $ char '>' >> blankline + +lineBlock :: PandocMonad m => MuseParser m (F Blocks) +lineBlock = try $ do + lns <- many1 (pure <$> blanklineVerseLine <|> lineVerseLine) + lns' <- mapM (parseFromString' (trimInlinesF . mconcat <$> many inline)) lns + return $ B.lineBlock <$> sequence lns' + -- -- lists -- diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 1f3218daf..4e5e5b606 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -145,6 +145,30 @@ tests = , " with a continuation" ] =?> blockQuote (para "This is a quotation with a continuation") + , "Verse" =: + T.unlines [ "> This is" + , "> First stanza" + , ">" -- Emacs produces verbatim ">" here, we follow Amusewiki + , "> And this is" + , "> Second stanza" + , ">" + , "" + , ">" + , "" + , "> Another verse" + , "> is here" + ] =?> + lineBlock [ "This is" + , "First stanza" + , "" + , "And this is" + , "\160\160Second stanza" + , "" + ] <> + lineBlock [ "" ] <> + lineBlock [ "Another verse" + , "\160\160\160is here" + ] ] , "Quote tag" =: "Hello, world" =?> blockQuote (para $ text "Hello, world") , "Verse tag" =: -- cgit v1.2.3 From 6a6c3858b47671f02f4f50ca2d6ab97d280a0f49 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 31 Aug 2017 18:02:07 +0200 Subject: Org writer: stop using raw HTML to wrap divs Div's are difficult to translate into org syntax, as there are multiple div-like structures (drawers, special blocks, greater blocks) which all have their advantages and disadvantages. Previously pandoc would use raw HTML to preserve the full div information; this was rarely useful and resulted in visual clutter. Div-rendering was changed to discard the div's classes and key-value pairs if there is no natural way to translate the div into an org structure. Closes: #3771 --- src/Text/Pandoc/Writers/Org.hs | 63 +++++++++++++++++------------------------- test/command/3771.md | 14 ++++++++++ 2 files changed, 40 insertions(+), 37 deletions(-) create mode 100644 test/command/3771.md (limited to 'test') diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index 48f17c4fb..88f42acd4 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -129,36 +129,25 @@ blockToOrg (Div (_,classes@(cls:_),kvs) bs) | "drawer" `elem` classes = do blankline $$ contents $$ blankline $$ drawerEndTag $$ blankline -blockToOrg (Div attrs bs) = do +blockToOrg (Div (ident, classes, kv) bs) = do contents <- blockListToOrg bs + -- if one class looks like the name of a greater block then output as such: + -- The ID, if present, is added via the #+NAME keyword; other classes and + -- key-value pairs are kept as #+ATTR_HTML attributes. let isGreaterBlockClass = (`elem` ["center", "quote"]) . map toLower - return $ case attrs of - ("", [], []) -> - -- nullAttr, treat contents as if it wasn't wrapped - blankline $$ contents $$ blankline - (ident, [], []) -> - -- only an id: add id as an anchor, unwrap the rest - blankline $$ "<<" <> text ident <> ">>" $$ contents $$ blankline - (ident, classes, kv) -> - -- if one class looks like the name of a greater block then output as - -- such: The ID, if present, is added via the #+NAME keyword; other - -- classes and key-value pairs are kept as #+ATTR_HTML attributes. - let - (blockTypeCand, classes') = partition isGreaterBlockClass classes - in case blockTypeCand of - (blockType:classes'') -> - blankline $$ attrHtml (ident, classes'' <> classes', kv) $$ - "#+BEGIN_" <> text blockType $$ contents $$ - "#+END_" <> text blockType $$ blankline - _ -> - -- fallback: wrap in div tags - let - startTag = tagWithAttrs "div" attrs - endTag = text "" - in blankline $$ "#+BEGIN_HTML" $$ - nest 2 startTag $$ "#+END_HTML" $$ blankline $$ - contents $$ blankline $$ "#+BEGIN_HTML" $$ - nest 2 endTag $$ "#+END_HTML" $$ blankline + (blockTypeCand, classes') = partition isGreaterBlockClass classes + return $ case blockTypeCand of + (blockType:classes'') -> + blankline $$ attrHtml (ident, classes'' <> classes', kv) $$ + "#+BEGIN_" <> text blockType $$ contents $$ + "#+END_" <> text blockType $$ blankline + _ -> + -- fallback with id: add id as an anchor if present, discard classes and + -- key-value pairs, unwrap the content. + let contents' = if not (null ident) + then "<<" <> text ident <> ">>" $$ contents + else contents + in blankline $$ contents' $$ blankline blockToOrg (Plain inlines) = inlineListToOrg inlines -- title beginning with fig: indicates that the image is a figure blockToOrg (Para [Image attr txt (src,'f':'i':'g':':':tit)]) = do @@ -173,7 +162,7 @@ blockToOrg (Para inlines) = do blockToOrg (LineBlock lns) = do let splitStanza [] = [] splitStanza xs = case break (== mempty) xs of - (l, []) -> l : [] + (l, []) -> [l] (l, _:r) -> l : splitStanza r let joinWithLinefeeds = nowrap . mconcat . intersperse cr let joinWithBlankLines = mconcat . intersperse blankline @@ -213,7 +202,7 @@ blockToOrg (Table caption' _ _ headers rows) = do caption'' <- inlineListToOrg caption' let caption = if null caption' then empty - else ("#+CAPTION: " <> caption'') + else "#+CAPTION: " <> caption'' headers' <- mapM blockListToOrg headers rawRows <- mapM (mapM blockListToOrg) rows let numChars = maximum . map offset @@ -289,8 +278,8 @@ propertiesDrawer (ident, classes, kv) = let drawerStart = text ":PROPERTIES:" drawerEnd = text ":END:" - kv' = if (classes == mempty) then kv else ("CLASS", unwords classes):kv - kv'' = if (ident == mempty) then kv' else ("CUSTOM_ID", ident):kv' + kv' = if classes == mempty then kv else ("CLASS", unwords classes):kv + kv'' = if ident == mempty then kv' else ("CUSTOM_ID", ident):kv' properties = vcat $ map kvToOrgProperty kv'' in drawerStart <> cr <> properties <> cr <> drawerEnd @@ -303,7 +292,7 @@ attrHtml :: Attr -> Doc attrHtml ("" , [] , []) = mempty attrHtml (ident, classes, kvs) = let - name = if (null ident) then mempty else "#+NAME: " <> text ident <> cr + name = if null ident then mempty else "#+NAME: " <> text ident <> cr keyword = "#+ATTR_HTML" classKv = ("class", unwords classes) kvStrings = map (\(k,v) -> ":" <> k <> " " <> v) (classKv:kvs) @@ -370,19 +359,19 @@ inlineToOrg SoftBreak = do WrapPreserve -> return cr WrapAuto -> return space WrapNone -> return space -inlineToOrg (Link _ txt (src, _)) = do +inlineToOrg (Link _ txt (src, _)) = case txt of [Str x] | escapeURI x == src -> -- autolink - do return $ "[[" <> text (orgPath x) <> "]]" + return $ "[[" <> text (orgPath x) <> "]]" _ -> do contents <- inlineListToOrg txt return $ "[[" <> text (orgPath src) <> "][" <> contents <> "]]" -inlineToOrg (Image _ _ (source, _)) = do +inlineToOrg (Image _ _ (source, _)) = return $ "[[" <> text (orgPath source) <> "]]" inlineToOrg (Note contents) = do -- add to notes in state notes <- gets stNotes modify $ \st -> st { stNotes = contents:notes } - let ref = show $ (length notes) + 1 + let ref = show $ length notes + 1 return $ "[fn:" <> text ref <> "]" orgPath :: String -> String diff --git a/test/command/3771.md b/test/command/3771.md new file mode 100644 index 000000000..1d3a75ae1 --- /dev/null +++ b/test/command/3771.md @@ -0,0 +1,14 @@ +``` +% pandoc -f html -t org +
+ Today is a nice day. +
+
+ Tomorrow will be rainy. +
+^D +Today is a nice day. + +<> +Tomorrow will be rainy. +``` -- cgit v1.2.3 From c09b586147d607f645a639a47c7781e8d8655e20 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 5 Sep 2017 07:22:40 +0300 Subject: Muse reader: parse
tag (#3888) --- src/Text/Pandoc/Readers/Muse.hs | 7 +++++++ test/Tests/Readers/Muse.hs | 8 ++++++++ 2 files changed, 15 insertions(+) (limited to 'test') diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index a4512cdd7..1951a47af 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -179,6 +179,7 @@ blockElements = choice [ comment , centerTag , rightTag , quoteTag + , divTag , verseTag , lineBlock , bulletList @@ -245,6 +246,12 @@ rightTag = blockTag id "right" quoteTag :: PandocMonad m => MuseParser m (F Blocks) quoteTag = withQuoteContext InDoubleQuote $ blockTag B.blockQuote "quote" +--
tag is supported by Emacs Muse, but not Amusewiki 2.025 +divTag :: PandocMonad m => MuseParser m (F Blocks) +divTag = do + (attrs, content) <- parseHtmlContentWithAttrs "div" block + return $ (B.divWith attrs) <$> mconcat content + verseLine :: PandocMonad m => MuseParser m String verseLine = do line <- anyLine <|> many1Till anyChar eof diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 4e5e5b606..714736c7f 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -145,6 +145,14 @@ tests = , " with a continuation" ] =?> blockQuote (para "This is a quotation with a continuation") + , testGroup "Div" + [ "Div without id" =: + "
Foo bar
" =?> + divWith nullAttr (para "Foo bar") + , "Div with id" =: + "
Foo bar
" =?> + divWith ("foo", [], []) (para "Foo bar") + ] , "Verse" =: T.unlines [ "> This is" , "> First stanza" -- cgit v1.2.3 From 350c282f205f48c6d0f7a96bf349b585a16fbcf4 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 5 Sep 2017 19:41:27 +0300 Subject: Muse reader: require at least one space char after * in header (#3895) --- src/Text/Pandoc/Readers/Muse.hs | 2 +- test/Tests/Readers/Muse.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 1951a47af..63bdfcba7 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -213,7 +213,7 @@ header = try $ do getPosition >>= \pos -> guard (st == NullState && q == NoQuote && sourceColumn pos == 1) level <- liftM length $ many1 $ char '*' guard $ level <= 5 - skipSpaces + spaceChar content <- trimInlinesF . mconcat <$> manyTill inline newline attr <- registerHeader ("", [], []) (runF content defaultParserState) return $ B.headerWith attr level <$> content diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 714736c7f..d9222b1dc 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -224,6 +224,7 @@ tests = , "Subsubsection" =: "***** Fifth level\n" =?> header 5 "Fifth level" + , "Whitespace is required after *" =: "**Not a header\n" =?> para "**Not a header" , "No headers in footnotes" =: T.unlines [ "Foo[1]" , "[1] * Bar" -- cgit v1.2.3 From 743413a5b506351499fa2fb66d4184d74e125c54 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 6 Sep 2017 18:48:06 +0300 Subject: Muse reader: Allow finishing header with EOF (#3897) --- src/Text/Pandoc/Readers/Muse.hs | 14 +++++++++----- test/Tests/Readers/Muse.hs | 12 ++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 63bdfcba7..2454057fa 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleContexts #-} {- Copyright (C) 2017 Alexander Krotov @@ -100,6 +101,9 @@ parseBlocks = do -- utility functions -- +eol :: Stream s m Char => ParserT s st m () +eol = void newline <|> eof + nested :: PandocMonad m => MuseParser m a -> MuseParser m a nested p = do nestlevel <- stateMaxNestingLevel <$> getState @@ -195,7 +199,7 @@ comment = try $ do char ';' space many $ noneOf "\n" - void newline <|> eof + eol return mempty separator :: PandocMonad m => MuseParser m (F Blocks) @@ -203,7 +207,7 @@ separator = try $ do string "----" many $ char '-' many spaceChar - void newline <|> eof + eol return $ return B.horizontalRule header :: PandocMonad m => MuseParser m (F Blocks) @@ -214,7 +218,7 @@ header = try $ do level <- liftM length $ many1 $ char '*' guard $ level <= 5 spaceChar - content <- trimInlinesF . mconcat <$> manyTill inline newline + content <- trimInlinesF . mconcat <$> manyTill inline eol attr <- registerHeader ("", [], []) (runF content defaultParserState) return $ B.headerWith attr level <$> content @@ -464,10 +468,10 @@ museAppendElement tbl element = tableCell :: PandocMonad m => MuseParser m (F Blocks) tableCell = try $ liftM B.plain . trimInlinesF . mconcat <$> manyTill inline (lookAhead cellEnd) - where cellEnd = try $ void (many1 spaceChar >> char '|') <|> void newline <|> eof + where cellEnd = try $ void (many1 spaceChar >> char '|') <|> eol tableElements :: PandocMonad m => MuseParser m [MuseTableElement] -tableElements = tableParseElement `sepEndBy1` (void newline <|> eof) +tableElements = tableParseElement `sepEndBy1` eol elementsToTable :: [MuseTableElement] -> F MuseTable elementsToTable = foldM museAppendElement emptyTable diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index d9222b1dc..dac167a92 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -210,21 +210,21 @@ tests = ] , testGroup "Headers" [ "Part" =: - "* First level\n" =?> + "* First level" =?> header 1 "First level" , "Chapter" =: - "** Second level\n" =?> + "** Second level" =?> header 2 "Second level" , "Section" =: - "*** Third level\n" =?> + "*** Third level" =?> header 3 "Third level" , "Subsection" =: - "**** Fourth level\n" =?> + "**** Fourth level" =?> header 4 "Fourth level" , "Subsubsection" =: - "***** Fifth level\n" =?> + "***** Fifth level" =?> header 5 "Fifth level" - , "Whitespace is required after *" =: "**Not a header\n" =?> para "**Not a header" + , "Whitespace is required after *" =: "**Not a header" =?> para "**Not a header" , "No headers in footnotes" =: T.unlines [ "Foo[1]" , "[1] * Bar" -- cgit v1.2.3 From 5fc4980216bf0a6b425827417655991859cba5ec Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 7 Sep 2017 22:10:13 -0700 Subject: Markdown writer: Escape pipe characters when `pipe_tables` enabled. Closes #3887. --- src/Text/Pandoc/Writers/Markdown.hs | 1 + test/command/3497.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 3dbfe3f11..0221ba6ef 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -288,6 +288,7 @@ escapeString opts (c:cs) = | otherwise -> ">" ++ escapeString opts cs _ | c `elem` ['\\','`','*','_','[',']','#'] -> '\\':c:escapeString opts cs + '|' | isEnabled Ext_pipe_tables opts -> '\\':'|':escapeString opts cs '^' | isEnabled Ext_superscript opts -> '\\':'^':escapeString opts cs '~' | isEnabled Ext_subscript opts -> '\\':'~':escapeString opts cs '$' | isEnabled Ext_tex_math_dollars opts -> '\\':'$':escapeString opts cs diff --git a/test/command/3497.md b/test/command/3497.md index 326817b0d..ca591cdd6 100644 --- a/test/command/3497.md +++ b/test/command/3497.md @@ -46,6 +46,6 @@ Also escape things that might become line blocks or tables: % pandoc -t markdown \| hi \| ^D -\| hi | +\| hi \| ``` -- cgit v1.2.3 From 732005456e2b28150943a5a4e11bca6e1566f309 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 7 Sep 2017 22:16:23 -0700 Subject: LaTeX template: load polyglossia after header-includes. It needs to be loaded as late as possible. Closes #3898. --- data/templates/default.latex | 18 +++++++++--------- test/writers-lang-and-dir.latex | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'test') diff --git a/data/templates/default.latex b/data/templates/default.latex index 357549d98..d100fd4d7 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -192,6 +192,15 @@ $else$ \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} \fi $endif$ + +% set default figure placement to htbp +\makeatletter +\def\fps@figure{htbp} +\makeatother + +$for(header-includes)$ +$header-includes$ +$endfor$ $if(lang)$ \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} @@ -225,15 +234,6 @@ $if(dir)$ \fi $endif$ -% set default figure placement to htbp -\makeatletter -\def\fps@figure{htbp} -\makeatother - -$for(header-includes)$ -$header-includes$ -$endfor$ - $if(title)$ \title{$title$$if(thanks)$\thanks{$thanks$}$endif$} $endif$ diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index b8481c879..ae29cd1bb 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -44,6 +44,12 @@ \let\oldsubparagraph\subparagraph \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} \fi + +% set default figure placement to htbp +\makeatletter +\def\fps@figure{htbp} +\makeatother + \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex \usepackage[shorthands=off,ngerman,british,nswissgerman,spanish,french,main=english]{babel} \newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}} @@ -77,12 +83,6 @@ \newenvironment{LTR}{\beginL}{\endL} \fi -% set default figure placement to htbp -\makeatletter -\def\fps@figure{htbp} -\makeatother - - \date{} \begin{document} -- cgit v1.2.3