Superficial tendon reflex and deep tendon reflex

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Reading File
Loading Image
Reading File
Reading File
I now have comprehensive information from multiple authoritative textbooks. Here is a full structured answer:

Superficial (Cutaneous) Tendon Reflexes vs. Deep Tendon Reflexes


Deep Tendon Reflexes (DTRs) / Stretch Reflexes

Definition & Mechanism

A deep tendon reflex is actually a muscle stretch reflex (myotatic reflex) - the name "deep tendon reflex" is a misnomer that persists because testing is done by tapping over a tendon. Tapping the tendon briefly stretches the muscle, activating muscle spindles (Ia afferent fibers), which send impulses into the spinal cord and synapse directly on anterior horn alpha motor neurons (LMNs) - this is a monosynaptic arc.
The result: the stretched muscle contracts and its antagonist relaxes (reciprocal inhibition via inhibitory interneurons).
Neural circuit for the deep tendon (muscle stretch) reflex - Ia afferent fiber from muscle spindle travels to spinal cord, synapses on motor neuron, which activates agonist (triceps) and inhibits antagonist (biceps)
Figure 2.21 - Neural Circuit for Deep Tendon (Muscle Stretch) Reflex - Neuroanatomy through Clinical Cases, 3rd Ed.

Components of the Reflex Arc

  1. Receptor - Muscle spindle (detects stretch)
  2. Afferent limb - Group Ia (primary) and Group II (secondary) sensory fibers via dorsal root
  3. Integration center - Spinal cord gray matter (anterior horn)
  4. Efferent limb - Alpha motor neuron via ventral root
  5. Effector - Extrafusal skeletal muscle fibers (contraction)

Dynamic vs. Static Components

  • Dynamic stretch reflex: Brief, powerful contraction in response to sudden stretch - elicited by the velocity component from primary (Ia) endings. Over within a fraction of a second.
  • Static stretch reflex: Weaker but prolonged contraction proportional to maintained muscle length, elicited by both primary and secondary endings. Functions to maintain muscle length against gravity. - Guyton & Hall, p.679

Modulation by Higher Centers

Descending pathways (corticospinal, reticulospinal) modulate DTR sensitivity. Damage to upper motor neurons (UMN) removes inhibitory input, leading to hyperreflexia and potentially clonus (oscillating reflex). Damage to lower motor neurons (LMN) disrupts the reflex arc itself, causing hyporeflexia or areflexia.

Common DTRs and Their Spinal Levels

ReflexTendon TappedSpinal LevelResponse
Biceps jerkBiceps tendonC5, C6Elbow flexion
Triceps jerkAbove olecranonC7Elbow extension
Knee jerk (patellar)Ligamentum patellaeL2, L3, L4Leg extension
Ankle jerkTendo Achilles (dorsiflexed foot)S1, S2Plantar flexion
Knee jerk technique: Patient sits with one knee crossed over the other (or knee supported); a sharp tap on the ligamentum patellae causes brisk quadriceps contraction and leg extension.
Ankle jerk technique: Foot slightly dorsiflexed to put Achilles on stretch; gentle stroke on the tendon causes sharp plantar flexion.

Clonus

When DTRs are highly sensitized (e.g., UMN lesions), repeated oscillatory contractions occur - clonus. Ankle clonus is elicited by sudden sustained dorsiflexion of the foot. It is pathognomonic of pyramidal system lesions. - S Das Manual of Clinical Surgery, p.280

Golgi Tendon Reflex (inverse myotatic reflex)

Distinct from the DTR. Golgi tendon organs (GTOs) detect muscle tension (not length). When muscle tension becomes excessive, Ib afferent fibers activate spinal inhibitory interneurons, causing the muscle to relax - a protective mechanism against excessive force. This is a polysynaptic reflex. - Guyton & Hall, p.681

Superficial (Cutaneous) Reflexes

Definition & Mechanism

Superficial reflexes are elicited by light stroking or scratching of the skin (not by tendon percussion). They are polysynaptic reflexes mediated through spinal cord interneurons, but are heavily dependent on the integrity of descending UMN (pyramidal/corticospinal) pathways. They are absent or diminished in UMN lesions (opposite to DTRs, which are exaggerated).

Key Superficial Reflexes and Spinal Levels

ReflexHow ElicitedNormal ResponseSpinal Level
Plantar reflexScratch inner/outer border of sole with a pinFlexion (curling) of great toeS1
Abdominal reflexesStroke abdominal wall parallel to costal margins/iliac crestsUmbilicus moves toward the stroked sideT7-T11
Cremasteric reflexScratch skin at upper inner thighTestis drawn upward (cremaster contracts)T12 / L1-L2

The Plantar Reflex and Babinski's Sign

  • Normal response: Great toe flexes (plantar flexion)
  • Babinski's sign (abnormal): Great toe extends (dorsiflexes) with fanning of other toes - indicates pyramidal tract (UMN) lesion. Also physiologically normal in infants whose tracts are not yet myelinated. - S Das, p.279

Abdominal Reflexes

Elicited by stroking the abdominal wall - umbilicus moves toward the stroked area due to contraction of underlying abdominal muscles. Abolished in pyramidal tract lesions. Asymmetric loss localizes the lesion by spinal segment.

Key Clinical Differences: UMN vs. LMN Lesions

FeatureUMN LesionLMN Lesion
Deep tendon reflexesExaggerated (hyperreflexia)Diminished/absent (hyporeflexia)
Superficial reflexesDiminished/absentVariable
Plantar reflexExtensor (Babinski +)Normal flexor
ClonusMay be presentAbsent
ToneSpastic (increased)Flaccid (decreased)
FasciculationsAbsentPresent
"In lesions of the pyramidal system, all deep or tendon reflexes are exaggerated, sometimes so much that a clonus can be elicited; the superficial or skin reflexes are diminished or absent (e.g. abdominal reflexes) or altered as in plantar reflex (Babinski's sign)." - S Das, A Manual on Clinical Surgery, 13th Ed.

Why Testing Both Matters

Testing DTRs provides information about:
  1. Sensory neurons (Ia afferent integrity)
  2. LMN/anterior horn cells
  3. Descending UMN modulatory pathways
Testing superficial reflexes adds sensitivity for pyramidal (UMN) tract dysfunction, since these are suppressed (not exaggerated) by UMN damage - complementing the DTR findings.
Sources: Neuroanatomy through Clinical Cases, 3rd Ed. | Guyton & Hall Medical Physiology | S Das Manual of Clinical Surgery, 13th Ed. | Rheumatology 2022 Elsevier | Adams & Victor's Principles of Neurology

Create a clinical summary table comparing UMN vs LMN findings

Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Excellent data from four authoritative textbooks. Here is the full clinical summary table:

UMN vs. LMN: Clinical Summary Table

FeatureUMN LesionLMN Lesion
Weakness patternGroups of muscles; never individual musclesIndividual muscles may be affected
Muscle toneIncreased - spasticity (acute phase: may be decreased)Decreased - flaccidity
Deep tendon reflexesIncreased (hyperreflexia) - clonus possible (acute phase: may be decreased)Decreased/absent (hyporeflexia/areflexia)
Superficial (cutaneous) reflexesDiminished or absent (e.g. abdominal reflexes)Variable - usually preserved if arc is intact
Plantar reflexExtensor - upgoing (Babinski sign) (expected normally in infants up to 1-2 years)Flexor - downgoing (normal response)
Muscle atrophyAbsent (mild disuse atrophy only, up to ~30%)Pronounced - up to 70% of total bulk
FasciculationsAbsentPresent (spontaneous motor unit firing)
ClonusMay be present (ankle, patellar)Absent
Hoffmann's signMay be presentAbsent
Additional pathological reflexesBabinski, Hoffmann, posturing presentAbsent
Nerve conduction studiesNormalAbnormal (reduced conduction velocity/amplitude)
EMGNo denervation potentialsFibrillations, positive sharp waves, fasciculation potentials
GaitSpastic gait (scissor/circumduction)Steppage gait (foot drop), waddling gait
Affected levelCerebral cortex, internal capsule, brainstem, corticospinal tract (before anterior horn)Anterior horn cells, nerve roots, peripheral nerve, NMJ, muscle
Common causesStroke, MS, spinal cord compression, brain tumors, cerebral palsyPolio, GBS, peripheral neuropathy, motor neuron disease (anterior horn), radiculopathy

Important Caveats

Acute UMN lesion (spinal shock): Immediately after an acute UMN lesion (e.g., spinal cord injury, acute stroke), the classic picture is paradoxically flaccid with depressed reflexes. Spasticity and hyperreflexia develop over hours to months as the spinal cord "escapes" from shock. The first pathological reflexes to return are the delayed plantar reflex, then the bulbocavernosus and cremasteric reflexes.
ALS (Amyotrophic Lateral Sclerosis): Both UMN and LMN signs coexist - hyperreflexia/Babinski (UMN) alongside fasciculations/atrophy (LMN) - a diagnostically important combination.
Infants: Babinski sign and increased tone with decreased reflexes (hypotonia) are the UMN pattern - note that an upgoing plantar reflex is normal until 1-2 years due to incomplete myelination.

Anatomical Localization Aid

CEREBRAL CORTEX / INTERNAL CAPSULE
           ↓  (corticospinal tract)
      BRAINSTEM
           ↓
    SPINAL CORD (before anterior horn)  ← UMN lesions above this
           ↓
    ANTERIOR HORN CELLS                 ← LMN lesions start here
           ↓
    NERVE ROOT / PERIPHERAL NERVE
           ↓
    NEUROMUSCULAR JUNCTION
           ↓
       MUSCLE
Sources: Neuroanatomy through Clinical Cases 3rd Ed. (Table 6.4 & 3.3) | Adams & Victor's Principles of Neurology 12th Ed. (Table 3-1) | Harriet Lane Handbook 23rd Ed. | S Das Manual of Clinical Surgery 13th Ed.

Give me a detailed description of tracts of spinal cord including ascending descending pyramidal and extrapyramidal tract

Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Loading Image
Reading File
Finding Sources
I now have comprehensive data from Gray's Anatomy for Students, Guyton & Hall, Localization in Clinical Neurology, and other textbooks. Here is the complete detailed answer:

Spinal Cord Tracts - Detailed Description

Ascending and descending tracts in a cross-section of the spinal cord - showing fasciculus gracilis, fasciculus cuneatus, Lissauer's tract, spinocerebellar tracts, spinothalamic tract (ascending); and lateral corticospinal, rubrospinal, vestibulospinal, reticulospinal, tectospinal, ventral corticospinal tracts (descending)
eFig. 9.42 - Tracts in the Spinal Cord. Ascending tracts shown on the left, descending tracts on the right. - Gray's Anatomy for Students

OVERVIEW

The spinal cord white matter is divided into three funiculi (columns):
  • Posterior (dorsal) funiculus - mainly ascending sensory tracts
  • Lateral funiculus - both ascending and descending tracts
  • Anterior (ventral) funiculus - mainly descending motor tracts

ASCENDING TRACTS (Sensory)

Sensory information travels through a 3-neuron chain: peripheral receptor → spinal cord → thalamus → cortex.

1. Posterior Column - Medial Lemniscal Pathway

Location: Posterior (dorsal) funiculus
Modalities carried: Fine/discriminative touch, vibration, two-point discrimination, conscious proprioception (joint position sense), stereognosis
Sub-divisions:
  • Fasciculus Gracilis (medial): carries input from lower limb and lower trunk (below T6). Fibers from S, L, lower T segments.
  • Fasciculus Cuneatus (lateral): carries input from upper limb, upper trunk, and neck (above T6). Fibers from upper T, C segments.
Course (3 neurons):
  1. 1st order neuron: Cell body in dorsal root ganglion → enters posterior horn → ascends ipsilaterally in posterior column → synapses in nucleus gracilis / nucleus cuneatus in the caudal medulla
  2. 2nd order neuron: Axons cross as internal arcuate fibers → form the medial lemniscus (contralateral medulla) → ascend to VPL nucleus of thalamus
  3. 3rd order neuron: VPL thalamus → through posterior limb of internal capsule → primary somatosensory cortex (postcentral gyrus)
Key point: Decussation occurs in the medulla - so lesions above the medulla cause contralateral sensory loss; lesions in the cord cause ipsilateral loss.

2. Anterolateral System (Spinothalamic Tract)

Location: Anterior and lateral funiculi
Modalities carried: Pain, temperature, crude touch, pressure
Composed of three tracts:

a) Spinothalamic Tract (main)

Course (3 neurons):
  1. 1st order neuron: Cell body in dorsal root ganglion → enters posterior horn → ascends/descends 1-2 segments in Lissauer's tract → synapses in laminae I and V of posterior horn
  2. 2nd order neuron: Axon crosses obliquely over 2-3 spinal segments through the anterior white commissure → joins the contralateral anterolateral column → ascends to VPL nucleus of thalamus
  3. 3rd order neuron: VPL thalamus → posterior limb of internal capsule → primary somatosensory cortex
Key point: Decussation is intrasegmental (within the cord) - a central cord lesion (e.g., syringomyelia) destroys crossing fibers at the affected levels, causing a "cape-like" suspended sensory loss for pain and temperature.

b) Spinoreticular Tract

  • Carries the emotional/affective components of pain
  • 2nd order axons project to the reticular formation in the brainstem (not the thalamus)

c) Spinomesencephalic Tract

  • Projects to periaqueductal gray (PAG) and superior colliculi
  • Involved in central pain modulation (endogenous analgesia)

3. Spinocerebellar Tracts (Subconscious Proprioception)

Modality: Unconscious proprioception from muscles and joints (not reaching consciousness)
TractOriginDecussationLocationCarries
Dorsal spinocerebellarClarke's nucleus (T1-L2)None - ipsilateralLateral funiculus (posterior)Unconscious proprioception from trunk and ipsilateral lower limb
Ventral spinocerebellarSpinal border cells (lumbosacral)Crosses twice (net ipsilateral)Lateral funiculus (anterior)Proprioception from lower limb
CuneocerebellarExternal arcuate nucleus (medulla)None - ipsilateral-Proprioception from upper limb (above T6)
Both dorsal and ventral tracts project to the ipsilateral cerebellar cortex (via inferior and superior cerebellar peduncles respectively).

DESCENDING TRACTS (Motor)

Divided into Lateral Motor System and Medial Motor System. These can also be classified as Pyramidal and Extrapyramidal.

PYRAMIDAL TRACT (Corticospinal Tract)

The pyramidal tract is the direct voluntary motor pathway from cortex to spinal cord.

Origin

  • ~30% from primary motor cortex (precentral gyrus, area 4)
  • ~30% from premotor and supplementary motor areas (area 6)
  • ~40% from somatosensory cortex (parietal lobe, areas 1, 2, 3)
The most notable fibers arise from Betz cells (giant pyramidal neurons, ~60 μm diameter) in the primary motor cortex - only ~34,000 per tract, representing just 3% of the total 1 million fibers. They conduct at ~70 m/sec.

Course

Primary Motor Cortex (precentral gyrus)
       ↓
Corona Radiata
       ↓
Posterior limb of Internal Capsule
(between caudate nucleus and putamen)
       ↓
Crus Cerebri (midbrain)
       ↓
Anterior Pons (small scattered bundles)
       ↓
Medullary Pyramids (forms the "pyramid" bulge)
       ↓
Pyramidal Decussation (cervicomedullary junction)
    ↙ (85-90% cross)        ↘ (10-15% stay)
Lateral Corticospinal      Anterior Corticospinal
Tract (contralateral       Tract (ipsilateral
lateral funiculus)         anterior funiculus)
       ↓                           ↓
Interneurons and LMNs      Crosses later in
(lateral anterior horn)    cervical/upper thoracic cord
       ↓                    (controls bilateral axial muscles)
Skeletal muscle
(distal limb movements)

Key Features

  • Controls fine, discrete, distal limb movements (especially fingers and hands)
  • Terminates on interneurons of intermediate zones AND directly on anterior horn LMNs
  • Has somatotopic organization throughout its course (leg medial, arm lateral in the cord)
  • Damage → UMN signs (spasticity, hyperreflexia, Babinski sign)

EXTRAPYRAMIDAL TRACTS

These are all descending motor tracts other than the corticospinal (pyramidal) tract. They travel outside the pyramids and work via indirect pathways involving the basal ganglia, brainstem nuclei, cerebellum, and reticular formation. They control posture, balance, tone, and automatic/stereotyped movements.

LATERAL MOTOR SYSTEM

1. Rubrospinal Tract

FeatureDetail
OriginRed nucleus (magnocellular division), midbrain tegmentum
DecussationVentral tegmental decussation - immediately crosses in midbrain
Location in cordLateral funiculus (just anterior to lateral corticospinal tract)
TerminationCervical cord only (in humans) - interneurons of anterior horn
FunctionControls movement of contralateral upper limbs; facilitates flexors, inhibits extensors
The motor cortex sends fibers to the red nucleus via the corticorubral tract. The combined corticospinal + rubrospinal system forms the lateral motor system - controlling distal limb musculature. When the corticospinal tract is damaged, some discrete movement remains via this route (except fine finger control). - Guyton & Hall, p.690

MEDIAL MOTOR SYSTEM

The medial system controls axial and proximal muscles - posture, balance, and head/neck orientation. All four tracts project bilaterally to medial anterior horn interneurons.

2. Anterior Corticospinal Tract

FeatureDetail
OriginPrimary motor cortex (uncrossed fibers from pyramidal decussation)
LocationAnterior funiculus, near anterior median fissure
TerminationUpper thoracic levels; crosses within the cord to synapse bilaterally
FunctionBilateral control of axial (postural) muscles

3. Vestibulospinal Tract

FeatureDetail
Origin (medial)Medial vestibular nucleus → projects bilaterally to thoracic levels
Origin (lateral)Lateral vestibular nucleus → descends ipsilaterally down entire cord
LocationAnterior funiculus
InputReceives from inner ear (vestibular organ) and cerebellum
FunctionFacilitates extensor/antigravity muscles, inhibits flexors - essential for maintaining balance and upright posture; mediates righting reflexes

4. Reticulospinal Tracts

FeatureDetail
Pontine reticulospinalFrom pontine reticular formation → descends ipsilaterally → facilitates extensors
Medullary reticulospinalFrom medullary reticular formation → descends bilaterally → inhibits extensors
LocationAnterior and lateral funiculi
FunctionRegulates voluntary movement, reflex activity, muscle tone, and autonomic outflow
Together, the reticulospinal tracts form the final pathway through which the basal ganglia and cerebellum exert their influence on spinal motor neurons.

5. Tectospinal Tract

FeatureDetail
OriginSuperior colliculus (dorsal midbrain)
DecussationDorsal tegmental decussation
LocationAnterior funiculus, near median fissure
TerminationCervical cord only
FunctionReflex postural movements of head and neck in response to visual stimuli

Summary Comparison Table

TractTypeColumnOriginDecussationModality/Function
Fasciculus gracilisAscendingPosteriorDRG (below T6)MedullaFine touch, vibration, proprioception (lower limb)
Fasciculus cuneatusAscendingPosteriorDRG (above T6)MedullaFine touch, vibration, proprioception (upper limb)
SpinothalamicAscendingAnterolateralPosterior hornSpinal cord (anterior commissure)Pain, temperature, crude touch
Dorsal spinocerebellarAscendingLateral (post.)Clarke's nucleusNone (ipsilateral)Unconscious proprioception (lower limb)
Ventral spinocerebellarAscendingLateral (ant.)Spinal border cellsTwice (net ipsilateral)Unconscious proprioception (lower limb)
Lateral corticospinalDescending (Pyramidal)LateralMotor cortexPyramidal decussation (medulla)Voluntary fine movement (contralateral distal limbs)
Anterior corticospinalDescending (Pyramidal)AnteriorMotor cortexWithin cord (bilateral)Axial/postural movements
RubrospinalDescending (Extrapyramidal)LateralRed nucleusMidbrain (ventral tegmental)Flexor facilitation, distal limb control
VestibulospinalDescending (Extrapyramidal)AnteriorVestibular nucleiNone (ipsilateral)Extensor facilitation, balance
ReticulospinalDescending (Extrapyramidal)Anterior/LateralPontine/medullary RFIpsilateralTone, autonomic, voluntary movement modulation
TectospinalDescending (Extrapyramidal)AnteriorSuperior colliculusMidbrain (dorsal tegmental)Head/neck reflexes to visual stimuli

Clinical Correlations

LesionTracts AffectedClinical Picture
Brown-Séquard syndrome (hemisection)Ipsilateral: posterior column + lateral CST; Contralateral: spinothalamicIpsilateral: fine touch/proprioception loss + UMN signs; Contralateral: pain/temperature loss
Central cord syndrome (syringomyelia)Crossing spinothalamic fibers at affected levels"Cape-like" suspended loss of pain and temperature; spares posterior column
Posterior column lesion (tabes dorsalis, B12 deficiency)Fasciculus gracilis/cuneatusLoss of vibration, proprioception; sensory ataxia, positive Romberg
Anterior cord syndromeBilateral spinothalamic + anterior CSTLoss of pain/temperature + motor paralysis below lesion; posterior column spared
ALSLateral CST + anterior horn cellsCombined UMN + LMN signs
Sources: Gray's Anatomy for Students | Guyton & Hall Medical Physiology | Neuroanatomy through Clinical Cases 3rd Ed. | Localization in Clinical Neurology 8th Ed. | Adams & Victor's Principles of Neurology

Generate a study guide on spinal cord tracts (DOCX or PDF)

Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null && ls /home/daytona/skills/docx/scripts/…

Running Command

mkdir -p /home/daytona/workspace/spinal-cord-study-guide && node -e "require('do…

Writing File

~/spinal-cord-study-guide/generate.js

const {
  Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
  HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
  VerticalAlign, PageNumber, Header, Footer, TabStopType, TabStopPosition,
  PageBreak, UnderlineType
} = require('docx');
const fs = require('fs');

// ── Colour palette ──────────────────────────────────────────────────────────
const BLUE_DARK  = "1A3A5C";   // headings
const BLUE_MID   = "2E6DA4";   // sub-headings / accent
const BLUE_LIGHT = "D9E8F5";   // table header shading
const GREEN_DARK = "1B5E20";   // ascending tract headers
const GREEN_LIGHT= "E8F5E9";   // ascending shading
const RED_DARK   = "B71C1C";   // descending tract headers
const RED_LIGHT  = "FFEBEE";   // descending shading
const GREY_LIGHT = "F5F5F5";   // alternating table rows
const WHITE      = "FFFFFF";

// ── Helper: bold coloured text run ─────────────────────────────────────────
const h = (text, color = BLUE_DARK, size = 24) =>
  new TextRun({ text, bold: true, color, size });

const t = (text, opts = {}) =>
  new TextRun({ text, size: opts.size || 20, color: opts.color || "000000",
    bold: opts.bold || false, italics: opts.italics || false });

// ── Helper: heading paragraph ───────────────────────────────────────────────
function heading1(text) {
  return new Paragraph({
    heading: HeadingLevel.HEADING_1,
    spacing: { before: 300, after: 120 },
    children: [new TextRun({ text, bold: true, color: BLUE_DARK, size: 32, font: "Calibri" })]
  });
}
function heading2(text, color = BLUE_MID) {
  return new Paragraph({
    heading: HeadingLevel.HEADING_2,
    spacing: { before: 240, after: 80 },
    children: [new TextRun({ text, bold: true, color, size: 26, font: "Calibri" })]
  });
}
function heading3(text, color = "2C3E50") {
  return new Paragraph({
    heading: HeadingLevel.HEADING_3,
    spacing: { before: 160, after: 60 },
    children: [new TextRun({ text, bold: true, color, size: 22, font: "Calibri" })]
  });
}
function para(text, opts = {}) {
  return new Paragraph({
    spacing: { before: 60, after: 60 },
    alignment: opts.align || AlignmentType.LEFT,
    children: [new TextRun({ text, size: opts.size || 20, color: opts.color || "000000",
      bold: opts.bold || false, italics: opts.italics || false, font: "Calibri" })]
  });
}
function bullet(text, level = 0) {
  return new Paragraph({
    bullet: { level },
    spacing: { before: 40, after: 40 },
    children: [new TextRun({ text, size: 20, font: "Calibri" })]
  });
}
function spacer() {
  return new Paragraph({ spacing: { before: 60, after: 60 }, children: [new TextRun({ text: "" })] });
}
function pageBreak() {
  return new Paragraph({ children: [new PageBreak()] });
}
function note(text) {
  return new Paragraph({
    spacing: { before: 80, after: 80 },
    indent: { left: 360 },
    children: [
      new TextRun({ text: "⚠ Clinical Note: ", bold: true, color: RED_DARK, size: 20, font: "Calibri" }),
      new TextRun({ text, size: 20, italics: true, color: "4A4A4A", font: "Calibri" })
    ]
  });
}

// ── Helper: shaded cell ─────────────────────────────────────────────────────
function cell(text, opts = {}) {
  return new TableCell({
    width: opts.width ? { size: opts.width, type: WidthType.PERCENTAGE } : undefined,
    verticalAlign: VerticalAlign.CENTER,
    shading: opts.shade ? { fill: opts.shade, type: ShadingType.SOLID } : undefined,
    children: [new Paragraph({
      alignment: AlignmentType.LEFT,
      spacing: { before: 60, after: 60 },
      children: [new TextRun({
        text,
        bold: opts.bold || false,
        size: opts.size || 18,
        color: opts.color || "000000",
        font: "Calibri"
      })]
    })]
  });
}

// ── Helper: table with header row ────────────────────────────────────────────
function makeTable(headers, rows, headerShade = BLUE_LIGHT) {
  const headerRow = new TableRow({
    tableHeader: true,
    children: headers.map(h => cell(h, { bold: true, shade: headerShade, color: "1A3A5C", size: 19 }))
  });
  const dataRows = rows.map((row, ri) =>
    new TableRow({
      children: row.map(cellText => cell(cellText, { shade: ri % 2 === 0 ? WHITE : GREY_LIGHT }))
    })
  );
  return new Table({
    width: { size: 100, type: WidthType.PERCENTAGE },
    borders: {
      top:    { style: BorderStyle.SINGLE, size: 4, color: BLUE_MID },
      bottom: { style: BorderStyle.SINGLE, size: 4, color: BLUE_MID },
      left:   { style: BorderStyle.SINGLE, size: 4, color: BLUE_MID },
      right:  { style: BorderStyle.SINGLE, size: 4, color: BLUE_MID },
      insideH:{ style: BorderStyle.SINGLE, size: 1, color: "CCCCCC" },
      insideV:{ style: BorderStyle.SINGLE, size: 1, color: "CCCCCC" },
    },
    rows: [headerRow, ...dataRows]
  });
}

// ═══════════════════════════════════════════════════════════════════════════
// DOCUMENT CONTENT
// ═══════════════════════════════════════════════════════════════════════════

const children = [

  // ── TITLE PAGE ─────────────────────────────────────────────────────────
  new Paragraph({
    alignment: AlignmentType.CENTER,
    spacing: { before: 600, after: 200 },
    children: [new TextRun({ text: "SPINAL CORD TRACTS", bold: true, size: 52, color: BLUE_DARK, font: "Calibri" })]
  }),
  new Paragraph({
    alignment: AlignmentType.CENTER,
    spacing: { before: 0, after: 120 },
    children: [new TextRun({ text: "Comprehensive Study Guide", size: 32, color: BLUE_MID, font: "Calibri", italics: true })]
  }),
  new Paragraph({
    alignment: AlignmentType.CENTER,
    spacing: { before: 0, after: 80 },
    children: [new TextRun({ text: "Ascending • Descending • Pyramidal • Extrapyramidal", size: 24, color: "555555", font: "Calibri" })]
  }),
  new Paragraph({
    alignment: AlignmentType.CENTER,
    spacing: { before: 200, after: 0 },
    children: [new TextRun({ text: "Sources: Gray's Anatomy for Students | Guyton & Hall Medical Physiology |", size: 18, color: "888888", font: "Calibri", italics: true })]
  }),
  new Paragraph({
    alignment: AlignmentType.CENTER,
    spacing: { before: 0, after: 0 },
    children: [new TextRun({ text: "Neuroanatomy through Clinical Cases 3e | Adams & Victor's Principles of Neurology", size: 18, color: "888888", font: "Calibri", italics: true })]
  }),
  pageBreak(),

  // ── SECTION 1: OVERVIEW ────────────────────────────────────────────────
  heading1("1. Overview of Spinal Cord White Matter"),
  para("The spinal cord white matter is divided into three funiculi (columns), each containing specific ascending and descending tracts:"),
  spacer(),
  makeTable(
    ["Funiculus (Column)", "Location", "Main Tracts"],
    [
      ["Posterior (Dorsal)", "Between posterior horns", "Fasciculus gracilis, Fasciculus cuneatus"],
      ["Lateral", "Between anterior and posterior horns", "Lateral corticospinal, Rubrospinal, Spinothalamic, Spinocerebellar"],
      ["Anterior (Ventral)", "Between anterior horns", "Anterior corticospinal, Vestibulospinal, Reticulospinal, Tectospinal"],
    ]
  ),
  spacer(),
  para("General Rules:", { bold: true }),
  bullet("Ascending tracts carry sensory information from periphery → brain"),
  bullet("Descending tracts carry motor commands from brain → spinal cord"),
  bullet("Most tracts decussate (cross midline) at some point — lesion side vs. symptom side depends on where"),
  bullet("Sensory pathways use a 3-neuron chain: 1st order → 2nd order → 3rd order neuron"),
  pageBreak(),

  // ── SECTION 2: ASCENDING TRACTS ────────────────────────────────────────
  heading1("2. Ascending (Sensory) Tracts"),
  para("Sensory information travels via a 3-neuron relay: (1) Dorsal root ganglion → (2) Thalamus → (3) Somatosensory cortex."),
  spacer(),

  // 2A – Posterior Column
  heading2("2A. Posterior Column – Medial Lemniscal Pathway", GREEN_DARK),
  makeTable(
    ["Feature", "Details"],
    [
      ["Location", "Posterior funiculus"],
      ["Modalities", "Fine/discriminative touch, vibration, 2-point discrimination, conscious proprioception, stereognosis"],
      ["Sub-divisions", "Fasciculus Gracilis (medial) — lower limb & trunk below T6\nFasciculus Cuneatus (lateral) — upper limb & trunk above T6"],
      ["1st Order Neuron", "Cell body in dorsal root ganglion → enters posterior horn → ascends IPSILATERALLY → nucleus gracilis / cuneatus (caudal medulla)"],
      ["2nd Order Neuron", "Crosses as internal arcuate fibers → forms medial lemniscus (contralateral) → ascends to VPL nucleus of thalamus"],
      ["3rd Order Neuron", "VPL thalamus → posterior limb of internal capsule → primary somatosensory cortex (postcentral gyrus, areas 1, 2, 3)"],
      ["Decussation Site", "Medulla (nucleus gracilis / cuneatus level)"],
      ["Lesion Effect", "IPSILATERAL loss of fine touch, vibration, proprioception BELOW the lesion level"],
    ],
    GREEN_LIGHT
  ),
  spacer(),
  note("In posterior column lesions (e.g., tabes dorsalis, B12 deficiency, MS): sensory ataxia, positive Romberg's sign, loss of vibration and joint position sense."),
  spacer(),

  // 2B – Spinothalamic
  heading2("2B. Anterolateral System — Spinothalamic Tract", GREEN_DARK),
  makeTable(
    ["Feature", "Details"],
    [
      ["Location", "Anterolateral column (lateral and anterior funiculi)"],
      ["Modalities", "Pain, temperature, crude touch, pressure"],
      ["1st Order Neuron", "DRG cell body → posterior horn → ascends/descends 1-2 segments in Lissauer's tract → synapses in laminae I and V"],
      ["2nd Order Neuron", "Crosses OBLIQUELY over 2-3 segments via anterior white commissure → joins contralateral anterolateral tract → VPL thalamus"],
      ["3rd Order Neuron", "VPL thalamus → posterior limb of internal capsule → primary somatosensory cortex"],
      ["Decussation Site", "Spinal cord (anterior white commissure) — 2-3 segments above entry level"],
      ["Lesion Effect", "CONTRALATERAL loss of pain and temperature, 1-2 levels below the lesion"],
    ],
    GREEN_LIGHT
  ),
  spacer(),
  note("Central cord lesion (syringomyelia) destroys crossing fibers at affected levels → cape-like / suspended loss of pain and temperature bilaterally, sparing posterior column (dissociated sensory loss)."),
  spacer(),

  // 2B2 – Spinoreticular / spinomesencephalic
  heading3("Spinoreticular and Spinomesencephalic Tracts"),
  bullet("Spinoreticular tract: carries emotional/affective aspects of pain → reticular formation in brainstem (not thalamus)"),
  bullet("Spinomesencephalic tract: projects to periaqueductal gray (PAG) → central pain modulation / endogenous analgesia"),
  spacer(),

  // 2C – Spinocerebellar
  heading2("2C. Spinocerebellar Tracts (Subconscious Proprioception)", GREEN_DARK),
  para("These tracts carry unconscious proprioceptive information from muscles, joints, and tendons to the cerebellum (NOT to conscious cortical awareness)."),
  spacer(),
  makeTable(
    ["Tract", "Origin", "Decussation", "Column", "Peduncle", "Function"],
    [
      ["Dorsal (posterior) spinocerebellar", "Clarke's nucleus (T1–L2)", "None — ipsilateral", "Lateral (posterior)", "Inferior cerebellar", "Unconscious proprioception: trunk + ipsilateral lower limb"],
      ["Ventral (anterior) spinocerebellar", "Spinal border cells (lumbosacral)", "Crosses twice (net ipsilateral)", "Lateral (anterior)", "Superior cerebellar", "Proprioception from lower limb during locomotion"],
      ["Cuneocerebellar", "External arcuate nucleus (medulla)", "None — ipsilateral", "—", "Inferior cerebellar", "Proprioception from upper limb & neck (above T6)"],
    ],
    GREEN_LIGHT
  ),
  spacer(),
  note("Spinocerebellar tract lesions (e.g., Friedreich's ataxia) produce cerebellar ataxia, nystagmus, dysarthria, and loss of coordination without loss of conscious proprioception."),
  pageBreak(),

  // ── SECTION 3: DESCENDING TRACTS ───────────────────────────────────────
  heading1("3. Descending (Motor) Tracts"),
  para("Divided into two major systems based on location and function:"),
  bullet("Lateral motor system: controls distal limb movements (fine, skilled)"),
  bullet("Medial motor system: controls axial/proximal muscles (posture, balance, automatic movement)"),
  spacer(),

  // 3A – Pyramidal
  heading2("3A. PYRAMIDAL TRACT (Corticospinal Tract)", RED_DARK),
  para("The direct voluntary motor pathway from cortex to spinal cord. The most clinically important descending tract."),
  spacer(),
  heading3("Origin"),
  bullet("~30% from primary motor cortex (precentral gyrus, area 4) — including giant Betz cells"),
  bullet("~30% from premotor and supplementary motor areas (area 6)"),
  bullet("~40% from somatosensory cortex (areas 1, 2, 3)"),
  bullet("Total fibers per tract: >1 million; Betz cell fibers: only ~34,000 (3%) — conduct at ~70 m/sec"),
  spacer(),
  heading3("Course"),
  makeTable(
    ["Level", "Structure", "Notes"],
    [
      ["Cortex", "Primary motor cortex", "Betz cells (60 μm), somatotopic map (homunculus)"],
      ["Cerebral hemisphere", "Corona radiata → posterior limb of internal capsule", "Leg (posterior), arm (middle), face (anterior) arrangement"],
      ["Midbrain", "Crus cerebri (basis pedunculi)", "Middle 3/5 of crus cerebri"],
      ["Pons", "Scattered bundles in basis pontis", "Separated by transverse pontocerebellar fibers"],
      ["Medulla", "Medullary pyramid", "Forms visible bulge = 'pyramid'"],
      ["Cervicomedullary junction", "Pyramidal decussation", "85-90% cross → Lateral corticospinal tract; 10-15% stay → Anterior corticospinal tract"],
      ["Spinal cord (lateral)", "Lateral corticospinal tract (lateral funiculus)", "Controls contralateral distal limbs — most important"],
      ["Spinal cord (anterior)", "Anterior corticospinal tract (anterior funiculus)", "Crosses later in cervical cord; controls bilateral axial muscles"],
      ["Termination", "Anterior horn interneurons (mainly) + some direct α-motor neurons", "Direct LMN synapses more prominent in humans than animals"],
    ],
    RED_LIGHT
  ),
  spacer(),
  heading3("Somatotopic Organisation in the Lateral Corticospinal Tract"),
  para("Leg fibers are most lateral (near cord surface); arm fibers are medial. This explains why central tumors/MS plaques may affect legs first."),
  spacer(),
  note("Damage to the pyramidal tract above the decussation → contralateral spastic hemiplegia (UMN signs: hyperreflexia, Babinski, spasticity). Damage below the decussation → ipsilateral UMN signs."),
  spacer(),

  // 3B – Extrapyramidal
  heading2("3B. EXTRAPYRAMIDAL TRACTS", RED_DARK),
  para("All descending motor tracts other than the corticospinal tract. They travel outside the medullary pyramids. They modulate posture, tone, balance, and automatic movements via indirect pathways through the basal ganglia, cerebellum, and brainstem nuclei."),
  spacer(),

  // Rubrospinal
  heading3("i. Rubrospinal Tract   [Lateral Motor System]"),
  makeTable(
    ["Feature", "Details"],
    [
      ["Origin", "Red nucleus — magnocellular division, midbrain tegmentum"],
      ["Decussation", "Ventral tegmental decussation — immediately crosses in midbrain"],
      ["Location in cord", "Lateral funiculus — just anterior to lateral corticospinal tract"],
      ["Termination", "Cervical cord only (in humans) — interneurons of lateral anterior horn"],
      ["Input", "Receives from motor cortex (corticorubral tract) and cerebellum"],
      ["Function", "Controls contralateral upper limb movement; facilitates flexors, inhibits extensors"],
      ["Clinical relevance", "Partially compensates when corticospinal tract is damaged (wrist/hand movement may persist)"],
    ],
    RED_LIGHT
  ),
  spacer(),

  // Anterior corticospinal
  heading3("ii. Anterior Corticospinal Tract   [Medial Motor System]"),
  makeTable(
    ["Feature", "Details"],
    [
      ["Origin", "Motor cortex — uncrossed fibers from pyramidal decussation"],
      ["Location in cord", "Anterior funiculus, near anterior median fissure"],
      ["Decussation", "Crosses within cervical/upper thoracic cord"],
      ["Termination", "Upper thoracic levels — bilateral, medial anterior horn"],
      ["Function", "Bilateral control of axial/postural muscles"],
    ],
    RED_LIGHT
  ),
  spacer(),

  // Vestibulospinal
  heading3("iii. Vestibulospinal Tract   [Medial Motor System]"),
  makeTable(
    ["Feature", "Details"],
    [
      ["Origin (medial)", "Medial vestibular nucleus → bilateral, to thoracic cord"],
      ["Origin (lateral)", "Lateral vestibular nucleus (Deiter's nucleus) → ipsilateral, entire cord"],
      ["Location in cord", "Anterior funiculus"],
      ["Input", "Inner ear (vestibular organ) + cerebellum"],
      ["Function", "FACILITATES extensors/antigravity muscles; INHIBITS flexors — maintains balance and upright posture; mediates righting reflexes"],
      ["Example", "Tripping → vestibulospinal reflex extends limbs to prevent fall"],
    ],
    RED_LIGHT
  ),
  spacer(),

  // Reticulospinal
  heading3("iv. Reticulospinal Tracts   [Medial Motor System]"),
  makeTable(
    ["Feature", "Pontine Reticulospinal", "Medullary Reticulospinal"],
    [
      ["Origin", "Pontine reticular formation", "Medullary reticular formation"],
      ["Laterality", "Ipsilateral", "Bilateral"],
      ["Location", "Anterior funiculus", "Anterior/lateral funiculus"],
      ["Effect on extensors", "FACILITATES extensors", "INHIBITS extensors"],
      ["Function", "Muscle tone, voluntary movement, gait", "Modulates tone, autonomic outflow, reflexes"],
    ],
    RED_LIGHT
  ),
  spacer(),
  note("Reticulospinal tracts are the final common pathway for basal ganglia and cerebellar influences on spinal motor neurons."),
  spacer(),

  // Tectospinal
  heading3("v. Tectospinal Tract   [Medial Motor System]"),
  makeTable(
    ["Feature", "Details"],
    [
      ["Origin", "Superior colliculus — dorsal midbrain"],
      ["Decussation", "Dorsal tegmental decussation — crosses in midbrain"],
      ["Location in cord", "Anterior funiculus, near anterior median fissure"],
      ["Termination", "Cervical cord only — interneurons in anterior horn"],
      ["Function", "Reflex postural movements of head and neck in response to VISUAL and auditory stimuli"],
    ],
    RED_LIGHT
  ),
  pageBreak(),

  // ── SECTION 4: MASTER COMPARISON TABLE ─────────────────────────────────
  heading1("4. Master Summary Table — All Spinal Cord Tracts"),
  spacer(),
  makeTable(
    ["Tract", "Type", "Column", "Origin", "Decussation", "Modality / Function"],
    [
      ["Fasciculus gracilis", "Ascending", "Posterior", "DRG (below T6)", "Medulla", "Fine touch, vibration, proprioception (lower limb/trunk)"],
      ["Fasciculus cuneatus", "Ascending", "Posterior", "DRG (above T6)", "Medulla", "Fine touch, vibration, proprioception (upper limb/neck)"],
      ["Spinothalamic", "Ascending", "Anterolateral", "Posterior horn (I, V)", "Spinal cord (ant. commissure)", "Pain, temperature, crude touch"],
      ["Spinoreticular", "Ascending", "Anterolateral", "Posterior horn", "Spinal cord", "Emotional/affective pain component"],
      ["Spinomesencephalic", "Ascending", "Anterolateral", "Posterior horn", "Spinal cord", "Endogenous pain modulation (PAG)"],
      ["Dorsal spinocerebellar", "Ascending", "Lateral (post.)", "Clarke's nucleus (T1-L2)", "None (ipsilateral)", "Unconscious proprioception — lower limb"],
      ["Ventral spinocerebellar", "Ascending", "Lateral (ant.)", "Spinal border cells", "Twice (net ipsilateral)", "Unconscious proprioception — lower limb"],
      ["Lateral corticospinal", "Descending (Pyramidal)", "Lateral", "Motor cortex", "Pyramidal decussation (medulla)", "Voluntary fine movement — contralateral distal limbs"],
      ["Anterior corticospinal", "Descending (Pyramidal)", "Anterior", "Motor cortex", "Within cord (bilateral)", "Bilateral axial/postural movements"],
      ["Rubrospinal", "Descending (Extrapyramidal)", "Lateral", "Red nucleus (midbrain)", "Ventral tegmental decussation", "Flexor facilitation — contralateral upper limb"],
      ["Vestibulospinal (lateral)", "Descending (Extrapyramidal)", "Anterior", "Lateral vestibular nucleus", "None (ipsilateral)", "Extensor facilitation — balance, posture"],
      ["Reticulospinal (pontine)", "Descending (Extrapyramidal)", "Anterior", "Pontine RF", "Ipsilateral", "Facilitates extensors; modulates tone"],
      ["Reticulospinal (medullary)", "Descending (Extrapyramidal)", "Ant./Lateral", "Medullary RF", "Bilateral", "Inhibits extensors; autonomic outflow"],
      ["Tectospinal", "Descending (Extrapyramidal)", "Anterior", "Superior colliculus", "Dorsal tegmental decussation", "Head/neck reflexes to visual stimuli"],
    ]
  ),
  pageBreak(),

  // ── SECTION 5: CLINICAL SYNDROMES ──────────────────────────────────────
  heading1("5. Clinical Cord Syndromes"),
  spacer(),
  makeTable(
    ["Syndrome", "Tracts Affected", "Ipsilateral Findings", "Contralateral Findings", "Cause"],
    [
      [
        "Brown-Séquard\n(Cord Hemisection)",
        "Posterior column + lateral CST (ipsilateral)\nSpingothalamic (contralateral)",
        "Loss of fine touch, vibration, proprioception\nUMN motor weakness below lesion",
        "Loss of pain and temperature (1-2 levels below lesion)",
        "Stab wound, MS, tumor, radiation"
      ],
      [
        "Central Cord Syndrome\n(Syringomyelia)",
        "Crossing spinothalamic fibers at affected levels",
        "Cape-like loss of pain and temperature\nPosterior column intact (spared)",
        "Same — bilateral symmetric loss",
        "Syrinx, hyperextension injury, tumor"
      ],
      [
        "Anterior Cord Syndrome",
        "Bilateral spinothalamic +\nanterior corticospinal tract",
        "Motor paralysis + loss of pain/temp below lesion",
        "Same — bilateral",
        "Anterior spinal artery infarction, disc herniation"
      ],
      [
        "Posterior Column Syndrome\n(Dorsal Column Syndrome)",
        "Fasciculus gracilis and/or cuneatus",
        "Loss of vibration, proprioception, fine touch\nSensory ataxia, Romberg+",
        "None (no contralateral deficit)",
        "Tabes dorsalis, B12 deficiency, MS, Friedreich's ataxia"
      ],
      [
        "Complete Cord Transection",
        "All tracts",
        "Spinal shock initially → then spastic paraplegia/quadriplegia",
        "Bilateral total loss below lesion",
        "Trauma, tumour"
      ],
      [
        "Subacute Combined\nDegeneration (B12 def.)",
        "Posterior columns + lateral\ncorticospinal tracts",
        "Sensory ataxia + UMN signs (combined)",
        "Bilateral involvement",
        "B12 deficiency (pernicious anaemia)"
      ],
    ]
  ),
  pageBreak(),

  // ── SECTION 6: UMN vs LMN ──────────────────────────────────────────────
  heading1("6. UMN vs LMN — Quick Reference"),
  spacer(),
  makeTable(
    ["Feature", "UMN Lesion", "LMN Lesion"],
    [
      ["Weakness pattern", "Groups of muscles", "Individual muscles possible"],
      ["Muscle tone", "Increased (spasticity)\n[Acute: may be decreased]", "Decreased (flaccidity)"],
      ["Deep tendon reflexes", "Increased (hyperreflexia)\nClonus possible", "Decreased / absent"],
      ["Superficial reflexes", "Diminished or absent", "Variable"],
      ["Plantar reflex", "Extensor — Babinski sign", "Flexor (normal)"],
      ["Atrophy", "Mild (disuse only)", "Pronounced (up to 70%)"],
      ["Fasciculations", "Absent", "Present"],
      ["EMG", "No denervation potentials", "Fibrillations, positive sharp waves"],
      ["Level of lesion", "Cortex → anterior horn (exclusive)", "Anterior horn → muscle"],
    ]
  ),
  spacer(),
  note("Acute UMN lesion (spinal shock): initially flaccid with absent reflexes — spasticity develops over hours to months."),
  pageBreak(),

  // ── SECTION 7: MEMORY AIDS ─────────────────────────────────────────────
  heading1("7. Memory Aids & Mnemonics"),
  spacer(),

  heading2("Decussation Sites"),
  makeTable(
    ["Tract", "Where it Crosses", "Mnemonic Clue"],
    [
      ["Posterior column (DCML)", "Medulla (nucleus gracilis/cuneatus)", "Crosses HIGH — medulla"],
      ["Spinothalamic", "Spinal cord (anterior commissure, 2-3 levels up)", "Crosses LOW — within cord"],
      ["Lateral corticospinal", "Pyramidal decussation (cervicomedullary)", "Crosses at the PYRAMID"],
      ["Rubrospinal", "Ventral tegmental decussation (midbrain)", "Crosses in MIDBRAIN"],
      ["Tectospinal", "Dorsal tegmental decussation (midbrain)", "Crosses in MIDBRAIN"],
    ]
  ),
  spacer(),

  heading2("Which Modalities Are Lost in Brown-Séquard?"),
  para("SAME side as lesion: Motor (UMN) + fine touch + vibration + proprioception"),
  para("OPPOSITE side to lesion: Pain + temperature (1-2 levels below)"),
  para("Memory: IPSILATERAL motor and fine sensation; CONTRALATERAL pain and temperature"),
  spacer(),

  heading2("Posterior Column Sensory Modalities — PPVS"),
  bullet("P — Proprioception (conscious joint position sense)"),
  bullet("P — Pressure (deep)"),
  bullet("V — Vibration"),
  bullet("S — Stereognosis / fine discriminative touch"),
  spacer(),

  heading2("Spinocerebellar Tracts — DOVE"),
  bullet("D — Dorsal spinocerebellar (from Clarke's nucleus, T1-L2, lower limb)"),
  bullet("O — (goes up ipsilateral, no cross)"),
  bullet("V — Ventral spinocerebellar (crosses twice — net ipsilateral)"),
  bullet("E — Enters cerebellum via inferior and superior peduncles respectively"),
  spacer(),

  heading2("Lateral vs. Medial Motor Systems"),
  para("LATERAL system (CST + rubrospinal) = LIMBS (distal, fine, skilled movement)"),
  para("MEDIAL system (vestibulospinal + reticulospinal + tectospinal + anterior CST) = MIDDLE of body (axial, posture, balance)"),
  pageBreak(),

  // ── SECTION 8: QUICK-REVIEW Q&A ────────────────────────────────────────
  heading1("8. Quick-Review Questions"),
  spacer(),
  makeTable(
    ["#", "Question", "Answer"],
    [
      ["1", "Which tract carries conscious proprioception?", "Posterior column (fasciculus gracilis / cuneatus)"],
      ["2", "Where does the spinothalamic tract decussate?", "Within the spinal cord, 2-3 segments above entry, via anterior white commissure"],
      ["3", "What is the 3rd-order neuron relay station for all sensory tracts?", "VPL nucleus of the thalamus (for body); VPM for face"],
      ["4", "What percentage of CST fibers cross at the pyramidal decussation?", "~85-90% (form lateral CST); ~10-15% remain ipsilateral (anterior CST)"],
      ["5", "What cells of origin give the fastest conducting CST fibers?", "Betz cells (giant pyramidal neurons, ~60 μm, conduct at ~70 m/sec)"],
      ["6", "Which tract facilitates extensor muscles for balance?", "Vestibulospinal tract (especially lateral vestibulospinal)"],
      ["7", "What is the function of the spinomesencephalic tract?", "Central pain modulation via periaqueductal gray (PAG)"],
      ["8", "In Brown-Séquard: which side loses pain/temperature?", "Contralateral side (spinothalamic crosses in cord)"],
      ["9", "What lesion causes cape-like suspended sensory loss?", "Central cord (syringomyelia) — destroys crossing spinothalamic fibers"],
      ["10", "Clarke's nucleus is the origin of which tract?", "Dorsal spinocerebellar tract (T1-L2)"],
      ["11", "Which extrapyramidal tract descends only to cervical cord?", "Both rubrospinal and tectospinal tracts"],
      ["12", "What is the reticulospinal tract's role in autonomic function?", "Relays hypothalamic autonomic signals to preganglionic neurons in IML column"],
    ]
  ),
  spacer(),
  spacer(),
  new Paragraph({
    alignment: AlignmentType.CENTER,
    spacing: { before: 200, after: 0 },
    children: [new TextRun({ text: "— End of Study Guide —", italics: true, color: "888888", size: 20, font: "Calibri" })]
  }),
  new Paragraph({
    alignment: AlignmentType.CENTER,
    spacing: { before: 40, after: 0 },
    children: [new TextRun({ text: "Generated by Orris AI | Sources: Gray's Anatomy for Students, Guyton & Hall, Neuroanatomy through Clinical Cases 3e, Adams & Victor 12e", italics: true, color: "AAAAAA", size: 16, font: "Calibri" })]
  }),
];

// ═══════════════════════════════════════════════════════════════════════════
// BUILD DOCUMENT
// ═══════════════════════════════════════════════════════════════════════════

const doc = new Document({
  creator: "Orris AI",
  title: "Spinal Cord Tracts — Study Guide",
  description: "Comprehensive study guide covering ascending, descending, pyramidal and extrapyramidal tracts of the spinal cord",
  styles: {
    default: {
      document: {
        run: { font: "Calibri", size: 20 }
      }
    }
  },
  sections: [{
    properties: {
      page: {
        margin: { top: 1000, bottom: 1000, left: 1100, right: 1100 }
      }
    },
    headers: {
      default: new Header({
        children: [new Paragraph({
          alignment: AlignmentType.RIGHT,
          children: [new TextRun({ text: "Spinal Cord Tracts — Study Guide", size: 16, color: "888888", font: "Calibri" })]
        })]
      })
    },
    footers: {
      default: new Footer({
        children: [new Paragraph({
          alignment: AlignmentType.CENTER,
          children: [
            new TextRun({ text: "Page ", size: 16, color: "888888", font: "Calibri" }),
            new PageNumber({ type: "current", style: { size: 16, color: "888888", font: "Calibri" } }),
          ]
        })]
      })
    },
    children
  }]
});

Packer.toBuffer(doc).then(buf => {
  fs.writeFileSync("/home/daytona/workspace/spinal-cord-study-guide/Spinal_Cord_Tracts_Study_Guide.docx", buf);
  console.log("Done");
}).catch(e => { console.error(e); process.exit(1); });
Running Command

cd /home/daytona/workspace/spinal-cord-study-guide && node generate.js 2>&1

Editing File

~/spinal-cord-study-guide/generate.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/spinal-cord-study-guide/generate.js'
Running Command

cd /home/daytona/workspace/spinal-cord-study-guide && node generate.js 2>&1

Running Command

python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/worksp…

Running Command

ls -lh /home/daytona/workspace/spinal-cord-study-guide/Spinal_Cord_Tracts_Study_…

Your study guide is ready:

Spinal Cord Tracts Study Guide

Word Document · DOCX


What's inside (8 sections, ~20 pages):
SectionContent
1. OverviewFuniculi, general rules of ascending/descending tracts
2. Ascending TractsPosterior column-DCML, spinothalamic, spinoreticular, spinomesencephalic, spinocerebellar tracts - full 3-neuron relay, decussation sites, lesion effects
3. Descending TractsPyramidal (lateral + anterior CST with full course table), extrapyramidal (rubrospinal, vestibulospinal, reticulospinal x2, tectospinal)
4. Master Summary TableAll 14 tracts - type, column, origin, decussation, function in one reference table
5. Clinical Cord SyndromesBrown-Séquard, central cord, anterior cord, posterior column, complete transection, subacute combined degeneration
6. UMN vs LMNQuick-reference comparison table
7. Memory AidsDecussation sites, mnemonics (PPVS, DOVE, lateral vs medial system rules)
8. Quick-Review Q&A12 exam-style questions with answers
Formatted with colour-coded sections (green for ascending, red for descending), shaded tables, clinical notes, and page headers/footers.
This is a shared conversation. Sign in to Orris to start your own chat.