-
Notifications
You must be signed in to change notification settings - Fork 89
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
Images Come Out Full Page Instead Of Cropped #24
Comments
What operating system are you using? |
Howdy, I'm using OS X 10.11.6, El Capitan. I can send you the source file. Strangely some figures are cropped and others not. Right now I'm at the TUG conference so it might be a sort while before I get it to you. Good Luck,
|
Howdy, Enclosed is the initial file along with information about compiling it in TeXShop using the pdflatexmk engine. I've also enclosed the sample pdf output that is correct and what I get with asy 2.38 Thanks for any help you can provide and please get in touch with me if you need more information. PS: I'll note that I'm using the 64bit (x86_64-darwin) version of asy 2.38. Good Luck, Herb Schulz |
Howdy, What OS are you using? What TeX Live and asy versions are you using? Good Luck, Herb Schulz |
Hi. I thought I was going to put another test case here, but it's probably not necessary. Anyway, it's Debian, Asymptote 2.38. I removed the asymptote package from the OS and installed a git version from today (d76f675) and the problem persists. Also, invoking Anyway, I have texlive 2016.20160623-1 from Debian sid. |
Howdy, It's definitely an asy problem and the folks maintaining it are looking at it. An up-vote with a note that you're using Debian (I use Mac OS X) and asy 2.38 with TeX Live 2016 would at least show that it's not related to one system. You could crop the bad images using pdfcrop, then rename the -crop output file back to the original name finally running pdflatex again. I consider that a temporary fix until asy is updated properly. Good Luck, Herb Schulz |
It isn't an Asymptote problem: if I run the intermediate files produced on |
Howdy, Wow, that's definitely a surprise. Good Luck, Herb Schulz |
I just installed TeXlive 2016 and can confirm that this is a bug in pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) The problem is that \pdfpagewidth=113.385827bp are ignored when appearing before \begin{document}. |
A workaround for this recent pdflatex bug has been implemented in |
Howdy, Thanks for the quick work on this problem. Will this pass through CTAN and TeX Live in the near future? Good Luck, Herb Schulz |
Unless the TeX Live policy changes, no. It requires a rebuild of asymptote binary and Karl generally opposes rebuilds of binaries. But you can try to ask on the TeX Live mailing list. If this is a bug in a macro package, you should insist in fixing the bug in pdflatex. |
I tried a latex document in tl2016 that set this before begin docuemnt
the settings had an effect, pdfinfo shows Creator: TeX
|
oh |
in TL2015 pdftex
is 113 pts square but
is US letter, also other back ends such as dvips didn't set the pdf page size. in the new graphics-def collection, tried to make dvips,dvipdfmx,luatex and dvips options work in a more or less compatible way (which is tricky as traditionally they were all incompatible...) so... in texlive 2016 the page size for all the above driver options is set at begin document based on the latex lengths \paperheight and \paperwidth unless the whole feature is turned off with [nosetpagesize] option. so the advantage is that dependence on order of loading graphicx is avoided but you need to set \paperwidth not \pdfpagewidth or use the [nosetpagesize] option to stop graphicx setting the size. So sorry if this broke your code. Please look at the block in pdftex.def starting
If this isn't workable for you, ping me here or in |
Howdy, My example didn't use the graphicx package so... . The original document (I paired it down a bit to demonstrate the problem) had the preamble and start of document \documentclass{article} % test bibliography \newcommand{\cC}{\mathcal{C}} \makeatletter \begin{document} \begin{asydef} and then mostly a series of asymptote figures and sub-figures using asymptote with some text, crossreferences, bibliography. It worked fine under TL2015 (with whatever the asy was then) but now fails under TL2016 ans asy 3.28. Good Luck, Herb Schulz |
Herb: Asymptote uses the graphicx package internally. David: Thank you so much for your prompt response on this issue.
However, I think this change to graphicx is unfortunate and should be reverted for the following reasons: First of all, this could be done without requiring a complete rebuild of the Asymptote and TeXLive binaries. We will also have to update the Asymptote binaries in many other distributions, which will not happen instantly. It is better to fix this problem at the source rather than working around it. Second, as is evident in this thread, including \usepackage{graphicx} now has suprising side-effects
|
The nosetpagesize option is not available in TeXLive 2015, so that solution won't work after all: ! LaTeX Error: Unknown option So I will revert the reversion and go back to setting the pagesize after \begin{document} |
On 4 August 2016 at 04:32, John Bowman notifications@github.com wrote:
perhaps I didn't understand but doesn't the generate code use \RequirePackage{color,graphicx} to \RequirePackage[nosetpagesize]{color,graphicx} around line 34. (I tried running the example in the zip file at top of this this could be easily guarded to work also on older releases. We will also have to update the Asymptote binaries in many other
As I say, I'm open to avoid having to make new binaries but not being an
\pdfpagewidth=113.385827bp and \usepackage{graphicx} and none of the behaviour was documented. With the new settings pdftex,xetex,dvips,dvipdfmx,luatex there is a user option to control things, and the behaviour is documented.
So despite present issue I think the new behaviour is correct. If the generated code is using asymptote.sty then I think it is easiest to David |
Ok so I found -k and understand better now... The generated files don't use any package but inline a lot of low level code, which is perhaps a shame but anyway that's how it is:-) Does it work for you if pdftex.def (and dvips,luatex,...) change from
around line 459 to
For the test at top of this thread it changes the page size from us letter to If \ASYaligned isn't guaranteed to be defined, could you suggest any other way of detecting one of these files. |
I suggest testing instead for \ASYprefix For me there are three surprises here. First, in the code
I would not expect that loading graphicx should reset the page size.
Most importantly, the new behaviour is backwards incompatible. Sometimes introducing a backwards incompatibility is necessary. But there has to be a strong justification for that and I really don't see it By the way, the bug in graphicx also broke the xelatex engine and the lualatex engine. Undefined control sequence. This isn't the case in TeXLive 2015. Can you please fix this issue too? |
On 5 August 2016 at 05:41, John Bowman notifications@github.com wrote:
OK, thanks.
Yes the page size has to be set by the first page so the package delays it
Although the exact timing has changed and there s an option not to do this,
It just became impossible to justify why \documenclass{article} made a US-letter pdf with pdftex and luatex and an A4 pdf with tex and
It is a change not a bug but the bigger change was for xelatatex (and
No that's an issue in the document not my code! as I said originally \pdfpageheight is a pdftex specific command, xetex If you set \paperheight and \paperwidth then the driver-specific backend David |
Unfortunately \paperwidth and \paperheight are undefined with pdftex and luatex: This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdftex) (./test_.tex |
The assumption is that anyone using plain tex is setting these things up they would be defined if you added or you could force the .def file to take the nosetpagesize rout via some \newif\ifGin@setpagesize \Gin@setpagesizefalse depending on exactly what plain tex setup you have. Or, as I said earlier, if changing your calling code means recompiling the David |
Yes, I had hoped that the temporary \ASYprefix hack you suggested would be in TeXLive 2016 by now but as of yesterday it still isn't there. In any case we also need a workaround for non-TeXLive distributions (like miktex) that are starting to update pdflatex and other TeX engines. In my tests yesterday, it seemed that I also need \RequirePackage{luatex85} for luatex. It's too bad that we suddenly need so many conditionals to fix simple code that has worked perfectly over the last 13 years. |
On 23 August 2016 at 15:48, John Bowman notifications@github.com wrote:
note that luatex85 is only intended as a user-level temporary fix for the luatex issue is not directly related to the page size setting change of David |
I think Karl wants to avoid a rebuild. But before adding the \ASYprefix test, I will first try to patch |
On 24 August 2016 at 09:16, John Bowman notifications@github.com wrote:
yes:-) I can add something to the def files (or perhaps graphics.cfg) to change
David |
It does work, but not as expected: with What
so
Changing |
Ok I have finally found a portable way of forcing the nosetpagesize option to the graphicx package,
|
The example now works with |
The spurious blank page issue is also fixed; this requires updating |
comment #1: for the next full release, i urge you to consider putting all this nontrivial tex code into a file read at runtime, instead of compiled into the binary. it seems improbable to me it will never need to change again. a single tex file can determine the engine it's running under and act accordingly. comment #2: fyi, akira, david carlisle, and i just concurred on making a change to dvips so that, in the 2017 release, it will act like dvipdmx: the last papersize special will win, instead of the first. i hope that will benefit asy rather than complicate the situation even more. |
Hi Karl, https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/base/plain.asy Re: comment #2: Yes I agree that the last (not first) papersize should win; that is what people expect. I also think that loading the graphicx package should not have side effects like changing the page size either at load time or worse, as is currently implemented, in the future, at \begin{document}. |
I understand why you take that view but that's not possible sorry. graphics In an ideal world \documentclass[a4paper]{article} would set the page size David |
sorry, i should have realized that was plain.asy. updated in tl. |
Howdy, With the latest update the cropping problem is back! This is typesetting a sample file that comes with asymptote. Good Luck, Herb Schulz |
Howdy, Just noticed that asymptote.sty is still at 1.30. I'll test with 1.31 as you posted. Good Luck, Herb Schulz |
Karl: in TL2016 could you also update asy-latex.dtx, which generates version 1.31 of asymptote.sty? https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/doc/asy-latex.dtx Also, if you change the tex engine within an asy file, you will need to call nosetpagesize() explicitly. if(!pdf()) {settings.tex="pdflatex"; nosetpagesize();} |
Howdy, Tested the new plain.asy (installed this AM via a TeX Live update) with version 1.31 of asymptote.sty (NOT installed at the same time) and all seems to be fine. So version 1.31 of asymptote.sty needs to be installed ASAP. Good Luck, Herb Schulz |
Howdy, Sigh... asymptote.sty 1.31 with the updated plain.asy seems to work just fine when I process with pdflatex but I have the same cropping problem if I use xelatex. Am I missing some information? (I'm not changing processing in the middle of anything.) Good Luck, Herb Schulz |
Hi Herb, |
Howdy, Works fine with both pdflatex and xelatex with asymptote.sty 1.32. Haven't tried to use lualatex, etc. Good Luck, Herb Schulz |
ran tex asy-latex.dtx, installed resulting asymptote.sty in TL for tonight's build. (also install asy-latex.dtx in the Build tree for completeness) |
Howdy, Karl, make sure you've got asymptote.sty 1.32 since it was updated from 1.31 today. Good Luck, Herb Schulz |
It turns out that the previous workaround for the graphicx bug was incompatible with Asymptote's 3D https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/base/plain.asy This also removes the requirement to call nosetpagesize() if you change the tex engine within an asy file. |
Karl: could you please update plain.asy in TL 2016 one more time? I've also updated asy-latex.dtx (which generates asymptote.sty) to version 1.33 although version 1.30-version 1.32 should work equally well. Thanks! |
On Nov 26, 2016, at 11:57 AM, John Bowman ***@***.***> wrote:
It turns out that the previous workaround for the graphicx bug was incompatible with Asymptote's 3D
label generation. A simpler and more robust workaround is here:
https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/base/plain.asy
This also removes the requirement to call nosetpagesize() if you change the tex engine within an asy file.
Howdy,
Works fine with both pdflatex and xelatex in my testing here. Thanks for the update.
Good Luck,
Herb Schulz
(herbs at wideopenwest dot com)
|
sure, updated plain.asy in tl. did not do asy-latex, but no problem to do that too if it becomes necessary ... |
A few days ago (January 6, 2017) I did a full upgrade to TexLive 2016 on my MacBook Pro running OSX 10.10.5. I found asymptote.sty file version [2016/02/09 v1.30 Asymptote style file for LaTeX] at /usr/local/texlive/2016/texmf-dist/tex/latex/asymptote. Based on the above discussions I expected to find v1.33. I found v1.33 of asymptote.sty on the Internet and replaced v1.30 at /usr/local/texlive/2016/texmf-dist/tex/latex/asymptote/asymptote.sty Was that correct or should I have put this version in /usr/local/texlive/texmf-local? If two versions (1.30 and 1.33) are found, will the latest version be used? |
Asymptote 1.30 and 1.33 are in fact identical. As long as you have the latest version of plain.asy: https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/base/plain.asy you should be fine. |
git-svn-id: svn://tug.org/texlive/trunk/Build/source@41935 c570f23f-e606-0410-a88d-b1316a301751
git-svn-id: svn://tug.org/texlive/trunk/Build/source@41994 c570f23f-e606-0410-a88d-b1316a301751
git-svn-id: svn://tug.org/texlive/trunk/Build/source@42511 c570f23f-e606-0410-a88d-b1316a301751
Howdy,
With asy 2.38 some of my images in a test file come out full page rather than properly cropped so multiple inages can't appear on a single typeset document. I enclose an example. Running asy on the enclosed asymptotemktest-6.asy (after unzipping) gives me the enclosed pdf file.
asymtotemktest-6.pdf
asymtotemktest-6.asy.zip
The text was updated successfully, but these errors were encountered: