papaja:放置浮动 H 时控制文本间距

papaja: controlling text spacing when placing floats H

我正在使用很棒的 papaja 包来创建手稿。我想在文本中放置数字 (floatsintext: yes) 并且我希望它们准确出现在指定的位置。

为了实现后者,我按照将以下内容添加到YAML:

header-includes: #allows you to add in your own Latex packages
- \usepackage{float} #use the 'float' package
- \floatplacement{figure}{H} #make every figure with caption = h

这会将图形放在我想要的位置,但文本间距设置为使用整个页面。我希望前面的文字从上到下使用space,在页面底部的数字之前留下白色space。

---
title             : "The title"
shorttitle        : "Title"

author: 
  - name          : "First Author"
    affiliation   : "1"
    corresponding : yes    # Define only one corresponding author
    address       : "Postal address"
    email         : "my@email.com"
  - name          : "Ernst-August Doelle"
    affiliation   : "1,2"

affiliation:
  - id            : "1"
    institution   : "Wilhelm-Wundt-University"
  - id            : "2"
    institution   : "Konstanz Business School"

authornote: |
  Add complete departmental affiliations for each author here. Each new line herein must be indented, like this line.

  Enter author note here.

abstract: |

keywords          : "keywords"
wordcount         : "X"

bibliography      : ["r-references.bib"]

floatsintext      : yes
figurelist        : no
tablelist         : no
footnotelist      : no
linenumbers       : yes
mask              : no
draft             : no

documentclass     : "apa6"
classoption       : "man,noextraspace"
header-includes:
  - \usepackage{pdfpages}
  - \usepackage{setspace}
  - \AtBeginEnvironment{tabular}{\singlespacing}
  - \makeatletter\let\expandableinput\@@input\makeatother
  - \interfootnotelinepenalty=10000
  - \usepackage{float} #use the 'float' package
  - \floatplacement{figure}{H} #make every figure with caption = h
output            : papaja::apa6_pdf
---

```{r setup, include = FALSE}
library("papaja")
```

```{r analysis-preferences}
# Seed for random number generation
set.seed(42)
knitr::opts_chunk$set(cache.extra = knitr::rand_seed)
```

# Methods
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sollicitudin libero id arcu accumsan sagittis. Sed vel rutrum magna, et posuere tellus. Aenean auctor maximus mauris, a dapibus lectus. Sed efficitur ultricies semper. Vestibulum dignissim mollis dui, ut rhoncus urna porttitor id. Vestibulum eget maximus tellus, molestie imperdiet nulla. Phasellus congue, libero quis sagittis porttitor, ex dui posuere leo, eget viverra nisi sapien non arcu. Ut consectetur magna quis sem fringilla, ac elementum risus suscipit. Morbi lobortis sem non ante imperdiet, in faucibus dui lobortis. Nam at lorem erat. Donec nec maximus erat, quis vehicula mi. Sed sed gravida lacus. Nam non elit enim.

Maecenas finibus turpis at lectus convallis, eget congue turpis rutrum. Fusce eleifend tellus turpis, eget egestas odio mattis at. Aenean interdum lectus a orci tempus, eget sodales diam congue. Aenean ac tellus a leo auctor rhoncus. Nam condimentum, diam sit amet iaculis gravida, risus augue aliquam urna, in vestibulum eros ex quis risus. Quisque porta euismod lectus hendrerit sollicitudin. Nulla condimentum est risus, non interdum urna commodo ac.


```{r pressure, echo=FALSE}
plot(pressure)
```

您正在使用的文档类似乎 \flushbottom 处于活动状态,这将确保所有页面都具有相同的 bootom 行。这通常在书籍等方面完成。

如果你不想这样,你可以使用 \raggedbottom 宏。