Skip to content
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 included in pdf are not middle aligned #85

Closed
PeterTKY opened this issue Jul 10, 2019 · 7 comments
Closed

Images included in pdf are not middle aligned #85

PeterTKY opened this issue Jul 10, 2019 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@PeterTKY
Copy link
Contributor

PeterTKY commented Jul 10, 2019

Happening in https://github.com/CalConnect/csd-digital-addresses. Yes, it's the same document that @ronaldtse had provided access.

How to trigger (in case you don't know): make

Path of the problematic document (after compilation): "documents/cc-19160-6.pdf"

Symptoms:

  • In "documents/cc-19160-6.pdf", images included are not middle aligned, e.g. Figure 1. Hopefully, you found where "Figure 1" is and I don't have to specify all the instances.

  • Only happens to the pdf, but not other formats. You can try "documents/cc-19160-6.html". You name it for other formats.

Please feel free to ask if you need even more details. Thanks!

@PeterTKY PeterTKY added the bug Something isn't working label Jul 10, 2019
@opoudjis
Copy link
Contributor

It is true that all images in HTML and therefore PDF are left aligned, unlike in Word where they are centre aligned. @ronaldtse should I make centre alignment universal, or just for PDFs? And all flavours, or just this one? This is a CSS change, but it might impact every flavor.

@ronaldtse
Copy link
Contributor

@opoudjis previously all HTML images are centered. I think it's safe to center all images across flavors.

@ronaldtse
Copy link
Contributor

It may be the case where HTML "appear centered" but is actually left-aligned. In this case, let's center all images anyway.

@PeterTKY
Copy link
Contributor Author

Agree. The center-aligned captions of those images may show the original intent to center align also the images.

@opoudjis
Copy link
Contributor

opoudjis commented Jul 14, 2019

Will apply to all flavours and then release, likely today. This hadn't been obvious before because most images we deal with are 100% sized and much bigger than the HTML window.

@opoudjis
Copy link
Contributor

Interesting. The 100% sizing is only being applied to HTML anyway, and not PDF. It would be preferable for 100% to be applied only when the image is bigger than the current screen, not smaller. Investigating further: enlarging images just looks horrible. Investigating further.

@opoudjis
Copy link
Contributor

Ok, so until now, solution was:

PDF: no special formatting to images. (So they ended up left aligned.)
HTML: width: 100%; height: auto; (So image was either blown up to 100%, or shrunk down to 100%. In either case, there was never an issue of left alignment, because the image filled the screen.

The formatting of images within figures, whether in PDF or in HTML, shall henceforth be centered, and reduced down to 100% but never enlarged past 100%:

margin-left: auto;
margin-right: auto;
display: block;
max-width: 100%;
height: auto;

opoudjis added a commit to metanorma/metanorma-generic that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-csa that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-cc that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-gb that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-iec that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-iso that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-itu that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-m3aawg that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-mpfa that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-ogc that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-ribose that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-sample that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-un that referenced this issue Jul 14, 2019
opoudjis added a commit to metanorma/metanorma-vg that referenced this issue Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants