Make notes on neuromuscular transmission according to rguhs following gk pal textbook of physiology

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Loading Image
Loading Image
Excellent! I now have all the information needed to write comprehensive RGUHS-pattern notes. Let me compile the complete notes.

Neuromuscular Transmission

Notes as per RGUHS Syllabus | Ref: GK Pal Textbook of Medical Physiology (Ganong's as primary library source)

1. Definition

Neuromuscular transmission refers to the process by which an impulse is transmitted from a motor nerve fiber to a skeletal muscle fiber at the neuromuscular junction (NMJ), resulting in muscle contraction.

2. Structure of the Neuromuscular Junction

The NMJ (also called the myoneural junction) is the specialized synapse between a motor neuron and a skeletal muscle fiber.
Structure of the Neuromuscular Junction - labeled diagram showing motor nerve fiber, myelin, axon terminal, Schwann cell, synaptic vesicles (ACh), active zone, sarcolemma, synaptic cleft, junctional folds, and nicotinic receptors

Components:

A. Presynaptic (Motor Nerve Terminal)
  • The axon loses its myelin sheath near the muscle and divides into several terminal boutons
  • Each terminal bouton contains:
    • Many small clear synaptic vesicles (each containing ~10,000 molecules of acetylcholine / ACh)
    • Mitochondria (for energy supply - ATP for ACh synthesis)
    • Voltage-gated Ca²+ channels at active zones
  • The terminal fits into junctional depressions of the motor endplate
B. Synaptic Cleft
  • A gap of ~20-30 nm between the nerve terminal and muscle membrane
  • Contains acetylcholinesterase (AChE) in high concentration - rapidly degrades ACh
C. Postsynaptic (Motor Endplate)
  • The thickened portion of the muscle fiber membrane beneath the nerve terminal
  • Has characteristic junctional folds (subneural clefts) that increase surface area
  • Nicotinic cholinergic receptors (N_M type) are concentrated at the tops of the junctional folds
  • AChE is also located in the depths of the folds
Key Point for RGUHS: Each skeletal muscle fiber is innervated by a single motor nerve fiber (1:1 relationship at the endplate). One motor neuron can, however, innervate multiple muscle fibers (motor unit).

3. Sequence of Events in Neuromuscular Transmission

Events at the neuromuscular junction - numbered steps 1-8 showing motor neuron AP, Ca2+ entry, ACh release, Na+ entry, local current, muscle AP initiation, propagated AP, and ACh degradation
The steps are as follows (important for RGUHS short/long answers):
StepEvent
1Motor neuron action potential arrives at the nerve terminal
2Depolarization opens voltage-gated Ca²+ channels → Ca²+ enters the terminal
3Ca²+ triggers exocytosis of ACh-containing vesicles → ACh released into synaptic cleft (~60 vesicles per impulse)
4ACh diffuses across the cleft and binds to nicotinic (N_M) receptors on the motor endplate
5Receptor activation opens ligand-gated Na+/K+ channels → increased Na+ and K+ conductance; net Na+ influx produces depolarization
6This depolarization = Endplate Potential (EPP)
7EPP acts as a current sink and depolarizes adjacent muscle membrane to firing threshold → muscle fiber action potential initiated
8Action potentials propagate in both directions along the muscle fiber → muscle contraction
9AChE rapidly hydrolyzes ACh → choline reabsorbed into nerve terminal → resynthesis of ACh

4. Endplate Potential (EPP)

  • A graded, non-propagated depolarizing potential at the motor endplate
  • Amplitude: approximately -15 to -20 mV (brings membrane from -90 mV toward threshold)
  • Unlike an action potential, the EPP is not all-or-none; it is proportional to the amount of ACh released
  • Normally, EPP is suprathreshold - it always generates a muscle action potential (high safety factor)
  • The EPP exceeds the threshold by about 3-4 times (the "safety margin" of neuromuscular transmission)

5. Quantal Release of Acetylcholine

This is a frequently asked RGUHS topic:
  • ACh is released in discrete packets called quanta (each quantum = contents of one synaptic vesicle = ~10,000 ACh molecules)
  • At rest, single quanta are released spontaneously and randomly → produce Miniature Endplate Potentials (MEPPs)
  • MEPP characteristics:
    • Amplitude: ~0.5 mV (well below threshold - does NOT cause muscle contraction)
    • Spontaneous, random
    • Reflects single-quantum (single vesicle) release
  • During a nerve impulse: ~60 quanta are released simultaneously → large EPP → muscle AP

Regulation of quantal release:

  • Ca²+: Quantal size varies directly with Ca²+ concentration at the endplate - more Ca²+ = more vesicle fusion
  • Mg²+: Varies inversely with Mg²+ concentration - Mg²+ competes with Ca²+ at the active zone

6. Role of Acetylcholine

PropertyDetail
SynthesisIn nerve terminal: Choline + Acetyl-CoA → ACh (by choline acetyltransferase)
StorageIn synaptic vesicles (~10,000 molecules/vesicle)
ReleaseExocytosis triggered by Ca²+ influx
ReceptorNicotinic N_M receptor (ionotropic - directly opens Na+/K+ channel)
DegradationHydrolyzed by AChE → acetic acid + choline; choline is recycled (75% taken back up)

7. Neuromuscular Fatigue

With repeated stimulation, transmission at the NMJ can fail because:
  1. Progressive depletion of readily-releasable ACh vesicles
  2. Accumulation of choline and metabolites
  3. Decrease in Ca²+ influx efficacy with very high frequency stimulation
This forms the physiological basis for muscle fatigue at the NMJ level (as distinct from central fatigue or muscle fatigue).

8. Denervation Hypersensitivity (Supersensitivity)

  • When a motor nerve is cut and degenerates, the denervated muscle becomes hypersensitive to ACh
  • Normally, nicotinic receptors are confined to the motor endplate region only
  • After denervation: new receptors appear across the entire sarcolemma (not just at the endplate)
  • This is called denervation supersensitivity
  • The muscle shows fibrillations (spontaneous contractions) on EMG

9. Pharmacological Agents Acting at the NMJ

Drug/AgentMechanismEffect
Curare (d-tubocurarine)Competitive antagonist at N_M receptorBlocks NMT - muscle paralysis
SuccinylcholinePersistent depolarization (depolarizing block)Initial fasciculations then paralysis
Neostigmine/PyridostigmineAChE inhibitorIncreases ACh in cleft - enhances NMT
Botulinum toxinBlocks ACh vesicle release (cleaves SNARE proteins)Flaccid paralysis
AminoglycosidesReduce Ca²+ influx at terminalImpair ACh release
HemicholiniumBlocks choline reuptakeDepletes ACh stores

10. Diseases of Neuromuscular Transmission (RGUHS Clinical Correlate)

A. Myasthenia Gravis (MG)

  • Definition: Autoimmune disease causing weakness and easy fatigability of skeletal muscles
  • Incidence: 25-125 per million; bimodal - peaks in 20s (women) and 60s (men)
  • Pathogenesis:
    • Circulating IgG antibodies against N_M (nicotinic) ACh receptors at the motor endplate
    • Antibodies destroy some receptors and cross-link others, triggering endocytosis (internalization and degradation)
    • 70-90% reduction in receptor number per endplate
    • Junctional folds become sparse, shallow, and widened/absent
    • With repetitive stimulation, normal decline in quantal ACh release goes uncorrected → transmission fails
  • Features:
    • Muscle fatigue with sustained or repeated activity (hallmark)
    • Two forms: (1) Ocular - extraocular muscles only; (2) Generalized - all skeletal muscles including diaphragm
    • Associated with thymus hyperplasia (85%) and thymoma (10-15%)
    • Associations: rheumatoid arthritis, SLE, polymyositis
  • Treatment:
    • AChE inhibitors: neostigmine, pyridostigmine (symptomatic)
    • Immunosuppression: prednisone, azathioprine, cyclosporine
    • Thymectomy - induces remission in 35%, improves symptoms in 45%
    • Plasmapheresis, IVIg in crisis

B. Lambert-Eaton Myasthenic Syndrome (LEMS)

  • Pathogenesis: Autoimmune attack against voltage-gated Ca²+ channels in nerve endings at the NMJ
  • Decreased Ca²+ influx → reduced ACh release
  • Often paraneoplastic (associated with small cell carcinoma of lung)
  • Feature: Proximal muscle weakness (lower limbs > upper), improves with repeated activity (unlike MG)
    • Repeated stimulation allows Ca²+ accumulation in terminal → more ACh released
  • Distinguished from MG by: incremental response on repetitive nerve stimulation (vs. decremental in MG)

11. Comparison: MG vs. LEMS

FeatureMyasthenia GravisLambert-Eaton Syndrome
Antibody targetACh receptor (postsynaptic)Voltage-gated Ca²+ channel (presynaptic)
Defect sitePostsynapticPresynaptic
Effect of repetitionWorsens (decremental)Improves (incremental)
AssociationThymomaSmall cell lung cancer
Muscle groupsOcular/extraocular firstProximal lower limb first
Autonomic featuresAbsentPresent (dry mouth, impotence)

12. Summary Diagram - Steps of NMT (Memory Aid)

Motor AP → Ca²+ entry → ACh exocytosis → ACh + N_M receptor
→ Na+ influx → EPP → Muscle AP → Muscle contraction
                    ↑
           AChE hydrolyzes ACh (terminates)
           Choline recycled back to terminal

13. Important Points for RGUHS Examinations

  • "Safety factor" of NMT: EPP is normally 3-4x the threshold - ensures reliable 1:1 transmission
  • MEPPs prove quantal release and are used to assess presynaptic vs. postsynaptic defects in NMJ diseases
  • In MG: MEPP amplitude is normal (presynaptic release intact), but EPP is small (receptors reduced)
  • In LEMS: MEPP amplitude is reduced (presynaptic release reduced)
  • Curare and competitive blockers can be reversed by AChE inhibitors; depolarizing blockers (succinylcholine) cannot
  • The entire NMT takes approximately 0.5-1 ms

Sources: Ganong's Review of Medical Physiology 26th Ed. (Ch. 6 - Neuromuscular Transmission); GK Pal Textbook of Medical Physiology (standard RGUHS reference - topics aligned to RGUHS First Year MBBS syllabus)

Create a comparison table: normal NMT vs. disorders with mechanisms and clinical features

Here is a comprehensive comparison table covering normal NMT alongside the major disorders:

Neuromuscular Transmission: Normal vs. Disorders

Part 1 - Mechanism Comparison

FeatureNormal NMTMyasthenia GravisLambert-Eaton SyndromeBotulinum ToxicityOrganophosphate PoisoningCurare / Non-depolarizing BlockSuccinylcholine / Depolarizing Block
Site of defect-PostsynapticPresynapticPresynapticSynaptic cleft (AChE)Postsynaptic receptorPostsynaptic receptor
Primary targetAll steps intactN_M ACh receptorsVoltage-gated Ca²+ channelsSNARE proteins (synaptobrevin, SNAP-25)AcetylcholinesteraseN_M receptor (competitive block)N_M receptor (persistent depolarization)
ACh synthesisNormalNormalNormalNormalNormalNormalNormal
Ca²+ entry into terminalNormal (triggered by AP)NormalReduced (antibody blocks VGCCs)NormalNormalNormalNormal
ACh release~60 quanta/impulseNormalReduced (less Ca²+ → fewer vesicles fuse)Absent (SNARE cleavage blocks exocytosis)NormalNormalNormal
ACh in cleftTransient (hydrolyzed rapidly)Normal initiallyReducedNoneExcess (AChE inhibited - ACh accumulates)NormalNormal
Postsynaptic receptor numberNormalReduced 70-90% (antibody-mediated endocytosis + destruction)NormalNormalNormalNormalNormal
Receptor activationNormalReduced (fewer receptors)Reduced (less ACh available)NoneExcessive/prolongedBlocked (competitive antagonist)Desensitized (persistent depolarization)
Endplate Potential (EPP)Large, suprathreshold (~70 mV)Small (subthreshold on repetition)Small (but improves with repeated stimuli)AbsentProlonged, excessiveAbsent/reducedInitial large → then absent
MEPP amplitude~0.5 mV (normal baseline)Normal (presynaptic intact)Reduced (less ACh per quantum? / less release)AbsentNormalNormalNormal
Muscle action potentialGenerated reliably 1:1Fails with repetitionFails at rest, partially restored with repetitionCompletely absentProlonged / repetitiveAbsentInitial fasciculations → then absent
AChE activityNormal (terminates ACh)NormalNormalNormalInhibited (irreversible with nerve agents; reversible with some pesticides)NormalNormal
Effect of repetitive stimulationSlight fatigue at very high freq.Decremental response - worsensIncremental response - improvesNo responseRepetitive firingNo responseNo response
ReversibilityN/APartially (AChE inhibitors help)Partially (3,4-DAP, symptomatic)Irreversible clinically (weeks-months)Reversible if treated early (atropine + pralidoxime)Fully reversible (neostigmine antidote)Spontaneously reversible (pseudocholinesterase hydrolysis)

Part 2 - Clinical Features Comparison

FeatureNormal NMTMyasthenia GravisLambert-Eaton SyndromeBotulinum ToxicityOrganophosphate PoisoningCurare BlockSuccinylcholine Block
TypePhysiologicalAutoimmuneAutoimmune / ParaneoplasticToxin (Clostridium botulinum)Pesticide / Nerve agent poisoningPharmacological (anesthesia)Pharmacological (anesthesia)
Muscles affected first-Ocular / extraocular (ptosis, diplopia)Proximal lower limb (waddling gait, difficulty climbing stairs)Cranial nerves first (diplopia, dysarthria, dysphagia) then descendingAll muscles (generalized) - also smooth muscle, glandsAll skeletal muscles equallyAll skeletal muscles (brief fasciculations first)
Pattern of weaknessNoneFatigable weakness - worse with activity, better with restWeakness better after exercise / repeated useDescending flaccid paralysisFlaccid paralysis (preceded by fasciculations, excessive secretions)Flaccid paralysis (dose-dependent)Brief fasciculations → flaccid paralysis
Autonomic featuresNoneAbsentPresent (dry mouth, constipation, erectile dysfunction - cholinergic autonomic failure)Present (dry mouth, dilated pupils, urinary retention - anti-cholinergic pattern)Present and prominent (SLUDGE: Salivation, Lacrimation, Urination, Defecation, GI cramps, Emesis + miosis, bradycardia)AbsentTransient (bradycardia, increased K+)
Ocular signsNormalPtosis, diplopia (hallmark early feature)Ptosis (less common)Bilateral ptosis, dilated fixed pupils, ophthalmoplegiaMiosis (pinpoint pupils)AbsentAbsent
Sensory featuresNormalNone (purely motor)None (purely motor)None (purely motor)None (motor dominant)NoneNone
ReflexesNormalNormal or slightly reducedReduced or absent (characteristic) then return after exerciseReduced/absentReduced (with paralysis)Absent during blockAbsent during block
Response to rest-Improves (hallmark)Minimal improvementDoes not improveDoes not improveDoes not improveSpontaneous recovery
Association-Thymoma (10-15%), thymus hyperplasia (85%)Small cell lung carcinoma (~60%), thymoma rarelyImproperly preserved food (canned), wound botulism, infant botulism (honey)Occupational (farmers), deliberate poisoning (nerve agents: sarin, VX)Anesthesia adjunctRapid sequence intubation
Diagnosis-Anti-AChR antibodies (+ve in 85%), Edrophonium (Tensilon) test, decremental EMGAnti-VGCC antibodies, incremental EMG on repetitive stimulation, CT chest (lung malignancy)Clinical + mouse bioassay / ELISA for toxin in serum/stoolReduced RBC cholinesterase activity, plasma pseudocholinesteraseClinical (intraoperative)Clinical (intraoperative)
Treatment-Pyridostigmine (AChE inhibitor), immunosuppression (steroids, azathioprine), thymectomy, plasmapheresis, IVIg3,4-Diaminopyridine (increases Ca²+ influx), pyridostigmine, immunosuppression, treat underlying malignancyAntitoxin (trivalent A/B/E), supportive ventilation, wound debridementAtropine (muscarinic block) + Pralidoxime/2-PAM (reactivates AChE if given early), supportive careReversal: Neostigmine + glycopyrrolateSpontaneous reversal (2-15 min); no specific antidote

Part 3 - Quick Memory Summary

DisorderAntibody/AgentSiteEffect on RepetitionKey Clinical Clue
Myasthenia GravisAnti-AChR (IgG)Post-synapticDecremental (worsens)Fatigable ptosis + diplopia; improves with rest
Lambert-EatonAnti-VGCC (IgG)Pre-synapticIncremental (improves)Proximal leg weakness + dry mouth; associated with lung cancer
BotulinumBotulinum toxin (cleaves SNARE)Pre-synapticNo responseDescending paralysis + dry mouth + dilated pupils; food-borne
OrganophosphateOPC (inhibits AChE)Cleft (AChE)Repetitive firingSLUDGE + fasciculations + miosis; treat with atropine + pralidoxime
CurareCompetitive N_M antagonistPost-synapticNo responseDose-dependent paralysis; reversed by neostigmine
SuccinylcholineDepolarizing agonistPost-synapticNo responseFasciculations first; risk of hyperkalemia; reversed spontaneously

All NMT disorders are purely motor (no sensory loss), since sensory nerves do not use the NMJ. This is a useful clinical differentiator from spinal cord or peripheral nerve lesions.

Make a PDF

Reading File
Running Command

ls -la /home/daytona/workspace/

Running Command

mkdir -p /home/daytona/workspace/nmt-notes

Writing File

~/nmt-notes/generate_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import Image as RLImage
import urllib.request
import os

OUTPUT = "/home/daytona/workspace/nmt-notes/NMT_Comparison_Table.pdf"

# ── Colour palette ──────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1A3A5C")
MID_BLUE    = colors.HexColor("#2E6DA4")
LIGHT_BLUE  = colors.HexColor("#D6E8F7")
ACCENT_TEAL = colors.HexColor("#1B7A78")
LIGHT_TEAL  = colors.HexColor("#D0EDEC")
GOLD        = colors.HexColor("#C8860A")
LIGHT_GOLD  = colors.HexColor("#FFF3CD")
RED_SOFT    = colors.HexColor("#C0392B")
LIGHT_RED   = colors.HexColor("#FDECEA")
GREEN_SOFT  = colors.HexColor("#1E7E34")
LIGHT_GREEN = colors.HexColor("#D4EDDA")
PURPLE      = colors.HexColor("#6A1B9A")
LIGHT_PURPLE= colors.HexColor("#EDE7F6")
GREY_LIGHT  = colors.HexColor("#F4F6F8")
GREY_MID    = colors.HexColor("#BDC3C7")
WHITE       = colors.white
BLACK       = colors.HexColor("#1C1C1C")

# ── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

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

cover_title = S("CoverTitle", fontName="Helvetica-Bold", fontSize=26,
                textColor=WHITE, alignment=TA_CENTER, leading=34, spaceAfter=8)
cover_sub   = S("CoverSub",   fontName="Helvetica",     fontSize=14,
                textColor=colors.HexColor("#BDD7EE"), alignment=TA_CENTER, leading=20)
cover_tag   = S("CoverTag",   fontName="Helvetica-Oblique", fontSize=11,
                textColor=colors.HexColor("#E0E0E0"), alignment=TA_CENTER, leading=16)

h1 = S("H1", fontName="Helvetica-Bold", fontSize=15, textColor=WHITE,
        alignment=TA_CENTER, leading=20, spaceAfter=4)
h2 = S("H2", fontName="Helvetica-Bold", fontSize=12, textColor=DARK_BLUE,
        leading=16, spaceBefore=12, spaceAfter=4)
h3 = S("H3", fontName="Helvetica-Bold", fontSize=10, textColor=ACCENT_TEAL,
        leading=14, spaceBefore=8, spaceAfter=2)

body   = S("Body",   fontName="Helvetica",      fontSize=9,  textColor=BLACK,
           leading=13, spaceAfter=4, alignment=TA_JUSTIFY)
small  = S("Small",  fontName="Helvetica",      fontSize=8,  textColor=BLACK, leading=11)
small_b= S("SmallB", fontName="Helvetica-Bold", fontSize=8,  textColor=BLACK, leading=11)
small_i= S("SmallI", fontName="Helvetica-Oblique", fontSize=7.5, textColor=colors.HexColor("#555555"), leading=10)

th_white= S("ThW", fontName="Helvetica-Bold", fontSize=8, textColor=WHITE,
            alignment=TA_CENTER, leading=11)
th_dark = S("ThD", fontName="Helvetica-Bold", fontSize=8, textColor=DARK_BLUE,
            alignment=TA_CENTER, leading=11)
td_ctr  = S("TdC", fontName="Helvetica",      fontSize=7.5, textColor=BLACK,
            alignment=TA_CENTER, leading=10)
td_left = S("TdL", fontName="Helvetica",      fontSize=7.5, textColor=BLACK,
            alignment=TA_LEFT,   leading=10)
td_bold = S("TdB", fontName="Helvetica-Bold", fontSize=7.5, textColor=DARK_BLUE,
            alignment=TA_LEFT,   leading=10)
td_red  = S("TdR", fontName="Helvetica-Bold", fontSize=7.5, textColor=RED_SOFT,
            alignment=TA_LEFT,   leading=10)
td_green= S("TdG", fontName="Helvetica-Bold", fontSize=7.5, textColor=GREEN_SOFT,
            alignment=TA_LEFT,   leading=10)
note_s  = S("Note", fontName="Helvetica-Oblique", fontSize=8, textColor=colors.HexColor("#444444"),
            leading=11, spaceAfter=6)

# ── Helper: coloured section header ─────────────────────────────────────────
def section_header(text, bg=MID_BLUE):
    t = Table([[Paragraph(text, h1)]], colWidths=[19*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("ROUNDEDCORNERS", [4, 4, 4, 4]),
        ("TOPPADDING",  (0,0), (-1,-1), 7),
        ("BOTTOMPADDING",(0,0),(-1,-1), 7),
        ("LEFTPADDING", (0,0), (-1,-1), 10),
    ]))
    return t

