簡體   English   中英

無法更改 papaja 文檔中錯誤的圖形/表格標題格式

[英]Can't change wrong figure/table caption format in papaja document

我正在嘗試根據 apa 指南編寫文檔,所以我在 RStudio 中編寫並使用了 papaja package 模板。 但圖表中的標題格式錯誤(見下文)。 標題文本應為斜體,label 應位於標題文本上方並加粗。

所以我嘗試使用 latex“標題”package(見下文)更正它。 現在表格標題沒問題。 但是圖形標題仍然是錯誤的(它是斜體並且與標題文本在同一行。)

標題 package 似乎對木瓜中的標題進行任何更改的能力非常有限。 我唯一能做的就是將 fonts 更改為粗體。 (我已經在純 rmarkdown 中嘗試了標題 package 並且一切正常。)

有沒有辦法用木瓜 package 將圖形標題更改為正確的格式? 我已經沒有什么想法了。

(下面的代碼和圖像。)

EDIT1:使用完整代碼更新。

EDIT2:我不確定,但是當涉及到圖形字幕時,似乎有幾種 apa 格式。 所以我猜最后一張圖片中的數字標題是可以的。 (只需將標題移動到圖像下方。)我不希望找到解決此問題的方法,所以我只需要像這樣離開它。

沒有標題 package 的標題: 格式錯誤 在此處輸入圖像描述

帶有標題 package 的標題。 (表格標題的格式正確) 在此處輸入圖像描述 在此處輸入圖像描述

---
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"
    role:         # Contributorship roles (e.g., CRediT, https://casrai.org/credit/)
      - Conceptualization
      - Writing - Original Draft Preparation
      - Writing - Review & Editing
  - name          : "Ernst-August Doelle"
    affiliation   : "1,2"
    role:
      - Writing - Review & Editing

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: |
  blablala
  
  
keywords          : "keywords"
wordcount         : "X"

bibliography      : ["r-references.bib"]

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

documentclass     : "apa6"
classoption       : "doc"
output            : papaja::apa6_pdf
header-includes:
  \usepackage{hhline, colortbl}
   \usepackage{wrapfig}
   \usepackage[
    labelsep=newline,
    textfont=it,
    labelfont=bf,
    justification=raggedright,
    singlelinecheck=off
  ]{caption}
---

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

```{=latex}
\begin{figure}
  \caption{My figure caption}
  \label{fig:cbttblock}
  \includegraphics[width=0.4\textwidth]{Figures/CBBTblock.png}
\end{figure}
```


```{=latex}
\begin{table}
  \caption{My table caption} \label{tab:tblSekvens}
  \begin{tabular}{|l||c||c||
    >{\columncolor[HTML]{C0C0C0}}c ||c||c||c||
    >{\columncolor[HTML]{C0C0C0}}c ||c||c|}

    \hhline{*{9}{-||}-}
    \textbf{\begin{tabular}[c]{@{}l@{}}Peksekvens \\ Försöksledare\end{tabular}}   
      & A & B & C & D & E & F & G & H & I \\

    \hhline{*{9}{=::}=}
    \textbf{Pekning nr} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\

    \hhline{*{9}{=::}=}
    \textbf{\begin{tabular}[c]{@{}l@{}}Peksekvens\\ Försöksdeltagare\end{tabular}}
      & A & B & G & D & E & F & C & H & I \\
    \hhline{*{9}{-||}-}

  \end{tabular}
\end{table}
```

你可以設置

documentclass: "apa7"

在您的 YAML 前端問題中。 它應該為您的示例解決問題。 如果這樣做,您也可以在 LaTeX header 中省略加載caption package。

但是,請注意,對 apa7 文檔 class 的完全支持仍然有些限制。 在這里,您可以找到有關如何盡可能接近 APA7 的更多信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM