Physics Blog Post Generator
Physics Blog Post Generator
This tool automatically generates blog posts about arXiv papers using Gemini 2.5 Pro. It downloads the full LaTeX sources, structures them with code2prompt, and generates physics-focused blog content.
Usage
# Using the bash wrapper (recommended)
./generate_blog 2301.12345
# Or directly with Python
python3 generate_blog_post.py 2301.12345
Requirements
- Python 3 with
requestslibrary code2prompt(already installed at/home/barker/.cargo/bin/code2prompt)- Access to Gemini 2.5 Pro API (via MCP)
How it works
- Downloads arXiv source: Fetches the full LaTeX source files for the given arXiv ID
- Structures with code2prompt: Converts the LaTeX sources into a structured prompt format
- Generates blog post: Uses Gemini 2.5 Pro to write a physics blog post based on the paper
- Outputs free text: Results can later be converted to markdown blog post format
Output Format
The tool outputs free text suitable for physicists (not necessarily experts in the specific topic):
- Less formal/technical than an abstract
- More technical than popular science articles
- ~800-1000 words
- May include LaTeX equations and external links
- Structured with clear headings
Example
./generate_blog 2301.12345
This will:
- Download sources for arXiv:2301.12345
- Process them with code2prompt
- Generate a blog post with Gemini
- Output the complete blog post text
The output is ready for later conversion into Jekyll markdown format for the blog.