2 ms·
Thanks for sharing your groff file. I'm on a Debian derivative and running the below command did produce a pdf but the line "This paragraph should be right-just
by noisy_boy 3y ago
Thanks for sharing your groff file. I'm on a Debian derivative and running the below command did produce a pdf but the line "This paragraph should be right-justified and indented by th" was chopped off on the right side:
groff -Tpdf example.groff > example.pdf
Also, the left/right margins are partically non-existent (top/bottom margins look fine).
Did I miss any command-line option?
- b3lm0nt 3y agoFirst 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.
- 2b3a51 3y agoTry groff -ms -Tpdf example.groff > example.pdf The difference is the use of the ms macro package. That package generates page breaks and makes assumptions about the page size. -Tpdf will typeset your text using proportional fonts, justification and so on. The previous poster's command generated nicely justified text in the terminal (or redirected to a file).
- b3lm0nt 3y agoAh, this explains it. I had a feeling I was missing something in my less informative response.