Ppt on migrane of 40 slides from Bradley and Adam neurology all clean white slides

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/migraine-ppt && ls /tmp/workspace/migraine-ppt/

Writing File

~/migraine-ppt/build_ppt.py

from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
from io import BytesIO

# ── Colours ──────────────────────────────────────────────────────────────────
WHITE      = RGBColor(0xFF, 0xFF, 0xFF)
NAVY       = RGBColor(0x1A, 0x3A, 0x5C)   # deep navy – headings / accent bar
MID_BLUE   = RGBColor(0x2E, 0x74, 0xB5)   # body bullet accent
LIGHT_GREY = RGBColor(0xF2, 0xF2, 0xF2)   # section-divider bg
DARK_GREY  = RGBColor(0x40, 0x40, 0x40)   # body text

prs = Presentation()
prs.slide_width  = Inches(13.333)
prs.slide_height = Inches(7.5)

blank = prs.slide_layouts[6]   # fully blank – we place everything

# ── Helper: coloured rectangle ───────────────────────────────────────────────
def add_rect(slide, x, y, w, h, colour):
    from pptx.util import Inches, Pt
    shape = slide.shapes.add_shape(
        1,  # MSO_SHAPE_TYPE.RECTANGLE
        Inches(x), Inches(y), Inches(w), Inches(h)
    )
    shape.fill.solid()
    shape.fill.fore_color.rgb = colour
    shape.line.fill.background()
    return shape

# ── Helper: textbox ──────────────────────────────────────────────────────────
def add_textbox(slide, text, x, y, w, h,
                font_name="Calibri", size=18, bold=False,
                colour=DARK_GREY, align=PP_ALIGN.LEFT,
                wrap=True, italic=False):
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = wrap
    tf.margin_left  = Pt(0)
    tf.margin_right = Pt(0)
    tf.margin_top   = Pt(0)
    tf.margin_bottom= Pt(0)
    p  = tf.paragraphs[0]
    p.alignment = align
    r  = p.add_run()
    r.text = text
    r.font.name  = font_name
    r.font.size  = Pt(size)
    r.font.bold  = bold
    r.font.italic= italic
    r.font.color.rgb = colour
    return tf

# ── Helper: multi-bullet textbox ─────────────────────────────────────────────
def add_bullets(slide, items, x, y, w, h,
                font_name="Calibri", size=16,
                colour=DARK_GREY, line_spacing_pt=None):
    from pptx.oxml.ns import qn
    from lxml import etree
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left   = Pt(4)
    tf.margin_right  = Pt(0)
    tf.margin_top    = Pt(2)
    tf.margin_bottom = Pt(2)
    first = True
    for item in items:
        if first:
            p = tf.paragraphs[0]
            first = False
        else:
            p = tf.add_paragraph()
        p.space_before = Pt(4)
        bullet_char = "•  "
        r = p.add_run()
        r.text = bullet_char + item
        r.font.name  = font_name
        r.font.size  = Pt(size)
        r.font.color.rgb = colour
    return tf

# ── Helper: section divider slide ────────────────────────────────────────────
def section_slide(title_text, subtitle_text=""):
    slide = prs.slides.add_slide(blank)
    # Full navy background
    add_rect(slide, 0, 0, 13.333, 7.5, NAVY)
    # Centre title
    add_textbox(slide, title_text, 1.0, 2.8, 11.333, 1.2,
                size=40, bold=True, colour=WHITE, align=PP_ALIGN.CENTER)
    if subtitle_text:
        add_textbox(slide, subtitle_text, 1.0, 4.15, 11.333, 0.8,
                    size=20, colour=RGBColor(0xBD, 0xD7, 0xEE),
                    align=PP_ALIGN.CENTER)

# ── Helper: content slide ─────────────────────────────────────────────────────
def content_slide(title_text, bullets, source_tag=""):
    slide = prs.slides.add_slide(blank)
    # White background (default) – accent bar top
    add_rect(slide, 0, 0, 13.333, 0.12, NAVY)
    # Title bar
    add_rect(slide, 0, 0.12, 13.333, 0.95, LIGHT_GREY)
    add_textbox(slide, title_text, 0.25, 0.13, 12.8, 0.94,
                size=24, bold=True, colour=NAVY, align=PP_ALIGN.LEFT)
    # Thin separator line
    add_rect(slide, 0.25, 1.1, 12.8, 0.03, MID_BLUE)
    # Bullets
    add_bullets(slide, bullets, 0.35, 1.2, 12.6, 5.9, size=17)
    # Source tag bottom-right
    if source_tag:
        add_textbox(slide, source_tag, 9.0, 7.1, 4.0, 0.35,
                    size=10, italic=True,
                    colour=RGBColor(0x90, 0x90, 0x90),
                    align=PP_ALIGN.RIGHT)

# ── Helper: two-column slide ─────────────────────────────────────────────────
def two_col_slide(title_text, left_items, right_items,
                  left_head="", right_head="", source_tag=""):
    slide = prs.slides.add_slide(blank)
    add_rect(slide, 0, 0, 13.333, 0.12, NAVY)
    add_rect(slide, 0, 0.12, 13.333, 0.95, LIGHT_GREY)
    add_textbox(slide, title_text, 0.25, 0.13, 12.8, 0.94,
                size=24, bold=True, colour=NAVY)
    add_rect(slide, 0.25, 1.1, 12.8, 0.03, MID_BLUE)
    # column divider
    add_rect(slide, 6.55, 1.2, 0.03, 5.9, LIGHT_GREY)
    if left_head:
        add_textbox(slide, left_head, 0.35, 1.18, 6.0, 0.45,
                    size=14, bold=True, colour=MID_BLUE)
    if right_head:
        add_textbox(slide, right_head, 6.7, 1.18, 6.0, 0.45,
                    size=14, bold=True, colour=MID_BLUE)
    y_start = 1.65 if (left_head or right_head) else 1.2
    add_bullets(slide, left_items,  0.35, y_start, 6.1, 5.6, size=16)
    add_bullets(slide, right_items, 6.7,  y_start, 6.1, 5.6, size=16)
    if source_tag:
        add_textbox(slide, source_tag, 9.0, 7.1, 4.0, 0.35,
                    size=10, italic=True,
                    colour=RGBColor(0x90, 0x90, 0x90),
                    align=PP_ALIGN.RIGHT)

# ── Helper: table slide ───────────────────────────────────────────────────────
def table_slide(title_text, headers, rows, source_tag=""):
    from pptx.util import Inches, Pt
    slide = prs.slides.add_slide(blank)
    add_rect(slide, 0, 0, 13.333, 0.12, NAVY)
    add_rect(slide, 0, 0.12, 13.333, 0.95, LIGHT_GREY)
    add_textbox(slide, title_text, 0.25, 0.13, 12.8, 0.94,
                size=24, bold=True, colour=NAVY)
    add_rect(slide, 0.25, 1.1, 12.8, 0.03, MID_BLUE)

    cols = len(headers)
    col_w = [Inches(12.8 / cols)] * cols
    table = slide.shapes.add_table(
        len(rows) + 1, cols,
        Inches(0.27), Inches(1.25),
        Inches(12.8), Inches(5.8)
    ).table

    # Header row
    for ci, h in enumerate(headers):
        cell = table.cell(0, ci)
        cell.fill.solid(); cell.fill.fore_color.rgb = NAVY
        p = cell.text_frame.paragraphs[0]
        p.alignment = PP_ALIGN.CENTER
        r = p.add_run(); r.text = h
        r.font.name = "Calibri"; r.font.size = Pt(14)
        r.font.bold = True; r.font.color.rgb = WHITE

    # Data rows
    for ri, row in enumerate(rows):
        bg = WHITE if ri % 2 == 0 else LIGHT_GREY
        for ci, val in enumerate(row):
            cell = table.cell(ri + 1, ci)
            cell.fill.solid(); cell.fill.fore_color.rgb = bg
            p = cell.text_frame.paragraphs[0]
            r = p.add_run(); r.text = str(val)
            r.font.name = "Calibri"; r.font.size = Pt(13)
            r.font.color.rgb = DARK_GREY

    if source_tag:
        add_textbox(slide, source_tag, 9.0, 7.1, 4.0, 0.35,
                    size=10, italic=True,
                    colour=RGBColor(0x90, 0x90, 0x90),
                    align=PP_ALIGN.RIGHT)

# =============================================================================
# SLIDE CONTENT
# =============================================================================

B = "Bradley & Daroff's Neurology in Clinical Practice"
A = "Adams & Victor's Principles of Neurology, 12e"
BA = "Bradley & Daroff / Adams & Victor"

# ── SLIDE 1: Title ────────────────────────────────────────────────────────────
slide1 = prs.slides.add_slide(blank)
add_rect(slide1, 0, 0, 13.333, 7.5, WHITE)
add_rect(slide1, 0, 0, 13.333, 0.15, NAVY)
add_rect(slide1, 0, 7.35, 13.333, 0.15, NAVY)
# Decorative left bar
add_rect(slide1, 0, 0.15, 0.5, 7.2, NAVY)
add_rect(slide1, 0.5, 0.15, 0.08, 7.2, MID_BLUE)
add_textbox(slide1, "MIGRAINE", 1.0, 1.5, 11.8, 1.8,
            size=60, bold=True, colour=NAVY, align=PP_ALIGN.LEFT)
add_textbox(slide1,
            "A Comprehensive Review",
            1.0, 3.4, 11.8, 0.7, size=26, colour=MID_BLUE, align=PP_ALIGN.LEFT)
add_textbox(slide1,
            "Based on Bradley & Daroff's Neurology in Clinical Practice\n"
            "and Adams & Victor's Principles of Neurology, 12th Edition",
            1.0, 4.3, 11.8, 1.0, size=16, italic=True,
            colour=DARK_GREY, align=PP_ALIGN.LEFT)

# ── SLIDE 2: Table of Contents ────────────────────────────────────────────────
content_slide(
    "Table of Contents",
    [
        "1.  Definition & Historical Perspective",
        "2.  Epidemiology",
        "3.  Classification (ICHD-3)",
        "4.  Phases of Migraine Attack",
        "5.  Migraine with Aura – Clinical Features",
        "6.  Migraine without Aura – Clinical Features",
        "7.  Pathophysiology – Overview",
        "8.  Cortical Spreading Depression",
        "9.  Trigeminovascular System",
        "10. Genetics of Migraine",
        "11. Migraine Variants",
        "12. Chronic Migraine",
        "13. Diagnosis & Differential Diagnosis",
        "14. Acute / Abortive Treatment",
        "15. Preventive Treatment",
        "16. Special Populations & Comorbidities",
    ],
    BA
)

# ── SECTION DIVIDER ───────────────────────────────────────────────────────────
section_slide("SECTION 1", "Definition, Epidemiology & Classification")

# ── SLIDE 3: Definition ───────────────────────────────────────────────────────
content_slide(
    "Definition of Migraine",
    [
        'The word "migraine" derives from ancient Greek hemikranios – "half head"',
        "Unilateral head pain is present in ~60–75% of patients (Kelman, 2005)",
        "Adams & Victor: a prevalent, largely familial disorder of periodic, commonly unilateral, usually pulsatile headaches",
        "Often begins in childhood, adolescence, or early adult life; recurs with diminishing frequency with age",
        "Attack consists of up to four phases: premonitory, aura, headache, postdrome",
        "Core features: throbbing headache, nausea/vomiting, photophobia, phonophobia",
        "WHO has declared migraine among the most disabling medical conditions worldwide",
    ],
    BA
)

# ── SLIDE 4: Epidemiology 1 ───────────────────────────────────────────────────
content_slide(
    "Epidemiology – Prevalence & Burden",
    [
        "1-year prevalence ~12% overall (18% women, 6% men) – Lipton et al., 2007",
        "Global Burden of Disease Study: ~15% 1-year prevalence worldwide (Stovner, 2018)",
        "Estimated 27.9 million migraine patients in the United States alone",
        ">90% report impaired function during attacks; 53% require bed rest",
        "31% missed ≥1 day from work/school in preceding 3 months",
        "Indirect economic costs: ~$13 billion/year in the US; equivalent of 112 million bedridden days/year",
        "Lifetime prevalence: ~33% in women, ~13% in men (Launer et al., 1999)",
    ],
    B
)

# ── SLIDE 5: Epidemiology 2 ───────────────────────────────────────────────────
two_col_slide(
    "Epidemiology – Demographics",
    [
        "Peak prevalence in 4th decade of life",
        "~24% of women and ~7% of men affected at peak",
        "Prepubescent boys and girls equally affected",
        "At puberty: sharp increase, especially in girls",
        "Onset before age 30 in >80% of patients",
        "Migraines typically milder and less frequent in later life",
    ],
    [
        "US ethnic differences (women / men):",
        "  White: ~20% / ~9%",
        "  African origin: ~16% / ~7%",
        "  Asian origin: ~9% / ~4%",
        "First-degree relatives of MwoA patients: 2× risk of MwoA",
        "First-degree relatives of MwA patients: 4× risk of MwA (Russell & Olesen, 1995)",
        "Strong familial aggregation – genetic predisposition established",
    ],
    "Demographics", "Genetic Risk",
    BA
)

# ── SLIDE 6: Classification ───────────────────────────────────────────────────
content_slide(
    "ICHD-3 Classification of Migraine (IHS, 2018)",
    [
        "1.1  Migraine without aura (common migraine) – most prevalent form",
        "1.2  Migraine with aura (classic migraine)",
        "       1.2.1 Migraine with typical aura",
        "       1.2.2 Migraine with brainstem aura (basilar migraine)",
        "       1.2.3 Hemiplegic migraine (familial / sporadic)",
        "       1.2.4 Retinal migraine",
        "1.3  Chronic migraine – headaches ≥15 days/month, ≥8 with migraine features",
        "1.4  Complications of migraine (status migrainosus, persistent aura, etc.)",
        "1.5  Probable migraine",
        "Ratio of classic (MwA) to common (MwoA) ≈ 1:5",
        "Same individual may experience both forms over their lifetime",
    ],
    BA
)

# ── SECTION DIVIDER ───────────────────────────────────────────────────────────
section_slide("SECTION 2", "Clinical Features – Phases & Subtypes")

# ── SLIDE 7: Premonitory Phase ────────────────────────────────────────────────
content_slide(
    "Phase 1 – Premonitory (Prodrome)",
    [
        "Occurs hours to days before the headache",
        "Present in ~60–80% of migraineurs (varies by study)",
        "Symptoms reflect hypothalamic and limbic dysfunction:",
        "  – Mood changes: depression, irritability, euphoria",
        "  – Cognitive: difficulty concentrating, yawning",
        "  – Autonomic: food cravings (especially chocolate/sweet foods), thirst, polyuria",
        "  – Neck stiffness or discomfort",
        "  – Fatigue, hypersensitivity to light and sound",
        "Recognition allows early administration of abortive therapy",
        "Dopaminergic activation of hypothalamus thought to be responsible",
    ],
    B
)

# ── SLIDE 8: Aura Phase ───────────────────────────────────────────────────────
content_slide(
    "Phase 2 – Aura",
    [
        "Present in ~25–30% of migraineurs (MwA)",
        "Develops gradually over ≥5 minutes; each symptom lasts 5–60 minutes",
        "Visual aura (most common, ~90% of auras):",
        "  – Scintillating scotoma: shimmering arc of zig-zag light (fortification spectrum)",
        "  – Homonymous visual disturbance, expanding across visual field",
        "Sensory aura: unilateral paresthesiae spreading from hand → face",
        "Motor aura: rare – weakness (hemiplegic migraine)",
        "Speech aura: dysphasia / aphasia – less common",
        "Aura typically precedes headache by 20–60 minutes; may occur without headache",
        "Cortical spreading depression (CSD) is the underlying mechanism",
    ],
    BA
)

# ── SLIDE 9: Headache Phase ───────────────────────────────────────────────────
content_slide(
    "Phase 3 – Headache",
    [
        "Duration: 4–72 hours (untreated or unsuccessfully treated)",
        "Unilateral in 60–75%; bilateral or holocranial in remainder",
        "Quality: throbbing / pulsatile in majority",
        "Severity: moderate to severe; worsened by routine physical activity",
        "Associated symptoms (ICHD-3 criteria):",
        "  – Nausea and/or vomiting (most patients)",
        "  – Photophobia (light sensitivity)",
        "  – Phonophobia (sound sensitivity)",
        "  – Osmophobia: highly specific for migraine when present (Chalmer et al., 2018)",
        "  – Cutaneous allodynia: hypersensitivity of scalp/skin – sign of central sensitisation",
        "Patient prefers to lie in a dark, quiet room and tries to sleep",
    ],
    BA
)

# ── SLIDE 10: Postdrome ───────────────────────────────────────────────────────
content_slide(
    "Phase 4 – Postdrome",
    [
        'Often called the "migraine hangover"',
        "Occurs after resolution of headache in majority of patients",
        "Duration: hours to ~24 hours",
        "Symptoms include:",
        "  – Fatigue, exhaustion",
        "  – Cognitive fog ('brain fog') – difficulty concentrating",
        "  – Mood changes: depression or, paradoxically, euphoria",
        "  – Residual head tenderness / soreness at prior pain site",
        "  – Continued photosensitivity and sensitivity to movement",
        "Reflects gradual return of cortical excitability to baseline",
        "Often underappreciated and underreported – contributes substantially to disability",
    ],
    B
)

# ── SLIDE 11: MwoA Diagnostic Criteria ───────────────────────────────────────
content_slide(
    "Migraine without Aura – ICHD-3 Diagnostic Criteria",
    [
        "A. ≥5 attacks fulfilling criteria B–D",
        "B. Headache attacks lasting 4–72 hours (untreated/unsuccessfully treated)",
        "C. At least 2 of the following characteristics:",
        "   1. Unilateral location",
        "   2. Pulsating quality",
        "   3. Moderate or severe pain intensity",
        "   4. Aggravation by or causing avoidance of routine physical activity",
        "D. During headache ≥1 of the following:",
        "   1. Nausea and/or vomiting",
        "   2. Photophobia AND phonophobia",
        "E. Not better accounted for by another ICHD-3 diagnosis",
    ],
    B
)

# ── SLIDE 12: MwA Diagnostic Criteria ────────────────────────────────────────
content_slide(
    "Migraine with Aura – ICHD-3 Diagnostic Criteria",
    [
        "A. ≥2 attacks fulfilling criteria B and C",
        "B. ≥1 of the following fully reversible aura symptoms:",
        "   1. Visual",
        "   2. Sensory",
        "   3. Speech and/or language",
        "   4. Motor",
        "   5. Brainstem",
        "   6. Retinal",
        "C. ≥3 of the following 6 characteristics:",
        "   – ≥1 aura symptom spreading gradually over ≥5 min",
        "   – ≥2 aura symptoms occurring in succession",
        "   – Each aura symptom lasts 5–60 min",
        "   – ≥1 aura symptom is unilateral",
        "   – ≥1 aura symptom is positive",
        "   – Aura accompanied/followed by headache within 60 min",
    ],
    B
)

# ── SECTION DIVIDER ───────────────────────────────────────────────────────────
section_slide("SECTION 3", "Pathophysiology")

# ── SLIDE 13: Pathophysiology Overview ───────────────────────────────────────
content_slide(
    "Pathophysiology – Overview",
    [
        "Migraine is a neurovascular disorder – abnormal brain excitability + vascular changes",
        "Three key mechanisms interact:",
        "  1. Cortical Spreading Depression (CSD) – generates aura",
        "  2. Trigeminovascular activation – generates headache pain",
        "  3. Central sensitisation – mediates allodynia and chronification",
        "Hypothalamic dysfunction: orchestrates premonitory phase",
        "Brainstem (PAG, locus coeruleus, raphe nuclei) modulates pain processing",
        "Serotonin (5-HT) plays a pivotal role in migraine pathogenesis",
        "CGRP (calcitonin gene-related peptide) is a key neuropeptide in headache generation",
        "Inflammatory neuropeptides released around meningeal vessels",
    ],
    BA
)

