~/anatomy-pdf/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus.tableofcontents import TableOfContents
OUTPUT = "/tmp/workspace/anatomy-pdf/Anatomy_Quick_Reference.pdf"
# ── Color palette ──────────────────────────────────────────────────────────────
C_HEADER = colors.HexColor("#1a3a5c") # dark navy - region headers
C_Q_BAR = colors.HexColor("#2e6da4") # blue - question title bars
C_TABLE_H = colors.HexColor("#d6e4f0") # light blue - table header bg
C_TABLE_R = colors.HexColor("#f0f6fb") # very light blue - alt rows
C_DIVIDER = colors.HexColor("#adc8e0") # muted blue - HR lines
C_APPLIED = colors.HexColor("#fff3cd") # warm yellow - applied boxes
C_APPLIED_B= colors.HexColor("#856404") # dark amber - applied text
C_BG_REGION= colors.HexColor("#eaf3fb") # soft blue region banner bg
PAGE_W, PAGE_H = A4
MARGIN = 1.8 * cm
styles = getSampleStyleSheet()
# Custom styles
def S(name, **kw):
return ParagraphStyle(name, **kw)
st_title = S("MyTitle", fontSize=26, textColor=C_HEADER, fontName="Helvetica-Bold",
alignment=TA_CENTER, spaceAfter=4)
st_subtitle = S("MySubtitle", fontSize=12, textColor=colors.HexColor("#555555"),
fontName="Helvetica", alignment=TA_CENTER, spaceAfter=2)
st_region = S("RegionHeader", fontSize=16, textColor=colors.white,
fontName="Helvetica-Bold", backColor=C_HEADER,
borderPad=6, leftIndent=4, spaceAfter=6, spaceBefore=14)
st_q = S("QTitle", fontSize=11, textColor=colors.white,
fontName="Helvetica-Bold", backColor=C_Q_BAR,
borderPad=4, leftIndent=4, spaceAfter=2, spaceBefore=8)
st_body = S("Body", fontSize=9, fontName="Helvetica", leading=13,
spaceAfter=2, alignment=TA_JUSTIFY)
st_bullet = S("Bullet", fontSize=9, fontName="Helvetica", leading=13,
leftIndent=12, bulletIndent=4, spaceAfter=1)
st_applied = S("Applied", fontSize=9, fontName="Helvetica-Oblique",
textColor=C_APPLIED_B, leading=12, leftIndent=8, spaceAfter=2)
st_applied_hdr = S("AppliedHdr", fontSize=9, fontName="Helvetica-Bold",
textColor=C_APPLIED_B, spaceAfter=1, leftIndent=8)
st_toc_region = S("TocRegion", fontSize=11, fontName="Helvetica-Bold",
textColor=C_HEADER, spaceBefore=6, spaceAfter=2)
st_toc_item = S("TocItem", fontSize=9, fontName="Helvetica",
leftIndent=12, spaceAfter=1)
st_footer_note = S("FooterNote", fontSize=8, fontName="Helvetica-Oblique",
textColor=colors.grey, alignment=TA_CENTER)
def hr():
return HRFlowable(width="100%", thickness=0.5, color=C_DIVIDER, spaceAfter=4, spaceBefore=2)
def region_header(text):
return Paragraph(f" {text}", st_region)
def q_header(text):
return Paragraph(f" {text}", st_q)
def body(text):
return Paragraph(text, st_body)
def bullet(text):
return Paragraph(f"• {text}", st_bullet)
def applied_box(lines):
items = [Paragraph("Applied / Clinical Significance", st_applied_hdr)]
for l in lines:
items.append(Paragraph(f"• {l}", st_applied))
data = [[items]]
t = Table(data, colWidths=[PAGE_W - 2*MARGIN - 0.2*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_APPLIED),
('BOX', (0,0), (-1,-1), 0.5, colors.HexColor("#ffc107")),
('LEFTPADDING', (0,0), (-1,-1), 6),
('RIGHTPADDING', (0,0), (-1,-1), 6),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
]))
return t
def make_table(headers, rows, col_widths=None):
avail = PAGE_W - 2*MARGIN - 0.4*cm
if col_widths is None:
w = avail / len(headers)
col_widths = [w] * len(headers)
hdr_cells = [Paragraph(f"<b>{h}</b>", S("th", fontSize=8, fontName="Helvetica-Bold",
textColor=C_HEADER, leading=11)) for h in headers]
table_data = [hdr_cells]
for i, row in enumerate(rows):
row_cells = [Paragraph(str(c), S(f"td{i}", fontSize=8, fontName="Helvetica", leading=11))
for c in row]
table_data.append(row_cells)
t = Table(table_data, colWidths=col_widths)
style = [
('BACKGROUND', (0,0), (-1,0), C_TABLE_H),
('BOX', (0,0), (-1,-1), 0.5, C_DIVIDER),
('INNERGRID', (0,0), (-1,-1), 0.3, C_DIVIDER),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING', (0,0), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
]
for i in range(1, len(table_data)):
if i % 2 == 0:
style.append(('BACKGROUND', (0,i), (-1,i), C_TABLE_R))
t.setStyle(TableStyle(style))
return t
# ═══════════════════════════════════════════════════════════════════════════════
# CONTENT
# ═══════════════════════════════════════════════════════════════════════════════
story = []
# ── Cover page ─────────────────────────────────────────────────────────────────
story.append(Spacer(1, 3.5*cm))
story.append(Paragraph("ANATOMY", S("cov1", fontSize=36, textColor=C_HEADER,
fontName="Helvetica-Bold", alignment=TA_CENTER)))
story.append(Paragraph("Quick Reference", S("cov2", fontSize=22,
textColor=C_Q_BAR, fontName="Helvetica", alignment=TA_CENTER)))
story.append(Spacer(1, 0.5*cm))
story.append(HRFlowable(width="60%", thickness=2, color=C_Q_BAR, hAlign="CENTER"))
story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("45 High-Yield Topics Organized by Body Region", S("cov3",
fontSize=13, textColor=colors.HexColor("#555555"),
fontName="Helvetica-Oblique", alignment=TA_CENTER)))
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("MBBS / MD Anatomy Examination Preparation",
S("cov4", fontSize=11, textColor=colors.grey,
fontName="Helvetica", alignment=TA_CENTER)))
story.append(Spacer(1, 5*cm))
story.append(Paragraph("Regions Covered:", S("cov5", fontSize=11,
textColor=C_HEADER, fontName="Helvetica-Bold", alignment=TA_CENTER)))
story.append(Spacer(1, 0.3*cm))
regions_list = [
"1. General Anatomy & Histology",
"2. Upper Limb",
"3. Lower Limb",
"4. Thorax & Breast",
"5. Abdomen & Pelvis",
"6. Reproductive System & Embryology",
"7. Head, Neck & Neuroanatomy",
]
for r in regions_list:
story.append(Paragraph(r, S("rl", fontSize=10, fontName="Helvetica",
textColor=C_Q_BAR, alignment=TA_CENTER, spaceAfter=3)))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# REGION 1 – GENERAL ANATOMY & HISTOLOGY
# ═══════════════════════════════════════════════════════════════════════════════
story.append(region_header("REGION 1 — GENERAL ANATOMY & HISTOLOGY"))
story.append(Spacer(1, 0.2*cm))
# Q4 Sesamoid bone
story.append(KeepTogether([
q_header("Q4 · Sesamoid Bone"),
body("<b>Definition:</b> A bone that develops within a tendon, usually over a bony prominence, to protect it from friction and wear."),
Spacer(1, 0.15*cm),
make_table(
["Feature", "Sesamoid Bone", "Compact Bone"],
[
["Location", "Within a tendon", "Cortex of long bones"],
["Shape", "Ovoid / nodular", "Cylindrical / flat"],
["Marrow", "Minimal or none", "Yellow marrow present"],
["Ossification", "Intramembranous", "Endochondral"],
],
[4*cm, 5.5*cm, 5.5*cm]
),
Spacer(1, 0.15*cm),
body("<b>Functions:</b> Reduces tendon friction · Alters angle of pull (mechanical advantage) · Protects against compressive forces"),
body("<b>Examples:</b> Patella (largest) · 2 sesamoids under 1st metatarsal head · Pisiform (in FCU tendon) · Fabella (behind lateral femoral condyle)"),
]))
story.append(Spacer(1, 0.3*cm))
# Q16 Somites
story.append(KeepTogether([
q_header("Q16 · Somites — Definition & Derivatives"),
body("<b>Definition:</b> Paired, segmented blocks of paraxial mesoderm that form bilaterally alongside the neural tube during weeks 3–5 (42–44 pairs total)."),
Spacer(1, 0.15*cm),
make_table(
["Compartment", "Location", "Derivatives"],
[
["Sclerotome", "Ventromedial", "Vertebrae, ribs, skull base"],
["Myotome", "Central", "Skeletal muscles of trunk & limbs"],
["Dermatome", "Dorsolateral", "Dermis of dorsal skin"],
],
[4*cm, 4*cm, 7*cm]
),
applied_box(["Hemivertebra / butterfly vertebra from sclerotome defects", "Congenital muscular defects from myotome anomalies"]),
]))
story.append(Spacer(1, 0.3*cm))
# Q17 Anastomosis
story.append(KeepTogether([
q_header("Q17 · Anastomosis — Definition & Types"),
body("<b>Definition:</b> A communication between two vessels (arteries, veins, or lymphatics) providing collateral circulation."),
Spacer(1, 0.1*cm),
make_table(
["Type", "Example"],
[
["Actual anastomosis", "Circle of Willis, palmar arches"],
["Potential anastomosis", "Coronary arteries (collaterals develop with ischaemia)"],
["End artery (no anastomosis)", "Central retinal artery, splenic end-arteries"],
["Portosystemic", "Oesophageal varices, haemorrhoids"],
["Arteriovenous", "AVMs"],
],
[5.5*cm, 9.5*cm]
),
applied_box(["End arteries — occlusion causes infarction (e.g. central retinal artery occlusion → blindness)"]),
]))
story.append(Spacer(1, 0.3*cm))
# Q25 Epiphysis
story.append(KeepTogether([
q_header("Q25 · Epiphysis — Definition & Types"),
body("<b>Definition:</b> A secondary ossification centre at the end of a long bone, separated from the diaphysis by the epiphyseal (growth) plate until skeletal maturity."),
Spacer(1, 0.1*cm),
make_table(
["Type", "Description", "Example"],
[
["Pressure epiphysis", "At joint ends; transmits weight", "Femoral head, distal femur"],
["Traction epiphysis (apophysis)", "At tendon attachments; transmits muscle pull; no joint", "Greater trochanter, tibial tuberosity"],
["Atavistic epiphysis", "Represents ancestral separate bone", "Coracoid process, os trigonum"],
["Aberrant epiphysis", "Appears in wrong location", "Head (not base) of 1st metacarpal"],
],
[4.5*cm, 5.5*cm, 5*cm]
),
applied_box(["Salter-Harris fractures (I–V) through growth plate", "SCFE in overweight adolescents", "Epiphysiodesis to correct limb-length discrepancy"]),
]))
story.append(Spacer(1, 0.3*cm))
# Q37 Parts of long bone
story.append(KeepTogether([
q_header("Q37 · Parts of Long Bone & Blood Supply"),
make_table(
["Part", "Description"],
[
["Epiphysis", "End; articular cartilage; secondary ossification centre"],
["Physis (growth plate)", "Zone of proliferating chondrocytes"],
["Metaphysis", "Flared region; rich blood supply; site of osteosarcoma & osteomyelitis"],
["Diaphysis", "Shaft; thick cortical bone; yellow marrow in adults"],
["Periosteum", "Outer fibrous + inner osteogenic layer; Volkmann's canals"],
["Endosteum", "Lines medullary cavity; osteoprogenitor cells"],
],
[4*cm, 11*cm]
),
Spacer(1, 0.1*cm),
body("<b>Blood supply:</b> (1) Nutrient artery → inner 2/3 cortex; (2) Metaphyseal arteries → metaphysis; (3) Epiphyseal arteries (separate in children); (4) Periosteal arteries → outer 1/3 cortex"),
applied_box(["AVN if epiphyseal supply disrupted (femoral head after neck fracture)", "Osteomyelitis seeds in metaphyseal sluggish capillary loops"]),
]))
story.append(Spacer(1, 0.3*cm))
# Microanatomy group
story.append(q_header("Q6 · Microanatomy of Large Artery (Elastic Artery)"))
story.append(body("e.g., Aorta, pulmonary trunk, common carotid arteries"))
story.append(make_table(
["Layer", "Key Features"],
[
["Tunica intima", "Endothelium + subendothelial CT + internal elastic lamina (fenestrated)"],
["Tunica media", "40–70 concentric elastic laminae alternating with smooth muscle; Windkessel effect"],
["Tunica adventitia", "Collagen, fibroblasts, vasa vasorum, nervi vasorum (thin relative to media)"],
],
[4.5*cm, 10.5*cm]
))
story.append(body("Elastic laminae stain black with Verhoeff's stain. No distinct external elastic lamina (unlike muscular arteries)."))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q15 · Microanatomy of Spinal (Dorsal Root) Ganglion"))
story.append(body("<b>Location:</b> Intervertebral foramen on dorsal root of spinal nerve"))
story.append(bullet("Neurons: Pseudounipolar — single process divides into central branch (→ dorsal horn) and peripheral branch (→ receptor)"))
story.append(bullet("Cell bodies: Large, spherical, pale nucleus, Nissl substance (RER)"))
story.append(bullet("Satellite cells: Flattened modified Schwann cells surrounding each neuron body"))
story.append(bullet("Capsule: Fibrous connective tissue"))
story.append(applied_box(["VZV lies dormant in DRG → reactivation = dermatomal shingles", "Site of changes in diabetic sensory neuropathy"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q26 · Microanatomy of Lymph Node"))
story.append(make_table(
["Zone", "Contents"],
[
["Capsule + trabeculae", "Dense fibrous CT"],
["Cortex", "Primary follicles (naive B cells); Secondary follicles with germinal centres (active B cells)"],
["Paracortex", "T lymphocytes; High endothelial venules (HEV) — lymphocyte entry"],
["Medullary cords", "Plasma cells, macrophages, B cells"],
["Medullary sinuses", "Lymph channels lined by macrophages; filter lymph"],
],
[4.5*cm, 10.5*cm]
))
story.append(body("<b>Lymph flow:</b> Afferent → subcapsular sinus → cortical sinuses → medullary sinuses → efferent (at hilum)"))
story.append(applied_box(["Reed-Sternberg cells in Hodgkin lymphoma destroy architecture", "Lymph node dissection in cancer staging"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q39 · Microanatomy of Hyaline Cartilage"))
story.append(make_table(
["Component", "Details"],
[
["Matrix", "Basophilic (sulfated proteoglycans); Type II collagen (invisible H&E); Alcian blue positive"],
["Chondrocytes", "In lacunae; deep zone: isogenous groups (cell nests)"],
["Territorial matrix", "Basophilic halo around cell nests (high proteoglycan)"],
["Perichondrium", "Inner chondrogenic + outer fibrous; ABSENT on articular surfaces"],
],
[4.5*cm, 10.5*cm]
))
story.append(body("<b>Locations:</b> Articular surfaces, costal cartilages, trachea/bronchi, larynx, nasal septum, fetal skeleton"))
story.append(applied_box(["Osteoarthritis = destruction of articular hyaline cartilage", "Avascular + aneural → poor regeneration; replaced by fibrocartilage"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q33 · Microanatomy of Suprarenal (Adrenal) Gland"))
story.append(make_table(
["Zone / Layer", "Histology", "Hormone Produced"],
[
["Zona Glomerulosa", "Clusters/arches; small cells", "Aldosterone"],
["Zona Fasciculata", "Parallel cords; large spongiocytes (lipid-laden)", "Cortisol, Corticosterone"],
["Zona Reticularis", "Irregular network; small dark cells; lipofuscin", "Androgens (DHEA, androstenedione)"],
["Medulla", "Chromaffin cells (brown with Cr salts); sustentacular cells", "Adrenaline (80%), Noradrenaline (20%)"],
],
[4.5*cm, 6*cm, 4.5*cm]
))
story.append(applied_box(["Conn's syndrome = glomerulosa adenoma", "Cushing's = fasciculata hyperplasia/adenoma", "CAH (21-hydroxylase deficiency)", "Phaeochromocytoma = medullary tumour"]))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# REGION 2 – UPPER LIMB
# ═══════════════════════════════════════════════════════════════════════════════
story.append(region_header("REGION 2 — UPPER LIMB"))
story.append(Spacer(1, 0.2*cm))
story.append(q_header("Q3 · Cubital Fossa — Boundaries, Contents & Clinical Significance"))
story.append(make_table(
["Boundary", "Structure"],
[
["Roof", "Skin + deep fascia + bicipital aponeurosis"],
["Floor", "Brachialis (medial), Supinator (lateral)"],
["Medial wall", "Pronator teres"],
["Lateral wall", "Brachioradialis"],
["Apex", "Meeting point of medial and lateral walls"],
],
[4*cm, 11*cm]
))
story.append(Spacer(1, 0.1*cm))
story.append(body("<b>Contents (lateral → medial — mnemonic TAN):</b> Biceps <b>T</b>endon → Brachial <b>A</b>rtery (bifurcates into radial & ulnar) → Median <b>N</b>erve"))
story.append(applied_box([
"Brachial artery — BP measurement, IV cannulation site",
"Median cubital vein — preferred venepuncture site",
"Supracondylar fracture of humerus — risk to brachial artery AND median nerve",
]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q13 · Rotator Cuff — Muscles, Nerve Supply & Action"))
story.append(make_table(
["Muscle (SITS)", "Origin", "Insertion", "Nerve (C)", "Action"],
[
["Supraspinatus", "Supraspinous fossa", "Greater tubercle (upper)", "Suprascapular C5,6", "Initiates abduction 0–15°"],
["Infraspinatus", "Infraspinous fossa", "Greater tubercle (middle)", "Suprascapular C5,6", "Lateral rotation"],
["Teres minor", "Lateral border scapula", "Greater tubercle (lower)", "Axillary C5,6", "Lateral rotation"],
["Subscapularis", "Subscapular fossa", "Lesser tubercle", "Upper+lower subscapular C5,6,7", "Medial rotation, adduction"],
],
[3.5*cm, 3.5*cm, 3.5*cm, 3.5*cm, 3*cm]
))
story.append(applied_box([
"Supraspinatus most commonly torn (impingement under coracoacromial arch)",
"Painful arc 60–120°; complete tear = cannot initiate abduction",
]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q22 · Supination & Pronation"))
story.append(body("<b>Joints involved:</b> Superior, middle, and inferior radioulnar joints"))
story.append(Spacer(1, 0.1*cm))
story.append(make_table(
["Movement", "Prime Movers", "Nerve"],
[
["Supination (palm forward)", "Biceps brachii (most powerful), Supinator", "Musculocutaneous C5,6 / Post. interosseous C6"],
["Pronation (palm back)", "Pronator teres (most powerful), Pronator quadratus", "Median nerve C6,7 / AIN C7,8"],
],
[4*cm, 6*cm, 5*cm]
))
story.append(applied_box(["Pulled elbow (nursemaid's) — subluxation of radial head through annular ligament in children", "Test: passive supination; 'screwdriver' motion"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q36 · Flexor Retinaculum — Anatomy & Applied"))
story.append(body("<b>Attachments:</b> Medially → pisiform & hook of hamate; Laterally → scaphoid tubercle & ridge of trapezium"))
story.append(Spacer(1, 0.1*cm))
story.append(make_table(
["Through carpal tunnel (deep to retinaculum)", "Superficial to retinaculum"],
[
["4 FDS tendons (2 rows)\n4 FDP tendons\nFPL tendon\nMedian nerve (radial/superficial)",
"Ulnar nerve & vessels (Guyon's canal)\nFlexor carpi ulnaris\nPalmaris longus"],
],
[7.5*cm, 7.5*cm]
))
story.append(applied_box([
"Carpal tunnel syndrome: median nerve compression → numbness/tingling lateral 3½ fingers, thenar wasting",
"Phalen's test (wrist flexion) & Tinel's sign",
"Common in pregnancy, hypothyroidism, RA, acromegaly",
"Rx: splint → steroid injection → surgical decompression (retinaculum division)",
]))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# REGION 3 – LOWER LIMB
# ═══════════════════════════════════════════════════════════════════════════════
story.append(region_header("REGION 3 — LOWER LIMB"))
story.append(Spacer(1, 0.2*cm))
story.append(q_header("Q5 · Gluteus Maximus — Origin, Insertion, Nerve Supply, Action"))
story.append(make_table(
["Aspect", "Details"],
[
["Origin", "Posterior gluteal line of ilium, dorsal sacrum & coccyx, sacrotuberous ligament, thoracolumbar fascia"],
["Insertion", "Upper ¾ → iliotibial tract (Gerdy's tubercle); Lower ¼ → gluteal tuberosity of femur"],
["Nerve", "Inferior gluteal nerve (L5, S1, S2)"],
["Actions", "Powerful hip extension (stairs, rising from sitting); lateral rotation; IT band stabilises knee"],
],
[3.5*cm, 11.5*cm]
))
story.append(applied_box(["Gluteal gait (waddling) when weakened", "IM injection: upper outer quadrant (avoids inferior gluteal vessels)"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q14 · Meniscus of Knee Joint"))
story.append(make_table(
["Feature", "Medial Meniscus", "Lateral Meniscus"],
[
["Shape", "C-shaped (larger)", "Circular / O-shaped"],
["Attachment", "Attached to MCL (tibial collateral lig.)", "Attached to popliteus; NOT to LCL"],
["Mobility", "Less mobile", "More mobile"],
["Injury rate", "4× more commonly torn", "Less commonly torn"],
],
[3.5*cm, 6.5*cm, 5*cm]
))
story.append(body("<b>Functions:</b> Deepen tibial plateau · Shock absorption (50–70% load) · Proprioception · Lubrication · Stabilisation"))
story.append(applied_box(["McMurray & Apley tests", "Bucket-handle tear → locking", "MRI investigation of choice"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q23 · Trendelenburg's Sign"))
story.append(body("<b>Test:</b> Stand on one leg. Normal (negative) = opposite pelvis rises. Positive (abnormal) = opposite pelvis drops."))
story.append(body("<b>Nerve tested:</b> Superior gluteal nerve (L4, L5, S1)"))
story.append(body("<b>Muscles responsible for NEGATIVE sign (normal):</b> Gluteus medius (main), Gluteus minimus, Tensor fasciae latae"))
story.append(Spacer(1, 0.1*cm))
story.append(make_table(
["Cause of Positive Trendelenburg", "Mechanism"],
[
["Superior gluteal nerve palsy", "Direct denervation of abductors"],
["Fracture neck of femur", "Abductors lose bony fulcrum"],
["Coxa vara", "Altered biomechanical lever arm"],
["CDH / DDH", "Shallow acetabulum, unstable hip"],
["Poliomyelitis (L4,L5)", "LMN paralysis of abductors"],
],
[6*cm, 9*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q24 · Popliteal Artery — Origin, Extent & Branches"))
story.append(body("<b>Origin:</b> Continuation of femoral artery at adductor hiatus (adductor magnus)"))
story.append(body("<b>Extent:</b> Adductor hiatus → lower border of popliteus → bifurcates into anterior and posterior tibial arteries"))
story.append(body("<b>Relation:</b> Deepest structure in popliteal fossa (anterior to vein and nerve); TAN from deep to superficial"))
story.append(body("<b>Branches:</b> Superior medial genicular · Superior lateral genicular · Middle genicular (cruciate ligaments) · Inferior medial genicular · Inferior lateral genicular"))
story.append(applied_box(["Popliteal aneurysm: most common peripheral aneurysm", "Injury in supracondylar fracture or posterior knee dislocation → limb-threatening ischaemia"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q34 · Popliteal Fossa — Boundaries & Contents"))
story.append(make_table(
["Boundary", "Structure"],
[
["Superolateral", "Biceps femoris"],
["Superomedial", "Semimembranosus + semitendinosus"],
["Inferolateral", "Lateral head of gastrocnemius"],
["Inferomedial", "Medial head of gastrocnemius"],
["Roof", "Popliteal fascia (short saphenous vein perforates)"],
["Floor", "Popliteal surface of femur, knee capsule, popliteus"],
],
[4*cm, 11*cm]
))
story.append(body("<b>Contents (TAN — from superficial to deep):</b> Tibial nerve (most posterior) → Popliteal vein → Popliteal artery (deepest); Common peroneal nerve along biceps tendon; Popliteal lymph nodes"))
story.append(applied_box(["Baker's cyst in medial gastrocnemius bursa", "Common peroneal nerve injury at fibular neck → foot drop", "Popliteal artery aneurysm"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q38 · Locking & Unlocking of Knee Joint"))
story.append(body("<b>Locking</b> (terminal 20–30° of extension — screw-home mechanism):"))
story.append(bullet("Lateral femoral condyle shorter than medial; when lateral arc is complete, medial condyle continues rotating femur medially on tibia (or tibia rotates laterally — closed chain)"))
story.append(bullet("All ligaments become taut → fully extended 'locked' knee stable without muscle effort"))
story.append(Spacer(1, 0.1*cm))
story.append(body("<b>Unlocking</b> (must precede flexion):"))
story.append(bullet("Popliteus muscle laterally rotates femur (medially rotates tibia) → unlocks joint"))
story.append(bullet("Nerve: Tibial nerve (L4, L5, S1)"))
story.append(applied_box(["Bucket-handle meniscal tear can prevent locking → joint locks in flexion", "Popliteus tear → failure to unlock"]))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# REGION 4 – THORAX & BREAST
# ═══════════════════════════════════════════════════════════════════════════════
story.append(region_header("REGION 4 — THORAX & BREAST"))
story.append(Spacer(1, 0.2*cm))
story.append(q_header("Q1 · Lymphatic Drainage of Mammary Gland"))
story.append(make_table(
["Route", "% Drainage", "Nodes"],
[
["Axillary (pectoral → central → apical)", "~75% (principal)", "Anterior axillary nodes"],
["Internal mammary", "~20%", "Parasternal nodes (medial quadrants)"],
["Posterior intercostal", "Deep aspects", "Posterior intercostal nodes"],
["Infraclavicular / supraclavicular", "Upper quadrants", "Infra/supraclavicular nodes"],
["Contralateral breast", "Cross drainage", "Via subareolar plexus"],
["Subdiaphragmatic/liver", "Inferior quadrants", "Via rectus sheath"],
],
[6*cm, 3.5*cm, 5.5*cm]
))
story.append(applied_box([
"Axillary clearance standard in breast cancer (75% spread is axillary)",
"Sentinel lymph node biopsy: first draining node concept",
"Internal mammary nodal involvement affects radiotherapy planning",
]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q10 · Development of Diaphragm & Anomalies"))
story.append(make_table(
["Component", "Contribution"],
[
["Septum transversum (week 4)", "Central tendon"],
["Pleuroperitoneal membranes", "Posterolateral parts"],
["Dorsal mesentery of oesophagus", "Crura + median arcuate ligament"],
["Body wall ingrowth", "Peripheral muscular parts"],
],
[5.5*cm, 9.5*cm]
))
story.append(Spacer(1, 0.1*cm))
story.append(make_table(
["Anomaly", "Defect", "Features"],
[
["Bochdalek hernia", "Posterolateral (most common CDH, 80%)", "Left-sided 85%; bowel in thorax; neonatal respiratory distress"],
["Morgagni hernia", "Anterior retrosternal", "Rare; usually right-sided"],
["Eventration", "Thinned muscular dome", "Paradoxical movement"],
],
[4.5*cm, 5.5*cm, 5*cm]
))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# REGION 5 – ABDOMEN & PELVIS
# ═══════════════════════════════════════════════════════════════════════════════
story.append(region_header("REGION 5 — ABDOMEN & PELVIS"))
story.append(Spacer(1, 0.2*cm))
story.append(q_header("Q8 · Extrahepatic Biliary Apparatus"))
story.append(body("<b>Pathway:</b> R & L hepatic ducts → Common hepatic duct + cystic duct → Common bile duct (CBD) → Ampulla of Vater → 2nd part duodenum"))
story.append(body("<b>Calot's triangle:</b> Bounded by cystic duct, common hepatic duct, inferior liver surface — contains cystic artery (branch of R hepatic artery)"))
story.append(applied_box([
"Gallstones: cystic duct obstruction = cholecystitis; CBD obstruction = obstructive jaundice",
"Mirizzi syndrome: stone in cystic duct compresses CBD",
"Murphy's sign: gallbladder tenderness on inspiration",
"Courvoisier's law: palpable non-tender GB + jaundice = pancreatic head carcinoma (not stones)",
]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q9 · Rectus Sheath — Formation & Contents"))
story.append(make_table(
["Level", "Anterior Wall", "Posterior Wall"],
[
["Above costal margin", "EO aponeurosis only", "None (rectus on costal cartilages)"],
["Above arcuate line", "EO + anterior IO lamina", "Posterior IO lamina + TA"],
["Below arcuate line (linea semilunaris of Douglas)", "All three aponeuroses (EO + IO + TA)", "None (only transversalis fascia)"],
],
[4.5*cm, 5.5*cm, 5*cm]
))
story.append(body("<b>Contents:</b> Rectus abdominis, pyramidalis, superior & inferior epigastric vessels, nerves T7–T12 + L1 (iliohypogastric, ilioinguinal)"))
story.append(applied_box(["Rectus sheath haematoma — below arcuate line: no posterior wall → unrestricted spread; mimics acute abdomen"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q11 · Ligamentous Support & Blood Supply of Urinary Bladder"))
story.append(body("<b>True ligaments:</b> Pubovesical (female) / puboprostatic (male) ligaments — peritoneal reflections"))
story.append(body("<b>False ligaments:</b> Median umbilical lig. (urachus anteriorly), medial umbilical ligs. (laterally), lateral ligaments"))
story.append(Spacer(1, 0.1*cm))
story.append(make_table(
["Artery", "Supply"],
[
["Superior vesical artery (from umbilical artery)", "Superior & anterosuperior bladder"],
["Inferior vesical artery (male) / Vaginal artery (female)", "Fundus and bladder neck"],
["Obturator + inferior gluteal (small)", "Additional contributions"],
],
[7.5*cm, 7.5*cm]
))
story.append(body("<b>Venous drainage:</b> Vesical venous plexus → internal iliac veins"))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q12 · Interior of Anal Canal"))
story.append(make_table(
["Feature", "Above Pectinate Line", "Below Pectinate Line"],
[
["Epithelium", "Columnar (endoderm)", "Stratified squamous (ectoderm)"],
["Arterial supply", "Superior rectal (IMA)", "Inferior rectal (pudendal)"],
["Venous drainage", "Portal (superior rectal)", "Systemic (inferior rectal)"],
["Lymphatics", "Internal iliac nodes", "Superficial inguinal nodes"],
["Nerve supply", "Autonomic (pain-insensitive)", "Somatic (pain-sensitive)"],
],
[4.5*cm, 5.5*cm, 5*cm]
))
story.append(body("<b>Sphincters:</b> Internal (smooth, involuntary) | External (skeletal, voluntary; subcutaneous/superficial/deep parts)"))
story.append(applied_box([
"Internal haemorrhoids (above — painless); external (below — painful)",
"Carcinoma above pectinate = adenocarcinoma; below = SCC",
"Anal fissure below pectinate line = painful (somatic innervation)",
]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q18 · Stomach Bed — Structures"))
story.append(body("The stomach bed = posterior relations visible when lesser sac (omental bursa) is opened:"))
story.append(body("Left diaphragm · Left suprarenal gland · Upper left kidney · Splenic artery (along upper pancreatic border) · Body & tail of pancreas · Transverse mesocolon · Splenic flexure of colon"))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q20 · Microanatomy of Ileum"))
story.append(make_table(
["Feature", "Ileum", "Jejunum (for comparison)"],
[
["Villi", "Short, finger-like", "Tall, leaf-like"],
["Plicae circulares", "Fewer/absent distally", "Numerous, tall"],
["Goblet cells", "More numerous", "Fewer"],
["Peyer's patches", "Present (in submucosa)", "Absent"],
["Wall / vascularity", "Thinner, less vascular", "Thicker, more vascular"],
],
[4.5*cm, 5.5*cm, 5*cm]
))
story.append(applied_box(["Meckel's diverticulum (ileum)", "Typhoid ulcers in Peyer's patches", "Crohn's disease: terminal ileum (skip lesions, cobblestone mucosa)"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q28 · Positions of Appendix & Arterial Supply"))
story.append(make_table(
["Position", "Frequency"],
[
["Retrocaecal", "65–70% (MOST COMMON)"],
["Pelvic / descending", "25–30%"],
["Paracaecal", "Rare"],
["Preileal", "Rare"],
["Postileal", "Rare"],
["Subcaecal", "Rare"],
],
[7*cm, 8*cm]
))
story.append(body("<b>Arterial supply:</b> Appendicular artery (branch of ileocolic artery from SMA) running in mesoappendix"))
story.append(applied_box(["Retrocaecal appendicitis: atypical presentation, no peritoneal signs, flank tenderness, positive psoas sign", "Pelvic appendicitis: diarrhoea + urinary symptoms"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q29 · Bare Area of Liver"))
story.append(body("<b>Definition:</b> Area on posterior/superior surface of right lobe NOT covered by peritoneum; directly contacts diaphragm."))
story.append(body("<b>Boundaries:</b> Superior layer of coronary lig. (above) · Inferior layer of coronary lig. (below) · Right triangular lig. (right) · IVC (left)"))
story.append(applied_box([
"Direct lymphatic connection liver → thorax → subphrenic abscess can spread to chest",
"Hepatic hydrothorax (right pleural effusion in cirrhosis) via this route",
"Amoebic liver abscess can rupture into pleural cavity / lung",
"No peritoneal barrier: HCC can directly invade diaphragm",
]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q30 · Ischiorectal (Ischioanal) Fossa — Boundaries & Contents"))
story.append(make_table(
["Wall", "Structure"],
[
["Medial", "External anal sphincter + levator ani"],
["Lateral", "Obturator internus + ischial tuberosity"],
["Posterior", "Sacrotuberous ligament + gluteus maximus"],
["Anterior", "Perineal body (posterior surface of perineal membrane)"],
["Floor", "Perineal skin"],
],
[4*cm, 11*cm]
))
story.append(body("<b>Contents:</b> Ischioanal fat pad · Inferior rectal vessels & nerves · Perineal branch of S4 · Pudendal canal (Alcock's canal) in lateral wall containing internal pudendal artery, vein, pudendal nerve"))
story.append(applied_box(["Ischiorectal abscess (most common perianal abscess) can track to form horseshoe abscess", "Pudendal nerve block via this fossa"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q31 · Coronal Section of Kidney — Macroscopic Features"))
story.append(make_table(
["Structure", "Description"],
[
["Cortex", "Outer reddish-brown zone; glomeruli, PCT, DCT; medullary rays extend into it"],
["Medulla", "8–18 renal pyramids; apex = papilla (projects into minor calyx); base faces cortex"],
["Columns of Bertin", "Cortical extensions between pyramids"],
["Renal sinus", "Central fat-filled space: pelvis, 2–3 major calyces, 8–12 minor calyces, vessels"],
],
[4.5*cm, 10.5*cm]
))
story.append(body("<b>Blood supply:</b> Renal a. → 5 segmental (end) arteries → interlobar → arcuate → interlobular → afferent arterioles → glomerulus"))
story.append(applied_box(["Hydronephrosis → cortical thinning", "Stone obstruction: PUJ, pelvic brim, VUJ", "Nephrectomy planes through columns of Bertin"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q41 · Deep Perineal Pouch — Boundaries & Contents"))
story.append(body("<b>Boundaries:</b> Superior fascia of urogenital diaphragm (above) · Perineal membrane (below) · Ischiopubic rami (lateral)"))
story.append(Spacer(1, 0.1*cm))
story.append(make_table(
["Contents — Male", "Contents — Female"],
[
["Deep transverse perineal muscle\nSphincter urethrae (ext. urethral sphincter)\nMembranous urethra\nBulbourethral (Cowper's) glands\nInternal pudendal vessels\nDorsal nerve of penis",
"Deep transverse perineal muscle\nSphincter urethrae\nUrethra + vagina\nInternal pudendal vessels\nDorsal nerve of clitoris"],
],
[7.5*cm, 7.5*cm]
))
story.append(applied_box(["Deep space infections spread superiorly into pelvis (no inferior barrier)", "Urethral injuries at membranous urethra"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q42 · Blood Supply & Lymphatic Drainage of Stomach"))
story.append(make_table(
["Area", "Artery (all from coeliac axis)", "Vein"],
[
["Lesser curvature", "Left gastric (coeliac) + Right gastric (hepatic proper)", "Left & right gastric → portal"],
["Greater curvature", "Left gastroepiploic (splenic) + Right gastroepiploic (gastroduodenal)", "Right gastroepiploic → SMV"],
["Fundus", "Short gastric arteries (4–5, from splenic)", "Short gastric → splenic"],
],
[3.5*cm, 7*cm, 4.5*cm]
))
story.append(body("<b>Lymphatics:</b> 4 zones all drain ultimately to coeliac nodes → thoracic duct"))
story.append(applied_box([
"Virchow's node (left supraclavicular) — gastric carcinoma distant spread",
"Krukenberg tumour (ovarian mets via transcoelemic/blood spread)",
"Sister Mary Joseph nodule — umbilical metastasis",
]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q45 · Portosystemic Anastomosis"))
story.append(make_table(
["Site", "Portal Vessel", "Systemic Vessel", "Clinical Sign"],
[
["Lower oesophagus", "Left gastric (coronary) v.", "Azygos / hemiazygos", "Oesophageal varices"],
["Anal canal (above pectinate)", "Superior rectal v. (IMV)", "Middle + inferior rectal", "Haemorrhoids"],
["Umbilicus", "Para-umbilical veins", "Superficial epigastric veins", "Caput medusae"],
["Retroperitoneum", "Colic & hepatic veins", "Lumbar, renal, phrenic veins", "Retroperitoneal varices"],
["Bare area of liver", "Hepatic sinusoids", "Diaphragmatic veins", "Small shunts"],
],
[3.5*cm, 3.5*cm, 4.5*cm, 3.5*cm]
))
story.append(applied_box([
"Portal hypertension (cirrhosis, Budd-Chiari, PV thrombosis) dilates all sites",
"Oesophageal varices: band ligation / sclerotherapy / TIPSS",
"TIPSS = transjugular intrahepatic portosystemic shunt",
]))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# REGION 6 – REPRODUCTIVE SYSTEM & EMBRYOLOGY
# ═══════════════════════════════════════════════════════════════════════════════
story.append(region_header("REGION 6 — REPRODUCTIVE SYSTEM & EMBRYOLOGY"))
story.append(Spacer(1, 0.2*cm))
story.append(q_header("Q2 · Stages in Development of Graafian Follicle"))
story.append(make_table(
["Stage", "Key Features"],
[
["1. Primordial follicle", "Flat granulosa cells around oocyte; arrested at meiosis I prophase"],
["2. Primary follicle (unilaminar)", "Granulosa cells become cuboidal; zona pellucida forms"],
["3. Primary follicle (multilaminar)", "Multiple granulosa layers; theca interna & externa differentiate"],
["4. Secondary (antral) follicle", "Fluid-filled antrum; cumulus oophorus; corona radiata develops"],
["5. Mature Graafian follicle", "20–25 mm; bulges from ovary; 1st meiotic division completed; ovulation"],
],
[5*cm, 10*cm]
))
story.append(applied_box(["PCOS: follicles arrested at antral stage", "OHSS: ovarian hyperstimulation in IVF"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q7 · Microanatomy of Uterus — Secretory Phase"))
story.append(body("<b>Stimulus:</b> Progesterone (post-ovulation days 15–28)"))
story.append(Spacer(1, 0.1*cm))
story.append(make_table(
["Structure", "Secretory Phase Changes"],
[
["Glands", "Tortuous, coiled, saw-toothed; wide lumen; glycogen-rich secretions (subnuclear then supranuclear vacuoles)"],
["Stroma", "Oedematous early; then predecidual reaction (stromal cells enlarge — decidualisation)"],
["Spiral arteries", "Coiled and prominent"],
],
[4*cm, 11*cm]
))
story.append(applied_box(["Inadequate secretory transformation = luteal phase defect → infertility", "Prepares endometrium for implantation"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q19 · Perineal Membrane in Males — Structures Piercing It"))
story.append(body("<b>Extent:</b> Triangular membrane stretched between ischiopubic rami (inferior pubic rami) to perineal body"))
story.append(body("<b>Structures piercing:</b> Membranous urethra · Bulbourethral (Cowper's) gland ducts · Arteries to the bulb · Perineal branches of pudendal nerve"))
story.append(applied_box(["Bulbar urethral rupture → urine extravasation into superficial perineal pouch / scrotum under Colles' fascia"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q21 · Cryptorchidism — Definition & Factors"))
story.append(body("<b>Definition:</b> Failure of one or both testes to descend into the scrotum by 3 months of age"))
story.append(Spacer(1, 0.1*cm))
story.append(make_table(
["Category", "Factors"],
[
["Hormonal", "Low testosterone/DHT, 5α-reductase deficiency, inadequate LH/HCG, low MIF"],
["Mechanical", "Short vas deferens or spermatic vessels, peritoneal adhesions"],
["Gubernaculum defects", "Abnormal gubernacular development impairs descent"],
["Neural", "Genitofemoral nerve / CGRP deficiency → impaired cremaster reflex"],
["Intra-abdominal pressure", "Prematurity, prune belly (abdominal wall defects)"],
["Genetic", "INSL3 or RXFP2 mutations"],
],
[4.5*cm, 10.5*cm]
))
story.append(applied_box([
"40× increased risk of testicular cancer",
"Infertility, torsion, hernia",
"Orchidopexy before age 2 recommended",
"Bilateral undescended testes: rule out intersex conditions",
]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q27 · Implantation — Normal & Abnormal Sites"))
story.append(body("<b>Normal:</b> Posterior wall of body of uterus, upper part, slightly right of midline (days 6–10 post-fertilisation)"))
story.append(Spacer(1, 0.1*cm))
story.append(make_table(
["Ectopic Site", "Frequency", "Note"],
[
["Ampulla of fallopian tube", "~70%", "Most common ectopic site"],
["Isthmus", "~12%", "Ruptures earlier (narrower)"],
["Fimbriae", "~11%", ""],
["Interstitial (cornual)", "~2%", "Most dangerous — late rupture, massive haemorrhage"],
["Cervical", "Rare", "Risk of massive haemorrhage with D&C"],
["Abdominal", "Very rare", "Can reach term; placenta on bowel/liver"],
],
[5*cm, 3.5*cm, 6.5*cm]
))
story.append(applied_box(["Rx: methotrexate (medical) or salpingectomy (surgical)", "Risk factors: PID, previous ectopic, IUD, tubal surgery"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q35 · Stages of Spermatogenesis"))
story.append(body("<b>Location:</b> Seminiferous tubules (~74 days total)"))
story.append(make_table(
["Stage", "Ploidy", "Notes"],
[
["Type A spermatogonium", "2n", "Stem cells; mitosis"],
["Type B spermatogonium → Primary spermatocyte", "2n", "Prophase I takes ~22 days"],
["Secondary spermatocyte", "1n", "Short-lived; meiosis II"],
["Spermatid (round → elongated)", "1n", "Spermiogenesis"],
["Spermatozoon (spermiation)", "1n", "Released into tubule lumen"],
],
[5.5*cm, 2*cm, 7.5*cm]
))
story.append(body("<b>Sertoli cells:</b> Blood-testis barrier (tight junctions), ABP, inhibin, phagocyte residual bodies"))
story.append(body("<b>Leydig cells (interstitium):</b> Testosterone; crystals of Reinke; LH-stimulated"))
story.append(applied_box(["Cryptorchidism impairs spermatogenesis (heat-sensitive)", "Sertoli-cell-only syndrome → azoospermia"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q40 · Microanatomy of Testis"))
story.append(body("<b>Capsule:</b> Tunica albuginea → mediastinum testis → septa → ~250 lobules"))
story.append(body("<b>Seminiferous tubules (basal → luminal):</b> Spermatogonia → 1° spermatocytes → 2° spermatocytes → Spermatids → Spermatozoa; Sertoli cells throughout"))
story.append(body("<b>Interstitium:</b> Leydig cells (large, polygonal, eosinophilic, crystals of Reinke) + macrophages"))
story.append(applied_box(["Leydig cell tumour → precocious puberty in boys", "Testicular torsion — ischaemia of all tubules"]))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q43 · Rotation of Midgut — Stages & Anomalies"))
story.append(body("<b>Normal rotation:</b> 270° counterclockwise around SMA axis"))
story.append(make_table(
["Stage", "Week", "Event"],
[
["Physiological herniation", "6", "Midgut enters umbilical cord (liver too large)"],
["1st rotation", "6–10", "90° CCW; duodenum moves right/posterior"],
["Return to abdomen", "10", "Pre-arterial segment first → right side"],
["2nd rotation", "10–12", "Further 180° CCW; caecum descends to RIF"],
],
[5*cm, 2*cm, 8*cm]
))
story.append(Spacer(1, 0.1*cm))
story.append(make_table(
["Anomaly", "Key Feature"],
[
["Non-rotation", "Small bowel right, colon left"],
["Malrotation", "Caecum at epigastrium; Ladd's bands across duodenum"],
["Volvulus (from malrotation)", "Midgut twists on SMA; bilious vomiting neonate; ischaemia"],
["Omphalocele", "Failure of return; gut covered by peritoneum at umbilicus"],
["Gastroschisis", "Lateral paraumbilical defect; gut NOT covered by peritoneum"],
],
[5*cm, 10*cm]
))
story.append(Spacer(1, 0.3*cm))
story.append(q_header("Q44 · Supports of Uterus"))
story.append(make_table(
["Support", "Type", "Description"],
[
["Cardinal (Mackenrodt's) lig.", "MOST IMPORTANT", "Cervix to lateral pelvic wall; contains uterine artery"],
["Uterosacral ligaments", "Primary", "Cervix to sacrum; important in vault prolapse repair"],
["Pubocervical fascia", "Secondary", "Cervix to pubis; supports bladder base"],
["Levator ani (pelvic floor)", "Muscular", "Most important muscular support; torn in childbirth"],
["Perineal body", "Muscular", "Anchors perineal structures"],
["Round ligament", "Peritoneal fold", "Maintains anteversion; NOT major support"],
],
[4.5*cm, 3.5*cm, 7*cm]
))
story.append(applied_box([
"Prolapse: failure of cardinal + uterosacral + levator ani (multiparity, menopause, raised IAP)",
"Ureter runs 1.5 cm lateral to cervix ('water under bridge' — risk in hysterectomy)",
]))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════════
# REGION 7 – HEAD, NECK & NEUROANATOMY
# ═══════════════════════════════════════════════════════════════════════════════
story.append(region_header("REGION 7 — HEAD, NECK & NEUROANATOMY"))
story.append(Spacer(1, 0.2*cm))
story.append(q_header("Q32 · Development of Pancreas & Annular Pancreas"))
story.append(make_table(
["Bud", "Origin", "Derivatives", "Duct"],
[
["Dorsal pancreatic bud", "Foregut (5th week)", "Body, tail, superior head", "Duct of Santorini (accessory)"],
["Ventral pancreatic bud", "Bile duct associated", "Uncinate process, inferior head", "Duct of Wirsung (main)"],
],
[4*cm, 4*cm, 4*cm, 4*cm]
))
story.append(body("<b>Fusion:</b> Ventral bud rotates 180° clockwise with duodenum (week 6) → fuses with dorsal bud posteriorly"))
story.append(Spacer(1, 0.15*cm))
story.append(body("<b>Annular pancreas:</b> Bifid ventral bud (or failure of rotation) → ring of pancreatic tissue encircles 2nd part duodenum → duodenal obstruction"))
story.append(body('<b>X-ray:</b> "Double bubble" sign (gas in stomach + duodenum)'))
story.append(applied_box(["Presents in neonates (bilious vomiting) or adults (peptic ulcer, pancreatitis)", "Treatment: duodenoduodenostomy (bypass — do NOT divide the ring)"]))
story.append(Spacer(1, 0.3*cm))
# Final page — quick summary index
story.append(PageBreak())
story.append(Paragraph("TOPIC INDEX BY QUESTION NUMBER", S("idx_hdr", fontSize=14,
textColor=C_HEADER, fontName="Helvetica-Bold", alignment=TA_CENTER,
spaceBefore=0, spaceAfter=8)))
story.append(hr())
index_data = [
["Q#", "Topic", "Region", "Q#", "Topic", "Region"],
["1", "Lymphatic drainage of breast", "Thorax", "24", "Popliteal artery", "Lower limb"],
["2", "Graafian follicle development", "Repro/Embryo", "25", "Epiphysis types", "General"],
["3", "Cubital fossa", "Upper limb", "26", "Lymph node microanatomy", "General"],
["4", "Sesamoid bone", "General", "27", "Implantation", "Repro/Embryo"],
["5", "Gluteus maximus", "Lower limb", "28", "Appendix positions", "Abdomen"],
["6", "Large artery microanatomy", "General", "29", "Bare area of liver", "Abdomen"],
["7", "Uterus secretory phase", "Repro/Embryo", "30", "Ischiorectal fossa", "Abdomen/Pelvis"],
["8", "Extrahepatic biliary apparatus", "Abdomen", "31", "Kidney coronal section", "Abdomen"],
["9", "Rectus sheath", "Abdomen", "32", "Pancreas development", "Head/Neck/Neuro"],
["10", "Diaphragm development", "Thorax", "33", "Suprarenal microanatomy", "General"],
["11", "Urinary bladder supports", "Abdomen/Pelvis", "34", "Popliteal fossa", "Lower limb"],
["12", "Anal canal interior", "Abdomen/Pelvis", "35", "Spermatogenesis", "Repro/Embryo"],
["13", "Rotator cuff", "Upper limb", "36", "Flexor retinaculum", "Upper limb"],
["14", "Knee meniscus", "Lower limb", "37", "Parts of long bone", "General"],
["15", "Spinal ganglion", "General/Neuro", "38", "Knee locking/unlocking", "Lower limb"],
["16", "Somites", "General/Embryo", "39", "Hyaline cartilage", "General"],
["17", "Anastomosis", "General", "40", "Testis microanatomy", "Repro/Embryo"],
["18", "Stomach bed", "Abdomen", "41", "Deep perineal pouch", "Abdomen/Pelvis"],
["19", "Perineal membrane (male)", "Repro/Pelvis", "42", "Stomach blood supply", "Abdomen"],
["20", "Ileum microanatomy", "Abdomen", "43", "Midgut rotation", "Repro/Embryo"],
["21", "Cryptorchidism", "Repro/Embryo", "44", "Uterine supports", "Repro/Embryo"],
["22", "Supination & pronation", "Upper limb", "45", "Portosystemic anastomosis", "Abdomen"],
["23", "Trendelenburg's sign", "Lower limb", "", "", ""],
]
t_idx = Table(index_data, colWidths=[1*cm, 5.5*cm, 3*cm, 1*cm, 5.5*cm, 3*cm])
idx_hdr_style = ParagraphStyle("idxH", fontSize=8, fontName="Helvetica-Bold", textColor=C_HEADER)
t_idx.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), C_TABLE_H),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('BOX', (0,0), (-1,-1), 0.5, C_DIVIDER),
('INNERGRID', (0,0), (-1,-1), 0.3, C_DIVIDER),
('TOPPADDING', (0,0), (-1,-1), 2),
('BOTTOMPADDING', (0,0), (-1,-1), 2),
('LEFTPADDING', (0,0), (-1,-1), 4),
('RIGHTPADDING', (0,0), (-1,-1), 4),
('LINEAFTER', (2,0), (2,-1), 1, C_Q_BAR),
]))
for i in range(1, len(index_data)):
if i % 2 == 0:
t_idx.setStyle(TableStyle([('BACKGROUND', (0,i), (-1,i), C_TABLE_R)]))
story.append(t_idx)
story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("Generated for MBBS / MD Anatomy Examination Preparation", st_footer_note))
# ── Page number footer ─────────────────────────────────────────────────────────
def on_page(canvas, doc):
canvas.saveState()
canvas.setFont("Helvetica", 8)
canvas.setFillColor(colors.grey)
canvas.drawCentredString(PAGE_W / 2, 0.7*cm, f"Anatomy Quick Reference | Page {doc.page}")
canvas.restoreState()
# ── Build ──────────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=MARGIN, rightMargin=MARGIN,
topMargin=1.5*cm, bottomMargin=1.5*cm,
title="Anatomy Quick Reference",
author="Orris",
)
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF saved to: {OUTPUT}")