| Conditions | 4 |
| Total Lines | 22 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/env python |
||
| 19 | def newpage(elem: Element, doc: Doc) -> RawBlock | None: |
||
| 20 | r""" |
||
| 21 | Replace HorizontalRule by a \clearpage or a \cleardoublepage. |
||
| 22 | |||
| 23 | Arguments |
||
| 24 | --------- |
||
| 25 | elem |
||
| 26 | A pandoc element |
||
| 27 | doc |
||
| 28 | pandoc document |
||
| 29 | |||
| 30 | Returns |
||
| 31 | ------- |
||
| 32 | RawBlock | None |
||
| 33 | A RawBlock or None. |
||
| 34 | """ |
||
| 35 | # Is it in the right format and is it an HorizontalRule? |
||
| 36 | if doc.format == "latex" and isinstance(elem, HorizontalRule): |
||
| 37 | if doc.double: |
||
| 38 | return RawBlock("\\cleardoublepage", "tex") |
||
| 39 | return RawBlock("\\clearpage", "tex") |
||
| 40 | return None |
||
| 41 | |||
| 82 |