def note_box(text, bg=LIGHT_GOLD, border=GOLD):
    t = Table([[Paragraph(text, note_s)]], colWidths=[19*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0),(-1,-1), bg),
        ("BOX",           (0,0),(-1,-1), 1, border),
        ("TOPPADDING",    (0,0),(-1,-1), 6),
        ("BOTTOMPADDING", (0,0),(-1,-1), 6),
        ("LEFTPADDING",   (0,0),(-1,-1), 8),
        ("RIGHTPADDING",  (0,0),(-1,-1), 8),
    ]))
    return t

# ── Download NMJ diagram ─────────────────────────────────────────────────────
NMJ_STRUCT_URL  = "https://cdn.orris.care/cdss_images/f7765a6a6a1ee814034ac1f733a53e479a378ee2011e8bc9a6082fd4df5a1f6e.png"
NMJ_EVENTS_URL  = "https://cdn.orris.care/cdss_images/0eff0180e07befcc8dc737922e0342f9de6d98e87f2e54bc9bcea680215d10db.png"
IMG_STRUCT = "/home/daytona/workspace/nmt-notes/nmj_struct.png"
IMG_EVENTS = "/home/daytona/workspace/nmt-notes/nmj_events.png"

for url, path in [(NMJ_STRUCT_URL, IMG_STRUCT), (NMJ_EVENTS_URL, IMG_EVENTS)]:
    if not os.path.exists(path):
        urllib.request.urlretrieve(url, path)
        print(f"Downloaded {path}")

# ── Build document ────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=1*cm, rightMargin=1*cm,
    topMargin=1.5*cm, bottomMargin=1.5*cm,
    title="Neuromuscular Transmission – Normal vs Disorders",
    author="RGUHS Physiology Notes"
)

story = []
W = 19*cm   # usable width

# ═══════════════════════════════════════════════════════════════════
# COVER PAGE
# ═══════════════════════════════════════════════════════════════════
cover_bg = Table(
    [[Paragraph("NEUROMUSCULAR TRANSMISSION", cover_title)],
     [Paragraph("Normal NMT vs. Disorders", cover_sub)],
     [Spacer(1, 0.3*cm)],
     [Paragraph("Mechanism · Clinical Features · Pharmacology · Comparison", cover_tag)],
     [Spacer(1, 0.5*cm)],
     [Paragraph("As per RGUHS Syllabus | Ref: GK Pal Textbook of Medical Physiology", cover_tag)],
    ],
    colWidths=[W]
)
cover_bg.setStyle(TableStyle([
    ("BACKGROUND",   (0,0),(-1,-1), DARK_BLUE),
    ("TOPPADDING",   (0,0),(-1,-1), 18),
    ("BOTTOMPADDING",(0,0),(-1,-1), 18),
    ("LEFTPADDING",  (0,0),(-1,-1), 20),
    ("RIGHTPADDING", (0,0),(-1,-1), 20),
]))
story.append(cover_bg)
story.append(Spacer(1, 0.6*cm))

# NMJ diagrams side by side
try:
    img1 = RLImage(IMG_STRUCT, width=9*cm, height=6.5*cm)
    img2 = RLImage(IMG_EVENTS, width=9*cm, height=6.5*cm)
    img_table = Table([[img1, img2]], colWidths=[9.5*cm, 9.5*cm])
    img_table.setStyle(TableStyle([
        ("ALIGN",  (0,0),(-1,-1), "CENTER"),
        ("VALIGN", (0,0),(-1,-1), "MIDDLE"),
        ("BOX",    (0,0),(0,0),   0.5, GREY_MID),
        ("BOX",    (1,0),(1,0),   0.5, GREY_MID),
        ("BACKGROUND", (0,0),(-1,-1), GREY_LIGHT),
    ]))
    story.append(img_table)
    cap_table = Table([[
        Paragraph("Fig 1: Structure of the Neuromuscular Junction", small_i),
        Paragraph("Fig 2: Steps 1–8 of NMT at the NMJ", small_i),
    ]], colWidths=[9.5*cm, 9.5*cm])
    cap_table.setStyle(TableStyle([("ALIGN",(0,0),(-1,-1),"CENTER")]))
    story.append(cap_table)
except Exception as e:
    print(f"Image skipped: {e}")

story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width=W, color=MID_BLUE, thickness=1.5))
story.append(Spacer(1, 0.2*cm))

# ═══════════════════════════════════════════════════════════════════
# SECTION 1 – Normal NMT Steps
# ═══════════════════════════════════════════════════════════════════
story.append(section_header("SECTION 1: Normal Neuromuscular Transmission – Step-by-Step"))
story.append(Spacer(1, 0.3*cm))

steps_data = [
    [Paragraph("Step", th_white), Paragraph("Event", th_white), Paragraph("Key Ion / Molecule", th_white), Paragraph("Result", th_white)],
    ["1", "Motor neuron AP arrives at terminal", "Electrical depolarization", "Opens voltage-gated Ca²⁺ channels"],
    ["2", "Ca²⁺ enters the axon terminal via VGCCs", "Ca²⁺ (extracellular → intracellular)", "Triggers vesicle fusion (exocytosis)"],
    ["3", "ACh released (~60 quanta/impulse)", "ACh (~10,000 molecules/vesicle)", "ACh floods synaptic cleft"],
    ["4", "ACh binds N_M nicotinic receptors on endplate", "ACh + N_M receptor", "Opens ligand-gated Na⁺/K⁺ channels"],
    ["5", "Na⁺ influx into muscle cell", "Na⁺", "Depolarization of endplate → EPP"],
    ["6", "EPP acts as current sink → adjacent sarcolemma depolarized", "Local current spread", "Threshold reached"],
    ["7", "Muscle fiber action potential generated", "Voltage-gated Na⁺ channels open", "AP propagates both directions"],
    ["8", "Muscle contraction via excitation-contraction coupling", "Ca²⁺ from SR, troponin", "Sliding filament mechanism"],
    ["9", "AChE hydrolyzes ACh → choline + acetate", "Acetylcholinesterase (AChE)", "Terminates signal; choline recycled (75%)"],
]

col_w = [0.8*cm, 5.8*cm, 4.5*cm, 7.9*cm]
steps_tbl = Table(steps_data, colWidths=col_w, repeatRows=1)
steps_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),   DARK_BLUE),
    ("TEXTCOLOR",     (0,0),(-1,0),   WHITE),
    ("FONTNAME",      (0,0),(-1,0),   "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),  8),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),  [WHITE, LIGHT_BLUE]),
    ("ALIGN",         (0,0),(0,-1),   "CENTER"),
    ("ALIGN",         (1,0),(-1,-1),  "LEFT"),
    ("VALIGN",        (0,0),(-1,-1),  "TOP"),
    ("GRID",          (0,0),(-1,-1),  0.4, GREY_MID),
    ("TOPPADDING",    (0,0),(-1,-1),  4),
    ("BOTTOMPADDING", (0,0),(-1,-1),  4),
    ("LEFTPADDING",   (0,0),(-1,-1),  5),
]))
story.append(steps_tbl)
story.append(Spacer(1, 0.3*cm))
story.append(note_box("⚡ Safety Factor of NMT: The EPP is 3–4× the threshold – ensuring reliable 1:1 transmission under normal conditions."))
story.append(Spacer(1, 0.2*cm))

# ═══════════════════════════════════════════════════════════════════
# SECTION 2 – Quantal Release & MEPP
# ═══════════════════════════════════════════════════════════════════
story.append(section_header("SECTION 2: Quantal Release & Miniature Endplate Potential (MEPP)", bg=ACCENT_TEAL))
story.append(Spacer(1, 0.3*cm))

quantal_data = [
    [Paragraph("Feature", th_white), Paragraph("At Rest (MEPP)", th_white), Paragraph("During Nerve Impulse (EPP)", th_white)],
    ["Quanta released", "1 (single vesicle, spontaneous)", "~60 quanta simultaneously"],
    ["ACh molecules", "~10,000", "~600,000"],
    ["Potential amplitude", "~0.5 mV", "~70 mV (suprathreshold)"],
    ["Propagated?", "No – graded, local", "No (EPP) → triggers propagated muscle AP"],
    ["Muscle contraction?", "No (subthreshold)", "Yes"],
    ["Ca²⁺ dependence", "Spontaneous / independent", "Directly proportional to Ca²⁺ concentration"],
    ["Mg²⁺ effect", "Minimal", "Inversely reduces quantal release"],
    ["Clinical use", "Reduced in LEMS; normal in MG → localises defect", "Decreased in MG → explains fatigue"],
]

qcol = [3.5*cm, 7.5*cm, 8*cm]
q_tbl = Table(quantal_data, colWidths=qcol, repeatRows=1)
q_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),   ACCENT_TEAL),
    ("TEXTCOLOR",     (0,0),(-1,0),   WHITE),
    ("FONTNAME",      (0,0),(-1,0),   "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),  8),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),  [WHITE, LIGHT_TEAL]),
    ("ALIGN",         (0,0),(-1,-1),  "LEFT"),
    ("VALIGN",        (0,0),(-1,-1),  "TOP"),
    ("GRID",          (0,0),(-1,-1),  0.4, GREY_MID),
    ("TOPPADDING",    (0,0),(-1,-1),  4),
    ("BOTTOMPADDING", (0,0),(-1,-1),  4),
    ("LEFTPADDING",   (0,0),(-1,-1),  5),
    ("FONTNAME",      (0,0),(0,-1),   "Helvetica-Bold"),
]))
story.append(q_tbl)
story.append(Spacer(1, 0.4*cm))

# ═══════════════════════════════════════════════════════════════════
# PAGE BREAK → SECTION 3
# ═══════════════════════════════════════════════════════════════════
story.append(PageBreak())
story.append(section_header("SECTION 3: Mechanism Comparison – Normal NMT vs. All Disorders"))
story.append(Spacer(1, 0.3*cm))

# ── Part 3A: Mechanism table (landscape-style, split for readability)
def p(text, style=td_left):
    return Paragraph(text, style)

# Row labels + 7 columns (Normal + 6 disorders)
mech_header = [
    p("Feature", th_white),
    p("Normal NMT", th_white),
    p("Myasthenia Gravis", th_white),
    p("Lambert-Eaton Syndrome", th_white),
    p("Botulinum Toxicity", th_white),
    p("Organophosphate Poisoning", th_white),
    p("Curare (Non-depol.)", th_white),
    p("Succinylcholine (Depol.)", th_white),
]

mech_rows = [
    [p("Site of defect"), p("—"), p("Post-synaptic"), p("Pre-synaptic"), p("Pre-synaptic"), p("Synaptic cleft (AChE)"), p("Post-synaptic"), p("Post-synaptic")],
    [p("Primary target"), p("All intact"), p("N_M ACh receptors"), p("Voltage-gated Ca²⁺ channels (VGCCs)"), p("SNARE proteins"), p("Acetylcholinesterase"), p("N_M receptor (competitive)"), p("N_M receptor (agonist)")],
    [p("ACh release"), p("~60 quanta"), p("Normal"), p("Reduced (↓ Ca²⁺ → fewer vesicles)"), p("Absent (SNARE cleaved)"), p("Normal"), p("Normal"), p("Normal")],
    [p("ACh in cleft"), p("Transient"), p("Normal initially"), p("Reduced"), p("None"), p("Excess (AChE blocked)"), p("Normal"), p("Normal")],
    [p("Receptor number"), p("Normal"), p("Reduced 70–90%"), p("Normal"), p("Normal"), p("Normal"), p("Normal"), p("Normal")],
    [p("Receptor activation"), p("Normal"), p("Reduced"), p("Reduced"), p("Absent"), p("Excessive / prolonged"), p("Blocked"), p("Desensitized")],
    [p("EPP amplitude"), p("Large, supra-threshold"), p("Small → subthreshold on repetition"), p("Small at rest, improves with repetition"), p("Absent"), p("Prolonged / excessive"), p("Absent / reduced"), p("Initial large → absent")],
    [p("MEPP amplitude"), p("~0.5 mV (normal)"), p("Normal"), p("Reduced"), p("Absent"), p("Normal"), p("Normal"), p("Normal")],
    [p("AChE activity"), p("Normal"), p("Normal"), p("Normal"), p("Normal"), p("Inhibited"), p("Normal"), p("Normal")],
    [p("Ca²⁺ entry"), p("Normal"), p("Normal"), p("Reduced (antibody blocks VGCCs)"), p("Normal"), p("Normal"), p("Normal"), p("Normal")],
    [p("Repetitive stimulation"), p("Slight fatigue at very high freq."), p("Decremental – worsens"), p("Incremental – improves"), p("No response"), p("Repetitive firing"), p("No response"), p("No response")],
    [p("Reversibility"), p("N/A"), p("Partial (AChE inhibitors)"), p("Partial (3,4-DAP)"), p("Irreversible (weeks–months)"), p("Reversible if early (atropine + pralidoxime)"), p("Full (neostigmine reversal)"), p("Spontaneous (pseudocholinesterase)")],
]

mech_col_w = [2.8*cm, 2.2*cm, 2.6*cm, 2.6*cm, 2.4*cm, 2.4*cm, 2.2*cm, 2.2*cm]
mech_data = [mech_header] + mech_rows

mech_tbl = Table(mech_data, colWidths=mech_col_w, repeatRows=1)
mech_style = TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),   DARK_BLUE),
    ("TEXTCOLOR",     (0,0),(-1,0),   WHITE),
    ("FONTNAME",      (0,0),(-1,-1),  "Helvetica"),
    ("FONTNAME",      (0,0),(-1,0),   "Helvetica-Bold"),
    ("FONTNAME",      (0,0),(0,-1),   "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),  7),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),  [WHITE, LIGHT_BLUE]),
    ("ALIGN",         (0,0),(-1,-1),  "LEFT"),
    ("VALIGN",        (0,0),(-1,-1),  "TOP"),
    ("GRID",          (0,0),(-1,-1),  0.3, GREY_MID),
    ("TOPPADDING",    (0,0),(-1,-1),  3),
    ("BOTTOMPADDING", (0,0),(-1,-1),  3),
    ("LEFTPADDING",   (0,0),(-1,-1),  4),
    # Highlight Normal column header
    ("BACKGROUND",    (1,0),(1,0),    GREEN_SOFT),
    # Highlight Normal column data with light green
    ("BACKGROUND",    (1,1),(1,-1),   LIGHT_GREEN),
])
mech_tbl.setStyle(mech_style)
story.append(mech_tbl)
story.append(Spacer(1, 0.4*cm))

# ═══════════════════════════════════════════════════════════════════
# PAGE BREAK → SECTION 4: Clinical Features
# ═══════════════════════════════════════════════════════════════════
story.append(PageBreak())
story.append(section_header("SECTION 4: Clinical Features Comparison"))
story.append(Spacer(1, 0.3*cm))

clin_header = [
    p("Feature", th_white),
    p("Normal NMT", th_white),
    p("Myasthenia Gravis", th_white),
    p("Lambert-Eaton Syndrome", th_white),
    p("Botulinum Toxicity", th_white),
    p("Organophosphate Poisoning", th_white),
    p("Curare Block", th_white),
    p("Succinylcholine Block", th_white),
]

clin_rows = [
    [p("Type"), p("Physiological"), p("Autoimmune"), p("Autoimmune / Paraneoplastic"), p("Toxin (C. botulinum)"), p("Pesticide / Nerve agent"), p("Pharmacological"), p("Pharmacological")],
    [p("First muscles affected"), p("—"), p("Ocular / extraocular (ptosis, diplopia)"), p("Proximal lower limb (waddling gait)"), p("Cranial nerves first (diplopia, dysarthria, dysphagia) → descending"), p("All muscles (generalized); also smooth muscle, glands"), p("All skeletal muscles equally"), p("All skeletal muscles (brief fasciculations first)")],
    [p("Pattern of weakness"), p("None"), p("Fatigable weakness – worse with activity, better with rest"), p("Weakness better after exercise / repeated use"), p("Descending flaccid paralysis"), p("Flaccid paralysis (preceded by fasciculations, secretions)"), p("Flaccid (dose-dependent)"), p("Fasciculations → flaccid paralysis (2–15 min)")],
    [p("Autonomic features"), p("None"), p("Absent"), p("Present – dry mouth, constipation, erectile dysfunction"), p("Present – dry mouth, dilated pupils, urinary retention (anti-cholinergic)"), p("Present & prominent – SLUDGE + miosis, bradycardia"), p("Absent"), p("Transient bradycardia; ↑K⁺ risk")],
    [p("Ocular signs"), p("Normal"), p("Ptosis, diplopia (hallmark early feature)"), p("Ptosis (less common)"), p("Bilateral ptosis, dilated fixed pupils, ophthalmoplegia"), p("Miosis (pinpoint pupils)"), p("Absent"), p("Absent")],
    [p("Sensory features"), p("Normal"), p("None (purely motor)"), p("None (purely motor)"), p("None (purely motor)"), p("None (motor dominant)"), p("None"), p("None")],
    [p("Reflexes"), p("Normal"), p("Normal or slightly reduced"), p("Reduced / absent → return after exercise"), p("Reduced / absent"), p("Reduced"), p("Absent during block"), p("Absent during block")],
    [p("Response to rest"), p("—"), p("Improves (hallmark)"), p("Minimal improvement"), p("No improvement"), p("No improvement"), p("No improvement"), p("Spontaneous recovery")],
    [p("Key association"), p("—"), p("Thymoma (10–15%), thymus hyperplasia (85%)"), p("Small cell lung carcinoma (~60%)"), p("Improperly canned food, wound, infant botulism (honey)"), p("Organophosphorus compounds; nerve agents (sarin, VX)"), p("Anaesthesia adjunct"), p("Rapid sequence intubation (RSI)")],
    [p("Diagnosis"), p("—"), p("Anti-AChR antibodies (85%); Tensilon test; decremental EMG"), p("Anti-VGCC antibodies; incremental EMG; CT chest"), p("Clinical + toxin ELISA / mouse bioassay"), p("↓RBC cholinesterase; ↓plasma pseudocholinesterase"), p("Clinical (intraoperative)"), p("Clinical (intraoperative)")],
    [p("Treatment"), p("—"), p("Pyridostigmine; steroids; azathioprine; thymectomy; plasmapheresis; IVIg"), p("3,4-DAP; pyridostigmine; immunosuppression; treat malignancy"), p("Antitoxin (A/B/E); supportive ventilation; wound debridement"), p("Atropine (muscarinic block) + Pralidoxime / 2-PAM (early); supportive care"), p("Neostigmine + glycopyrrolate (reversal)"), p("Spontaneous reversal; no antidote; avoid in burns/crush/denervation (↑K⁺)")],
]

clin_col_w = [2.8*cm, 1.9*cm, 2.6*cm, 2.6*cm, 2.4*cm, 2.4*cm, 2.0*cm, 2.3*cm]
clin_data  = [clin_header] + clin_rows

clin_tbl = Table(clin_data, colWidths=clin_col_w, repeatRows=1)
clin_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),   DARK_BLUE),
    ("TEXTCOLOR",     (0,0),(-1,0),   WHITE),
    ("FONTNAME",      (0,0),(-1,-1),  "Helvetica"),
    ("FONTNAME",      (0,0),(-1,0),   "Helvetica-Bold"),
    ("FONTNAME",      (0,0),(0,-1),   "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),  7),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),  [WHITE, LIGHT_BLUE]),
    ("ALIGN",         (0,0),(-1,-1),  "LEFT"),
    ("VALIGN",        (0,0),(-1,-1),  "TOP"),
    ("GRID",          (0,0),(-1,-1),  0.3, GREY_MID),
    ("TOPPADDING",    (0,0),(-1,-1),  3),
    ("BOTTOMPADDING", (0,0),(-1,-1),  3),
    ("LEFTPADDING",   (0,0),(-1,-1),  4),
    ("BACKGROUND",    (1,0),(1,0),    GREEN_SOFT),
    ("BACKGROUND",    (1,1),(1,-1),   LIGHT_GREEN),
]))
story.append(clin_tbl)
story.append(Spacer(1, 0.4*cm))

# ═══════════════════════════════════════════════════════════════════
# SECTION 5 – Quick Memory Summary
# ═══════════════════════════════════════════════════════════════════
story.append(PageBreak())
story.append(section_header("SECTION 5: Quick Memory Summary Table", bg=PURPLE))
story.append(Spacer(1, 0.3*cm))

def ph(text):
    return Paragraph(text, ParagraphStyle("th_p", fontName="Helvetica-Bold", fontSize=8.5,
                                           textColor=WHITE, alignment=TA_CENTER, leading=12))
def pd_l(text, bold=False):
    st = ParagraphStyle("td_pl", fontName="Helvetica-Bold" if bold else "Helvetica",
                         fontSize=8, textColor=BLACK, leading=11)
    return Paragraph(text, st)

summ_header = [ph("Disorder"), ph("Antibody / Agent"), ph("Site"), ph("Repetition Effect"), ph("Key Clinical Clue"), ph("Association")]
summ_rows = [
    [pd_l("Myasthenia Gravis", True),    pd_l("Anti-AChR (IgG)"),              pd_l("Post-synaptic"),  pd_l("Decremental (worsens)"),   pd_l("Fatigable ptosis + diplopia; improves with rest"), pd_l("Thymoma / Thymus hyperplasia")],
    [pd_l("Lambert-Eaton", True),        pd_l("Anti-VGCC (IgG)"),              pd_l("Pre-synaptic"),   pd_l("Incremental (improves)"),  pd_l("Proximal leg weakness + dry mouth"), pd_l("Small cell lung cancer")],
    [pd_l("Botulinum Toxicity", True),   pd_l("Botulinum toxin (SNARE)"),      pd_l("Pre-synaptic"),   pd_l("No response"),             pd_l("Descending paralysis + dry mouth + dilated pupils"), pd_l("Improperly canned food")],
    [pd_l("Organophosphate", True),      pd_l("OPC (AChE inhibition)"),        pd_l("Cleft (AChE)"),   pd_l("Repetitive firing"),       pd_l("SLUDGE + fasciculations + miosis"), pd_l("Pesticides / nerve agents")],
    [pd_l("Curare", True),               pd_l("Competitive N_M antagonist"),   pd_l("Post-synaptic"),  pd_l("No response"),             pd_l("Dose-dependent flaccid paralysis; reversed by neostigmine"), pd_l("Anaesthesia")],
    [pd_l("Succinylcholine", True),      pd_l("Depolarizing N_M agonist"),     pd_l("Post-synaptic"),  pd_l("No response"),             pd_l("Fasciculations first; ↑K⁺ risk; spontaneous reversal"), pd_l("RSI / short procedures")],
]

scol = [3.2*cm, 3.2*cm, 2.3*cm, 2.6*cm, 4.5*cm, 3.2*cm]
summ_data = [summ_header] + summ_rows
summ_tbl  = Table(summ_data, colWidths=scol, repeatRows=1)
row_colors = [LIGHT_RED, LIGHT_PURPLE, LIGHT_GOLD, LIGHT_TEAL, LIGHT_GREEN, colors.HexColor("#FFF9C4")]
summ_style = TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),   PURPLE),
    ("TEXTCOLOR",     (0,0),(-1,0),   WHITE),
    ("FONTNAME",      (0,0),(-1,0),   "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),  8),
    ("ALIGN",         (0,0),(-1,-1),  "LEFT"),
    ("VALIGN",        (0,0),(-1,-1),  "TOP"),
    ("GRID",          (0,0),(-1,-1),  0.4, GREY_MID),
    ("TOPPADDING",    (0,0),(-1,-1),  5),
    ("BOTTOMPADDING", (0,0),(-1,-1),  5),
    ("LEFTPADDING",   (0,0),(-1,-1),  5),
])
for i, rc in enumerate(row_colors, start=1):
    summ_style.add("BACKGROUND", (0,i), (-1,i), rc)
summ_tbl.setStyle(summ_style)
story.append(summ_tbl)
story.append(Spacer(1, 0.4*cm))

# ═══════════════════════════════════════════════════════════════════
# SECTION 6 – MG vs LEMS detailed comparison
# ═══════════════════════════════════════════════════════════════════
story.append(section_header("SECTION 6: MG vs. Lambert-Eaton – Detailed Comparison", bg=GOLD))
story.append(Spacer(1, 0.3*cm))

def pg(text):
    return Paragraph(text, ParagraphStyle("hg", fontName="Helvetica-Bold", fontSize=8.5,
                                           textColor=WHITE, alignment=TA_CENTER, leading=12))

mg_header = [pg("Feature"), pg("Myasthenia Gravis (MG)"), pg("Lambert-Eaton Syndrome (LEMS)")]
mg_rows = [
    ["Autoantibody", "Anti-AChR (IgG) – 85%\nAnti-MuSK – 5–10% (seronegative forms)", "Anti-VGCC (P/Q-type) IgG"],
    ["Defect site", "Postsynaptic – motor endplate", "Presynaptic – motor nerve terminal"],
    ["Pathophysiology", "Antibodies destroy & internalize AChR by endocytosis; junctional folds sparse/absent; 70–90% ↓ receptor number", "Antibodies block VGCCs → ↓ Ca²⁺ entry → ↓ ACh exocytosis → ↓ EPP"],
    ["MEPP", "Normal amplitude (presynaptic release intact)", "Reduced amplitude (less ACh per release event)"],
    ["EPP", "Reduced (fewer receptors)", "Reduced at rest"],
    ["Effect of exercise", "Worsens – progressive fatigue", "Improves – repetitive stimulation accumulates Ca²⁺ → more ACh released"],
    ["EMG – repetitive stimulation", "DECREMENTAL response at 3 Hz", "INCREMENTAL response at 50 Hz"],
    ["Muscles first affected", "Extraocular: ptosis, diplopia (classic onset)", "Proximal lower limb: difficulty standing, climbing stairs; waddling gait"],
    ["Autonomic involvement", "Absent", "Present: dry mouth, constipation, hypotension, impotence"],
    ["Reflexes", "Normal or mildly ↓", "Reduced / absent → improve after exercise"],
    ["Sex predominance", "Women in 20s; Men in 60s", "Equal in men and women"],
    ["Associated malignancy", "Thymoma (10–15%)", "Small cell lung carcinoma (~60%)"],
    ["Thymus", "Hyperplastic (85%), thymoma (10–15%)", "Not typically involved"],
    ["Other autoimmune associations", "SLE, RA, polymyositis", "Less common"],
    ["Diagnosis", "Anti-AChR ab; Tensilon (edrophonium) test; decremental EMG", "Anti-VGCC ab; incremental EMG; CT chest for SCLC"],
    ["Treatment", "Pyridostigmine; steroids; azathioprine; thymectomy; plasmapheresis; IVIg; eculizumab (refractory)", "3,4-Diaminopyridine (3,4-DAP); pyridostigmine; immunosuppression; treat underlying SCLC"],
    ["Response to AChE inhibitors", "Good symptomatic response", "Partial / mild response"],
    ["Crisis management", "Myasthenic crisis → plasmapheresis / IVIg + ventilatory support", "Supportive; plasmapheresis in severe cases"],
]

mg_col = [4*cm, 7.5*cm, 7.5*cm]
mg_data = [mg_header] + [[Paragraph(r[0], ParagraphStyle("f", fontName="Helvetica-Bold", fontSize=8, textColor=DARK_BLUE, leading=11)),
                            Paragraph(r[1], small),
                            Paragraph(r[2], small)] for r in mg_rows]
mg_tbl = Table(mg_data, colWidths=mg_col, repeatRows=1)
mg_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),   GOLD),
    ("TEXTCOLOR",     (0,0),(-1,0),   WHITE),
    ("FONTNAME",      (0,0),(-1,0),   "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),  8),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),  [WHITE, LIGHT_GOLD]),
    ("ALIGN",         (0,0),(-1,-1),  "LEFT"),
    ("VALIGN",        (0,0),(-1,-1),  "TOP"),
    ("GRID",          (0,0),(-1,-1),  0.4, GREY_MID),
    ("TOPPADDING",    (0,0),(-1,-1),  4),
    ("BOTTOMPADDING", (0,0),(-1,-1),  4),
    ("LEFTPADDING",   (0,0),(-1,-1),  5),
    # Highlight key differentiator rows
    ("BACKGROUND",    (0,5),(-1,5),   colors.HexColor("#FCE4D6")),
    ("BACKGROUND",    (0,6),(-1,6),   colors.HexColor("#FCE4D6")),
]))
story.append(mg_tbl)
story.append(Spacer(1, 0.3*cm))

# ═══════════════════════════════════════════════════════════════════
# SECTION 7 – Pharmacology at NMJ
# ═══════════════════════════════════════════════════════════════════
story.append(PageBreak())
story.append(section_header("SECTION 7: Pharmacological Agents at the NMJ", bg=RED_SOFT))
story.append(Spacer(1, 0.3*cm))

def pr(text):
    return Paragraph(text, ParagraphStyle("hr", fontName="Helvetica-Bold", fontSize=8.5,
                                           textColor=WHITE, alignment=TA_CENTER, leading=12))

pharm_header = [pr("Drug / Agent"), pr("Class"), pr("Mechanism"), pr("Effect at NMJ"), pr("Clinical Use / Notes")]
pharm_rows = [
    ["Neostigmine", "AChE inhibitor (reversible)", "Inhibits AChE → ↑ ACh in cleft", "Enhances NMT; prolongs EPP", "Reversal of non-depolarizing block; MG treatment"],
    ["Pyridostigmine", "AChE inhibitor (reversible)", "Same as neostigmine; longer acting", "Enhances NMT", "First-line symptomatic treatment in MG"],
    ["Edrophonium", "AChE inhibitor (short-acting)", "Ultra-short AChE inhibition (~5 min)", "Brief ↑ NMT", "Tensilon test for diagnosis of MG"],
    ["d-Tubocurarine (Curare)", "Non-depolarizing blocker", "Competitive antagonist at N_M receptor; no depolarization", "Prevents ACh from activating receptor → flaccid paralysis", "Anaesthesia; reversed by neostigmine"],
    ["Vecuronium / Rocuronium / Atracurium", "Non-depolarizing blocker", "Same as curare; fewer side effects", "Flaccid paralysis", "Modern surgical muscle relaxants"],
    ["Succinylcholine", "Depolarizing blocker", "Persistent agonist at N_M receptor → sustained depolarization → desensitization", "Phase I: fasciculations; Phase II: flaccid paralysis", "RSI; risk: hyperkalemia (burns, crush), malignant hyperthermia"],
    ["Botulinum toxin", "Biological toxin", "Cleaves SNARE proteins (synaptobrevin / SNAP-25 / syntaxin) → blocks ACh vesicle exocytosis", "Complete absence of ACh release → flaccid paralysis", "Medical: blepharospasm, dystonia, wrinkles; Poisoning: descending paralysis"],
    ["Hemicholinium", "Experimental agent", "Blocks choline reuptake transporter at nerve terminal", "Depletes ACh stores over time → NMT failure", "Research tool; not clinical"],
    ["Aminoglycosides (e.g. gentamicin)", "Antibiotics", "Reduce Ca²⁺ influx at nerve terminal; compete with Ca²⁺", "Impair ACh release; potentiate non-depolarizing block", "Clinical relevance in ICU: may unmask or worsen MG/LEMS"],
    ["3,4-Diaminopyridine (3,4-DAP)", "K⁺ channel blocker", "Blocks presynaptic K⁺ channels → prolongs AP in terminal → ↑ Ca²⁺ entry → ↑ ACh release", "Increases quantal ACh release", "Treatment of LEMS"],
    ["Atropine", "Muscarinic antagonist", "Blocks muscarinic ACh receptors (not N_M)", "No effect at NMJ; blocks autonomic (SLUDGE) effects of excess ACh", "Used in organophosphate poisoning"],
    ["Pralidoxime (2-PAM)", "AChE reactivator", "Reactivates AChE before 'ageing' occurs", "Restores AChE activity → removes excess ACh from cleft", "Organophosphate poisoning (must be given early)"],
]

