modes of aphasia

Reading File
Finding Sources
Searching the Web

modes types of aphasia classification Broca Wernicke

Reading File
Reading File
Reading File
Reading File
Loading Image
I now have all the material needed for a thorough answer. Here is a comprehensive breakdown of the modes (types) of aphasia:

Modes of Aphasia

Aphasia is an acquired language disorder from damage to the brain's dominant (usually left) hemisphere language centers. The classic classification is based on three bedside features: fluency of spontaneous speech, auditory comprehension, and repetition. Naming is impaired in virtually all types.

Perisylvian Aphasias (Repetition Impaired)

These aphasias involve the perisylvian language zone; repetition is always impaired.

1. Broca Aphasia (Non-fluent / Expressive)

  • Lesion: Posterior inferior frontal gyrus (Brodmann areas 44 & 45) + adjacent cortex and subcortical white matter; territory of upper division of left MCA
  • Speech: Non-fluent, hesitant, telegraphic ("agrammatism") - e.g., "wife come hospital." Phonetic errors inconsistent utterance-to-utterance (literal paraphasias)
  • Comprehension: Relatively preserved, though complex syntax is impaired
  • Repetition: Impaired
  • Naming: Impaired (often "tip of the tongue" phenomenon)
  • Reading/Writing: Both impaired
  • Associated signs: Right hemiparesis, right hemisensory loss, apraxia of left limbs
  • Behavior: Patients are typically aware of deficits; depression is common
FeatureFinding
Spontaneous speechNonfluent, telegraphic
ComprehensionIntact (mild difficulty with complex syntax)
RepetitionImpaired
Associated signsRight hemiparesis, apraxia

2. Wernicke Aphasia (Fluent / Receptive)

  • Lesion: Posterior superior temporal gyrus (Wernicke area, Brodmann area 22); territory of lower division of left MCA
  • Speech: Fluent, effortless, sometimes logorrhea (excessive) - but empty of meaning; filled with verbal paraphasias, neologisms, and jargon
  • Comprehension: Impaired - even for simple commands
  • Repetition: Impaired
  • Naming: Severely impaired with bizarre paraphasic substitutions
  • Reading: Impaired (similar to auditory comprehension)
  • Associated signs: Often no hemiparesis; right hemianopia or superior quadrantanopia may be present
  • Behavior: Patients are often unaware of their deficits (anosognosia); may become agitated or paranoid when not understood
FeatureFinding
Spontaneous speechFluent, paraphasic, jargon
ComprehensionImpaired
RepetitionImpaired
Associated signsNo hemiparesis typically

3. Global Aphasia

  • Lesion: Large left hemisphere lesion involving both inferior frontal AND superior temporal regions + much of parietal lobe; most of left MCA territory
  • The most severe form - essentially Broca + Wernicke combined
  • Speech: Mute or non-fluent
  • Comprehension: Impaired
  • Repetition: Impaired
  • Naming: Impaired
  • Reading/Writing: Impaired
  • Associated signs: Dense right hemiplegia, hemisensory loss, hemianopia
  • Prognosis: Recovery may continue through the second 6 months post-stroke; patients often evolve toward Broca aphasia if the superior temporal gyrus is spared
FeatureFinding
Spontaneous speechMute or nonfluent
ComprehensionImpaired
RepetitionImpaired
Associated signsRight hemiplegia, hemianopia

4. Conduction Aphasia

  • Lesion: Arcuate fasciculus (disconnects Broca from Wernicke areas); involves the supramarginal gyrus and/or the insula
  • The hallmark: Disproportionately impaired repetition - a patient who can hold a conversation cannot repeat even single words. Classic example: patient could not repeat "boy" but said "I like girls better."
  • Speech: Relatively fluent, but with literal paraphasic errors and frequent self-correction attempts (conduite d'approche)
  • Comprehension: Preserved
  • Repetition: Severely impaired (out of proportion to spontaneous speech)
  • Naming: Moderately impaired
  • Associated signs: Right hemisensory loss, mild hemiparesis; limb apraxia
FeatureFinding
Spontaneous speechFluent with literal paraphasias
ComprehensionIntact
RepetitionSeverely impaired (hallmark)
Associated signsApraxia, mild right-sided deficits

Transcortical Aphasias (Repetition Preserved / Spared)

These involve areas outside the core perisylvian zone. Repetition is relatively preserved because the arcuate fasciculus is intact.

5. Transcortical Motor Aphasia

  • Lesion: Anterior or superior to Broca area (supplementary motor area / anterior watershed zone)
  • Speech: Non-fluent, reduced, but can become fluent when prompted or completing a phrase
  • Comprehension: Intact
  • Repetition: Preserved (often echolalia)
  • Naming: Impaired

6. Transcortical Sensory Aphasia

  • Lesion: Posterior watershed zone, posterior to Wernicke area (temporo-parieto-occipital junction)
  • Speech: Fluent with paraphasias - similar to Wernicke, but repetition is intact
  • Comprehension: Impaired
  • Repetition: Preserved
  • Naming: Impaired

7. Mixed Transcortical Aphasia (Isolation Aphasia)

  • All modalities impaired except repetition
  • Patient can only repeat (echo) what is said
  • Lesion: Watershed zone infarcts isolating the perisylvian language zone

Non-Perisylvian Aphasias

8. Anomic Aphasia

  • Lesion: Variable - can be the angular gyrus, temporal-parietal junction, or any part of the language network; also seen in recovery from other aphasias
  • The mildest and most common aphasia type
  • Speech: Fluent, but marked word-finding difficulty (anomia). Patients circumlocute ("the thing you use to... cut bread")
  • Comprehension: Intact
  • Repetition: Intact
  • Naming: Impaired (defining feature)
  • Often a residual of other aphasias after recovery

Quick Reference Summary Table

Aphasia TypeFluencyComprehensionRepetitionKey Feature
BrocaNon-fluentIntactImpairedTelegraphic speech, right hemiparesis
WernickeFluentImpairedImpairedJargon/paraphasic, unaware of deficits
GlobalNon-fluentImpairedImpairedAll modalities affected; dense hemiplegia
ConductionFluentIntactImpairedDisproportionate repetition deficit
Transcortical MotorNon-fluentIntactPreservedLike Broca but repetition spared
Transcortical SensoryFluentImpairedPreservedLike Wernicke but repetition spared
Mixed TranscorticalNon-fluentImpairedPreservedEcholalia only
AnomicFluentIntactIntactWord-finding only; mildest

Anatomy at a Glance

  • Broca area: Posterior inferior frontal gyrus (BA 44, 45) - production
  • Wernicke area: Posterior superior temporal gyrus (BA 22) - comprehension
  • Arcuate fasciculus: White matter tract connecting the two - when cut, causes conduction aphasia
  • Angular gyrus: Parietal lobe - reading, writing, and naming
  • Watershed zones: Medial/superior frontoparietal and posterior parieto-occipital - transcortical aphasias

MRI: Broca Aphasia Infarct

MRI scans from a patient with Broca aphasia showing infarction involving the cortical Broca area, subcortical white matter, and insula
MRI from a patient with Broca aphasia - the infarct involves the cortical Broca area, subcortical white matter, and insula. The patient made a good recovery. (Bradley and Daroff's Neurology in Clinical Practice)

Special Notes

  • Aphemia: A rare transient muteness from isolated left frontal/Broca area lesions; classified separately if writing is normal (may not be a true language disorder)
  • Primary Progressive Aphasia (PPA): Unlike the above acquired aphasias (typically from stroke), PPA is a neurodegenerative syndrome that worsens over time
  • Pure Word Deafness: Severe auditory comprehension deficit with preserved reading/writing; lesion isolates Wernicke area from auditory input
  • All aphasias impair naming to some degree; naming is the most sensitive indicator of dominant hemisphere language dysfunction
Sources: Bradley and Daroff's Neurology in Clinical Practice, Ch. 13; Kaplan & Sadock's Comprehensive Textbook of Psychiatry, Ch. 55

Create a summary PDF comparing aphasia types side-by-side

Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"

Running Command

mkdir -p /home/daytona/workspace/aphasia-pdf && python3 -c "import reportlab; print('reportlab ok')"

Writing File

~/aphasia-pdf/build_aphasia_pdf.py

from reportlab.lib.pagesizes import A4, landscape
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.colors import HexColor

OUTPUT = "/home/daytona/workspace/aphasia-pdf/Aphasia_Types_Comparison.pdf"

# ── Colour palette ──────────────────────────────────────────────────────────
NAVY      = HexColor("#1a3a5c")
TEAL      = HexColor("#1d7874")
LIGHT_BG  = HexColor("#f0f6fb")
ALT_ROW   = HexColor("#e8f4f0")
WHITE     = colors.white
GREY_LINE = HexColor("#cccccc")
RED_BADGE = HexColor("#c0392b")
GREEN_BADGE = HexColor("#1d7874")
YELLOW_BADGE = HexColor("#d4a017")
ORANGE_BADGE = HexColor("#e67e22")
HEADER_BG = HexColor("#1a3a5c")
SUBHEAD_BG = HexColor("#2e6da4")

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=landscape(A4),
    leftMargin=1.2*cm, rightMargin=1.2*cm,
    topMargin=1.4*cm, bottomMargin=1.4*cm
)

styles = getSampleStyleSheet()

def S(name, **kw):
    return ParagraphStyle(name, **kw)

title_style = S("Title", fontSize=20, fontName="Helvetica-Bold",
                textColor=WHITE, alignment=TA_CENTER, spaceAfter=4)
subtitle_style = S("Subtitle", fontSize=10, fontName="Helvetica",
                   textColor=HexColor("#aaccee"), alignment=TA_CENTER)
section_head = S("SectionHead", fontSize=13, fontName="Helvetica-Bold",
                 textColor=NAVY, spaceBefore=10, spaceAfter=4)
cell_head = S("CellHead", fontSize=8, fontName="Helvetica-Bold",
              textColor=WHITE, alignment=TA_CENTER)
cell_body = S("CellBody", fontSize=7.5, fontName="Helvetica",
              textColor=HexColor("#1a1a1a"), leading=11, alignment=TA_LEFT)
cell_body_c = S("CellBodyC", fontSize=7.5, fontName="Helvetica",
                textColor=HexColor("#1a1a1a"), leading=11, alignment=TA_CENTER)
note_style = S("Note", fontSize=7, fontName="Helvetica-Oblique",
               textColor=HexColor("#555555"), alignment=TA_CENTER)
badge_style = S("Badge", fontSize=7.5, fontName="Helvetica-Bold",
                textColor=WHITE, alignment=TA_CENTER)
legend_style = S("Legend", fontSize=8, fontName="Helvetica",
                 textColor=HexColor("#333333"))

# ── Helper: coloured badge cell ─────────────────────────────────────────────
def badge(text, bg):
    return Paragraph(f"<b>{text}</b>", ParagraphStyle(
        "b", fontSize=7.5, fontName="Helvetica-Bold",
        textColor=WHITE, alignment=TA_CENTER
    ))

def P(text, style=None):
    if style is None:
        style = cell_body
    return Paragraph(text, style)

def PC(text):
    return Paragraph(text, cell_body_c)

# ── Page 1: Main Comparison Table (all 8 types) ─────────────────────────────
# Columns: Aphasia | Zone | Fluency | Comprehension | Repetition | Naming | Reading | Writing | Associated Signs | Key Feature
COL_WIDTHS = [2.5*cm, 2.7*cm, 2.0*cm, 2.5*cm, 2.5*cm, 2.0*cm, 2.0*cm, 2.0*cm, 3.8*cm, 3.8*cm]

HEADERS = [
    P("Aphasia Type", cell_head),
    P("Lesion / Zone", cell_head),
    P("Fluency", cell_head),
    P("Comprehension", cell_head),
    P("Repetition", cell_head),
    P("Naming", cell_head),
    P("Reading", cell_head),
    P("Writing", cell_head),
    P("Associated Signs", cell_head),
    P("Key Feature / Mnemonic", cell_head),
]

# badge colours: ✓ green, ✗ red, ~ orange
OK   = lambda: badge("✓ Intact",    GREEN_BADGE)
BAD  = lambda: badge("✗ Impaired",  RED_BADGE)
VAR  = lambda: badge("~ Variable",  ORANGE_BADGE)
PRES = lambda: badge("✓ Preserved", GREEN_BADGE)

rows_data = [
    # 1 Broca
    [
        P("<b>Broca</b>\n(Non-fluent / Expressive)", cell_body),
        P("Post. inferior frontal gyrus\n(BA 44, 45)\nUpper MCA", cell_body),
        badge("Non-fluent", RED_BADGE),
        OK(),
        BAD(),
        BAD(),
        BAD(),
        BAD(),
        P("• Right hemiparesis\n• Right hemisensory loss\n• Limb apraxia", cell_body),
        P("Telegraphic / agrammatic speech\n\"wife come hospital\"\nDepression common; patient aware", cell_body),
    ],
    # 2 Wernicke
    [
        P("<b>Wernicke</b>\n(Fluent / Receptive)", cell_body),
        P("Post. superior temporal\ngyrus (BA 22)\nLower MCA", cell_body),
        badge("Fluent", GREEN_BADGE),
        BAD(),
        BAD(),
        BAD(),
        BAD(),
        VAR(),
        P("• No hemiparesis (usually)\n• Superior quadrantanopia\n• Right hemianopia", cell_body),
        P("Jargon / paraphasic speech\nPatient unaware of errors\nNeologisms, logorrhea", cell_body),
    ],
    # 3 Global
    [
        P("<b>Global</b>\n(Most severe)", cell_body),
        P("Entire left MCA territory\n(frontal + temporal\n+ parietal)", cell_body),
        badge("Non-fluent", RED_BADGE),
        BAD(),
        BAD(),
        BAD(),
        BAD(),
        BAD(),
        P("• Dense right hemiplegia\n• Hemisensory loss\n• Hemianopia", cell_body),
        P("ALL modalities impaired\nBroca + Wernicke combined\nEvolution toward Broca if STG spared", cell_body),
    ],
    # 4 Conduction
    [
        P("<b>Conduction</b>", cell_body),
        P("Arcuate fasciculus\n(Supramarginal gyrus\n/ Insula)", cell_body),
        badge("Fluent", GREEN_BADGE),
        OK(),
        BAD(),
        BAD(),
        VAR(),
        VAR(),
        P("• Mild right hemiparesis\n• Right hemisensory loss\n• Limb apraxia", cell_body),
        P("REPETITION disproportionately bad\nConduite d'approche\n(repeated self-correction attempts)", cell_body),
    ],
    # 5 Transcortical Motor
    [
        P("<b>Transcortical Motor</b>\n(TC Motor)", cell_body),
        P("Anterior/superior to\nBroca area\n(Watershed zone)", cell_body),
        badge("Non-fluent", RED_BADGE),
        OK(),
        PRES(),
        BAD(),
        VAR(),
        VAR(),
        P("• Mild right-sided signs\n• SMA involvement", cell_body),
        P("Like Broca BUT repetition spared\nEcholalia; patients can complete\nfamiliar phrases", cell_body),
    ],
    # 6 Transcortical Sensory
    [
        P("<b>Transcortical Sensory</b>\n(TC Sensory)", cell_body),
        P("Posterior to Wernicke\n(TPO junction)\nPosterior watershed", cell_body),
        badge("Fluent", GREEN_BADGE),
        BAD(),
        PRES(),
        BAD(),
        BAD(),
        VAR(),
        P("• No hemiparesis typically\n• Visual field defects", cell_body),
        P("Like Wernicke BUT repetition spared\nMay repeat without comprehending", cell_body),
    ],
    # 7 Mixed Transcortical
    [
        P("<b>Mixed Transcortical</b>\n(Isolation Aphasia)", cell_body),
        P("Bilateral watershed\nzones isolating\nperisylvian zone", cell_body),
        badge("Non-fluent", RED_BADGE),
        BAD(),
        PRES(),
        BAD(),
        BAD(),
        BAD(),
        P("• Global deficits except\n  repetition/echolalia\n• Bilateral signs", cell_body),
        P("ONLY repetition preserved\n(echolalia)\nPerisylvian zone intact\nbut isolated", cell_body),
    ],
    # 8 Anomic
    [
        P("<b>Anomic</b>\n(Mildest form)", cell_body),
        P("Angular gyrus or\nTPO junction\n(or residual)", cell_body),
        badge("Fluent", GREEN_BADGE),
        OK(),
        PRES(),
        BAD(),
        OK(),
        OK(),
        P("• Often no focal deficits\n• May be residual of other\n  aphasias", cell_body),
        P("Word-finding difficulty ONLY\nCircumlocution common\n\"thing you use to... cut bread\"", cell_body),
    ],
]

table_data = [HEADERS] + rows_data

ts = TableStyle([
    # Header row
    ("BACKGROUND",   (0,0), (-1,0),  HEADER_BG),
    ("TEXTCOLOR",    (0,0), (-1,0),  WHITE),
    ("FONTNAME",     (0,0), (-1,0),  "Helvetica-Bold"),
    ("FONTSIZE",     (0,0), (-1,0),  8),
    ("ALIGN",        (0,0), (-1,0),  "CENTER"),
    ("VALIGN",       (0,0), (-1,-1), "MIDDLE"),
    ("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, ALT_ROW]),
    ("GRID",         (0,0), (-1,-1), 0.5, GREY_LINE),
    ("LEFTPADDING",  (0,0), (-1,-1), 4),
    ("RIGHTPADDING", (0,0), (-1,-1), 4),
    ("TOPPADDING",   (0,0), (-1,-1), 4),
    ("BOTTOMPADDING",(0,0), (-1,-1), 4),
    # First column bold background
    ("BACKGROUND",   (0,1), (0,-1),  LIGHT_BG),
    ("FONTNAME",     (0,1), (0,-1),  "Helvetica-Bold"),
])

main_table = Table(table_data, colWidths=COL_WIDTHS, repeatRows=1)
main_table.setStyle(ts)

# ── Page 2: Anatomy + Bedside Exam + Clinical Pearls ────────────────────────
# Three-column layout using a Table

anatomy_text = [
    P("<b>Language Areas &amp; White Matter</b>", section_head),
    Spacer(1, 4),
    P("<b>Broca Area (BA 44/45):</b> Posterior inferior frontal gyrus. Responsible for speech production and syntactic processing.", cell_body),
    Spacer(1,3),
    P("<b>Wernicke Area (BA 22):</b> Posterior superior temporal gyrus. Responsible for auditory language comprehension.", cell_body),
    Spacer(1,3),
    P("<b>Arcuate Fasciculus:</b> White matter tract connecting Wernicke to Broca. Damage → Conduction aphasia.", cell_body),
    Spacer(1,3),
    P("<b>Angular Gyrus (BA 39):</b> Parietal lobe. Reading, writing, naming. Damage → Anomic or alexia with agraphia.", cell_body),
    Spacer(1,3),
    P("<b>Supplementary Motor Area (SMA):</b> Superior to Broca. Initiation of speech. Damage → TC Motor aphasia.", cell_body),
    Spacer(1,3),
    P("<b>Watershed Zones:</b> Border zones between MCA/ACA and MCA/PCA. Ischemia here → Transcortical aphasias.", cell_body),
    Spacer(1,6),
    P("<b>Vascular Territories</b>", section_head),
    Spacer(1,4),
    P("• <b>Upper MCA:</b> Broca area → Broca aphasia + right hemiparesis", cell_body),
    P("• <b>Lower MCA:</b> Wernicke area → Wernicke aphasia ± hemianopia", cell_body),
    P("• <b>Entire MCA:</b> → Global aphasia", cell_body),
    P("• <b>ACA/MCA watershed:</b> SMA → TC Motor aphasia", cell_body),
    P("• <b>MCA/PCA watershed:</b> TPO junction → TC Sensory aphasia", cell_body),
    P("• <b>Bilateral watersheds:</b> → Isolation/Mixed TC aphasia", cell_body),
]

bedside_text = [
    P("<b>Bedside Language Examination</b>", section_head),
    Spacer(1, 4),
    P("<b>1. Spontaneous speech</b> — note fluency, rate, effort, paraphasias, prosody", cell_body),
    Spacer(1,3),
    P("<b>2. Naming</b> — show objects (pen, watch, coin). Impaired in ALL aphasias.", cell_body),
    Spacer(1,3),
    P("<b>3. Repetition</b> — key discriminator:", cell_body),
    P("   • \"No ifs, ands, or buts\"\n   • \"The president lives in Washington\"\n   • Single words, then sentences", cell_body),
    Spacer(1,3),
    P("<b>4. Comprehension</b>", cell_body),
    P("   • Yes/No questions (\"Is your name John?\")\n   • Single commands → complex multi-step\n   • Syntactic comprehension (embedded clauses)", cell_body),
    Spacer(1,3),
    P("<b>5. Reading</b> — single words, then sentences, both aloud and for comprehension", cell_body),
    Spacer(1,3),
    P("<b>6. Writing</b> — spontaneous sentence, dictation, copy", cell_body),
    Spacer(1,6),
    P("<b>Paraphasia Types</b>", section_head),
    Spacer(1,4),
    P("• <b>Literal/Phonemic:</b> Sound substitution — \"spoon\" → \"spoop\" (Broca, Conduction)", cell_body),
    P("• <b>Verbal/Semantic:</b> Word substitution — \"spoon\" → \"fork\" (Wernicke)", cell_body),
    P("• <b>Neologism:</b> Non-word — \"spoon\" → \"flarble\" (Wernicke)", cell_body),
    P("• <b>Jargon:</b> String of neologisms (severe Wernicke)", cell_body),
    P("• <b>Circumlocution:</b> Describing the word — \"the thing for eating soup\" (Anomic)", cell_body),
]

pearls_text = [
    P("<b>Clinical Pearls</b>", section_head),
    Spacer(1, 4),
    P("<b>The Repetition Rule:</b>", cell_body),
    P("   Perisylvian zone (Broca/Wernicke/Global/Conduction) → <b>Repetition IMPAIRED</b>", cell_body),
    P("   Transcortical / Anomic → <b>Repetition PRESERVED</b>", cell_body),
    Spacer(1,5),
    P("<b>Fluency + Comprehension + Repetition = Diagnosis:</b>", cell_body),
    Spacer(1,3),
    P("   NF + Intact + Impaired → <b>Broca</b>", cell_body),
    P("   F + Impaired + Impaired → <b>Wernicke</b>", cell_body),
    P("   NF + Impaired + Impaired → <b>Global</b>", cell_body),
    P("   F + Intact + Impaired → <b>Conduction</b>", cell_body),
    P("   NF + Intact + Preserved → <b>TC Motor</b>", cell_body),
    P("   F + Impaired + Preserved → <b>TC Sensory</b>", cell_body),
    P("   NF + Impaired + Preserved → <b>Mixed TC</b>", cell_body),
    P("   F + Intact + Preserved → <b>Anomic</b>", cell_body),
    Spacer(1,5),
    P("<b>Associated Hemiparesis:</b>", cell_body),
    P("   Present → Broca or Global (frontal involvement)", cell_body),
    P("   Absent → Wernicke (purely temporal lesion)", cell_body),
    P("   Absent → Conduction (parietal/insular lesion)", cell_body),
    Spacer(1,5),
    P("<b>Awareness of Deficits:</b>", cell_body),
    P("   Aware + Frustrated → Broca (depression common)", cell_body),
    P("   Unaware → Wernicke (anosognosia)", cell_body),
    Spacer(1,5),
    P("<b>Recovery Patterns (post-stroke):</b>", cell_body),
    P("   • Global often evolves → Broca over weeks-months", cell_body),
    P("   • Mild aphasia: 95% peak at 2 weeks", cell_body),
    P("   • Moderate aphasia: peak ~6 weeks", cell_body),
    P("   • Severe aphasia: peak ~10 weeks", cell_body),
    P("   • Only 8% with severe aphasia fully recover by 6 months", cell_body),
    Spacer(1,5),
    P("<b>Primary Progressive Aphasia (PPA):</b>", cell_body),
    P("   Neurodegenerative; worsens over time. Three variants:", cell_body),
    P("   1. Nonfluent/Agrammatic (like Broca)", cell_body),
    P("   2. Semantic (like TC Sensory/Wernicke)", cell_body),
    P("   3. Logopenic (like Conduction)", cell_body),
    Spacer(1,5),
    P("<b>Source:</b> Bradley &amp; Daroff's Neurology in Clinical Practice, Ch. 13", note_style),
]

# Build three-column layout
def make_col(items):
    """Wrap a list of flowables in a single-cell table to act as a column."""
    return items

col_table_data = [[
    [x for x in anatomy_text],
    [x for x in bedside_text],
    [x for x in pearls_text],
]]

# Use a nested approach: each column is itself a list of Paragraphs in a Table cell
col_widths_p2 = [8.5*cm, 8.5*cm, 8.5*cm]

# We'll flatten the three columns into a single 3-col table with the content
from reportlab.platypus import ListFlowable

def col_cells(items):
    from io import BytesIO
    story = items
    return story

page2_col_data = [[anatomy_text, bedside_text, pearls_text]]
page2_table = Table(page2_col_data, colWidths=col_widths_p2)
page2_table.setStyle(TableStyle([
    ("VALIGN",       (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING",  (0,0), (-1,-1), 8),
    ("RIGHTPADDING", (0,0), (-1,-1), 8),
    ("TOPPADDING",   (0,0), (-1,-1), 4),
    ("LINEAFTER",    (0,0), (1,-1),  0.5, GREY_LINE),
]))

# ── Build title banner (as a Table for coloured background) ─────────────────
def title_banner(title_text, subtitle_text):
    data = [[
        Paragraph(title_text, title_style),
    ], [
        Paragraph(subtitle_text, subtitle_style),
    ]]
    t = Table(data, colWidths=[sum(COL_WIDTHS)])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), NAVY),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING",   (0,0), (-1,-1), 12),
        ("RIGHTPADDING",  (0,0), (-1,-1), 12),
    ]))
    return t

title1 = title_banner(
    "Aphasia Types: Side-by-Side Comparison",
    "Classification based on Fluency · Comprehension · Repetition   |   Source: Bradley & Daroff's Neurology in Clinical Practice"
)

title2 = title_banner(
    "Aphasia: Anatomy, Bedside Examination &amp; Clinical Pearls",
    "Lesion localization · Diagnostic algorithm · Recovery patterns"
)

# ── Assemble story ───────────────────────────────────────────────────────────
story = [
    title1,
    Spacer(1, 6),
    main_table,
    Spacer(1, 6),
    # Legend row
    Table([[
        badge("✓ Intact / Preserved", GREEN_BADGE),
        Spacer(0.3*cm, 0),
        badge("✗ Impaired", RED_BADGE),
        Spacer(0.3*cm, 0),
        badge("~ Variable", ORANGE_BADGE),
        Spacer(0.3*cm, 0),
        P("NF = Non-fluent  |  F = Fluent  |  MCA = Middle Cerebral Artery  |  "
          "BA = Brodmann Area  |  TPO = Temporo-Parieto-Occipital  |  "
          "TC = Transcortical  |  SMA = Supplementary Motor Area  |  STG = Superior Temporal Gyrus",
          note_style),
    ]], colWidths=[2.5*cm, 0.3*cm, 2.2*cm, 0.3*cm, 2.2*cm, 0.3*cm, None]),
    PageBreak(),
    title2,
    Spacer(1, 8),
    page2_table,
]

doc.build(story)
print(f"PDF written to {OUTPUT}")
Running Command

cd /home/daytona/workspace/aphasia-pdf && python3 build_aphasia_pdf.py 2>&1

Editing File

~/aphasia-pdf/build_aphasia_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/aphasia-pdf/build_aphasia_pdf.py'
Running Command

cd /home/daytona/workspace/aphasia-pdf && python3 build_aphasia_pdf.py 2>&1

PDF generated successfully. Here it is:

Aphasia Types Comparison

PDF Document · PDF


The PDF is 2 pages, landscape A4, and contains:
Page 1 - Side-by-Side Comparison Table (all 8 types)
  • Columns: Aphasia Type, Lesion/Zone, Fluency, Comprehension, Repetition, Naming, Reading, Writing, Associated Signs, Key Feature/Mnemonic
  • Color-coded badges: green (intact), red (impaired), orange (variable)
  • Alternating row shading for easy reading
  • Abbreviation legend at the bottom
Page 2 - Reference & Diagnostics (3 columns)
  • Left: Anatomy of language areas + vascular territories
  • Center: Bedside examination steps + paraphasia types
  • Right: Diagnostic algorithm (fluency/comprehension/repetition matrix), hemiparesis clues, awareness patterns, recovery timelines, and PPA variants
This is a shared conversation. Sign in to Orris to start your own chat.