4 ms·
First point: the groff file in my gist is designed for plain-text files, so not all the functionality will exactly translate to PDF rendering. Second point: to
by b3lm0nt 3y ago
First point: the groff file in my gist is designed for plain-text files, so not all the functionality will exactly translate to PDF rendering.
Second point: to resolve the issue you're running into, remove these lines from the groff file to allow the default margins for PDF rendering to occur.
\# Set the line lenth to \nl
.ll \nl
There can occasionally be some strange behavior with the macros when different output devices are used (some options are ignored, some may have unexpected consequences). I took a look at the PDF output using my file directly, and it looks like the em sizing for gropdf is different from the grotty implementation, causing some overflow. (Maybe the font needs to be set explicitly before setting the line-length? Not sure).
Using a different unit of measurement (like inches or points) may be a better option for PDF files: https://www.gnu.org/software/groff/manual/html_node/Measurements.html https://www.gnu.org/software/groff/manual/html_node/Measurem...
Bonus note: you can confirm the final output device that will be used by a groff command by adding the -V option. Example:
groff -Tpdf -V examaple.groff
Outputs:
troff -Tpdf example.groff | gropdf
Using -Tascii instead will produce:
troff -Tascii example.groff | grotty
Ref on output devices: https://www.gnu.org/software/groff/manual/html_node/Output-Devices.html#Output-Devices https://www.gnu.org/software/groff/manual/html_node/Output-D...
* Edit: See 2b3a51's response for a better explanation.