PDF, images, side-by-side, no margin, flush-right

11 views
Skip to first unread message

Rob Beezer

unread,
Nov 20, 2025, 12:37:51 PM (3 days ago) Nov 20
to prete...@googlegroups.com
Mostly for David Farmer. But I know others are interested.

In your current project, you have an #image in a #sidebyside that has 0%
margins. But it is still obviously not quite flush-right in the PDF. Well,
obvious to you, me, Oscar, Alex, and everybody else here.

I've noticed during work on the Mermaid files, that there are a couple of missed
opportunities to put trailing percent-signs on some lines including images. Not
as easy as adding them, since some #stack break, but that is a solvable problem.

Would you mind doing a test? I think you know how to get all your LaTeX, imnage
files, etc out so you can do an edit and a test build. If not, Oscar just made
it easier and will soon integrate into the CLI. Find the "\includegraphics" for
your particular image, add a % at the end of the line (presuming it is not
there!), rebuild, and check alignment.

Thanks,
Rob

David W. Farmer

unread,
Nov 21, 2025, 8:13:47 AM (2 days ago) Nov 21
to 'Rob Beezer' via PreTeXt development

Okay, I have something.

It is not missing %s at the end of lines. I put such a character
at the end of every line that could possibly have an influence,
to no effect.

It may be improperly (or misunderstood) source markup on my part.
Or, between two seemingly equivalent ways of expressing a layout,
one is not being handled properly.


Let's say I want an image of 50% width next to an image of 48% width,
with the extra 2% as blank space between the images.

I was doing this:

<sidebyside widths="50% 48%" margins="0% 2% 0%" valign="bottom">

Which gave the following in the LaTeX:

\begin{sidebyside}{2}{0}{0.02}{0}%

That gave the error described: the layout in the PDF is:

[no margin][image][image][the missing 2%]

(aside: if I make the "2%" larger value, I get an error about a
negative computed space. Making it smaller does not generate an error.)


Instead, suppose I do this:

<sidebyside widths="50% 48%" margins="0% 0%" valign="bottom">

which gives:

\begin{sidebyside}{2}{0}{0}{0.02}%

That gives what I wanted:

[no margin][image][2% gap][image][no margin]


I figured this out because elsewhere I had:

<sidebyside widths="30% 30% 30%" valigns="bottom bottom bottom" margins="0% 0%">

which gave what I wanted: 3 images, equal space between, no side margins.


I think the problem is putting the arguments in the wrong order in the
LaTeX.

Regards,

David
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pretext-dev...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/pretext-dev/MTAwMDAzOC5iZWV6ZXI.1763660265%40pnsh.
>

Alex Jordan

unread,
Nov 21, 2025, 9:45:27 AM (2 days ago) Nov 21
to prete...@googlegroups.com
I don't think source with margins="0% 2% 0%" is valid. I think you either specify the two outer margins, or one percent to use for both. But all inner margins are calculated, and forced to be equal.

Rob Beezer

unread,
Nov 21, 2025, 11:22:53 AM (2 days ago) Nov 21
to prete...@googlegroups.com
Alex has it right. There are two margins, left-, and right-. Then there are n
- 1 gaps when there are n panels. You never explicitly set the gaps and they
are always equal. You do control them: yours is 0.02 = (1 - 0.50 - 0.48 - 0.00
- 0.00)/(2 - 1). There is a *lot* of default behavior and a lot of
error-checking going on with #sidebyside.

I should add a run-time warning for more than two values in @margins. We can't
parse that via the schema. Once @widths became multi-valued (of variable
length), I decided against @left-margin and @right-margin, especially since I
think most uses have equal margins and are not going for an asymmetric slide one
way or the other.

Thanks for the careful report. I'm going to still go hunting for new percent
signs, once I decide about how to handle run-on elements in a #stack. It was
sort of coincidental that this popped up right after you had shown us your image.

Rob
> > email to pretext-dev...@googlegroups.com <mailto:pretext-
> dev%2Bunsu...@googlegroups.com>.
> > To view this discussion visit
> > https://groups.google.com/d/msgid/pretext-dev/
> MTAwMDAzOC5iZWV6ZXI.1763660265%40pnsh <https://groups.google.com/d/msgid/
> pretext-dev/MTAwMDAzOC5iZWV6ZXI.1763660265%40pnsh>.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pretext-dev...@googlegroups.com <mailto:pretext-
> dev%2Bunsu...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> c99d8e2-ccd8-5340-8b2c-a03debcfb8e2%40aimath.org <https://groups.google.com/
> d/msgid/pretext-dev/c99d8e2-ccd8-5340-8b2c-a03debcfb8e2%40aimath.org>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CA%2BR-jrcbHgdNfdTtLHF%3DDmLB6jpqv9CTtjA9BO%3Dhis%3Da5VJcfw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/CA%2BR-
> jrcbHgdNfdTtLHF%3DDmLB6jpqv9CTtjA9BO%3Dhis%3Da5VJcfw%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

Rob Beezer

unread,
Nov 21, 2025, 4:38:33 PM (2 days ago) Nov 21
to prete...@googlegroups.com
On 11/21/25 08:22, 'Rob Beezer' via PreTeXt development wrote:
> I should add a run-time warning for more than two values in  @margins.

Done.

David W. Farmer

unread,
Nov 21, 2025, 5:14:36 PM (2 days ago) Nov 21
to 'Rob Beezer' via PreTeXt development

Thank you!

A warning when you do the wrong thing is better than assuming
I have read (or remembered) the documentation!

Still waiting for the journal to report whether their style,
generated from PreTeXt, is acceptable to them.
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pretext-dev...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/pretext-dev/MTAwMDAwMC5iZWV6ZXI.1763761110%40pnsh.
>

Rob Beezer

unread,
Nov 21, 2025, 6:41:36 PM (2 days ago) Nov 21
to prete...@googlegroups.com
On 11/21/25 14:14, David W. Farmer wrote:
> Still waiting for the journal to report whether their style,
> generated from PreTeXt, is acceptable to them.
Yes, please report what you can. Between "common" LaTeX and Oscar's
"classic/journal" LaTeX, I'll be interested to hear what they make of it.

I had a frightening thought last night: its going to be recoded into some
publisher-workflow XML.

Thanks again for doing the exercise of your running your big research paper
through PreTeXt.

Rob
Reply all
Reply to author
Forward
0 new messages