Write the answers of all the questions according to the marks allotted to each questions.

Reading File
Running Command

cd /home/daytona/workspace/attachments/a9510f46-a995-472d-a563-332392f85cde/ && python3 -c " import pdfplumber with pdfplumber.open('ANATOMY SECOND INTERNAL SET 2_260617_213025.pdf') as pdf: for i, page in enumerate(pdf.pages): print(f'=== PAGE {i+1} ===') text = page.extract_text() print(text) print() "

Give all the answers according to BD Chaurasia 10th edition.

Running Command

cd /home/daytona/workspace/attachments/a9510f46-a995-472d-a563-332392f85cde/ && python3 -c " import pdfplumber with pdfplumber.open('ANATOMY SECOND INTERNAL SET 2_260617_213025.pdf') as pdf: for i, page in enumerate(pdf.pages): print(f'=== PAGE {i+1} ===') text = page.extract_text() print(text) print() "

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Finding Sources
All answers have been written. Here's a summary of what was covered:

Paper Coverage Summary:
QuestionTopicMarksStatus
Q.1Oculomotor Nerve (nucleus, components, course, applied)10✅ Full answer
Q.1 ORTongue (muscles, nerve supply, histology, development, applied)10✅ Full answer
Q.2 (all 8)Short notes - Cavernous sinus, Mandibular nerve, Bell's palsy, Lateral wall of nose, Carotid sheath, Hyoglossus, Trachea histology, 2nd arch derivatives4 each✅ All 8 answered
Q.3 (all 8)Reasoning - Scalp, SLN palsy, Thyroid, Tonsillectomy, Parotid, Thyroidectomy, Cavernous sinus thrombosis, Danger area of face2 each✅ All 8 answered
Q.4 (all 7)TMJ nerve, ECA branches, Tonsil arteries, Pharyngeal plexus, Soft palate motor, Ansa cervicalis, Foramen ovale2 each✅ All 7 answered
Q.5Knee joint (type, ligaments, locking, nerve/applied)10✅ Full answer
Q.6 (all 8)Femoral sheath, CTEV, Deltoid ligament, Tibialis posterior, Adductor canal, IT tract, Dorsalis pedis, Abductor mechanism4 each✅ All 8 answered
Q.7 (all 7)Reasoning - Sartorius, Meralgia, Foot drop, AVN, Femoral hernia, TB hip, IM injection2 each✅ All 7 answered
Q.8 (all 8)Femoral ring, Hamstrings, Popliteal fossa floor, Hip flexors, Lesser sciatic foramen, Spring ligament, Anserine bursa, Sole innervation2 each✅ All 8 answered

Create a downloadable PDF summary of these anatomy answers

Reading File
Running Command

mkdir -p /home/daytona/workspace/anatomy-answers && ls /home/daytona/workspace/anatomy-answers/

Writing File

~/anatomy-answers/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_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import ListFlowable, ListItem

OUTPUT = "/home/daytona/workspace/anatomy-answers/Anatomy_2nd_Internal_Answers.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=2*cm,
    rightMargin=2*cm,
    topMargin=2.2*cm,
    bottomMargin=2*cm,
    title="Anatomy 2nd Internal Assessment - Answers",
    author="BD Chaurasia 10th Edition"
)

styles = getSampleStyleSheet()

# Custom styles
NAVY = colors.HexColor("#1a3a5c")
BLUE = colors.HexColor("#2563EB")
LBLUE = colors.HexColor("#EFF6FF")
GREEN = colors.HexColor("#166534")
LGREEN = colors.HexColor("#F0FDF4")
ORANGE = colors.HexColor("#9A3412")
LORANGE = colors.HexColor("#FFF7ED")
GRAY = colors.HexColor("#374151")
LGRAY = colors.HexColor("#F3F4F6")
WHITE = colors.white
RED = colors.HexColor("#7F1D1D")

title_style = ParagraphStyle("TitleStyle", parent=styles["Title"],
    fontSize=20, textColor=WHITE, alignment=TA_CENTER,
    fontName="Helvetica-Bold", spaceAfter=4, leading=26)

subtitle_style = ParagraphStyle("SubTitle", parent=styles["Normal"],
    fontSize=11, textColor=colors.HexColor("#CBD5E1"), alignment=TA_CENTER,
    fontName="Helvetica", spaceAfter=2)

q_heading = ParagraphStyle("QHeading",
    fontSize=13, textColor=WHITE, fontName="Helvetica-Bold",
    spaceAfter=4, spaceBefore=8, leading=18, leftIndent=0)

section_heading = ParagraphStyle("SectionH",
    fontSize=11, textColor=NAVY, fontName="Helvetica-Bold",
    spaceAfter=3, spaceBefore=6, leading=15,
    borderPad=3)

sub_heading = ParagraphStyle("SubH",
    fontSize=10, textColor=BLUE, fontName="Helvetica-Bold",
    spaceAfter=2, spaceBefore=4, leading=13)

body = ParagraphStyle("Body",
    fontSize=9, textColor=GRAY, fontName="Helvetica",
    spaceAfter=3, spaceBefore=1, leading=14, alignment=TA_JUSTIFY)

bullet_style = ParagraphStyle("Bullet",
    fontSize=9, textColor=GRAY, fontName="Helvetica",
    spaceAfter=2, spaceBefore=1, leading=13, leftIndent=12,
    bulletIndent=3, bulletFontName="Helvetica")

note_style = ParagraphStyle("Note",
    fontSize=8.5, textColor=colors.HexColor("#6B7280"), fontName="Helvetica-Oblique",
    spaceAfter=2, spaceBefore=2, leading=12, alignment=TA_CENTER)

applied_style = ParagraphStyle("Applied",
    fontSize=9, textColor=RED, fontName="Helvetica-BoldOblique",
    spaceAfter=2, spaceBefore=3, leading=13)

story = []

# ── COVER / HEADER BAND ──────────────────────────────────────────────────────
def header_band(text, bg=NAVY, fg=WHITE, fs=13):
    tbl = Table([[Paragraph(text, ParagraphStyle("hdr", fontSize=fs, textColor=fg,
        fontName="Helvetica-Bold", alignment=TA_CENTER, leading=fs+4))]],
        colWidths=[17*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("TOPPADDING", (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING", (0,0), (-1,-1), 10),
        ("RIGHTPADDING", (0,0), (-1,-1), 10),
        ("ROUNDEDCORNERS", [4,4,4,4]),
    ]))
    return tbl

def section_band(text, bg=BLUE, fg=WHITE):
    tbl = Table([[Paragraph(text, ParagraphStyle("sec", fontSize=10, textColor=fg,
        fontName="Helvetica-Bold", alignment=TA_LEFT, leading=14))]],
        colWidths=[17*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 10),
        ("RIGHTPADDING", (0,0), (-1,-1), 8),
    ]))
    return tbl

def sub_band(text, bg=LBLUE):
    tbl = Table([[Paragraph(text, ParagraphStyle("sub", fontSize=9.5, textColor=NAVY,
        fontName="Helvetica-Bold", alignment=TA_LEFT, leading=13))]],
        colWidths=[17*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING", (0,0), (-1,-1), 14),
        ("RIGHTPADDING", (0,0), (-1,-1), 8),
        ("LINEBELOW", (0,0), (-1,-1), 0.5, BLUE),
    ]))
    return tbl

def reasoning_band(text, bg=LORANGE):
    tbl = Table([[Paragraph(text, ParagraphStyle("rsn", fontSize=9.5, textColor=ORANGE,
        fontName="Helvetica-Bold", alignment=TA_LEFT, leading=13))]],
        colWidths=[17*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING", (0,0), (-1,-1), 14),
        ("RIGHTPADDING", (0,0), (-1,-1), 8),
        ("LINEBELOW", (0,0), (-1,-1), 0.5, ORANGE),
    ]))
    return tbl

def bp(text):
    return Paragraph(f"• {text}", bullet_style)

def b(text):
    return Paragraph(text, body)

def sh(text):
    return Paragraph(text, sub_heading)

def sp(n=4):
    return Spacer(1, n)

def make_table(headers, rows, col_widths=None):
    data = [headers] + rows
    if col_widths is None:
        col_widths = [17*cm / len(headers)] * len(headers)
    t = Table([[Paragraph(str(c), ParagraphStyle("tc", fontSize=8.5,
               fontName="Helvetica-Bold" if i == 0 else "Helvetica",
               textColor=WHITE if i==0 else GRAY, leading=12))
               for c in row] for i, row in enumerate(data)],
              colWidths=col_widths)
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), NAVY),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
        ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
        ("VALIGN", (0,0), (-1,-1), "TOP"),
    ]))
    return t

# ── COVER PAGE ────────────────────────────────────────────────────────────────
cover_tbl = Table([[
    Paragraph("ANATOMY", ParagraphStyle("cov1", fontSize=28, textColor=WHITE,
        fontName="Helvetica-Bold", alignment=TA_CENTER, leading=34)),
    ]], colWidths=[17*cm])
cover_tbl.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), NAVY),
    ("TOPPADDING", (0,0), (-1,-1), 30),
    ("BOTTOMPADDING", (0,0), (-1,-1), 6),
]))
story.append(cover_tbl)

cover_sub = Table([[
    Paragraph("2nd Internal Assessment — Complete Answers", ParagraphStyle("covs",
        fontSize=13, textColor=colors.HexColor("#93C5FD"), fontName="Helvetica-Bold",
        alignment=TA_CENTER, leading=18)),
    ]], colWidths=[17*cm])
cover_sub.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), NAVY),
    ("TOPPADDING", (0,0), (-1,-1), 2),
    ("BOTTOMPADDING", (0,0), (-1,-1), 6),
]))
story.append(cover_sub)

cover_ref = Table([[
    Paragraph("Reference: BD Chaurasia's Human Anatomy, 10th Edition | 1st Year MBBS (Batch 2025-26)",
        ParagraphStyle("covr", fontSize=9.5, textColor=colors.HexColor("#CBD5E1"),
        fontName="Helvetica-Oblique", alignment=TA_CENTER, leading=13)),
    ]], colWidths=[17*cm])
cover_ref.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), NAVY),
    ("TOPPADDING", (0,0), (-1,-1), 2),
    ("BOTTOMPADDING", (0,0), (-1,-1), 20),
]))
story.append(cover_ref)
story.append(sp(10))

# Index table
idx_data = [
    [Paragraph("Q.No", ParagraphStyle("ih", fontSize=9, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER)),
     Paragraph("Topic", ParagraphStyle("ih", fontSize=9, fontName="Helvetica-Bold", textColor=WHITE)),
     Paragraph("Marks", ParagraphStyle("ih", fontSize=9, fontName="Helvetica-Bold", textColor=WHITE, alignment=TA_CENTER))],
    ["Q.1", "Oculomotor Nerve / Tongue", "10"],
    ["Q.2", "Short Notes (8 topics)", "20"],
    ["Q.3", "Reasoning – Head & Neck (8 questions)", "10"],
    ["Q.4", "Short Answers – Head & Neck (7 questions)", "10"],
    ["Q.5", "Knee Joint / Veins of Lower Limb", "10"],
    ["Q.6", "Short Notes – Lower Limb (8 topics)", "20"],
    ["Q.7", "Reasoning – Lower Limb (7 questions)", "10"],
    ["Q.8", "Short Answers – Lower Limb (8 questions)", "10"],
]
idx_rows = []
for row in idx_data:
    idx_rows.append([Paragraph(str(c), ParagraphStyle("ib", fontSize=9,
        fontName="Helvetica", textColor=GRAY, leading=12)) for c in row])
idx_tbl = Table([idx_data[0]] + idx_rows[1:], colWidths=[2.5*cm, 10.5*cm, 2.5*cm])
idx_tbl.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING", (0,0), (-1,-1), 7),
    ("ALIGN", (0,0), (0,-1), "CENTER"),
    ("ALIGN", (2,0), (2,-1), "CENTER"),
]))
story.append(Paragraph("Contents", ParagraphStyle("idx_h", fontSize=12, textColor=NAVY,
    fontName="Helvetica-Bold", spaceAfter=6)))
story.append(idx_tbl)
story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════════════════
# Q.1 OCULOMOTOR NERVE
# ═══════════════════════════════════════════════════════════════════════════════
story.append(header_band("Q.1  Describe the Oculomotor Nerve  (2+4+2+2 = 10 Marks)"))
story.append(sp(6))

story.append(sub_band("a) Oculomotor Nerve Complex (Nucleus)  [2 marks]"))
story.append(sp(4))
story.append(b("The oculomotor nerve arises from the <b>oculomotor nuclear complex</b> in the midbrain at the level of the superior colliculus, anterior to the periaqueductal grey matter. It has two nuclei:"))
story.append(bp("<b>Main (somatic) motor nucleus</b>: Paired; supplies all extraocular muscles except superior oblique and lateral rectus."))
story.append(bp("<b>Edinger-Westphal nucleus</b> (accessory parasympathetic nucleus): Unpaired, midline; gives preganglionic parasympathetic fibers that relay in the ciliary ganglion to supply the sphincter pupillae (pupillary constriction) and ciliary muscle (accommodation)."))
story.append(sp(4))

story.append(sub_band("b) Components  [4 marks]"))
story.append(sp(4))
story.append(b("The oculomotor nerve [CN III] is a mixed nerve with two functional components:"))
comp_data = [
    [Paragraph("<b>Component</b>", ParagraphStyle("th", fontSize=9, fontName="Helvetica-Bold", textColor=WHITE)),
     Paragraph("<b>Origin</b>", ParagraphStyle("th", fontSize=9, fontName="Helvetica-Bold", textColor=WHITE)),
     Paragraph("<b>Structures Supplied</b>", ParagraphStyle("th", fontSize=9, fontName="Helvetica-Bold", textColor=WHITE))],
    ["GSE (General Somatic Efferent)", "Main motor nucleus", "Levator palpebrae superioris, Superior rectus, Inferior rectus, Medial rectus, Inferior oblique"],
    ["GVE (Parasympathetic)", "Edinger-Westphal nucleus", "Sphincter pupillae (miosis), Ciliary muscle (accommodation) – via ciliary ganglion & short ciliary nerves"],
]
comp_rows_fmt = []
for i, row in enumerate(comp_data):
    comp_rows_fmt.append([Paragraph(str(c), ParagraphStyle("td", fontSize=8.5,
        fontName="Helvetica-Bold" if i==0 else "Helvetica",
        textColor=WHITE if i==0 else GRAY, leading=12)) for c in row])
ct = Table(comp_rows_fmt, colWidths=[4.5*cm, 4.5*cm, 8*cm])
ct.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(ct)
story.append(sp(4))

story.append(sub_band("c) Course and Distribution  [2 marks]"))
story.append(sp(4))
story.append(sh("Course:"))
story.append(bp("Emerges from the <b>anterior surface of midbrain</b> (interpeduncular fossa) between posterior cerebral and superior cerebellar arteries."))
story.append(bp("Passes forward in the <b>lateral wall of the cavernous sinus</b> (uppermost structure), below the tentorium cerebelli."))
story.append(bp("Enters orbit via the <b>superior orbital fissure</b>, within the common tendinous ring (annular tendon of Zinn)."))
story.append(bp("Divides into <b>superior and inferior divisions</b> just before entering the orbit."))
story.append(sh("Distribution:"))
story.append(bp("<b>Superior division</b>: Innervates superior rectus and levator palpebrae superioris."))
story.append(bp("<b>Inferior division</b> (3 branches): Innervates medial rectus, inferior rectus, and inferior oblique. The branch to inferior oblique gives the <b>parasympathetic root to the ciliary ganglion</b>."))
story.append(sp(4))

story.append(sub_band("d) Applied Anatomy  [2 marks]"))
story.append(sp(4))
applied_data = [
    ["Complete CN III Palsy", "Eye deviated 'down and out'; ptosis; fixed dilated pupil (mydriasis)"],
    ["PCoA Aneurysm", "Painful CN III palsy with dilated pupil (parasympathetic fibers on outer surface of nerve compressed first)"],
    ["Diabetic CN III Palsy", "Pupil SPARING – ischemia affects central motor fibers, sparing outer parasympathetic fibers"],
    ["Weber's Syndrome", "CN III palsy + contralateral hemiplegia – midbrain lesion involving CN III nucleus and corticospinal fibers"],
]
at = Table([[Paragraph("<b>Condition</b>", ParagraphStyle("th", fontSize=9, fontName="Helvetica-Bold", textColor=WHITE)),
             Paragraph("<b>Feature</b>", ParagraphStyle("th", fontSize=9, fontName="Helvetica-Bold", textColor=WHITE))]] +
           [[Paragraph(r[0], ParagraphStyle("td", fontSize=8.5, fontName="Helvetica-Bold", textColor=RED, leading=12)),
             Paragraph(r[1], ParagraphStyle("td", fontSize=8.5, fontName="Helvetica", textColor=GRAY, leading=12))]
            for r in applied_data],
           colWidths=[5.5*cm, 11.5*cm])
at.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#7F1D1D")),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, colors.HexColor("#FEF2F2")]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#FECACA")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(at)
story.append(sp(8))

# OR TONGUE
story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor("#CBD5E1")))
story.append(sp(4))
story.append(header_band("Q.1 (OR)  Describe the Tongue  (2+2+2+2+2 = 10 Marks)"))
story.append(sp(6))

story.append(sub_band("a) Muscles of the Tongue  [2 marks]"))
story.append(sp(3))
story.append(b("<b>Intrinsic muscles</b> (alter shape – no bony attachment): Superior longitudinal, Inferior longitudinal, Transverse, Vertical"))
muscle_data = [
    ["Muscle", "Origin", "Action"],
    ["Genioglossus", "Mental spine of mandible", "Protrudes tongue (most important)"],
    ["Hyoglossus", "Hyoid bone", "Depresses & retracts tongue"],
    ["Styloglossus", "Styloid process", "Retracts & elevates tongue"],
    ["Palatoglossus", "Palatine aponeurosis", "Elevates posterior tongue"],
]
mt = Table([[Paragraph(str(c), ParagraphStyle("th" if i==0 else "td", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=12)) for c in row]
    for i, row in enumerate(muscle_data)], colWidths=[4.5*cm, 6*cm, 6.5*cm])
mt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(mt)
story.append(sp(4))

story.append(sub_band("b) Nerve Supply  [2 marks]"))
story.append(sp(3))
ns_data = [
    ["Function", "Anterior 2/3", "Posterior 1/3"],
    ["General Sensation", "Lingual nerve (V3)", "Glossopharyngeal nerve (IX)"],
    ["Taste", "Chorda tympani (VII) via lingual nerve", "Glossopharyngeal nerve (IX)"],
    ["Motor (all muscles)", "Hypoglossal nerve (XII) – all EXCEPT palatoglossus", "Vagus (X) – palatoglossus only"],
]
nst = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=12)) for c in row]
    for i, row in enumerate(ns_data)], colWidths=[4*cm, 6.5*cm, 6.5*cm])
nst.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(nst)
story.append(sp(4))

story.append(sub_band("c) Histology  [2 marks]"))
story.append(sp(3))
story.append(b("Tongue is covered by <b>stratified squamous epithelium</b>. Dorsum has four types of lingual papillae:"))
story.append(bp("<b>Filiform papillae</b>: Most numerous; no taste buds; mechanical function."))
story.append(bp("<b>Fungiform papillae</b>: Scattered, red-tipped; contain taste buds."))
story.append(bp("<b>Circumvallate (vallate) papillae</b>: 8-12 in V-row at sulcus terminalis; contain most taste buds; Von Ebner's (serous) glands open into trench."))
story.append(bp("<b>Foliate papillae</b>: On lateral margins; rudimentary in humans."))
story.append(b("<b>Taste buds</b>: Ovoid structures containing neuroepithelial (gustatory) cells, supporting cells, and basal cells; taste pores open on the surface."))
story.append(sp(4))

story.append(sub_band("d) Development  [2 marks]"))
story.append(sp(3))
story.append(bp("<b>Anterior 2/3 (oral tongue)</b>: From 1st pharyngeal arch – two lateral lingual swellings + tuberculum impar (median tongue bud). Covered by ectoderm."))
story.append(bp("<b>Posterior 1/3 (pharyngeal tongue)</b>: From 2nd, 3rd, and 4th pharyngeal arches – copula (2nd arch) and hypobranchial eminence (3rd + 4th arch). Covered by endoderm."))
story.append(bp("Sulcus terminalis and foramen cecum mark the junction – site of thyroglossal duct origin (thyroid gland development)."))
story.append(bp("Tongue muscles derived from <b>occipital myotomes</b> – migrate with hypoglossal nerve (XII)."))
story.append(sp(4))

story.append(sub_band("e) Applied Anatomy  [2 marks]"))
story.append(sp(3))
story.append(bp("<b>Tongue carcinoma</b>: Most common on lateral border; spreads to submental/submandibular nodes (ant. 2/3) and jugulodigastric nodes (post. 1/3)."))
story.append(bp("<b>Deviation on protrusion</b>: Toward side of hypoglossal nerve (XII) LMN lesion (genioglossus of affected side cannot push tongue forward)."))
story.append(bp("<b>After tonsillectomy</b>: Damage to glossopharyngeal nerve → loss of taste from posterior 1/3."))
story.append(bp("<b>Macroglossia</b>: Down syndrome, cretinism, acromegaly, amyloidosis."))
story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════════════════
# Q.2 SHORT NOTES
# ═══════════════════════════════════════════════════════════════════════════════
story.append(header_band("Q.2  Short Notes  (Any 5 × 4 = 20 Marks)"))
story.append(sp(6))

# a) Cavernous Sinus
story.append(sub_band("a) Contents & Tributaries of Cavernous Sinus"))
story.append(sp(3))
story.append(b("The cavernous sinus is a paired dural venous sinus on either side of the sella turcica, extending from the superior orbital fissure to the apex of the petrous temporal bone."))
story.append(sh("Contents:"))
cs_data = [
    ["Location", "Structure"],
    ["Within sinus cavity (medial)", "Internal carotid artery (with sympathetic plexus) + Abducent nerve [VI] (lateral to artery)"],
    ["Lateral wall (superior → inferior)", "CN III (Oculomotor) → CN IV (Trochlear) → CN V1 (Ophthalmic) → CN V2 (Maxillary)"],
]
cst = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=12)) for c in row]
    for i, row in enumerate(cs_data)], colWidths=[5.5*cm, 11.5*cm])
cst.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(cst)
story.append(sh("Tributaries / Connections:"))
story.append(bp("<b>Drains via</b>: Superior and inferior petrosal sinuses → internal jugular vein; basilar plexus."))
story.append(bp("<b>Receives blood from</b>: Superior ophthalmic vein (major), inferior ophthalmic vein, superficial middle cerebral vein (via sphenoparietal sinus), central vein of retina, intercavernous sinuses, emissary veins from pterygoid plexus."))
story.append(b("<b>Applied</b>: Cavernous sinus thrombosis (CST) – ophthalmoplegia, chemosis, proptosis, severe periorbital pain. Infection spreads from danger area of face via angular/facial vein → superior ophthalmic vein → cavernous sinus."))
story.append(sp(5))

# b) Mandibular Nerve
story.append(sub_band("b) Mandibular Nerve [V3]"))
story.append(sp(3))
story.append(b("The mandibular nerve is the largest division of the trigeminal nerve and the only division with both sensory and motor fibers."))
story.append(bp("<b>Exits skull</b>: Through foramen ovale into the infratemporal fossa."))
story.append(sh("Anterior trunk (mainly motor):"))
story.append(b("Nerve to masseter, Deep temporal nerves (2), Nerve to lateral pterygoid, Nerve to medial pterygoid, <b>Buccal nerve</b> (only sensory branch – skin and mucosa of cheek)."))
story.append(sh("Posterior trunk (mainly sensory):"))
story.append(bp("<b>Auriculotemporal nerve</b>: Sensation to temporal region, scalp, auricle, TMJ; carries secretomotor fibers to parotid (from IX via otic ganglion)."))
story.append(bp("<b>Lingual nerve</b>: General sensation to anterior 2/3 tongue and floor of mouth; joined by chorda tympani."))
story.append(bp("<b>Inferior alveolar nerve</b>: Enters mandibular foramen → supplies teeth → gives mental nerve (chin and lower lip)."))
story.append(b("<b>Motor supply</b>: Muscles of mastication (masseter, temporalis, medial pterygoid, lateral pterygoid), mylohyoid, anterior belly of digastric, tensor veli palatini, tensor tympani."))
story.append(sp(5))

# c) Bell's Palsy
story.append(sub_band("c) Bell's Palsy"))
story.append(sp(3))
story.append(b("Bell's palsy is <b>idiopathic LMN facial nerve palsy</b> – most common cause of acute unilateral facial paralysis. Believed to be due to reactivation of HSV-1 causing edema and compression of the facial nerve in the bony facial canal."))
story.append(sh("Features of LMN facial palsy:"))
story.append(bp("Paralysis of <b>ALL muscles of facial expression</b> including the UPPER face (frontalis – cannot wrinkle forehead) – distinguishes from UMN palsy."))
story.append(bp("Drooping of angle of mouth; inability to close eye (lagophthalmos) → <b>Bell's phenomenon</b> (protective upward rolling of eye)."))
story.append(bp("Loss of corneal reflex (efferent limb = facial nerve)."))
story.append(bp("If above chorda tympani: loss of taste (anterior 2/3 tongue) + dry mouth."))
story.append(bp("If above nerve to stapedius: <b>hyperacusis</b> (hypersensitivity to sound)."))
story.append(b("<b>Treatment</b>: Oral corticosteroids (prednisolone), eye care. 80-85% recover spontaneously. Distinguish from <b>Ramsay Hunt syndrome</b> (vesicles in ear, CN VIII involvement)."))
story.append(sp(5))

# d) Lateral wall of Nose
story.append(sub_band("d) Lateral Wall of the Nose"))
story.append(sp(3))
story.append(b("The lateral wall bears three curved shelf-like projections called <b>conchae (turbinates)</b>. Bony contributions: nasal bone, maxilla, lacrimal bone, ethmoid labyrinth (superior + middle conchae), inferior nasal concha, palatine bone, medial pterygoid plate."))
lw_data = [
    ["Concha", "Meatus Beneath", "Openings / Drainage"],
    ["Superior concha", "Superior meatus", "Posterior ethmoidal air sinuses"],
    ["Middle concha", "Middle meatus", "Frontal sinus (frontonasal duct), Maxillary sinus (hiatus semilunaris), Anterior + middle ethmoidal sinuses"],
    ["Inferior concha", "Inferior meatus", "Nasolacrimal duct (1 cm behind anterior end)"],
    ["Above superior concha", "Spheno-ethmoidal recess", "Sphenoidal sinus"],
]
lwt = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=12)) for c in row]
    for i, row in enumerate(lw_data)], colWidths=[3.5*cm, 4*cm, 9.5*cm])
lwt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(lwt)
story.append(b("<b>Middle meatus features</b>: Hiatus semilunaris (maxillary sinus opening), Ethmoidal bulla, Infundibulum (connects frontal sinus to meatus)."))
story.append(b("<b>Applied</b>: Maxillary sinusitis most common – sinus drains to middle meatus via hiatus semilunaris; position not gravity-dependent in upright posture → inadequate drainage."))
story.append(sp(5))

# e) Carotid Sheath
story.append(sub_band("e) Carotid Sheath"))
story.append(sp(3))
story.append(b("The carotid sheath is a condensation of cervical fascia formed by all three layers of deep cervical fascia. Extends from base of skull to root of neck on each side."))
story.append(sh("Contents:"))
story.append(bp("<b>Common carotid artery</b> (medial; divides at C4 into ICA and ECA)"))
story.append(bp("<b>Internal jugular vein</b> (lateral and slightly anterior)"))
story.append(bp("<b>Vagus nerve [X]</b> (posterior, between artery and vein)"))
story.append(bp("<b>Ansa cervicalis</b> (on anterior surface of sheath)"))
story.append(b("<b>Applied</b>: Site of IJV central venous cannulation. Carotid body (chemoreceptor) and carotid sinus (baroreceptor) at bifurcation. Infections can track to mediastinum along the sheath."))
story.append(sp(5))

# f) Relations of Hyoglossus
story.append(sub_band("f) Relations of Hyoglossus"))
story.append(sp(3))
story.append(b("Hyoglossus is a thin quadrilateral muscle (origin: body and greater cornu of hyoid; insertion: side of tongue; nerve: XII; action: depresses and retracts tongue)."))
hy_data = [
    ["Surface", "Relations"],
    ["Superficial / Lateral surface", "Lingual nerve, Submandibular ganglion (suspended from lingual nerve), Deep part of submandibular gland + Wharton's duct, Hypoglossal nerve [XII], Stylohyoid, Posterior belly of digastric"],
    ["Deep / Medial surface", "Glossopharyngeal nerve, Stylohyoid ligament, Lingual artery, Middle pharyngeal constrictor"],
]
hyt = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=12)) for c in row]
    for i, row in enumerate(hy_data)], colWidths=[4.5*cm, 12.5*cm])
hyt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(hyt)
story.append(b("<b>Applied</b>: Lingual artery lies deep to hyoglossus – protected if hyoglossus is not cut. Key surgical landmark on floor of mouth."))
story.append(sp(5))

# g) Trachea Histology
story.append(sub_band("g) Histology of Trachea"))
story.append(sp(3))
tr_data = [
    ["Layer", "Features"],
    ["1. Mucosa", "Pseudostratified ciliated columnar epithelium with goblet cells. Cell types: ciliated columnar, goblet (mucus), brush, small granule (neuroendocrine/Kulchitsky), basal (stem) cells. Lamina propria: loose CT with elastic fibers."],
    ["2. Submucosa", "Loose CT with mucoserous tracheal glands – secretion contributes to mucus blanket (mucociliary escalator)."],
    ["3. Cartilage & Muscle", "16-20 C-shaped hyaline cartilage rings keep airway patent. Posterior gap bridged by: Trachealis muscle (smooth, transverse) + fibroelastic tissue – allows esophageal bulge during swallowing."],
    ["4. Adventitia", "Loose CT blending with surrounding structures."],
]
trt = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=12)) for c in row]
    for i, row in enumerate(tr_data)], colWidths=[4*cm, 13*cm])
trt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(trt)
story.append(b("<b>Applied</b>: Goblet cells increase in chronic bronchitis. Smoking destroys cilia → impaired mucociliary clearance."))
story.append(sp(5))

# h) 2nd Branchial Arch
story.append(sub_band("h) Derivatives of 2nd Branchial Arch (Hyoid Arch / Reichert's Arch)"))
story.append(sp(3))
ba_data = [
    ["Category", "Derivatives"],
    ["Cartilage (Reichert's cartilage)", "Stapes; Styloid process of temporal bone; Stylohyoid ligament; Lesser cornu of hyoid; Upper body of hyoid"],
    ["Muscles (supplied by CN VII)", "All muscles of facial expression; Buccinator; Platysma; Stylohyoid; Posterior belly of digastric; Stapedius"],
    ["Nerve", "Facial nerve [CN VII]"],
    ["Clinical", "Ectoderm of 2nd arch overgrows 3rd + 4th arch clefts forming cervical sinus – normally obliterates. Failure = branchial cyst/fistula"],
]
bat = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=12)) for c in row]
    for i, row in enumerate(ba_data)], colWidths=[4.5*cm, 12.5*cm])
bat.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(bat)
story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════════════════
# Q.3 REASONING HEAD & NECK
# ═══════════════════════════════════════════════════════════════════════════════
story.append(header_band("Q.3  Reasoning Questions – Head & Neck  (Any 5 × 2 = 10 Marks)"))
story.append(sp(6))

reasoning_hn = [
    ("a) 4th Layer of Scalp is the 'Dangerous Layer'",
     "The 4th layer (loose areolar tissue) is dangerous because:\n"
     "• Emissary veins (valveless) pass through it, connecting scalp veins to intracranial dural venous sinuses (especially superior sagittal sinus).\n"
     "• Infection can spread directly intracranially → meningitis, dural sinus thrombosis, brain abscess.\n"
     "• Blood from a torn vessel spreads extensively under the entire scalp (subgaleal hematoma).\n"
     "Layers: Skin | Connective tissue (dense) | Aponeurosis (epicranial) | Loose areolar (DANGEROUS) | Pericranium"),
    ("b) In SLN Palsy, Foreign Bodies Can Easily Enter the Larynx",
     "The internal branch of the superior laryngeal nerve (from vagus) supplies sensory innervation to laryngeal mucosa ABOVE the vocal cords (supraglottis) including epiglottis and aryepiglottic folds.\n"
     "• This sensory supply triggers the cough and laryngeal closure reflexes when a foreign body approaches the laryngeal inlet.\n"
     "• In SLN palsy, this protective reflex is ABOLISHED → silent aspiration → food/liquids enter trachea without triggering cough → aspiration pneumonia and choking."),
    ("c) Enlarged Thyroid Causes Dyspnoea, Dysphagia & Dysphonia",
     "• Dyspnoea: Enlarged thyroid compresses the TRACHEA (lies posterior to thyroid lobes) → narrow airway.\n"
     "• Dysphagia: Posterior compression of the OESOPHAGUS (posterior to trachea).\n"
     "• Dysphonia: Compression/stretch of RECURRENT LARYNGEAL NERVE (running in tracheo-oesophageal groove) → supplies all intrinsic laryngeal muscles except cricothyroid → hoarseness/voice loss."),
    ("d) After Tonsillectomy – Loss of Taste from Posterior 1/3 Tongue",
     "The glossopharyngeal nerve [IX] provides taste from the posterior 1/3 of the tongue.\n"
     "• It passes very close to the LATERAL SURFACE of the tonsil, just deep to the tonsillar bed in the pharyngeal wall.\n"
     "• During tonsillectomy, if dissection is too deep/lateral, the nerve can be damaged or stretched → loss of taste from posterior 1/3 + reduced pharyngeal sensation (impaired gag reflex)."),
    ("e) Parotid Swelling is Extremely Painful",
     "The parotid gland is enclosed in a DENSE, NON-DISTENSIBLE fibrous capsule (investing layer of deep cervical fascia).\n"
     "• When gland swells (mumps, parotitis, abscess), there is no room for expansion.\n"
     "• Intense pressure within the unyielding capsule stimulates rich sensory nerve supply (auriculotemporal + great auricular nerves) → severe pain.\n"
     "• Pain aggravated by eating (increased salivation → more swelling → more pain)."),
    ("f) Superior Thyroid Artery – Ligated Near Apex; Inferior Thyroid Artery – Ligated Away from Gland",
     "• Superior thyroid artery runs close to the EXTERNAL LARYNGEAL NERVE on its way to the upper pole. Ligating far from gland risks catching this nerve → loss of cricothyroid function → voice change. Therefore ligated NEAR the gland (apex).\n"
     "• Inferior thyroid artery is intimately related to the RECURRENT LARYNGEAL NERVE (which may cross anterior, posterior, or between its branches). Ligating near the gland risks RLN injury → hoarseness. Therefore ligated AWAY from the gland."),
    ("g) Cavernous Sinus Thrombosis → Ophthalmoplegia + Severe Pain + Congestion of Eyeball",
     "• Ophthalmoplegia: CN III, IV, VI all travel in/through the cavernous sinus → all become involved → complete external ophthalmoplegia.\n"
     "• Severe pain: Ophthalmic (V1) and maxillary (V2) nerves in lateral wall → inflammation stimulates them → severe periorbital and frontal pain.\n"
     "• Proptosis/Congestion: Superior ophthalmic vein drains INTO cavernous sinus → thrombosis blocks drainage → venous congestion → proptosis, periorbital edema, conjunctival chemosis."),
    ("h) Upper Lip & Lower Nose = Dangerous Area of Face",
     "This region is 'dangerous' because the FACIAL VEIN here is VALVELESS and communicates with the cavernous sinus via:\n"
     "• Angular vein → superior ophthalmic vein → cavernous sinus, OR\n"
     "• Deep facial vein → pterygoid plexus → cavernous sinus.\n"
     "Infections/squeezing pimples can cause septic thrombophlebitis propagating intracranially → CAVERNOUS SINUS THROMBOSIS (life-threatening). Never squeeze pimples in this area!"),
]

for title, content in reasoning_hn:
    story.append(reasoning_band(title))
    story.append(sp(3))
    for line in content.split('\n'):
        line = line.strip()
        if not line:
            continue
        if line.startswith('•'):
            story.append(bp(line[1:].strip()))
        else:
            story.append(b(line))
    story.append(sp(5))

story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════════════════
# Q.4 SHORT ANSWERS HEAD & NECK
# ═══════════════════════════════════════════════════════════════════════════════
story.append(header_band("Q.4  Short Answers – Head & Neck  (Any 5 × 2 = 10 Marks)"))
story.append(sp(6))

q4_data = [
    ["Q", "Topic", "Answer"],
    ["a", "Nerve supply of TMJ", "Auriculotemporal nerve (main – posterior/lateral), Masseteric nerve (anterior), Deep temporal nerves (minor) – all branches of mandibular nerve [V3]"],
    ["b", "Terminal branches of ECA", "Superficial temporal artery (scalp, temporal region) and Maxillary artery (largest branch – deep face, teeth, dura, nasal cavity, palate). Both arise at neck of mandible within parotid gland."],
    ["c", "Arteries supplying tonsil", "1. Tonsillar artery (facial artery – main supply, lower pole)\n2. Ascending pharyngeal artery (ECA)\n3. Ascending palatine artery (facial artery)\n4. Descending palatine artery (maxillary artery)\n5. Dorsal lingual artery (lingual artery)"],
    ["d", "Nerves forming pharyngeal plexus", "1. Glossopharyngeal nerve [IX] – sensory\n2. Vagus nerve [X] – motor to pharyngeal muscles except stylopharyngeus; parasympathetic\n3. Sympathetic fibers from superior cervical ganglion (via external carotid plexus)"],
    ["e", "Motor supply of soft palate", "Levator veli palatini, Musculus uvulae, Palatoglossus, Palatopharyngeus → Vagus [X] via pharyngeal plexus.\nTensor veli palatini → Medial pterygoid nerve (V3) – ONLY palatal muscle NOT supplied by vagus."],
    ["f", "Muscles by ansa cervicalis", "Sternohyoid (C1,2,3), Sternothyroid (C2,3), Omohyoid – both bellies (C1,2,3).\nNote: Thyrohyoid is supplied by C1 fibers carried by the hypoglossal nerve."],
    ["g", "Structures through foramen ovale", "1. Mandibular nerve [V3] (main)\n2. Accessory meningeal artery\n3. Lesser petrosal nerve (occasionally)\n4. Emissary vein (cavernous sinus ↔ pterygoid plexus)"],
]
q4t = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=13)) for c in row]
    for i, row in enumerate(q4_data)], colWidths=[0.8*cm, 4.2*cm, 12*cm])
q4t.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"), ("TEXTCOLOR", (0,1), (0,-1), BLUE),
]))
story.append(q4t)
story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════════════════
# Q.5 KNEE JOINT
# ═══════════════════════════════════════════════════════════════════════════════
story.append(header_band("Q.5  Describe the Knee Joint  (2+3+3+2 = 10 Marks)"))
story.append(sp(6))

story.append(sub_band("a) Type of Joint & Articular Surfaces  [2 marks]"))
story.append(sp(3))
story.append(b("<b>Type</b>: Modified hinge (bicondylar) synovial joint – largest and most complex joint in the body."))
story.append(b("<b>Three articulations</b> sharing one joint cavity:"))
story.append(bp("Medial tibiofemoral joint (medial femoral condyle + medial tibial condyle)"))
story.append(bp("Lateral tibiofemoral joint (lateral femoral condyle + lateral tibial condyle)"))
story.append(bp("Patellofemoral joint (posterior patella + patellar surface of femur)"))
story.append(b("<b>Articular surfaces</b> (all covered by hyaline cartilage): Two femoral condyles; corresponding tibial condyles; posterior patella; two fibrocartilaginous menisci (improve congruency)."))
story.append(b("<b>Menisci</b>: Medial meniscus (C-shaped, attached to capsule and tibial collateral ligament) and lateral meniscus (circular, NOT attached to capsule – more mobile)."))
story.append(sp(4))

story.append(sub_band("b) Ligaments  [3 marks]"))
story.append(sp(3))
lig_data = [
    ["Ligament", "Type", "Attachment & Function"],
    ["Patellar ligament", "Extracapsular", "Patella → tibial tuberosity; continuation of quadriceps tendon; main anterior ligament"],
    ["Tibial (medial) collateral lig.", "Extracapsular", "Medial epicondyle → medial tibial condyle; attached to medial meniscus; prevents valgus"],
    ["Fibular (lateral) collateral lig.", "Extracapsular", "Lateral epicondyle → head of fibula; NOT attached to lateral meniscus; prevents varus"],
    ["Oblique popliteal lig.", "Extracapsular", "Expansion of semimembranosus; strengthens posterior capsule"],
    ["Anterior cruciate lig. (ACL)", "Intracapsular", "Anterior intercondylar tibia → lateral wall of intercondylar fossa femur; PREVENTS ANTERIOR displacement of tibia"],
    ["Posterior cruciate lig. (PCL)", "Intracapsular", "Posterior intercondylar tibia → medial wall of intercondylar fossa femur; PREVENTS POSTERIOR displacement; taut in flexion"],
]
ligt = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=12)) for c in row]
    for i, row in enumerate(lig_data)], colWidths=[4*cm, 3.5*cm, 9.5*cm])
ligt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(ligt)
story.append(sp(4))

story.append(sub_band("c) Locking Mechanism  [3 marks]"))
story.append(sp(3))
story.append(b("When standing fully erect, the knee 'locks' into a close-packed position to minimize muscle energy. Two components:"))
story.append(bp("<b>Change in femoral articular surface</b>: In flexion, smaller curved posterior condylar surfaces articulate with tibia. As knee extends, articulation shifts to larger flat inferior surfaces → increases stability (close-packed position)."))
story.append(bp("<b>Medial rotation of femur (screw-home mechanism)</b>: Because the medial femoral condyle is LONGER than the lateral condyle, the lateral condyle completes its movement first. The medial condyle continues, causing femur to rotate MEDIALLY on tibia. This tightens all ligaments → locked position."))
story.append(b("<b>Unlocking</b>: The <b>popliteus muscle</b> initiates LATERAL rotation of femur on tibia, unwinding the ligaments → allows flexion to begin."))
story.append(sp(4))

story.append(sub_band("d) Nerve Supply & Applied  [2 marks]"))
story.append(sp(3))
story.append(b("<b>Nerve supply</b> (Hilton's law): Femoral nerve, Obturator nerve, Tibial nerve, Common fibular nerve."))
story.append(bp("<b>'Unhappy triad' (O'Donoghue)</b>: ACL + medial meniscus + tibial collateral ligament injury – common in contact sports (valgus force on flexed knee)."))
story.append(bp("<b>Anterior drawer test</b>: Tibial anterior displacement = ACL injury. Posterior drawer test = PCL injury."))
story.append(bp("<b>Hilton's law relevance</b>: Obturator nerve supplies both hip and knee joints → hip pathology causes knee pain (referred pain)."))
story.append(bp("<b>Osteoarthritis</b>: Most commonly affects medial compartment."))
story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════════════════
# Q.6 SHORT NOTES LOWER LIMB
# ═══════════════════════════════════════════════════════════════════════════════
story.append(header_band("Q.6  Short Notes – Lower Limb  (Any 5 × 4 = 20 Marks)"))
story.append(sp(6))

# a) Femoral Sheath
story.append(sub_band("a) Femoral Sheath"))
story.append(sp(3))
story.append(b("A funnel-shaped sleeve of fascia enclosing proximal femoral vessels beneath the inguinal ligament. Formed by transversalis fascia (anterior wall) + iliac fascia (posterior wall). Merges with vessel adventitia 3-4 cm below."))
fs_data = [
    ["Compartment (Lateral → Medial)", "Contents"],
    ["Lateral", "Femoral artery"],
    ["Intermediate", "Femoral vein"],
    ["Medial (Femoral canal)", "Lymphatics + lymph node of Cloquet + loose areolar tissue"],
]
fst = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=12)) for c in row]
    for i, row in enumerate(fs_data)], colWidths=[6.5*cm, 10.5*cm])
fst.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(fst)
story.append(b("<b>Note</b>: Femoral nerve is LATERAL to the sheath and NOT enclosed within it."))
story.append(b("<b>Femoral ring</b> (upper end of femoral canal): Bounded by inguinal ligament (ant.), femoral vein (lat.), lacunar ligament (med.), pectineal ligament (post.). Allows femoral vein to expand."))
story.append(b("<b>Applied</b>: Femoral canal = site of femoral hernia (more common in females – wider femoral ring). Narrow femoral ring → prone to strangulation."))
story.append(sp(5))

# b) CTEV
story.append(sub_band("b) CTEV – Congenital Talipes Equinovarus (Club Foot)"))
story.append(sp(3))
story.append(b("Most common congenital foot deformity (~1-2/1000 births; male:female = 2:1)."))
story.append(b("<b>Four deformities (mnemonic CAVE)</b>:"))
story.append(bp("<b>C</b>avus – high medial arch"))
story.append(bp("<b>A</b>dductus of forefoot – metatarsus adductus"))
story.append(bp("<b>V</b>arus of hindfoot – heel inverted"))
story.append(bp("<b>E</b>quinus – plantarflexion (foot pointing downward)"))
story.append(b("<b>Pathology</b>: Talus abnormally shaped/positioned; navicular, calcaneum, cuboid displaced medially and plantarward; tibialis posterior and gastrocnemius-soleus muscles tight."))
story.append(b("<b>Treatment</b>: <b>Ponseti method</b> (gold standard) – serial casting from birth, weekly corrections → percutaneous Achilles tenotomy → Denis-Browne splint (foot abduction brace). Surgery for resistant cases."))
story.append(sp(5))

# c) Deltoid Ligament
story.append(sub_band("c) Deltoid Ligament (Medial Ligament of Ankle)"))
story.append(sp(3))
story.append(b("Strong triangular medial ligament of ankle joint; apex on medial malleolus, base on tarsal bones. Four bands:"))
dl_data = [
    ["Band", "Origin", "Insertion"],
    ["Anterior tibiotalar", "Medial malleolus", "Anterior part of talus"],
    ["Tibiocalcaneal", "Medial malleolus", "Sustentaculum tali of calcaneum"],
    ["Tibionavicular (most superficial)", "Medial malleolus", "Navicular"],
    ["Posterior tibiotalar", "Medial malleolus", "Posterior process of talus"],
]
dlt = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=12)) for c in row]
    for i, row in enumerate(dl_data)], colWidths=[5.5*cm, 4.5*cm, 7*cm])
dlt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6),
]))
story.append(dlt)
story.append(b("<b>Function</b>: Resists eversion (pronation). So strong that eversion injury more commonly AVULSES the medial malleolus than tears the ligament."))
story.append(b("<b>Applied</b>: Less commonly injured than lateral ligament. Rupture associated with medial malleolus fracture (bimalleolar). Also supports medial longitudinal arch."))
story.append(sp(5))

# d) Tibialis Posterior
story.append(sub_band("d) Tibialis Posterior"))
story.append(sp(3))
story.append(b("<b>Origin</b>: Posterior surface of interosseous membrane + adjacent tibia and fibula (posterior surface)."))
story.append(b("<b>Insertion</b>: Tuberosity of navicular (main) + slips to all 3 cuneiforms, cuboid, bases of 2nd-4th metatarsals, sustentaculum tali."))
story.append(b("<b>Nerve</b>: Tibial nerve (L4, L5). | <b>Blood supply</b>: Posterior tibial artery."))
story.append(b("<b>Actions</b>: Primary – INVERSION of foot (most powerful invertor). Secondary – Plantarflexion. Supports medial longitudinal arch dynamically."))
story.append(b("<b>Tendon course</b>: Passes behind medial malleolus in 1st (most anterior) compartment of tarsal tunnel, anterior to flexor digitorum longus."))
story.append(b("<b>Applied</b>: Tibialis posterior tendon dysfunction (TPTD) → progressive adult-acquired flatfoot deformity. 'Too many toes' sign. Overloaded in pes planus."))
story.append(sp(5))

# e) Adductor Canal
story.append(sub_band("e) Adductor Canal (Hunter's / Subsartorial Canal)"))
story.append(sp(3))
story.append(b("An aponeurotic tunnel in the middle third of the thigh. Extends from apex of femoral triangle to adductor hiatus in adductor magnus."))
story.append(sh("Boundaries:"))
story.append(bp("<b>Anterolateral wall</b>: Vastus medialis"))
story.append(bp("<b>Posteromedial wall</b>: Adductor longus (upper) and adductor magnus (lower)"))
story.append(bp("<b>Roof (anterior)</b>: Vastoadduc­tor membrane – fibrous aponeurosis deep to sartorius"))
story.append(sh("Contents:"))
story.append(bp("Femoral artery (becomes popliteal after adductor hiatus)"))
story.append(bp("Femoral vein (posterior to artery)"))
story.append(bp("Saphenous nerve – exits through roof midway; descends to supply medial leg and foot; does NOT pass through adductor hiatus"))
story.append(bp("Nerve to vastus medialis (exits proximally)"))
story.append(b("<b>Applied</b>: Site of femoral artery compression/aneurysm causing claudication. Saphenous nerve injury during medial knee surgery → medial leg numbness. Classical site for Hunter's ligation of femoral artery."))
story.append(sp(5))

# f) Iliotibial Tract
story.append(sub_band("f) Iliotibial Tract (IT Band)"))
story.append(sp(3))
story.append(b("A thick band of fascia lata on the lateral thigh, reinforced by tensor fasciae latae (TFL) and gluteus maximus."))
story.append(bp("<b>Above</b>: Iliac crest, TFL muscle, gluteus maximus posterior part."))
story.append(bp("<b>Below</b>: Lateral condyle of tibia (Gerdy's tubercle); also blends with lateral patellar retinaculum and biceps femoris."))
story.append(sh("Actions:"))
story.append(bp("Assists extension and abduction of hip."))
story.append(bp("Stabilizes lateral knee during standing/walking (prevents excessive varus)."))
story.append(bp("Part of abductor mechanism of hip (with TFL and gluteus maximus) – stabilizes pelvis during single-leg stance."))
story.append(b("<b>Applied</b>: <b>Iliotibial Band Syndrome (ITBS)</b> – overuse injury in runners/cyclists; ITT rubs over lateral femoral epicondyle at ~30° knee flexion → lateral knee pain. Treatment: stretching, physiotherapy."))
story.append(sp(5))

# g) Dorsalis Pedis
story.append(sub_band("g) Dorsalis Pedis Artery"))
story.append(sp(3))
story.append(b("Continuation of the anterior tibial artery on the dorsum of the foot. Begins anterior to ankle midway between malleoli, passes to proximal end of 1st intermetatarsal space."))
story.append(sh("Branches:"))
story.append(bp("<b>Lateral tarsal artery</b> – passes laterally over tarsal bones"))
story.append(bp("<b>Medial tarsal artery</b> – passes to medial border"))
story.append(bp("<b>Arcuate artery</b> – passes laterally over metatarsal bases → 2nd, 3rd, 4th dorsal metatarsal arteries"))
story.append(bp("<b>1st dorsal metatarsal artery</b>"))
story.append(bp("<b>Deep plantar artery</b> – passes through 1st intermetatarsal space → joins plantar arch (anastomosis with lateral plantar artery)"))
story.append(b("<b>Pulse</b>: Palpable lateral to extensor hallucis longus tendon on dorsum of foot."))
story.append(b("<b>Applied</b>: Absent in ~10% (replaced by large perforating peroneal artery). Assessment of peripheral arterial disease, diabetic angiopathy. Used as flap vessel in reconstructive surgery."))
story.append(sp(5))

# h) Abductor Mechanism
story.append(sub_band("h) Abductor Mechanism of Hip Joint"))
story.append(sp(3))
story.append(b("Maintains pelvic stability during single-limb stance (walking) and prevents the pelvis from tilting to the unsupported (swing) side."))
story.append(sh("Mechanism:"))
story.append(bp("During single-leg stance, body weight acts through centre of gravity MEDIAL to hip joint → creates moment dropping pelvis on opposite side."))
story.append(bp("Hip abductors (gluteus medius, gluteus minimus, TFL/ITT) on stance side generate counteracting force to keep pelvis level."))
story.append(bp("Normal abductor + body weight reaction force = ~3× body weight through hip joint."))
story.append(sh("Muscles: Gluteus medius (primary), Gluteus minimus, TFL (via ITT), Piriformis. Nerve: Superior gluteal nerve (L4, L5, S1)."))
story.append(b("<b>Applied – Trendelenburg Sign</b>: If abductors paralyzed or hip painful (coxa vara, fracture neck femur, AVN) → pelvis drops on opposite side during stance = positive Trendelenburg sign."))
story.append(b("<b>Trendelenburg Gait</b>: Patient lurches trunk TOWARD affected side during stance to bring centre of gravity over the hip, reducing demand on abductors."))
story.append(b("<b>Causes</b>: Superior gluteal nerve damage (IM injection injury), poliomyelitis (L4-L5-S1), hip pathology."))
story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════════════════
# Q.7 REASONING LOWER LIMB
# ═══════════════════════════════════════════════════════════════════════════════
story.append(header_band("Q.7  Reasoning Questions – Lower Limb  (Any 5 × 2 = 10 Marks)"))
story.append(sp(6))

