Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format control letter paper/ISO A4, pdf generation with -t ms #8403

Closed
nbehrnd opened this issue Oct 27, 2022 · 4 comments
Closed

format control letter paper/ISO A4, pdf generation with -t ms #8403

nbehrnd opened this issue Oct 27, 2022 · 4 comments

Comments

@nbehrnd
Copy link
Contributor

nbehrnd commented Oct 27, 2022

I would like to convert some markdown files into .pdf. Because the content does not contain illustrations, however snippets of code, e.g.

`# a principal header

This text is upright, or italic, may be bold, or contain some
code{.verbatim} in the line of question. Here and there, a snippet of
a language like Python e.g.,

for i in range(4):
    print(f"The counter is on {i}")

Words like Ägäis, öffentlich, üblich, école, polymères, août, garçon,
citroën, œil, cœur;`

the submission of the block above as file minimal.md to pandoc (2.19.2) in Linux Debian 12/bookworm with

pandoc minimal.md -o minimal.pdf -t ms

appears as suitable.

While pdfinfo (22.08.0) recognizes the .pdf written as created by groff (1.22.4), produced by ghostscript (9.56.1) in dimensions of US letter paper.

In addition to the functionality already provided, I would like to suggest a possibility to offer an export to ISO A4 which the current manual ([2022-08-22 Mon]) not yet mentions.

Alternatives ventured out so far to generate output in ISO A4 include:

pandoc -V papersize=a4 --pdf-engine=pdfroff minimal.md -o minimal.pdf -t ms
  • based on the suggest on issue 600 though addressing pdfLaTeX as pdf engine
pandoc --variable=geometry:a4paper minimal.md -o minimal.pdf -t ms
pandoc --variable=geometry:"a4paper" minimal.md -o minimal.pdf -t ms
pandoc -V geometry:a4paper minimal.md -o minimal.pdf -t ms
pandoc -V geometry:"a4paper" minimal.md -o minimal.pdf -t ms
pandoc -V papersize:"a4paper" minimal.md -o minimal.pdf -t ms

however the .pdf generated remains identified by pdfinfo as format US letter paper.

minimal.md.zip

@jgm
Copy link
Owner

jgm commented Oct 27, 2022

-Vpapersize=a4 gives you

.ds paper a4

in the ms file.
I think what you're finding is that this isn't enough to produce an a4 pdf. Perhaps we also need special arguments for pdfroff.

@jgm
Copy link
Owner

jgm commented Oct 27, 2022

OK, this seems to work:

pandoc -Vpapersize=a4 --pdf-engine-opt=-P-pa4 -t ms -o result.pdf

I will look into changing pandoc so that the -P-pa4 is added automatically, but for now you can add it this way.

@jgm
Copy link
Owner

jgm commented Oct 27, 2022

From man groff:

       groff uses the command-line option -P
       to  pass  options to output devices; for example, the following selects
       A4 paper in landscape orientation for the PS device:

              groff -Tps -P-pa4 -P-l ...

@jgm jgm closed this as completed in 87f4247 Oct 27, 2022
@nbehrnd
Copy link
Contributor Author

nbehrnd commented Oct 28, 2022

I think what you're finding is that this isn't enough to produce an a4 pdf. Perhaps we also need special arguments for pdfroff.

I equally start to comprehend how the appearance may be tailored with the template files, too. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants