TransWikia.com

center big proof in a vertical side

TeX - LaTeX Asked on June 24, 2021

I’m an occasional user of latex, and I’m autogenerating code to make a proof with the proof package.

Now I have the problem, with big proof I’m not able to center it in the pdf and also avoid the overflow.

Any suggestion to solve this problem?

An example of proof with a bad pdf as result can be

% auto generate file, please not modify the content
documentclass[10pt]{article}
usepackage{proof}
usepackage{lscape}
pdfpagewidth 11inpdfpageheight 12inbegin{document}
begin{landscape}centering[
infer[while]
{langle while (x > 1) do (x := x - 1), [x:3] rangle to [x:1]}
{infer[gt]
{langle x > 1, [x:3] rangle to true}
{infer[var]
{langle x, [x:3] rangle to 3}
{}
&
infer[num]
{langle 1, [x:3] rangle to 1}
{}}
&
infer[assign]
{langle x := x - 1, [x:3] rangle to [x:2]}
{infer[dec]
{langle x - 1, [x:3] rangle to 2}
{infer[num]
{langle 1, [x:3] rangle to 1}
{}
&
infer[var]
{langle x, [x:3] rangle to 3}
{}}}
&
infer[while]
{langle while (x > 1) do (x := x - 1), [x:2] rangle to [x:1]}
{infer[gt]
{langle x > 1, [x:2] rangle to true}
{infer[var]
{langle x, [x:2] rangle to 2}
{}
&
infer[num]
{langle 1, [x:2] rangle to 1}
{}}
&
infer[assign]
{langle x := x - 1, [x:2] rangle to [x:1]}
{infer[dec]
{langle x - 1, [x:2] rangle to 1}
{infer[num]
{langle 1, [x:2] rangle to 1}
{}
&
infer[var]
{langle x, [x:2] rangle to 2}
{}}}
&
infer[while]
{langle while (x > 1) do (x := x - 1), [x:1] rangle to [x:1]}
{infer[gt]
{langle x > 1, [x:1] rangle to false}
{infer[var]
{langle x, [x:1] rangle to 1}
{}
&
infer[num]
{langle 1, [x:1] rangle to 1}
{}}}}}]
end{landscape}end{document}

One Answer

I want to add an answer to this question, I realize that one easy method to center the proof is to resize the pdf file.

I have some rules where I need to use the proof package to achieve my result.

The solution basically is to remove the package lscape and make use of the latex directive to resize the pdf, like the following pdfpagewidth and pdfpageheight

So the solution is the following code

    % auto generate file, please not modify the content
    documentclass[10pt]{article}
    usepackage{proof}
    % usepackage{lscape} 
  pdfpagewidth=800mm
  pdfpageheight=150mm
  
  begin{document}
    %begin{landscape}
centering[
    infer[while]
    {langle while (x > 1) do (x := x - 1), [x:3] rangle to [x:1]}
    {infer[gt]
    {langle x > 1, [x:3] rangle to true}
    {infer[var]
    {langle x, [x:3] rangle to 3}
    {}
    &
    infer[num]
    {langle 1, [x:3] rangle to 1}
    {}}
    &
    infer[assign]
    {langle x := x - 1, [x:3] rangle to [x:2]}
    {infer[dec]
    {langle x - 1, [x:3] rangle to 2}
    {infer[num]
    {langle 1, [x:3] rangle to 1}
    {}
    &
    infer[var]
    {langle x, [x:3] rangle to 3}
    {}}}
    &
    infer[while]
    {langle while (x > 1) do (x := x - 1), [x:2] rangle to [x:1]}
    {infer[gt]
    {langle x > 1, [x:2] rangle to true}
    {infer[var]
    {langle x, [x:2] rangle to 2}
    {}
    &
    infer[num]
    {langle 1, [x:2] rangle to 1}
    {}}
    &
    infer[assign]
    {langle x := x - 1, [x:2] rangle to [x:1]}
    {infer[dec]
    {langle x - 1, [x:2] rangle to 1}
    {infer[num]
    {langle 1, [x:2] rangle to 1}
    {}
    &
    infer[var]
    {langle x, [x:2] rangle to 2}
    {}}}
    &
    infer[while]
    {langle while (x > 1) do (x := x - 1), [x:1] rangle to [x:1]}
    {infer[gt]
    {langle x > 1, [x:1] rangle to false}
    {infer[var]
    {langle x, [x:1] rangle to 1}
    {}
    &
    infer[num]
    {langle 1, [x:1] rangle to 1}
    {}}}}}]
    %end{landscape}
end{document}

Correct answer by vincenzopalazzo on June 24, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP