Topography of neck

Reading File
Finding Sources
Finding Sources
Searching Images

neck topography triangles anatomy diagram

Anatomical and clinical study of the neck topography focusing on the cervical vagus nerve (CVN). Panel A is an anatomical diagram of the carotid triangle region, showing the spatial arrangement of the vagus nerve (yellow), common/internal carotid artery (red), and internal jugular vein (blue) relative to the laryngeal prominence. Orientations are marked as cranial (cr), caudal (cd), anterior (a), and posterior (p). Panel B is a clinical photograph of a cadaveric dissection showing the surgical exposure of the carotid sheath. In this view, the vagus nerve is positioned dorsally (posteriorly) between the common carotid artery (anterior) and the internal jugular vein (ventro-caudal). Blue arrows in panel B highlight the vagal artery—vessels located external to the epineurium of the CVN, a variation observed in nearly 50% of the study population. The content is designed for advanced medical education in surgical anatomy, particularly for procedures such as vagus nerve stimulation (VNS) electrode implantation.

Anatomical and clinical study of the neck topography focusing on the cervical vagus nerve (CVN). Panel A is an anatomical diagram of the carotid triangle region, showing the spatial arrangement of the vagus nerve (yellow), common/internal carotid artery (red), and internal jugular vein (blue) relative to the laryngeal prominence. Orientations are marked as cranial (cr), caudal (cd), anterior (a), and posterior (p). Panel B is a clinical photograph of a cadaveric dissection showing the surgical exposure of the carotid sheath. In this view, the vagus nerve is positioned dorsally (posteriorly) between the common carotid artery (anterior) and the internal jugular vein (ventro-caudal). Blue arrows in panel B highlight the vagal artery—vessels located external to the epineurium of the CVN, a variation observed in nearly 50% of the study population. The content is designed for advanced medical education in surgical anatomy, particularly for procedures such as vagus nerve stimulation (VNS) electrode implantation.

This photograph displays a high-fidelity, life-sized 3D-printed anatomical model of a human head, neck, and upper torso, based on scanned cadaveric prosections. The model utilizes a layered dissection approach to illustrate regional anatomy and topography. In the head and neck, a hemifacial dissection reveals superficial facial musculature (e.g., orbicularis oculi and oris) on one side, while the neck highlights neurovascular structures, including the carotid arteries (red) and jugular veins (blue) flanking the trachea. The thoracic region features a windowed dissection; the right side retains the anterior rib cage and lung, whereas the left side is opened to show the mediastinum containing the heart and major vessels like the aorta. Proximal upper extremities demonstrate musculoskeletal anatomy, specifically the deltoid and brachial muscles, interspersed with neurovascular bundles and plexuses. This anatomical diagram serves as a realistic educational tool for medical students to study spatial relationships and structural depth without the need for traditional formaldehyde-fixed specimens.

This photograph displays a high-fidelity, life-sized 3D-printed anatomical model of a human head, neck, and upper torso, based on scanned cadaveric prosections. The model utilizes a layered dissection approach to illustrate regional anatomy and topography. In the head and neck, a hemifacial dissection reveals superficial facial musculature (e.g., orbicularis oculi and oris) on one side, while the neck highlights neurovascular structures, including the carotid arteries (red) and jugular veins (blue) flanking the trachea. The thoracic region features a windowed dissection; the right side retains the anterior rib cage and lung, whereas the left side is opened to show the mediastinum containing the heart and major vessels like the aorta. Proximal upper extremities demonstrate musculoskeletal anatomy, specifically the deltoid and brachial muscles, interspersed with neurovascular bundles and plexuses. This anatomical diagram serves as a realistic educational tool for medical students to study spatial relationships and structural depth without the need for traditional formaldehyde-fixed specimens.

A clinical photograph of a human neck demonstrating surface anatomy landmarks for a lateral regional anesthesia approach. The image shows the right posterior triangle of the neck with skin markings in purple ink. The markings delineate the posterior border of the sternocleidomastoid muscle (SCM), the anterior border of the trapezius muscle (T), and the inferior belly of the omohyoid muscle (OM) as it crosses the triangle. These boundaries define the supraclavicular and occipital triangles within the posterior cervical region. The landmarks are used to identify the needle insertion point for interscalene or supraclavicular brachial plexus blocks, typically located approximately 1 cm superior to the clavicle. This visual serves as a topographical guide for medical education in anesthesiology and clinical anatomy, highlighting the relationship between palpable muscular structures and underlying neural plexuses.

A clinical photograph of a human neck demonstrating surface anatomy landmarks for a lateral regional anesthesia approach. The image shows the right posterior triangle of the neck with skin markings in purple ink. The markings delineate the posterior border of the sternocleidomastoid muscle (SCM), the anterior border of the trapezius muscle (T), and the inferior belly of the omohyoid muscle (OM) as it crosses the triangle. These boundaries define the supraclavicular and occipital triangles within the posterior cervical region. The landmarks are used to identify the needle insertion point for interscalene or supraclavicular brachial plexus blocks, typically located approximately 1 cm superior to the clavicle. This visual serves as a topographical guide for medical education in anesthesiology and clinical anatomy, highlighting the relationship between palpable muscular structures and underlying neural plexuses.

Anatomical Diagram: A historical medical illustration by Leonardo da Vinci, depicting a right lateral profile of the human head and neck. The drawing serves as an early study of gross anatomy and neuroanatomy. It features a detailed representation of the orbit, showing the eyeball as a spherical structure with attached extraocular muscles or neural pathways extending posteriorly toward the brain. The cranium is outlined, with fine hatching and cross-hatching used to provide topographical depth to the skull and facial features. The nasal cavity and oral region are visible in profile. Extending inferiorly from the base of the skull through the neck are several vertical, parallel structures representing major vessels (carotid arteries/jugular veins) and possibly nerves or muscular bundles. The illustration highlights the early Renaissance focus on understanding the relationship between surface anatomy and underlying physiological structures, particularly the visual system's connection to the central nervous system.

Anatomical Diagram: A historical medical illustration by Leonardo da Vinci, depicting a right lateral profile of the human head and neck. The drawing serves as an early study of gross anatomy and neuroanatomy. It features a detailed representation of the orbit, showing the eyeball as a spherical structure with attached extraocular muscles or neural pathways extending posteriorly toward the brain. The cranium is outlined, with fine hatching and cross-hatching used to provide topographical depth to the skull and facial features. The nasal cavity and oral region are visible in profile. Extending inferiorly from the base of the skull through the neck are several vertical, parallel structures representing major vessels (carotid arteries/jugular veins) and possibly nerves or muscular bundles. The illustration highlights the early Renaissance focus on understanding the relationship between surface anatomy and underlying physiological structures, particularly the visual system's connection to the central nervous system.

This Comparison Chart consists of an anatomical diagram of a human skeleton, functioning as a fracture topography map. It illustrates the distribution of fracture sites categorized by glucocorticoid (GC) exposure. The educational focus is on identifying patterns of skeletal fragility associated with steroid use. Teal circles represent patients with 'No corticosteroid use,' showing a high density of fractures in the distal forearm (radius/ulna), humerus, ribs, lumbar vertebrae, and lower extremities (tibia, fibula, and phalanges). Teal triangles represent patients with 'Systemic or inhaled corticosteroid use,' highlighting a specific concentration of fractures in the facial bones and proximal humerus. This visualization serves as a clinical epidemiological tool to compare fracture prevalence and anatomical localization between control groups and those at risk for glucocorticoid-induced osteoporosis. The diagram effectively demonstrates that while the distal forearm is the most frequent fracture site overall, steroid users may exhibit distinct patterns in facial and humeral involvement, emphasizing the clinical importance of monitoring skeletal health in patients on GC therapy.

This Comparison Chart consists of an anatomical diagram of a human skeleton, functioning as a fracture topography map. It illustrates the distribution of fracture sites categorized by glucocorticoid (GC) exposure. The educational focus is on identifying patterns of skeletal fragility associated with steroid use. Teal circles represent patients with 'No corticosteroid use,' showing a high density of fractures in the distal forearm (radius/ulna), humerus, ribs, lumbar vertebrae, and lower extremities (tibia, fibula, and phalanges). Teal triangles represent patients with 'Systemic or inhaled corticosteroid use,' highlighting a specific concentration of fractures in the facial bones and proximal humerus. This visualization serves as a clinical epidemiological tool to compare fracture prevalence and anatomical localization between control groups and those at risk for glucocorticoid-induced osteoporosis. The diagram effectively demonstrates that while the distal forearm is the most frequent fracture site overall, steroid users may exhibit distinct patterns in facial and humeral involvement, emphasizing the clinical importance of monitoring skeletal health in patients on GC therapy.

This clinical photograph displays an intraoperative view of a human neck dissection, specifically focusing on the submandibular region after the removal of the submandibular gland and level IB lymph nodes. The surgical field highlights key anatomical landmarks used for identifying deep vascular structures. Two superimposed geometric overlays delineate critical surgical triangles: the dashed white triangle indicates Lesser's triangle, and the solid white triangle indicates Pirogoff's triangle. Visible anatomical components include the mylohyoid muscle being retracted superiorly with a Langenbeck retractor, the hyoglossus muscle forming the floor of the triangles, and the hypoglossal nerve passing through the region. Surgical instruments, including forceps and retractors, are positioned to provide exposure. These landmarks are clinically significant for the safe identification and ligation of the lingual artery during radical or modified radical neck dissections. The image serves as an educational tool for head and neck surgery, demonstrating surgical anatomy and the boundaries of the submandibular workspace.

This clinical photograph displays an intraoperative view of a human neck dissection, specifically focusing on the submandibular region after the removal of the submandibular gland and level IB lymph nodes. The surgical field highlights key anatomical landmarks used for identifying deep vascular structures. Two superimposed geometric overlays delineate critical surgical triangles: the dashed white triangle indicates Lesser's triangle, and the solid white triangle indicates Pirogoff's triangle. Visible anatomical components include the mylohyoid muscle being retracted superiorly with a Langenbeck retractor, the hyoglossus muscle forming the floor of the triangles, and the hypoglossal nerve passing through the region. Surgical instruments, including forceps and retractors, are positioned to provide exposure. These landmarks are clinically significant for the safe identification and ligation of the lingual artery during radical or modified radical neck dissections. The image serves as an educational tool for head and neck surgery, demonstrating surgical anatomy and the boundaries of the submandibular workspace.

Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Loading Image
Loading Image
I now have all the essential material. Let me compile the comprehensive answer on topography of the neck.

Topography of the Neck

Sources: Gray's Anatomy for Students; Bailey & Love's Short Practice of Surgery, 28th ed.; K.J. Lee's Essential Otolaryngology

Overview

The neck is a tube providing continuity between the head and the trunk. It extends:
  • Anteriorly: from the lower border of the mandible to the upper surface of the manubrium of the sternum
  • Posteriorly: from the superior nuchal line on the occipital bone to the intervertebral disc between CVII and TI
Within the tube, four compartments provide longitudinal organization:
CompartmentPositionContents
VisceralAnteriorPharynx, larynx, trachea, esophagus, thyroid, parathyroids
VertebralPosteriorCervical vertebrae, spinal cord, cervical nerves, deep back muscles
Vascular (x2)Lateral (one each side)Common carotid artery, internal jugular vein, vagus nerve [X]
Compartments of the Neck - cross-section showing fascial layers and four compartments

Triangles of the Neck

The sternocleidomastoid (SCM) muscle is the key landmark dividing the neck into anterior and posterior triangles on each side.
Anterior and Posterior Triangles of the Neck

I. Anterior Triangle

Boundaries:
  • Medially - midline of the neck
  • Superiorly - inferior border of the mandible
  • Laterally/posteriorly - anterior border of the SCM
The anterior triangle is subdivided into four smaller triangles by the digastric and omohyoid muscles:
Borders and Subdivisions of the Anterior Triangle

1. Submandibular (Digastric) Triangle

  • Superior: inferior border of the mandible
  • Anterior: anterior belly of digastric
  • Posterior: posterior belly of digastric
  • Contents: submandibular gland, submandibular lymph nodes, facial artery and vein, hypoglossal nerve [XII], mylohyoid nerve

2. Submental (Suprahyoid) Triangle

  • A single midline triangle (unpaired)
  • Superior/anterior: symphysis menti (mandible)
  • Inferior: body of hyoid bone
  • Lateral boundaries: anterior belly of digastric (one on each side)
  • Contents: submental lymph nodes, small veins forming the anterior jugular vein

3. Carotid Triangle

  • Superior: posterior belly of digastric + stylohyoid
  • Anteroinferior: superior belly of omohyoid
  • Posterior: anterior border of SCM
  • Contents: common carotid artery, bifurcation into internal and external carotid arteries, internal jugular vein, vagus nerve [X], ansa cervicalis, hypoglossal nerve [XII], parts of XI, XII

4. Muscular (Strap Muscle) Triangle

  • Superior: superior belly of omohyoid
  • Lateral: anterior border of SCM
  • Medially: midline
  • Contents: strap muscles (sternohyoid, sternothyroid, thyrohyoid), thyroid and parathyroid glands, trachea, esophagus

II. Posterior Triangle

Boundaries:
  • Anteriorly: posterior border of SCM
  • Posteriorly: anterior border of trapezius
  • Basally: middle one-third of clavicle
  • Apex: occipital bone posterior to mastoid process (where SCM and trapezius meet)
  • Roof: investing layer of deep cervical fascia
  • Floor (superior to inferior): splenius capitis, levator scapulae, posterior/middle/anterior scalene muscles (covered by prevertebral fascia)
The inferior belly of omohyoid subdivides the posterior triangle into two:

1. Occipital Triangle (larger, superior)

  • Anterior: SCM | Posterior: trapezius | Inferior: omohyoid
  • Contents: accessory nerve [XI] (CN XI crosses here to reach trapezius), cervical plexus branches, occipital artery, external jugular vein, transverse cervical vessels, brachial plexus (trunks emerge between scalenus anterior and medius)

2. Omoclavicular (Subclavian/Subclavicular) Triangle (smaller, inferior)

  • Superior: omohyoid | Inferior: clavicle | Anterior: SCM
  • Contents: subclavian artery (3rd part), subclavian vein, suprascapular vessels, lower trunks of brachial plexus

Fascia of the Neck

Superficial Cervical Fascia

  • Contains the platysma - a thin sheet of muscle innervated by the cervical branch of facial nerve [VII]
  • Also encloses muscles of facial expression
  • Forms the main plane of resistance to deep spread of cellulitis
  • Extends from zygomatic process superiorly to the clavicle inferiorly

Deep Cervical Fascia

Has three main layers:
LayerAlso CalledEnclosesKey Features
Investing layerSuperficial layer of DCFTrapezius, SCM, parotid gland, submandibular gland, muscles of masticationSplits to surround SCM and trapezius; forms roof of posterior triangle; splits anteroinferiorly to form suprasternal space of Burns
Pretracheal layerMiddle/visceral layerStrap muscles (muscular division) + pharynx, larynx, trachea, esophagus, thyroid, parathyroid (visceral division)Forms pretracheal fascia and buccopharyngeal fascia; extends from base of skull to mediastinum
Prevertebral layerDeep layerParaspinous muscles, cervical vertebraeExtends from base of skull to diaphragm; creates danger space

Carotid Sheaths

  • Receive contributions from all three fascial layers
  • Surround the common carotid artery, internal jugular vein, and vagus nerve on each side
  • Run from base of skull to the root of the neck
Clinical note: The fascial layers and spaces define the routes by which deep neck infections can spread - the retropharyngeal space (between buccopharyngeal and prevertebral fasciae) communicates directly with the posterior mediastinum.

Superficial Veins of the Neck

VeinFormationCourseDrainage
External jugular veinPosterior auricular + posterior division of retromandibular vein (behind angle of mandible)Descends in superficial fascia, crosses SCM diagonally; pierces investing fascia just above clavicleInto subclavian vein
Anterior jugular veinSmall veins near hyoid boneDescends on either side of midline; joins jugular venous arch just above sternumInto external jugular or subclavian vein

Key Structures Accessible Through the Neck

Anterior Triangle

  • Carotid artery bifurcation (at level of C3/C4 - upper border of thyroid cartilage)
  • Internal jugular vein (central venous access)
  • Thyroid gland (lying anterior to trachea, C5-T1)
  • Trachea (begins at CVI, anterior to esophagus)
  • Esophagus (begins at CVI, posterior to trachea)
  • Vagus nerve, ansa cervicalis, hypoglossal nerve

Posterior Triangle

  • Brachial plexus trunks (emerge between anterior and middle scalene muscles)
  • Accessory nerve (CN XI) - most vulnerable nerve in the posterior triangle, passing through it to innervate trapezius
  • External jugular vein
  • Subclavian artery (3rd part) and vein

Cervical Lymph Nodes

The lymphatic drainage of the neck is organized into levels I-VI:
LevelLocationDrains
ISubmental and submandibularOral cavity, lips
IIUpper jugular (upper 1/3 carotid sheath; jugulodigastric node here)Nasopharynx, oropharynx, tonsils, posterior oral cavity, upper larynx
IIIMid-jugularOral cavity, nasopharynx, oropharynx, larynx, hypopharynx
IVLower jugularHypopharynx, larynx, thyroid, esophagus
VPosterior triangle nodesScalp, nasopharynx
VICentral compartment (anterior)Thyroid, trachea, esophagus
The jugular chain (levels II-IV) runs adjacent to the internal jugular vein and is the most commonly enlarged chain in head and neck malignancy. Metastatic SCC (80% of head and neck cancers) spreads from the oral cavity, nasopharynx, oropharynx, larynx, and hypopharynx primarily to levels II-IV. - Bailey & Love's Short Practice of Surgery, 28th ed.

Clinical Significance of the Neck Zones (Trauma)

In penetrating neck trauma, the neck is divided into three horizontal zones:
  • Zone I: Clavicle to cricoid cartilage (great vessels, trachea, esophagus, thoracic duct)
  • Zone II: Cricoid to angle of mandible (carotid and vertebral arteries, jugular veins, pharynx, trachea, esophagus) - most common zone of injury
  • Zone III: Above angle of mandible to base of skull (distal carotid, vertebral arteries, jugular veins, CN IX-XII)
This framework forms the backbone of neck anatomy as taught in surgical and anatomical texts. - Gray's Anatomy for Students; K.J. Lee's Essential Otolaryngology; Bailey & Love's Surgery

Create a summary document on neck topography I can reference

Asking for Preferences
Reading File
Running Command

ls -la /tmp/workspace/ 2>/dev/null || echo "workspace does not exist yet"

Running Command

mkdir -p /tmp/workspace/neck-topography

Writing File

~/neck-topography/build_pdf.py

#!/usr/bin/env python3
"""
Build a well-formatted PDF reference document on Neck Topography
using ReportLab.
"""

import urllib.request
import io
import os

from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, Image, PageBreak
)
from reportlab.platypus.flowables import BalancedColumns
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont

OUTPUT = "/tmp/workspace/neck-topography/Neck_Topography_Reference.pdf"

# ── Page setup ────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=2*cm, rightMargin=2*cm,
    topMargin=2.2*cm, bottomMargin=2.2*cm,
    title="Topography of the Neck – Reference Document",
    author="Orris Medical Library",
    subject="Anatomy – Neck Topography",
)

W, H = A4
PAGE_W = W - 4*cm   # usable width

# ── Colour palette ────────────────────────────────────────────────────────────
NAVY       = colors.HexColor("#1a3a5c")
TEAL       = colors.HexColor("#0e7490")
TEAL_LIGHT = colors.HexColor("#cffafe")
STEEL      = colors.HexColor("#475569")
AMBER      = colors.HexColor("#b45309")
AMBER_BG   = colors.HexColor("#fef3c7")
GREEN      = colors.HexColor("#15803d")
GREEN_BG   = colors.HexColor("#dcfce7")
GRAY_BG    = colors.HexColor("#f1f5f9")
WHITE      = colors.white
BLACK      = colors.black

# ── Styles ────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

def S(name, **kw):
    return ParagraphStyle(name, **kw)

TITLE    = S("DocTitle",   fontSize=22, textColor=WHITE,      alignment=TA_CENTER,
             fontName="Helvetica-Bold", leading=28, spaceAfter=0)
SUBTITLE = S("DocSub",     fontSize=11, textColor=TEAL_LIGHT, alignment=TA_CENTER,
             fontName="Helvetica", leading=16, spaceAfter=0)

H1 = S("H1", fontSize=13, textColor=WHITE,  fontName="Helvetica-Bold",
        leading=18, spaceBefore=14, spaceAfter=4, leftIndent=0)
H2 = S("H2", fontSize=11, textColor=NAVY,   fontName="Helvetica-Bold",
        leading=15, spaceBefore=10, spaceAfter=3, leftIndent=0)
H3 = S("H3", fontSize=10, textColor=TEAL,   fontName="Helvetica-Bold",
        leading=14, spaceBefore=7, spaceAfter=2, leftIndent=8)

BODY = S("Body", fontSize=9, textColor=BLACK, fontName="Helvetica",
         leading=13, spaceBefore=2, spaceAfter=2, leftIndent=0, alignment=TA_JUSTIFY)
BULLET = S("Bullet", fontSize=9, textColor=BLACK, fontName="Helvetica",
           leading=13, spaceBefore=1, spaceAfter=1, leftIndent=14,
           bulletIndent=4, bulletFontName="Helvetica")
SMALL  = S("Small", fontSize=8, textColor=STEEL, fontName="Helvetica",
           leading=11, spaceBefore=0, spaceAfter=2, alignment=TA_CENTER)
CAPTION= S("Caption", fontSize=7.5, textColor=STEEL, fontName="Helvetica-Oblique",
           leading=10, spaceBefore=1, spaceAfter=6, alignment=TA_CENTER)

def h1_block(text):
    """Teal banner heading."""
    tbl = Table([[Paragraph(text, H1)]], colWidths=[PAGE_W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), TEAL),
        ("ROUNDEDCORNERS", [4]),
        ("LEFTPADDING",  (0,0), (-1,-1), 8),
        ("RIGHTPADDING", (0,0), (-1,-1), 8),
        ("TOPPADDING",   (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0), (-1,-1), 5),
    ]))
    return tbl

def h2_block(text):
    tbl = Table([[Paragraph(text, H2)]], colWidths=[PAGE_W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), GRAY_BG),
        ("LINEBELOW",  (0,0), (-1,-1), 1.2, TEAL),
        ("LEFTPADDING",(0,0), (-1,-1), 6),
        ("TOPPADDING", (0,0), (-1,-1), 3),
        ("BOTTOMPADDING",(0,0),(-1,-1), 3),
    ]))
    return tbl

def bullet(text, indent=14):
    return Paragraph(f"• {text}", BULLET)

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

def note_box(text, bg=AMBER_BG, border=AMBER, label="CLINICAL NOTE"):
    content = f"<b><font color='#b45309'>{label}:</font></b> {text}"
    tbl = Table([[Paragraph(content, BODY)]], colWidths=[PAGE_W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("BOX",        (0,0), (-1,-1), 1, border),
        ("LEFTPADDING",(0,0), (-1,-1), 8),
        ("RIGHTPADDING",(0,0),(-1,-1), 8),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
    ]))
    return tbl

def green_box(text, label="KEY POINT"):
    content = f"<b><font color='#15803d'>{label}:</font></b> {text}"
    tbl = Table([[Paragraph(content, BODY)]], colWidths=[PAGE_W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), GREEN_BG),
        ("BOX",        (0,0), (-1,-1), 1, GREEN),
        ("LEFTPADDING",(0,0), (-1,-1), 8),
        ("RIGHTPADDING",(0,0),(-1,-1), 8),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
    ]))
    return tbl

def mk_table(header_row, data_rows, col_widths=None):
    if col_widths is None:
        n = len(header_row)
        col_widths = [PAGE_W / n] * n
    rows = [header_row] + data_rows
    tbl = Table(rows, colWidths=col_widths, repeatRows=1)
    style = [
        ("BACKGROUND",    (0,0), (-1,0),  NAVY),
        ("TEXTCOLOR",     (0,0), (-1,0),  WHITE),
        ("FONTNAME",      (0,0), (-1,0),  "Helvetica-Bold"),
        ("FONTSIZE",      (0,0), (-1,-1), 8),
        ("FONTNAME",      (0,1), (-1,-1), "Helvetica"),
        ("LEADING",       (0,0), (-1,-1), 12),
        ("ALIGN",         (0,0), (-1,-1), "LEFT"),
        ("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),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, GRAY_BG]),
        ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#cbd5e1")),
    ]
    tbl.setStyle(TableStyle(style))
    return tbl

def fetch_image_from_url(url, width, caption_text=None):
    """Download image from URL and return an Image flowable + optional caption."""
    items = []
    try:
        req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
        data = urllib.request.urlopen(req, timeout=12).read()
        img_io = io.BytesIO(data)
        img = Image(img_io, width=width)
        img.hAlign = "CENTER"
        items.append(img)
        if caption_text:
            items.append(Paragraph(caption_text, CAPTION))
    except Exception as e:
        items.append(Paragraph(f"[Image unavailable: {e}]", CAPTION))
    return items

# ── Cover banner ──────────────────────────────────────────────────────────────
def cover_banner():
    banner_data = [[Paragraph("TOPOGRAPHY OF THE NECK", TITLE)],
                   [Paragraph("Anatomy Reference Document  |  Gray's Anatomy for Students · Bailey & Love's · K.J. Lee's Otolaryngology", SUBTITLE)]]
    tbl = Table(banner_data, colWidths=[PAGE_W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), NAVY),
        ("TOPPADDING",    (0,0), (-1,-1), 14),
        ("BOTTOMPADDING", (0,0), (-1,-1), 14),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
        ("RIGHTPADDING",  (0,0), (-1,-1), 10),
        ("ROUNDEDCORNERS",[6]),
    ]))
    return tbl

# ═══════════════════════════════════════════════════════════════════════════════
# BUILD CONTENT
# ═══════════════════════════════════════════════════════════════════════════════
story = []

# ── Cover ─────────────────────────────────────────────────────────────────────
story.append(cover_banner())
story.append(Spacer(1, 0.4*cm))

# ── 1  Overview ───────────────────────────────────────────────────────────────
story.append(h1_block("1.  OVERVIEW"))
story.append(Spacer(1, 0.2*cm))
story.append(body(
    "The neck is a tube providing continuity between the head and trunk. "
    "It extends anteriorly from the lower border of the mandible to the upper surface of the "
    "manubrium of the sternum, and posteriorly from the superior nuchal line on the occipital "
    "bone to the intervertebral disc between C VII and T I vertebrae."
))
story.append(Spacer(1, 0.2*cm))

story.append(h2_block("Four Longitudinal Compartments"))
comp_data = [
    ["Compartment", "Position", "Contents"],
    ["Visceral", "Anterior", "Pharynx, larynx, trachea, esophagus, thyroid, parathyroids"],
    ["Vertebral", "Posterior", "Cervical vertebrae, spinal cord, cervical nerves, deep back muscles"],
    ["Vascular (×2)", "Lateral (one each side)", "Common carotid artery, internal jugular vein, vagus nerve [X]"],
]
story.append(mk_table(comp_data[0], comp_data[1:], [3.5*cm, 3.5*cm, PAGE_W-7*cm]))
story.append(Spacer(1, 0.3*cm))

# Neck compartments cross-section image
story.append(Paragraph("Cross-section of the Neck – Fascial Compartments", H3))
imgs = fetch_image_from_url(
    "https://cdn.orris.care/cdss_images/aa6e6140f69a0dcf7e3f5bce62d184630f389c00c56eedf4ab3743f6c1681e39.png",
    width=10*cm,
    caption_text="Fig. 1  Compartments and fascial layers of the neck (cross-section). "
                 "Source: Gray's Anatomy for Students."
)
story.extend(imgs)
story.append(Spacer(1, 0.3*cm))

# ── 2  Triangles overview ─────────────────────────────────────────────────────
story.append(h1_block("2.  TRIANGLES OF THE NECK"))
story.append(Spacer(1, 0.2*cm))
story.append(body(
    "The sternocleidomastoid (SCM) muscle is the key landmark, dividing the neck into an "
    "<b>anterior triangle</b> and a <b>posterior triangle</b> on each side. "
    "Each large triangle is further subdivided by smaller muscles."
))
story.append(Spacer(1, 0.2*cm))

# Lateral view image
imgs = fetch_image_from_url(
    "https://cdn.orris.care/cdss_images/815d4efef9de1c2864cf0647645cb8ce5d1aeffe352e212203d2e77248c4fb0c.png",
    width=10*cm,
    caption_text="Fig. 2  Anterior and posterior triangles of the neck (lateral view). "
                 "Source: Gray's Anatomy for Students."
)
story.extend(imgs)
story.append(Spacer(1, 0.2*cm))

# ── 2a  Anterior Triangle ─────────────────────────────────────────────────────
story.append(h2_block("2a.  Anterior Triangle"))
story.append(Spacer(1, 0.15*cm))

ant_bounds = [
    ["Boundary", "Structure"],
    ["Medial",    "Midline of the neck"],
    ["Superior",  "Inferior border of the mandible"],
    ["Lateral / posterior", "Anterior border of the SCM"],
]
story.append(mk_table(ant_bounds[0], ant_bounds[1:], [5*cm, PAGE_W-5*cm]))
story.append(Spacer(1, 0.25*cm))

story.append(Paragraph("Subdivisions of the Anterior Triangle", H3))

# Subdivisions image
imgs = fetch_image_from_url(
    "https://cdn.orris.care/cdss_images/c5e47c08b627b3edb056e749cd886481513041a5cb28a98ebac87503b8c71791.png",
    width=11*cm,
    caption_text="Fig. 3  Borders and subdivisions of the anterior triangle of the neck. "
                 "Source: Gray's Anatomy for Students."
)
story.extend(imgs)
story.append(Spacer(1, 0.2*cm))

sub_ant = [
    ["Sub-triangle", "Boundaries", "Key Contents"],
    ["Submandibular\n(Digastric)", 
     "Sup: inf. border mandible\nAnt: ant. belly digastric\nPost: post. belly digastric",
     "Submandibular gland & nodes, facial a. & v., hypoglossal n. [XII], mylohyoid n."],
    ["Submental\n(Suprahyoid)", 
     "Sup: mandibular symphysis\nInf: hyoid body\nLat: ant. belly digastric (each side)",
     "Submental lymph nodes; small veins forming ant. jugular vein. Unpaired/midline."],
    ["Carotid", 
     "Sup: post. belly digastric + stylohyoid\nAnt-inf: sup. belly omohyoid\nPost: ant. border SCM",
     "Common carotid bifurcation, int. & ext. carotid aa., int. jugular v., vagus n. [X], ansa cervicalis, CN XII"],
    ["Muscular\n(Strap)",
     "Sup: sup. belly omohyoid\nLat: ant. border SCM\nMed: midline",
     "Strap muscles (sternohyoid, sternothyroid, thyrohyoid), thyroid & parathyroid glands, trachea, esophagus"],
]
story.append(mk_table(sub_ant[0], sub_ant[1:], [3.2*cm, 5*cm, PAGE_W-8.2*cm]))
story.append(Spacer(1, 0.3*cm))

story.append(note_box(
    "The carotid triangle is the most clinically important subdivision. The carotid bifurcation "
    "lies at the level of C3/C4 (upper border of thyroid cartilage) and is palpable here. "
    "The carotid sinus and body are also accessible in this triangle.",
    label="CLINICAL NOTE"
))
story.append(Spacer(1, 0.35*cm))

# ── 2b  Posterior Triangle ────────────────────────────────────────────────────
story.append(h2_block("2b.  Posterior Triangle"))
story.append(Spacer(1, 0.15*cm))

post_bounds = [
    ["Boundary", "Structure"],
    ["Anterior",  "Posterior border of the SCM"],
    ["Posterior", "Anterior border of trapezius"],
    ["Base (inferior)", "Middle one-third of the clavicle"],
    ["Apex",      "Occipital bone posterior to mastoid process"],
    ["Roof",      "Investing layer of deep cervical fascia"],
    ["Floor (sup→inf)", "Splenius capitis, levator scapulae, posterior/middle/anterior scalene muscles (covered by prevertebral fascia)"],
]
story.append(mk_table(post_bounds[0], post_bounds[1:], [4.5*cm, PAGE_W-4.5*cm]))
story.append(Spacer(1, 0.25*cm))

story.append(Paragraph("Subdivisions of the Posterior Triangle", H3))
sub_post = [
    ["Sub-triangle", "Boundaries", "Key Contents"],
    ["Occipital\n(larger, superior)",
     "Ant: SCM\nPost: trapezius\nInf: inf. belly omohyoid",
     "Accessory n. [XI] (CN XI), cervical plexus branches, occipital a., external jugular v., transverse cervical & suprascapular vessels, brachial plexus trunks"],
    ["Omoclavicular\n(Subclavian, inferior)",
     "Sup: inf. belly omohyoid\nInf: clavicle\nAnt: SCM",
     "Subclavian a. (3rd part), subclavian v., suprascapular vessels, lower trunks of brachial plexus"],
]
story.append(mk_table(sub_post[0], sub_post[1:], [3.2*cm, 5*cm, PAGE_W-8.2*cm]))
story.append(Spacer(1, 0.25*cm))

story.append(note_box(
    "The accessory nerve (CN XI) is the most vulnerable nerve in the posterior triangle. "
    "It crosses the triangle superficially to reach the trapezius. Injury during lymph node "
    "biopsy or neck dissection leads to trapezius palsy (shoulder drop, winging of scapula).",
    label="SURGICAL HAZARD"
))
story.append(Spacer(1, 0.35*cm))

# ── 3  Fascia ─────────────────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1_block("3.  FASCIA OF THE NECK"))
story.append(Spacer(1, 0.2*cm))

story.append(h2_block("Superficial Cervical Fascia"))
story.append(bullet("Contains the <b>platysma</b> — a thin sheet of muscle innervated by the cervical branch of facial nerve [VII]"))
story.append(bullet("Extends from the zygomatic process superiorly to the clavicle inferiorly"))
story.append(bullet("Main plane of resistance to deep spread of cellulitis"))
story.append(bullet("Allows mobility of skin over deep neck structures"))
story.append(bullet("Subplatysmal space contains adipose tissue, sensory nerves, and vessels"))
story.append(Spacer(1, 0.2*cm))

story.append(h2_block("Deep Cervical Fascia (DCF) — Three Layers"))
fascia_data = [
    ["Layer", "Also Known As", "Encloses", "Boundaries / Significance"],
    ["Investing layer\n(Outer / Superficial DCF)", 
     "Superficial layer of DCF",
     "Trapezius, SCM, parotid gland, submandibular gland, muscles of mastication",
     "Sup: mandible, zygoma\nInf: clavicle, acromion, spine of scapula, manubrium\n"
     "Splits to surround SCM & trapezius; forms roof of posterior triangle; "
     "splits anteroinferiorly → suprasternal space of Burns; "
     "forms stylomandibular ligament (separates parapharyngeal & submandibular spaces)"],
    ["Pretracheal layer\n(Middle / Visceral layer)",
     "Visceral fascia",
     "Muscular div.: strap muscles\nVisceral div.: pharynx, larynx, trachea, esophagus, thyroid, parathyroid, buccinator, pharyngeal constrictors",
     "Sup: base of skull\nInf: mediastinum\n"
     "Forms pretracheal fascia (over trachea) and buccopharyngeal fascia (ant. border retropharyngeal space); "
     "forms midline raphe and pterygomandibular raphe"],
    ["Prevertebral layer\n(Deep layer)",
     "Prevertebral fascia",
     "Paraspinous muscles, cervical vertebrae",
     "Sup: base of skull\nInf: diaphragm (through posterior mediastinum)\n"
     "Two laminae create a fascial (danger) space; floor of posterior triangle"],
]
story.append(mk_table(fascia_data[0], fascia_data[1:], [3.2*cm, 3*cm, 4*cm, PAGE_W-10.2*cm]))
story.append(Spacer(1, 0.25*cm))

story.append(h2_block("Carotid Sheaths"))
story.append(body(
    "Each carotid sheath receives contributions from all three layers of the DCF and surrounds "
    "the <b>common carotid artery</b>, <b>internal jugular vein</b>, and <b>vagus nerve [X]</b> "
    "on each side. The sheaths run from the base of the skull to the root of the neck."
))
story.append(Spacer(1, 0.2*cm))

story.append(h2_block("Fascial Spaces and Clinical Significance"))
spaces = [
    ["Space", "Boundaries", "Clinical Relevance"],
    ["Retropharyngeal space", 
     "Ant: buccopharyngeal fascia\nPost: prevertebral fascia",
     "Communicates directly with posterior mediastinum → retropharyngeal abscess can descend to chest"],
    ["Prevertebral (danger) space",
     "Within the two laminae of prevertebral fascia",
     "Extends from base of skull through posterior mediastinum to diaphragm → rapid inferior spread of infection"],
    ["Suprasternal space of Burns",
     "Between two layers of investing fascia just above sternum",
     "Contains anterior jugular veins and jugular arch; site of anterior neck dissection landmarks"],
    ["Parapharyngeal space",
     "Between pharyngeal wall and ramus of mandible",
     "Conduit for spread of oropharyngeal, dental and parotid infections; contains internal carotid a., jugular v., CN IX–XII"],
]
story.append(mk_table(spaces[0], spaces[1:], [3.5*cm, 4.5*cm, PAGE_W-8*cm]))
story.append(Spacer(1, 0.35*cm))

# ── 4  Superficial veins ──────────────────────────────────────────────────────
story.append(h1_block("4.  SUPERFICIAL VEINS OF THE NECK"))
story.append(Spacer(1, 0.2*cm))

veins = [
    ["Vein", "Formation", "Course", "Drains Into"],
    ["External jugular vein (EJV)",
     "Posterior auricular v. + posterior div. of retromandibular v. (behind angle of mandible)",
     "Descends in superficial fascia crossing SCM diagonally; pierces investing fascia just above clavicle",
     "Subclavian vein"],
    ["Anterior jugular vein (AJV)",
     "Small veins converging near hyoid bone",
     "Descends either side of midline; communicates via jugular venous arch above sternum",
     "External jugular or subclavian vein"],
]
story.append(mk_table(veins[0], veins[1:], [3.5*cm, 4*cm, 4.5*cm, PAGE_W-12*cm]))
story.append(Spacer(1, 0.25*cm))
story.append(note_box(
    "The external jugular vein is visible through the skin and is a guide to venous pressure. "
    "The internal jugular vein lies within the carotid sheath and is used for central venous "
    "catheterisation — best approached at the apex of the carotid triangle (between the two heads "
    "of SCM), now routinely guided by ultrasound.",
    label="CLINICAL NOTE"
))
story.append(Spacer(1, 0.35*cm))

# ── 5  Muscles ────────────────────────────────────────────────────────────────
story.append(h1_block("5.  MUSCLES OF THE NECK"))
story.append(Spacer(1, 0.2*cm))

story.append(h2_block("Suprahyoid Muscles"))
sup_hy = [
    ["Muscle", "Origin → Insertion", "Action", "Nerve"],
    ["Digastric (ant. belly)", "Mandible (digastric fossa) → hyoid (via fibrous loop)", "Opens mouth; elevates hyoid", "Mylohyoid n. (V3)"],
    ["Digastric (post. belly)", "Mastoid notch → hyoid (via fibrous loop)", "Elevates hyoid; extends head", "Facial n. [VII]"],
    ["Stylohyoid", "Styloid process → hyoid body", "Elevates & retracts hyoid", "Facial n. [VII]"],
    ["Mylohyoid", "Mylohyoid line of mandible → hyoid & median raphe", "Elevates floor of mouth & hyoid", "Mylohyoid n. (V3)"],
    ["Geniohyoid", "Inf. mental spine (mandible) → hyoid body", "Elevates/protracts hyoid; depresses mandible", "C1 via hypoglossal n. [XII]"],
]
story.append(mk_table(sup_hy[0], sup_hy[1:], [2.8*cm, 4.5*cm, 4*cm, PAGE_W-11.3*cm]))
story.append(Spacer(1, 0.2*cm))

story.append(h2_block("Infrahyoid (Strap) Muscles"))
inf_hy = [
    ["Muscle", "Origin → Insertion", "Action", "Nerve"],
    ["Sternohyoid", "Post. sternoclavicular joint & manubrium → hyoid body", "Depresses hyoid", "Ansa cervicalis (C1–C3)"],
    ["Sternothyroid", "Post. manubrium → thyroid cartilage (oblique line)", "Depresses larynx", "Ansa cervicalis (C1–C3)"],
    ["Thyrohyoid", "Thyroid cartilage (oblique line) → hyoid greater horn", "Depresses hyoid; elevates larynx", "C1 via CN XII"],
    ["Omohyoid (2 bellies)", "Sup. border scapula → hyoid body (via tendon anchored to clavicle)", "Depresses & fixes hyoid", "Ansa cervicalis (C1–C3)"],
]
story.append(mk_table(inf_hy[0], inf_hy[1:], [2.8*cm, 5*cm, 3.5*cm, PAGE_W-11.3*cm]))
story.append(Spacer(1, 0.25*cm))

story.append(green_box(
    "The omohyoid passes through BOTH triangles — its superior belly is in the anterior triangle "
    "and its inferior belly crosses the posterior triangle, subdividing it into the occipital and "
    "omoclavicular (subclavian) triangles.",
    label="KEY POINT"
))
story.append(Spacer(1, 0.35*cm))

# ── 6  Nerves ─────────────────────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1_block("6.  KEY NERVES IN THE NECK"))
story.append(Spacer(1, 0.2*cm))

story.append(h2_block("Ansa Cervicalis"))
story.append(body(
    "The ansa cervicalis is a nerve loop formed by anterior rami of C1–C3 that innervates "
    "all infrahyoid (strap) muscles except thyrohyoid."
))
story.append(bullet("<b>Superior root</b>: C1 fibres carried along the hypoglossal nerve [XII]; descends between internal jugular vein and carotid arteries; innervates superior belly of omohyoid and upper parts of sternohyoid and sternothyroid"))
story.append(bullet("<b>Inferior root</b>: Direct branch from cervical plexus (C2, C3); descends medial or lateral to internal jugular vein; innervates inferior belly of omohyoid and lower parts of sternohyoid and sternothyroid"))
story.append(Spacer(1, 0.2*cm))

story.append(h2_block("Cervical Plexus (C1–C4)"))
cerv_pl = [
    ["Branch", "Type", "Distribution"],
    ["Lesser occipital n.",   "Sensory", "Skin of scalp behind the ear"],
    ["Great auricular n.",    "Sensory", "Skin over parotid region, ear, angle of jaw"],
    ["Transverse cervical n.","Sensory", "Anterior skin of neck"],
    ["Supraclavicular nn.",   "Sensory", "Skin of lower neck, shoulder, upper chest"],
    ["Phrenic n. (C3,4,5)",   "Motor",   "Diaphragm (principal motor supply) + pericardium/mediastinal pleura"],
    ["Ansa cervicalis",       "Motor",   "All infrahyoid muscles except thyrohyoid"],
]
story.append(mk_table(cerv_pl[0], cerv_pl[1:], [4*cm, 2.5*cm, PAGE_W-6.5*cm]))
story.append(Spacer(1, 0.2*cm))

story.append(h2_block("Other Important Nerves"))
other_nn = [
    ["Nerve", "Location in Neck", "Clinical Importance"],
    ["Vagus [X]", "Within carotid sheath, between CCA and IJV", "Cardiac, pulmonary, GI branches; recurrent laryngeal n. from vagus innervates intrinsic laryngeal muscles"],
    ["Hypoglossal [XII]", "Emerges at skull base; loops forward across carotid arteries to tongue", "Carries C1 fibres (thyrohyoid, geniohyoid); damaged in anterior neck surgery"],
    ["Accessory [XI]", "Enters posterior triangle from behind SCM; crosses to trapezius", "Most vulnerable nerve in posterior triangle; injury → trapezius palsy"],
    ["Sympathetic trunk", "Posterior to carotid sheath, anterior to prevertebral muscles", "Superior/middle/inferior cervical ganglia; injury → Horner syndrome (ptosis, miosis, anhidrosis, enophthalmos)"],
]
story.append(mk_table(other_nn[0], other_nn[1:], [3.5*cm, 4.5*cm, PAGE_W-8*cm]))
story.append(Spacer(1, 0.35*cm))

# ── 7  Lymph nodes ────────────────────────────────────────────────────────────
story.append(h1_block("7.  CERVICAL LYMPH NODE LEVELS"))
story.append(Spacer(1, 0.2*cm))
story.append(body(
    "A standard level system (I–VI) is used to describe cervical node locations, crucial for "
    "oncological surgery and staging."
))
story.append(Spacer(1, 0.1*cm))

levels = [
    ["Level", "Node Group", "Location", "Primary Drainage"],
    ["I",   "Submental (Ia) &\nSubmandibular (Ib)", "Below mandible, above hyoid", "Lips, anterior oral cavity, chin, submandibular gland"],
    ["II",  "Upper jugular\n(jugulodigastric)", "Upper third of carotid sheath; large jugulodigastric node", "Nasopharynx, oropharynx, tonsils, posterior oral cavity, upper larynx"],
    ["III", "Mid-jugular", "Middle third of carotid sheath", "Oral cavity, nasopharynx, oropharynx, larynx, hypopharynx"],
    ["IV",  "Lower jugular", "Lower third of carotid sheath", "Hypopharynx, larynx, thyroid, cervical esophagus"],
    ["V",   "Posterior triangle", "Posterior triangle (Occipital Va; Transverse cervical Vb)", "Scalp, nasopharynx, thyroid"],
    ["VI",  "Central compartment", "Between carotid arteries, below hyoid", "Thyroid, trachea, esophagus, larynx"],
]
story.append(mk_table(levels[0], levels[1:], [1.8*cm, 3.5*cm, 4*cm, PAGE_W-9.3*cm]))
story.append(Spacer(1, 0.2*cm))

story.append(note_box(
    "Metastatic spread of squamous cell carcinoma (80% of head and neck cancers) most commonly "
    "arises from the upper aerodigestive tract (oral cavity, nasopharynx, oropharynx, larynx, "
    "hypopharynx) and preferentially involves levels II–IV. Level II nodes palpable along the "
    "anterior border of SCM are the most common site of initial enlargement.",
    label="ONCOLOGY NOTE"
))
story.append(Spacer(1, 0.35*cm))

# ── 8  Trauma zones ───────────────────────────────────────────────────────────
story.append(h1_block("8.  ZONES OF THE NECK (PENETRATING TRAUMA)"))
story.append(Spacer(1, 0.2*cm))

zones = [
    ["Zone", "Limits", "Structures at Risk", "Management"],
    ["I",  "Clavicle → cricoid cartilage", "Great vessels (subclavian, innominate), trachea, esophagus, thoracic duct, lung apices, brachial plexus roots", "Most dangerous; often needs thoracotomy; angiography/CT-A essential"],
    ["II", "Cricoid → angle of mandible", "Common/internal/external carotid aa., vertebral aa., jugular vv., pharynx, trachea, esophagus, CN X, XII", "Most accessible; surgical exploration often indicated"],
    ["III","Angle of mandible → base of skull", "Distal internal carotid a., vertebral aa., jugular vv., CN IX–XII, parotid gland", "Difficult surgical access; angiography/endovascular preferred"],
]
story.append(mk_table(zones[0], zones[1:], [1.5*cm, 3.5*cm, 5.5*cm, PAGE_W-10.5*cm]))
story.append(Spacer(1, 0.25*cm))
story.append(note_box(
    "Zone II is the most commonly injured zone in penetrating neck trauma. "
    "Hard signs of vascular injury (expanding haematoma, absent pulse, bruit, haemorrhage) "
    "mandate immediate surgical exploration regardless of zone.",
    label="EMERGENCY NOTE"
))
story.append(Spacer(1, 0.35*cm))

# ── 9  Quick-reference summary ────────────────────────────────────────────────
story.append(PageBreak())
story.append(h1_block("9.  QUICK-REFERENCE SUMMARY CARD"))
story.append(Spacer(1, 0.2*cm))

summary_rows = [
    [Paragraph("<b>SCM muscle</b>", BODY),
     Paragraph("Divides neck into anterior and posterior triangles on each side", BODY)],
    [Paragraph("<b>Anterior triangle</b>", BODY),
     Paragraph("4 sub-triangles: submandibular, submental, carotid, muscular", BODY)],
    [Paragraph("<b>Posterior triangle</b>", BODY),
     Paragraph("2 sub-triangles: occipital (large) + omoclavicular (small)", BODY)],
    [Paragraph("<b>Omohyoid</b>", BODY),
     Paragraph("Passes through both triangles; forms key subdivision landmark in posterior triangle", BODY)],
    [Paragraph("<b>DCF layers</b>", BODY),
     Paragraph("Investing → Pretracheal (visceral) → Prevertebral; + carotid sheaths", BODY)],
    [Paragraph("<b>Carotid bifurcation</b>", BODY),
     Paragraph("C3/C4 level (upper border thyroid cartilage); within carotid triangle", BODY)],
    [Paragraph("<b>CN XI in neck</b>", BODY),
     Paragraph("Crosses posterior triangle; injury = trapezius palsy (shoulder drop)", BODY)],
    [Paragraph("<b>Ansa cervicalis</b>", BODY),
     Paragraph("C1–C3 loop; innervates all strap muscles except thyrohyoid (C1 via CN XII)", BODY)],
    [Paragraph("<b>Horner syndrome</b>", BODY),
     Paragraph("Injury to cervical sympathetic trunk (posterior to carotid sheath)", BODY)],
    [Paragraph("<b>Retropharyngeal space</b>", BODY),
     Paragraph("Direct route from posterior pharynx to posterior mediastinum", BODY)],
    [Paragraph("<b>Lymph node levels</b>", BODY),
     Paragraph("I–VI; levels II–IV (jugular chain) = most common site of metastatic SCC", BODY)],
    [Paragraph("<b>Trauma zones</b>", BODY),
     Paragraph("I (clavicle–cricoid), II (cricoid–angle of jaw), III (jaw–skull base)", BODY)],
]
summ_tbl = Table(summary_rows, colWidths=[4.5*cm, PAGE_W-4.5*cm])
summ_tbl.setStyle(TableStyle([
    ("FONTSIZE",      (0,0), (-1,-1), 9),
    ("LEADING",       (0,0), (-1,-1), 13),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
    ("RIGHTPADDING",  (0,0), (-1,-1), 6),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("ROWBACKGROUNDS",(0,0), (-1,-1), [TEAL_LIGHT, WHITE]),
    ("GRID",          (0,0), (-1,-1), 0.3, colors.HexColor("#94a3b8")),
]))
story.append(summ_tbl)
story.append(Spacer(1, 0.4*cm))

# ── Footer note ───────────────────────────────────────────────────────────────
story.append(HRFlowable(width=PAGE_W, thickness=0.5, color=STEEL))
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph(
    "Sources: Gray's Anatomy for Students (9780323934237) · Bailey & Love's Short Practice of Surgery, 28th ed. (9780367548117) · "
    "K.J. Lee's Essential Otolaryngology (9781260122237) · Cummings Otolaryngology Head and Neck Surgery (9780323612173)",
    SMALL
))

# ── Build ─────────────────────────────────────────────────────────────────────
def add_page_number(canvas, doc):
    canvas.saveState()
    canvas.setFont("Helvetica", 8)
    canvas.setFillColor(STEEL)
    page_num = canvas.getPageNumber()
    canvas.drawRightString(W - 2*cm, 1.2*cm, f"Page {page_num}")
    canvas.drawString(2*cm, 1.2*cm, "Topography of the Neck  |  Orris Medical Library")
    canvas.restoreState()

doc.build(story, onFirstPage=add_page_number, onLaterPages=add_page_number)
print(f"PDF saved to: {OUTPUT}")
Running Command

cd /tmp/workspace/neck-topography && python build_pdf.py 2>&1

Editing File

~/neck-topography/build_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/neck-topography/build_pdf.py'
Running Command

cd /tmp/workspace/neck-topography && python build_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/neck-topography/Neck_Topography_Reference.pdf

Your PDF reference document is ready. Here's what it contains:

Neck Topography Reference

PDF Document · PDF


Document contents (4.6 MB, A4, multi-page):
  1. Overview - Four longitudinal compartments with a cross-section diagram showing fascial layers
  2. Triangles of the Neck - Lateral view diagram + full boundary tables for anterior and posterior triangles, including all sub-triangles with boundaries and contents
  3. Fascia of the Neck - All three DCF layers (investing, pretracheal, prevertebral), carotid sheaths, and clinical fascial spaces (retropharyngeal, danger space, space of Burns, parapharyngeal)
  4. Superficial Veins - External and anterior jugular veins
  5. Muscles - Suprahyoid and infrahyoid strap muscles with origins, insertions, actions, and nerve supply
  6. Key Nerves - Ansa cervicalis, cervical plexus, vagus, hypoglossal, accessory nerve, sympathetic trunk
  7. Cervical Lymph Node Levels I-VI - With drainage territories and oncology note on SCC spread
  8. Trauma Zones I-III - Structures at risk and management principles
  9. Quick-Reference Summary Card - 12-row at-a-glance table for rapid review
Sourced from Gray's Anatomy for Students, Bailey & Love's 28th edition, K.J. Lee's Essential Otolaryngology, and Cummings Otolaryngology.
This is a shared conversation. Sign in to Orris to start your own chat.