Median nerve answer construct according to bdc in pdf format

Asking for Preferences
Reading File
Finding Sources
Searching Images

median nerve anatomy course branches hand arm diagram

This educational image displays the gross anatomy and morphological branching pattern of the human median nerve through dissection. Image A is a clinical photograph showing the median nerve in situ within the medial aspect of the arm and elbow, with the median epicondyle and interosseous nerve labeled as landmarks. Image B presents the fully harvested median nerve against a green background, detailing its extensive branching hierarchy. Muscular branches are identified proximally to distally, including the pronator teres (PT), flexor carpi radialis (FCR), palmaris longus (PL), anterior interosseous nerve, flexor pollicis longus (FPL), pronator quadratus (PQ), flexor digitorum profundus (FDP), and flexor digitorum superficialis (FDS). Distal terminal branches are shown extending into the hand, including the sensitive palmar branch, thenar branches, and digital branches (1-3). The diagram includes a normalized distance scale, designating the epicondylar landmark at 24 cm (100%) and the styloid landmark at 0 cm (0%). This visual serves as a topographical guide for identifying nerve distribution during surgical procedures like electrode implantation or neurolysis.

This educational image displays the gross anatomy and morphological branching pattern of the human median nerve through dissection. Image A is a clinical photograph showing the median nerve in situ within the medial aspect of the arm and elbow, with the median epicondyle and interosseous nerve labeled as landmarks. Image B presents the fully harvested median nerve against a green background, detailing its extensive branching hierarchy. Muscular branches are identified proximally to distally, including the pronator teres (PT), flexor carpi radialis (FCR), palmaris longus (PL), anterior interosseous nerve, flexor pollicis longus (FPL), pronator quadratus (PQ), flexor digitorum profundus (FDP), and flexor digitorum superficialis (FDS). Distal terminal branches are shown extending into the hand, including the sensitive palmar branch, thenar branches, and digital branches (1-3). The diagram includes a normalized distance scale, designating the epicondylar landmark at 24 cm (100%) and the styloid landmark at 0 cm (0%). This visual serves as a topographical guide for identifying nerve distribution during surgical procedures like electrode implantation or neurolysis.

Anatomical diagram of the human hand and distal forearm in a palmar view, illustrating peripheral nerve anatomy and muscle transposition for pronator quadratus opponensplasty. The diagram features color-coded structures overlaid on a skeletal and soft tissue outline. Major peripheral nerves, including the median and ulnar nerves, are highlighted in yellow, showing their proximal courses and distal branching into digital nerves. The recipient anterior interosseous nerve (AIN) motor branch is highlighted in red, indicating its path toward the transposed muscle. The donor recurrent median nerve and donor deep ulnar nerve branches are highlighted in green, demonstrating potential donor sites for nerve coaptation to restore thenar function. The pronator quadratus muscle is shaded in red, shown in a transposed position toward the thumb (thenar eminence) to simulate its role as an opponens substitute. This illustration is designed for surgical planning in cases of chronic carpal tunnel syndrome or atrophic thenar muscle dysfunction, focusing on the spatial relationships required for effective nerve transfer and muscle mobilization.

Anatomical diagram of the human hand and distal forearm in a palmar view, illustrating peripheral nerve anatomy and muscle transposition for pronator quadratus opponensplasty. The diagram features color-coded structures overlaid on a skeletal and soft tissue outline. Major peripheral nerves, including the median and ulnar nerves, are highlighted in yellow, showing their proximal courses and distal branching into digital nerves. The recipient anterior interosseous nerve (AIN) motor branch is highlighted in red, indicating its path toward the transposed muscle. The donor recurrent median nerve and donor deep ulnar nerve branches are highlighted in green, demonstrating potential donor sites for nerve coaptation to restore thenar function. The pronator quadratus muscle is shaded in red, shown in a transposed position toward the thumb (thenar eminence) to simulate its role as an opponens substitute. This illustration is designed for surgical planning in cases of chronic carpal tunnel syndrome or atrophic thenar muscle dysfunction, focusing on the spatial relationships required for effective nerve transfer and muscle mobilization.

This medical anatomical diagram illustrates a rare variation of the hand's neurovasculature, specifically the preligamentous course of the thenar motor branch (TMB) of the median nerve. The black-and-white line drawing shows the median nerve trunk passing deep to the transverse carpal ligament (TCL). In this variation, the thenar motor branch originates from the median nerve proximal to the carpal tunnel and courses superficially over the transverse carpal ligament before diving into the striated thenar musculature on the radial side of the palm. The illustration highlights critical surgical anatomy for procedures such as carpal tunnel release, where identifying the TMB's relationship to the TCL is essential to avoid iatrogenic injury. The diagram provides educational context for understanding anatomical deviations that do not strictly adhere to standard classifications like the Lanz system, specifically demonstrating an 'over the ligament' pathway rather than the typical subligamentous or transligamentous routes.

This medical anatomical diagram illustrates a rare variation of the hand's neurovasculature, specifically the preligamentous course of the thenar motor branch (TMB) of the median nerve. The black-and-white line drawing shows the median nerve trunk passing deep to the transverse carpal ligament (TCL). In this variation, the thenar motor branch originates from the median nerve proximal to the carpal tunnel and courses superficially over the transverse carpal ligament before diving into the striated thenar musculature on the radial side of the palm. The illustration highlights critical surgical anatomy for procedures such as carpal tunnel release, where identifying the TMB's relationship to the TCL is essential to avoid iatrogenic injury. The diagram provides educational context for understanding anatomical deviations that do not strictly adhere to standard classifications like the Lanz system, specifically demonstrating an 'over the ligament' pathway rather than the typical subligamentous or transligamentous routes.

This composite educational resource details the anatomy and innervation of the brachial plexus. Panel (a) is a cadaveric dissection of the left axillary region. Key structures are labeled numerically: the median nerve (1), lateral and medial roots of the median nerve (2, 3), ulnar nerve (4), axillary artery (5), and axillary vein (6), alongside the medial cutaneous nerves of the arm (7) and forearm (8). In the supraclavicular region, the upper (9), middle (10), and lower (11) trunks are identified. Red and blue lines indicate proximal and distal bounds of a clinical lesion site. Panel (b) is a color-coded schematic diagram illustrating the brachial plexus architecture from roots (C5-T1) to terminal branches. It maps specific nerves to their target muscles, including the serratus anterior, deltoid, biceps brachii, and the intrinsic muscles of the hand. This content is designed for medical students and surgical residents to understand the relationship between neuroanatomical structures, their physiological territories, and the clinical correlation of axillary nerve injuries.

This composite educational resource details the anatomy and innervation of the brachial plexus. Panel (a) is a cadaveric dissection of the left axillary region. Key structures are labeled numerically: the median nerve (1), lateral and medial roots of the median nerve (2, 3), ulnar nerve (4), axillary artery (5), and axillary vein (6), alongside the medial cutaneous nerves of the arm (7) and forearm (8). In the supraclavicular region, the upper (9), middle (10), and lower (11) trunks are identified. Red and blue lines indicate proximal and distal bounds of a clinical lesion site. Panel (b) is a color-coded schematic diagram illustrating the brachial plexus architecture from roots (C5-T1) to terminal branches. It maps specific nerves to their target muscles, including the serratus anterior, deltoid, biceps brachii, and the intrinsic muscles of the hand. This content is designed for medical students and surgical residents to understand the relationship between neuroanatomical structures, their physiological territories, and the clinical correlation of axillary nerve injuries.

This clinical photograph displays a high-resolution cadaveric dissection of the ulnar nerve and its branching patterns within the hand, specifically focused on the distal forearm and palmar regions. The image serves as an anatomical diagram of the peripheral nervous system, illustrating the ulnar nerve bifurcating into its primary deep and superficial branches. Key anatomical landmarks identified through labeling include the cutaneous branch, the muscular branch to the palmaris brevis, and the medial palmar digital nerve to the 5th finger. Of particular educational significance is the visualization of the common palmar digital nerve to the 4th and 5th fingers and a notable anastomosis connecting the ulnar digital branches to the median nerve. This image is essential for understanding the neuroanatomy of the hand, Guyon's canal variations, and clinical scenarios involving ulnar nerve entrapment or surgical decompression. The content is suitable for medical students and surgical residents studying upper extremity anatomy and peripheral nerve variations.

This clinical photograph displays a high-resolution cadaveric dissection of the ulnar nerve and its branching patterns within the hand, specifically focused on the distal forearm and palmar regions. The image serves as an anatomical diagram of the peripheral nervous system, illustrating the ulnar nerve bifurcating into its primary deep and superficial branches. Key anatomical landmarks identified through labeling include the cutaneous branch, the muscular branch to the palmaris brevis, and the medial palmar digital nerve to the 5th finger. Of particular educational significance is the visualization of the common palmar digital nerve to the 4th and 5th fingers and a notable anastomosis connecting the ulnar digital branches to the median nerve. This image is essential for understanding the neuroanatomy of the hand, Guyon's canal variations, and clinical scenarios involving ulnar nerve entrapment or surgical decompression. The content is suitable for medical students and surgical residents studying upper extremity anatomy and peripheral nerve variations.

Ultra-High Frequency Ultrasound (UHFUS) images demonstrating the detailed anatomy of small peripheral branches of the median nerve in the hand. Panel (a) shows a cross-sectional view at the level of the thenar eminence; the recurrent branch of the median nerve is identified as a hypoechoic, rounded structure (indicated by the line marking) within the surrounding soft tissue (marked with a square parenthesis). Panel (b) provides an ultra-high resolution view of a digital branch of the median nerve at the finger level. Enclosed within a dotted circle, the nerve exhibits a typical 'honeycomb' internal echo-structure, characterized by multiple small hypoechoic fascicles separated by thinner hyperechoic lines. The images illustrate the clinical utility of high-frequency transducers for visualizing superficial nerve morphology, which is essential for diagnosing entrapment neuropathies, traumatic injuries, or pre-operative planning in hand surgery.

Ultra-High Frequency Ultrasound (UHFUS) images demonstrating the detailed anatomy of small peripheral branches of the median nerve in the hand. Panel (a) shows a cross-sectional view at the level of the thenar eminence; the recurrent branch of the median nerve is identified as a hypoechoic, rounded structure (indicated by the line marking) within the surrounding soft tissue (marked with a square parenthesis). Panel (b) provides an ultra-high resolution view of a digital branch of the median nerve at the finger level. Enclosed within a dotted circle, the nerve exhibits a typical 'honeycomb' internal echo-structure, characterized by multiple small hypoechoic fascicles separated by thinner hyperechoic lines. The images illustrate the clinical utility of high-frequency transducers for visualizing superficial nerve morphology, which is essential for diagnosing entrapment neuropathies, traumatic injuries, or pre-operative planning in hand surgery.

Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/median-nerve-pdf && ls /tmp/workspace/

Writing File

~/median-nerve-pdf/generate_pdf.py

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, black, white, Color
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.lib import colors

OUTPUT = "/tmp/workspace/median-nerve-pdf/Median_Nerve_BDC_Answer.pdf"

# --- Colour palette ---
DEEP_BLUE   = HexColor("#1a3a5c")
MID_BLUE    = HexColor("#2a6099")
LIGHT_BLUE  = HexColor("#ddeeff")
ACCENT      = HexColor("#e8732a")
LIGHT_GREY  = HexColor("#f4f6fa")
BORDER_GREY = HexColor("#b0c4de")
HEADING_BG  = HexColor("#1a3a5c")
SUBHEAD_BG  = HexColor("#2a6099")
TABLE_HEAD  = HexColor("#2a6099")
TABLE_ALT   = HexColor("#eef4fb")

# --- Document ---
doc = SimpleDocTemplate(
    OUTPUT, pagesize=A4,
    leftMargin=2*cm, rightMargin=2*cm,
    topMargin=2*cm, bottomMargin=2*cm,
    title="Median Nerve – BDC Anatomy Answer",
    author="Orris Medical"
)

styles = getSampleStyleSheet()

# Custom styles
def make_style(name, parent="Normal", **kw):
    return ParagraphStyle(name, parent=styles[parent], **kw)

cover_title = make_style("CoverTitle", fontSize=28, textColor=white,
                         alignment=TA_CENTER, fontName="Helvetica-Bold",
                         spaceAfter=6)
cover_sub   = make_style("CoverSub", fontSize=14, textColor=HexColor("#aaccee"),
                         alignment=TA_CENTER, fontName="Helvetica",
                         spaceAfter=4)
cover_tag   = make_style("CoverTag", fontSize=11, textColor=HexColor("#e8c87a"),
                         alignment=TA_CENTER, fontName="Helvetica-Oblique",
                         spaceAfter=4)

section_h   = make_style("SectionH", fontSize=13, textColor=white,
                         fontName="Helvetica-Bold", alignment=TA_LEFT,
                         spaceBefore=10, spaceAfter=4, leftIndent=0)
sub_h       = make_style("SubH", fontSize=11, textColor=white,
                         fontName="Helvetica-Bold", alignment=TA_LEFT,
                         spaceBefore=6, spaceAfter=3)
body        = make_style("Body", fontSize=10, textColor=black,
                         leading=15, spaceAfter=5, alignment=TA_JUSTIFY,
                         fontName="Helvetica")
bullet_s    = make_style("Bullet", fontSize=10, textColor=black,
                         leading=14, spaceAfter=3, leftIndent=14,
                         firstLineIndent=-10, fontName="Helvetica")
bold_label  = make_style("BoldLabel", fontSize=10, textColor=DEEP_BLUE,
                         fontName="Helvetica-Bold", spaceAfter=2)
note_box    = make_style("NoteBox", fontSize=10, textColor=HexColor("#5a2d00"),
                         leading=14, fontName="Helvetica-Oblique",
                         leftIndent=10, rightIndent=10, spaceAfter=4)
footer_s    = make_style("Footer", fontSize=8, textColor=HexColor("#888888"),
                         alignment=TA_CENTER)
imp_box     = make_style("ImpBox", fontSize=10, textColor=HexColor("#7b0000"),
                         leading=14, fontName="Helvetica-Bold",
                         leftIndent=10, rightIndent=10, spaceAfter=4)

story = []

# =========================================================
# Helper: Section header with coloured bar
# =========================================================
def sec_header(title, bg=HEADING_BG, sub=False):
    fs = 11 if sub else 13
    clr = SUBHEAD_BG if sub else HEADING_BG
    t = Table([[Paragraph(title, ParagraphStyle("sh", fontSize=fs,
               textColor=white, fontName="Helvetica-Bold",
               alignment=TA_LEFT, leading=fs+3))]],
              colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), clr),
        ("TOPPADDING",  (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 8),
        ("RIGHTPADDING",(0,0), (-1,-1), 8),
        ("ROUNDEDCORNERS", [4]),
    ]))
    story.append(t)
    story.append(Spacer(1, 3*mm))

def sub_header(title):
    t = Table([[Paragraph(title, ParagraphStyle("sbh", fontSize=11,
               textColor=white, fontName="Helvetica-Bold",
               alignment=TA_LEFT, leading=14))]],
              colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), SUBHEAD_BG),
        ("TOPPADDING",  (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0),(-1,-1), 4),
        ("LEFTPADDING", (0,0), (-1,-1), 14),
        ("RIGHTPADDING",(0,0), (-1,-1), 8),
    ]))
    story.append(t)
    story.append(Spacer(1, 2*mm))

def bullet(txt):
    story.append(Paragraph(f"<bullet>\u2022</bullet> {txt}", bullet_s))

def body_p(txt):
    story.append(Paragraph(txt, body))

def spacer(h=4):
    story.append(Spacer(1, h*mm))

def note(txt):
    t = Table([[Paragraph(f"\u2139\ufe0f  {txt}", note_box)]],
              colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0),(-1,-1), HexColor("#fff8e6")),
        ("BOX",(0,0),(-1,-1), 0.8, HexColor("#e8a000")),
        ("TOPPADDING",(0,0),(-1,-1),5),
        ("BOTTOMPADDING",(0,0),(-1,-1),5),
        ("LEFTPADDING",(0,0),(-1,-1),8),
    ]))
    story.append(t)
    story.append(Spacer(1, 2*mm))

def imp(txt):
    t = Table([[Paragraph(f"\u26a0  {txt}", imp_box)]],
              colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0),(-1,-1), HexColor("#fff0f0")),
        ("BOX",(0,0),(-1,-1), 1.0, HexColor("#cc0000")),
        ("TOPPADDING",(0,0),(-1,-1),5),
        ("BOTTOMPADDING",(0,0),(-1,-1),5),
        ("LEFTPADDING",(0,0),(-1,-1),8),
    ]))
    story.append(t)
    story.append(Spacer(1, 2*mm))

# =========================================================
# COVER PAGE
# =========================================================
cover_table = Table(
    [[Paragraph("MEDIAN NERVE", cover_title)],
     [Paragraph("Complete Anatomy Answer", cover_sub)],
     [Spacer(1, 4*mm)],
     [Paragraph("As per BD Chaurasia's Human Anatomy", cover_tag)],
     [Paragraph("For MBBS Anatomy Examinations", cover_tag)],
     [Spacer(1, 8*mm)],
     [HRFlowable(width="80%", thickness=1, color=HexColor("#4a90d9"), spaceAfter=4)],
     [Spacer(1, 4*mm)],
     [Paragraph("Upper Limb | Brachial Plexus | Peripheral Nerves", cover_sub)],
    ],
    colWidths=[17*cm]
)
cover_table.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), DEEP_BLUE),
    ("ALIGN", (0,0), (-1,-1), "CENTER"),
    ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING", (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING", (0,0), (-1,-1), 20),
    ("RIGHTPADDING", (0,0), (-1,-1), 20),
    ("ROUNDEDCORNERS", [8]),
]))
story.append(Spacer(1, 2*cm))
story.append(cover_table)
story.append(Spacer(1, 1*cm))

# Quick outline box
outline_data = [
    [Paragraph("<b>CONTENTS AT A GLANCE</b>", ParagraphStyle("ol",
               fontSize=10, textColor=DEEP_BLUE, fontName="Helvetica-Bold"))],
    [Paragraph("1. Origin &amp; Roots  &nbsp;|&nbsp;  2. Formation  &nbsp;|&nbsp;  "
               "3. Course in Axilla &amp; Arm  &nbsp;|&nbsp;  4. Course in Forearm", body)],
    [Paragraph("5. Branches in Forearm  &nbsp;|&nbsp;  6. Course in Hand  &nbsp;|&nbsp;  "
               "7. Branches in Hand  &nbsp;|&nbsp;  8. Motor Supply", body)],
    [Paragraph("9. Sensory Supply  &nbsp;|&nbsp;  10. Applied Anatomy  &nbsp;|&nbsp;  "
               "11. Clinical Tests  &nbsp;|&nbsp;  12. Quick-Revision Table", body)],
]
ol = Table(outline_data, colWidths=[17*cm])
ol.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), LIGHT_BLUE),
    ("BOX", (0,0), (-1,-1), 0.8, MID_BLUE),
    ("TOPPADDING",(0,0),(-1,-1),5),
    ("BOTTOMPADDING",(0,0),(-1,-1),5),
    ("LEFTPADDING",(0,0),(-1,-1),10),
]))
story.append(ol)
story.append(Spacer(1, 8*mm))

# =========================================================
# 1. ORIGIN & FORMATION
# =========================================================
sec_header("1.  ORIGIN AND FORMATION")
body_p("The median nerve is a terminal branch of the <b>brachial plexus</b>. "
       "It is formed by contributions from the <b>lateral cord (C6, C7)</b> and "
       "<b>medial cord (C8, T1)</b>, giving it a total root value of "
       "<b>C5, C6, C7, C8, T1</b> (C5 is a minor inconsistent contribution).")
spacer(2)
body_p("Formation: The lateral root (from the lateral cord) and the medial root "
       "(from the medial cord) converge and unite <b>anterior to the third part of the "
       "axillary artery</b>, forming the median nerve trunk.")
note("Mnemonic – Roots: 'C5 to T1 laterally and medially combined' — "
     "the median nerve is the only terminal nerve formed by roots from BOTH lateral and medial cords.")
spacer(3)

# =========================================================
# 2. COURSE
# =========================================================
sec_header("2.  COURSE")

sub_header("A.  In the Axilla")
body_p("After formation anterior to the axillary artery (3rd part), the nerve runs "
       "<b>lateral</b> to the axillary artery through the axilla. "
       "It gives <b>no branches</b> in the axilla.")
spacer(2)

sub_header("B.  In the Arm")
body_p("The median nerve enters the arm at the inferior margin of the teres major muscle, "
       "running in the <b>anterior compartment</b>.")
bullet("In the <b>proximal arm</b>: lies <b>lateral</b> to the brachial artery.")
bullet("In the <b>distal arm</b>: crosses <b>anterior</b> to the brachial artery and "
       "lies <b>medial</b> to it at the cubital fossa.")
bullet("The nerve gives <b>NO branches</b> in the arm (occasional branch to pronator teres "
       "may arise just above the elbow).")
spacer(2)

sub_header("C.  In the Cubital Fossa")
body_p("The median nerve lies <b>medial to the brachial artery</b> in the cubital fossa "
       "(contents from lateral to medial: <b>Biceps tendon – Brachial artery – Median nerve</b> "
       "— mnemonic: <b>TAN</b>). "
       "It leaves the cubital fossa by passing between the <b>two heads of pronator teres</b>.")
spacer(2)

sub_header("D.  In the Forearm")
bullet("Enters forearm by passing between the <b>humero-ulnar head</b> and "
       "<b>radial head of pronator teres</b>.")
bullet("Then passes deep to the <b>fibrous arch between the humero-ulnar and radial heads of "
       "flexor digitorum superficialis (FDS)</b>.")
bullet("Runs distally along the <b>deep surface of FDS</b>, lying in the fascial plane "
       "between FDS (superficial) and FDP/FPL (deep).")
bullet("Just proximal to the wrist, it moves <b>laterally and becomes superficial</b>, "
       "lying between the tendons of <b>palmaris longus (medially)</b> and "
       "<b>flexor carpi radialis (laterally)</b>.")
bullet("Enters the palm by passing through the <b>carpal tunnel</b> deep to the "
       "flexor retinaculum.")
spacer(3)

sub_header("E.  In the Hand")
bullet("Enters through the carpal tunnel under the flexor retinaculum.")
bullet("Divides into a <b>recurrent (thenar) branch</b> and <b>palmar digital branches</b> "
       "near the distal margin of the flexor retinaculum.")
spacer(3)

# =========================================================
# 3. BRANCHES
# =========================================================
sec_header("3.  BRANCHES")

sub_header("A.  In the Arm")
body_p("Usually <b>NO branches</b> in the arm. An occasional twig to the proximal "
       "part of pronator teres may arise here.")
spacer(2)

sub_header("B.  In the Cubital Fossa / Proximal Forearm")
body_p("The following muscular branches arise just <b>distal to the elbow</b>:")

muscles_data = [
    [Paragraph("<b>Muscle</b>", ParagraphStyle("th", fontSize=10, textColor=white,
               fontName="Helvetica-Bold")),
     Paragraph("<b>Action</b>", ParagraphStyle("th", fontSize=10, textColor=white,
               fontName="Helvetica-Bold"))],
    ["Pronator teres", "Pronation of forearm"],
    ["Flexor carpi radialis (FCR)", "Flexion + radial deviation at wrist"],
    ["Palmaris longus", "Weak wrist flexor; tenses palmar aponeurosis"],
    ["Flexor digitorum superficialis (FDS)", "Flexes middle phalanges of fingers 2-5"],
]
mt = Table(muscles_data, colWidths=[9*cm, 8*cm])
mt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), TABLE_HEAD),
    ("TEXTCOLOR", (0,0), (-1,0), white),
    ("BACKGROUND", (0,1), (-1,1), TABLE_ALT),
    ("BACKGROUND", (0,2), (-1,2), white),
    ("BACKGROUND", (0,3), (-1,3), TABLE_ALT),
    ("BACKGROUND", (0,4), (-1,4), white),
    ("FONTNAME", (0,1), (-1,-1), "Helvetica"),
    ("FONTSIZE", (0,0), (-1,-1), 9),
    ("GRID", (0,0), (-1,-1), 0.4, BORDER_GREY),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6),
]))
story.append(mt)
spacer(3)

sub_header("C.  Anterior Interosseous Nerve (AIN) — Largest Branch in Forearm")
body_p("The <b>anterior interosseous nerve (AIN)</b> is the largest branch of the "
       "median nerve in the forearm. It arises between the two heads of pronator teres "
       "and runs distally with the anterior interosseous artery on the <b>anterior surface of "
       "the interosseous membrane</b>.")
body_p("It supplies:")
bullet("<b>Flexor pollicis longus (FPL)</b> — flexes thumb IP joint")
bullet("<b>Lateral half of flexor digitorum profundus (FDP)</b> — flexes DIP joints of "
       "index and middle fingers")
bullet("<b>Pronator quadratus (PQ)</b> — pronation (especially rapid pronation)")
bullet("<b>Articular branches</b> to distal radioulnar, radiocarpal, and intercarpal joints")
imp("AIN injury = inability to make 'OK sign'. Tip pinch uses FPL + FDP to index finger. "
    "Patient uses 'key pinch' instead — FPL hyperextension gives triangular (pinch) appearance.")
spacer(2)

sub_header("D.  Palmar Cutaneous Branch")
body_p("Arises from the <b>lateral side of the median nerve</b>, about 5 cm proximal to the "
       "flexor retinaculum. Passes <b>superficially over</b> (not through) the flexor "
       "retinaculum and supplies:")
bullet("Skin over the <b>base of the palm (central part)</b>")
bullet("Skin of the <b>thenar eminence</b>")
note("This branch is NOT compressed in carpal tunnel syndrome (it travels superficial to "
     "the retinaculum), so sensation over the base of the palm is preserved in CTS.")
spacer(2)

sub_header("E.  Branches in the Hand")
body_p("<b>1. Recurrent (Thenar) Branch of Median Nerve</b>")
body_p("Arises from the <b>lateral side</b> of the median nerve just distal to the "
       "flexor retinaculum. Curls around the distal margin of the retinaculum and "
       "runs proximally over flexor pollicis brevis. Supplies the <b>3 thenar muscles</b>:")
bullet("<b>Abductor pollicis brevis (APB)</b>")
bullet("<b>Flexor pollicis brevis (FPB)</b> — superficial head only")
bullet("<b>Opponens pollicis (OP)</b>")
imp("The recurrent branch is sometimes called the 'Motoring Branch' of the hand. "
    "Injury causes thenar wasting and loss of opposition (ape-hand deformity).")
spacer(2)

body_p("<b>2. Palmar Digital Nerves</b>")
body_p("These cross the palm deep to the palmar aponeurosis and superficial palmar arch. "
       "The median nerve supplies:")
bullet("Palmar aspect of <b>lateral 3½ digits</b> (thumb, index, middle, lateral half of ring)")
bullet("Dorsal aspect of the <b>distal phalanx and nail bed</b> of the same digits")
bullet("<b>Lateral two lumbrical muscles</b> (1st and 2nd lumbricals) — via common digital "
       "branches to index and middle fingers")
spacer(3)

# =========================================================
# 4. MOTOR SUPPLY SUMMARY
# =========================================================
sec_header("4.  COMPLETE MOTOR SUPPLY")
body_p("The median nerve is the <b>chief motor nerve of the forearm</b>. "
       "Mnemonic for hand muscles (LOAF):")

