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