mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-29 01:41:20 +08:00
Docx writer: Use different style for block quotes in notes.
Using "Footnote Block Text" for the style name, so it can be given a different font size if footnotes are. Closes #9243.
This commit is contained in:
+2
-1
@@ -1187,7 +1187,8 @@ header when requesting a document from a URL:
|
||||
- Heading 7
|
||||
- Heading 8
|
||||
- Heading 9
|
||||
- Block Text
|
||||
- Block Text [for block quotes]
|
||||
- Footnote Block Text [for block quotes in footnotes]
|
||||
- Source Code
|
||||
- Footnote Text
|
||||
- Definition Term
|
||||
|
||||
@@ -348,6 +348,18 @@
|
||||
<w:unhideWhenUsed />
|
||||
<w:qFormat />
|
||||
</w:style>
|
||||
<w:style w:type="paragraph" w:styleId="FootnoteBlockText">
|
||||
<w:name w:val="Footnote Block Text" />
|
||||
<w:basedOn w:val="Footnote Text" />
|
||||
<w:next w:val="Footnote Text" />
|
||||
<w:uiPriority w:val="9" />
|
||||
<w:unhideWhenUsed />
|
||||
<w:qFormat />
|
||||
<w:pPr>
|
||||
<w:spacing w:before="100" w:after="100" />
|
||||
<w:ind w:firstLine="0" w:left="480" w:right="480" />
|
||||
</w:pPr>
|
||||
</w:style>
|
||||
<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont">
|
||||
<w:name w:val="Default Paragraph Font" />
|
||||
<w:semiHidden />
|
||||
|
||||
@@ -940,7 +940,11 @@ blockToOpenXML' _ b@(RawBlock format str)
|
||||
report $ BlockNotRendered b
|
||||
return []
|
||||
blockToOpenXML' opts (BlockQuote blocks) = do
|
||||
p <- withParaPropM (pStyleM "Block Text")
|
||||
inNote <- asks envInNote
|
||||
p <- withParaPropM (pStyleM
|
||||
(if inNote
|
||||
then "Footnote Block Text"
|
||||
else "Block Text"))
|
||||
$ blocksToOpenXML opts blocks
|
||||
setFirstPara
|
||||
return p
|
||||
@@ -1361,9 +1365,10 @@ inlineToOpenXML' opts (Note bs) = do
|
||||
|
||||
contents <- local (\env -> env{ envListLevel = -1
|
||||
, envParaProperties = mempty
|
||||
, envTextProperties = mempty })
|
||||
(withParaPropM (pStyleM "Footnote Text") $ blocksToOpenXML opts
|
||||
$ insertNoteRef bs)
|
||||
, envTextProperties = mempty
|
||||
, envInNote = True })
|
||||
(withParaPropM (pStyleM "Footnote Text") $
|
||||
blocksToOpenXML opts $ insertNoteRef bs)
|
||||
let newnote = mknode "w:footnote" [("w:id", notenum)] contents
|
||||
modify $ \s -> s{ stFootnotes = newnote : notes }
|
||||
return [ Elem $ mknode "w:r" []
|
||||
|
||||
@@ -81,6 +81,7 @@ data WriterEnv = WriterEnv
|
||||
, envListLevel :: Int
|
||||
, envListNumId :: Int
|
||||
, envInDel :: Bool
|
||||
, envInNote :: Bool
|
||||
, envChangesAuthor :: Text
|
||||
, envChangesDate :: Text
|
||||
, envPrintWidth :: Integer
|
||||
@@ -95,6 +96,7 @@ defaultWriterEnv = WriterEnv
|
||||
, envListLevel = -1
|
||||
, envListNumId = 1
|
||||
, envInDel = False
|
||||
, envInNote = False
|
||||
, envChangesAuthor = "unknown"
|
||||
, envChangesDate = "1969-12-31T19:00:00Z"
|
||||
, envPrintWidth = 1
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user