# λ
Όλ¬Έ μλ μμ± νμ΄νλΌμΈ κ°μ΄λ
# Paper Auto-Generation Pipeline Guide
## π― λͺ©ν
**Input**: λ°μ΄ν° + κ°μ€
**Output**: 32κ° λ¨λ½ + ν + κ·Έλ¦ΌμΌλ‘ ꡬμ±λ μμ±λ λ
Όλ¬Έ (PDF)
---
## ποΈ μν€ν
μ²
```
Raw Data (.dat files)
β
[1] Data Processing (features.py)
β features_engineered.parquet
[2] Statistical Analysis (models.py)
β H1/H2 results
[3] Table Generation (scripts/generate_paper_tables.py)
β table1_h1.tex, table2_h2.tex
[4] Figure Generation (plotting.py)
β fig2_*.pdf, fig3_*.pdf
[5] Results Section (scripts/generate_paper_results_section.py)
β results_auto.tex (Module #23-27 μμ μλ)
[6] LaTeX Compilation (pdflatex)
β main.pdf (μ΅μ’
λ
Όλ¬Έ)
```
---
## π λΉ λ₯Έ μμ (5λΆ)
### **μ 체 νμ΄νλΌμΈ ν λ²μ μ€ν**
```bash
# 1. μ 체 νμ΄νλΌμΈ μ€ν (λ°μ΄ν° β λΆμ β λ
Όλ¬Έ)
make all
# κ²°κ³Ό:
# - paper/output/main.pdf β μ΅μ’
λ
Όλ¬Έ
# - paper/tables/*.tex β ν
μ΄λΈ 2κ°
# - paper/figures/*.pdf β κ·Έλ¦Ό 2-3κ°
# - paper/results_auto.tex β μλ μμ±λ Results μΉμ
```
### **μ΄λ―Έ λ°μ΄ν° μμΌλ©΄ λΉ λ₯΄κ²**
```bash
# λ°μ΄ν° μ²λ¦¬ 건λλ°κ³ λΆμλ§
make quick
```
---
## π λ¨κ³λ³ μ€ν
### **Step 1: λ°μ΄ν° μ²λ¦¬** (Module #14-16)
```bash
make data
# λλ μ§μ :
python -m src.cli load-data
python -m src.cli engineer-features
# Output: data/processed/features_engineered.parquet
```
### **Step 2: ν΅κ³ λΆμ** (Module #23-27)
```bash
make analysis
# λλ μ§μ :
python scripts/generate_paper_results_section.py \
--data data/processed/features_engineered.parquet \
--output paper/
# Output:
# - paper/results_auto.tex (μμ μλ Results μΉμ
)
# - paper/results_values.json (λͺ¨λ ν΅κ³ κ°)
```
### **Step 3: ν
μ΄λΈ μμ±**
```bash
make tables
# λλ μ§μ :
python scripts/generate_paper_tables.py \
--data data/processed/features_engineered.parquet \
--output paper/tables/
# Output:
# - paper/tables/table1_h1.tex (H1 regression table)
# - paper/tables/table2_h2.tex (H2 logit table)
```
### **Step 4: κ·Έλ¦Ό μμ±**
```bash
make figures
# λλ μ§μ :
python -m src.cli generate-plots --dataset all --output paper/figures/
# Output:
# - paper/figures/fig2_early_funding.pdf
# - paper/figures/fig3_later_success.pdf
```
### **Step 5: λ
Όλ¬Έ μ»΄νμΌ**
```bash
make paper
# λλ μ§μ :
cd paper/output
pdflatex main.tex
bibtex main
pdflatex main.tex
pdflatex main.tex
# Output: paper/output/main.pdf
```
---
## π μλν λ 벨
### **Tier 1: μμ μλ (Results μΉμ
)**
**Module #23-27**: Results μΉμ
μ **100% μλ μμ±**λ©λλ€.
```latex
% paper/main.texμ μΆκ°
\input{paper/results_auto.tex} % μμ μλ!
```
**ν¬ν¨ λ΄μ©:**
- Paragraph 23: H1 κ²°κ³Ό ν΄μ (κ³μ, p-value μλ μ½μ
)
- Paragraph 24: H2 κ²°κ³Ό ν΄μ (main effect + interaction)
- Table 1: H1 regression table (LaTeX)
- Table 2: H2 logit table (LaTeX)
- Figure 2-3: μ°Έμ‘° κ²½λ‘ μλ μμ±
**μ₯μ :**
- λ°μ΄ν° λ°λλ©΄ β `make analysis` β Results μΉμ
μλ μ
λ°μ΄νΈ
- κ³μ ν릴 μΌ μμ (μ½λμμ μ§μ μΆμΆ)
- p-valueμ λ°λΌ ν
μ€νΈ μλ λ³κ²½ ("significant" vs "not significant")
### **Tier 2: λ°μλ (Methodology μΉμ
)**
**Module #14-22**: λ°μ΄ν° ν΅κ³λ₯Ό μλμΌλ‘ μ±μ
```latex
% paper/templates/methodology.tex.j2
\subsection{Sample Construction}
Our final sample comprises \VAR{descriptive.n_total} ventures,
with \VAR{descriptive.n_software} (\VAR{descriptive.pct_software}\%)
software ventures and \VAR{descriptive.n_hardware} hardware ventures.
The average vagueness score is \VAR{descriptive.vagueness_mean}
(SD = \VAR{descriptive.vagueness_std}).
```
**μ¬μ©λ²:**
```bash
python scripts/generate_paper_full.py
# β paper/output/methodology.tex (μλ κ° μ½μ
)
```
### **Tier 3: μλ (λλ¨Έμ§)**
**Module #1-13, #28-32**: μλ μμ± νμ
- Introduction (#1-7): μ€ν 리ν
λ§ νμ
- Literature (#8-10): λ¬Έν μ 리 νμ
- Theory (#11-13): μ΄λ‘ μ κ° νμ
- Discussion (#28-32): ν΄μ λ° ν¨μ νμ
**νμ§λ§** μμΉλ μλμΌλ‘ μ°Έμ‘° κ°λ₯:
```latex
% paper/main.tex
% Introductionμμ Results κ° μ°Έμ‘°
Our analysis of \input{paper/results_values.json} companies reveals...
```
---
## π μΌλ°μ μΈ μν¬νλ‘μ°
### **λ
Όλ¬Έ μμ± μ€**
```bash
# 1. λ°μ΄ν° μ
λ°μ΄νΈλλ©΄
make data
# 2. Results μΉμ
μ¬μμ±
make results-only
# 3. λ
Όλ¬Έ νμΈ
open paper/output/main.pdf
```
### **λ
Όλ¬Έ μ μΆ μ **
```bash
# 1. μ 체 νμ΄νλΌμΈ μ€ν (μ²μλΆν°)
make clean-all
make all
# 2. ν
μ€νΈ μ€ν (λ
Όλ¬Έ κ° κ²μ¦)
make test
# 3. μ΅μ’
νμΈ
make validate
```
### **리뷰 νΌλλ°± ν**
```bash
# 1. μ½λ μμ (μ: H1 formula λ³κ²½)
vi src/models.py
# 2. Results μ¬μμ± (λ°μ΄ν°λ κ·Έλλ‘)
make quick
# 3. ν
μ€νΈλ‘ κ²μ¦
make test
# 4. λͺ¨λ ν΅κ³Όνλ©΄ commit
git add . && git commit -m "Update H1 specification"
```
---
## π νμΌ κ΅¬μ‘°
```
empirics_ent_strat_ops/
βββ data/
β βββ raw/*.dat # μλ³Έ λ°μ΄ν°
β βββ processed/
β βββ features_engineered.parquet # μ²λ¦¬λ λ°μ΄ν°
βββ src/
β βββ models.py # H1/H2 ν¨μ
β βββ features.py # λ°μ΄ν° μ²λ¦¬
β βββ plotting.py # κ·Έλ¦Ό μμ±
βββ scripts/
β βββ generate_paper_results_section.py # Results μλ μμ±
β βββ generate_paper_tables.py # ν
μ΄λΈ μμ±
β βββ generate_paper_full.py # μ 체 λ
Όλ¬Έ μμ±
βββ paper/
β βββ main.tex # λ©μΈ λ
Όλ¬Έ νμΌ (μλ μμ±)
β βββ results_auto.tex # μλ μμ±λ Results β
β βββ results_values.json # λͺ¨λ ν΅κ³ κ°
β βββ tables/
β β βββ table1_h1.tex # μλ μμ± β
β β βββ table2_h2.tex # μλ μμ± β
β βββ figures/
β β βββ fig2_early_funding.pdf # μλ μμ± β
β β βββ fig3_later_success.pdf # μλ μμ± β
β βββ templates/ # Jinja2 ν
νλ¦Ώ (μ ν)
β β βββ main.tex.j2
β β βββ results.tex.j2
β βββ output/
β βββ main.pdf # μ΅μ’
λ
Όλ¬Έ PDF β
βββ test/
β βββ integration/
β βββ test_paper_results.py # λ
Όλ¬Έ κ° κ²μ¦
βββ Makefile # νμ΄νλΌμΈ μλν
βββ README.md
```
---
## π¨ main.tex ꡬ쑰 μμ
```latex
\documentclass{article}
\begin{document}
% ============================================
% Tier 3: μλ μμ±
% ============================================
\section{Introduction}
% Paragraph 1-7: μ§μ μμ±
In 2008, Tesla Motors approached investors...
\section{Literature Review}
% Paragraph 8-10: μ§μ μμ±
The information economics tradition...
\section{Theory}
% Paragraph 11-13: μ§μ μμ±
Information and Real option value...
% ============================================
% Tier 2: λ°μλ (ν
νλ¦Ώ + κ°)
% ============================================
\section{Empirical Methodology}
% Paragraph 14-22: ν
νλ¦Ώ μ¬μ© (μ ν)
% \input{paper/methodology_auto.tex}
% λλ μλ + κ° μ°Έμ‘°
Our final sample comprises \VAR{n_total} ventures...
% ============================================
% Tier 1: μμ μλ β
% ============================================
\section{Results}
\input{paper/results_auto.tex} % Module #23-27 μμ μλ!
% ============================================
% Tier 3: μλ μμ±
% ============================================
\section{Discussion}
% Paragraph 28-32: μ§μ μμ±
Our findings reconcile...
\bibliographystyle{plainnat}
\bibliography{references}
\end{document}
```
---
## βοΈ κ³ κΈ κΈ°λ₯
### **μλ μ¬λΉλ (νμΌ λ³κ²½ κ°μ§)**
```bash
# νμΌ λ³κ²½ μ μλμΌλ‘ λ
Όλ¬Έ μ¬μ»΄νμΌ
make watch
# λλ (entr νμ):
ls paper/*.tex paper/tables/*.tex | entr make paper
```
### **CI/CD ν΅ν©**
```yaml
# .github/workflows/paper.yml
name: Build Paper
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make all
- uses: actions/upload-artifact@v3
with:
name: paper
path: paper/output/main.pdf
```
### **λ²μ κ΄λ¦¬**
```bash
# λ
Όλ¬Έ λ²μ λ³λ‘ μ€λ
μ· μ μ₯
make all
cp paper/output/main.pdf paper/versions/draft_v1_$(date +%Y%m%d).pdf
# Gitμ commit (PDF μ μΈ)
git add paper/results_auto.tex paper/tables/*.tex
git commit -m "Update Results section - H2 interaction now significant"
```
---
## π μ±κ³Ό μ§ν
### **μλ μμ
μ κ°**
**Before (μλ)**:
- Results μΉμ
μμ±: 2-3μκ°
- Table 1-2 LaTeX μμ±: 1-2μκ°
- κ³μ ν릴 νλ₯ : λμ
- λ°μ΄ν° λ°λλ©΄: μ²μλΆν° λ€μ
**After (μλ)**:
- Results μΉμ
: 2λΆ (`make analysis`)
- Tables: 1λΆ (`make tables`)
- κ³μ μ€λ₯: 0%
- λ°μ΄ν° λ°λλ©΄: `make quick` β 3λΆ
### **μ¬νμ± λ³΄μ₯**
```bash
# 리뷰μ΄κ° μ¬ν μμ²νλ©΄:
git clone https://github.com/user/paper.git
cd paper
make all
# 5λΆ ν β λκ°μ λ
Όλ¬Έ PDF μμ± β
```
---
## β FAQ
**Q: λͺ¨λ 32κ° λ¨λ½μ μλ μμ±ν μ μλμ?**
A: μλμ. **Results (Module #23-27)λ§ 100% μλ**μ
λλ€.
Introduction/Discussionμ μλ μμ± νμ (μ€ν 리ν
λ§/ν΄μ).
**Q: λ°μ΄ν°κ° λ°λλ©΄ μ΄λ»κ² νλμ?**
A:
```bash
make data # λ°μ΄ν° μ¬μ²λ¦¬
make quick # λΆμ+λ
Όλ¬Έ μ¬μμ±
```
3-5λΆμ΄λ©΄ μλ£.
**Q: λ
Όλ¬Έ ν
νλ¦Ώμ μ΄λ»κ² λ§λλμ?**
A: κΈ°μ‘΄ LaTeX λ
Όλ¬Έμμ μ«μ λΆλΆλ§ `\VAR{λ³μλͺ
}`μΌλ‘ κ΅μ²΄.
μ: `450 ventures` β `\VAR{n_total} ventures`
**Q: Figureλ μ΄λ»κ² μλννλμ?**
A: `src/plotting.py`μ κ·Έλ¦Ό μμ± ν¨μ μΆκ°:
```python
def generate_figure2(df):
# ... plotting code
plt.savefig('paper/figures/fig2.pdf')
```
**Q: CI/CDμμ λ
Όλ¬Έ μλ λΉλν μ μλμ?**
A: λ€! GitHub Actionsμμ `make all` μ€ν β PDF μλ μμ±.
---
## π Best Practices
### **1. Resultsλ μμ μλ, λλ¨Έμ§λ μλ**
```latex
% μ’μ μ:
\section{Results}
\input{paper/results_auto.tex} % μλ β
\section{Discussion}
% μ§μ μμ± (μλν μλ X)
```
### **2. μ€μν κ°λ§ JSONμΌλ‘ μ°Έμ‘°**
```latex
% main.texμμ
Our analysis of {{ n_total }} companies reveals
that vagueness reduces early funding by {{ h1_coef_abs }}%.
% λλ¨Έμ§ ν
μ€νΈλ μλ μμ±
```
### **3. λ²μ κ΄λ¦¬λ μμ€λ§, PDFλ μ μΈ**
```bash
# .gitignore
paper/output/*.pdf
paper/output/*.aux
```
### **4. ν
μ€νΈλ‘ λ
Όλ¬Έ κ° κ²μ¦**
```bash
# λ
Όλ¬Έ μ μΆ μ νμ
make test
make validate
```
---
## π Next Steps
1. **μ§κΈ λ°λ‘ μλ**:
```bash
make all
```
2. **Results μΉμ
νμΈ**:
```bash
cat paper/results_auto.tex
```
3. **λ
Όλ¬Έμ ν΅ν©**:
```latex
% paper/main.texμ μΆκ°
\input{paper/results_auto.tex}
```
4. **μ»΄νμΌ & νμΈ**:
```bash
make paper
open paper/output/main.pdf
```
---
**λ¬Έμ**: μ΄ κ°μ΄λλ `docs/PAPER_INTEGRATION_STRATEGY.md`μ ν¨κ» μ½μ΄μ£ΌμΈμ.