python-pptx-2-advanced-text-formatting

Sub-skill of python-pptx: 2. Advanced Text Formatting.

5 stars

Best use case

python-pptx-2-advanced-text-formatting is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Sub-skill of python-pptx: 2. Advanced Text Formatting.

Teams using python-pptx-2-advanced-text-formatting should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/2-advanced-text-formatting/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_archive/data/office/python-pptx/2-advanced-text-formatting/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/2-advanced-text-formatting/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How python-pptx-2-advanced-text-formatting Compares

Feature / Agentpython-pptx-2-advanced-text-formattingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Sub-skill of python-pptx: 2. Advanced Text Formatting.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 2. Advanced Text Formatting

## 2. Advanced Text Formatting


```python
"""
Advanced text formatting with runs, fonts, and paragraph styles.
"""
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.dml.color import RgbColor
from pptx.oxml.ns import nsmap

def create_formatted_presentation(output_path: str) -> None:
    """Create presentation with advanced text formatting."""
    prs = Presentation()

    # Slide with formatted text
    slide_layout = prs.slide_layouts[6]  # Blank
    slide = prs.slides.add_slide(slide_layout)

    # Title with formatting
    title_box = slide.shapes.add_textbox(
        Inches(0.5), Inches(0.3),
        Inches(12), Inches(1)
    )
    tf = title_box.text_frame

    p = tf.paragraphs[0]
    p.alignment = PP_ALIGN.CENTER

    # Multiple runs with different formatting
    run1 = p.add_run()
    run1.text = "Quarterly "
    run1.font.size = Pt(40)
    run1.font.bold = True
    run1.font.color.rgb = RgbColor(0x2F, 0x54, 0x96)

    run2 = p.add_run()
    run2.text = "Performance"
    run2.font.size = Pt(40)
    run2.font.bold = True
    run2.font.color.rgb = RgbColor(0x70, 0xAD, 0x47)

    run3 = p.add_run()
    run3.text = " Report"
    run3.font.size = Pt(40)
    run3.font.bold = True
    run3.font.color.rgb = RgbColor(0x2F, 0x54, 0x96)

    # Formatted paragraph with various styles
    content_box = slide.shapes.add_textbox(
        Inches(0.75), Inches(1.5),
        Inches(11.5), Inches(5)
    )
    tf = content_box.text_frame
    tf.word_wrap = True

    # Paragraph 1: Bold heading
    p1 = tf.paragraphs[0]
    p1.text = "Executive Summary"
    p1.font.size = Pt(24)
    p1.font.bold = True
    p1.space_after = Pt(12)

    # Paragraph 2: Normal text
    p2 = tf.add_paragraph()
    p2.text = (
        "This quarter demonstrated strong performance across all metrics. "
        "Revenue increased by 15% year-over-year, driven by expansion in "
        "key markets and improved customer retention."
    )
    p2.font.size = Pt(16)
    p2.space_after = Pt(18)
    p2.line_spacing = 1.5

    # Paragraph 3: Highlighted text
    p3 = tf.add_paragraph()
    p3.text = "Key Achievement: "
    p3.font.size = Pt(18)
    p3.font.bold = True
    p3.font.color.rgb = RgbColor(0xC0, 0x00, 0x00)

    run = p3.add_run()
    run.text = "Achieved 120% of quarterly target"
    run.font.size = Pt(18)
    run.font.italic = True

    # Paragraph 4: Subscript and superscript
    p4 = tf.add_paragraph()
    p4.space_before = Pt(18)

    run = p4.add_run()
    run.text = "Formula example: H"
    run.font.size = Pt(16)

    sub = p4.add_run()
    sub.text = "2"
    sub.font.size = Pt(12)
    sub.font._element.set(
        '{http://schemas.openxmlformats.org/drawingml/2006/main}baseline', '-25000'
    )

    run = p4.add_run()
    run.text = "O and E=mc"
    run.font.size = Pt(16)

    sup = p4.add_run()
    sup.text = "2"
    sup.font.size = Pt(12)
    sup.font._element.set(
        '{http://schemas.openxmlformats.org/drawingml/2006/main}baseline', '30000'
    )

    # Bullet list with custom formatting
    bullet_box = slide.shapes.add_textbox(
        Inches(0.75), Inches(5),
        Inches(11.5), Inches(2)
    )
    tf = bullet_box.text_frame

    p = tf.paragraphs[0]
    p.text = "Key Metrics:"
    p.font.size = Pt(18)
    p.font.bold = True

    bullets = [
        ("Revenue", "$12.5M", "up 15%"),
        ("Customers", "45,000", "up 8%"),
        ("NPS Score", "72", "up 5 points"),
    ]

    for metric, value, change in bullets:
        p = tf.add_paragraph()
        p.level = 0

        run = p.add_run()
        run.text = f"{metric}: "
        run.font.size = Pt(14)
        run.font.bold = True

        run = p.add_run()
        run.text = f"{value} "
        run.font.size = Pt(14)

        run = p.add_run()
        run.text = f"({change})"
        run.font.size = Pt(14)
        run.font.color.rgb = RgbColor(0x00, 0x80, 0x00)

    prs.save(output_path)
    print(f"Formatted presentation saved to {output_path}")


create_formatted_presentation("formatted_presentation.pptx")
```

Related Skills

context-compaction-handoff

5
from vamseeachanta/workspace-hub

Guardrails for resuming work after context compaction or transcript handoff blocks; prioritize the latest real user request over stale summarized tasks and verify before answering.

python-import-path-mismatch-debugging

5
from vamseeachanta/workspace-hub

Diagnose and fix ModuleNotFoundError when a package is installed but imports still fail due to environment/path mismatches

python-import-path-debugging

5
from vamseeachanta/workspace-hub

Diagnose ModuleNotFoundError when a package is installed but still fails to import

python-debugpy

5
from vamseeachanta/workspace-hub

Debug Python: pdb REPL + debugpy remote (DAP).

wiki-context

5
from vamseeachanta/workspace-hub

Auto-query llm-wiki domains for relevant context before executing domain tasks

python-project-template

5
from vamseeachanta/workspace-hub

Generate standardized Python project structure with pyproject.toml, UV environment, pytest configuration, and workspace-hub compliance. Creates production-ready project scaffolding.

xlsx-to-python

5
from vamseeachanta/workspace-hub

Convert Excel calculation spreadsheets to Python code — extract formulas, build dependency graphs, generate pytest tests using cell values as assertions, and produce dark-intelligence archive YAMLs.

excel-workbook-to-python-v2

5
from vamseeachanta/workspace-hub

Convert engineering Excel workbooks to Python code using Codex Desktop cowork on Windows. Proven superior quality vs Linux openpyxl extraction (24 vs 7 functions, 81 vs 53 tests). Validated on Ballymore jumper installation analysis.

pptx

5
from vamseeachanta/workspace-hub

PowerPoint presentation toolkit for creating new presentations, editing existing ones, and using templates. Supports HTML-to-PPTX conversion, slide manipulation, and professional design. Use when building presentations, slide decks, or visual reports.

pdf-text-extractor-readability-classification

5
from vamseeachanta/workspace-hub

Sub-skill of pdf-text-extractor: Readability Classification.

pdf-text-extractor

5
from vamseeachanta/workspace-hub

Extract text from PDF files with intelligent chunking and metadata preservation. For batch extraction (1K+ PDFs), use pdftotext (poppler) via subprocess — see pdf skill Tool Selection table. For single-doc quality, use Codex or PyMuPDF. Supports technical documents, standards libraries, research papers, or any PDF collection.

pdf-pdftotext-poppler

5
from vamseeachanta/workspace-hub

Sub-skill of pdf: pdftotext (Poppler) (+2).