Search code examples
latexpandocjupyter-labxelatexquarto

Change the page margin of a single page inside a pdf using Quarto?


I'm using Jupyterlab and quarto to compile a pdf and I want to change the local page margin of a single page in the pdf, say page 3, and the margin in the rest of the pages are the same and are set globally, is there a way to do this?

I understand that in latex you can use \newgeometry{...} and \restoregeometry, I wonder if I can do similar things here... thanks!


Solution

  • You can add latex code exactly as is in jupyterlab with the cell mode set as Raw NBConvert and then render that ipynb file with quarto render.

    (I am adding an image of the ipynb file to show how this works)


    ipynb file with latex code


    Now render this ipynb file

    quarto render jupyterlab_file.ipynb
    

    and the pdf file with desired page specific margin.


    page specific margin


    (Note that, page 3 has a different margin than others and I have used showframe package option just to show the margins.)