loaf_data = [
    [Paragraph("<b>Letter</b>", ParagraphStyle("th2", fontSize=10, textColor=white,
               fontName="Helvetica-Bold")),
     Paragraph("<b>Muscle</b>", ParagraphStyle("th2", fontSize=10, textColor=white,
               fontName="Helvetica-Bold")),
     Paragraph("<b>Function</b>", ParagraphStyle("th2", fontSize=10, textColor=white,
               fontName="Helvetica-Bold"))],
    ["L", "Lateral two Lumbricals (1st & 2nd)", "Flex MCPJs, extend IPJs of index & middle"],
    ["O", "Opponens pollicis", "Opposition of thumb"],
    ["A", "Abductor pollicis brevis (APB)", "Abduction of thumb (key test muscle)"],
    ["F", "Flexor pollicis brevis (FPB) — superficial head", "Flexion of thumb at MCPJ"],
]
lt = Table(loaf_data, colWidths=[1.5*cm, 8*cm, 7.5*cm])
lt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), TABLE_HEAD),
    ("TEXTCOLOR", (0,0), (-1,0), white),
    ("BACKGROUND", (0,1), (-1,1), TABLE_ALT),
    ("BACKGROUND", (0,2), (-1,2), white),
    ("BACKGROUND", (0,3), (-1,3), TABLE_ALT),
    ("BACKGROUND", (0,4), (-1,4), white),
    ("FONTNAME", (0,1), (-1,-1), "Helvetica"),
    ("FONTSIZE", (0,0), (-1,-1), 9),
    ("GRID", (0,0), (-1,-1), 0.4, BORDER_GREY),
    ("ALIGN", (0,0), (0,-1), "CENTER"),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6),
]))
story.append(lt)
spacer(2)
note("Mnemonic: <b>LOAF</b> — the 4 intrinsic hand muscles supplied by the median nerve. "
     "All other intrinsic muscles of the hand are supplied by the ulnar nerve.")
spacer(3)

body_p("<b>Complete Forearm Motor Supply:</b>")
all_motor_data = [
    [Paragraph("<b>Muscle</b>", ParagraphStyle("th3", fontSize=9, textColor=white,
               fontName="Helvetica-Bold")),
     Paragraph("<b>Branch</b>", ParagraphStyle("th3", fontSize=9, textColor=white,
               fontName="Helvetica-Bold")),
     Paragraph("<b>Root Value</b>", ParagraphStyle("th3", fontSize=9, textColor=white,
               fontName="Helvetica-Bold"))],
    ["Pronator teres", "Directly from median nerve", "C6, C7"],
    ["Flexor carpi radialis", "Directly from median nerve", "C6, C7"],
    ["Palmaris longus", "Directly from median nerve", "C7, C8"],
    ["Flexor digitorum superficialis", "Directly from median nerve", "C7, C8, T1"],
    ["Flexor pollicis longus", "AIN", "C8, T1"],
    ["FDP (lateral half — index, middle)", "AIN", "C7, C8"],
    ["Pronator quadratus", "AIN", "C8, T1"],
    ["Thenar muscles (3)", "Recurrent branch", "C8, T1"],
    ["Lateral 2 lumbricals", "Digital branches", "C8, T1"],
]
at = Table(all_motor_data, colWidths=[6.5*cm, 5.5*cm, 5*cm])
at.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), TABLE_HEAD),
    ("TEXTCOLOR", (0,0), (-1,0), white),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [TABLE_ALT, white]),
    ("FONTNAME", (0,1), (-1,-1), "Helvetica"),
    ("FONTSIZE", (0,0), (-1,-1), 9),
    ("GRID", (0,0), (-1,-1), 0.4, BORDER_GREY),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6),
]))
story.append(at)
spacer(3)

# =========================================================
# 5. SENSORY SUPPLY
# =========================================================
sec_header("5.  SENSORY SUPPLY")
body_p("The median nerve is the most important <b>sensory nerve</b> of the hand "
       "because it supplies the dominant grasping surface.")
bullet("Palmar surface: <b>lateral 3½ digits</b> (thumb, index, middle, lateral half of ring)")
bullet("Dorsal surface: <b>distal phalanges and nail beds</b> of the same digits")
bullet("Palm: <b>central and lateral palm</b> (via palmar cutaneous branch)")
bullet("<b>Autonomous area</b> (area of exclusive supply, important for testing): "
       "tip of the <b>index finger</b>")
imp("Always test sensation at the tip of the index finger (autonomous zone) to assess "
    "median nerve sensory function.")
spacer(3)

# =========================================================
# 6. APPLIED ANATOMY
# =========================================================
sec_header("6.  APPLIED ANATOMY AND CLINICAL CORRELATES")

sub_header("A.  High Median Nerve Injury (Above Elbow)")
body_p("<b>Causes:</b> Supracondylar fracture of humerus (most common in children), "
       "dislocation of elbow, Struthers' ligament compression, pronator teres syndrome.")
spacer(2)
body_p("<b>Motor Loss:</b>")
bullet("Loss of pronation (pronator teres + pronator quadratus paralysed)")
bullet("Loss of wrist flexion (with radial deviation due to intact FCU)")
bullet("Loss of flexion of index and middle finger DIP joints (FDP lateral half)")
bullet("Loss of flexion of thumb IP joint (FPL)")
bullet("Loss of thenar muscles → loss of opposition of thumb")
bullet("Loss of lateral 2 lumbricals → loss of extension at IPJs of index and middle fingers")
spacer(2)
body_p("<b>Deformity — 'Hand of Benediction' (Pope's Blessing / Preacher's Hand):</b>")
body_p("When the patient attempts to <b>make a fist</b>, the index and middle fingers "
       "cannot flex fully (due to paralysis of FDS and lateral half of FDP + lumbricals). "
       "Only the ring and little fingers flex (supplied by ulnar nerve via FDP medial half). "
       "This gives the appearance of a papal blessing — 'hand of benediction'.")
note("HIGH injury → Hand of benediction (when making a fist). "
     "LOW injury (at wrist) → Ape-hand (at rest).")
spacer(2)

body_p("<b>Sensory Loss:</b>")
bullet("Loss of sensation over lateral 3½ digits (palmar surface) and nail beds")
bullet("Preserved sensation over central palm (palmar cutaneous branch arises proximal to injury)")
spacer(2)

body_p("<b>Vasomotor changes:</b> Dry, smooth skin; trophic changes in nail beds; "
       "increased cutaneous blood flow in the autonomous area.")
spacer(3)

sub_header("B.  Low Median Nerve Injury (At the Wrist — Carpal Tunnel)")
body_p("<b>Causes:</b> Carpal tunnel syndrome (CTS) — compression under the flexor "
       "retinaculum. Also: lacerations at the wrist (e.g. attempted suicide).")
spacer(2)
body_p("<b>Motor Loss:</b>")
bullet("Thenar muscle wasting → <b>Ape-hand (Simian hand)</b> deformity — "
       "the thumb falls back into the plane of other digits (loss of opposition). "
       "The thenar eminence is flattened.")
bullet("Lateral 2 lumbricals paralysed — extension of IPJs of index and middle fingers affected")
bullet("Forearm muscles are <b>spared</b> (branches given off proximal to the injury)")
spacer(2)
body_p("<b>Sensory Loss:</b>")
bullet("Palmar surface of lateral 3½ digits and their nail beds")
bullet("<b>Central palm is SPARED</b> (palmar cutaneous branch passes superficial to "
       "flexor retinaculum and is not compressed in CTS)")
spacer(3)

sub_header("C.  Carpal Tunnel Syndrome (CTS)")
body_p("CTS is the <b>most common entrapment neuropathy</b>. The median nerve is compressed "
       "in the carpal tunnel deep to the flexor retinaculum.")
body_p("<b>Contents of carpal tunnel:</b> 9 flexor tendons (4 FDS + 4 FDP + 1 FPL) + "
       "median nerve. Note: FCU and FCR tendons are NOT in the carpal tunnel.")
body_p("<b>Symptoms:</b> Tingling and numbness in the lateral 3½ digits, worse at night, "
       "relieved by shaking the hand (flick sign). Thenar wasting in late stages.")
body_p("<b>Clinical tests:</b>")
bullet("<b>Tinel's test:</b> Percussion over the carpal tunnel → tingling in median nerve distribution")
bullet("<b>Phalen's test:</b> Sustained wrist flexion for 60 seconds → reproduces symptoms")
spacer(3)

# =========================================================
# 7. CLINICAL TESTS
# =========================================================
sec_header("7.  CLINICAL TESTS FOR MEDIAN NERVE FUNCTION")

test_data = [
    [Paragraph("<b>Test</b>", ParagraphStyle("th4", fontSize=9, textColor=white,
               fontName="Helvetica-Bold")),
     Paragraph("<b>Muscle Tested</b>", ParagraphStyle("th4", fontSize=9, textColor=white,
               fontName="Helvetica-Bold")),
     Paragraph("<b>Method / Positive Finding</b>", ParagraphStyle("th4", fontSize=9, textColor=white,
               fontName="Helvetica-Bold"))],
    ["Pen Test (Abduction Test)", "Abductor pollicis brevis",
     "Hand flat on table; ask patient to touch a pen held above palm with thumb. "
     "Negative = paralysis of APB."],
    ["Opponens Test", "Opponens pollicis",
     "Ask patient to touch tips of each finger with thumb in a sweeping arc. "
     "Lost in low median nerve injury."],
    ["Ochsner's Clasping Test", "FDS + FDP (lateral half)",
     "Ask patient to clasp hands — index finger of affected side fails to flex, "
     "remains extended ('pointing index')."],
    ["OK Sign / Circle Test", "FPL + FDP (index)",
     "Ask patient to make 'OK' sign. With AIN palsy, the circle cannot be made "
     "(pinch deformity: hyperextension of thumb IP + DIP of index)."],
    ["Bottle Sign", "APB (+ thumb opposition)",
     "Cannot fully close hand around a cylindrical bottle — thumb cannot abduct. "
     "Positive in proximal median nerve lesion."],
]
tt = Table(test_data, colWidths=[4*cm, 4*cm, 9*cm])
tt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), TABLE_HEAD),
    ("TEXTCOLOR", (0,0), (-1,0), white),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [TABLE_ALT, white]),
    ("FONTNAME", (0,1), (-1,-1), "Helvetica"),
    ("FONTSIZE", (0,0), (-1,-1), 9),
    ("GRID", (0,0), (-1,-1), 0.4, BORDER_GREY),
    ("VALIGN", (0,0), (-1,-1), "TOP"),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 5),
    ("WORDWRAP", (0,0), (-1,-1), True),
]))
story.append(tt)
spacer(3)

# =========================================================
# 8. COMPARISON TABLE: High vs Low Injury
# =========================================================
sec_header("8.  HIGH vs LOW MEDIAN NERVE INJURY — COMPARISON")

comp_data = [
    [Paragraph("<b>Feature</b>", ParagraphStyle("th5", fontSize=9, textColor=white,
               fontName="Helvetica-Bold")),
     Paragraph("<b>High Injury (above elbow)</b>", ParagraphStyle("th5", fontSize=9,
               textColor=white, fontName="Helvetica-Bold")),
     Paragraph("<b>Low Injury (at wrist)</b>", ParagraphStyle("th5", fontSize=9,
               textColor=white, fontName="Helvetica-Bold"))],
    ["Common cause", "Supracondylar # humerus", "Carpal tunnel syndrome / wrist laceration"],
    ["Deformity", "Hand of Benediction (on fist-making)", "Ape-hand / Simian hand (at rest)"],
    ["Pronation", "Lost", "Preserved"],
    ["Wrist flexion", "Weak (radial deviation)", "Preserved"],
    ["Thenar wasting", "Present", "Present"],
    ["Forearm muscles", "All affected", "Spared"],
    ["FDS / FDP (lat half)", "Paralysed", "Spared"],
    ["FPL", "Paralysed", "Spared"],
    ["Sensation on palm", "Lost (including palm)", "Central palm PRESERVED (palmar branch)"],
    ["AIN", "Often damaged", "Spared"],
]
ct = Table(comp_data, colWidths=[5*cm, 6*cm, 6*cm])
ct.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), TABLE_HEAD),
    ("TEXTCOLOR", (0,0), (-1,0), white),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [TABLE_ALT, white]),
    ("FONTNAME", (0,1), (-1,-1), "Helvetica"),
    ("FONTSIZE", (0,0), (-1,-1), 9),
    ("GRID", (0,0), (-1,-1), 0.4, BORDER_GREY),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(ct)
spacer(3)

# =========================================================
# 9. QUICK REVISION TABLE
# =========================================================
sec_header("9.  QUICK REVISION TABLE — MEDIAN NERVE AT A GLANCE")

qr_data = [
    [Paragraph("<b>Property</b>", ParagraphStyle("th6", fontSize=9, textColor=white,
               fontName="Helvetica-Bold")),
     Paragraph("<b>Detail</b>", ParagraphStyle("th6", fontSize=9, textColor=white,
               fontName="Helvetica-Bold"))],
    ["Root value", "C5, C6, C7, C8, T1"],
    ["Formed from", "Lateral cord (C6, C7) + Medial cord (C8, T1)"],
    ["Formation site", "Anterior to 3rd part of axillary artery"],
    ["Branches in arm", "NONE (occasional twig to pronator teres)"],
    ["Enters forearm via", "Between 2 heads of pronator teres"],
    ["Largest forearm branch", "Anterior interosseous nerve (AIN)"],
    ["Enters hand via", "Carpal tunnel (deep to flexor retinaculum)"],
    ["Hand motor (LOAF)", "Lat 2 Lumbricals, Opponens, Abductor PB, Flexor PB (sup)"],
    ["Autonomous sensory zone", "Tip of index finger"],
    ["Palmar cutaneous branch", "Arises 5 cm above wrist; superficial to retinaculum"],
    ["High injury deformity", "Hand of Benediction (on fist)"],
    ["Low injury deformity", "Ape-hand / Simian hand (at rest)"],
    ["Common entrapment", "Carpal tunnel syndrome (most common entrapment neuropathy)"],
    ["Test for APB", "Pen Test"],
    ["Test for FDS", "Ochsner's clasping test"],
]
qrt = Table(qr_data, colWidths=[6*cm, 11*cm])
qrt.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,0), TABLE_HEAD),
    ("TEXTCOLOR", (0,0), (-1,0), white),
    ("ROWBACKGROUNDS", (0,1), (-1,-1), [TABLE_ALT, white]),
    ("FONTNAME", (0,0), (0,-1), "Helvetica-Bold"),
    ("FONTNAME", (1,1), (-1,-1), "Helvetica"),
    ("FONTSIZE", (0,0), (-1,-1), 9),
    ("GRID", (0,0), (-1,-1), 0.4, BORDER_GREY),
    ("TOPPADDING", (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING", (0,0), (-1,-1), 6),
]))
story.append(qrt)
spacer(3)

# =========================================================
# 10. IMPORTANT EXAM POINTS
# =========================================================
sec_header("10.  IMPORTANT EXAM POINTS (HIGH-YIELD)")
bullet("Median nerve = <b>Laborer's nerve</b> (supplies forearm flexors) and "
       "<b>nerve of fine movements</b> in hand")
bullet("<b>Nerve of pronation</b> — both pronator muscles (teres + quadratus) "
       "are supplied by median nerve")
bullet("<b>Only nerve</b> to pass through the carpal tunnel (all others pass superficially or "
       "via Guyon's canal — ulnar nerve)")
bullet("<b>Palmar cutaneous branch</b> spared in CTS — a key differentiating feature")
bullet("<b>AIN</b> = only pure motor branch; no cutaneous component")
bullet("<b>Martin-Gruber anastomosis</b>: Communication between median and ulnar "
       "nerves in the forearm (varies clinical presentation of injuries)")
bullet("In CTS, symptoms are typically worse at night and relieved by shaking the "
       "hand — 'flick sign'")
bullet("Opposition of thumb = most important function tested for median nerve; "
       "supplies OPPONENS pollicis")
spacer(3)

# =========================================================
# Footer note
# =========================================================
story.append(HRFlowable(width="100%", thickness=0.5, color=BORDER_GREY, spaceAfter=4))
story.append(Paragraph(
    "Compiled from BD Chaurasia's Human Anatomy (Upper Limb), Gray's Anatomy for Students, "
    "and S. Das Clinical Surgery. For MBBS Anatomy Examination use only.",
    footer_s))

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

cd /tmp/workspace/median-nerve-pdf && python generate_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/median-nerve-pdf/

Your BDC-style Median Nerve PDF is ready:

Median Nerve BDC Answer

PDF Document · PDF


Here is what is covered inside the PDF (10 sections, exam-ready):
SectionContent
1Origin & Formation — root values C5–T1, lateral + medial cord contributions, site of formation
2Complete Course — axilla, arm, cubital fossa, forearm, hand
3All Branches — arm (nil), cubital fossa muscles, AIN, palmar cutaneous, recurrent (thenar), digital
4Motor Supply Table — all forearm + hand muscles with branch and root values; LOAF mnemonic
5Sensory Supply — lateral 3½ digits, nail beds, palm; autonomous zone = tip of index finger
6Applied Anatomy — High injury (hand of benediction), Low injury (ape-hand), CTS
7Clinical Tests — Pen test, Ochsner's clasping test, OK sign, Bottle sign, Tinel's, Phalen's
8High vs Low Injury comparison table
9Quick Revision Table — all key facts in one place
10High-yield exam points — Martin-Gruber anastomosis, palmar branch in CTS, etc.
Key mnemonics included:
  • LOAF — hand muscles of median nerve (Lumbricals 1&2, Opponens, Abductor PB, Flexor PB)
  • TAN — cubital fossa contents (Tendon of biceps – Artery (brachial) – Nerve (median))
  • High injury = Hand of Benediction (on making fist) | Low injury = Ape/Simian hand (at rest)
This is a shared conversation. Sign in to Orris to start your own chat.