self._image_size = image_size
def renderChunk(self, chunk: Chunk) -> bytes:
- return b'''\\begin{wrapfigure}{l}{0pt}\\oalign{
+ return b'''\\begin{wrapstuff}[l]\\oalign{
%s\\cr
%s\\cr
%s\\cr
%s\\cr
-}\\end{wrapfigure}
+}\\end{wrapstuff}
%s
def process(spec: Spec) -> None:
spec.texout.write(b'''\\documentclass{article}
\\usepackage{graphicx}
-\\usepackage{wrapfig}
+\\usepackage{wrapstuff}
''')
if spec.geometry is not None:
spec.texout.write(b'\\usepackage[' +
else:
# h/t https://tex.stackexchange.com/questions/309856
spec.texout.write(b'''
-\\vspace{-.5\\ht\\strutbox}\\noindent\\hrulefill
+\\wrapstuffclear\\vspace{-.5\\ht\\strutbox}\\noindent\\hrulefill
''')
spec.domfilter(r)
paperdoorknob.process(spec)
assert buf.getvalue() == b'''\\documentclass{article}
\\usepackage{graphicx}
-\\usepackage{wrapfig}
+\\usepackage{wrapstuff}
\\usepackage[margin=20mm]{geometry}
\\begin{document}
This is glowfic
-\\vspace{-.5\\ht\\strutbox}\\noindent\\hrulefill
+\\wrapstuffclear\\vspace{-.5\\ht\\strutbox}\\noindent\\hrulefill
You \\emph{sure}?
-\\vspace{-.5\\ht\\strutbox}\\noindent\\hrulefill
+\\wrapstuffclear\\vspace{-.5\\ht\\strutbox}\\noindent\\hrulefill
Pretty sure.
\\end{document}