reasoning_ll = [
    ("a) Sartorius is Known as the 'Tailor's Muscle'",
     "Sartorius (longest muscle in body) produces the cross-legged tailor's squat position by performing four simultaneous actions:\n"
     "• Flexion of the hip\n• Abduction of the hip\n• Lateral rotation at the hip\n• Flexion of the knee\n"
     "It is the only muscle performing all four actions simultaneously, creating this characteristic sitting position."),
    ("b) Meralgia Paraesthetica Causes Pain along Lateral Side of Thigh",
     "The lateral cutaneous nerve of the thigh (LCNT – L2, L3; purely sensory) passes UNDER or THROUGH the inguinal ligament just medial to the ASIS.\n"
     "• Vulnerable to compression here by tight belts, obesity, pregnancy, tight clothing.\n"
     "• Since it is purely sensory (supplying lateral thigh skin), entrapment causes: pain, burning, tingling, and numbness along the LATERAL THIGH.\n"
     "• No motor weakness (purely sensory nerve)."),
    ("c) Fracture Neck of Fibula Causes Foot Drop",
     "The common fibular nerve (L4, L5, S1) winds around the NECK OF THE FIBULA, lying very superficially with minimal soft tissue protection.\n"
     "• Fracture directly injures the nerve.\n"
     "• Deep fibular branch → supplies all DORSIFLEXORS (tibialis anterior, EDL, EHL).\n"
     "• Superficial fibular branch → supplies evertors (fibularis longus & brevis).\n"
     "• Damage → paralysis of all dorsiflexors → foot drops at ankle → FOOT DROP with steppage gait.\n"
     "• Also: loss of eversion + sensory loss over dorsum of foot and anterolateral leg."),
    ("d) AVN of Femoral Head Common in Fracture Neck of Femur",
     "Blood supply to femoral head in adults:\n"
     "• MEDIAL CIRCUMFLEX FEMORAL ARTERY (dominant, ~80%) → retinacular (capsular) arteries → lateral epiphyseal arteries → femoral head.\n"
     "• Lateral circumflex femoral artery (minor).\n"
     "• Artery in ligamentum teres (minimal in adults).\n"
     "• Retinacular vessels run along the neck of femur under the synovial reflection.\n"
     "• Intracapsular fracture DISRUPTS these vessels → ischemia → AVN.\n"
     "• More proximal (subcapital) the fracture → higher risk of AVN."),
    ("e) Femoral Hernia is More Common in Females",
     "Femoral hernia occurs through the femoral canal (most medial compartment of femoral sheath):\n"
     "• Women have a WIDER PELVIS → wider femoral canal/femoral ring.\n"
     "• Inguinal ligament is more anteriorly inclined in females.\n"
     "• Less muscle bulk at the femoral ring.\n"
     "• Increased intra-abdominal pressure (pregnancy, multiparity) predisposes females.\n"
     "• Narrow femoral ring neck → femoral hernias are highly prone to strangulation."),
    ("f) TB of Hip Joint Causes Pain in Knee and Medial Thigh",
     "The OBTURATOR NERVE (L2, L3, L4) supplies:\n"
     "• The hip joint (articular branches)\n"
     "• The knee joint (articular branches)\n"
     "• Skin of medial thigh and medial side of knee\n"
     "Irritation of the obturator nerve by hip joint inflammation (TB pus in hip capsule) → REFERRED PAIN along its distribution → knee and medial thigh pain.\n"
     "This is an example of Hilton's law. Clinically important: always examine hip when child complains of knee pain."),
    ("g) IM Injections Preferably Given in Superolateral Quadrant of Gluteal Region",
     "The SCIATIC NERVE (largest nerve in body) passes through the inferomedial THREE QUADRANTS of the buttock (exits greater sciatic foramen below piriformis, passes through middle of lower gluteal region).\n"
     "The SUPEROLATERAL QUADRANT is SAFE because:\n"
     "• Sciatic nerve does not pass here.\n"
     "• Superior gluteal vessels/nerve exit superomedially, not into the superolateral quadrant.\n"
     "• Adequate muscle bulk (gluteus medius + upper gluteus maximus).\n"
     "• Injection in any other quadrant risks SCIATIC NERVE INJURY → foot drop (permanent disability)."),
]

for title, content in reasoning_ll:
    story.append(reasoning_band(title))
    story.append(sp(3))
    for line in content.split('\n'):
        line = line.strip()
        if not line:
            continue
        if line.startswith('•'):
            story.append(bp(line[1:].strip()))
        else:
            story.append(b(line))
    story.append(sp(5))

story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════════════════
# Q.8 SHORT ANSWERS LOWER LIMB
# ═══════════════════════════════════════════════════════════════════════════════
story.append(header_band("Q.8  Short Answers – Lower Limb  (Any 5 × 2 = 10 Marks)"))
story.append(sp(6))

q8_data = [
    ["Q", "Topic", "Answer"],
    ["a", "Boundaries of Femoral Ring", "Anteriorly: Inguinal ligament (medial part)\nPosteriorly: Pectineal ligament (Cooper's ligament)\nMedially: Lacunar ligament (Gimbernat's ligament)\nLaterally: Femoral vein"],
    ["b", "Hamstring Muscles", "1. Biceps femoris (long + short heads)\n2. Semitendinosus\n3. Semimembranosus\nAll originate from ischial tuberosity (except short head of biceps – linea aspera). Nerve: tibial division of sciatic (except short head of biceps – common fibular division)."],
    ["c", "Floor of Popliteal Fossa", "1. Popliteal surface of femur (upper)\n2. Posterior surface of knee joint capsule (including oblique popliteal ligament)\n3. Popliteus muscle with fascia (lower)"],
    ["d", "Flexors of Hip Joint", "Main: Iliopsoas (most powerful, femoral nerve + L2,3 direct), Rectus femoris, Sartorius, TFL\nAccessory: Pectineus, Adductor longus, Adductor brevis"],
    ["e", "Contents of Lesser Sciatic Foramen", "1. Tendon of obturator internus (exits pelvis, turns 90° around ischium)\n2. Nerve to obturator internus (L5, S1, S2)\n3. Internal pudendal artery\n4. Pudendal nerve"],
    ["f", "Spring Ligament", "= Plantar calcaneonavicular ligament. Connects sustentaculum tali of calcaneum → plantar surface of navicular. Forms part of articular socket for head of talus (fibrocartilaginous area on superior surface). Principal STATIC support of medial longitudinal arch. Applied: Rupture/elongation → pes planus (flatfoot)."],
    ["g", "Anserine Bursa", "Synovial bursa between medial tibial condyle and conjoined tendon of pes anserinus (Sartorius + Gracilis + Semitendinosus = 'Say Grace before Tea'). Applied: Anserine bursitis → medial knee pain; common in obese patients and knee osteoarthritis, runners with genu valgum."],
    ["h", "Sensory Innervation of Sole", "Medial plantar nerve → medial 3½ digits (plantar) + medial 2/3 of sole\nLateral plantar nerve → lateral 1½ digits + lateral 1/3 of sole\nMedial calcaneal branches (tibial nerve) → medial heel + medial sole\nSural nerve → lateral heel + lateral sole\nApplied: Tarsal tunnel syndrome → compression of tibial nerve behind medial malleolus → burning pain and numbness of sole."],
]
q8t = Table([[Paragraph(str(c), ParagraphStyle("t", fontSize=8.5,
    fontName="Helvetica-Bold" if i==0 else "Helvetica",
    textColor=WHITE if i==0 else GRAY, leading=13)) for c in row]
    for i, row in enumerate(q8_data)], colWidths=[0.8*cm, 4.2*cm, 12*cm])
q8t.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LGRAY]),
    ("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
    ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"), ("TEXTCOLOR", (0,1), (0,-1), BLUE),
]))
story.append(q8t)

# FOOTER NOTE
story.append(sp(12))
story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor("#CBD5E1")))
story.append(sp(4))
story.append(Paragraph(
    "Reference: BD Chaurasia's Human Anatomy, 10th Edition (Vol. 2 – Upper & Lower Limb; Vol. 3 – Head, Neck & Brain) | "
    "1st Year MBBS, 2nd Internal Assessment | Batch 2025-26",
    note_style))

# ── PAGE NUMBERS ──────────────────────────────────────────────────────────────
def add_page_number(canvas, doc):
    canvas.saveState()
    canvas.setFont("Helvetica", 8)
    canvas.setFillColor(colors.HexColor("#9CA3AF"))
    page_num = canvas.getPageNumber()
    canvas.drawRightString(doc.pagesize[0] - 2*cm, 1.2*cm, f"Page {page_num}")
    canvas.drawString(2*cm, 1.2*cm, "BD Chaurasia's Anatomy – 10th Ed.")
    canvas.restoreState()

doc.build(story, onFirstPage=add_page_number, onLaterPages=add_page_number)
print("PDF created:", OUTPUT)
Running Command

cd /home/daytona/workspace/anatomy-answers && python3 generate_pdf.py

Running Command

ls -lh /home/daytona/workspace/anatomy-answers/Anatomy_2nd_Internal_Answers.pdf

Your PDF is ready! Download it here:

Anatomy 2nd Internal Answers

PDF Document · PDF

What's inside the PDF (48 KB, fully formatted):
FeatureDetails
Cover pageTitle, batch info, BD Chaurasia 10th Ed. reference
Contents tableAll 8 questions with marks listed
Q.1Oculomotor Nerve + Tongue (both OR options) with colour-coded tables
Q.2All 8 short notes with structured tables
Q.3All 8 reasoning answers (orange highlight boxes)
Q.4All 7 short answers in tabular format
Q.5Knee Joint – full 10-mark answer
Q.6All 8 lower limb short notes
Q.7All 7 lower limb reasoning answers
Q.8All 8 lower limb short answers
FooterPage numbers + reference on every page

Create a downloadable PDF summary of these anatomy answers

The PDF was already created in the previous step. You can download it directly here:

Anatomy 2nd Internal Answers

PDF Document · PDF

This is the same fully formatted PDF (48 KB) covering all 8 questions with colour-coded sections, tables, reasoning answers, and page numbers - referenced to BD Chaurasia's Human Anatomy, 10th Edition.

Write the OR part of the question 5 using the same resources as earlier used.

Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Excellent - I now have all the content needed. Let me write the full answer.

