A professional, template-based workflow for automatically adding citations to academic manuscripts and generating properly formatted outputs using Pandoc with AMA citation style.
# Initialize a new project
make init
# Edit your manuscript and references
# manuscript.md - your content
# reference.bib - your bibliography
# Generate outputs
make allacademic-manuscript-workflow/
βββ π manuscript.md # Working manuscript (created from template)
βββ π reference.bib # Bibliography (created from template)
βββ π CLAUDE.md # Claude Code LLM instructions
βββ π Makefile # Automation workflow
βββ π README.md # This file
βββ π« .gitignore # Git ignore patterns
βββ βοΈ pyproject.toml # Python project configuration
β
βββ π scripts/ # Utility scripts
β βββ π validate_references.py # DOI/URL validation script
β βββ π ama.csl # AMA citation style (auto-downloaded)
β
βββ π output/ # Generated files (ignored by git)
β βββ π manuscript.html # HTML output with citations
β βββ π manuscript.docx # Word document output
β βββ π log.txt # Validation results
β
βββ π Templates (for new projects):
βββ manuscript.template.md # Manuscript template
βββ reference.template.bib # Bibliography template
Required Tools:
Installation:
# macOS
brew install pandoc
# Install uv (cross-platform)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Verify installation
make check-depsmake init # Initialize new project from templates
make status # Show project status and missing files
make check-deps # Check required tools are installed
make help # Show all available commandsmake all # Check files, validate, and convert (default)
make validate # Validate DOIs and URLs in bibliography
make convert # Convert to HTML and DOCX with AMA citationsmake setup # Setup Python environment
make clean # Remove output files
make clean-all # Remove outputs and downloaded files
make reset # Reset to template state (β οΈ destructive)
make full # Complete workflow from clean statemake example # Create example project with sample content
make watch # Auto-rebuild on file changes (requires entr)
make dev-validate # Run validation without uv
make dev-convert # Run conversion in development modemake initThis creates manuscript.md and reference.bib from templates.
manuscript.md - Write your manuscript with citations:
# Your Title
Breast cancer affects millions worldwide [@Smith2024].
Recent studies show improved outcomes [@Jones2023; @Brown2022].reference.bib - Add your references:
@article{Smith2024,
title={Recent Advances in Cancer Treatment},
author={Smith, Jane and Doe, John},
journal={Journal of Oncology},
year={2024},
doi={10.1000/example}
}make allCreates HTML and DOCX files in the output/ directory with:
- β Numbered AMA-style citations
- β Complete bibliography
- β Validated DOIs and URLs
- AMA Style: Numbered superscripts with Vancouver bibliography
- Multiple Formats: Support for journal articles, books, conferences, web resources
- DOI Validation: Automatic checking of DOI resolution
- URL Verification: Validates accessibility of all URLs
- HTML: Web-ready with linked citations and references
- DOCX: Microsoft Word compatible for collaboration and editing
- Professional Formatting: Clean, publication-ready appearance
- Template System: Start new projects instantly
- Dependency Management: Automatic Python environment setup
- File Validation: Ensures all required files exist
- Error Handling: Clear messages and recovery suggestions
- Reference Validation: Checks DOI resolution and URL accessibility
- Comprehensive Logging: Detailed validation results with timestamps
- Git Integration: Proper .gitignore excludes generated files
Single citation: Recent studies show progress [@Smith2024].
Multiple: Several studies confirm this [@Smith2024; @Jones2023].
Inline: Smith et al. [@Smith2024] demonstrated significant improvements.- Journal articles with DOI
- Books and edited volumes
- Conference proceedings
- Government reports
- Web resources and databases
- Preprints (bioRxiv, arXiv)
- Clinical trial registrations
In-text: Recent advances in treatmentΒΉ show promising resultsΒ²,Β³.
Bibliography:
- Smith J, Doe J. Recent advances in cancer treatment. J Oncol. 2024;15(3):123-145.
- Jones A, Brown B. Clinical outcomes in modern therapy. Cancer Res. 2023;45(2):67-89.
# Download a different CSL style
curl -o scripts/nature.csl https://raw.githubusercontent.com/citation-style-language/styles/master/nature.csl
# Update Makefile CSL_STYLE variable
# Then run: make convertModify manuscript.template.md and reference.template.bib to customize templates for new projects.
Extend scripts/validate_references.py to add custom validation rules:
- Journal name validation
- Author ORCID verification
- Retraction checking
- Impact factor inclusion
| Issue | Solution |
|---|---|
| Missing dependencies | make check-deps |
| Files not found | make status then make init |
| 403 validation errors | Normal - publisher bot protection |
| Python environment issues | make setup |
| Pandoc conversion failures | Check manuscript syntax |
make statusShows project structure and file availability.
Check output/log.txt for detailed validation results. 403 errors are common due to publisher anti-bot measures but don't indicate invalid references.
make init
# Creates structured academic paper template with:
# - Abstract, Introduction, Methods, Results, Discussion
# - Proper citation placeholders
# - Example bibliography entriesmake example
# Creates working example with:
# - Breast cancer treatment manuscript
# - 13 real academic references
# - Demonstrates all features- Fork the repository
- Create feature branch:
git checkout -b feature/new-style - Add new citation styles or validation features
- Test with
make full - Submit pull request
- Add new output formats (PDF, LaTeX)
- Integrate with reference managers (Zotero, Mendeley)
- Add journal-specific citation styles
- Implement automated reference searching
This project is designed for educational and research purposes. Please ensure compliance with publisher terms of service when using automated reference validation.
- Pandoc - Universal document converter
- Citation Style Language - Open citation style repository
- uv - Modern Python package management
- AMA Manual of Style - Citation format specification
Generated with Claude Code - A professional academic writing workflow with automated citation management.
- β Template-based initialization
- β AMA citation style implementation
- β Multi-format output generation
- β Reference validation system
- β Structured project organization
- β Comprehensive documentation
- β Git integration and workflow automation