~/anatomy-pdf/generate_pdf.py
#!/usr/bin/env python3
"""
Anatomy Exam Answer PDF Generator
Generates a well-formatted PDF for all 17 upper limb anatomy exam questions
with embedded images from CDN URLs.
"""
import urllib.request
import os
import io
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib.colors import HexColor, white, black
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, HRFlowable, Image, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus.flowables import Flowable
# ββ Color palette ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
DARK_BLUE = HexColor("#1a3a5c")
MED_BLUE = HexColor("#2e6da4")
LIGHT_BLUE = HexColor("#dce8f5")
ACCENT = HexColor("#e8412c")
GREEN = HexColor("#1a6b3a")
LIGHT_GREEN = HexColor("#e6f4ec")
GOLD = HexColor("#c8860a")
LIGHT_GREY = HexColor("#f5f5f5")
MID_GREY = HexColor("#cccccc")
DARK_GREY = HexColor("#444444")
WHITE = white
OUTPUT_PATH = "/home/daytona/workspace/anatomy-pdf/Upper_Limb_Anatomy_Exam_Answers.pdf"
# ββ Image download helper ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def download_image(url, local_path):
try:
req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
with urllib.request.urlopen(req, timeout=15) as resp:
data = resp.read()
with open(local_path, "wb") as f:
f.write(data)
return True
except Exception as e:
print(f" WARN: could not download {url}: {e}")
return False
def get_image_flowable(url, local_name, width_cm=14, caption=""):
local_path = f"/home/daytona/workspace/anatomy-pdf/img_{local_name}.png"
if not os.path.exists(local_path):
ok = download_image(url, local_path)
if not ok:
return None
try:
img = Image(local_path, width=width_cm*cm, kind="proportional")
return img
except Exception as e:
print(f" WARN: could not load image {local_path}: {e}")
return None
# ββ Document setup βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
doc = SimpleDocTemplate(
OUTPUT_PATH,
pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=2.2*cm, bottomMargin=2.5*cm,
title="Upper Limb Anatomy β Exam Answers",
author="Anatomy Exam Prep | BD Chaurasia & Vishram Singh"
)
W = A4[0] - 4*cm # usable text width
# ββ Styles βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
base = getSampleStyleSheet()
def ps(name, parent="Normal", **kw):
s = ParagraphStyle(name, parent=base[parent])
for k, v in kw.items():
setattr(s, k, v)
return s
sTitle = ps("sTitle", "Title", fontSize=22, textColor=DARK_BLUE,
alignment=TA_CENTER, spaceAfter=4, fontName="Helvetica-Bold")
sSubtitle = ps("sSubtitle", fontSize=11, textColor=MED_BLUE,
alignment=TA_CENTER, spaceAfter=2, fontName="Helvetica")
sQHeader = ps("sQHeader", fontSize=13, textColor=WHITE,
fontName="Helvetica-Bold", leading=18, spaceAfter=0)
sBody = ps("sBody", "Normal", fontSize=9.5, leading=14, textColor=DARK_GREY,
spaceAfter=4, alignment=TA_JUSTIFY, fontName="Helvetica")
sBullet = ps("sBullet", "Normal", fontSize=9.5, leading=13, textColor=DARK_GREY,
leftIndent=14, bulletIndent=4, spaceAfter=2, fontName="Helvetica")
sSubHead = ps("sSubHead","Normal", fontSize=10.5, textColor=DARK_BLUE,
fontName="Helvetica-Bold", spaceBefore=6, spaceAfter=3)
sClinical = ps("sClinical","Normal", fontSize=9, leading=13, textColor=GREEN,
fontName="Helvetica", spaceAfter=3, leftIndent=8)
sCaption = ps("sCaption","Normal", fontSize=8, textColor=HexColor("#666666"),
alignment=TA_CENTER, spaceAfter=4, fontName="Helvetica-Oblique")
sMark = ps("sMark", "Normal", fontSize=9, textColor=GOLD,
fontName="Helvetica-Bold", alignment=TA_CENTER)
sTOCEntry = ps("sTOCEntry","Normal", fontSize=9.5, leading=14, textColor=DARK_BLUE,
fontName="Helvetica", spaceAfter=1)
sFootnote = ps("sFootnote","Normal", fontSize=7.5, textColor=HexColor("#888888"),
fontName="Helvetica-Oblique")
def tbl_style(header_color=MED_BLUE):
return TableStyle([
("BACKGROUND", (0,0), (-1,0), header_color),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,0), 8.5),
("FONTNAME", (0,1), (-1,-1), "Helvetica"),
("FONTSIZE", (0,1), (-1,-1), 8.5),
("BACKGROUND", (0,1), (-1,-1), LIGHT_GREY),
("ROWBACKGROUNDS",(0,1),(-1,-1),[LIGHT_GREY, WHITE]),
("GRID", (0,0), (-1,-1), 0.4, MID_GREY),
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING",(0,0), (-1,-1), 5),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING",(0,0),(-1,-1), 4),
("ROWHEIGHT", (0,0), (-1,-1), 14),
])
# ββ Q-header banner ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def q_header(qnum, title, marks):
banner_data = [[
Paragraph(f"Q{qnum}. {title}", sQHeader),
Paragraph(f"{marks} Marks", sMark)
]]
t = Table(banner_data, colWidths=[W-2.5*cm, 2.5*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING",(0,0), (-1,-1), 6),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING",(0,0),(-1,-1), 7),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
return t
def section(title):
return Paragraph(f"<b><font color='#{MED_BLUE.hexval()[2:]}'>βΆ {title}</font></b>", sSubHead)
def clinical_box(text):
data = [[Paragraph(f"<b>Clinical Significance:</b> {text}", sClinical)]]
t = Table(data, colWidths=[W])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT_GREEN),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING",(0,0), (-1,-1), 8),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING",(0,0),(-1,-1), 6),
("BOX", (0,0), (-1,-1), 1, GREEN),
("LINEAFTER", (0,0), (0,-1), 4, GREEN),
]))
return t
def bullet(text):
return Paragraph(f"β’ {text}", sBullet)
def body(text):
return Paragraph(text, sBody)
def sp(h=0.3):
return Spacer(1, h*cm)
def hr():
return HRFlowable(width="100%", thickness=0.5, color=MID_GREY, spaceAfter=4)
# ββ PAGE NUMBERING βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def on_page(canvas, doc):
canvas.saveState()
# Header bar
canvas.setFillColor(DARK_BLUE)
canvas.rect(1.5*cm, A4[1]-1.5*cm, A4[0]-3*cm, 0.5*cm, fill=1, stroke=0)
canvas.setFillColor(WHITE)
canvas.setFont("Helvetica-Bold", 7.5)
canvas.drawString(1.8*cm, A4[1]-1.25*cm, "UPPER LIMB ANATOMY β EXAM ANSWERS")
canvas.drawRightString(A4[0]-1.8*cm, A4[1]-1.25*cm, "BD Chaurasia | Vishram Singh")
# Footer
canvas.setFillColor(DARK_GREY)
canvas.setFont("Helvetica", 7.5)
canvas.drawCentredString(A4[0]/2, 1.5*cm, f"Page {doc.page}")
canvas.setFillColor(MID_GREY)
canvas.rect(1.5*cm, 1.9*cm, A4[0]-3*cm, 0.3, fill=1, stroke=0)
canvas.restoreState()
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# BUILD CONTENT
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story = []
# ββ COVER PAGE βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(Spacer(1, 3*cm))
# Title block
cover_data = [[Paragraph("UPPER LIMB ANATOMY", sTitle)]]
ct = Table(cover_data, colWidths=[W])
ct.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), DARK_BLUE),
("LEFTPADDING", (0,0),(-1,-1), 20),
("RIGHTPADDING",(0,0),(-1,-1), 20),
("TOPPADDING", (0,0),(-1,-1), 18),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
]))
story.append(ct)
sub_data = [[Paragraph("Exam-Style Model Answers | 17 Questions | 7 Marks Each", sSubtitle)]]
st2 = Table(sub_data, colWidths=[W])
st2.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), MED_BLUE),
("LEFTPADDING", (0,0),(-1,-1), 20),
("RIGHTPADDING",(0,0),(-1,-1), 20),
("TOPPADDING", (0,0),(-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
]))
story.append(st2)
story.append(sp(1.5))
# Info box
info_data = [
["Curriculum", "BD Chaurasia (Vol. 1) | Vishram Singh (Vol. 1 β Upper Limb)"],
["Subject", "Human Anatomy β Upper Limb"],
["Level", "First Year MBBS / BDS"],
["Topics", "Rotator Cuff, Deltoid, Pectoralis Major, Serratus Anterior,\nCarpal Tunnel, Interossei, Brachial Plexus, Erb's Palsy,\nMedian Nerve, Musculocutaneous Nerve, Radial Nerve,\nAxillary Artery, Cubital Fossa, Axilla"],
["Diagrams", "Embedded from Gray's Anatomy for Students"],
]
it = Table(info_data, colWidths=[3.5*cm, W-3.5*cm])
it.setStyle(TableStyle([
("FONTNAME", (0,0),(0,-1), "Helvetica-Bold"),
("FONTNAME", (1,0),(1,-1), "Helvetica"),
("FONTSIZE", (0,0),(-1,-1), 9),
("TEXTCOLOR", (0,0),(0,-1), DARK_BLUE),
("TEXTCOLOR", (1,0),(1,-1), DARK_GREY),
("GRID", (0,0),(-1,-1), 0.4, MID_GREY),
("BACKGROUND", (0,0),(0,-1), LIGHT_BLUE),
("BACKGROUND", (1,0),(1,-1), WHITE),
("LEFTPADDING", (0,0),(-1,-1), 8),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("VALIGN", (0,0),(-1,-1), "TOP"),
]))
story.append(it)
story.append(sp(2))
story.append(Paragraph("All answers include attachments, actions, nerve supply, clinical significance and diagrams where applicable.", sFootnote))
story.append(PageBreak())
# ββ TABLE OF CONTENTS ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
toc_header = [[Paragraph("Table of Contents", ps("tocH", fontSize=14, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_CENTER))]]
toch_t = Table(toc_header, colWidths=[W])
toch_t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),DARK_BLUE),
("TOPPADDING",(0,0),(-1,-1),8),("BOTTOMPADDING",(0,0),(-1,-1),8)]))
story.append(toch_t)
story.append(sp(0.3))
toc_items = [
("1", "Attachments of Rotator Cuff Muscles", "3"),
("2", "Attachments, Actions & Nerve Supply of Deltoid", "3"),
("3", "Structures Under Cover of Deltoid Muscle", "7"),
("4", "Attachment of Pectoralis Major Muscle", "2"),
("5", "Attachments, Actions & Nerve Supply of Serratus Anterior", "4"),
("6", "Carpal Tunnel β Boundaries, Contents & Carpal Tunnel Syndrome", "7"),
("7", "Nerve Supply & Actions of Interossei of Hand", "7"),
("8", "Brachial Plexus β Diagram and Explanation", "5"),
("9", "Anatomical Basis of Erb's Paralysis", "7"),
("10", "Pronation & Supination", "2"),
("11", "Median Nerve in Hand & Forearm", "4"),
("12", "Musculocutaneous Nerve", "3"),
("13", "Origin, Insertion & Distribution of Radial Nerve", "7"),
("14", "Root Value, Muscles Supplied & Clinical Anatomy of Radial Nerve","7"),
("15", "Parts, Course & Branches of Axillary Artery", "3"),
("16", "Cubital Fossa", "7"),
("17", "Axilla β Boundaries, Contents & Applied Anatomy", "3"),
]
for q, title, marks in toc_items:
row_data = [[
Paragraph(f"<b>Q{q}.</b>", sTOCEntry),
Paragraph(title, sTOCEntry),
Paragraph(f"[{marks}M]", ps("tM", fontSize=9, textColor=GOLD, fontName="Helvetica-Bold", alignment=TA_CENTER)),
]]
rt = Table(row_data, colWidths=[1*cm, W-2.5*cm, 1.5*cm])
rt.setStyle(TableStyle([
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("TOPPADDING",(0,0),(-1,-1),3),
("BOTTOMPADDING",(0,0),(-1,-1),3),
("LINEBELOW",(0,0),(-1,-1),0.3,MID_GREY),
]))
story.append(rt)
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# IMAGE URLS
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
IMGS = {
"subdeltoid_bursa": "https://cdn.orris.care/cdss_images/fe2d3c390874cb30b2391c387e6db94ffc9ac476adcd5305b5997dff3ced5d60.png",
"deltoid_lateral": "https://cdn.orris.care/cdss_images/1f28e3feb87300c94865942a27f1e54f08b40155c9c2d647c1ff93ff6281a14f.png",
"axillary_parts": "https://cdn.orris.care/cdss_images/491b4784ff84e6f608a5c32fa8c96e675b4f8b7a44ba666fc545793cca28a122.png",
"axillary_branches": "https://cdn.orris.care/cdss_images/70583920d10d12d2aa3d541c28e293548b1d0e2b266918563bddcd4f1694ac20.png",
"bp_components": "https://cdn.orris.care/cdss_images/42e3982ca738d0e6877cc67f524d1fbfcf9d635fdfed6e0372f6519623416ef7.png",
"bp_schematic": "https://cdn.orris.care/cdss_images/62ef9714975a8ea1509371bbecc736c66c2fdd7a02df72fb8141a511a0a08af2.png",
"bp_branches": "https://cdn.orris.care/cdss_images/2d1e124866bcf5ef44fe04881ee3568b0ed579f0f211fa7c979d830bd74fde4d.png",
"bp_table": "https://cdn.orris.care/cdss_images/c5f44e067af5791f418a2b4d80520cff61cad8ac4451516a3710567331c665c6.png",
"cubital_fossa": "https://cdn.orris.care/cdss_images/e3531fe8031b3f5bb2c220d7ee6c143d878e1bfc65a677f3842c8f4dbffa158c.png",
"radial_nerve": "https://cdn.orris.care/cdss_images/d78d1b83ae7c118cfd762fa686fb3785b4120f17adce49e86c0a97a166e9fac7.png",
}
def img(key, caption="", w=14):
url = IMGS.get(key)
if not url:
return []
fl = get_image_flowable(url, key, width_cm=w, caption=caption)
items = []
if fl:
items.append(sp(0.3))
# center the image
img_table = Table([[fl]], colWidths=[W])
img_table.setStyle(TableStyle([
("ALIGN",(0,0),(-1,-1),"CENTER"),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("TOPPADDING",(0,0),(-1,-1),4),
("BOTTOMPADDING",(0,0),(-1,-1),2),
]))
items.append(img_table)
if caption:
items.append(Paragraph(f"<i>{caption}</i>", sCaption))
items.append(sp(0.2))
return items
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q1 β ROTATOR CUFF
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(1, "Attachments of Rotator Cuff Muscles", "3"))
story.append(sp(0.2))
story.append(section("Definition"))
story.append(body("The rotator cuff is a musculotendinous cuff formed by four muscles surrounding the glenohumeral joint, providing dynamic stability and rotation of the humerus. Mnemonic: <b>SITS</b>"))
story.append(sp(0.2))
story.append(section("Attachments of the Four SITS Muscles"))
sits_data = [
["Muscle", "Origin", "Insertion", "Nerve", "Action"],
["Supraspinatus", "Supraspinous fossa of scapula", "Superior facet of greater tubercle", "Suprascapular n. (C5,C6)", "Initiates abduction 0-15Β°"],
["Infraspinatus", "Infraspinous fossa of scapula", "Middle facet of greater tubercle", "Suprascapular n. (C5,C6)", "Lateral rotation"],
["Teres Minor", "Upper 2/3 of lateral border of scapula", "Inferior facet of greater tubercle", "Axillary n. (C5,C6)", "Lateral rotation"],
["Subscapularis", "Subscapular fossa (costal surface)", "Lesser tubercle of humerus", "Upper & lower subscapular n. (C5,C6,C7)", "Medial rotation & adduction"],
]
t = Table(sits_data, colWidths=[2.8*cm, 3.5*cm, 3.2*cm, 3.5*cm, 3*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.extend(img("subdeltoid_bursa", "Fig. Supraspinatus tendon tear on MRI and subacromial bursa injection site (Gray's Anatomy for Students)", 13))
story.append(clinical_box("Supraspinatus is the most commonly injured rotator cuff muscle. The 'painful arc' (60Β°-120Β° abduction) and a positive drop-arm test indicate supraspinatus tear. Subacromial impingement occurs as the tendon passes beneath the acromion and coraco-acromial ligament."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q2 β DELTOID
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(2, "Attachments, Actions & Nerve Supply of Deltoid", "3"))
story.append(sp(0.2))
story.append(section("Origin (3 Parts β Inverted V from the 'DeltaACS' landmarks)"))
deltoid_origin = [
["Part", "Origin"],
["Anterior (Clavicular)", "Anterior border & upper surface of lateral 1/3 of clavicle"],
["Middle (Acromial)", "Lateral margin and superior surface of acromion process"],
["Posterior (Spinal)", "Lower lip of the crest of the spine of scapula (entire length)"],
]
t = Table(deltoid_origin, colWidths=[4.5*cm, W-4.5*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.append(sp(0.2))
story.append(section("Insertion"))
story.append(body("All three parts converge to insert at the <b>deltoid tuberosity</b> β a roughened area on the lateral surface of the middle 1/3 of the shaft of the humerus."))
story.append(sp(0.2))
story.append(section("Actions"))
actions_data = [
["Part", "Action"],
["Anterior (clavicular)", "Flexion + medial rotation of arm"],
["Middle (acromial)", "Abduction of arm (15Β°β90Β°; supraspinatus initiates 0β15Β°)"],
["Posterior (spinal)", "Extension + lateral rotation of arm"],
["All parts together", "Chief abductor of arm at the glenohumeral joint"],
]
t = Table(actions_data, colWidths=[4.5*cm, W-4.5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(sp(0.2))
story.append(section("Nerve Supply"))
story.append(body("<b>Axillary nerve (C5, C6)</b> β from the posterior cord of the brachial plexus. The nerve passes through the quadrangular space and winds around the surgical neck of the humerus before entering the deep surface of the deltoid."))
story.extend(img("deltoid_lateral", "Fig. 7.35 Lateral view of trapezius and deltoid muscles (Gray's Anatomy for Students)", 13))
story.append(clinical_box("Fracture of the surgical neck of the humerus or inferior shoulder dislocation injures the axillary nerve β deltoid paralysis β loss of abduction and flattening of the shoulder contour. IM injections given into the upper-outer deltoid must avoid the axillary nerve below."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q3 β STRUCTURES UNDER DELTOID
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(3, "Structures Under Cover of Deltoid Muscle", "7"))
story.append(sp(0.2))
story.append(body("The deltoid covers the lateral aspect of the shoulder. The following structures lie deep to it:"))
story.append(sp(0.2))
story.append(section("Bony Structures"))
for b in ["Greater tubercle of humerus", "Surgical neck of humerus", "Glenohumeral joint capsule"]:
story.append(bullet(b))
story.append(section("Rotator Cuff Tendons (SITS)"))
for b in ["Supraspinatus tendon (greater tubercle β superior facet)", "Infraspinatus tendon (greater tubercle β middle facet)",
"Teres minor tendon (greater tubercle β inferior facet)", "Subscapularis tendon (lesser tubercle)",
"Long head of biceps tendon (in intertubercular groove)"]:
story.append(bullet(b))
story.append(section("Bursa"))
story.append(bullet("Subacromial (subdeltoid) bursa β lies between deltoid and supraspinatus tendon, allowing free gliding of the cuff beneath the acromion"))
story.append(section("Nerves"))
for b in ["Axillary nerve β winds around surgical neck in quadrangular space, enters deep surface of deltoid",
"Branches of suprascapular nerve (to infraspinatus)"]:
story.append(bullet(b))
story.append(section("Vessels"))
for b in ["Posterior circumflex humeral artery & vein β accompany axillary nerve through quadrangular space",
"Anterior circumflex humeral artery β smaller, winds anteriorly around surgical neck"]:
story.append(bullet(b))
story.extend(img("deltoid_lateral", "Fig. Structures deep to deltoid β rotator cuff tendons, subacromial bursa, axillary nerve & circumflex humeral vessels", 13))
story.append(clinical_box("Subacromial bursitis produces painful shoulder abduction. Corticosteroid injections under ultrasound guidance target the subacromial bursa. Dislocation of the shoulder can stretch the axillary nerve which lies deep to the deltoid."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q4 β PECTORALIS MAJOR
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(4, "Attachment of Pectoralis Major Muscle", "2"))
story.append(sp(0.2))
story.append(section("Origin β Three Heads"))
pm_data = [
["Head", "Origin"],
["Clavicular head", "Anterior surface of medial half of clavicle"],
["Sternocostal head", "Anterior surface of sternum; upper 6 costal cartilages; aponeurosis of external oblique"],
["Abdominal head (variable)", "Anterior layer of rectus sheath"],
]
t = Table(pm_data, colWidths=[4.5*cm, W-4.5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(sp(0.2))
story.append(section("Insertion"))
story.append(body("<b>Lateral lip of the intertubercular (bicipital) groove</b> of the humerus. The tendon is bilaminar β lower sternocostal fibers rotate 180Β° so they end up superior to the clavicular fibers at the humerus."))
story.append(sp(0.2))
story.append(section("Nerve Supply & Actions"))
pm_act = [
["Nerve", "Action"],
["Medial + lateral pectoral nerves\n(C5, C6, C7, C8, T1)", "Adduction & medial rotation of arm at glenohumeral joint;\nClavicular head: flexion of extended arm;\nSternocostal head: extension of flexed arm (draws arm down)"],
]
t = Table(pm_act, colWidths=[4.5*cm, W-4.5*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.append(clinical_box("Pectoralis major rupture (bench press injury) creates a visible defect in the anterior axillary fold with weakness of adduction and medial rotation. The muscle forms the anterior axillary fold."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q5 β SERRATUS ANTERIOR
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(5, "Attachments, Actions & Nerve Supply of Serratus Anterior", "4"))
story.append(sp(0.2))
story.append(section("Origin"))
story.append(body("Eight fleshy digitations (slips) from the <b>outer surfaces and superior borders of the upper 8 ribs</b> and their intervening intercostal fascia."))
story.append(section("Insertion"))
story.append(body("Entire <b>costal (anterior) surface of the medial border of the scapula</b> β from superior angle to inferior angle. The lower 4 slips (from ribs 5β8) converge specifically onto the <b>inferior angle</b>."))
story.append(section("Nerve Supply"))
story.append(body("<b>Long thoracic nerve of Bell (C5, C6, C7)</b> β arises from anterior rami of C5, C6, C7. It passes vertically down the lateral chest wall entirely on the superficial surface of the muscle (highly exposed and vulnerable to injury)."))
story.append(section("Actions"))
sa_data = [
["Action", "Mechanism"],
["Protracts scapula", "Pulls the medial border of scapula forward and laterally around the chest wall"],
["Holds scapula against thoracic wall", "Prevents winging; acts as the 'boxing muscle' or 'punching muscle'"],
["Rotates glenoid cavity upward", "Lower 4 slips rotate the inferior angle laterally β essential for abduction above 90Β°"],
]
t = Table(sa_data, colWidths=[4.5*cm, W-4.5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(sp(0.2))
story.append(body("<b>Force couple for scapular rotation:</b> Serratus anterior (lower fibers) + Trapezius (upper and lower fibers) rotate the scapula to elevate the glenoid cavity β enabling full arm elevation above 90Β°."))
story.extend(img("bp_branches", "Fig. Long thoracic nerve (C5,C6,C7) course on serratus anterior (brachial plexus branch diagram)", 13))
story.append(clinical_box("Injury to the long thoracic nerve (during mastectomy, first-rib resection, or by carrying heavy loads on the shoulder) paralyses serratus anterior β WINGED SCAPULA: the medial border and inferior angle become prominent when the patient pushes against a wall. Full arm abduction beyond 90Β° is also lost."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q6 β CARPAL TUNNEL
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(6, "Carpal Tunnel β Boundaries, Contents & Carpal Tunnel Syndrome", "7"))
story.append(sp(0.2))
story.append(section("Definition"))
story.append(body("A fibro-osseous tunnel at the wrist formed by the <b>carpal bones (floor and sides)</b> and the <b>flexor retinaculum / transverse carpal ligament (roof)</b>."))
story.append(section("Boundaries"))
ct_bounds = [
["Wall", "Structure"],
["Floor", "Concave anterior surface of carpal bones (carpal arch): scaphoid + trapezium (lateral); triquetrum + hamate (medial)"],
["Roof", "Flexor retinaculum β attached medially to pisiform & hook of hamate; laterally to scaphoid tubercle & ridge of trapezium"],
["Sides", "Formed by carpal bones"],
]
t = Table(ct_bounds, colWidths=[3*cm, W-3*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(sp(0.2))
story.append(section("Contents (9 Tendons + 1 Nerve)"))
for b in [
"Flexor digitorum superficialis (FDS) β 4 tendons (in 2 rows)",
"Flexor digitorum profundus (FDP) β 4 tendons",
"Flexor pollicis longus (FPL) β 1 tendon",
"Median nerve β most superficial structure, just beneath flexor retinaculum",
]:
story.append(bullet(b))
story.append(body("<b>NOT in the carpal tunnel:</b> FCR (separate compartment in retinaculum), palmaris longus (superficial to retinaculum), ulnar nerve & artery (travel through Guyon's canal β medial to tunnel)."))
story.append(section("Carpal Tunnel Syndrome (CTS)"))
story.append(body("<b>Definition:</b> Compression of the median nerve within the carpal tunnel."))
story.append(sp(0.1))
cts_data = [
["Causes", "Symptoms & Signs", "Treatment"],
["Idiopathic (most common)\nHypothyroidism, RA, pregnancy\nDiabetes, acromegaly\nColles' fracture\nRepetitive wrist use",
"Numbness/tingling in lateral 3Β½ digits\nNocturnal paraesthesia (worse at night)\nWeakness of grip\nThenar wasting (LOAF muscles)\nApe hand deformity (loss of opposition)\n+ve Tinel's sign (tapping wrist)\n+ve Phalen's test (forced flexion 60s)",
"Conservative:\nβ’ Wrist splinting (neutral)\nβ’ Corticosteroid injection\nβ’ Treat underlying cause\n\nSurgical:\nβ’ Division of flexor retinaculum\n(open or endoscopic carpal tunnel release)"],
]
t = Table(cts_data, colWidths=[4*cm, 6*cm, 6*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.append(clinical_box("The palmar cutaneous branch of the median nerve arises 5 cm above the wrist and passes SUPERFICIAL to the retinaculum β therefore it is spared in CTS. Sensation over the thenar eminence is preserved even in carpal tunnel syndrome."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q7 β INTEROSSEI
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(7, "Nerve Supply & Actions of Interossei of Hand", "7"))
story.append(sp(0.2))
story.append(section("Overview"))
story.append(body("The interossei are intrinsic muscles of the hand occupying the spaces between the metacarpals. They are divided into <b>dorsal</b> (4) and <b>palmar</b> (3β4) groups. Mnemonic: <b>DAB β PAD</b> (Dorsal Abduct, Palmar Adduct)."))
story.append(section("Dorsal Interossei (4 muscles) β Bipennate"))
di_data = [
["Muscle", "Origin (from adjacent metacarpals)", "Insertion", "Action"],
["1st dorsal", "1st & 2nd metacarpals", "Radial side of index finger proximal phalanx + extensor expansion", "Abducts index finger"],
["2nd dorsal", "2nd & 3rd metacarpals", "Radial side of middle finger", "Abducts middle finger radially"],
["3rd dorsal", "3rd & 4th metacarpals", "Ulnar side of middle finger", "Abducts middle finger ulnarly"],
["4th dorsal", "4th & 5th metacarpals", "Ulnar side of ring finger", "Abducts ring finger"],
]
t = Table(di_data, colWidths=[2.5*cm, 4*cm, 4.5*cm, 5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(section("Palmar Interossei (3 muscles) β Unipennate"))
pi_data = [
["Muscle", "Origin (palmar surface)", "Acts on", "Action"],
["1st palmar", "2nd metacarpal (ulnar side)", "Index finger", "Adducts index toward middle"],
["2nd palmar", "4th metacarpal (radial side)", "Ring finger", "Adducts ring toward middle"],
["3rd palmar", "5th metacarpal (radial side)", "Little finger", "Adducts little toward middle"],
]
t = Table(pi_data, colWidths=[2.5*cm, 4.5*cm, 3*cm, 6*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.append(section("Shared Actions of All Interossei"))
for b in [
"Flex the metacarpophalangeal (MCP) joints",
"Extend the proximal and distal interphalangeal (IP) joints (via the extensor expansion / dorsal hood)",
]:
story.append(bullet(b))
story.append(section("Nerve Supply"))
story.append(body("<b>ALL interossei (both dorsal and palmar) are supplied by the Deep branch of the Ulnar nerve (C8, T1)</b>. This is a consistent and important exam fact."))
story.append(clinical_box("Ulnar nerve palsy β loss of all interossei β (1) Guttering (visible depressions between metacarpals) due to muscle wasting; (2) Claw hand (ring and little fingers β MCP hyperextension + IP flexion); (3) Froment's sign: patient cannot grip paper between thumb and index without flexing the IP joint of thumb (FPL substitutes for paralysed 1st dorsal interosseous)."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q8 β BRACHIAL PLEXUS
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(8, "Brachial Plexus β Diagram and Explanation", "5"))
story.append(sp(0.2))
story.append(section("Formation"))
story.append(body("The brachial plexus is formed by the <b>anterior primary rami of C5, C6, C7, C8, and T1</b>. It supplies the entire upper limb. It originates in the posterior triangle of the neck and enters the axilla."))
story.append(section("Structure β Mnemonic: RTDCB"))
rtdcb_data = [
["Component", "Details", "Location"],
["Roots", "Anterior rami of C5, C6, C7, C8, T1\nPass between anterior and middle scalene muscles", "Neck β posterior triangle"],
["Trunks", "Upper trunk (C5+C6)\nMiddle trunk (C7)\nLower trunk (C8+T1)", "Neck β posterior triangle\n(lower trunk on rib I)"],
["Divisions", "Each trunk β anterior + posterior division (6 total)", "Behind clavicle"],
["Cords", "Lateral cord (ant. div. upper + middle = C5-C7)\nMedial cord (ant. div. lower = C8,T1)\nPosterior cord (all 3 post. div. = C5-T1)", "Axilla β named by relation to axillary artery 2nd part"],
["Branches", "All major terminal nerves of upper limb", "Axilla"],
]
t = Table(rtdcb_data, colWidths=[2.5*cm, 6.5*cm, 7*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.extend(img("bp_components", "Fig. 7.52A β Brachial plexus: major components in neck and axilla (Gray's Anatomy for Students)", 12))
story.extend(img("bp_schematic", "Fig. 7.52B β Schematic of brachial plexus showing roots, trunks, divisions, cords (Gray's Anatomy for Students)", 12))
story.append(section("Key Branches Summary"))
branches_data = [
["Origin", "Nerve", "Distribution"],
["Root C5", "Dorsal scapular (C5)", "Rhomboids + levator scapulae"],
["Roots C5,C6,C7", "Long thoracic", "Serratus anterior"],
["Upper trunk", "Suprascapular (C5,C6)", "Supraspinatus + infraspinatus"],
["Lateral cord", "Musculocutaneous (C5,C6,C7)", "Anterior arm muscles + lat. cutaneous of forearm"],
["Lateral cord", "Lateral root of median", "Forms median nerve"],
["Medial cord", "Ulnar (C7,C8,T1)", "All intrinsic hand muscles (except LOAF) + 1.5 flexors"],
["Medial cord", "Medial root of median", "Forms median nerve"],
["Posterior cord", "Axillary (C5,C6)", "Deltoid + teres minor"],
["Posterior cord", "Radial (C5-T1)", "All extensors of upper limb"],
["Posterior cord", "Thoracodorsal (C6,C7,C8)", "Latissimus dorsi"],
]
t = Table(branches_data, colWidths=[3*cm, 4.5*cm, W-7.5*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.extend(img("bp_branches", "Fig. 7.53 β Complete brachial plexus branching diagram with relationship to axillary artery", 13))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q9 β ERB'S PALSY
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(9, "Anatomical Basis of Deformity of Erb's Paralysis", "7"))
story.append(sp(0.2))
story.append(section("Definition & Causes"))
story.append(body("Erb's palsy (Erb-Duchenne palsy) results from injury to the <b>upper trunk of the brachial plexus (C5, C6 roots)</b>. Common causes include birth injury (excessive lateral neck-shoulder traction during delivery), falls on the shoulder, and traction injuries."))
story.append(section("Nerves Injured β Upper Trunk (C5, C6)"))
erbs_nerves = [
["Nerve Damaged", "Muscle Paralysed", "Function Lost"],
["Axillary nerve (C5,C6)", "Deltoid, Teres minor", "Abduction, lateral rotation of shoulder"],
["Suprascapular nerve (C5,C6)", "Supraspinatus, Infraspinatus", "Abduction initiation, lateral rotation"],
["Musculocutaneous nerve (C5,C6)", "Biceps brachii, Brachialis, Coracobrachialis", "Elbow flexion, supination"],
["Radial nerve (C5,C6 fibers)", "Brachioradialis, ECRL", "Flexion of forearm in mid-prone; wrist extension (partial)"],
]
t = Table(erbs_nerves, colWidths=[4.5*cm, 5*cm, W-9.5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(section("Deformity β 'Waiter's Tip' Position"))
story.append(body("With the above muscles paralysed, the <b>unopposed muscles</b> produce the classic posture:"))
erbs_deform = [
["Joint", "Unopposed Muscles", "Resulting Position"],
["Shoulder", "Subscapularis, pectoralis major, teres major (adductors & medial rotators)", "Adducted + medially rotated arm"],
["Elbow", "Triceps brachii (extensor)", "Extended elbow"],
["Forearm", "Pronator teres, pronator quadratus", "Pronated forearm"],
["Wrist", "Flexors (partially)", "Wrist slightly flexed"],
]
t = Table(erbs_deform, colWidths=[3*cm, 6*cm, W-9*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.append(sp(0.2))
story.append(body("<b>Result:</b> Arm hangs adducted, medially rotated at shoulder; elbow extended; forearm pronated β the classic <b>'Waiter's Tip'</b> or <b>'Porter's Tip'</b> deformity."))
story.append(section("Sensory Loss"))
story.append(body("Loss of sensation over the <b>lateral aspect of arm and forearm</b> (axillary and musculocutaneous nerve territory β the 'regimental badge' area and lateral forearm)."))
story.append(section("Comparison: Klumpke's Palsy (Lower Trunk C8,T1)"))
story.append(body("Klumpke's palsy affects C8, T1 β intrinsic hand muscles paralysed β <b>claw hand</b>. If sympathetic T1 fibers are involved β Horner's syndrome (ptosis, miosis, anhidrosis)."))
story.extend(img("bp_schematic", "Fig. Brachial plexus schematic showing upper trunk (C5,C6) injury site in Erb's palsy", 12))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q10 β PRONATION & SUPINATION
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(10, "Pronation & Supination", "2"))
story.append(sp(0.2))
story.append(section("Definitions"))
story.append(body("<b>Supination:</b> Rotation of the forearm to bring the palm to face anteriorly (anatomical position). Mnemonic: 'SOUPination = carrying a bowl of soup.' Radius and ulna lie parallel."))
story.append(body("<b>Pronation:</b> Rotation of the forearm to bring the palm to face posteriorly (downward). The radius crosses over the ulna."))
story.append(section("Mechanism"))
story.append(body("Movement occurs at the <b>proximal and distal radio-ulnar joints</b>. The <b>radius rotates around the stationary ulna</b>."))
story.append(section("Muscles"))
ps_data = [
["Movement", "Primary Muscle", "Nerve", "Root", "Secondary Muscle"],
["Supination", "Supinator", "Deep branch of radial nerve", "C6", "Biceps brachii (powerful when elbow flexed; C5,C6 musculocutaneous)"],
["Pronation", "Pronator teres", "Median nerve", "C6", "Pronator quadratus (C7,C8 β anterior interosseous branch of median)"],
]
t = Table(ps_data, colWidths=[2.5*cm, 3*cm, 3.5*cm, 1.5*cm, W-10.5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(clinical_box("Supination is stronger than pronation (important in driving screws). Supinator syndrome: entrapment of the posterior interosseous nerve at the arcade of Frohse β weakness of finger/thumb extension without sensory loss (purely motor, unlike wrist drop from radial nerve injury in radial groove)."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q11 β MEDIAN NERVE
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(11, "Median Nerve in Hand & Forearm", "4"))
story.append(sp(0.2))
story.append(section("Formation"))
story.append(body("Formed by the <b>lateral root (C5,C6,C7 β from lateral cord)</b> and <b>medial root (C8,T1 β from medial cord)</b> of brachial plexus, uniting in front of the third part of the axillary artery."))
story.append(section("Course in Forearm"))
for b in [
"Enters the forearm by passing between the humeral and ulnar heads of pronator teres",
"Runs deep to flexor digitorum superficialis (FDS)",
"Emerges between FDS and FDP in the lower forearm",
"Passes deep to the flexor retinaculum through the carpal tunnel into the hand",
]:
story.append(bullet(b))
story.append(section("Branches in Forearm"))
mn_fr = [
["Branch", "Muscles Supplied"],
["Direct muscular branches (upper forearm)", "Pronator teres, Flexor carpi radialis, Palmaris longus, FDS"],
["Anterior interosseous nerve (AIN)", "Flexor pollicis longus (FPL), Lateral half of FDP (index + middle), Pronator quadratus"],
["Palmar cutaneous branch (given 5 cm above wrist)", "Skin over thenar eminence and lateral palm (does NOT pass through carpal tunnel)"],
]
t = Table(mn_fr, colWidths=[5*cm, W-5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(section("Branches in Hand β LOAF Muscles (Motor)"))
loaf_data = [
["Muscle", "Action"],
["Lateral two Lumbricals (index & middle)", "Flex MCP + extend IP joints of index and middle fingers"],
["Opponens pollicis", "Opposition of thumb (the most important)"],
["Abductor pollicis brevis", "Abducts thumb at CMC joint"],
["Flexor pollicis brevis (superficial head)", "Flexes proximal phalanx of thumb"],
]
t = Table(loaf_data, colWidths=[6*cm, W-6*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.append(section("Sensory Supply in Hand"))
story.append(body("Palmar surface of lateral 3Β½ digits; dorsal tips (nail beds) of lateral 3Β½ digits; lateral palm (via palmar cutaneous branch)."))
story.append(section("Clinical Features by Level of Injury"))
mn_inj = [
["Level of Injury", "Additional Features"],
["At wrist (carpal tunnel)", "Thenar wasting; ape hand; loss of opposition; sensory loss lateral 3Β½ fingers. NO forearm muscle loss."],
["Above pronator teres (elbow/arm)", "All of above + loss of pronation + loss of FCR, FPL, FDP lateral half β 'Hand of Benediction' on making a fist (index & middle stay extended)."],
]
t = Table(mn_inj, colWidths=[4.5*cm, W-4.5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q12 β MUSCULOCUTANEOUS NERVE
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(12, "Musculocutaneous Nerve", "3"))
story.append(sp(0.2))
story.append(section("Origin & Root Value"))
story.append(body("<b>Lateral cord of the brachial plexus (C5, C6, C7)</b>. Arises in the axilla."))
story.append(section("Course"))
for b in [
"Arises from the lateral cord in the axilla",
"PIERCES coracobrachialis muscle (distinguishing anatomical feature)",
"Passes obliquely between biceps brachii (anterior) and brachialis (posterior)",
"Emerges at the lateral border of the biceps tendon just above the elbow",
"Pierces deep fascia β becomes the lateral cutaneous nerve of forearm",
]:
story.append(bullet(b))
story.append(section("Motor Branches β Anterior Compartment of Arm ('BBC')"))
bbc_data = [
["Muscle", "Root", "Action"],
["Biceps brachii (B)", "C5, C6", "Elbow flexion (esp. supinated); supination; long head β shoulder flexion"],
["Brachialis (B)", "C5, C6 (lateral also from radial)", "Elbow flexion in all positions (the 'workhorse')"],
["Coracobrachialis (C)", "C6, C7", "Shoulder flexion and adduction"],
]
t = Table(bbc_data, colWidths=[4*cm, 2.5*cm, W-6.5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(section("Sensory Branch"))
story.append(body("<b>Lateral cutaneous nerve of forearm</b> β supplies skin on both the anterior and posterior aspects of the lateral forearm as far as the thenar eminence."))
story.append(clinical_box("Injury (from shoulder dislocation or penetrating wounds) causes: weakness of elbow flexion in supinated position; loss of supination (biceps paralysed); sensory loss on lateral forearm. The biceps (C5,C6) reflex is abolished."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q13 β RADIAL NERVE ORIGIN/INSERTION/DISTRIBUTION
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(13, "Origin, Insertion & Distribution of Radial Nerve", "7"))
story.append(sp(0.2))
story.append(section("Origin"))
story.append(body("Largest branch of the brachial plexus. Arises from the <b>posterior cord (C5, C6, C7, C8, T1)</b>."))
story.append(section("Course"))
rn_course = [
["Region", "Course"],
["Axilla", "Lies posterior to axillary artery. Passes through triangular interval (with profunda brachii artery) to enter posterior compartment of arm."],
["Arm (posterior compartment)", "Runs in radial groove (spiral groove) on posterior surface of humerus from medial to lateral, accompanied by profunda brachii artery."],
["Lateral arm", "Pierces lateral intermuscular septum to enter anterior compartment between brachialis and brachioradialis muscles."],
["Cubital fossa", "Lies deep to brachioradialis, anterior to lateral epicondyle. Divides into superficial and deep (posterior interosseous) branches."],
["Forearm", "Superficial branch: under brachioradialis β dorsum of hand. Deep branch (PIN): winds through supinator muscle."],
]
t = Table(rn_course, colWidths=[3.5*cm, W-3.5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(section("Motor Distribution β All Extensors"))
rn_motor = [
["Region", "Muscles Supplied"],
["Arm (before radial groove)", "Triceps brachii (all 3 heads), anconeus"],
["Arm (in radial groove)", "Brachioradialis, extensor carpi radialis longus (ECRL), lateral part of brachialis"],
["Forearm (via posterior interosseous / deep radial nerve)", "ECRB, supinator, extensor digitorum, EDM, ECU, APL, EPB, EPL, EIP"],
]
t = Table(rn_motor, colWidths=[4*cm, W-4*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.append(section("Sensory Distribution"))
for b in [
"Posterior cutaneous nerve of arm (from axilla)",
"Inferior lateral cutaneous nerve of arm (from radial groove)",
"Posterior cutaneous nerve of forearm (from radial groove)",
"Superficial radial nerve β dorsum of lateral 3Β½ fingers (proximal phalanges only; nail beds by median nerve)",
]:
story.append(bullet(b))
story.extend(img("radial_nerve", "Fig. 7.69 β Radial nerve in the arm showing course through triangular interval, radial groove and division at cubital fossa (Gray's Anatomy for Students)", 13))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q14 β RADIAL NERVE CLINICAL ANATOMY
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(14, "Root Value, Muscles Supplied & Clinical Anatomy of Radial Nerve", "7"))
story.append(sp(0.2))
story.append(section("Root Value"))
story.append(body("<b>C5, C6, C7, C8, T1</b> β from the posterior cord of the brachial plexus. The radial nerve is the nerve of the <b>extensor compartments</b> of the upper limb."))
story.append(section("Complete Muscle Supply"))
rn_full = [
["Level", "Muscles"],
["Arm", "Triceps (all heads), Anconeus, Brachioradialis, ECRL, Lateral portion of brachialis"],
["Forearm\n(via PIN β posterior interosseous nerve)", "ECRB, Supinator, Extensor digitorum communis, Extensor digiti minimi, ECU, APL, EPB, EPL, Extensor indicis proprius (EIP)"],
]
t = Table(rn_full, colWidths=[4*cm, W-4*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(section("Clinical Anatomy β Sites of Injury & Deformities"))
rn_clin = [
["Site of Injury", "Common Cause", "Paralysis", "Deformity / Signs"],
["Axilla", "Crutch palsy; Saturday night palsy (sleeping with arm over back of chair)", "Triceps + all below", "COMPLETE WRIST DROP + loss of elbow extension; loss of triceps reflex; sensory loss entire radial distribution"],
["Radial groove\n(mid-humerus)", "Mid-shaft humerus fracture\n(most common site)", "All below radial groove; TRICEPS SPARED (branch given before groove)", "WRIST DROP; finger drop; loss of supination; sensory loss dorsum of hand (autonomous area: dorsal web space between thumb & index)"],
["Lateral epicondyle / cubital fossa", "Fracture of lateral epicondyle; compression", "Below elbow; brachioradialis spared", "Wrist drop; weakness of finger extension"],
["Neck of radius\n(PIN / deep radial nerve)", "Dislocation of radial head; compression by fibrous arcade of Frohse (supinator syndrome)", "Posterior interosseous nerve β all extensors of fingers and thumb; ECRL spared", "FINGER DROP (cannot extend MCP joints); NO wrist drop; NO sensory loss (purely motor nerve)"],
]
t = Table(rn_clin, colWidths=[3*cm, 3.5*cm, 4*cm, W-10.5*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.append(clinical_box("Wrist drop: All wrist and finger extensors paralysed β wrist hangs in flexion due to unopposed flexors. This is the hallmark of radial nerve injury in the radial groove. The autonomous sensory area is the dorsal web space between thumb and index finger."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q15 β AXILLARY ARTERY
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(15, "Parts, Course & Branches of the Axillary Artery", "3"))
story.append(sp(0.2))
story.append(section("Introduction"))
story.append(body("The axillary artery is the continuation of the subclavian artery. It begins at the <b>outer border of the first rib</b> and ends at the <b>lower border of teres major</b> (where it becomes the brachial artery). It is divided into 3 parts by the <b>pectoralis minor muscle</b>. Mnemonic: 'One branch from part 1, two from part 2, three from part 3.'"))
story.append(section("Three Parts & Their Branches"))
aa_data = [
["Part", "Relation to Pec. Minor", "Branch", "Distribution"],
["1st part", "Medial to (proximal)\nto pectoralis minor", "Superior thoracic artery", "Intercostals 1&2; upper medial & anterior axillary walls"],
["2nd part", "Posterior to\npectoralis minor", "Thoraco-acromial artery\n(4 branches: pectoral, deltoid,\nclavicular, acromial)", "Anterior axillary wall; breast (pectoral branch); deltopectoral triangle (deltoid branch)"],
["2nd part", "", "Lateral thoracic artery", "Lateral chest wall; serratus anterior; lateral breast"],
["3rd part", "Lateral to (distal to)\npectoralis minor", "Subscapular artery\n(largest branch)", "Divides β thoracodorsal (latissimus dorsi) + circumflex scapular (scapular anastomosis)"],
["3rd part", "", "Anterior circumflex humeral artery", "Winds anteriorly around surgical neck of humerus (small)"],
["3rd part", "", "Posterior circumflex humeral artery", "Through quadrangular space with axillary nerve; larger; anastomoses with anterior circumflex humeral"],
]
t = Table(aa_data, colWidths=[1.8*cm, 3.5*cm, 4.2*cm, W-9.5*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.extend(img("axillary_parts", "Fig. 7.49 β Axillary artery divided into 3 parts by pectoralis minor (Gray's Anatomy for Students)", 12))
story.extend(img("axillary_branches", "Fig. 7.50 β Branches of the axillary artery from all three parts", 13))
story.append(clinical_box("The posterior circumflex humeral artery is most at risk in surgical neck fractures and anterior shoulder dislocations. The axillary artery can be compressed against the humerus to control haemorrhage. The scapular anastomosis (suprascapular β circumflex scapular) maintains limb perfusion in axillary artery occlusion."))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q16 β CUBITAL FOSSA
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(16, "Cubital Fossa", "7"))
story.append(sp(0.2))
story.append(section("Definition"))
story.append(body("A triangular (intermuscular) depression situated <b>anterior to the elbow joint</b> at the junction of the arm and forearm. It is a passageway for major neurovascular structures entering the forearm."))
story.append(section("Boundaries"))
cf_bounds = [
["Boundary", "Structure"],
["Lateral", "Medial border of brachioradialis muscle"],
["Medial", "Lateral border of pronator teres muscle"],
["Base (superior)", "Imaginary line between medial and lateral epicondyles of humerus"],
["Apex (inferior)", "Meeting point of brachioradialis and pronator teres"],
["Floor (posterior)", "Brachialis muscle (upper part) + supinator muscle (lower part)"],
["Roof (anterior)", "Skin β superficial fascia β deep fascia reinforced by bicipital aponeurosis (lacertus fibrosus)"],
]
t = Table(cf_bounds, colWidths=[3*cm, W-3*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(section("Contents β Lateral to Medial (Mnemonic: TAN)"))
cf_contents = [
["Structure", "Details"],
["T β Tendon of biceps brachii", "Most lateral structure; passes to radial tuberosity. The bicipital aponeurosis (lacertus fibrosus) fans medially from the tendon over the brachial artery."],
["A β Brachial Artery", "Medial to biceps tendon. Bifurcates into radial (lateral) and ulnar (medial) arteries at the apex of the fossa."],
["N β Median Nerve", "Most medial content. Passes between the two heads of pronator teres to exit the fossa."],
["Radial nerve (lateral β not a true content)", "Lies deep to brachioradialis, lateral to fossa proper. Divides into superficial and deep (posterior interosseous) branches here."],
["Ulnar nerve (absent from fossa)", "Travels POSTERIOR to medial epicondyle β does not pass through the cubital fossa."],
]
t = Table(cf_contents, colWidths=[5*cm, W-5*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.append(section("Roof Contents"))
for b in [
"Median cubital vein β connects cephalic (lateral) and basilic (medial) veins; most common site for venepuncture",
"Bicipital aponeurosis β protects brachial artery and median nerve from superficial puncture",
"Medial and lateral cutaneous nerves of forearm",
]:
story.append(bullet(b))
story.extend(img("cubital_fossa", "Fig. 7.77 β Cubital fossa: (A) margins, (B) contents β biceps tendon, brachial artery bifurcation, median nerve, (C) radial nerve, (D) superficial structures / median cubital vein", 14))
story.append(section("Applied Anatomy"))
applied = [
("Venepuncture", "Median cubital vein in the roof is the standard site for blood sampling and IV access. The bicipital aponeurosis protects the brachial artery."),
("Blood pressure", "Brachial artery pulse is auscultated in the cubital fossa during BP measurement."),
("Supracondylar fracture", "In children, this common fracture endangers the brachial artery and median nerve in the fossa."),
("Radial head dislocation", "Can injure the posterior interosseous nerve (deep radial nerve) as it enters the supinator β finger drop without wrist drop."),
("Bicipital tendinitis", "Pain in the cubital fossa on resisted supination."),
]
for title_txt, detail in applied:
story.append(Paragraph(f"<b><font color='#{DARK_BLUE.hexval()[2:]}'>β’ {title_txt}:</font></b> {detail}", sBullet))
story.append(PageBreak())
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Q17 β AXILLA
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(q_header(17, "Axilla β Boundaries, Contents & Applied Anatomy", "3"))
story.append(sp(0.2))
story.append(section("Definition"))
story.append(body("A <b>pyramidal (cone-shaped) space</b> at the junction of the arm and thorax, serving as the passageway for all neurovascular structures entering and leaving the upper limb."))
story.append(section("Boundaries (6 Walls + Apex + Base)"))
ax_bounds = [
["Wall", "Structures"],
["Apex (Inlet β cervico-axillary canal)", "Clavicle (anterior) + 1st rib (medial) + superior border of scapula to coracoid process (posterior)"],
["Base (Floor)", "Axillary fascia (deep) + dome of axillary skin. Supported by clavipectoral fascia from above."],
["Anterior wall", "Pectoralis major (superficial) + pectoralis minor + subclavius + clavipectoral fascia (deep)"],
["Posterior wall", "Subscapularis (upper) + teres major + latissimus dorsi (lower) + long head of triceps"],
["Medial wall", "Upper 4 ribs + intercostal spaces + serratus anterior muscle"],
["Lateral wall (narrowest)", "Intertubercular (bicipital) groove of humerus"],
]
t = Table(ax_bounds, colWidths=[4*cm, W-4*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(section("Contents"))
story.append(body("<b>Vessels:</b> Axillary artery (3 parts, 6 branches), Axillary vein (medial to artery), Cephalic vein (enters deltopectoral triangle)."))
story.append(body("<b>Nerves:</b> 3 cords of brachial plexus + all their major terminal branches; Intercostobrachial nerve (T2 β anterior cutaneous nerve of arm)."))
story.append(body("<b>Lymph Nodes (5 groups):</b>"))
ln_data = [
["Group", "Location", "Drains"],
["Anterior (pectoral)", "Along lateral thoracic vessels", "Breast (major), anterior chest wall"],
["Posterior (subscapular)", "Along subscapular vessels", "Back, posterior shoulder"],
["Lateral", "Along axillary vein", "Upper limb"],
["Central", "Embedded in axillary fat", "All 3 above groups"],
["Apical", "At apex, medial to cephalic vein", "All groups β subclavian trunk β thoracic duct / right lymphatic duct"],
]
t = Table(ln_data, colWidths=[3.5*cm, 5*cm, W-8.5*cm])
t.setStyle(tbl_style(MED_BLUE))
story.append(t)
story.append(section("Gateways in Posterior Wall"))
gw_data = [
["Space", "Boundaries", "Contents"],
["Quadrangular space", "Above: subscapularis; Below: teres major; Medial: long head triceps; Lateral: surgical neck of humerus", "Axillary nerve + posterior circumflex humeral artery & vein"],
["Triangular space", "Above: subscapularis; Below: teres major; Lateral: long head triceps", "Circumflex scapular artery & vein"],
["Triangular interval", "Above: teres major; Medial: long head triceps; Lateral: shaft of humerus", "Radial nerve + profunda brachii artery"],
]
t = Table(gw_data, colWidths=[3*cm, 6*cm, W-9*cm])
t.setStyle(tbl_style(DARK_BLUE))
story.append(t)
story.append(section("Applied Anatomy"))
ax_applied = [
("Breast cancer surgery", "Axillary lymph node dissection for staging. Long thoracic nerve (serratus anterior) and thoracodorsal nerve (latissimus dorsi) must be preserved."),
("Axillary nerve injury", "Shoulder dislocation (most common cause) or surgical neck fracture damages axillary nerve in quadrangular space β deltoid paralysis + 'regimental badge' sensory loss."),
("Intercostobrachial nerve", "Sacrificed during axillary node dissection β sensory loss medial arm (common complaint after mastectomy)."),
("Axillary artery injury", "In severe shoulder dislocation or penetrating trauma. Scapular anastomosis maintains some distal perfusion."),
("Axillary abscess", "Deep space infection β incision and drainage must avoid the neurovascular structures. Requires medial approach."),
]
for title_txt, detail in ax_applied:
story.append(Paragraph(f"<b><font color='#{DARK_BLUE.hexval()[2:]}'>β’ {title_txt}:</font></b> {detail}", sBullet))
story.append(sp(0.5))
story.append(HRFlowable(width="100%", thickness=1, color=DARK_BLUE))
story.append(sp(0.3))
story.append(Paragraph("End of Upper Limb Anatomy Exam Answers | BD Chaurasia Vol. 1 + Vishram Singh Vol. 1", sFootnote))
story.append(Paragraph("Diagrams sourced from Gray's Anatomy for Students (Elsevier). For examination use only.", sFootnote))
# ββ BUILD ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
print("Building PDF...")
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"Done! Saved to: {OUTPUT_PATH}")