Open crh23 opened 2 years ago
Note to myself: find/create a PDF showing this error, and then fix.
Creating one isn't too difficult. Compile the following with PDFLaTeX:
%! TEX program = pdflatex
\documentclass{article}
\begin{document}
\title{A \texttt{document} \\ with two lines title}
\author{Author name}
\date{February 30, 2023}
\maketitle
\end{document}
The output is, as expected, withtwolinestitleAdocument
.
On another note, the spaces disappear in the output as well (even in the second line which is unaffected), I have no idea why.
In the implementation of the "eliot" algorithm, the y coordinates are sorted low-to-high: https://github.com/metebalci/pdftitle/blob/5ebc1a0ec3f347e5a257485bc6ce43a9f12798ba/pdftitle.py#L543-L548
Since the origin of a pdf is the bottom-left corner, the y coordinates should be sorted high-to-low, as in the implementation of the "original" algorithm: https://github.com/metebalci/pdftitle/blob/5ebc1a0ec3f347e5a257485bc6ce43a9f12798ba/pdftitle.py#L492-L494
Sorting could be done as:
since tuples follow lexicographical ordering (see here)