# ── SLIDE 14: Cortical Spreading Depression ───────────────────────────────────
content_slide(
    "Cortical Spreading Depression (CSD)",
    [
        "First described by Leão (1944) in experimental animals",
        "CSD is a slowly propagating wave (~3 mm/min) of neuronal and glial depolarisation",
        "Spreads across the cortex, preceded by a brief excitatory phase, followed by sustained suppression",
        "In occipital cortex: corresponds to the visual aura (scintillating scotoma travels across visual field)",
        "CSD triggers trigeminal activation via meningeal afferents – linking aura to headache",
        "Functional MRI shows 'blood flow changes' concordant with CSD propagation during spontaneous aura",
        "Propagation follows cortical topology – explains the spreading nature of sensory aura",
        "Animal models: CSD activates trigeminocervical complex neurons",
        "CSD may sensitise peripheral and central trigeminal neurons",
    ],
    BA
)

# ── SLIDE 15: Trigeminovascular System ────────────────────────────────────────
content_slide(
    "Trigeminovascular System",
    [
        "Meningeal blood vessels are innervated by trigeminal C-fibre afferents (1st division, V1)",
        "CSD and other triggers activate trigeminal ganglia → release of CGRP, substance P, neurokinin A",
        "Neurogenic inflammation: vasodilation, plasma protein extravasation, mast cell degranulation",
        "Pain signals ascend via trigeminal nucleus caudalis (TNC) → thalamus → cortex",
        "TNC in medulla serves as the 'trigeminocervical complex' (extends to C1–C2)",
        "Central sensitisation in TNC explains: photophobia, phonophobia, cutaneous allodynia",
        "CGRP concentrations elevated in jugular venous blood during migraine attacks",
        "Anti-CGRP therapies (gepants, monoclonal antibodies) are highly effective – validates this pathway",
        "5-HT1B/1D receptor agonists (triptans) inhibit CGRP release and cause meningeal vasoconstriction",
    ],
    BA
)

# ── SLIDE 16: CSD & Neurovascular Coupling ────────────────────────────────────
content_slide(
    "Neuroinflammation & Central Sensitisation",
    [
        "Peripheral sensitisation: sustained activation of meningeal nociceptors → allodynia of pericranial area",
        "Central sensitisation: sensitisation of TNC neurons → whole-body allodynia",
        "Allodynia present in ~70% of migraineurs; predicts poor triptan response if treatment delayed",
        "Triptans most effective when given before central sensitisation is established (within 20 min of onset)",
        "Meningeal neurogenic inflammation driven by:",
        "  – CGRP (potent vasodilator)",
        "  – Substance P",
        "  – Nitric oxide (NO) – important trigger in nitroglycerin-provoked migraine",
        "  – Prostaglandins (explains NSAID efficacy)",
        "Descending modulation from PAG and nucleus raphe magnus modulates pain gate",
    ],
    BA
)

# ── SECTION DIVIDER ───────────────────────────────────────────────────────────
section_slide("SECTION 4", "Genetics of Migraine")

# ── SLIDE 17: Genetics ────────────────────────────────────────────────────────
content_slide(
    "Genetics of Migraine",
    [
        "Strong heritable component – twin and sibling studies",
        "No simple Mendelian inheritance for common forms (MwoA / MwA)",
        "GWAS: ~40 susceptibility loci identified; many near genes of vascular smooth muscle (Gormley et al.)",
        "Familial Hemiplegic Migraine (FHM) – rare monogenic subtype:",
        "  FHM1: CACNA1A – Cav2.1 (P/Q-type) voltage-gated calcium channel",
        "  FHM2: ATP1A2 – Na+/K+-ATPase α2 subunit",
        "  FHM3: SCN1A – voltage-gated sodium channel Nav1.1",
        "  FHM4: PRRT2 – proline-rich transmembrane protein",
        "All FHM genes code for ion transport proteins – highlighting channelopathy basis",
        "CADASIL (NOTCH3 mutation) can present with migraine with aura",
        "MELAS syndrome: mitochondrial DNA mutation – may cause migraine-like episodes",
    ],
    BA
)

# ── SECTION DIVIDER ───────────────────────────────────────────────────────────
section_slide("SECTION 5", "Migraine Variants & Special Subtypes")

# ── SLIDE 18: Hemiplegic Migraine ────────────────────────────────────────────
content_slide(
    "Hemiplegic Migraine",
    [
        "Rare subtype characterised by reversible motor weakness (hemiplegia) as part of aura",
        "Familial (FHM) or sporadic forms",
        "FHM1 (CACNA1A) – most common; also associated with cerebellar ataxia in some families",
        "FHM2 (ATP1A2) – Na+/K+ ATPase mutation",
        "FHM3 (SCN1A) – Nav1.1 sodium channel mutation",
        "Motor aura may last hours to days – much longer than typical aura",
        "Associated aura features: visual, sensory, aphasia, confusion, reduced consciousness",
        "Fever and marked meningeal irritation may occur in severe attacks",
        "Avoid triptans and ergotamines (risk of prolonged vasoconstriction); use verapamil or acetazolamide for prevention",
        "Must be differentiated from stroke, Todd's palsy, demyelinating disease",
    ],
    A
)

# ── SLIDE 19: Migraine with Brainstem Aura ────────────────────────────────────
content_slide(
    "Migraine with Brainstem Aura (Basilar Migraine)",
    [
        "Aura symptoms of brainstem origin – previously called 'basilar artery migraine' (Bickerstaff, 1961)",
        "Renamed in ICHD-3 because basilar artery involvement not proven",
        "ICHD-3: ≥2 of the following brainstem aura features:",
        "  – Dysarthria",
        "  – Vertigo",
        "  – Tinnitus",
        "  – Hypacusis (hearing loss)",
        "  – Diplopia",
        "  – Ataxia (non-hemiplegic)",
        "  – Decreased level of consciousness",
        "Followed by headache typical of migraine",
        "Common in adolescent girls; often resolves with age",
        "Syncope and drop attacks can occur – termed 'syncopal migraine'",
    ],
    BA
)

# ── SLIDE 20: Retinal & Ophthalmoplegic Migraine ──────────────────────────────
two_col_slide(
    "Retinal Migraine & Ophthalmoplegic Migraine",
    [
        "Retinal Migraine:",
        "Repeated attacks of monocular visual disturbance – scotoma, blindness",
        "Fully reversible; associated with headache",
        "Due to ischaemia or CSD in retina",
        "Rare; differential includes amaurosis fugax (TIA)",
        "Fundoscopy: retinal artery pallor during attack",
        "Triptans used cautiously – monitor for permanent visual loss",
    ],
    [
        "Ophthalmoplegic Migraine:",
        "Recurrent attacks of ophthalmoplegia (CN III most often)",
        "Headache precedes eye muscle palsy",
        "Pain in/around orbit",
        "Now classified in ICHD-3 as 'recurrent painful ophthalmoplegic neuropathy'",
        "MRI: gadolinium enhancement of oculomotor nerve during attack",
        "Corticosteroids may abort attacks; rule out aneurysm",
    ],
    "Retinal", "Ophthalmoplegic",
    A
)

# ── SLIDE 21: Chronic Migraine ────────────────────────────────────────────────
content_slide(
    "Chronic Migraine",
    [
        "Definition (ICHD-3): ≥15 headache days/month for >3 months, of which ≥8 days meet migraine criteria",
        "Prevalence: ~2% of general population; major public health burden",
        "Risk factors for chronification:",
        "  – High attack frequency (episodic migraine ≥1×/week)",
        "  – Medication overuse headache (MOH) – most important modifiable risk",
        "  – Obesity, sleep disorders, psychiatric comorbidities (anxiety, depression)",
        "  – Caffeine overuse, stressful life events",
        "Pathophysiology: central sensitisation and neuroplastic changes in pain modulation",
        "Treatment: combination of preventive pharmacotherapy + behavioural interventions + MOH management",
        "OnabotulinumtoxinA (Botox): FDA-approved for chronic migraine prevention (PREEMPT trials)",
        "CGRP mAbs (erenumab, fremanezumab, galcanezumab) effective in chronic migraine",
    ],
    B
)

# ── SLIDE 22: Menstrual & Vestibular Migraine ─────────────────────────────────
two_col_slide(
    "Menstrual Migraine & Vestibular Migraine",
    [
        "Menstrual / Catamenial Migraine:",
        "Attacks exclusively or predominantly peri-menstrual",
        "~15% of migraineurs – purely menstrual",
        "Mechanism: oestradiol withdrawal → CSD threshold reduction",
        "Typically MwoA; often severe and prolonged",
        "Management: frovatriptan mini-prophylaxis or transdermal oestrogen",
        "Pregnancy often improves migraine; may worsen in 1st trimester",
    ],
    [
        "Vestibular Migraine (VM):",
        "Most common cause of episodic vertigo in adults",
        "Vestibular symptoms lasting 5 min – 72 hours",
        "At least 50% of attacks associated with headache",
        "Photophobia / phonophobia during vertiginous episodes",
        "Differentiate from BPPV, Menière disease",
        "Treatment: same as migraine prevention; vestibular rehabilitation adjunct",
        "Betahistine not well-supported; verapamil often used",
    ],
    "Menstrual", "Vestibular",
    B
)

# ── SECTION DIVIDER ───────────────────────────────────────────────────────────
section_slide("SECTION 6", "Triggers, Diagnosis & Differential Diagnosis")

# ── SLIDE 23: Triggers ────────────────────────────────────────────────────────
two_col_slide(
    "Migraine Triggers",
    [
        "Hormonal:",
        "  – Oestrogen withdrawal (menstruation)",
        "  – Oral contraceptive pill",
        "  – Hormone replacement therapy",
        "Dietary:",
        "  – Alcohol (especially red wine, beer)",
        "  – Caffeine (excess or withdrawal)",
        "  – Tyramine-containing foods (aged cheese)",
        "  – Skipped meals, fasting",
    ],
    [
        "Environmental / Lifestyle:",
        "  – Bright light, glare, flickering lights",
        "  – Strong odours, perfumes",
        "  – Sleep disturbance (too much or too little)",
        "  – Stress and stress let-down",
        "  – Weather / barometric pressure changes",
        "Pharmacological:",
        "  – Nitroglycerin (NO donor) – classic experimental trigger",
        "  – Histamine, CGRP infusion",
        "  – Medication overuse",
    ],
    "Hormonal & Dietary", "Environmental & Other",
    B
)

# ── SLIDE 24: Diagnosis ───────────────────────────────────────────────────────
content_slide(
    "Diagnosis of Migraine",
    [
        "Migraine is a clinical diagnosis based on history – no diagnostic test confirms migraine",
        "Take a thorough headache history: onset, duration, frequency, character, severity, associated features",
        "Ask specifically about aura, triggers, family history, medication use",
        "Neurological examination: usually normal between attacks",
        "Neuroimaging is NOT routinely required for typical migraine",
        "Imaging indications (red flags –'SNOOP10'):",
        "  – Systemic symptoms / secondary risk factors",
        "  – New onset after age 50",
        "  – Onset <5 min (thunderclap), or change in established pattern",
        "  – Progressive worsening, papilloedema, focal neurological signs",
        "Headache diary: crucial for diagnosis and monitoring treatment response",
        "Validated screening tools: ID-Migraine (3-item questionnaire: nausea, disability, photophobia)",
    ],
    B
)

# ── SLIDE 25: Differential Diagnosis ─────────────────────────────────────────
two_col_slide(
    "Differential Diagnosis",
    [
        "Secondary headaches to exclude:",
        "  – Subarachnoid haemorrhage (thunderclap)",
        "  – Cerebral venous sinus thrombosis",
        "  – Arterial dissection (cervical, intracranial)",
        "  – Idiopathic intracranial hypertension",
        "  – Meningitis / encephalitis",
        "  – Space-occupying lesion",
        "  – Giant cell arteritis (>50 years)",
        "  – Carbon monoxide poisoning",
    ],
    [
        "Primary headaches to differentiate:",
        "  – Tension-type headache (bilateral, non-pulsating, no nausea)",
        "  – Cluster headache (unilateral, periorbital, short duration, autonomic)",
        "  – SUNCT / SUNA",
        "  – Hemicrania continua",
        "  – New daily persistent headache (NDPH)",
        "Visual aura must be distinguished from:",
        "  – TIA / occipital lobe ischaemia",
        "  – Retinal detachment",
        "  – Posterior cortical atrophy",
    ],
    "Secondary Headaches", "Primary Headaches",
    B
)

# ── SECTION DIVIDER ───────────────────────────────────────────────────────────
section_slide("SECTION 7", "Acute / Abortive Treatment")

# ── SLIDE 26: Acute Treatment Principles ─────────────────────────────────────
content_slide(
    "Acute Treatment – General Principles",
    [
        "Goal: rapid, complete pain relief and restoration of function within 2 hours",
        "Stratified care preferred over 'step care' approach for moderate-severe migraine",
        "Treat early in the attack – before central sensitisation is established",
        "Avoid overuse of acute medications: ≥2–3 days/week → risk of MOH (medication overuse headache)",
        "Non-pharmacological: dark quiet room, sleep, cold/warm compress, hydration",
        "Consider rescue medication for severe or refractory attacks",
        "Antiemetics often needed for nausea/vomiting (also aid absorption of oral medications)",
        "Parenteral routes (IV, SC, nasal spray) for severe attacks with vomiting",
    ],
    BA
)

# ── SLIDE 27: Simple Analgesics & NSAIDs ──────────────────────────────────────
content_slide(
    "Acute Treatment – Analgesics, NSAIDs & Antiemetics",
    [
        "Simple analgesics (mild-moderate attacks):",
        "  – Aspirin 900–1000 mg: effective in RCTs; comparable to sumatriptan in some studies",
        "  – Paracetamol (acetaminophen) 1000 mg: modest efficacy; safe in pregnancy",
        "NSAIDs (first-line for moderate attacks):",
        "  – Ibuprofen 400–600 mg",
        "  – Naproxen sodium 550–825 mg",
        "  – Diclofenac potassium 50 mg (fast-acting formulation)",
        "  – Ketorolac IM: useful in ED setting",
        "Antiemetics (adjunct – also accelerate gastric emptying for better drug absorption):",
        "  – Metoclopramide 10–20 mg (also has intrinsic anti-migraine properties)",
        "  – Prochlorperazine 10 mg PO / 25 mg PR",
        "  – Domperidone 20 mg",
        "Combination: aspirin + paracetamol + caffeine (Excedrin) – superior to components alone",
    ],
    BA
)

# ── SLIDE 28: Triptans ────────────────────────────────────────────────────────
content_slide(
    "Acute Treatment – Triptans (5-HT1B/1D Agonists)",
    [
        "Mechanism: vasoconstriction of meningeal vessels + inhibition of trigeminal CGRP release",
        "Mainstay of treatment for moderate-severe migraine; most effective if taken early",
        "7 oral triptans available (see table on next slide)",
        "Sumatriptan: most studied – 50 mg oral (first-line), 6 mg SC (fastest onset, most effective)",
        "Sumatriptan 20 mg nasal spray: useful when vomiting prevents oral intake",
        "Non-oral options: sumatriptan SC, zolmitriptan nasal spray, dihydroergotamine (DHE) nasal/IM",
        "Response in ~70–75% of patients if used within 1–2 hours of onset",
        "Contraindications: coronary artery disease, uncontrolled hypertension, history of stroke, pregnancy",
        "Serotonin agonists avoided during prolonged aura (hemiparesis, aphasia, basilar features)",
        "Not effective during aura phase – give at headache onset",
    ],
    BA
)

# ── SLIDE 29: Triptan Table ───────────────────────────────────────────────────
table_slide(
    "Oral Triptans – Dosing Reference",
    ["Triptan", "Tablet Sizes (mg)", "Optimum Dose (mg)", "Max Single Dose (mg)", "Max Daily Dose (mg)"],
    [
        ["Sumatriptan*", "25, 50, 100", "50", "100", "200"],
        ["Rizatriptan",  "5, 10",       "10", "10",  "30"],
        ["Zolmitriptan", "2.5, 5",      "2.5","5",   "10"],
        ["Eletriptan",   "20, 40",      "20", "40",  "80"],
        ["Almotriptan",  "6.25, 12.5",  "12.5","12.5","25"],
        ["Naratriptan",  "1, 2.5",      "2.5","2.5", "5"],
        ["Frovatriptan", "2.5",         "2.5","2.5", "7.5"],
    ],
    A
)

# ── SLIDE 30: Ergotamines & Gepants ───────────────────────────────────────────
content_slide(
    "Acute Treatment – Ergotamines, Gepants & Lasmiditan",
    [
        "Ergotamine tartrate:",
        "  – 1–2 mg sublingual or oral (with caffeine); rectal suppository for vomiting",
        "  – Alpha-adrenergic + serotonergic vasoconstriction",
        "  – Effective in 70–75% if given early; risk of ergotism with overuse → daily headache",
        "Dihydroergotamine (DHE):",
        "  – 0.5–1 mg IV/IM/SC; nasal spray; superior to ergotamine for efficacy/tolerability",
        "  – IV DHE + antiemetic: effective rescue for intractable headache in ED",
        "Gepants (CGRP receptor antagonists) – oral, no vasoconstriction:",
        "  – Ubrogepant, Rimegepant – approved for acute treatment",
        "  – Safe in patients with cardiovascular risk where triptans are contraindicated",
        "Lasmiditan (5-HT1F agonist, 'ditan'):",
        "  – No vasoconstriction; CNS-specific mechanism",
        "  – Effective for acute migraine; dizziness main side effect; Schedule V (CNS effects)",
    ],
    BA
)

# ── SECTION DIVIDER ───────────────────────────────────────────────────────────
section_slide("SECTION 8", "Preventive Treatment")

# ── SLIDE 31: Indications for Prevention ──────────────────────────────────────
content_slide(
    "Preventive Treatment – Indications",
    [
        "Preventive therapy indicated when:",
        "  – ≥4 migraine days/month causing significant disability",
        "  – Acute medication overuse or acute treatments ineffective/contraindicated",
        "  – Severe or prolonged attacks (including hemiplegic or basilar migraine)",
        "  – Patient preference even with less frequent attacks",
        "Goal: reduce attack frequency ≥50%, severity, duration, and disability",
        "Adequate trial: at least 2–3 months at therapeutic dose",
        "Lifestyle measures always accompany pharmacological prevention:",
        "  – Regular sleep, exercise, meals; stress management",
        "  – Avoidance of known triggers",
        "  – Headache diary to monitor progress",
        "Patient education is essential – treatment adherence is critical",
    ],
    B
)

# ── SLIDE 32: Preventive Drugs ────────────────────────────────────────────────
two_col_slide(
    "Preventive Treatment – Pharmacological Options",
    [
        "Beta-blockers (Level A evidence):",
        "  – Propranolol 40–240 mg/day",
        "  – Metoprolol 100–200 mg/day",
        "  – Timolol 20–30 mg/day",
        "Antidepressants:",
        "  – Amitriptyline 10–75 mg/night (most evidence among TCAs)",
        "  – Venlafaxine 75–150 mg/day (SNRI)",
        "Anticonvulsants:",
        "  – Topiramate 50–200 mg/day (Level A)",
        "  – Valproate / sodium valproate 500–1000 mg/day",
        "  – Gabapentin: modest evidence",
    ],
    [
        "Calcium channel blockers:",
        "  – Flunarizine 5–10 mg/night (most evidence in Europe)",
        "  – Verapamil (mainly for cluster; also used in hemiplegic migraine)",
        "CGRP pathway monoclonal antibodies (mAbs):",
        "  – Erenumab (anti-CGRP receptor) – monthly SC",
        "  – Fremanezumab (anti-CGRP ligand) – monthly or quarterly SC",
        "  – Galcanezumab (anti-CGRP ligand) – monthly SC",
        "  – Eptinezumab (anti-CGRP ligand) – quarterly IV",
        "OnabotulinumtoxinA (Botox):",
        "  – 31 injection sites, 155 U every 12 weeks – for chronic migraine only",
        "  – PREEMPT protocol; FDA-approved",
    ],
    "Oral Preventives", "Newer Therapies",
    B
)

