bugUnofficial LaTeX graphics drivers - moved to github - Bugs: bug #317, setpagesize

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #317: setpagesize

Submitted by:  David Carlisle <davidcarlisle>
Submitted on:  Sat Jun 18 15:46:44 2016  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed Jun 29 21:33:52 2016, comment #4:

closing with nothing done, since maintenance of these drivers is being transferred to you :). -k

Karl Berry <karl>
Project Administrator
Tue Jun 28 17:03:28 2016, comment #3:

David - two questions before i install this.

1) do you want to incorporate xetex.def and dvipdfmx.def into latex? they are separately "unofficial" only because of history.
i doubt anyone here would mind if you want to handle them too.

2) independent of this patch, but it came to mind: what about the case of specifying the page size when graphics is not loaded? e.g.,
\documentclass[b5paper]{article}
\begin{document}Hello.\end{document}
outputs the default installation paper size with all drivers I tried. (It works as described with \usepackage{graphics}.)

I'm not sure what it would mean to support this (automatically loading graphics? yuck ...), but if a user-given setting is going to be ignored, maybe it's worth a runtime warning and doc update? or something? --thanks, k.

Karl Berry <karl>
Project Administrator
Mon Jun 20 17:47:58 2016, comment #2:

p.s. akira, would you be willing to install these changes (bump version numbers, change entries, etc.) and upload to ctan? if no time at the moment, i can get to it at some point ... thanks, k.

Karl Berry <karl>
Project Administrator
Mon Jun 20 17:44:08 2016, comment #1:

hi david - ok, thanks. do you expect user-visible changes to normal documents as a result of this? i had actually thought the decision had been to change nothing; didn't pay enough attention to the dvips.def update ... -k

Karl Berry <karl>
Project Administrator
Sat Jun 18 15:46:44 2016, original submission:

After some discussion of page sizes on texlive list I came to the conclusion that the status quo of pdftex (and luatex) options setting the (PDF) page size based on the latex \paperheight/width settings but dvips and other drivers not doing that was not really justifiable.

From the June 2016 release, graphics and color have setpagesize and nosetpagesize options to explicitly request that the pdf size is or is not set. It defaults to setpagesize, matching the former pdflatex behaviour.

The package option just sets \ifGin@setpagesize to be true or false: it is up to the driver .def file to actually set the size. (It could have been factored slightly differently between package and back end code but this seemed the most compatible with existing uses.)

It would be good (or at least consistent) if xetex and dvipdfmx options supported this in the same way.

They could both use the \special{pagesize... syntax but I think probably it is best if xetex uses \pdfpageheight setting, like pdftex, and dvipdfmx uses the special, like dvips.

The required code blocks could be copied from pdftex.def and dvips.def and added just before \endinput, I put then below, for completeness.

As a test pdfinfo should show PDF generated from this test as 100x300 pts

\documentclass{article}

\paperheight=300bp
\paperwidth=100bp

\usepackage{graphicx}

\begin{document}

x
\end{document}

thanks for supporting these drivers,

David

for xetex.def:

\@ifundefined{ifGin@setpagesize}
{\expandafter\let\csname ifGin@setpagesize\expandafter\endcsname
\csname iftrue\endcsname}
{}
\ifGin@setpagesize
\ifx\paperwidth\@undefined\else
\AtBeginDocument{%
\ltx@IfUndefined{stockwidth}{%
\ltx@IfUndefined{paperwidth}{%
}{%
\ifdim\paperwidth>0pt\relax
\ifdim\paperheight>0pt\relax
\pdfpagewidth=\paperwidth
\pdfpageheight=\paperheight
\fi
\fi
}%
}{%
\ifdim\stockwidth>0pt\relax
\ifdim\stockheight>0pt\relax
\pdfpagewidth=\stockwidth
\pdfpageheight=\stockheight
\fi
\fi
}%
}
\fi
\fi

and for dvipdfm.def

\@ifundefined{ifGin@setpagesize}
{\expandafter\let\csname ifGin@setpagesize\expandafter\endcsname
\csname iftrue\endcsname}
{}
\ifGin@setpagesize
\ifx\paperwidth\@undefined\else
\AtBeginDocument{\AtBeginDvi{%
\begingroup
\ifx\stockwidth\@undefined\else
\paperwidth\stockwidth
\paperheight\stockheight
\fi
\ifdim\paperwidth>\z@
\ifdim\paperheight>\z@
\special{papersize=\the\paperwidth,\the\paperheight}%
\fi
\fi
\endgroup}}
\fi
\fi

David Carlisle <davidcarlisle>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by karl (Posted a comment)
  • -unavailable- added by davidcarlisle (Submitted the item)
  • -unavailable- added by davidcarlisle
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    2 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Jun 29 21:33:52 2016karlOpen/ClosedOpen=>Closed
    Sat Jun 18 15:46:44 2016davidcarlisleCarbon-Copy-=>Added davidcarlisle
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray