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

External images in slideshows do not consider the publication file #2155

Open
rbeezer opened this issue Apr 19, 2024 · 12 comments
Open

External images in slideshows do not consider the publication file #2155

rbeezer opened this issue Apr 19, 2024 · 12 comments
Labels

Comments

@rbeezer
Copy link
Collaborator

rbeezer commented Apr 19, 2024

Check the template matching image and condition on the existence of a generated directory. Good chance there maybe other similar failures to respect aspects of the publication file.

Obsoletes: PreTeXtBook/pretext-cli#717

@kcrisman
Copy link
Contributor

kcrisman commented Apr 19, 2024 via email

@kcrisman
Copy link
Contributor

Sounds like #2156 addresses this, correct?

@sean-fitzpatrick
Copy link
Contributor

I just checked a slideshow that I have.

Images are in the assets directory, and I have

<directories external="../assets" generated="../generated-assets"/>

within the source section of my publication file.

Including an image with <image source="foo.svg"/> works as expected. (This was not the case when I wrote the slides last fall.)

However, width attributes (either on the image element or on an enclosing sidebyside) are not respected.

@kcrisman
Copy link
Contributor

However, width attributes (either on the image element or on an enclosing sidebyside) are not respected.

I certainly expect this on the image element, I have some hacked code that solves that problem which I'd like to contribute after helping with #2159. I never had problems with sidebyside so I'd have to check that out.

@kcrisman
Copy link
Contributor

Including an image with <image source="foo.svg"/> works as expected. (This was not the case when I wrote the slides last fall.)

Weirdly, this works for my complex slides too, but not when I mess with the sample slideshow - ?!?

@kcrisman
Copy link
Contributor

Including an image with <image source="foo.svg"/> works as expected. (This was not the case when I wrote the slides last fall.)

Weirdly, this works for my complex slides too, but not when I mess with the sample slideshow - ?!?

I should point out that I am NOT using the CLI for the sample slideshow yet (that would be, as #2159 points out. another level of difficulty). The publisher file is being recognized (as I can tell from changing other entries) - any ideas on an extra step I might need to take, something with the pretext script? That's been alluded to various times recently.

@kcrisman
Copy link
Contributor

No, I figured it out. It's weird. Instead of using

<xsl:variable name="external-directory-source">

it's using

<xsl:variable name="external-directory">

which defaults to external (intentionally hard-coded!) for backwards compatibility. I just posted to -dev about this.

@kcrisman
Copy link
Contributor

However, width attributes (either on the image element or on an enclosing sidebyside) are not respected.

I certainly expect this on the image element, I have some hacked code that solves that problem which I'd like to contribute after helping with #2159. I never had problems with sidebyside so I'd have to check that out.

Yeah, I have code like <sidebyside widths="60% 20%"> and it definitely behaves as expected. Is there something different you're doing there?

@sean-fitzpatrick
Copy link
Contributor

If you use the CLI, images are copied over where you expect them to be.

I have a slide with:

<sidebyside widths="45% 45%>
  <image source="foo.svg"/>
  <p>Some text</p>
</sidebyside>

and the image only takes up about 30% of the first SBS panel. If I edit the HTML file to add width="100%" to the image element, it scales to fill the panel.

Probably if you use .jpg or .png, you get the native size of the image (or it scales down?)

@sean-fitzpatrick
Copy link
Contributor

Does your sidebyside behave as expected because you are using the hacked code you mention?

@kcrisman
Copy link
Contributor

kcrisman commented Jul 19, 2024 via email

@kcrisman
Copy link
Contributor

Probably? I can't check now, unfortunately.

See my woeful guess at #2159 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants