quarto_titlepages icon indicating copy to clipboard operation
quarto_titlepages copied to clipboard

Conflict of titlepage-pdf with margin figure captions

Open dkStevensNZed opened this issue 1 year ago • 3 comments

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 `

dkStevensNZed avatar Apr 04 '24 16:04 dkStevensNZed

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 

eeholmes avatar Apr 04 '24 18:04 eeholmes

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?

dkStevensNZed avatar Apr 04 '24 21:04 dkStevensNZed

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" />

eeholmes avatar Jan 15 '25 21:01 eeholmes