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

Floats in text only for figures (PDF) #106

Closed
jgeller112 opened this issue Jan 20, 2025 · 4 comments
Closed

Floats in text only for figures (PDF) #106

jgeller112 opened this issue Jan 20, 2025 · 4 comments

Comments

@jgeller112
Copy link

Hi,

In my qmd document: https://github.com/jgeller112/L2_VWP_Webcam/blob/main/_manuscript/L2_VWP_webcam_ET.qmd the floats arg is set to true, however, when rendered only figures are placed in-text

See: https://github.com/jgeller112/L2_VWP_Webcam/blob/main/_manuscript/L2_VWP_webcam_ET.pdf

@jgeller112
Copy link
Author

In addition, code wrap does not work for PDF?

@wjschne
Copy link
Owner

wjschne commented Jan 20, 2025

The apaquarto extension makes use of the apa7 LaTeX package to convert to .pdf. The float mechanisms are not something I have a lot of control over. It looks to me that LaTeX placed Table 1 into the text but could not fit Table 2 into the text, so it defaulted to placing it and all subsequent tables at the end.

For code wrapping, put this in your setup chunk:

knitr::opts_chunk$set(tidy.opts=list(width.cutoff=60), tidy=TRUE)

Make sure that the formatR package is installed.

@jgeller112
Copy link
Author

Thanks for the quick response!

it looks like

documentmode: doc 

floats in-text but not man or jou

@wjschne
Copy link
Owner

wjschne commented Jan 25, 2025

Failing to float in text is usually because the algorithms that latex uses fail. That is, it cannot find a good place to fit large plots or a series of plots in a short span of text. This problem happens a lot. There are many suggestions for what do to next. For example, this page suggests resetting the defaults: https://aty.sdsu.edu/bibliog/latex/floats.html

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