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

Conflict of titlepage-pdf with margin figure captions #54

Open
dkStevensNZed opened this issue Apr 4, 2024 · 3 comments
Open

Conflict of titlepage-pdf with margin figure captions #54

dkStevensNZed opened this issue Apr 4, 2024 · 3 comments

Comments

@dkStevensNZed
Copy link

I'm using titlepage-pdf format for a quarto document. It works great except that when I use that format, the captions for margin figures are clipped to ~0.75" and the caption is hyphenated and wraps around to the next line. If I use the standard pdf format, the caption extends across the full width of the margin before wrapping. I've attached the pdf file produced using titlepage-pdf (see p. 2 of the file)

Tester.pdf

with format: titlepage

Figure 1: Empiri-
cal CDF

with format: pdf

Figure 1: Empirical CDF

format: pdf or titlepage-pdf
editor: visual

\newgeometry{left=10mm,right= 80mm,top=25mm,bottom=25mm}

#| label: fig-ecdfm
#| fig-cap: Empirical CDF
#| echo: false
#| include: true
#| column: margin
#| fig-pos: center
#| fig-width: 4
#| fig-asp: .75
#| out-width: 2.5in

  x <- rnorm(10000,-0.75,1)
  hist(x)

\clearpage
\restoregeometry
`

@eeholmes
Copy link
Member

eeholmes commented Apr 4, 2024

Seems to have to do with the \usepackage{geometry} call. I can replicate with format: pdf by adding geometry. titlepage-pdf has a \usepackage{geometry} call backed in.

---
  title: Test case
  format: 
    pdf:
      documentclass: scrartcl
      geometry:
        - top=30mm
        - left=20mm
  ---
  
  
  # Introduction
  
  \newgeometry{left=10mm,right= 80mm,top=25mm,bottom=25mm}
  
  ```{r}
  #| label: fig-ecdfm
  #| fig-cap: Empirical CDF
  #| echo: false
  #| include: true
  #| column: margin
  #| fig-pos: center
  #| fig-width: 4
  #| fig-asp: .75
  #| out-width: 2.5in
  
    x <- rnorm(10000,-0.75,1)
    hist(x)
  ```
  
 \clearpage
 \restoregeometry

@dkStevensNZed
Copy link
Author

dkStevensNZed commented Apr 4, 2024

After adding the geometry include with no success,I tried your example with the same result. Then I took out the documentclass: scrartcl and the result was correct, as I had gotten with 'just' pdf format. When I change the format from pdf: default to titlepage-pdf: default, the shortened caption came back. Is pdf with 'documentclass: scrartcl' the same as titlepage-pdf?

@eeholmes
Copy link
Member

A test case. Has to do I think with geometry package in LaTeX.

---
title: Test case
format: titlepage-pdf
---


# Introduction

\newgeometry{left=10mm,right= 80mm,top=25mm,bottom=25mm}

```{r}
#| label: fig-ecdfm
#| fig-cap: Empirical CDF
#| echo: false
#| include: true
#| column: margin
#| fig-pos: center
#| fig-width: 4
#| fig-asp: .75
#| out-width: 2.5in

  x <- rnorm(10000,-0.75,1)
  hist(x)

\clearpage
\restoregeometry


What it produces

<img width="1066" alt="image" src="https://github.com/user-attachments/assets/1ce8aa84-dd16-435a-9afd-e96705d690e6" />

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

No branches or pull requests

2 participants