Explain upper limb anatomy in one pdf
mkdir -p /home/daytona/workspace/upper-limb-anatomy && ls /home/daytona/workspac…
Where is pdf
~/upper-limb-anatomy/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
OUTPUT = "/home/daytona/workspace/upper-limb-anatomy/Upper_Limb_Anatomy.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=2*cm, leftMargin=2*cm,
topMargin=2.5*cm, bottomMargin=2.5*cm,
title="Upper Limb Anatomy",
author="Gray's Anatomy for Students"
)
styles = getSampleStyleSheet()
# Custom styles
title_style = ParagraphStyle('Title', parent=styles['Title'],
fontSize=28, textColor=colors.HexColor('#1a3c5e'), spaceAfter=6,
fontName='Helvetica-Bold', alignment=TA_CENTER)
subtitle_style = ParagraphStyle('Subtitle', parent=styles['Normal'],
fontSize=13, textColor=colors.HexColor('#2e6da4'), spaceAfter=20,
fontName='Helvetica', alignment=TA_CENTER)
h1_style = ParagraphStyle('H1', parent=styles['Heading1'],
fontSize=18, textColor=colors.white, spaceAfter=8, spaceBefore=16,
fontName='Helvetica-Bold', backColor=colors.HexColor('#1a3c5e'),
borderPad=6, leftIndent=-10, rightIndent=-10)
h2_style = ParagraphStyle('H2', parent=styles['Heading2'],
fontSize=14, textColor=colors.HexColor('#1a3c5e'), spaceAfter=6, spaceBefore=12,
fontName='Helvetica-Bold', borderPad=2,
borderColor=colors.HexColor('#2e6da4'), borderWidth=0)
h3_style = ParagraphStyle('H3', parent=styles['Heading3'],
fontSize=12, textColor=colors.HexColor('#2e6da4'), spaceAfter=4, spaceBefore=8,
fontName='Helvetica-BoldOblique')
body_style = ParagraphStyle('Body', parent=styles['Normal'],
fontSize=10, leading=15, spaceAfter=6, alignment=TA_JUSTIFY,
fontName='Helvetica')
bullet_style = ParagraphStyle('Bullet', parent=styles['Normal'],
fontSize=10, leading=14, spaceAfter=3, leftIndent=16,
bulletIndent=6, fontName='Helvetica')
note_style = ParagraphStyle('Note', parent=styles['Normal'],
fontSize=9, leading=13, spaceAfter=4,
backColor=colors.HexColor('#eaf3fb'), borderColor=colors.HexColor('#2e6da4'),
borderWidth=1, borderPad=6, fontName='Helvetica-Oblique')
def h1(text): return Paragraph(text, h1_style)
def h2(text): return Paragraph(text, h2_style)
def h3(text): return Paragraph(text, h3_style)
def body(text): return Paragraph(text, body_style)
def bullet(text): return Paragraph(f"• {text}", bullet_style)
def note(text): return Paragraph(f"<i>{text}</i>", note_style)
def sp(n=1): return Spacer(1, n*0.35*cm)
def hr(): return HRFlowable(width="100%", thickness=0.5, color=colors.HexColor('#2e6da4'), spaceAfter=4, spaceBefore=4)
def muscle_table(data, col_headers):
tdata = [col_headers] + data
t = Table(tdata, repeatRows=1, hAlign='LEFT')
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a3c5e')),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8.5),
('GRID', (0,0), (-1,-1), 0.4, colors.HexColor('#aac4de')),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor('#eaf3fb')]),
('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),
]))
return t
story = []
# ── COVER PAGE ─────────────────────────────────────────────────────────────
story += [
Spacer(1, 3*cm),
Paragraph("UPPER LIMB ANATOMY", title_style),
sp(),
Paragraph("A Comprehensive Reference Guide", subtitle_style),
hr(),
sp(2),
body("Based on Gray's Anatomy for Students | 4th Edition"),
sp(6),
Paragraph("Contents", h2_style),
sp(),
body("1. Conceptual Overview"),
body("2. Bones and Joints"),
body("3. Shoulder Region"),
body("4. Axilla"),
body("5. Brachial Plexus"),
body("6. Arm (Brachium)"),
body("7. Elbow Joint"),
body("8. Forearm"),
body("9. Wrist and Carpal Region"),
body("10. Hand"),
body("11. Nerves of the Upper Limb"),
body("12. Blood Supply"),
body("13. Clinical Correlations"),
PageBreak(),
]
# ── 1. CONCEPTUAL OVERVIEW ─────────────────────────────────────────────────
story += [
h1("1. Conceptual Overview"),
sp(),
h2("General Description"),
body("The upper limb is specialized for positioning the hand in space and enabling the hand to manipulate "
"objects. It consists of four regions: the shoulder (which attaches the limb to the trunk), the arm "
"(between the shoulder and elbow), the forearm (between the elbow and wrist), and the hand."),
sp(),
h2("Functions"),
bullet("Positioning the hand: The shoulder and elbow joints, combined with pronation/supination, allow the "
"hand to be placed in almost any spatial position."),
bullet("The hand as a mechanical tool: The hand grips and manipulates objects. Intrinsic hand muscles modify "
"the actions of long tendons from the forearm and produce precise digit movements."),
bullet("The hand as a sensory tool: The palmar fingerpads contain dense populations of sensory receptors, "
"enabling discrimination of shape, texture, temperature, and pain."),
sp(),
h2("Movements Summary"),
muscle_table([
["Shoulder (Glenohumeral)", "Flexion, Extension, Abduction, Adduction, Medial/Lateral rotation, Circumduction"],
["Elbow", "Flexion, Extension"],
["Forearm (proximal + distal radio-ulnar)", "Pronation, Supination"],
["Wrist (radiocarpal)", "Flexion, Extension, Abduction (radial dev.), Adduction (ulnar dev.), Circumduction"],
["Fingers (MCP, PIP, DIP)", "Flexion, Extension, Abduction, Adduction (at MCP)"],
["Thumb (CMC, MCP, IP)", "Flexion, Extension, Abduction, Adduction, Opposition"],
], ["Joint", "Movements"]),
PageBreak(),
]
# ── 2. BONES AND JOINTS ────────────────────────────────────────────────────
story += [
h1("2. Bones and Joints"),
sp(),
h2("Bones of the Upper Limb"),
body("The upper limb skeleton consists of 32 bones on each side, organized by region:"),
sp(),
muscle_table([
["Shoulder girdle", "Clavicle, Scapula"],
["Arm", "Humerus"],
["Forearm", "Radius (lateral), Ulna (medial)"],
["Wrist (Carpus)", "Scaphoid, Lunate, Triquetrum, Pisiform (proximal row); Trapezium, Trapezoid, Capitate, Hamate (distal row)"],
["Hand (Metacarpus)", "Metacarpals I-V"],
["Fingers (Phalanges)", "Proximal, Middle, and Distal phalanges (thumb has only proximal and distal)"],
], ["Region", "Bones"]),
sp(),
h2("Clavicle"),
body("The clavicle is an S-shaped bone that connects the upper limb to the axial skeleton at the sternoclavicular "
"joint medially, and to the scapula at the acromioclavicular joint laterally. It is subcutaneous throughout "
"its length and is the most commonly fractured bone in the body. The middle third is the narrowest and "
"most susceptible to fracture."),
sp(),
h2("Scapula"),
body("The scapula is a flat triangular bone on the posterior thoracic wall (ribs 2-7). Key features include:"),
bullet("Glenoid cavity: articulates with the head of the humerus (glenohumeral joint)"),
bullet("Coracoid process: projects anteriorly; attachment for pectoralis minor, short head of biceps, coracobrachialis"),
bullet("Acromion: projects over the glenohumeral joint; forms the acromioclavicular joint"),
bullet("Spine of scapula: posterior projection; separates supraspinous and infraspinous fossae"),
bullet("Subscapular fossa: anterior surface; origin of subscapularis"),
sp(),
h2("Humerus"),
body("The humerus is the bone of the arm. Important features:"),
bullet("Head: articulates with the glenoid cavity of the scapula"),
bullet("Greater tubercle: attachment for supraspinatus, infraspinatus, teres minor (lateral side)"),
bullet("Lesser tubercle: attachment for subscapularis (anterior)"),
bullet("Intertubercular (bicipital) groove: contains the tendon of the long head of biceps brachii"),
bullet("Surgical neck: common fracture site; at risk of injuring the axillary nerve"),
bullet("Radial (spiral) groove: transmits the radial nerve and deep brachial artery"),
bullet("Medial and lateral epicondyles: attachments for forearm muscles"),
bullet("Capitulum: articulates with the head of the radius"),
bullet("Trochlea: articulates with the trochlear notch of the ulna"),
sp(),
h2("Radius and Ulna"),
body("The radius is the lateral bone of the forearm; the ulna is medial. They articulate with each other "
"proximally at the head of radius/radial notch of ulna, and distally at the ulnar notch of radius/head "
"of ulna - allowing pronation and supination."),
bullet("Olecranon (ulna): forms the point of the elbow; insertion of triceps"),
bullet("Coronoid process (ulna): resists posterior dislocation at the elbow"),
bullet("Styloid processes: the radial styloid is longer and more distal than the ulnar styloid"),
bullet("Ulnar notch of radius + head of ulna: distal radio-ulnar joint"),
sp(),
h2("Carpal Bones"),
body("The 8 carpal bones form two rows. A useful mnemonic: "
"<b>S</b>he <b>L</b>ooks <b>T</b>oo <b>P</b>retty, <b>T</b>ry <b>T</b>o <b>C</b>atch <b>H</b>er "
"(Scaphoid, Lunate, Triquetrum, Pisiform | Trapezium, Trapezoid, Capitate, Hamate)."),
bullet("Scaphoid: most commonly fractured carpal bone; blood supply enters distally, so proximal fractures risk avascular necrosis"),
bullet("Lunate: most commonly dislocated carpal bone; can compress the median nerve"),
bullet("Pisiform: sesamoid bone within the tendon of flexor carpi ulnaris"),
bullet("Hamate: hook of hamate separates the ulnar nerve and artery at Guyon's canal"),
PageBreak(),
]
# ── 3. SHOULDER REGION ─────────────────────────────────────────────────────
story += [
h1("3. Shoulder Region"),
sp(),
h2("Glenohumeral Joint"),
body("The glenohumeral joint is a synovial ball-and-socket joint - the most mobile joint in the body, "
"sacrificing stability for range of motion. The glenoid labrum deepens the shallow glenoid cavity."),
sp(),
h3("Stabilizing Structures"),
bullet("Rotator cuff muscles (SITS): Supraspinatus, Infraspinatus, Teres minor, Subscapularis - reinforce the joint capsule superiorly, posteriorly, and anteriorly"),
bullet("Coracohumeral ligament: strengthens the superior capsule"),
bullet("Glenohumeral ligaments (superior, middle, inferior): thickenings of the anterior capsule"),
bullet("Long head of biceps brachii tendon: passes through the joint and helps hold the humeral head against the glenoid"),
sp(),
h3("Rotator Cuff Muscles (SITS)"),
muscle_table([
["Supraspinatus", "Supraspinous fossa of scapula", "Greater tubercle (superior facet)", "Suprascapular nerve (C5,C6)", "Initiates abduction (0-15°); stabilizes humeral head"],
["Infraspinatus", "Infraspinous fossa of scapula", "Greater tubercle (middle facet)", "Suprascapular nerve (C5,C6)", "Lateral rotation; stabilizes humeral head"],
["Teres Minor", "Lateral border of scapula (upper part)", "Greater tubercle (inferior facet)", "Axillary nerve (C5,C6)", "Lateral rotation; stabilizes humeral head"],
["Subscapularis", "Subscapular fossa", "Lesser tubercle", "Upper & lower subscapular nerves (C5,C6,C7)", "Medial rotation; stabilizes humeral head anteriorly"],
], ["Muscle", "Origin", "Insertion", "Nerve", "Action"]),
sp(),
h2("Acromioclavicular (AC) Joint"),
body("A plane synovial joint between the acromion and lateral clavicle. Stabilized by the acromioclavicular "
"and coracoclavicular (conoid + trapezoid) ligaments. AC joint injuries are graded I-VI by severity of "
"ligament disruption."),
sp(),
h2("Sternoclavicular (SC) Joint"),
body("The only bony articulation between the upper limb and the axial skeleton. A saddle-type synovial joint "
"with an articular disc. The costoclavicular and sternoclavicular ligaments provide stability."),
sp(),
h2("Deltoid Muscle"),
body("The deltoid has three parts arising from the clavicle, acromion, and spine of scapula, all inserting "
"into the deltoid tuberosity of the humerus. Innervated by the axillary nerve (C5, C6). The anterior "
"part flexes and medially rotates; the middle part abducts; the posterior part extends and laterally rotates."),
sp(),
note("Clinical: Axillary nerve injury (e.g., fractured surgical neck of humerus, shoulder dislocation) "
"causes loss of deltoid function (weak abduction) and a small patch of sensory loss over the 'regimental badge' area of the lateral arm."),
PageBreak(),
]
# ── 4. AXILLA ──────────────────────────────────────────────────────────────
story += [
h1("4. Axilla"),
sp(),
body("The axilla is a pyramidal space between the arm and thoracic wall - the gateway for all major "
"neurovascular structures entering the upper limb. It has four walls, an apex (inlet), and a floor (base)."),
sp(),
h2("Boundaries"),
muscle_table([
["Apex (inlet)", "Bounded by clavicle, 1st rib, superior border of scapula - communicates with neck"],
["Floor (base)", "Skin and fascia of the armpit"],
["Anterior wall", "Pectoralis major and minor, subclavius, clavipectoral fascia"],
["Posterior wall", "Subscapularis, teres major, latissimus dorsi"],
["Medial wall", "Serratus anterior overlying ribs 1-4"],
["Lateral wall", "Intertubercular groove of humerus (narrowest wall)"],
], ["Structure", "Composition"]),
sp(),
h2("Axillary Artery"),
body("The axillary artery is the continuation of the subclavian artery, beginning at the lateral border of "
"the 1st rib and ending at the lower border of teres major where it continues as the brachial artery. "
"It is divided into 3 parts by the pectoralis minor:"),
bullet("1st part (medial to pectoralis minor): 1 branch - superior thoracic artery"),
bullet("2nd part (posterior to pectoralis minor): 2 branches - thoracoacromial artery, lateral thoracic artery"),
bullet("3rd part (lateral to pectoralis minor): 3 branches - subscapular artery, anterior circumflex humeral artery, posterior circumflex humeral artery"),
sp(),
note("Mnemonic: 'She Tastes Like Candy So Sweet' - Superior thoracic, Thoracoacromial, Lateral thoracic, "
"(subscapular), anterior Circumflex humeral, posterior circumflex humeral, Subscapular."),
sp(),
h2("Axillary Vein"),
body("The axillary vein lies medial to the axillary artery. It is formed by the union of the brachial veins "
"and the basilic vein, and continues as the subclavian vein at the lateral border of rib 1."),
sp(),
h2("Spaces in the Posterior Axillary Wall"),
bullet("Quadrangular space: bounded by teres minor (superiorly), teres major (inferiorly), long head of triceps (medially), and surgical neck of humerus (laterally). Transmits: axillary nerve and posterior circumflex humeral artery."),
bullet("Triangular space (medial): bounded by teres minor, teres major, long head of triceps. Transmits: circumflex scapular artery."),
bullet("Triangular interval (lateral): bounded by teres major, long head of triceps, and shaft of humerus. Transmits: radial nerve and deep brachial (profunda brachii) artery."),
PageBreak(),
]
# ── 5. BRACHIAL PLEXUS ─────────────────────────────────────────────────────
story += [
h1("5. Brachial Plexus"),
sp(),
body("The brachial plexus is a somatic nerve network formed by the anterior rami of C5-C8 and T1. "
"It originates in the neck between the anterior and middle scalene muscles, passes over rib I, "
"and enters the axilla. It supplies the entire upper limb."),
sp(),
h2("Structure: Roots → Trunks → Divisions → Cords → Branches"),
muscle_table([
["Roots", "C5, C6, C7, C8, T1 (anterior rami)", "—"],
["Trunks", "Superior (C5+C6), Middle (C7), Inferior (C8+T1)", "In posterior cervical triangle"],
["Divisions", "Each trunk → anterior and posterior division (6 total)", "Behind clavicle"],
["Cords", "Lateral (C5-C7), Medial (C8,T1), Posterior (C5-T1)", "Related to axillary artery"],
["Branches", "Named peripheral nerves", "In axilla and beyond"],
], ["Component", "Formation", "Location"]),
sp(),
h2("Terminal Branches from Cords"),
muscle_table([
["Musculocutaneous nerve", "C5,C6,C7", "Lateral cord", "Anterior arm muscles; lateral cutaneous nerve of forearm"],
["Median nerve (lateral root)", "C6,C7", "Lateral cord", "Joins medial root to form median nerve"],
["Median nerve (medial root)", "C8,T1", "Medial cord", "Joins lateral root to form median nerve"],
["Ulnar nerve", "C7,C8,T1", "Medial cord", "Anterior forearm (FCU, medial FDP); most hand intrinsics"],
["Medial cutaneous n. of arm", "C8,T1", "Medial cord", "Skin on medial arm"],
["Medial cutaneous n. of forearm", "C8,T1", "Medial cord", "Skin on medial forearm"],
["Axillary nerve", "C5,C6", "Posterior cord", "Deltoid, teres minor; skin of lateral arm"],
["Radial nerve", "C5-T1", "Posterior cord", "Posterior arm and forearm; extensor muscles"],
], ["Nerve", "Roots", "Source", "Distribution"]),
sp(),
h2("Non-terminal Branches"),
muscle_table([
["Dorsal scapular nerve", "C5", "C5 root", "Rhomboid major, rhomboid minor, levator scapulae"],
["Long thoracic nerve", "C5,C6,C7", "Roots", "Serratus anterior"],
["Suprascapular nerve", "C5,C6", "Superior trunk", "Supraspinatus, infraspinatus"],
["Nerve to subclavius", "C5,C6", "Superior trunk", "Subclavius"],
["Lateral pectoral nerve", "C5,C6,C7", "Lateral cord", "Pectoralis major"],
["Upper subscapular nerve", "C5,C6", "Posterior cord", "Subscapularis (upper part)"],
["Thoracodorsal nerve", "C6,C7,C8", "Posterior cord", "Latissimus dorsi"],
["Lower subscapular nerve", "C5,C6", "Posterior cord", "Subscapularis (lower part), teres major"],
["Medial pectoral nerve", "C8,T1", "Medial cord", "Pectoralis major and minor"],
], ["Nerve", "Roots", "Origin", "Supply"]),
sp(),
h2("Brachial Plexus Injuries"),
h3("Upper Trunk Injury (Erb's Palsy) - C5, C6"),
body("Typically from traction on shoulder (e.g., difficult delivery, falling on shoulder). Results in "
"'Waiter's tip' posture: arm hangs adducted, medially rotated, forearm pronated, wrist flexed."),
bullet("Lost functions: shoulder abduction and lateral rotation, elbow flexion, forearm supination"),
bullet("Muscles affected: deltoid, supraspinatus, infraspinatus, biceps brachii, brachialis, brachioradialis"),
sp(),
h3("Lower Trunk Injury (Klumpke's Palsy) - C8, T1"),
body("Traction on abducted arm (e.g., grabbing an overhead structure during fall). Results in 'claw hand' "
"with loss of intrinsic hand muscles."),
bullet("Lost functions: intrinsic hand muscles, long flexors of fingers, wrist flexors"),
bullet("Horner syndrome if T1 sympathetic fibers involved (ptosis, miosis, anhidrosis)"),
PageBreak(),
]
# ── 6. ARM (BRACHIUM) ──────────────────────────────────────────────────────
story += [
h1("6. Arm (Brachium)"),
sp(),
body("The arm extends from the shoulder to the elbow. It is divided into anterior and posterior "
"compartments by the medial and lateral intermuscular septa."),
sp(),
h2("Anterior Compartment Muscles"),
muscle_table([
["Biceps Brachii", "Long head: supraglenoid tubercle\nShort head: coracoid process", "Radial tuberosity and bicipital aponeurosis", "Musculocutaneous n. (C5,C6)", "Flexes elbow; supinates forearm; weak shoulder flexion"],
["Brachialis", "Anterior surface of distal humerus (lower half)", "Tuberosity of ulna and coronoid process", "Musculocutaneous n. (C5,C6); small contribution from radial n.", "Primary elbow flexor (works in all forearm positions)"],
["Coracobrachialis", "Coracoid process", "Middle of medial surface of humeral shaft", "Musculocutaneous n. (C6,C7)", "Flexion and adduction of arm at shoulder"],
], ["Muscle", "Origin", "Insertion", "Nerve", "Action"]),
sp(),
h2("Posterior Compartment Muscles"),
muscle_table([
["Triceps Brachii (Long head)", "Infraglenoid tubercle of scapula", "Olecranon of ulna (via common tendon)", "Radial nerve (C6,C7,C8)", "Extends elbow; extends/adducts arm"],
["Triceps Brachii (Lateral head)", "Posterior surface of humerus above radial groove", "Olecranon of ulna (via common tendon)", "Radial nerve (C6,C7,C8)", "Extends elbow"],
["Triceps Brachii (Medial head)", "Posterior surface of humerus below radial groove", "Olecranon of ulna (via common tendon)", "Radial nerve (C6,C7,C8)", "Extends elbow (most active)"],
["Anconeus", "Lateral epicondyle of humerus", "Lateral surface of olecranon", "Radial nerve (C7,C8)", "Assists triceps in extension"],
], ["Muscle", "Origin", "Insertion", "Nerve", "Action"]),
sp(),
h2("Neurovascular Structures in the Arm"),
h3("Brachial Artery"),
body("The brachial artery is the continuation of the axillary artery, beginning at the lower border of "
"teres major. It runs in the medial bicipital groove medial to the biceps brachii and divides into "
"the radial and ulnar arteries at the level of the neck of the radius (elbow crease)."),
bullet("Profunda brachii (deep brachial artery): the largest branch; accompanies the radial nerve through the radial groove"),
bullet("Superior ulnar collateral artery: accompanies the ulnar nerve to the back of the medial epicondyle"),
bullet("Inferior ulnar collateral artery: part of the anastomosis around the elbow"),
sp(),
h3("Musculocutaneous Nerve"),
body("Arises from the lateral cord (C5-C7). Pierces coracobrachialis, passes between biceps and brachialis, "
"innervating all three anterior compartment muscles. Continues as the lateral cutaneous nerve of the "
"forearm."),
sp(),
h3("Radial Nerve in the Arm"),
body("Arises from the posterior cord (C5-T1). Travels with the profunda brachii artery in the radial "
"(spiral) groove on the posterior humerus. Pierces the lateral intermuscular septum and enters the "
"anterior compartment at the lateral epicondyle, dividing into superficial (sensory) and deep "
"(posterior interosseous) branches."),
note("Clinical: Holstein-Lewis fracture (distal-third humeral shaft) may trap the radial nerve in the "
"lateral intermuscular septum, causing wrist drop (inability to extend wrist and fingers)."),
PageBreak(),
]
# ── 7. ELBOW JOINT ─────────────────────────────────────────────────────────
story += [
h1("7. Elbow Joint"),
sp(),
body("The elbow is a compound synovial hinge joint consisting of three articulations within a single "
"joint capsule: the humeroulnar joint, the humeroradial joint, and the proximal radio-ulnar joint."),
sp(),
h2("Articular Surfaces"),
bullet("Trochlea of humerus ↔ Trochlear notch of ulna (humeroulnar): pure hinge, allows flexion/extension"),
bullet("Capitulum of humerus ↔ Head of radius (humeroradial): flexion/extension + rotation"),
bullet("Head of radius ↔ Radial notch of ulna (proximal RUJ): pronation/supination"),
sp(),
h2("Ligaments"),
bullet("Medial (ulnar) collateral ligament: anterior, posterior, and transverse bands; resists valgus stress; injured in throwing athletes (e.g., Tommy John injury)"),
bullet("Lateral (radial) collateral ligament: resists varus stress; blends with the anular ligament"),
bullet("Anular ligament of radius: encircles the radial head; holds it against the radial notch of ulna"),
sp(),
h2("Carrying Angle"),
body("When the elbow is fully extended and the forearm supinated, the forearm deviates laterally - this is "
"the carrying angle (normally 5-15° in males, 10-25° in females). It keeps carried objects away from "
"the thigh during walking."),
sp(),
h2("Fat Pads"),
body("Three fat pads (coronoid, radial, and olecranon fossae) lie outside the synovial membrane but inside "
"the joint capsule. Intra-articular effusion or haemarthrosis displaces these pads - visible on lateral "
"X-ray as the 'sail sign' - indicating occult fracture until proven otherwise."),
sp(),
note("Clinical: Supracondylar fracture of the humerus is the most common elbow fracture in children. "
"Anterior interosseous nerve (branch of median) and brachial artery are at risk."),
PageBreak(),
]
# ── 8. FOREARM ─────────────────────────────────────────────────────────────
story += [
h1("8. Forearm"),
sp(),
body("The forearm has anterior (flexor/pronator) and posterior (extensor/supinator) compartments separated "
"by the radius, ulna, and interosseous membrane."),
sp(),
h2("Anterior Compartment - Superficial Layer"),
muscle_table([
["Pronator Teres", "Medial epicondyle + coronoid process", "Middle of lateral radius", "Median n. (C6,C7)", "Pronation; assists elbow flexion"],
["Flexor Carpi Radialis", "Medial epicondyle", "Base of 2nd (and 3rd) metacarpal", "Median n. (C6,C7)", "Flexion + abduction of wrist"],
["Palmaris Longus", "Medial epicondyle", "Palmar aponeurosis", "Median n. (C7,C8)", "Tenses palmar aponeurosis; wrist flexion (absent in ~14%)"],
["Flexor Carpi Ulnaris", "Medial epicondyle + olecranon + posterior ulna", "Pisiform, hamate, 5th metacarpal", "Ulnar n. (C7,C8)", "Flexion + adduction of wrist"],
["Flexor Digitorum Superficialis", "Medial epicondyle, coronoid process, anterior radius", "Middle phalanges of fingers 2-5", "Median n. (C7,C8,T1)", "Flexes PIP and MCP joints"],
], ["Muscle", "Origin", "Insertion", "Nerve", "Action"]),
sp(),
h2("Anterior Compartment - Deep Layer"),
muscle_table([
["Flexor Digitorum Profundus", "Medial and anterior surfaces of ulna + interosseous membrane", "Distal phalanges of fingers 2-5", "Median n. (lateral half, AIN); Ulnar n. (medial half)", "Flexes DIP joints (only muscle to do so)"],
["Flexor Pollicis Longus", "Anterior surface of radius + interosseous membrane", "Distal phalanx of thumb", "Anterior interosseous n. (branch of median, C8,T1)", "Flexes IP joint of thumb"],
["Pronator Quadratus", "Anterior surface of distal ulna", "Anterior surface of distal radius", "Anterior interosseous n. (C8,T1)", "Primary pronator of forearm"],
], ["Muscle", "Origin", "Insertion", "Nerve", "Action"]),
sp(),
h2("Posterior Compartment - Superficial Layer"),
muscle_table([
["Brachioradialis", "Lateral supraepicondylar ridge", "Lateral surface of distal radius", "Radial n. (C5,C6)", "Flexes elbow in midpronation"],
["Extensor Carpi Radialis Longus", "Lateral supraepicondylar ridge", "Base of 2nd metacarpal", "Radial n. (C6,C7)", "Extends and abducts wrist"],
["Extensor Carpi Radialis Brevis", "Lateral epicondyle", "Base of 3rd metacarpal", "Deep branch of radial n. (C7,C8)", "Extends and abducts wrist"],
["Extensor Digitorum", "Lateral epicondyle", "Extensor expansions of fingers 2-5", "Posterior interosseous n. (C7,C8)", "Extends fingers and wrist"],
["Extensor Digiti Minimi", "Lateral epicondyle", "Extensor expansion of little finger", "Posterior interosseous n. (C7,C8)", "Extends little finger"],
["Extensor Carpi Ulnaris", "Lateral epicondyle + posterior ulna", "Base of 5th metacarpal", "Posterior interosseous n. (C7,C8)", "Extends and adducts wrist"],
], ["Muscle", "Origin", "Insertion", "Nerve", "Action"]),
sp(),
h2("Posterior Compartment - Deep Layer"),
muscle_table([
["Supinator", "Lateral epicondyle, radial collateral & anular ligaments, supinator crest of ulna", "Lateral surface of radius (proximal third)", "Deep branch of radial n. / Posterior interosseous n. (C6,C7)", "Supinates forearm"],
["Abductor Pollicis Longus", "Posterior ulna, radius, and interosseous membrane", "Base of 1st metacarpal", "Posterior interosseous n. (C7,C8)", "Abducts thumb and wrist"],
["Extensor Pollicis Brevis", "Posterior radius + interosseous membrane", "Base of proximal phalanx of thumb", "Posterior interosseous n. (C7,C8)", "Extends MCP of thumb"],
["Extensor Pollicis Longus", "Posterior ulna + interosseous membrane", "Base of distal phalanx of thumb", "Posterior interosseous n. (C7,C8)", "Extends IP and MCP of thumb"],
["Extensor Indicis", "Posterior ulna + interosseous membrane", "Extensor expansion of index finger", "Posterior interosseous n. (C7,C8)", "Extends index finger independently"],
], ["Muscle", "Origin", "Insertion", "Nerve", "Action"]),
sp(),
h2("Key Neurovascular Structures in the Forearm"),
h3("Radial Artery"),
body("Arises from the brachial artery at the level of the radial neck. Runs distally beneath "
"brachioradialis, becomes superficial near the wrist (palpable lateral to flexor carpi radialis). "
"Crosses the anatomical snuffbox and enters the palm to form the deep palmar arch."),
h3("Ulnar Artery"),
body("The larger terminal branch of the brachial artery. Passes under flexor carpi ulnaris and enters "
"the hand via Guyon's canal to form the superficial palmar arch."),
h3("Median Nerve"),
body("Enters the forearm between the two heads of pronator teres. Gives off the anterior interosseous "
"nerve (supplies FDP to index and middle fingers, FPL, pronator quadratus). Runs between FDS and "
"FDP to the wrist, then through the carpal tunnel."),
h3("Ulnar Nerve"),
body("Passes posterior to the medial epicondyle in the cubital tunnel, enters the forearm between the "
"two heads of FCU. Innervates FCU and the medial half of FDP."),
PageBreak(),
]
# ── 9. WRIST AND CARPAL REGION ─────────────────────────────────────────────
story += [
h1("9. Wrist and Carpal Region"),
sp(),
h2("Wrist (Radiocarpal) Joint"),
body("An ellipsoid synovial joint between the distal radius (and articular disc) proximally, and the "
"scaphoid, lunate, and triquetrum distally. The ulna does not articulate directly with the carpus. "
"Movements: flexion, extension, abduction (radial deviation), adduction (ulnar deviation), circumduction."),
sp(),
h2("Carpal Tunnel"),
body("The carpal tunnel is an osseofibrous tunnel bounded by the carpal bones (floor and sides) and the "
"flexor retinaculum (roof). It transmits:"),
bullet("Median nerve (most superficial and radial structure in the tunnel)"),
bullet("4 tendons of flexor digitorum superficialis"),
bullet("4 tendons of flexor digitorum profundus"),
bullet("1 tendon of flexor pollicis longus"),
body("The ulnar nerve and artery do NOT pass through the carpal tunnel - they pass through Guyon's canal."),
sp(),
note("Clinical: Carpal Tunnel Syndrome (CTS) - median nerve compression causing pain, paresthesia, "
"and numbness in the lateral 3.5 digits. Thenar wasting in severe/chronic cases. Tests: Phalen's "
"sign (wrist flexion for 60s reproduces symptoms), Tinel's sign (tapping over tunnel). More common "
"in pregnancy, hypothyroidism, rheumatoid arthritis, diabetes."),
sp(),
h2("Anatomical Snuffbox"),
body("A triangular depression visible on the dorsolateral wrist when the thumb is extended:"),
bullet("Lateral border: tendons of abductor pollicis longus and extensor pollicis brevis"),
bullet("Medial border: tendon of extensor pollicis longus"),
bullet("Floor: scaphoid and trapezium"),
bullet("Contents: radial artery (deep), terminal branches of superficial radial nerve (superficial), origin of cephalic vein"),
sp(),
note("Clinical: Tenderness in the anatomical snuffbox after a fall on an outstretched hand suggests "
"scaphoid fracture, even if X-ray is initially normal. MRI or CT should be obtained if clinical "
"suspicion is high due to the risk of avascular necrosis."),
PageBreak(),
]
# ── 10. HAND ───────────────────────────────────────────────────────────────
story += [
h1("10. Hand"),
sp(),
h2("Palmar Fascia and Spaces"),
body("The palmar aponeurosis is a triangular, dense connective tissue sheet covering the palm. It is "
"continuous with the palmaris longus tendon proximally and divides into four digital slips distally. "
"Dupuytren's contracture involves fibrotic nodules and cords in the palmar aponeurosis, causing "
"progressive flexion deformity of the ring and little fingers."),
sp(),
h2("Thenar Muscles (Thumb)"),
muscle_table([
["Abductor Pollicis Brevis", "Flexor retinaculum, scaphoid, trapezium", "Lateral base of proximal phalanx of thumb", "Recurrent branch of median n. (C8,T1)", "Abducts thumb"],
["Flexor Pollicis Brevis", "Flexor retinaculum and trapezium", "Lateral base of proximal phalanx of thumb", "Recurrent branch of median n. (C8,T1)", "Flexes MCP of thumb"],
["Opponens Pollicis", "Flexor retinaculum and trapezium", "Lateral border of 1st metacarpal", "Recurrent branch of median n. (C8,T1)", "Opposition of thumb (most important thenar action)"],
["Adductor Pollicis", "Two heads: oblique (capitate, bases of 2nd and 3rd metacarpals) and transverse (3rd metacarpal shaft)", "Medial base of proximal phalanx of thumb", "Deep branch of ulnar n. (C8,T1)", "Adducts thumb"],
], ["Muscle", "Origin", "Insertion", "Nerve", "Action"]),
sp(),
h2("Hypothenar Muscles (Little Finger)"),
muscle_table([
["Abductor Digiti Minimi", "Pisiform and pisohamate ligament", "Medial base of proximal phalanx of little finger", "Deep branch of ulnar n. (C8,T1)", "Abducts little finger"],
["Flexor Digiti Minimi Brevis", "Hook of hamate, flexor retinaculum", "Medial base of proximal phalanx of little finger", "Deep branch of ulnar n. (C8,T1)", "Flexes MCP of little finger"],
["Opponens Digiti Minimi", "Hook of hamate, flexor retinaculum", "Medial border of 5th metacarpal", "Deep branch of ulnar n. (C8,T1)", "Opposes little finger toward thumb"],
], ["Muscle", "Origin", "Insertion", "Nerve", "Action"]),
sp(),
h2("Lumbricals (4)"),
body("Origin: tendons of flexor digitorum profundus. Insertion: lateral bands of extensor expansions. "
"Nerves: Lumbricals 1 & 2 = median nerve; Lumbricals 3 & 4 = deep ulnar nerve. "
"Function: flex MCP joints while extending IP joints (key for writing position)."),
sp(),
h2("Interossei"),
body("There are 4 dorsal and 3 palmar interossei, all innervated by the deep branch of the ulnar nerve (C8, T1)."),
bullet("Dorsal interossei (DAB): abduct fingers from the middle finger axis"),
bullet("Palmar interossei (PAD): adduct fingers toward the middle finger axis"),
bullet("Both groups flex MCP and extend IP joints (via extensor expansions)"),
sp(),
h2("Palmar Arches"),
h3("Superficial Palmar Arch"),
body("Formed mainly by the ulnar artery, with a contribution from the superficial palmar branch of the "
"radial artery. Lies deep to the palmar aponeurosis. Gives rise to the common palmar digital arteries."),
h3("Deep Palmar Arch"),
body("Formed mainly by the radial artery (entering the palm via the 1st dorsal interosseous space), "
"with a contribution from the deep palmar branch of the ulnar artery. Lies deep to the long flexor "
"tendons. Gives rise to the palmar metacarpal arteries."),
PageBreak(),
]
# ── 11. NERVES OF THE UPPER LIMB ───────────────────────────────────────────
story += [
h1("11. Nerves of the Upper Limb"),
sp(),
h2("Median Nerve - 'The Labourer's Nerve'"),
body("Formed by roots from both lateral (C6,C7) and medial (C8,T1) cords. Has no branches in the arm."),
muscle_table([
["Forearm", "Pronator teres, FCR, Palmaris longus, FDS (all via main trunk)", "Median n. (C7,C8,T1)"],
["Deep forearm (AIN)", "FDP (lateral half), FPL, Pronator quadratus", "Anterior interosseous n."],
["Hand (recurrent branch)", "Abductor pollicis brevis, Opponens pollicis, Flexor pollicis brevis (superficial head)", "Recurrent branch (C8,T1)"],
["Hand (digital branches)", "Lumbricals 1 and 2", "Common palmar digital branches"],
], ["Region", "Muscles Supplied", "Branch"]),
body("Sensory: lateral 3.5 digits (palmar), nail beds of index/middle/lateral ring finger."),
sp(),
note("Injury at wrist (carpal tunnel): loss of thenar muscles (ape thumb deformity/flat palm), sensory loss "
"in lateral 3.5 fingers. Injury at elbow: above + loss of forearm flexors, pronators; 'hand of benediction' "
"on attempted fist (index/middle fingers cannot flex at IP joints)."),
sp(),
h2("Ulnar Nerve - 'The Musician's Nerve'"),
body("Formed from medial cord (C7,C8,T1). Passes behind medial epicondyle in cubital tunnel."),
muscle_table([
["Forearm", "FCU, FDP (medial half: ring and little)", "Main trunk"],
["Hand (superficial branch)", "Skin of little finger and medial ring finger", "Sensory"],
["Hand (deep branch)", "Hypothenar muscles, Lumbricals 3 & 4, All interossei, Adductor pollicis, FPB (deep head)", "Deep branch"],
], ["Region", "Supply", "Branch"]),
sp(),
note("Injury at elbow: loss of hypothenar, interossei, medial lumbricals, adductor pollicis; ring and little "
"finger clawing ('ring-little claw hand'); weak grip; Froment's sign (thumb IP flexes with adductor pollicis "
"loss). Injury at wrist: same but MORE clawing of ring and little (lumbricals intact = 'ulnar paradox')."),
sp(),
h2("Radial Nerve - 'The Extensor Nerve'"),
body("Largest branch of posterior cord (C5-T1). Descends spiral groove on posterior humerus."),
muscle_table([
["Arm", "Triceps, anconeus, brachioradialis, ECRL", "Main trunk in radial groove"],
["Forearm (superficial branch)", "Sensory: lateral dorsum of hand, lateral 3.5 digits (proximal)", "No muscular supply"],
["Forearm (deep branch / PIN)", "ECRB, Supinator, ED, EDM, ECU, APL, EPB, EPL, EI", "Posterior interosseous n."],
], ["Region", "Supply", "Branch"]),
sp(),
note("High radial nerve injury (axilla/arm): 'wrist drop' - cannot extend wrist or fingers; weakened elbow "
"flexion (brachioradialis). Posterior interosseous nerve injury: cannot extend fingers but wrist extension "
"preserved (ECRL intact as it comes off radial nerve before PIN split)."),
sp(),
h2("Musculocutaneous Nerve"),
body("From lateral cord (C5,C6,C7). Pierces coracobrachialis, then passes between biceps brachii and brachialis. "
"Innervates all three anterior arm muscles. Continues as the lateral cutaneous nerve of the forearm "
"(sensory to lateral forearm)."),
sp(),
h2("Axillary Nerve"),
body("From posterior cord (C5,C6). Exits through the quadrangular space with the posterior circumflex humeral "
"artery. Wraps around the surgical neck of the humerus (vulnerable in surgical neck fractures and anterior "
"shoulder dislocations). Innervates deltoid and teres minor. Sensory: 'regimental badge' area of lateral arm."),
PageBreak(),
]
# ── 12. BLOOD SUPPLY ───────────────────────────────────────────────────────
story += [
h1("12. Blood Supply"),
sp(),
h2("Arterial Supply Overview"),
body("The upper limb is supplied by the subclavian artery, which becomes the axillary artery at the lateral "
"border of the 1st rib, then the brachial artery at the lower border of teres major. The brachial artery "
"divides at the radial neck into the radial and ulnar arteries."),
sp(),
muscle_table([
["Subclavian a.", "Aorta (left)/Brachiocephalic trunk (right)", "Lateral border of 1st rib"],
["Axillary a.", "Lateral border of 1st rib", "Lower border of teres major"],
["Brachial a.", "Lower border of teres major", "Level of radial neck (bifurcation)"],
["Radial a.", "Brachial a. bifurcation", "Deep palmar arch (primarily)"],
["Ulnar a.", "Brachial a. bifurcation", "Superficial palmar arch (primarily)"],
], ["Artery", "Origin", "Continues as / Ends at"]),
sp(),
h2("Venous Drainage"),
h3("Deep Veins"),
body("Follow the arteries as venae comitantes, ultimately draining into the axillary vein."),
h3("Superficial Veins"),
muscle_table([
["Cephalic vein", "Lateral dorsal venous network of hand → lateral forearm → lateral arm → deltopectoral groove → cephalic vein enters axillary vein"],
["Basilic vein", "Medial dorsal venous network → medial forearm → medial arm → pierces deep fascia mid-arm → joins brachial vein → becomes axillary vein"],
["Median cubital vein", "Connects cephalic and basilic in the cubital fossa - commonly used for venipuncture"],
], ["Vein", "Course"]),
sp(),
h2("Cubital Fossa"),
body("The cubital fossa is a triangular depression anterior to the elbow. Its contents (medial to lateral): "
"Tendon, Artery, Nerve (TAN)."),
bullet("Boundaries: laterally by brachioradialis, medially by pronator teres, roof by bicipital aponeurosis and skin, floor by brachialis and supinator"),
bullet("Contents (lateral to medial): Radial nerve, Biceps tendon, Brachial artery (and its bifurcation), Median nerve"),
note("Mnemonic: 'Really Be Nice' (Radial nerve, Biceps tendon, brachial artery aNd vein) - or simply 'TAN' medial to lateral (Tendon, Artery, Nerve)."),
PageBreak(),
]
# ── 13. CLINICAL CORRELATIONS ──────────────────────────────────────────────
story += [
h1("13. Clinical Correlations"),
sp(),
h2("Nerve Injury Summary"),
muscle_table([
["Axillary n. (C5,C6)", "Surgical neck fracture, anterior dislocation", "Deltoid weakness (abduction 15-90°), sensory loss lateral arm"],
["Musculocutaneous n. (C5-C7)", "Coracoid process surgery", "Weak elbow flexion (biceps/brachialis), sensory loss lateral forearm"],
["Radial n. (C5-T1) - arm", "Humeral shaft (spiral groove) fracture, crutch palsy, Saturday night palsy", "Wrist drop, finger drop, weakened supination; sensory loss lateral dorsal hand"],
["Posterior interosseous n. (C7,C8)", "Radial head fracture, compression by supinator", "Finger drop (no wrist drop); no sensory loss"],
["Median n. (C6-T1) - wrist", "Carpal tunnel syndrome", "Thenar wasting, sensory loss lateral 3.5 fingers; Tinel's/Phalen's +ve"],
["Median n. - elbow", "Supracondylar fracture", "Pronator, FDS loss + above"],
["Anterior interosseous n.", "Forearm compression", "Cannot pinch: FPL + FDP index/middle fail (no OK sign)"],
["Ulnar n. - elbow", "Cubital tunnel syndrome, medial epicondyle fracture", "Claw hand (ring+little), Froment's sign, weakness grip and pinch"],
["Ulnar n. - wrist", "Guyon's canal (cyclist's palsy)", "Same as elbow but more clawing (ulnar paradox); palmar sensation intact"],
["Long thoracic n. (C5-C7)", "Mastectomy, serratus anterior injury", "Winged scapula"],
], ["Nerve", "Common Cause", "Deficit"]),
sp(),
h2("Shoulder Pathology"),
h3("Rotator Cuff Tears"),
body("Supraspinatus is the most commonly torn rotator cuff tendon (at the critical zone - 1 cm from insertion, "
"where blood supply is poorest). Presents with painful arc (60-120°) and weakness of abduction."),
h3("Shoulder Dislocation"),
body("Anterior dislocation (95% of all dislocations): usually subcoracoid. Axillary nerve is at risk. "
"Bankart lesion (glenoid labrum tear) and Hill-Sachs lesion (humeral head compression fracture) may result."),
sp(),
h2("Fractures"),
muscle_table([
["Clavicle", "Middle third most common; FOOSH or direct blow", "Brachial plexus, subclavian vessels (rare)"],
["Surgical neck humerus", "Elderly, osteoporotic; FOOSH", "Axillary nerve, posterior circumflex humeral a."],
["Supracondylar humerus", "Children, FOOSH with hyperextension", "Anterior interosseous n., brachial a. (Volkmann's ischemia)"],
["Lateral epicondyle", "Children avulsion fracture", "Posterior interosseous nerve"],
["Scaphoid", "FOOSH; snuffbox tenderness", "Avascular necrosis of proximal fragment (25-30% of cases)"],
["Colles' fracture", "Distal radius: FOOSH in elderly", "Median nerve; 'dinner fork' deformity"],
["Smith's fracture", "Distal radius: fall on flexed wrist (reverse Colles)", "Volar angulation/displacement"],
], ["Fracture", "Mechanism", "Complication"]),
sp(),
h2("Elbow Conditions"),
bullet("Tennis elbow (lateral epicondylitis): extensor carpi radialis brevis tendinopathy at lateral epicondyle; pain with wrist extension and grip"),
bullet("Golfer's elbow (medial epicondylitis): flexor-pronator origin; pain with wrist flexion"),
bullet("Cubital tunnel syndrome: ulnar nerve compression at medial epicondyle; ring/little finger numbness and claw deformity"),
bullet("Pulled elbow (radial head subluxation): in children <5 years; sudden traction on extended elbow; anular ligament tears and radial head slips"),
sp(),
h2("Dupuytren's Contracture"),
body("Progressive fibrosis of the palmar aponeurosis leading to MCP flexion deformity of the ring and "
"little fingers. Associated with diabetes, alcoholism, smoking, and epilepsy. Treatment: collagenase "
"injection (Clostridium histolyticum) or surgical fasciectomy."),
sp(),
Paragraph("Source: Gray's Anatomy for Students, 4th Edition | Orris Medical Library",
ParagraphStyle('Footer', parent=styles['Normal'], fontSize=8,
textColor=colors.HexColor('#888888'), alignment=TA_CENTER)),
]
doc.build(story)
print("PDF created successfully:", OUTPUT)
cd /home/daytona/workspace/upper-limb-anatomy && python generate_pdf.py
ls -lh /home/daytona/workspace/upper-limb-anatomy/Upper_Limb_Anatomy.pdf
Upper Limb Anatomy
PDF Document · PDF
| Section | Content |
|---|---|
| 1 | Conceptual Overview - movements and functions |
| 2 | Bones and Joints - clavicle, scapula, humerus, radius, ulna, carpals |
| 3 | Shoulder Region - glenohumeral joint, rotator cuff (SITS), AC/SC joints |
| 4 | Axilla - boundaries, axillary artery (3 parts + 6 branches), quadrangular/triangular spaces |
| 5 | Brachial Plexus - roots→trunks→divisions→cords→branches, Erb's and Klumpke's palsy |
| 6 | Arm - anterior/posterior compartment muscles, brachial artery, radial/musculocutaneous nerves |
| 7 | Elbow Joint - articulations, ligaments, carrying angle, fat pad signs |
| 8 | Forearm - all 20 muscles in layered tables with origins, insertions, nerves, actions |
| 9 | Wrist and Carpal Region - radiocarpal joint, carpal tunnel contents, anatomical snuffbox |
| 10 | Hand - thenar/hypothenar muscles, lumbricals, interossei, palmar arches |
| 11 | Nerves - median, ulnar, radial, musculocutaneous, axillary nerve distributions |
| 12 | Blood Supply - arterial chain, superficial veins (cephalic/basilic), cubital fossa |
| 13 | Clinical Correlations - nerve injury table, fractures, shoulder pathology, Dupuytren's |
Not like this give me pdf with images and very simplified which iwill be sufficient for my fmge prepration and also easy to revise
Fast
~/upper-limb-anatomy/fmge_upper_limb.py
import requests, io
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, Image, KeepTogether)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
W, H = A4
OUT = "/home/daytona/workspace/upper-limb-anatomy/FMGE_Upper_Limb_Anatomy.pdf"
doc = SimpleDocTemplate(OUT, pagesize=A4,
rightMargin=1.8*cm, leftMargin=1.8*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="Upper Limb Anatomy – FMGE Quick Revision")
# ── styles ────────────────────────────────────────────────────────────────
ss = getSampleStyleSheet()
def S(name, **kw): return ParagraphStyle(name, parent=ss['Normal'], **kw)
COVER_TITLE = S('ct', fontSize=32, textColor=colors.HexColor('#0d3b66'),
fontName='Helvetica-Bold', alignment=TA_CENTER, spaceAfter=4)
COVER_SUB = S('cs', fontSize=14, textColor=colors.HexColor('#2196a6'),
fontName='Helvetica', alignment=TA_CENTER, spaceAfter=8)
H1 = S('h1', fontSize=17, textColor=colors.white, fontName='Helvetica-Bold',
backColor=colors.HexColor('#0d3b66'), spaceBefore=14, spaceAfter=6,
leftIndent=-6, rightIndent=-6, borderPad=5)
H2 = S('h2', fontSize=13, textColor=colors.HexColor('#0d3b66'),
fontName='Helvetica-Bold', spaceBefore=10, spaceAfter=4,
borderColor=colors.HexColor('#2196a6'), borderWidth=0)
H3 = S('h3', fontSize=11, textColor=colors.HexColor('#2196a6'),
fontName='Helvetica-Bold', spaceBefore=7, spaceAfter=3)
BODY = S('bd', fontSize=9.5, leading=14, spaceAfter=4, alignment=TA_JUSTIFY)
BUL = S('bl', fontSize=9.5, leading=14, spaceAfter=3, leftIndent=14)
MNE = S('mn', fontSize=9.5, leading=14, spaceAfter=4,
backColor=colors.HexColor('#fff8dc'), borderColor=colors.HexColor('#f0b429'),
borderWidth=1, borderPad=5, fontName='Helvetica-Oblique')
RED = S('rd', fontSize=9.5, leading=14, spaceAfter=4,
backColor=colors.HexColor('#fff0f0'), borderColor=colors.HexColor('#e53935'),
borderWidth=1, borderPad=5)
TIP = S('tp', fontSize=9.5, leading=14, spaceAfter=4,
backColor=colors.HexColor('#e8f5e9'), borderColor=colors.HexColor('#43a047'),
borderWidth=1, borderPad=5)
CAPTION = S('cap', fontSize=8, textColor=colors.HexColor('#555555'),
alignment=TA_CENTER, spaceAfter=4)
FOOT = S('ft', fontSize=7.5, textColor=colors.HexColor('#999999'), alignment=TA_CENTER)
def h1(t): return Paragraph(t, H1)
def h2(t): return Paragraph(t, H2)
def h3(t): return Paragraph(t, H3)
def body(t): return Paragraph(t, BODY)
def bul(t): return Paragraph(f"<b>•</b> {t}", BUL)
def mne(t): return Paragraph(f"🔑 <i>{t}</i>", MNE)
def red(t): return Paragraph(f"⚠️ {t}", RED)
def tip(t): return Paragraph(f"✅ {t}", TIP)
def sp(n=1): return Spacer(1, n*0.3*cm)
def hr(): return HRFlowable(width="100%", thickness=0.5,
color=colors.HexColor('#2196a6'), spaceAfter=4, spaceBefore=4)
# ── helper: download image ────────────────────────────────────────────────
def img(url, w=14*cm, caption=None):
items = []
try:
r = requests.get(url, timeout=8)
if r.status_code == 200:
im = Image(io.BytesIO(r.content), width=w)
im.hAlign = 'CENTER'
items.append(im)
if caption:
items.append(Paragraph(caption, CAPTION))
except Exception:
pass
return items
# ── table helper ─────────────────────────────────────────────────────────
def tbl(data, hdrs, col_widths=None):
rows = [hdrs] + data
t = Table(rows, colWidths=col_widths, repeatRows=1, hAlign='LEFT')
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#0d3b66')),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8.5),
('GRID', (0,0), (-1,-1), 0.35, colors.HexColor('#b0c4d8')),
('ROWBACKGROUNDS',(0,1),(-1,-1),[colors.white, colors.HexColor('#eaf4fb')]),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('LEFTPADDING', (0,0), (-1,-1), 4),
('RIGHTPADDING',(0,0), (-1,-1), 4),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING',(0,0),(-1,-1), 3),
]))
return t
# ─────────────────────────────────────────────────────────────────────────
story = []
# ══ COVER ════════════════════════════════════════════════════════════════
story += [
Spacer(1,2.5*cm),
Paragraph("UPPER LIMB ANATOMY", COVER_TITLE),
Paragraph("FMGE High-Yield Quick Revision Notes", COVER_SUB),
hr(),
sp(),
Paragraph("Based on Gray's Anatomy for Students", FOOT),
sp(2),
# overview image
*img("https://cdn.orris.care/cdss_images/77820220c0f9f7dcfe531c0d01fa78a1eb5252b5fc759e4742ac4148851fde01.png",
w=12*cm, caption="Fig. Movements of the Glenohumeral Joint"),
sp(2),
Paragraph("WHAT'S INSIDE", H2),
tbl([
["1","Bones & Joints – Clavicle, Scapula, Humerus, Radius, Ulna, Carpals"],
["2","Shoulder – Rotator Cuff, AC joint, Glenohumeral joint"],
["3","Axilla – Walls, Axillary Artery, Spaces"],
["4","Brachial Plexus – Full diagram + Injuries (Erb's / Klumpke's)"],
["5","Arm Muscles – Anterior & Posterior compartment"],
["6","Elbow Joint – Ligaments, Fat pad sign, Fractures"],
["7","Forearm Muscles – Flexors & Extensors"],
["8","Wrist & Carpal Tunnel – CTS, Snuffbox"],
["9","Hand – Thenar, Hypothenar, Lumbricals, Interossei"],
["10","Nerve Injuries – High-yield FMGE table"],
["11","Dermatomes & Reflexes"],
["12","High-Yield Clinical Pearls"],
], ["#","Topic"], col_widths=[0.6*cm, 14.8*cm]),
PageBreak(),
]
# ══ 1. BONES ════════════════════════════════════════════════════════════
story += [
h1("1. BONES OF THE UPPER LIMB"),
sp(),
*img("https://cdn.orris.care/cdss_images/87c09cdf6b2fe14c44bc5abc4a4225cb2b57556ee103b22a9004f2030cc1f363.png",
w=13*cm, caption="Fig. Muscles of Back & Shoulder Girdle"),
sp(),
h2("Key FMGE Facts – Bones"),
tbl([
["Clavicle","Most commonly fractured bone in body","Middle 1/3 – narrowest part"],
["Scaphoid","Most commonly fractured carpal","AVN of proximal fragment (25–30%)"],
["Lunate","Most commonly dislocated carpal","Can compress median nerve"],
["Pisiform","Sesamoid bone in FCU tendon","Only carpal without direct blood supply"],
["Surgical neck humerus","Most common site of # in adults","Axillary nerve injured"],
["Supracondylar humerus","Most common elbow # in children","Anterior interosseous n. + brachial a."],
], ["Bone","Clinical Relevance","Complication"],
col_widths=[3.5*cm, 6.5*cm, 5.4*cm]),
sp(),
mne("Carpal bones (proximal→distal, lateral→medial):\n"
"\"She Looks Too Pretty, Try To Catch Her\"\n"
"Scaphoid · Lunate · Triquetrum · Pisiform | Trapezium · Trapezoid · Capitate · Hamate"),
sp(),
h2("Muscle Attachments – Quick Recall"),
tbl([
["Greater tubercle","Supraspinatus (top) · Infraspinatus (mid) · Teres minor (bottom) → SIT"],
["Lesser tubercle","Subscapularis"],
["Coracoid process","Short head biceps + Coracobrachialis + Pectoralis minor → BCP"],
["Medial epicondyle","Flexor-pronator group (all 5 superficial anterior forearm muscles)"],
["Lateral epicondyle","Extensor-supinator group"],
["Olecranon","Triceps brachii (main extensor of elbow)"],
], ["Site","Attachments"], col_widths=[4*cm, 11.4*cm]),
PageBreak(),
]
# ══ 2. SHOULDER ════════════════════════════════════════════════════════
story += [
h1("2. SHOULDER REGION"),
sp(),
h2("Rotator Cuff – SITS"),
tbl([
["Supraspinatus","Supraspinous fossa","Greater tubercle (top)","Suprascapular n. C5,C6","Initiates abduction 0–15°"],
["Infraspinatus","Infraspinous fossa","Greater tubercle (mid)","Suprascapular n. C5,C6","Lateral rotation"],
["Teres Minor","Lat border scapula","Greater tubercle (bot)","Axillary n. C5,C6","Lateral rotation"],
["Subscapularis","Subscapular fossa","Lesser tubercle","Upper/lower subscapular n. C5,C6","Medial rotation"],
], ["Muscle","Origin","Insertion","Nerve","Action"],
col_widths=[3.2*cm, 3.2*cm, 3.2*cm, 3*cm, 2.8*cm]),
sp(),
red("FMGE FAVOURITE: Supraspinatus is the most commonly torn rotator cuff tendon.\n"
"Painful arc = 60°–120° of abduction. Tear at 'critical zone' (1 cm from insertion) due to poor blood supply."),
sp(),
h2("Glenohumeral Joint"),
bul("Type: Ball & socket synovial – most mobile joint in body"),
bul("Glenoid labrum deepens the shallow socket"),
bul("Anterior dislocation (95%): humeral head moves subcoracoid → Bankart lesion (labrum) + Hill-Sachs lesion (humeral head)"),
bul("Axillary nerve at risk in anterior dislocation AND surgical neck fracture"),
sp(),
*img("https://cdn.orris.care/cdss_images/35c017ea8c58d74a559bbaff5922f78bff6a5a25c4a615b78b91ef0e4209a88d.png",
w=11*cm, caption="Fig. Pectoral Region"),
sp(),
tip("Carrying angle = 5–15° males, 10–25° females. Cubitus valgus (increased) → Tardy ulnar nerve palsy."),
PageBreak(),
]
# ══ 3. AXILLA ═══════════════════════════════════════════════════════════
story += [
h1("3. AXILLA"),
sp(),
*img("https://cdn.orris.care/cdss_images/033de7e484a1c5e2491269317207378d8640837bc0c4d2d4b3bcf778dc339a5c.png",
w=13*cm, caption="Fig. Axilla – Walls, Floor, Apex"),
sp(),
h2("Axillary Artery – 3 Parts & Branches"),
mne("Mnemonic: \"1 She, 2 Tastes, 3 Lovers\"\n"
"Part 1 (medial to pec minor): 1 branch → Superior thoracic\n"
"Part 2 (behind pec minor): 2 branches → Thoracoacromial, Lateral thoracic\n"
"Part 3 (lateral to pec minor): 3 branches → Subscapular, Ant. circumflex humeral, Post. circumflex humeral"),
sp(),
h2("Gaps in Posterior Axillary Wall"),
tbl([
["Quadrangular space","Teres minor / Teres major / Long head triceps / Humerus","Axillary nerve + Post. circumflex humeral a."],
["Triangular space (medial)","Teres minor / Teres major / Long head triceps","Circumflex scapular a."],
["Triangular interval (lateral)","Teres major / Long head triceps / Humerus","Radial nerve + Profunda brachii a."],
], ["Space","Boundaries","Contents"],
col_widths=[3.5*cm, 7*cm, 5*cm]),
red("Quadrangular space syndrome → axillary nerve compression → deltoid wasting + sensory loss lateral arm ('regimental badge area')."),
PageBreak(),
]
# ══ 4. BRACHIAL PLEXUS ══════════════════════════════════════════════════
story += [
h1("4. BRACHIAL PLEXUS"),
sp(),
*img("https://cdn.orris.care/cdss_images/42e3982ca738d0e6877cc67f524d1fbfcf9d635fdfed6e0372f6519623416ef7.png",
w=13*cm, caption="Fig. Brachial Plexus – Components in Neck & Axilla"),
sp(),
*img("https://cdn.orris.care/cdss_images/62ef9714975a8ea1509371bbecc736c66c2fdd7a02df72fb8141a511a0a08af2.png",
w=13*cm, caption="Fig. Brachial Plexus Schematic – Roots → Trunks → Divisions → Cords → Branches"),
sp(),
mne("Remember: \"Robert Taylor Drinks Cold Beer\"\nRoots · Trunks · Divisions · Cords · Branches"),
sp(),
h2("Roots → Trunks"),
tbl([
["Superior trunk","C5 + C6"],
["Middle trunk","C7 alone"],
["Inferior trunk","C8 + T1"],
], ["Trunk","Roots"], col_widths=[7*cm, 8.4*cm]),
sp(),
h2("Cords → Key Terminal Branches"),
tbl([
["Lateral cord (C5–C7)","Musculocutaneous n., Lateral root of median n., Lateral pectoral n."],
["Medial cord (C8,T1)","Ulnar n., Medial root of median n., Medial cutaneous n. arm/forearm, Medial pectoral n."],
["Posterior cord (C5–T1)","Axillary n., Radial n., Thoracodorsal n., Subscapular n. (upper/lower)"],
], ["Cord","Branches"], col_widths=[4.5*cm, 11*cm]),
sp(),
h2("Brachial Plexus Injuries – FMGE Favourites"),
tbl([
["Erb's Palsy (C5,C6)","Upper trunk","Difficult delivery (shoulder traction)","Waiter's tip – arm adducted, medially rotated, forearm pronated, wrist flexed"],
["Klumpke's Palsy (C8,T1)","Lower trunk","Grabbing overhead (upward traction)","Claw hand + Horner's syndrome (if T1 sympathetics involved)"],
["Long thoracic n. (C5–C7)","Root","Mastectomy, 1st rib fracture, carrying heavy loads","Winged scapula (serratus anterior palsy)"],
], ["Injury","Level","Cause","Sign"],
col_widths=[3.5*cm, 2.5*cm, 4*cm, 5.4*cm]),
sp(),
*img("https://cdn.orris.care/cdss_images/2d1e124866bcf5ef44fe04881ee3568b0ed579f0f211fa7c979d830bd74fde4d.png",
w=13*cm, caption="Fig. Brachial Plexus Branches Schematic"),
PageBreak(),
]
# ══ 5. ARM ═══════════════════════════════════════════════════════════════
story += [
h1("5. ARM MUSCLES"),
sp(),
h2("Anterior Compartment (Flexors) – Musculocutaneous nerve"),
tbl([
["Biceps Brachii","Long head: supraglenoid tubercle\nShort head: coracoid process","Radial tuberosity + bicipital aponeurosis","Flexes elbow + SUPINATES forearm (most powerful supinator)"],
["Brachialis","Anterior shaft of humerus (lower half)","Tuberosity of ulna","Primary elbow flexor – works in ALL positions"],
["Coracobrachialis","Coracoid process","Medial shaft humerus","Flexes + adducts arm"],
], ["Muscle","Origin","Insertion","Action"],
col_widths=[3.5*cm, 4.5*cm, 4*cm, 3.4*cm]),
sp(),
tip("Musculocutaneous nerve pierces coracobrachialis → continues as LATERAL CUTANEOUS NERVE OF FOREARM."),
sp(),
h2("Posterior Compartment (Extensors) – Radial nerve"),
tbl([
["Triceps (3 heads)","Long: infraglenoid\nLateral: above radial groove\nMedial: below radial groove","Olecranon","Extends elbow; long head also extends arm"],
["Anconeus","Lateral epicondyle","Lateral olecranon","Assists triceps"],
], ["Muscle","Origin","Insertion","Action"],
col_widths=[3.5*cm, 5*cm, 3.5*cm, 3.4*cm]),
sp(),
red("Radial nerve in spiral groove – injured in humeral shaft fracture (Holstein-Lewis #) → WRIST DROP.\n"
"Profunda brachii artery accompanies the radial nerve in the radial groove."),
sp(),
h2("Cubital Fossa"),
body("Triangular depression anterior to elbow. Contents (medial → lateral):"),
mne("Mnemonic: \"My Brother Rocks\" = Median nerve · Brachial artery · (biceps) tendon · Radial nerve\n"
"Or simply: TAN (Tendon · Artery · Nerve) lateral to medial"),
bul("Floor: brachialis + supinator"),
bul("Roof: bicipital aponeurosis + skin"),
PageBreak(),
]
# ══ 6. ELBOW JOINT ═════════════════════════════════════════════════════
story += [
h1("6. ELBOW JOINT"),
sp(),
*img("https://cdn.orris.care/cdss_images/41b9543562fe01cf8e4c82e6775d4012dc514e84f2353c38fb0bcea93400de5a.png",
w=13*cm, caption="Fig. Elbow – Synovial Membrane, Fat Pads, Annular Ligament"),
sp(),
*img("https://cdn.orris.care/cdss_images/b4af2698474cb9ebe80b05582f15677b225cece10e6906c2599e3cf0e8146881.png",
w=13*cm, caption="Fig. Elbow Ligaments & MRI"),
sp(),
h2("3 Joints in 1 Capsule"),
tbl([
["Humeroulnar","Trochlea ↔ Trochlear notch of ulna","Hinge – flexion/extension"],
["Humeroradial","Capitulum ↔ Head of radius","Hinge + rotation"],
["Proximal radio-ulnar","Head radius ↔ Radial notch of ulna","Pronation/supination"],
], ["Joint","Articulation","Movement"],
col_widths=[4*cm, 6*cm, 5.4*cm]),
sp(),
h2("Ligaments"),
bul("Medial (ulnar) collateral ligament → resists VALGUS stress → torn in throwing athletes ('Tommy John injury')"),
bul("Lateral (radial) collateral ligament → resists VARUS stress"),
bul("Anular ligament of radius → holds radial head in radial notch"),
sp(),
red("FAT PAD SIGN (Sail sign on lateral X-ray) → posterior fat pad visible = intra-articular effusion → occult fracture until proven otherwise.\n"
"Most common elbow # in children = SUPRACONDYLAR (risk: brachial artery + AIN palsy = no 'OK sign')."),
sp(),
tip("Pulled elbow (Nursemaid's elbow): radial head subluxation in children < 5 yrs from sudden arm traction. Anular ligament slips over radial head."),
PageBreak(),
]
# ══ 7. FOREARM ══════════════════════════════════════════════════════════
story += [
h1("7. FOREARM MUSCLES"),
sp(),
*img("https://cdn.orris.care/cdss_images/102f3509ada98aaf6522dcd236e6d14ad691923c5f41a85a4249f74f12a8fe04.png",
w=13*cm, caption="Fig. Posterior Forearm Muscles – Superficial & Deep Layers"),
sp(),
h2("Anterior (Flexor) Compartment – Median + Ulnar Nerve"),
h3("Superficial layer (all from MEDIAL EPICONDYLE – common flexor origin)"),
tbl([
["Pronator Teres","Median n. C6,C7","Pronation; assists flexion"],
["Flexor Carpi Radialis","Median n. C6,C7","Wrist flexion + abduction"],
["Palmaris Longus","Median n. C7,C8","Tenses palmar aponeurosis (absent in ~14%)"],
["Flexor Carpi Ulnaris","Ulnar n. C7,C8","Wrist flexion + adduction"],
["Flexor Digitorum Superficialis","Median n. C7,C8,T1","Flexes PIP joints"],
], ["Muscle","Nerve","Action"],
col_widths=[5*cm, 4*cm, 6.4*cm]),
sp(),
h3("Deep layer"),
tbl([
["Flexor Digitorum Profundus","Lateral half → Median (AIN); Medial half → Ulnar","Flexes DIP joints – only muscle to do so"],
["Flexor Pollicis Longus","Anterior interosseous n. (AIN)","Flexes IP joint of thumb"],
["Pronator Quadratus","AIN (C8,T1)","Primary pronator of forearm"],
], ["Muscle","Nerve","Action"],
col_widths=[4.5*cm, 5.5*cm, 5.4*cm]),
sp(),
h2("Posterior (Extensor) Compartment – Radial Nerve / PIN"),
h3("Superficial (from LATERAL EPICONDYLE)"),
tbl([
["Brachioradialis","Radial n. C5,C6","Flexes elbow in mid-pronation"],
["Extensor Carpi Radialis Longus","Radial n. C6,C7","Extends + abducts wrist"],
["Extensor Carpi Radialis Brevis","Deep radial (PIN) C7,C8","Extends + abducts wrist"],
["Extensor Digitorum","PIN C7,C8","Extends fingers 2–5 + wrist"],
["Extensor Digiti Minimi","PIN C7,C8","Extends little finger"],
["Extensor Carpi Ulnaris","PIN C7,C8","Extends + adducts wrist"],
], ["Muscle","Nerve","Action"],
col_widths=[5*cm, 3.5*cm, 6.9*cm]),
sp(),
h3("Deep (Tom Ate Bert's Epididymis – APL, EPB, EPL, EI + Supinator)"),
mne("\"Tom And Best Enjoy Singing\" = Supinator · APL · EPB · EPL · EI (deep posterior forearm, all by PIN)"),
sp(),
red("Anterior interosseous nerve (AIN) injury → cannot flex DIP of index + IP of thumb → loss of 'OK sign' (pinch). No sensory loss."),
PageBreak(),
]
# ══ 8. WRIST & CARPAL TUNNEL ════════════════════════════════════════════
story += [
h1("8. WRIST & CARPAL TUNNEL"),
sp(),
h2("Carpal Tunnel – Contents"),
body("Osseofibrous tunnel: floor = carpal bones, roof = FLEXOR RETINACULUM"),
tbl([
["Median nerve","Most superficial & radial – FIRST compressed"],
["FDS tendons x4","Middle layer"],
["FDP tendons x4","Deep layer"],
["FPL tendon","Radial side"],
["NOT in tunnel","Ulnar nerve & artery (Guyon's canal), FCR, FCU, palmaris longus"],
], ["Structure","Note"], col_widths=[5*cm, 10.4*cm]),
sp(),
red("CARPAL TUNNEL SYNDROME (CTS):\n"
"Symptoms: pain/paresthesia in lateral 3.5 digits (thumb, index, middle, lateral ring) – WORSE AT NIGHT\n"
"Signs: Phalen's test (wrist flexion 60s), Tinel's sign (tap over tunnel)\n"
"Late: thenar wasting + permanent sensory loss\n"
"Common in: pregnancy, hypothyroidism, RA, diabetes, acromegaly"),
sp(),
h2("Anatomical Snuffbox"),
tbl([
["Lateral border","APL + EPB tendons"],
["Medial border","EPL tendon"],
["Floor","Scaphoid + Trapezium"],
["Contents","Radial artery (deep) · Superficial branch radial n. · Cephalic vein origin"],
], ["Boundary","Structure"], col_widths=[4.5*cm, 10.9*cm]),
sp(),
red("Tenderness in snuffbox after FOOSH = SCAPHOID FRACTURE until proven otherwise.\n"
"X-ray may be NORMAL initially → get MRI/CT if high suspicion → risk of AVN of proximal fragment."),
sp(),
h2("Colles' vs Smith's Fracture"),
tbl([
["Colles'","Distal radius","FOOSH (fall on outstretched hand)","Dinner fork deformity (dorsal tilt/displacement)","Median nerve; EPL tendon rupture"],
["Smith's","Distal radius","Fall on FLEXED wrist (reverse)","Garden spade deformity (volar tilt)","Wrist drop"],
], ["Fracture","Bone","Mechanism","Deformity","Complication"],
col_widths=[2.2*cm, 2.5*cm, 4*cm, 4*cm, 2.7*cm]),
PageBreak(),
]
# ══ 9. HAND ═════════════════════════════════════════════════════════════
story += [
h1("9. HAND"),
sp(),
h2("Thenar Muscles – Median nerve (recurrent branch C8,T1)"),
tbl([
["Abductor Pollicis Brevis","Abducts thumb"],
["Opponens Pollicis","Opposition (most important thenar action)"],
["Flexor Pollicis Brevis (superficial head)","Flexes MCP of thumb"],
["Adductor Pollicis (NOT thenar!)","Adducts thumb – DEEP ULNAR nerve"],
], ["Muscle","Action"], col_widths=[7*cm, 8.4*cm]),
sp(),
mne("Thenar = LOAF (Lateral two lumbricals · Opponens pollicis · Abductor pollicis brevis · Flexor pollicis brevis) → all MEDIAN nerve"),
sp(),
h2("Hypothenar Muscles – Ulnar nerve (deep branch C8,T1)"),
tbl([
["Abductor Digiti Minimi","Abducts little finger"],
["Flexor Digiti Minimi Brevis","Flexes MCP of little finger"],
["Opponens Digiti Minimi","Opposes little finger"],
["Palmaris Brevis","Wrinkles skin of hypothenar (superficial ulnar n.)"],
], ["Muscle","Action"], col_widths=[6*cm, 9.4*cm]),
sp(),
h2("Lumbricals & Interossei"),
tbl([
["Lumbricals 1&2","Median nerve","Flex MCP + extend IP joints (writing position)"],
["Lumbricals 3&4","Ulnar nerve (deep)","Flex MCP + extend IP joints"],
["Dorsal Interossei (4)","Ulnar nerve (deep)","DAB – abduct fingers from middle finger axis"],
["Palmar Interossei (3)","Ulnar nerve (deep)","PAD – adduct fingers toward middle finger"],
], ["Muscle","Nerve","Action"],
col_widths=[4*cm, 4*cm, 7.4*cm]),
sp(),
h2("Palmar Arches"),
tbl([
["Superficial palmar arch","ULNAR artery (mainly) + superficial radial","Deep to palmar aponeurosis","Common palmar digital arteries"],
["Deep palmar arch","RADIAL artery (mainly) + deep ulnar","Deep to flexor tendons","Palmar metacarpal arteries"],
], ["Arch","Formation","Depth","Branches"],
col_widths=[3.5*cm, 4.5*cm, 3.8*cm, 3.6*cm]),
sp(),
*img("https://cdn.orris.care/cdss_images/be69a5977ee564e9f6b475b3897afcc6bb565eaddcfdf5b43766f788cbbed6fb.png",
w=13*cm, caption="Fig. Deep Palmar Arch – Right Hand"),
PageBreak(),
]
# ══ 10. NERVE INJURIES ══════════════════════════════════════════════════
story += [
h1("10. NERVE INJURIES – HIGH YIELD FMGE"),
sp(),
*img("https://cdn.orris.care/cdss_images/f8b710e79d500fcc768f201961a8090a47bf3bcd3b02bcabb131e005619e692c.png",
w=13*cm, caption="Fig. Brachial Plexus & Upper Limb Dermatomes"),
sp(),
tbl([
["Axillary n.","Surgical neck # / ant. dislocation","Deltoid wasting; weak abduction 15–90°; sensory loss 'regimental badge' lateral arm"],
["Musculocutaneous n.","Coracoid fracture/surgery","Weak elbow flexion; sensory loss lateral forearm"],
["Radial n. (arm)","Spiral groove # / Saturday night palsy","WRIST DROP; loss finger extension; sensory loss dorsal lateral hand"],
["PIN (deep radial)","Radial head # / supinator arcade","Finger drop, NO wrist drop (ECRL intact); NO sensory loss"],
["Median n. (wrist/CTS)","Carpal tunnel","Thenar wasting; sensory loss lateral 3.5 digits; Phalen's/Tinel's +ve"],
["Median n. (elbow)","Supracondylar #","Above + loss pronators/FDS; 'Hand of Benediction' on making fist"],
["AIN","Supracondylar # / fracture","No OK sign; NO sensory loss"],
["Ulnar n. (elbow)","Cubital tunnel / medial epicondyle #","RING+LITTLE claw; Froment's sign; weak grip"],
["Ulnar n. (wrist)","Guyon's canal / cyclist's palsy","MORE clawing than elbow (Ulnar Paradox); palmar sensation preserved"],
["Long thoracic n.","Mastectomy / rib fracture","Winged scapula"],
], ["Nerve","Cause","Signs & Deficit"],
col_widths=[3.2*cm, 4.5*cm, 7.7*cm]),
sp(),
red("ULNAR PARADOX: Ulnar n. injury at WRIST causes MORE clawing than injury at ELBOW.\n"
"Why? At wrist, medial 2 lumbricals are spared at elbow but lost at wrist → more IP extension lost → worse claw."),
sp(),
tip("Froment's sign = patient grips paper between thumb & index; if adductor pollicis paralysed (ulnar n.), thumb IP flexes (FPL takes over) to maintain grip."),
PageBreak(),
]
# ══ 11. DERMATOMES & REFLEXES ══════════════════════════════════════════
story += [
h1("11. DERMATOMES & REFLEXES"),
sp(),
*img("https://cdn.orris.care/cdss_images/9f96996036a42cb05e2e10d316ea69efde910ddc280688fe2817fcba07d1a96b.png",
w=13*cm, caption="Fig. Dermatomes and Myotomes of Upper Limb"),
sp(),
h2("Key Dermatomes"),
tbl([
["C5","Upper lateral arm","Axillary nerve – 'regimental badge'"],
["C6","Thumb + lateral forearm","Musculocutaneous n. (lateral cutaneous of forearm)"],
["C7","Middle (index) finger","Radial nerve – superficial branch"],
["C8","Little finger + medial forearm","Ulnar n. + medial cutaneous n. forearm"],
["T1","Medial arm","Medial cutaneous nerve of arm"],
], ["Level","Area","Nerve"], col_widths=[2*cm, 5*cm, 8.4*cm]),
sp(),
h2("Tendon Reflexes"),
tbl([
["Biceps jerk","C5, C6","Musculocutaneous n."],
["Supinator (brachioradialis) jerk","C5, C6","Radial n."],
["Triceps jerk","C7 (mainly)","Radial n."],
["Finger jerk","C8","Ulnar + median"],
], ["Reflex","Spinal Level","Nerve"], col_widths=[5*cm, 4*cm, 6.4*cm]),
sp(),
mne("C5–Shoulder abduction, C6–Elbow flexion, C7–Elbow extension, C8–Finger flexion, T1–Finger abduction/adduction"),
PageBreak(),
]
# ══ 12. HIGH-YIELD CLINICAL PEARLS ═════════════════════════════════════
story += [
h1("12. HIGH-YIELD CLINICAL PEARLS – FMGE"),
sp(),
h2("Must-Know One-Liners"),
tbl([
["Most mobile joint in body","Glenohumeral joint (ball & socket)"],
["Only bony link between UL & axial skeleton","Sternoclavicular joint"],
["Most common rotator cuff tear","Supraspinatus (at critical zone)"],
["Most common elbow # in adults","Radial head fracture"],
["Most common elbow # in children","Supracondylar humerus fracture"],
["Most common carpal # ","Scaphoid"],
["Most common carpal dislocation","Lunate (can compress median n.)"],
["Most commonly fractured bone in body","Clavicle (middle third)"],
["Muscle absent in 14% people","Palmaris longus"],
["Sesamoid bone of upper limb","Pisiform"],
["Nerve in spiral groove of humerus","Radial nerve + profunda brachii artery"],
["Nerve behind medial epicondyle","Ulnar nerve"],
["Nerve through carpal tunnel","Median nerve (NOT ulnar)"],
["Nerve causing wrist drop","Radial nerve"],
["Nerve causing finger drop (no wrist drop)","Posterior interosseous nerve (PIN)"],
["Nerve causing claw hand","Ulnar nerve"],
["Nerve causing Froment's sign","Ulnar nerve (adductor pollicis palsy)"],
["Winged scapula nerve","Long thoracic nerve (serratus anterior)"],
["Erb's palsy levels","C5, C6 – waiter's tip posture"],
["Klumpke's palsy levels","C8, T1 – claw hand + Horner's syndrome"],
["Dupuytren's contracture","Palmar aponeurosis fibrosis – ring + little finger flexion"],
["Allen's test","Tests radial–ulnar anastomosis adequacy"],
["De Quervain's tenosynovitis","APL + EPB tendons in 1st extensor compartment – Finkelstein's test +ve"],
], ["Fact","Answer"], col_widths=[8*cm, 7.4*cm]),
sp(),
Paragraph("Source: Gray's Anatomy for Students | FMGE High-Yield Notes | Orris Medical", FOOT),
]
doc.build(story)
print("DONE:", OUT)
cd /home/daytona/workspace/upper-limb-anatomy && python fmge_upper_limb.py 2>&1
~/upper-limb-anatomy/fmge_upper_limb.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/upper-limb-anatomy/fmge_upper_limb.py'
cd /home/daytona/workspace/upper-limb-anatomy && python fmge_upper_limb.py 2>&1
ls -lh /home/daytona/workspace/upper-limb-anatomy/FMGE_Upper_Limb_Anatomy.pdf
FMGE Upper Limb Anatomy
PDF Document · PDF
| Section | What you get |
|---|---|
| Bones | Key fractures, carpal mnemonic, muscle attachments table |
| Shoulder | Rotator cuff SITS table, glenohumeral joint, dislocation |
| Axilla | Axillary artery "1-2-3 branches" mnemonic, 3 spaces diagram |
| Brachial Plexus | 2 full diagrams + Erb's/Klumpke's injury table |
| Arm | Anterior/posterior muscle tables, cubital fossa mnemonic |
| Elbow | 2 diagrams, fat pad sign, ligaments, important fractures |
| Forearm | All muscles layered with nerve supply |
| Wrist/Carpal Tunnel | CTS signs, snuffbox, Colles' vs Smith's |
| Hand | LOAF mnemonic, palmar arches diagram |
| Nerve Injuries | One complete table - all nerves, causes, signs |
| Dermatomes & Reflexes | C5-T1 chart with nerve names |
| 25 FMGE one-liners | Fast last-minute revision table |