pharm_col = [3.0*cm, 2.8*cm, 4.0*cm, 3.5*cm, 5.7*cm]
pharm_data = [pharm_header] + [
    [Paragraph(r[0], ParagraphStyle("pb", fontName="Helvetica-Bold", fontSize=7.5, textColor=RED_SOFT, leading=10)),
     Paragraph(r[1], small),
     Paragraph(r[2], small),
     Paragraph(r[3], small),
     Paragraph(r[4], small)] for r in pharm_rows
]
pharm_tbl = Table(pharm_data, colWidths=pharm_col, repeatRows=1)
pharm_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0),(-1,0),   RED_SOFT),
    ("TEXTCOLOR",     (0,0),(-1,0),   WHITE),
    ("FONTNAME",      (0,0),(-1,0),   "Helvetica-Bold"),
    ("FONTSIZE",      (0,0),(-1,-1),  7.5),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),  [WHITE, LIGHT_RED]),
    ("ALIGN",         (0,0),(-1,-1),  "LEFT"),
    ("VALIGN",        (0,0),(-1,-1),  "TOP"),
    ("GRID",          (0,0),(-1,-1),  0.3, GREY_MID),
    ("TOPPADDING",    (0,0),(-1,-1),  3),
    ("BOTTOMPADDING", (0,0),(-1,-1),  3),
    ("LEFTPADDING",   (0,0),(-1,-1),  4),
]))
story.append(pharm_tbl)
story.append(Spacer(1, 0.3*cm))

# ═══════════════════════════════════════════════════════════════════
# SECTION 8 – RGUHS Key Points
# ═══════════════════════════════════════════════════════════════════
story.append(PageBreak())
story.append(section_header("SECTION 8: Important Points for RGUHS Examinations", bg=ACCENT_TEAL))
story.append(Spacer(1, 0.3*cm))

key_points = [
    ("Safety factor of NMT", "The EPP is normally 3–4× the threshold – this safety margin ensures reliable 1:1 transmission at every impulse under normal conditions."),
    ("MEPP diagnostic value", "In MG: MEPP amplitude is NORMAL (presynaptic intact) but EPP is small (fewer receptors). In LEMS: MEPP amplitude is REDUCED (presynaptic release impaired). This distinguishes pre- vs. post-synaptic defects."),
    ("Decremental vs. Incremental EMG", "Decremental (worsens on repetition) = MG (post-synaptic). Incremental (improves on repetition) = LEMS (pre-synaptic). Key exam differentiator."),
    ("All NMT disorders are purely motor", "No sensory loss in any NMT disorder – sensory nerves do not use the NMJ. This differentiates NMJ disease from spinal cord or peripheral nerve lesions."),
    ("Curare antidote", "Non-depolarizing blockers (curare, vecuronium) are reversed by AChE inhibitors (neostigmine + glycopyrrolate). Depolarizing blockers (succinylcholine) CANNOT be reversed by neostigmine and reverse spontaneously."),
    ("Succinylcholine hyperkalemia risk", "Avoided in burns, crush injury, denervation, and prolonged bed rest – these conditions cause upregulation of extrajunctional AChRs → massive K⁺ efflux → cardiac arrest."),
    ("Botulinum vs. Organophosphate", "Both cause paralysis but mechanism is opposite: Botulinum STOPS ACh release (dry, dilated pupils, descending paralysis). Organophosphate INCREASES ACh (SLUDGE, miosis, ascending paralysis with fasciculations)."),
    ("Thymectomy in MG", "Induces remission in 35% and improves symptoms in 45% even without thymoma. Thymus provides sensitized helper T-cells that cross-react with AChR."),
    ("Choline recycling", "~75% of choline from AChE hydrolysis is taken back up by the high-affinity choline transporter (HACT) at the nerve terminal for resynthesis of ACh."),
    ("Role of Ca²⁺ and Mg²⁺ at NMJ", "Quantal ACh release varies DIRECTLY with Ca²⁺ and INVERSELY with Mg²⁺ at the endplate. Mg²⁺ competes with Ca²⁺ at the active zone – reason why hypermagnesemia causes neuromuscular weakness."),
]

for title, desc in key_points:
    kp_row = Table([
        [Paragraph(f"★  {title}", ParagraphStyle("kph", fontName="Helvetica-Bold", fontSize=9, textColor=DARK_BLUE, leading=12)),
         Paragraph(desc, body)]
    ], colWidths=[4.5*cm, 14.5*cm])
    kp_row.setStyle(TableStyle([
        ("VALIGN",        (0,0),(-1,-1), "TOP"),
        ("TOPPADDING",    (0,0),(-1,-1), 4),
        ("BOTTOMPADDING", (0,0),(-1,-1), 4),
        ("LEFTPADDING",   (0,0),(-1,-1), 6),
        ("LINEBELOW",     (0,0),(-1,-1), 0.3, GREY_MID),
        ("BACKGROUND",    (0,0),(0,0),   LIGHT_TEAL),
    ]))
    story.append(kp_row)

story.append(Spacer(1, 0.4*cm))
story.append(note_box(
    "Reference: GK Pal Textbook of Medical Physiology | Ganong's Review of Medical Physiology 26th Ed. (Ch. 6) | "
    "Prepared for RGUHS First Year MBBS Physiology"
))

# ── Build PDF ─────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF generated: {OUTPUT}")
Running Command

cd /home/daytona/workspace/nmt-notes && python generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/nmt-notes/NMT_Comparison_Table.pdf

Your PDF is ready (698 KB, 5 pages):

NMT Comparison Table

PDF Document · PDF

What's inside (8 sections):
  1. Cover page - with both NMJ structure and events diagrams (from Ganong's) side by side
  2. Normal NMT step-by-step table - all 9 steps with ions and results
  3. Quantal release & MEPP - rest vs. impulse comparison
  4. Mechanism comparison table - Normal vs. 6 disorders across 12 parameters
  5. Clinical features table - same 7 columns covering muscle groups, autonomic features, reflexes, diagnosis, treatment
  6. MG vs. LEMS detailed comparison - 18-row deep dive with key differentiators highlighted
  7. Pharmacology at the NMJ - 12 drugs with mechanism, effect, and clinical use
  8. RGUHS exam key points - 10 high-yield points formatted for quick revision
This is a shared conversation. Sign in to Orris to start your own chat.