-
Notifications
You must be signed in to change notification settings - Fork 568
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
Pdflatex figurefixes #178
Pdflatex figurefixes #178
Conversation
…versions. I suspect most users will find it to be a more readable and pleasant font than CM in the majority of applications and use cases, and it ships by default with every modern LaTeX installation.
Control that figures don't overflow the page by giving them a max width, and removing the empty "Figure N:" captions that pandoc would leave beind. Credit for this logic: https://gist.github.com/rwst/1366514
Thanks for the note. I have no problem with this, please go ahead. On Mon, 28 Dec 2015 00:39 Fernando Perez notifications@github.com wrote:
|
Great, many thanks @rwst! I've updated the PR description accordingly. Credit in the corresponding commit linking to your original gist, please let us know if you'd like any changes made, happy to do so. |
\usepackage{graphicx} | ||
% We will generate all images so they have a width \maxwidth. This means | ||
% that they will get their normal width if they fit onto the page, but | ||
% are scaled down if they would overflow the margins. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should already be handled line 204 and works correctly for me with pandoc 1.15.2 (with a default of min witdth 80% pagewidth, height 80% pageheight,to ensure extra-long image still fit.) So This would be a regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmh, it wasn't working for me... The reason I introduced this logic was precisely because when I started creating the Sloan report, I was getting all my figures to be absolutely huge, blowing way past the page borders. I'm on OS X, pandoc 1.15.2.1.
So, evidently, something wasn't quite right until I put this logic in, but we should sort it out first...
I guess what you want is to set no-caption (not to get the For the width/height things if it does not work for you we can try to debug it. |
Yes, we need a solution for the case where there's no caption in the alt-text, to avoid the ugly empty As far as the figure size, I'm happy to drop that commit, if it worked, but in my case, it didn't at all. Can you try to create the Sloan report without this PR at all, and see what you get? Just run |
Can you send me the images you use ? I just have the ipynb. (see if I get a pixel for pixel PDF) |
On Tue, Dec 29, 2015 at 10:36 AM, Matthias Bussonnier <
sent! Fernando Perez (@fperez_org; http://fperez.org) |
Ah indeed, my bad. The current handling of width/height apply only in outputs,not pandokized markdown. I think we can just update that to @fperez dont' worry about that, we'll take care of it ! |
Ok, thanks! I played a lot with sizes, and I think a bit smaller than 90% would be a little better, perhaps 75% or 80%. Visually it makes them somewhat more inset from the text. 90% barely shows as an inset, think of a block quote, and it's typically more inset than 10% (keep in mind that a 10% inset has to be split into 5% on each side, so it's almost nothing visually on each side to differentiate it). So I'd argue for at least 80%... |
+1 on 80% On Wed, Dec 30, 2015 at 10:23 AM, Fernando Perez notifications@github.com
Brian E. Granger |
80% it is. |
Do we want to merge this and refine in master, or is there anything left to do in this PR? |
:-( Need rebase now. |
@fperez I think the conflict is only on the last commit, because the same fix had been found and merged in another PR. If you pop that, I think we can merge this. |
29fa65f
to
b9a781a
Compare
thanks! |
🍰 |
Mostly improvements to figure handling, but a few extra fixes as well, to improve the quality of PDF output out of the box.
With these fixes, I was able to generate the final Sloan report with the command
jupyter nbconvert --to pdf <notebook-filename>
, without any further manual modification.Note to whoever does final merge: merge commit message should list credit to https://gist.github.com/rwst/1366514 by @rwst, which is the main logic of this PR, the rest are small tweaks.