# ── SLIDE 33: CGRP Therapies ──────────────────────────────────────────────────
content_slide(
    "CGRP-Targeted Therapies – A New Era",
    [
        "CGRP and its receptor are expressed in trigeminal ganglia and meningeal vessels",
        "CGRP levels rise during migraine attacks; fall after successful triptan treatment",
        "CGRP infusion reliably induces migraine in susceptible individuals",
        "Gepants (small molecule CGRP-RA): ubrogepant, rimegepant, atogepant (daily oral preventive)",
        "Monoclonal antibodies: monthly or quarterly dosing – high specificity and tolerability",
        "Erenumab (Aimovig): targets CGRP receptor; 50 or 140 mg SC monthly",
        "Fremanezumab (Ajovy): 225 mg monthly or 675 mg quarterly SC",
        "Galcanezumab (Emgality): 240 mg loading → 120 mg monthly SC",
        "Eptinezumab (Vyepti): 100 or 300 mg IV every 3 months",
        "Clinical trials show 50% responder rates ~50–60% for episodic migraine",
        "Key advantage: no hepatotoxicity or cognitive side-effects of older preventives",
    ],
    BA
)

# ── SECTION DIVIDER ───────────────────────────────────────────────────────────
section_slide("SECTION 9", "Special Populations, Comorbidities & Status Migrainosus")

# ── SLIDE 34: Migraine in Special Populations ─────────────────────────────────
two_col_slide(
    "Migraine in Special Populations",
    [
        "Paediatric Migraine:",
        "  – Often bilateral, frontal-temporal",
        "  – Duration may be shorter (2–72 h)",
        "  – Abdominal migraine & cyclical vomiting are childhood equivalents",
        "  – Ibuprofen, paracetamol first-line; almotriptan / rizatriptan approved ≥12 yrs",
        "  – Propranolol, topiramate, amitriptyline for prevention",
        "",
        "Migraine in Elderly:",
        "  – Be cautious: new-onset headache after 50 → investigate",
        "  – 'Late-life migrainous accompaniments' (Fisher) – visual aura without headache",
    ],
    [
        "Pregnancy:",
        "  – Often improves after 1st trimester (oestrogen stabilisation)",
        "  – Paracetamol: safest acute treatment",
        "  – Aspirin (low dose, 2nd trimester caution), metoclopramide safe",
        "  – Triptans: generally avoided (limited safety data); sumatriptan registry reassuring",
        "  – Avoid valproate, ergotamines, NSAIDs in 3rd trimester",
        "  – Magnesium IV: option for severe acute treatment and prevention",
        "",
        "Contraception & OCP:",
        "  – Combined OCP: contraindicated in MwA (↑ stroke risk)",
        "  – Progestogen-only or non-hormonal methods preferred",
    ],
    "Paediatric & Elderly", "Pregnancy & Contraception",
    B
)

# ── SLIDE 35: Comorbidities ───────────────────────────────────────────────────
content_slide(
    "Comorbidities of Migraine",
    [
        "Psychiatric comorbidities (bidirectional association):",
        "  – Depression: 3× more prevalent in migraineurs; treat to improve both",
        "  – Anxiety disorders: generalised anxiety, panic disorder",
        "  – PTSD, bipolar disorder",
        "Cardiovascular / Cerebrovascular:",
        "  – MwA: ~2× risk of ischaemic stroke; higher in young women on combined OCP who smoke",
        "  – Patent foramen ovale (PFO): higher prevalence in MwA; PFO closure – not routinely recommended for migraine",
        "  – Increased risk of white matter hyperintensities on MRI",
        "Other:",
        "  – Epilepsy: migralepsy (migraine-triggered seizure)",
        "  – Fibromyalgia, irritable bowel syndrome – central sensitisation spectrum",
        "  – Sleep disorders: insomnia, sleep apnoea",
        "  – Raynaud phenomenon",
    ],
    B
)

# ── SLIDE 36: Status Migrainosus & Complications ──────────────────────────────
content_slide(
    "Status Migrainosus & Complications of Migraine",
    [
        "Status Migrainosus: debilitating migraine attack lasting >72 hours",
        "  – Often associated with medication overuse",
        "  – Requires parenteral treatment: IV DHE + antiemetic, IV ketorolac, IV valproate, IV dexamethasone",
        "Persistent Aura without Infarction:",
        "  – Aura lasting >1 week without evidence of infarction on neuroimaging",
        "Migrainous Infarction:",
        "  – Ischaemic infarct during migraine with aura (area corresponds to aura deficit)",
        "  – Rare – DWI MRI confirms",
        "  – Risk factor: young women + OCP + MwA + smoking",
        "Migraine Aura-Triggered Seizure (Migralepsy):",
        "  – Seizure within 1 hour of migraine aura",
        "Medication Overuse Headache (MOH):",
        "  – Triptans ≥10 days/month or NSAIDs/opioids ≥15 days/month → chronic daily headache",
        "  – Management: education + gradual or abrupt withdrawal + bridging therapy",
    ],
    B
)

# ── SECTION DIVIDER ───────────────────────────────────────────────────────────
section_slide("SECTION 10", "Management Summary & Future Directions")

# ── SLIDE 37: Comprehensive Management Algorithm ──────────────────────────────
content_slide(
    "Comprehensive Management Algorithm",
    [
        "Step 1 – Accurate Diagnosis: ICHD-3 criteria; exclude secondary causes; headache diary",
        "Step 2 – Patient Education: nature of migraine, triggers, lifestyle modifications, medication overuse risks",
        "Step 3 – Acute Treatment:",
        "   Mild-moderate: NSAIDs ± antiemetic (paracetamol, ibuprofen, aspirin)",
        "   Moderate-severe: triptan ± NSAID (stratified care)",
        "   Severe/refractory: parenteral DHE, IV ketorolac, antiemetics",
        "Step 4 – Preventive Treatment (if ≥4 migraine days/month):",
        "   First-line: propranolol, topiramate, amitriptyline",
        "   Second-line: CGRP mAbs, flunarizine, valproate",
        "   Chronic migraine: add onabotulinumtoxinA + CGRP mAb",
        "Step 5 – Multidisciplinary Care: neurology, psychology/CBT, physiotherapy, pain clinic",
        "Step 6 – Regular Follow-up: reassess frequency, disability (MIDAS/HIT-6), and medication use",
    ],
    BA
)

# ── SLIDE 38: Migraine & Stroke ───────────────────────────────────────────────
content_slide(
    "Migraine & Stroke",
    [
        "MwA carries ~2× relative risk of ischaemic stroke (meta-analyses)",
        "Absolute risk remains low in young women without other risk factors",
        "Risk is multiplicative with:",
        "  – Combined oral contraceptive pill (OCP): ≈8× risk vs non-migraine, non-OCP",
        "  – Smoking",
        "Possible mechanisms:",
        "  – Cardioembolic (PFO-mediated paradoxical embolism)",
        "  – CSD-induced cortical ischaemia during prolonged aura",
        "  – Hypercoagulable state during attacks",
        "Migrainous infarction: infarct in area corresponding to aura deficit – extremely rare",
        "MwoA: no clearly established stroke risk",
        "Management: eliminate modifiable risk factors; prefer progestogen-only contraception",
        "Avoid triptans and ergots during focal aura with neurological deficits",
    ],
    B
)

# ── SLIDE 39: New & Emerging Therapies ────────────────────────────────────────
content_slide(
    "Emerging & Future Therapies",
    [
        "Anti-CGRP pathway continues to expand:",
        "  – Atogepant (Qulipta): oral gepant approved for daily preventive use",
        "  – Zavegepant: nasal gepant for acute treatment",
        "Non-invasive neurostimulation:",
        "  – Single-pulse TMS (sTMS): approved for acute treatment of MwA",
        "  – External trigeminal neurostimulation (eTNS – Cefaly): preventive",
        "  – Remote electrical neuromodulation (REN – Nerivio): wearable acute device",
        "  – Non-invasive vagus nerve stimulation (nVNS – gammaCore): acute and preventive",
        "Invasive neurostimulation (refractory cases):",
        "  – Occipital nerve stimulation (ONS)",
        "  – Sphenopalatine ganglion stimulation",
        "Monoclonal antibodies under investigation targeting PACAP, pituitary adenylate cyclase",
        "Personalised medicine: pharmacogenomics to predict triptan/preventive response",
        "Digital therapeutics: app-based CBT + biofeedback for migraine management",
    ],
    B
)

# ── SLIDE 40: Key Take-Home Messages ──────────────────────────────────────────
slide40 = prs.slides.add_slide(blank)
add_rect(slide40, 0, 0, 13.333, 7.5, WHITE)
add_rect(slide40, 0, 0, 13.333, 0.12, NAVY)
add_rect(slide40, 0, 0.12, 13.333, 0.95, LIGHT_GREY)
add_textbox(slide40, "Key Take-Home Messages", 0.25, 0.13, 12.8, 0.94,
            size=24, bold=True, colour=NAVY)
add_rect(slide40, 0.25, 1.1, 12.8, 0.03, MID_BLUE)

messages = [
    ("1", "Migraine is a neurovascular disorder with a strong genetic basis – not just a headache"),
    ("2", "Classification (ICHD-3) distinguishes MwA, MwoA, chronic migraine, and rare variants"),
    ("3", "CSD underlies aura; trigeminovascular activation + CGRP release underlie pain"),
    ("4", "Treat early with triptans for moderate-severe migraine; avoid overuse (>2–3 days/week)"),
    ("5", "Prevent when ≥4 migraine days/month – beta-blockers, topiramate, amitriptyline, or CGRP mAbs"),
    ("6", "CGRP-targeted therapies (gepants & mAbs) represent a precision-medicine breakthrough"),
    ("7", "MwA + OCP + smoking = high stroke risk – modify aggressively"),
    ("8", "Chronic migraine and MOH are preventable with early intervention and patient education"),
]

for i, (num, msg) in enumerate(messages):
    y = 1.2 + i * 0.72
    add_rect(slide40, 0.3, y, 0.5, 0.5, NAVY)
    add_textbox(slide40, num, 0.3, y, 0.5, 0.5,
                size=18, bold=True, colour=WHITE, align=PP_ALIGN.CENTER)
    add_textbox(slide40, msg, 1.0, y + 0.02, 11.9, 0.55,
                size=16, colour=DARK_GREY)

add_textbox(slide40,
            "Sources: Bradley & Daroff's Neurology in Clinical Practice | Adams & Victor's Principles of Neurology, 12e",
            0.25, 7.1, 12.8, 0.35,
            size=10, italic=True,
            colour=RGBColor(0x90, 0x90, 0x90),
            align=PP_ALIGN.CENTER)

# ── SAVE ──────────────────────────────────────────────────────────────────────
out_path = "/tmp/workspace/migraine-ppt/Migraine_Bradley_Adams_Neurology.pptx"
prs.save(out_path)
print(f"Saved: {out_path}")
print(f"Total slides: {len(prs.slides)}")
Running Command

cd /tmp/workspace/migraine-ppt && python build_ppt.py

Running Command

cd /tmp/workspace/migraine-ppt && python3 -c " from pptx import Presentation prs = Presentation('Migraine_Bradley_Adams_Neurology.pptx') for i, slide in enumerate(prs.slides, 1): for shape in slide.shapes: if shape.has_text_frame: txt = shape.text_frame.text.strip() if txt: print(f'Slide {i:2d}: {txt[:80]}') break "

Running Command

cd /tmp/workspace/migraine-ppt && python3 -c " from pptx import Presentation from pptx.oxml.ns import qn from lxml import etree import copy prs = Presentation('Migraine_Bradley_Adams_Neurology.pptx') # Section divider slides to remove (1-indexed): 3, 8, 15, 20, 22, 28, 32, 38, 42, 46 remove_indices = {3, 8, 15, 20, 22, 28, 32, 38, 42, 46} # 1-indexed slides_el = prs.slides._sldIdLst slide_ids = list(slides_el) keep = [sid for i, sid in enumerate(slide_ids, 1) if i not in remove_indices] # Remove all then re-add only kept for sid in slide_ids: slides_el.remove(sid) for sid in keep: slides_el.append(sid) print(f'Slides remaining: {len(prs.slides)}') prs.save('Migraine_Bradley_Adams_Neurology.pptx') print('Done') "

Running Command

cd /tmp/workspace/migraine-ppt && python3 -c " from pptx import Presentation prs = Presentation('Migraine_Bradley_Adams_Neurology.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): for shape in slide.shapes: if shape.has_text_frame: txt = shape.text_frame.text.strip() if txt: print(f' {i:2d}. {txt[:75]}') break "

Running Command

ls -lh /tmp/workspace/migraine-ppt/Migraine_Bradley_Adams_Neurology.pptx

Your 40-slide presentation is ready. Download it here:

Migraine Bradley Adams Neurology

Presentation · PPTX


What's inside – all 40 slides, clean white design:
SlidesTopic
1–2Title + Table of Contents
3–6Definition, Epidemiology (2 slides), ICHD-3 Classification
7–12Four phases of migraine, ICHD-3 criteria for MwoA & MwA
13–16Pathophysiology – overview, CSD, trigeminovascular system, central sensitisation
17Genetics (FHM1/2/3/4, GWAS)
18–22Migraine variants: hemiplegic, basilar, retinal, ophthalmoplegic, chronic, menstrual, vestibular
23–25Triggers, Diagnosis, Differential Diagnosis
26–30Acute treatment: principles, NSAIDs/antiemetics, triptans (+ dosing table), ergotamines/gepants/lasmiditan
31–33Preventive treatment: indications, pharmacological options, CGRP mAbs
34–36Special populations, comorbidities, status migrainosus & complications
37–40Management algorithm, migraine & stroke, emerging therapies, key take-home messages
Design: Pure white background, deep navy header bar, mid-blue accents, clean Calibri font throughout - no distracting backgrounds or gradients. All content sourced directly from Bradley & Daroff's Neurology in Clinical Practice and Adams & Victor's Principles of Neurology, 12th Edition.
This is a shared conversation. Sign in to Orris to start your own chat.