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

Subfigure Caption and Cross Reference Not in PDF (Reopening #7815) #7818

Closed
IULibScholComm opened this issue Dec 6, 2023 · 12 comments · Fixed by #7821
Closed

Subfigure Caption and Cross Reference Not in PDF (Reopening #7815) #7818

IULibScholComm opened this issue Dec 6, 2023 · 12 comments · Fixed by #7821
Assignees
Labels
bug Something isn't working crossref figures
Milestone

Comments

@IULibScholComm
Copy link

Bug description

Updated description

I made the change that you recommended, but it does not fix the problem, as the main caption and cross reference are still not present in the PDF version (see attached). (Worse, it creates a problem in the HTML version, as the figures are no longer side by side (as intended) but stacked).
Through-the-Looking-Glass--I.-Why-Cross-Fertilize-problem2.pdf

Steps to reproduce

::: {#fig-4.1 layout-ncol=2}

![The life cycle of the trematode *Microphallus*](images/fig4-2.jpeg){fig-alt=""}

![Infected female (top) and uninfected female (bottom) of *P. antipodarum*](images/fig4-3.jpg){fig-alt=""}

**Left panel:** the life cycle of the trematode *Microphallus*. The adult worms live in the intestines of waterfowl and wading birds (black stilts). They produce cross-fertilized eggs, which are released into lakes and streams with the bird’s feces. The eggs hatch following ingestion by snails. Infection results in the asexual production of hundreds of cysts (called metacercaria). These cysts "hatch" and mature following ingestion by ducks, thus completing the life cycle. Drawing by Zoe M Dinges. **Right panel:** Infected female (top) and uninfected female (bottom) of *P. antipodarum* (Photo Credit: Gabe Harp). The snails had been removed from their shells. The golden cysts in the infected female (top) are *Microphallus* metacercaria. The white tissue of the uninfected female (bottom) is ovary.     
:::

Expected behavior

The PDF subfigures should have a caption and cross reference number (4.1), as they do in the HTML, EPUB, and DOCX versions. The HTML subfigures should be side by side.

Actual behavior

The PDF subfigures do not have a caption and cross reference number (4.1), despite having them in the HTML, EPUB, and DOCX versions. The HTML subfigures are stacked.

Your environment

  • IDE: VS Code 1.84.2
  • OS: Windows 10 Enterprise

Quarto check output

quarto check                                                                                                                                                                                                                    [>] Checking versions of quarto binary dependencies...                                                                        Pandoc version 3.1.1: OK                                                                                                Dart Sass version 1.55.0: OK                                                                                      [>] Checking versions of quarto dependencies......OK                                                                    [>] Checking Quarto installation......OK                                                                                      Version: 1.3.361                                                                                                        Path: C:\Users\amazel\AppData\Local\Programs\Quarto\bin                                                                 CodePage: 1252                                                                                                                                                                                                                            [>] Checking basic markdown render....OK                                                                                                                                                                                                        [>] Checking Python 3 installation....OK                                                                                      Version: 3.11.4                                                                                                         Path: C:/Users/amazel/AppData/Local/Programs/Python/Python311/python.exe                                                Jupyter: 5.5.0                                                                                                          Kernels: ir, python3                                                                                                                                                                                                                      (|) Checking Jupyter engine render....0.00s - Debugger warning: It seems that frozen modules are being used, which may  0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off                                            0.00s - to python to disable frozen modules.                                                                            0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.                  0.00s - Debugger warning: It seems that frozen modules are being used, which may                                        0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off                                            0.00s - to python to disable frozen modules.                                                                            0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.                  [>] Checking Jupyter engine render....OK                                                                                                                                                                                                        [>] Checking R installation...........OK                                                                                      Version: 4.3.0                                                                                                          Path: C:/Users/amazel/AppData/Local/Programs/R/R-4.3.0                                                                  LibPaths:                                                                                                                 - C:/Users/amazel/AppData/Local/R/win-library/4.3                                                                       - C:/Users/amazel/AppData/Local/Programs/R/R-4.3.0/library                                                            knitr: 1.43                                                                                                             rmarkdown: 2.22                                                                                                                                                                                                                           [>] Checking Knitr engine render......OK 
@IULibScholComm IULibScholComm added the bug Something isn't working label Dec 6, 2023
@mcanouil
Copy link
Collaborator

mcanouil commented Dec 6, 2023

I do not think what you used what the suggested code.
The following should work as it makes the "figure" a single element.

::: {#fig-4.1}
:::: {layout-ncol=2}
![The life cycle of the trematode *Microphallus*](images/fig4-2.jpeg){fig-alt=""}

![Infected female (top) and uninfected female (bottom) of *P. antipodarum*](images/fig4-3.jpg){fig-alt=""}
::::

**Left panel:** the life cycle of the trematode *Microphallus*. The adult worms live in the intestines of waterfowl and wading birds (black stilts). They produce cross-fertilized eggs, which are released into lakes and streams with the bird’s feces. The eggs hatch following ingestion by snails. Infection results in the asexual production of hundreds of cysts (called metacercaria). These cysts "hatch" and mature following ingestion by ducks, thus completing the life cycle. Drawing by Zoe M Dinges. **Right panel:** Infected female (top) and uninfected female (bottom) of *P. antipodarum* (Photo Credit: Gabe Harp). The snails had been removed from their shells. The golden cysts in the infected female (top) are *Microphallus* metacercaria. The white tissue of the uninfected female (bottom) is ovary.     
:::

Also why creating a new issue instead of continuing and eventually reopening the previous issue? Opening a new issue is not the same as reopening an issue.
Now there is two issue to follow up.

@IULibScholComm
Copy link
Author

I apologize! I did not know how to reopen an issue, so I created a new one and referenced the closed one. Thank you for helping me.

@IULibScholComm
Copy link
Author

I do not think what you used what the suggested code. The following should work as it makes the "figure" a single element.

::: {#fig-4.1}
:::: {layout-ncol=2}
![The life cycle of the trematode *Microphallus*](images/fig4-2.jpeg){fig-alt=""}

![Infected female (top) and uninfected female (bottom) of *P. antipodarum*](images/fig4-3.jpg){fig-alt=""}
::::

**Left panel:** the life cycle of the trematode *Microphallus*. The adult worms live in the intestines of waterfowl and wading birds (black stilts). They produce cross-fertilized eggs, which are released into lakes and streams with the bird’s feces. The eggs hatch following ingestion by snails. Infection results in the asexual production of hundreds of cysts (called metacercaria). These cysts "hatch" and mature following ingestion by ducks, thus completing the life cycle. Drawing by Zoe M Dinges. **Right panel:** Infected female (top) and uninfected female (bottom) of *P. antipodarum* (Photo Credit: Gabe Harp). The snails had been removed from their shells. The golden cysts in the infected female (top) are *Microphallus* metacercaria. The white tissue of the uninfected female (bottom) is ovary.     
:::

Thank you again! This is helpful, but it does not fully solve the issue. In the PDF, the main caption text appears as regular text rather than as a caption, and in the HTML, the images are stacked rather than side by side.

@mcanouil
Copy link
Collaborator

mcanouil commented Dec 6, 2023

Because you did not fill the issue template properly, I have to assume the Quarto version you are using and my guess is you don't use 1.4 pre-release.

Also note that your example is not a reproducible one.

@IULibScholComm
Copy link
Author

IULibScholComm commented Dec 6, 2023

Yes, my quarto version is 1.3.361, which is stated in the template (Quarto check output)

@mcanouil
Copy link
Collaborator

mcanouil commented Dec 6, 2023

you are not even using the latest stable.
And Carlos told you to use the syntax highlighted in the documentation and to use 1.4 pre-release.

It works just fine with 1.4:

HTML PDF
image #4142 & #7017
---
title: "Quarto Playground"
format: html
---

::: {#fig-demo}
:::: {layout-ncol=2}
![A sub caption for A](https://placehold.co/600x400.png)

![A Sub caption for B](https://placehold.co/600x400.png)
::::

A caption
:::

@mcanouil
Copy link
Collaborator

mcanouil commented Dec 6, 2023

I am closing this as there no unknown issue and the syntax was shown.

@mcanouil mcanouil closed this as completed Dec 6, 2023
@mcanouil mcanouil added support a request for support and removed bug Something isn't working labels Dec 6, 2023
@cscheid
Copy link
Collaborator

cscheid commented Dec 6, 2023

@IULibScholComm hi, let me revisit this - does the following syntax not actually solve your issue? We do have to ask you to update to 1.4, because that's where we do the development, but the following should do the trick for you:

---
title: "Quarto Playground"
format: pdf
---

::: {#fig-demo layout-ncol=2}
![A sub caption for A](https://placehold.co/600x400.png)

![A Sub caption for B](https://placehold.co/600x400.png)

A caption
:::

(@mcanouil FYI your suggested syntax with nested divs doesn't actually work in PDF format.)

@cscheid cscheid reopened this Dec 6, 2023
@cscheid cscheid added bug Something isn't working and removed support a request for support labels Dec 6, 2023
@cscheid cscheid self-assigned this Dec 6, 2023
@cscheid cscheid added this to the v1.4 milestone Dec 6, 2023
@mcanouil

This comment was marked as off-topic.

@cscheid

This comment was marked as off-topic.

@mcanouil

This comment was marked as off-topic.

@IULibScholComm
Copy link
Author

@IULibScholComm hi, let me revisit this - does the following syntax not actually solve your issue? We do have to ask you to update to 1.4, because that's where we do the development, but the following should do the trick for you:

---
title: "Quarto Playground"
format: pdf
---

::: {#fig-demo layout-ncol=2}
![A sub caption for A](https://placehold.co/600x400.png)

![A Sub caption for B](https://placehold.co/600x400.png)

A caption
:::

(@mcanouil FYI your suggested syntax with nested divs doesn't actually work in PDF format.)

Thank you! Yes, the above fixes my issue. I really appreciate it! (And yes, mcanouil's proposed solution, as you mentioned, caused the pdf to break, unfortunately--I think #4142 is the issue mcanouil mentions. I do need both the HTML and PDF versions to work.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crossref figures
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants