I have this MWE:






enter image description here

I'd like to remove the geometry stuff from the file and pass it by command line. I mean something like:

latex "\AtBeginDocument{\RequirePackage[pass]{geometry}\geometry{showframe,a4paper}}\

As it is, it doesn't work (the frame isn't added). Is it possible to do it?

1 Answer 1


Try this:

  • Firstly, load etoolbox
  • Then load and config geometry inside \AtEndPreamble{...}
pdflatex -jobname=myfile '\RequirePackage{etoolbox}\AtEndPreamble{\usepackage[pass]{geometry}\geometry{showframe, a4paper}}\input{myfile}'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .