File size: 4,287 Bytes
3878dd8
26e6c88
3878dd8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
title: 'Extracting Signal from the Noise'
short_desc: 'What we learned triaging two years of agent PRs'
emoji: 📝
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: false
header: mini
app_port: 8080
tags:
  - research-article-template
  - research paper
  - scientific paper
  - data visualization
---
<div align="center">

# Research Article Template

**A modern, interactive template for scientific writing that brings papers to life.**

Interactive diagrams, math, citations, dark mode, PDF export - all with minimal setup.

**[Live demo & docs](https://huggingface.co/spaces/tfrere/research-article-template)** | [![License: CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/) [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/tfrere/research-article-template)

</div>

## Quick start

```bash
npx create-research-article my-paper
```

The CLI walks you through setup interactively:
- **Project name** and basic metadata (title, authors, affiliations)
- **Template choice**: `article` (full layout with banner, TOC, citations, figure numbering, PDF export) or `paper` (lighter centered single-column layout)
- **Hugging Face deployment** (optional, auto-creates a Space if `huggingface-cli` is installed)

Then start writing:

```bash
cd my-paper/app
npm run dev              # dev server at localhost:4321
```

## Deploy to Hugging Face

If you skipped the auto-deploy during setup, push manually:

```bash
# create a Docker Space at huggingface.co/new-space, then:
git remote add space git@hf.co:spaces/<your-username>/<your-space>
git push space main
```

The project ships with Dockerfile, nginx config, and HF Space metadata ready to go.

## Template variants

Set `template` in `app/src/content/article.mdx` frontmatter:

| Value | Layout | Best for |
|-------|--------|----------|
| `article` (default) | Banner, sidebar TOC, figure numbering, citation block, PDF export | Full research articles |
| `paper` | Centered single column, no figure numbering, minimal footer | Blog posts, lighter papers |

### External links (paper template)

The `paper` template supports external link buttons below the authors:

```yaml
links:
  - label: "Paper"
    url: "https://arxiv.org/abs/..."
  - label: "Code"
    url: "https://github.com/..."
  - label: "Demo"
    url: "https://huggingface.co/spaces/..."
```

### Title line breaks

Long titles are automatically balanced across lines. You can also force a line break with `\n`:

```yaml
title: "Why Open-Source LLMs\nAre Reshaping the AI Landscape"
```

Titles longer than 60 characters are automatically downsized for readability.

## Edit your content

| File | What |
|------|------|
| `app/src/content/article.mdx` | Main article (metadata + chapter imports) |
| `app/src/content/chapters/` | Chapters (one .mdx per section) |
| `app/src/content/bibliography.bib` | BibTeX references |
| `app/src/content/embeds/` | D3.js HTML visualizations |
| `app/src/content/assets/image/` | Images |
| `app/src/content/assets/data/` | CSV/JSON data files |

## Commands

| Command | What |
|---------|------|
| `npm run dev` | Dev server |
| `npm run build` | Production build |
| `npm run export:pdf` | Export as PDF |
| `npm run export:latex` | Export as LaTeX |
| `npm run sync:template` | Pull latest template updates |

## Alternative setup

<details>
<summary>Duplicate on Hugging Face</summary>

1. Visit **[Research Article Template](https://huggingface.co/spaces/tfrere/research-article-template)**, click **"Duplicate this Space"**
2. Clone: `git clone git@hf.co:spaces/<your-username>/<your-space>`
3. `cd <your-space>/app && git lfs pull && npm install && npm run dev`
</details>

<details>
<summary>Clone directly</summary>

```bash
git clone https://github.com/tfrere/research-article-template.git
cd research-article-template/app
git lfs install && git lfs pull
npm install && npm run dev
```
</details>

## License

CC-BY-4.0 - [Distill](https://distill.pub/)-inspired, built with [Astro](https://astro.build/) + MDX + D3.js.

**[Discussions](https://huggingface.co/spaces/tfrere/research-article-template/discussions)** | **[@tfrere](https://huggingface.co/tfrere)**