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 requests library
  • code2prompt (already installed at /home/barker/.cargo/bin/code2prompt)
  • Access to Gemini 2.5 Pro API (via MCP)

How it works

  1. Downloads arXiv source: Fetches the full LaTeX source files for the given arXiv ID
  2. Structures with code2prompt: Converts the LaTeX sources into a structured prompt format
  3. Generates blog post: Uses Gemini 2.5 Pro to write a physics blog post based on the paper
  4. 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:

  1. Download sources for arXiv:2301.12345
  2. Process them with code2prompt
  3. Generate a blog post with Gemini
  4. Output the complete blog post text

The output is ready for later conversion into Jekyll markdown format for the blog.