Q.5 (OR) — Veins of the Lower Limb (4+3+3 = 10 Marks)

"Name the various types of veins found in lower limb & why? Describe various veins found in lower limb with examples. Which is the peripheral heart and why?"

Part 1 — Types of Veins in the Lower Limb & Why These Types Exist (4 marks)

The lower limb is a weight-bearing structure where venous return must work against gravity continuously. To achieve this efficiently, the veins of the lower limb are organised into three distinct systems that work in coordination:

1. Superficial Veins (Epifascial veins)
  • These lie in the subcutaneous fatty tissue, above the deep fascia (epifascial).
  • They do not accompany arteries.
  • They carry approximately 15% of total venous return from the lower limb.
  • Two main trunks: Great saphenous vein and Small saphenous vein.
  • Why they exist: They drain the skin and subcutaneous tissue, and provide a low-pressure reservoir. Their superficial location allows easy clinical access (cannulation, harvesting for bypass grafts).

2. Deep Veins (Subfascial / Intermuscular veins)
  • Lie deep to the deep fascia, closely accompanying the corresponding arteries (venae comitantes).
  • Named after their accompanying arteries (e.g., femoral vein, popliteal vein, anterior/posterior tibial veins).
  • They carry approximately 85% of total venous return from the lower limb.
  • Why they exist: Deep veins are embedded within or adjacent to muscle compartments, making them ideal recipients of the pumping action of contracting muscles (the calf muscle pump). The high proportion of blood they carry reflects their central role in venous return.

3. Perforating (Communicating) Veins
  • These are connecting channels that pierce the deep fascia and link the superficial veins to the deep veins.
  • They contain valves directed inward - allowing blood to flow from superficial → deep only (unidirectional flow; prevents reflux outward).
  • Three clinically important groups:
    • Dodd's group - medial thigh, middle third
    • Boyd's group - medial leg, just below knee
    • Cockett's group - medial distal leg, 5, 10, and 15 cm above the medial malleolus
  • Why they exist: They are the physiological "pressure release valves" - ensuring that blood generated in the superficial system and by muscular activity flows towards the deep system and ultimately to the heart. Incompetent perforators are a primary cause of varicose veins and venous ulcers.

Venous Valves - the key structural reason for all three systems:
All three systems contain bicuspid (semilunar) valves oriented to allow blood flow only towards the heart and from superficial → deep. These valves overcome gravity and prevent backflow. Their incompetence leads to varicose veins.

Part 2 — Description of Various Veins with Examples (3 marks)

A. Superficial Veins

Great Saphenous Vein (GSV) - longest vein in the body:
  • Origin: Medial side of the dorsal venous arch of the foot (medial marginal vein).
  • Course: Ascends along the medial side of the foot, leg, and thigh:
    • In front of the medial malleolus (ankle)
    • Along the medial surface of the tibia
    • Behind the medial condyle of the femur (knee)
    • Along the medial aspect of the thigh
  • Termination: Passes through the saphenous opening (fossa ovalis) in the deep fascia of the thigh, approximately 3-4 cm inferolateral to the pubic tubercle, and joins the femoral vein in the femoral triangle.
  • Tributaries at saphenous opening (4 superficial tributaries): Superficial epigastric vein, Superficial circumflex iliac vein, Superficial external pudendal vein, Deep external pudendal vein.
  • Relations: The saphenous nerve (branch of femoral nerve) runs alongside the GSV in the leg - important in varicose vein surgery.
Small (Short) Saphenous Vein (SSV):
  • Origin: Lateral side of the dorsal venous arch of the foot (lateral marginal vein).
  • Course: Ascends along the posterior surface of the leg, lateral to the Achilles tendon, then runs upward in the midline of the back of the leg.
  • Termination: Pierces the deep fascia in the upper posterior leg and drains into the popliteal vein in the popliteal fossa, posterior to the knee.
  • Relations: The sural nerve accompanies the SSV in the leg.

B. Deep Veins

The deep veins follow the arteries closely and are named accordingly:
RegionDeep VeinFollows Artery
FootDorsal and plantar metatarsal veins, plantar digital veinsCorresponding arteries
LegAnterior tibial veins (paired)Anterior tibial artery
LegPosterior tibial veins (paired)Posterior tibial artery
LegFibular (peroneal) veins (paired)Fibular artery - join posterior tibial veins
KneePopliteal veinPopliteal artery - formed by union of anterior + posterior tibial veins
ThighFemoral veinFemoral artery - continuation of popliteal vein after adductor hiatus
ThighDeep vein of thigh (profunda femoris vein)Deep femoral artery
Hip/buttockSuperior and inferior gluteal veins, obturator veinCorresponding arteries
AbdomenExternal iliac veinFemoral vein becomes external iliac at inguinal ligament
  • The popliteal vein is formed by the union of the paired anterior and posterior tibial veins.
  • The fibular (peroneal) veins join the posterior tibial veins.
  • The popliteal vein, on passing through the adductor hiatus, becomes the femoral vein.
  • The femoral vein receives the deep vein of thigh (profunda femoris) in the femoral triangle.
  • The femoral vein becomes the external iliac vein as it passes beneath the inguinal ligament.

C. Perforating Veins (Clinically Important)

Three groups perforate the deep fascia of the leg on the medial side, connecting the GSV to the deep tibial veins:
  • Dodd group (mid-thigh): Connect GSV to femoral vein.
  • Boyd group (just below knee): Connect GSV to posterior tibial veins.
  • Cockett group (lower leg): Three perforators at 5, 10, and 15 cm above the medial malleolus, connecting the posterior arch vein (tributary of GSV) to the posterior tibial veins. These are the most clinically significant - their incompetence causes venous ulcers above the medial malleolus.

Part 3 — The "Peripheral Heart" and Why (3 marks)

The Peripheral Heart = The Calf Muscle Pump (Soleus + Gastrocnemius)

The calf (sural) muscle pump - primarily the soleus and gastrocnemius complex - is called the "peripheral heart" because it actively propels blood upward toward the heart against gravity, mimicking the pumping action of the heart itself.
Why the calf muscle pump is called the "peripheral heart":
Mechanism:
  1. The deep veins of the leg (posterior tibial, fibular, popliteal) and the venous sinusoids within the soleus and gastrocnemius muscles act as a venous reservoir.
  2. When the calf muscles contract (e.g., during walking, standing on tiptoes):
    • Muscle contraction compresses the deep veins and intramuscular sinusoids.
    • Blood is forcibly propelled upward toward the popliteal and femoral veins.
    • Valves in the perforating veins close (preventing outward reflux to superficial veins).
    • Valves in the deep veins allow only upward (proximal) flow.
  3. When calf muscles relax:
    • Pressure in deep veins falls (drops to near zero).
    • Blood is sucked from superficial veins through the perforators into the deep system (valves open inward).
    • The venous reservoir refills, ready for the next contraction.
Quantitative significance:
  • In a walking adult, venous pressure in the foot falls from ~90 mmHg (standing still) to less than 20 mmHg - entirely due to the calf muscle pump.
  • Standing perfectly still abolishes the pump → venous pressure in feet rises to ~90 mmHg within 30 seconds → capillary leak → pedal edema.
  • The pump handles ~85% of venous return from the lower limb.
Structural basis:
  • The soleus muscle contains large venous sinusoids (lake-like dilated channels) that can hold a significant volume of blood and empty forcefully on contraction - sometimes called the "soleal sinuses" - the true heart of the calf pump.
  • The deep fascia of the leg acts as an inextensible sleeve - muscle contraction against this rigid compartment maximises compression of the veins.
Applied:
ConditionEffect on Calf PumpResult
Walking, exercisePump working optimallyVenous pressure <20 mmHg, no edema
Prolonged standing still (soldiers)Pump not workingFluid shifts, possible fainting
Immobilisation, paralysis (DVT risk)Pump failureVenous stasis → DVT → pulmonary embolism
Varicose veinsIncompetent valvesPump inefficiency → chronic venous hypertension → leg ulcers
Post-thrombotic syndromeValve destruction after DVTPump works but blood flows backward → chronic edema and ulcers
PregnancyIncreased venous pressure + lax valvesVaricose veins, DVT risk
Accessory mechanisms aiding venous return (supplement the peripheral heart):
  1. Vis a tergo - residual pressure from the arterial side pushing blood forward.
  2. Thoracic pump - negative intrathoracic pressure during inspiration draws venous blood upward.
  3. Cardiac suction - diastolic expansion of the right atrium draws blood from veins.
  4. Venous valves - ensure one-directional flow.
  5. Plantar venous plexus pump - compression of the plantar venous plexus during heel strike propels blood upward.
Reference: BD Chaurasia's Human Anatomy, 10th Edition, Vol. 2 (Lower Limb); Gray's Anatomy for Students; Guyton & Hall Textbook of Medical Physiology - Venous pump mechanism.

Summary Table for Quick Revision:
System% ReturnExampleValves
Superficial veins~15%Great saphenous vein, Small saphenous veinYes
Deep veins~85%Femoral vein, Popliteal vein, Tibial veinsYes
Perforating veinsBridgeCockett's, Boyd's, Dodd's groupsYes (superficial → deep only)
Calf pump ("Peripheral Heart")Drives allSoleus + Gastrocnemius sinusoids-
This is a shared conversation. Sign in to Orris to start your own chat.