Back to Skills

format-apa-report

pjt222
Updated 2 days ago
9 views
17
2
17
View on GitHub
Metageneral

About

This skill formats Quarto or R Markdown reports to comply with APA 7th edition style guidelines. It handles title pages, abstracts, citations, tables, figures, and references using apaquarto or papaja packages. Use it when creating psychology/social science research reports, academic papers, or thesis chapters with embedded, reproducible analysis in R.

Quick Install

Claude Code

Recommended
Primary
npx skills add pjt222/agent-almanac -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/pjt222/agent-almanac
Git CloneAlternative
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/format-apa-report

Copy and paste this command in Claude Code to install this skill

Documentation

格 APA 報

造循 APA 第七版之 Quarto(apaquarto)或 R Markdown(papaja)格之報。

用時

  • 書 APA 格學報
  • 造心或社科研報
  • 生含析之可復製稿
  • 備學位論章

  • 必要:析碼與果
  • 必要:參考文獻檔(.bib)
  • 可選:共作與所屬
  • 可選:稿類(期刊文、學生稿)

第一步:擇框

甲選:apaquarto(Quarto,薦)

install.packages("remotes")
remotes::install_github("wjschne/apaquarto")

乙選:papaja(R Markdown)

remotes::install_github("crsh/papaja")

得: 所擇框包成裝,可以 library(apaquarto)library(papaja) 載。

敗則: 若因缺系依(如 PDF 之 LaTeX)裝敗,先 quarto install tinytex。若 GitHub 裝敗,察 remotes 已裝且 GitHub 可達。

第二步:造文(apaquarto)

manuscript.qmd

---
title: "Effects of Variable X on Outcome Y"
shorttitle: "Effects of X on Y"
author:
  - name: First Author
    corresponding: true
    orcid: 0000-0000-0000-0000
    email: [email protected]
    affiliations:
      - name: University Name
        department: Department of Psychology
  - name: Second Author
    affiliations:
      - name: Other University
abstract: |
  This study examined the relationship between X and Y.
  Using a sample of N = 200 participants, we found...
  Results are discussed in terms of theoretical implications.
keywords: [keyword1, keyword2, keyword3]
bibliography: references.bib
format:
  apaquarto-docx: default
  apaquarto-pdf:
    documentmode: man
---

得: manuscript.qmd 存附有效 YAML 含題、短題、作者所屬、摘、鍵詞、參考、APA 特格選。

敗則: 驗 YAML 縮進一(二空)且 author:name:affiliations:corresponding: 之列格。察 bibliography: 指存之 .bib

第三步:書 APA 容

# Introduction

Previous research has established that... [@smith2023; @jones2022].
@smith2023 found significant effects of X on Y.

# Method

## Participants

We recruited `r nrow(data)` participants (*M*~age~ = `r mean(data$age)`,
*SD* = `r sd(data$age)`).

## Materials

The study used the Measurement Scale [@author2020].

## Procedure

Participants completed... (see @fig-design for the study design).

# Results

```{r}
#| label: fig-results
#| fig-cap: "Mean scores by condition with 95% confidence intervals."
#| fig-width: 6
#| fig-height: 4

ggplot(summary_data, aes(x = condition, y = mean, fill = condition)) +
  geom_col() +
  geom_errorbar(aes(ymin = ci_lower, ymax = ci_upper), width = 0.2) +
  theme_apa()
```

A two-way ANOVA revealed a significant main effect of condition,
*F*(`r anova_result$df1`, `r anova_result$df2`) = `r anova_result$F`,
*p* `r format_pvalue(anova_result$p)`, $\eta^2_p$ = `r anova_result$eta`.

# Discussion

The findings support the hypothesis that...

# References

得: 容循 APA 節構(Introduction、Method、Results、Discussion、References)附內嵌 R 碼統附正交引用 @fig-@tbl-

敗則: 若內嵌 R 碼不渲,驗反引 r 語正(`r expression`)。若交引示為字,察所引塊標正用前綴並配應題選。

第四步:以 APA 格表

#| label: tbl-descriptives
#| tbl-cap: "Descriptive Statistics by Condition"

library(gt)

descriptive_table <- data |>
  group_by(condition) |>
  summarise(
    M = mean(score),
    SD = sd(score),
    n = n()
  )

gt(descriptive_table) |>
  fmt_number(columns = c(M, SD), decimals = 2) |>
  cols_label(
    condition = "Condition",
    M = "*M*",
    SD = "*SD*",
    n = "*n*"
  )

得: 表以 APA 格渲:統符列頭斜體、正小對、表上有述題。

敗則:gt 表不以 APA 渲,確 gt 裝且 cols_label() 用 markdown 斜體(*M**SD*)。papaja 用 apa_table()gt()

第五步:管引用

references.bib

@article{smith2023,
  author = {Smith, John A. and Jones, Mary B.},
  title = {Effects of intervention on outcomes},
  journal = {Journal of Psychology},
  year = {2023},
  volume = {45},
  pages = {123--145},
  doi = {10.1000/example}
}

APA 引用式:

  • 括內:[@smith2023] -> (Smith & Jones, 2023)
  • 敘:@smith2023 -> Smith and Jones (2023)
  • 多:[@smith2023; @jones2022] -> (Jones, 2022; Smith & Jones, 2023)

得: references.bib 含有效 BibTeX 條附諸必域(author、title、year、journal),引鍵合稿文。

敗則: 以線驗器或 bibtool -d references.bib 驗 BibTeX 語。確文引鍵與 .bib 鍵確合(別大小)。

第六步:渲

# Word document (common for journal submission)
quarto render manuscript.qmd --to apaquarto-docx

# PDF (for preprint or review)
quarto render manuscript.qmd --to apaquarto-pdf

得: 正格之 APA 文附題頁、頁眉、正格之參考節。

敗則: PDF 渲敗時,驗 TinyTeX 裝(quarto install tinytex)。DOCX 出問時,察 apaquarto 之 Word 模可達。若參不現,確文末有 # References 題。

  • 題頁正格(題、作者、所屬、作者注)
  • 摘附鍵詞
  • 文內引合參考列
  • 表圖正編
  • 統循 APA 格(斜體、正符)
  • 參考以 APA 第七版格
  • 頁號與頁眉存(PDF)

  • 內嵌 R 碼格:用反引 r 於內統,非硬值
  • 引鍵失配:確 .bib 鍵於文確合
  • 圖置:APA 稿通置圖於末;設 documentmode: man
  • 缺 CSL 檔:apaquarto 含 APA CSL;papaja 或需指 csl: apa.csl
  • 摘中特字:避 YAML 摘塊之 markdown 格

  • create-quarto-report - 通 Quarto 文造
  • generate-statistical-tables - 可發表表
  • build-parameterized-report - 批報生

GitHub Repository

pjt222/agent-almanac
Path: i18n/wenyan/skills/format-apa-report
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

Related Skills

content-collections

Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill

polymarket

Meta

This skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.

View skill

creating-opencode-plugins

Meta

This skill helps developers create OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It provides the plugin structure, event API specifications, and implementation patterns for JavaScript/TypeScript modules. Use it when you need to intercept, monitor, or extend the OpenCode AI assistant's lifecycle with custom event-driven logic.

View skill

sglang

Meta

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

View skill