Arteries and it's branches of lower limb for medical student in detailed notes

Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Loading Image
Loading Image
Loading Image
Finding Sources
Reading File
Loading Image
Finding Sources
Loading Image
I now have comprehensive information and excellent diagrams from the textbooks. Let me compile the detailed notes.

Arteries of the Lower Limb — Detailed Notes for Medical Students

Sources: Gray's Anatomy for Students; THIEME Atlas of Anatomy — General Anatomy and Musculoskeletal System

Overview: Arterial Sequence

The arterial supply of the lower limb follows a sequential chain from the abdominal aorta to the toes:
Abdominal Aorta
    └── Common Iliac Artery
            ├── Internal Iliac Artery (gluteal/obturator supply)
            └── External Iliac Artery
                    └── Femoral Artery (at inguinal ligament)
                            └── Popliteal Artery (at adductor hiatus)
                                    ├── Anterior Tibial Artery → Dorsalis Pedis Artery
                                    └── Posterior Tibial Artery
                                            └── Fibular (Peroneal) Artery
Overview of arteries from aorta to femoral including deep thigh branches — Gray's Anatomy for Students

1. External Iliac Artery

  • Arises as one of the two terminal branches of the common iliac artery
  • Descends along the medial border of the psoas major muscle
  • Passes under the inguinal ligament through the lacuna vasorum to enter the thigh
  • Becomes the femoral artery at the level of the inguinal ligament

Branches of the External Iliac Artery

BranchSupply
Inferior epigastric arteryAnterior abdominal wall; has a pubic branch
Deep circumflex iliac arteryIliac fossa, anterolateral abdominal wall
Cremasteric artery (males)Cremaster muscle
Artery of round ligament (females)Round ligament of uterus

2. Femoral Artery

Femoral artery in the anterior thigh showing course through the femoral triangle and adductor canal — Gray's Anatomy for Students
Origin: Continuation of the external iliac artery, begins as the vessel passes under the inguinal ligament.
Course:
  1. Enters the femoral triangle on the anterior thigh
  2. Palpable midway between the ASIS and pubic symphysis, just inferior to the inguinal ligament
  3. Descends through the femoral triangle, then continues into the adductor canal (Hunter's canal)
  4. Exits through the adductor hiatus in the adductor magnus → becomes the popliteal artery
Clinical note: The femoral artery is the most common site for vascular access (cardiac catheterization, angiography). The vessel is also used to palpate the pulse in shock.

Branches of the Femoral Artery

a) Superficial cutaneous branches (arise in the femoral triangle)

BranchSupply
Superficial epigastric arteryLower anterior abdominal wall skin
Superficial circumflex iliac arterySkin over iliac fossa
Superficial external pudendal arterySkin of perineum/scrotum/labia
Deep external pudendal arteryDeeper perineal structures

b) Deep Artery of the Thigh (Profunda Femoris)

  • Largest branch of the femoral artery
  • Arises from the lateral side of the femoral artery in the femoral triangle, ~3–5 cm below the inguinal ligament
  • Passes posteriorly between pectineus and adductor longus, then between adductor longus and adductor brevis, eventually perforating adductor magnus to anastomose with popliteal artery branches behind the knee
  • Main blood supply to the thigh
Sub-branches of the deep artery of the thigh:
i. Lateral Circumflex Femoral Artery
  • Arises from the lateral side of the profunda femoris (occasionally from the femoral artery directly)
  • Passes deep to sartorius and rectus femoris; divides into three branches:
    • Ascending branch → passes deep to tensor fasciae latae → circles femoral neck → anastomoses with medial circumflex femoral artery → supplies femoral head and neck
    • Descending branch → descends deep to rectus femoris → pierces vastus lateralis → anastomoses with popliteal branches near knee
    • Transverse branch → circles the proximal femoral shaft → joins the cruciate anastomosis (with medial circumflex femoral, inferior gluteal, and first perforating arteries)
ii. Medial Circumflex Femoral Artery
  • Arises from the posteromedial aspect of the profunda femoris
  • Passes medially between pectineus and iliopsoas, then between obturator externus and adductor brevis
  • Gives a small branch through the acetabular notch → supplies femoral head (anastomoses with obturator artery's acetabular branch)
  • Divides into two major branches deep to quadratus femoris:
    • One branch → trochanteric fossa → connects with gluteal and lateral circumflex femoral arteries
    • Other branch → forms part of the anastomotic network around the hip (cruciate anastomosis)
Clinical importance: The medial circumflex femoral artery is the primary blood supply to the femoral head. Fracture of the femoral neck can disrupt this vessel → avascular necrosis of the femoral head.
iii. Perforating Arteries (3)
  • All three penetrate the adductor magnus near its attachment to the linea aspera to enter the posterior compartment of the thigh
  • First originates above adductor brevis, second anterior to it, third below it
  • They form an interconnected longitudinal channel:
    • Superiorly → anastomose around the hip (cruciate anastomosis)
    • Inferiorly → anastomose with popliteal artery branches

c) Descending Genicular Artery

  • Arises from the femoral artery just before it exits the adductor hiatus
  • Contributes to the anastomotic network around the knee joint

3. Popliteal Artery

Popliteal artery and its branches in the posterior leg — Gray's Anatomy for Students
Origin: Continuation of the femoral artery at the adductor hiatus
Course:
  • Runs through the popliteal fossa (deepest structure in the fossa)
  • Passes between the gastrocnemius and popliteus muscles
  • Passes under the tendinous arch of the soleus muscle
  • Divides at the inferior border of the popliteus into:
    • Anterior tibial artery
    • Posterior tibial artery
Clinical note: The popliteal artery is the second most common site for peripheral aneurysms. It is also the most common site of entrapment (popliteal artery entrapment syndrome). The pulse is palpable in the popliteal fossa with the knee slightly flexed.

Branches of the Popliteal Artery

BranchNotes
Sural arteries (2 large, one each side)Supplies gastrocnemius, soleus, and plantaris muscles
Superior medial genicular arteryPart of the knee anastomotic network
Superior lateral genicular arteryPart of the knee anastomotic network
Middle genicular arterySupplies cruciate ligaments and joint capsule
Inferior medial genicular arteryPart of the knee anastomotic network
Inferior lateral genicular arteryPart of the knee anastomotic network
Posterior tibial recurrent arteryJoins knee anastomosis
The superior and inferior genicular vessels form an arterial anastomotic network around the knee — clinically important as a collateral pathway when the popliteal artery is obstructed.

4. Anterior Tibial Artery

Origin: Larger of the two terminal branches of the popliteal artery
Course:
  • Immediately passes anteriorly through the aperture in the upper part of the interosseous membrane
  • Enters and supplies the anterior compartment of the leg
  • Descends between tibialis anterior and extensor hallucis longus
  • Passes under the extensor retinaculum at the ankle
  • Continues onto the dorsum of the foot as the dorsalis pedis artery

Branches of the Anterior Tibial Artery

BranchSupply
Anterior tibial recurrent arteryKnee anastomosis (tibiofibular joint)
Muscular branchesAnterior compartment muscles
Anterior medial malleolar arteryMedial ankle network
Anterior lateral malleolar arteryLateral ankle network

5. Dorsalis Pedis Artery

Dorsalis pedis artery and its branches on the dorsum of the right foot — Gray's Anatomy for Students
Origin: Continuation of the anterior tibial artery as it crosses the ankle joint
Course:
  • Passes over the dorsal surface of the talus, navicular, and intermediate cuneiform
  • Passes inferiorly between the two heads of the first dorsal interosseous muscle → becomes the deep plantar artery → joins the deep plantar arch in the sole
Pulse palpation: Between the tendons of extensor hallucis longus and extensor digitorum longus to the second toe, over the tarsal bones. This is a key peripheral pulse assessment point.

Branches of the Dorsalis Pedis Artery

BranchSupply
Medial tarsal arteriesMedial tarsal bones and soft tissues
Lateral tarsal arteriesLateral tarsal bones; anastomose with ankle network
Arcuate arteryPasses laterally over dorsal metatarsal bases → gives 3 dorsal metatarsal arteriesdorsal digital arteries to adjacent sides of digits II–V + lateral side of digit V
First dorsal metatarsal arteryDorsal digital branches to adjacent sides of great toe and second toe
Deep plantar arteryTerminal branch; passes to sole between heads of first dorsal interosseous → completes the deep plantar arch

6. Posterior Tibial Artery

Origin: Direct continuation of the popliteal artery (larger terminal branch)
Course:
  • Descends through the deep region of the posterior compartment of the leg
  • Lies on the superficial surfaces of tibialis posterior and flexor digitorum longus
  • Passes through the tarsal tunnel behind the medial malleolus
  • Divides in the sole into:
    • Medial plantar artery
    • Lateral plantar artery
Pulse palpation: Behind the medial malleolus — another key peripheral pulse site.

Branches of the Posterior Tibial Artery

BranchNotes
Circumflex fibular arteryPasses through soleus → circles fibular neck → joins knee anastomosis
Fibular (Peroneal) artery (major branch)See below
Medial plantar arteryTerminal branch; supplies medial sole and hallux
Lateral plantar arteryTerminal branch; forms the deep plantar arch with deep plantar artery of dorsalis pedis

7. Fibular (Peroneal) Artery

  • Arises from the posterior tibial artery shortly after it enters the leg
  • Descends in the posterior compartment along the medial crest of the fibula, between tibialis posterior and flexor hallucis longus
  • Supplies adjacent muscles and bone in the posterior compartment
  • Also sends branches laterally through the intermuscular septum → fibular (peroneal) muscles in the lateral compartment
  • Distally gives a perforating branch → passes anteriorly through the inferior aperture in the interosseous membrane → anastomoses with a branch of the anterior tibial artery
  • Terminates in a network over the lateral surface of the calcaneus
The fibular artery is often the dominant leg artery when the anterior or posterior tibial arteries are absent or hypoplastic (a common anatomical variant).

8. Plantar Arteries (Sole of the Foot)

Plantar arteries of the sole of the right foot — THIEME Atlas of Anatomy

Medial Plantar Artery

  • Smaller terminal branch of the posterior tibial artery
  • Passes along the medial side of the sole
  • Divides into:
    • Superficial branch → supplies hallux and skin of medial sole
    • Deep branch → anastomoses with the deep plantar arch

Lateral Plantar Artery

  • Larger terminal branch; passes laterally and anteriorly across the sole
  • Curves medially across the bases of the metatarsals as the deep plantar arch
  • Deep plantar arch (formed by lateral plantar artery + deep plantar artery from dorsalis pedis) gives rise to:
    • Plantar metatarsal arteries (×4) → common plantar digital arteriesproper plantar digital arteries to all toes

9. Gluteal Arterial Supply (from Internal Iliac)

ArteryExit PointSupply
Superior gluteal arteryGreater sciatic foramen, above piriformisGluteus medius, minimus, tensor fasciae latae; anastomoses with lateral circumflex femoral
Inferior gluteal arteryGreater sciatic foramen, below piriformisGluteus maximus, short lateral rotators, proximal hamstrings
Obturator arteryObturator canalMedial compartment of thigh (adductor muscles); acetabular branch supplies femoral head

10. Cruciate Anastomosis

A critical anastomosis around the hip joint formed by:
  • Inferior gluteal artery (internal iliac)
  • Medial circumflex femoral artery (transverse branch)
  • Lateral circumflex femoral artery (transverse branch)
  • First perforating artery (from profunda femoris)
This network provides collateral flow if the femoral artery is ligated above the profunda femoris origin.

11. Genicular Anastomosis (around the knee)

Formed by branches of:
  • Femoral artery (descending genicular artery)
  • Popliteal artery (medial and lateral superior genicular, middle genicular, medial and lateral inferior genicular)
  • Anterior tibial artery (anterior tibial recurrent artery)
  • Circumflex fibular artery
Provides collateral circulation around the knee joint.

Summary Table: Key Pulses to Palpate

PulseLocation
FemoralMidway between ASIS and pubic symphysis, inferior to inguinal ligament
PoplitealPopliteal fossa, knee slightly flexed
Dorsalis pedisDorsum of foot, between tendons of EHL and EDL to 2nd toe
Posterior tibialBehind the medial malleolus

Clinical Correlates

ConditionVessel AffectedMechanism
Avascular necrosis of femoral headMedial circumflex femoral arteryFemoral neck fracture disrupts arterial supply
Peripheral arterial diseaseFemoral → popliteal → tibialAtherosclerotic stenosis/occlusion → claudication
Popliteal aneurysmPopliteal arteryMost common peripheral aneurysm; risk of thrombosis/embolism
Compartment syndromeAll leg arteriesIncreased pressure in fascial compartment compresses vessels
Ankle-Brachial Index (ABI)Dorsalis pedis / posterior tibial vs. brachialABI < 0.9 = peripheral arterial disease

Sources: Gray's Anatomy for Students (9780323934237); THIEME Atlas of Anatomy — General Anatomy and Musculoskeletal System (9781626237186)

Create a detailed study guide PDF with arterial branches and tables for exam preparation

Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"

Running Command

mkdir -p /home/daytona/workspace/lower-limb-arteries && python3 -c "import reportlab; print('reportlab ok')" && python3 -c "from reportlab.lib.pagesizes import A4; print('A4 ok')"

Writing File

~/lower-limb-arteries/generate_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import ListFlowable, ListItem

# ── Colour palette ──────────────────────────────────────────────────────────
CRIMSON    = colors.HexColor('#C0392B')
DARK_RED   = colors.HexColor('#8B0000')
LIGHT_RED  = colors.HexColor('#FADBD8')
MID_RED    = colors.HexColor('#E8A0A0')
NAVY       = colors.HexColor('#1A2639')
SLATE      = colors.HexColor('#2C3E50')
LIGHT_GRAY = colors.HexColor('#F4F6F7')
MID_GRAY   = colors.HexColor('#BDC3C7')
WHITE      = colors.white
GOLD       = colors.HexColor('#F39C12')
TEAL       = colors.HexColor('#117A65')
LIGHT_TEAL = colors.HexColor('#A9DFBF')

PAGE_W, PAGE_H = A4
MARGIN = 2 * cm

# ── Document ────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    '/home/daytona/workspace/lower-limb-arteries/Lower_Limb_Arteries_Study_Guide.pdf',
    pagesize=A4,
    rightMargin=MARGIN, leftMargin=MARGIN,
    topMargin=2.2*cm, bottomMargin=2.2*cm,
    title='Arteries of the Lower Limb – Medical Study Guide',
    author='Orris Medical Education'
)

styles = getSampleStyleSheet()

# Custom paragraph styles
def make_style(name, parent='Normal', **kw):
    s = ParagraphStyle(name, parent=styles[parent])
    for k, v in kw.items():
        setattr(s, k, v)
    return s

title_style = make_style('Title2', 'Normal',
    fontSize=26, textColor=WHITE, alignment=TA_CENTER,
    fontName='Helvetica-Bold', leading=32)

subtitle_style = make_style('Subtitle2', 'Normal',
    fontSize=13, textColor=colors.HexColor('#FADBD8'), alignment=TA_CENTER,
    fontName='Helvetica', leading=18)

h1_style = make_style('H1', 'Normal',
    fontSize=15, textColor=WHITE, fontName='Helvetica-Bold',
    leading=20, leftIndent=0)

h2_style = make_style('H2', 'Normal',
    fontSize=12, textColor=DARK_RED, fontName='Helvetica-Bold',
    leading=16, spaceBefore=8, spaceAfter=4)

h3_style = make_style('H3', 'Normal',
    fontSize=10.5, textColor=NAVY, fontName='Helvetica-Bold',
    leading=14, spaceBefore=6, spaceAfter=3)

body_style = make_style('Body2', 'Normal',
    fontSize=9.5, textColor=SLATE, fontName='Helvetica',
    leading=14, alignment=TA_JUSTIFY, spaceAfter=4)

bullet_style = make_style('Bullet2', 'Normal',
    fontSize=9.5, textColor=SLATE, fontName='Helvetica',
    leading=13, leftIndent=14, spaceAfter=2)

note_style = make_style('Note', 'Normal',
    fontSize=9, textColor=colors.HexColor('#6E2F2F'), fontName='Helvetica-Oblique',
    leading=13, leftIndent=10, rightIndent=10, spaceAfter=4,
    backColor=colors.HexColor('#FEF9E7'))

label_style = make_style('Label', 'Normal',
    fontSize=8.5, textColor=WHITE, fontName='Helvetica-Bold',
    alignment=TA_CENTER, leading=12)

tbl_header = make_style('TblHdr', 'Normal',
    fontSize=9, textColor=WHITE, fontName='Helvetica-Bold',
    alignment=TA_CENTER, leading=12)

tbl_body = make_style('TblBody', 'Normal',
    fontSize=8.8, textColor=SLATE, fontName='Helvetica',
    alignment=TA_LEFT, leading=12)

tbl_body_c = make_style('TblBodyC', 'Normal',
    fontSize=8.8, textColor=SLATE, fontName='Helvetica',
    alignment=TA_CENTER, leading=12)

# ── Helper functions ─────────────────────────────────────────────────────────
def section_header(text, color=CRIMSON):
    """Returns a coloured section header band."""
    tbl = Table([[Paragraph(text, h1_style)]], colWidths=[PAGE_W - 2*MARGIN])
    tbl.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), color),
        ('ROUNDEDCORNERS', [4,4,4,4]),
        ('TOPPADDING', (0,0), (-1,-1), 7),
        ('BOTTOMPADDING', (0,0), (-1,-1), 7),
        ('LEFTPADDING', (0,0), (-1,-1), 10),
    ]))
    return tbl

def sub_section(text):
    return Paragraph(text, h2_style)

def sub_sub_section(text):
    return Paragraph(text, h3_style)

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

def bullet(text):
    return Paragraph(f'• {text}', bullet_style)

def note(text):
    return Paragraph(f'⚡ <b>Clinical note:</b> {text}', note_style)

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

def hr():
    return HRFlowable(width='100%', thickness=0.5, color=MID_GRAY, spaceAfter=4, spaceBefore=4)

def make_table(headers, rows, col_widths, header_color=CRIMSON, alt_color=LIGHT_RED):
    header_row = [Paragraph(h, tbl_header) for h in headers]
    data = [header_row]
    for i, row in enumerate(rows):
        cells = []
        for cell in row:
            cells.append(Paragraph(str(cell), tbl_body))
        data.append(cells)

    style = [
        ('BACKGROUND', (0,0), (-1,0), header_color),
        ('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, LIGHT_RED]),
        ('GRID', (0,0), (-1,-1), 0.4, MID_GRAY),
        ('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
        ('TOPPADDING', (0,0), (-1,-1), 5),
        ('BOTTOMPADDING', (0,0), (-1,-1), 5),
        ('LEFTPADDING', (0,0), (-1,-1), 6),
        ('RIGHTPADDING', (0,0), (-1,-1), 6),
        ('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, colors.HexColor('#FDEDEC')]),
    ]
    t = Table(data, colWidths=col_widths)
    t.setStyle(TableStyle(style))
    return t

def tree_box(lines, title=None):
    """A bordered box for arterial trees."""
    content = []
    if title:
        content.append(Paragraph(title, h3_style))
    for line in lines:
        p = Paragraph(f'<font face="Courier" size="9">{line}</font>', body_style)
        content.append(p)
    tbl = Table([[c] for c in content], colWidths=[PAGE_W - 2*MARGIN - 20])
    tbl.setStyle(TableStyle([
        ('BOX', (0,0), (-1,-1), 1, CRIMSON),
        ('BACKGROUND', (0,0), (-1,-1), LIGHT_GRAY),
        ('LEFTPADDING', (0,0), (-1,-1), 12),
        ('TOPPADDING', (0,0), (-1,-1), 3),
        ('BOTTOMPADDING', (0,0), (-1,-1), 3),
    ]))
    return tbl

# ────────────────────────────────────────────────────────────────────────────
# BUILD STORY
# ────────────────────────────────────────────────────────────────────────────
story = []

# ══════════════════════════════════════════════════════════════════════════════
# COVER PAGE
# ══════════════════════════════════════════════════════════════════════════════
cover_data = [[
    Paragraph('ARTERIES OF THE', title_style),
    Paragraph('LOWER LIMB', title_style),
    sp(8),
    Paragraph('Complete Study Guide for Medical Examinations', subtitle_style),
    sp(4),
    Paragraph('Femoral · Popliteal · Tibial · Plantar · Dorsalis Pedis', subtitle_style),
]]
cover_tbl = Table([[row] for row in cover_data[0]],
                  colWidths=[PAGE_W - 2*MARGIN])
cover_tbl.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (-1,-1), DARK_RED),
    ('TOPPADDING', (0,0), (-1,-1), 6),
    ('BOTTOMPADDING', (0,0), (-1,-1), 6),
    ('LEFTPADDING', (0,0), (-1,-1), 20),
    ('RIGHTPADDING', (0,0), (-1,-1), 20),
    ('ROUNDEDCORNERS', [8,8,8,8]),
]))
story.append(sp(30))
story.append(cover_tbl)
story.append(sp(20))

# Quick-reference info box
info_data = [
    [Paragraph('<b>Contents</b>', h2_style)],
    [Paragraph('1.  Arterial Overview &amp; Sequence', body_style)],
    [Paragraph('2.  External Iliac Artery', body_style)],
    [Paragraph('3.  Femoral Artery &amp; Branches', body_style)],
    [Paragraph('4.  Deep Artery of the Thigh (Profunda Femoris)', body_style)],
    [Paragraph('5.  Popliteal Artery &amp; Genicular Network', body_style)],
    [Paragraph('6.  Anterior Tibial Artery', body_style)],
    [Paragraph('7.  Dorsalis Pedis Artery', body_style)],
    [Paragraph('8.  Posterior Tibial Artery', body_style)],
    [Paragraph('9.  Fibular (Peroneal) Artery', body_style)],
    [Paragraph('10. Plantar Arteries &amp; Deep Plantar Arch', body_style)],
    [Paragraph('11. Cruciate &amp; Genicular Anastomoses', body_style)],
    [Paragraph('12. Peripheral Pulses — Exam Quick Reference', body_style)],
    [Paragraph('13. High-Yield Clinical Correlates', body_style)],
    [Paragraph('14. Master Summary Tables', body_style)],
]
info_tbl = Table(info_data, colWidths=[PAGE_W - 2*MARGIN])
info_tbl.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (0,0), NAVY),
    ('TEXTCOLOR', (0,0), (0,0), WHITE),
    ('BACKGROUND', (0,1), (-1,-1), LIGHT_GRAY),
    ('TOPPADDING', (0,0), (-1,-1), 5),
    ('BOTTOMPADDING', (0,0), (-1,-1), 5),
    ('LEFTPADDING', (0,0), (-1,-1), 12),
    ('BOX', (0,0), (-1,-1), 0.8, NAVY),
    ('LINEBELOW', (0,0), (-1,-2), 0.3, MID_GRAY),
]))
story.append(info_tbl)
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 1 — ARTERIAL OVERVIEW
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('1.  ARTERIAL OVERVIEW & SEQUENCE'))
story.append(sp(8))
story.append(body('The lower limb is supplied by a sequential chain of arteries originating from the abdominal aorta. Each vessel continues as the next at a named transition point.'))
story.append(sp(6))

tree_lines = [
    'Abdominal Aorta  (bifurcates at L4)',
    '  └─ Common Iliac Artery',
    '        ├─ Internal Iliac Artery  → gluteal &amp; obturator branches',
    '        └─ External Iliac Artery',
    '              └─ FEMORAL ARTERY  (at inguinal ligament)',
    '                    ├─ Superficial branches  (epigastric, circumflex iliac, pudendal)',
    '                    ├─ Deep Artery of Thigh (Profunda Femoris)',
    '                    │     ├─ Lateral Circumflex Femoral  (ascending/descending/transverse)',
    '                    │     ├─ Medial Circumflex Femoral',
    '                    │     └─ 3× Perforating Arteries',
    '                    └─ POPLITEAL ARTERY  (at adductor hiatus)',
    '                          ├─ Sural arteries  (gastrocnemius, soleus)',
    '                          ├─ Genicular branches  (5 pairs → knee anastomosis)',
    '                          ├─ ANTERIOR TIBIAL ARTERY',
    '                          │     └─ DORSALIS PEDIS ARTERY',
    '                          │           ├─ Medial &amp; Lateral tarsal arteries',
    '                          │           ├─ Arcuate artery → 3 dorsal metatarsal arteries',
    '                          │           ├─ 1st dorsal metatarsal artery',
    '                          │           └─ Deep plantar artery → deep plantar arch',
    '                          └─ POSTERIOR TIBIAL ARTERY',
    '                                ├─ Circumflex fibular artery',
    '                                ├─ FIBULAR (PERONEAL) ARTERY',
    '                                │     └─ Perforating branch, calcaneal branches',
    '                                ├─ MEDIAL PLANTAR ARTERY  (superficial + deep)',
    '                                └─ LATERAL PLANTAR ARTERY → DEEP PLANTAR ARCH',
    '                                      └─ 4× Plantar metatarsal → digital arteries',
]
story.append(tree_box(tree_lines))
story.append(sp(6))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 2 — EXTERNAL ILIAC
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('2.  EXTERNAL ILIAC ARTERY'))
story.append(sp(8))
story.append(body('The external iliac artery arises as one of the two terminal branches of the common iliac artery at the L5/S1 level. It descends along the medial border of psoas major and passes under the inguinal ligament through the <b>lacuna vasorum</b>, at which point it becomes the femoral artery.'))
story.append(sp(6))

headers = ['Branch', 'Supply / Notes']
rows = [
    ['Inferior epigastric artery', 'Anterior abdominal wall; gives pubic branch (anastomoses with obturator artery — "corona mortis" variant)'],
    ['Deep circumflex iliac artery', 'Iliac fossa, anterolateral abdominal wall muscles'],
    ['Cremasteric artery (♂)', 'Cremaster muscle; accompanies spermatic cord'],
    ['Artery of round ligament (♀)', 'Round ligament of uterus'],
]
story.append(make_table(headers, rows, [5.5*cm, 11.5*cm]))
story.append(sp(4))
story.append(note('"Corona mortis" — aberrant obturator artery (from inferior epigastric) may be injured during pelvic fracture fixation or hernia repair.'))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 3 — FEMORAL ARTERY
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('3.  FEMORAL ARTERY'))
story.append(sp(8))
story.append(sub_section('Origin & Course'))
story.append(body('Continuation of the external iliac artery beginning at the inguinal ligament. Enters the femoral triangle and passes vertically through it, then continues into the adductor canal (Hunter\'s canal). Exits through the <b>adductor hiatus</b> in adductor magnus → becomes the popliteal artery.'))
story.append(sp(5))

course_data = [
    [Paragraph('<b>Region</b>', tbl_header), Paragraph('<b>Key Relationships</b>', tbl_header)],
    [Paragraph('Femoral triangle', tbl_body), Paragraph('Bounded by inguinal ligament (sup), sartorius (lat), adductor longus (med). Contains: artery, vein, nerve (lateral to medial = VAN reversed: Nerve–Artery–Vein)', tbl_body)],
    [Paragraph('Adductor (Hunter\'s) canal', tbl_body), Paragraph('Lies deep to sartorius; bounded by vastus medialis (ant/lat) and adductor longus/magnus (post). Femoral artery + vein + saphenous nerve pass through.', tbl_body)],
    [Paragraph('Adductor hiatus', tbl_body), Paragraph('Opening in adductor magnus. Artery exits → becomes popliteal artery. Femoral vein becomes popliteal vein.', tbl_body)],
]
course_tbl = Table(course_data, colWidths=[4*cm, 13*cm])
course_tbl.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (-1,0), NAVY),
    ('BACKGROUND', (0,1), (-1,-1), WHITE),
    ('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, LIGHT_GRAY]),
    ('GRID', (0,0), (-1,-1), 0.4, MID_GRAY),
    ('VALIGN', (0,0), (-1,-1), 'TOP'),
    ('TOPPADDING', (0,0), (-1,-1), 5),
    ('BOTTOMPADDING', (0,0), (-1,-1), 5),
    ('LEFTPADDING', (0,0), (-1,-1), 6),
]))
story.append(course_tbl)
story.append(sp(6))

story.append(sub_section('Pulse Palpation'))
story.append(body('<b>Femoral pulse:</b> Palpate midway between the anterior superior iliac spine (ASIS) and pubic symphysis, just inferior to the inguinal ligament — the <b>mid-inguinal point</b>.'))
story.append(sp(4))
story.append(note('The femoral artery is the most common access site for cardiac catheterisation, IABP insertion, and arterial angiography. Femoral arteriovenous fistula is a recognised complication of catheterisation.'))
story.append(sp(6))

story.append(sub_section('Superficial Branches (arise in femoral triangle)'))
headers = ['Branch', 'Distribution']
rows = [
    ['Superficial epigastric a.', 'Skin of lower anterior abdominal wall; ascends toward umbilicus'],
    ['Superficial circumflex iliac a.', 'Skin over iliac crest; used as skin flap pedicle in plastic surgery'],
    ['Superficial external pudendal a.', 'Skin of upper scrotum / labia majora and inner thigh'],
    ['Deep external pudendal a.', 'Deeper perineal skin and scrotum / labia'],
    ['Descending genicular a.', 'Arises just before adductor hiatus; contributes to knee anastomosis'],
]
story.append(make_table(headers, rows, [6*cm, 11*cm]))
story.append(sp(10))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 4 — DEEP ARTERY OF THIGH
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('4.  DEEP ARTERY OF THE THIGH (PROFUNDA FEMORIS)', color=NAVY))
story.append(sp(8))
story.append(body('Largest branch of the femoral artery; the <b>principal blood supply to the thigh</b>. Arises from the lateral side of the femoral artery ~3–5 cm below the inguinal ligament. Passes posteriorly between pectineus and adductor longus, then descends between adductor longus and adductor magnus, eventually perforating adductor magnus to anastomose with popliteal branches.'))
story.append(sp(6))

story.append(sub_section('A. Lateral Circumflex Femoral Artery'))
story.append(body('Arises from the lateral side of profunda femoris (occasionally from the femoral artery directly). Passes deep to sartorius and rectus femoris then divides into three branches:'))
story.append(sp(4))
headers = ['Branch', 'Course & Supply']
rows = [
    ['Ascending branch', 'Deep to tensor fasciae latae → circles femoral neck → anastomoses with medial circumflex femoral a. → supplies neck and head of femur'],
    ['Descending branch', 'Deep to rectus femoris → pierces vastus lateralis → anastomoses with popliteal branches near knee; used as free flap (anterolateral thigh flap)'],
    ['Transverse branch', 'Circles proximal femoral shaft → joins CRUCIATE ANASTOMOSIS (with medial circumflex femoral, inferior gluteal, 1st perforating arteries)'],
]
story.append(make_table(headers, rows, [4*cm, 13*cm], header_color=TEAL))
story.append(sp(6))

story.append(sub_section('B. Medial Circumflex Femoral Artery'))
story.append(body('Arises from posteromedial profunda femoris. Passes medially between pectineus and iliopsoas, then between obturator externus and adductor brevis. Gives a branch through the acetabular notch to the femoral head.'))
story.append(sp(4))
story.append(body('<b>Terminal branches:</b>'))
story.append(bullet('Ascending branch → trochanteric fossa → connects with gluteal and LCFA'))
story.append(bullet('Transverse branch → anastomoses around the hip (cruciate anastomosis)'))
story.append(sp(4))
story.append(note('The medial circumflex femoral artery is the DOMINANT blood supply to the femoral head. Femoral neck fractures — especially displaced intracapsular types — disrupt this vessel → risk of avascular necrosis (AVN). AVN risk: subcapital > transcervical > basicervical.'))
story.append(sp(6))

story.append(sub_section('C. Perforating Arteries (×3)'))
story.append(body('All three penetrate through adductor magnus near the linea aspera to enter the <b>posterior compartment of the thigh</b>:'))
story.append(sp(3))
headers = ['Perforating Artery', 'Origin Relative to Adductor Brevis', 'Notes']
rows = [
    ['1st perforating a.', 'Above the muscle', 'Part of cruciate anastomosis; also supplies long and short head of biceps femoris'],
    ['2nd perforating a.', 'Anterior to the muscle', 'Supplies biceps femoris, semimembranosus, semitendinosus'],
    ['3rd perforating a.', 'Below the muscle', 'Forms longitudinal anastomosis with branches of the popliteal a.'],
]
story.append(make_table(headers, rows, [4*cm, 5.5*cm, 7.5*cm], header_color=NAVY))
story.append(sp(4))
story.append(note('The perforating arteries form an interconnected longitudinal channel in the posterior thigh — important collateral pathway when the femoral artery is occluded.'))
story.append(sp(10))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 5 — POPLITEAL ARTERY
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('5.  POPLITEAL ARTERY & GENICULAR NETWORK'))
story.append(sp(8))
story.append(body('Continuation of the femoral artery beginning at the adductor hiatus. Runs through the popliteal fossa — the <b>deepest structure</b> in the fossa (posterior to the vein and tibial nerve). Passes between the gastrocnemius and popliteus, traverses under the tendinous arch of the soleus, and divides at the inferior border of popliteus into the anterior and posterior tibial arteries.'))
story.append(sp(4))
story.append(note('The popliteal pulse is palpated in the popliteal fossa with the knee slightly flexed. It is the second most common site for peripheral aneurysms (after the aorta); 60% are bilateral. Popliteal artery entrapment syndrome (PAES) presents as exertional calf claudication in young athletes.'))
story.append(sp(6))

story.append(sub_section('Branches of the Popliteal Artery'))
headers = ['Branch', 'Number', 'Supply / Notes']
rows = [
    ['Superior medial genicular a.', '×1', 'Above medial femoral condyle → knee anastomosis'],
    ['Superior lateral genicular a.', '×1', 'Above lateral femoral condyle → knee anastomosis'],
    ['Middle genicular a.', '×1', 'Penetrates posterior capsule → cruciate ligaments, synovium'],
    ['Inferior medial genicular a.', '×1', 'Below medial tibial plateau → knee anastomosis'],
    ['Inferior lateral genicular a.', '×1', 'Below lateral tibial plateau → knee anastomosis'],
    ['Sural arteries', '×2', 'Large; supply gastrocnemius, soleus, plantaris'],
    ['Posterior tibial recurrent a.', '×1', 'Tibiofibular joint → knee anastomosis'],
    ['Anterior tibial artery', 'Terminal', 'Passes through interosseous membrane → anterior compartment'],
    ['Posterior tibial artery', 'Terminal', 'Direct continuation → posterior & lateral compartments + sole'],
]
story.append(make_table(headers, rows, [6*cm, 2.5*cm, 8.5*cm]))
story.append(sp(6))

story.append(sub_section('Genicular Anastomosis'))
story.append(body('Formed around the knee by contributions from: descending genicular a. (femoral), 5 genicular branches (popliteal), anterior tibial recurrent a. (anterior tibial), and circumflex fibular a. (posterior tibial). This network allows collateral flow if the popliteal artery is ligated above the inferior genicular vessels.'))
story.append(sp(10))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 6 — ANTERIOR TIBIAL
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('6.  ANTERIOR TIBIAL ARTERY', color=TEAL))
story.append(sp(8))
story.append(body('<b>Origin:</b> Larger of the two terminal branches of the popliteal artery at the inferior border of popliteus.'))
story.append(sp(4))
story.append(sub_section('Course'))
story.append(body('Passes <b>anteriorly through the aperture in the upper part of the interosseous membrane</b> to enter the anterior compartment of the leg. Descends between tibialis anterior (medially) and extensor hallucis longus (laterally). At the ankle passes deep to the extensor retinaculum and continues onto the dorsum of the foot as the <b>dorsalis pedis artery</b>.'))
story.append(sp(6))

headers = ['Branch', 'Distribution']
rows = [
    ['Anterior tibial recurrent a.', 'Joins genicular anastomosis; tibiofibular joint'],
    ['Anterior medial malleolar a.', 'Medial aspect of ankle; joins medial malleolar network'],
    ['Anterior lateral malleolar a.', 'Lateral aspect of ankle; joins lateral malleolar network'],
    ['Muscular branches', 'All muscles of anterior compartment (tibialis anterior, EHL, EDL, fibularis tertius)'],
]
story.append(make_table(headers, rows, [6*cm, 11*cm], header_color=TEAL))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 7 — DORSALIS PEDIS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('7.  DORSALIS PEDIS ARTERY', color=TEAL))
story.append(sp(8))
story.append(body('<b>Origin:</b> Continuation of anterior tibial artery as it crosses the ankle joint (anterior to the ankle).'))
story.append(sp(4))
story.append(sub_section('Course'))
story.append(body('Passes over the dorsal surface of the talus, navicular, and intermediate cuneiform bones. Passes inferiorly between the two heads of the first dorsal interosseous muscle → enters the sole as the <b>deep plantar artery</b> → completes the deep plantar arch.'))
story.append(sp(4))
story.append(body('<b>Pulse palpation:</b> Between the tendons of extensor hallucis longus and extensor digitorum longus to the second toe, on top of the tarsal bones.'))
story.append(sp(6))

headers = ['Branch', 'Course & Supply']
rows = [
    ['Medial tarsal arteries', 'Pass medially over tarsal bones; anastomose with medial malleolar vessels'],
    ['Lateral tarsal arteries', 'Pass laterally over tarsal bones; anastomose with lateral malleolar and arcuate arteries'],
    ['Arcuate artery', 'Passes laterally over dorsal metatarsal bases → gives 3 dorsal metatarsal arteries (to digits II–V) + dorsal digital artery to lateral side of 5th digit'],
    ['1st dorsal metatarsal artery', 'Dorsal digital branches to adjacent sides of great toe and 2nd toe'],
    ['Deep plantar artery (terminal)', 'Passes between heads of 1st dorsal interosseous → sole → completes DEEP PLANTAR ARCH with lateral plantar artery'],
]
story.append(make_table(headers, rows, [5*cm, 12*cm], header_color=TEAL))
story.append(sp(10))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 8 — POSTERIOR TIBIAL
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('8.  POSTERIOR TIBIAL ARTERY'))
story.append(sp(8))
story.append(body('<b>Origin:</b> Direct continuation of the popliteal artery (the larger terminal branch). Supplies the posterior and lateral compartments of the leg and the sole of the foot.'))
story.append(sp(4))
story.append(sub_section('Course'))
story.append(body('Descends through the deep posterior compartment on the superficial surfaces of tibialis posterior and flexor digitorum longus. Accompanied by two venae comitantes and the tibial nerve. Passes through the <b>tarsal tunnel</b> (behind the medial malleolus, under the flexor retinaculum), then divides in the sole into <b>medial</b> and <b>lateral plantar arteries</b>.'))
story.append(sp(4))
story.append(body('<b>Pulse palpation:</b> Palpate in the groove behind the medial malleolus, halfway between the medial malleolus and the heel.'))
story.append(sp(6))

headers = ['Branch', 'Notes']
rows = [
    ['Circumflex fibular a.', 'Passes through soleus → circles fibular neck → joins knee anastomosis'],
    ['Fibular (peroneal) a.', 'Major branch — see Section 9'],
    ['Nutrient artery of tibia', 'Enters posterior tibial surface'],
    ['Muscular branches', 'Posterior compartment muscles (gastrocnemius, soleus, flexors)'],
    ['Medial plantar a. (terminal)', 'See Section 10'],
    ['Lateral plantar a. (terminal)', 'See Section 10 — forms deep plantar arch'],
]
story.append(make_table(headers, rows, [5*cm, 12*cm]))
story.append(sp(4))
story.append(note('Order of structures in the tarsal tunnel (medial to lateral): Tom, Dick AND Harry — Tibialis posterior, flexor Digitorum longus, posterior tibial Artery + vein, tibial Nerve, flexor Hallucis longus.'))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 9 — FIBULAR ARTERY
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('9.  FIBULAR (PERONEAL) ARTERY', color=NAVY))
story.append(sp(8))
story.append(body('<b>Origin:</b> Largest branch of the posterior tibial artery, arising ~2.5 cm below the bifurcation of the popliteal artery.'))
story.append(sp(4))
story.append(sub_section('Course'))
story.append(body('Descends in the deep posterior compartment along the medial crest of the fibula, between tibialis posterior (medially) and flexor hallucis longus (laterally). Terminates in a network over the lateral calcaneus.'))
story.append(sp(6))

headers = ['Branch', 'Distribution']
rows = [
    ['Muscular branches', 'Posterior compartment muscles; pierces intermuscular septum → fibularis (peroneus) muscles in lateral compartment'],
    ['Nutrient artery of fibula', 'Fibular shaft'],
    ['Perforating branch (distal)', 'Passes anteriorly through inferior aperture in interosseous membrane → anastomoses with anterior tibial artery; may become dominant if anterior tibial is small'],
    ['Posterior lateral malleolar branch', 'Lateral malleolar network'],
    ['Calcaneal branches (terminal)', 'Lateral calcaneus; joins calcaneal anastomosis'],
]
story.append(make_table(headers, rows, [5.5*cm, 11.5*cm], header_color=NAVY))
story.append(sp(4))
story.append(note('The fibular artery is often the dominant vessel in "peroneal type" peripheral arterial disease patterns. Its perforating branch can substitute for an absent or occluded anterior tibial artery. The fibula (with its blood supply via the fibular artery) is used as a vascularised bone graft.'))
story.append(sp(10))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 10 — PLANTAR ARTERIES
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('10.  PLANTAR ARTERIES & DEEP PLANTAR ARCH'))
story.append(sp(8))
story.append(body('The posterior tibial artery bifurcates in the sole of the foot into the medial and lateral plantar arteries. The lateral plantar artery forms the deep plantar arch, which is completed by the deep plantar artery (from dorsalis pedis).'))
story.append(sp(6))

story.append(sub_section('Medial Plantar Artery'))
story.append(body('The smaller terminal branch. Passes along the medial side of the sole between abductor hallucis and flexor digitorum brevis. Divides into:'))
story.append(bullet('Superficial branch → cutaneous supply to medial sole; supplies great toe'))
story.append(bullet('Deep branch → anastomoses with 1st plantar metatarsal artery (from deep plantar arch)'))
story.append(sp(6))

story.append(sub_section('Lateral Plantar Artery'))
story.append(body('The larger terminal branch. Passes laterally and anteriorly across the sole between flexor digitorum brevis (superficially) and flexor accessorius. Curves medially across the bases of the metatarsals to form the <b>deep plantar arch</b>.'))
story.append(sp(4))

story.append(sub_section('Deep Plantar Arch'))
story.append(body('Formed by: lateral plantar artery (main contributor) + deep plantar artery (from dorsalis pedis, entering between heads of 1st dorsal interosseous). Lies on the bases of metatarsals 2–5.'))
story.append(sp(4))

headers = ['From Deep Plantar Arch', 'Course & Supply']
rows = [
    ['4× Plantar metatarsal arteries', 'Run forward in each intermetatarsal space; anastomose with perforating branches from dorsal metatarsals'],
    ['Common plantar digital arteries (×4)', 'Each divides into 2 proper plantar digital arteries → supply adjacent sides of all 5 toes'],
    ['Proper plantar digital arteries (×8)', 'Run to each side of toes II–V; 2 supply the great toe from the medial plantar artery'],
]
story.append(make_table(headers, rows, [6*cm, 11*cm]))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 11 — ANASTOMOSES
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('11.  CRUCIATE & GENICULAR ANASTOMOSES', color=NAVY))
story.append(sp(8))

story.append(sub_section('Cruciate Anastomosis (around the hip)'))
story.append(body('Forms a cruciate (cross-shaped) anastomosis at the level of the lesser trochanter / proximal femoral shaft:'))
story.append(sp(4))
headers = ['Artery', 'Source']
rows = [
    ['Inferior gluteal artery (descending branch)', 'Internal iliac artery'],
    ['Medial circumflex femoral artery (transverse branch)', 'Profunda femoris'],
    ['Lateral circumflex femoral artery (transverse branch)', 'Profunda femoris'],
    ['1st perforating artery (ascending branch)', 'Profunda femoris'],
]
story.append(make_table(headers, rows, [9*cm, 8*cm], header_color=NAVY))
story.append(sp(4))
story.append(body('<b>Significance:</b> Provides collateral circulation if the femoral artery is ligated proximal to the profunda femoris origin (e.g. in trauma or tumour surgery).'))
story.append(sp(6))

story.append(sub_section('Trochanteric Anastomosis (around the femoral neck)'))
story.append(body('Formed by: LCFA (ascending branch) + MCFA (ascending branch) + superior and inferior gluteal arteries. Critical for femoral head viability.'))
story.append(sp(6))

story.append(sub_section('Genicular Anastomosis (around the knee)'))
story.append(body('Formed by: descending genicular a. (femoral), 5 pairs of genicular branches (popliteal), anterior tibial recurrent a. (anterior tibial), circumflex fibular a. (posterior tibial). Collateral path when popliteal artery is obstructed.'))
story.append(sp(6))

story.append(sub_section('Malleolar & Calcaneal Anastomoses'))
story.append(body('Medial malleolar network: anterior medial malleolar a. + branches of posterior tibial a. Lateral malleolar network: anterior lateral malleolar a. + perforating branch of fibular a. + posterior lateral malleolar a. These form a ring-like network supporting the ankle region.'))
story.append(sp(10))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 12 — PERIPHERAL PULSES
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('12.  PERIPHERAL PULSES — EXAM QUICK REFERENCE', color=DARK_RED))
story.append(sp(8))

headers = ['Pulse', 'Location', 'Tip for Palpation', 'Clinical Use']
rows = [
    ['Femoral', 'Mid-inguinal point (midway between ASIS and pubic symphysis, below inguinal ligament)',
     'Press firmly; patient supine, hip slightly flexed and externally rotated',
     'Vascular access, shock assessment, PAD diagnosis'],
    ['Popliteal', 'Popliteal fossa, between medial and lateral hamstring tendons',
     'Knee flexed ~30°; thumbs on tibial tuberosity, fingers deep into fossa; press against posterior intercondylar surface',
     'Popliteal aneurysm, distal occlusion check'],
    ['Dorsalis pedis', 'Dorsum of foot, between tendons of EHL and EDL to 2nd toe, over tarsal bones',
     'Light touch with two fingers; absent in ~8% of normal people',
     'ABI measurement, critical ischaemia assessment'],
    ['Posterior tibial', 'Behind and below medial malleolus, halfway between malleolus and heel',
     'Two fingers; foot slightly plantarflexed',
     'ABI measurement; most reliable foot pulse in PAD'],
]
story.append(make_table(headers, rows, [3.5*cm, 5*cm, 4*cm, 4.5*cm]))
story.append(sp(6))
story.append(body('<b>Ankle-Brachial Index (ABI):</b> Ratio of systolic BP at ankle (dorsalis pedis or posterior tibial) to brachial systolic BP.'))
abi_rows = [
    ['> 1.3', 'Calcified vessels (non-compressible) — common in diabetes, CKD'],
    ['1.0 – 1.3', 'Normal'],
    ['0.9 – 1.0', 'Borderline'],
    ['0.7 – 0.9', 'Mild PAD'],
    ['0.4 – 0.7', 'Moderate PAD — intermittent claudication'],
    ['< 0.4', 'Severe PAD — critical limb ischaemia'],
]
story.append(sp(4))
story.append(make_table(['ABI Value', 'Interpretation'], abi_rows, [4*cm, 13*cm], header_color=DARK_RED))
story.append(sp(10))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 13 — CLINICAL CORRELATES
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('13.  HIGH-YIELD CLINICAL CORRELATES'))
story.append(sp(8))

headers = ['Condition', 'Vessel(s) Affected', 'Mechanism / Notes']
rows = [
    ['Avascular necrosis of femoral head',
     'Medial circumflex femoral a. (dominant); lateral circumflex femoral a.',
     'Femoral neck fracture (esp. displaced intracapsular) disrupts retinacular vessels → ischaemia of femoral head. Risk: subcapital > transcervical > basicervical.'],
    ['Peripheral arterial disease (PAD)',
     'Aortoiliac, femoral, popliteal, tibial, fibular',
     'Atherosclerosis → stenosis/occlusion. Fontaine classification: I = asymptomatic, II = claudication, III = rest pain, IV = tissue loss. ABI < 0.9 diagnostic.'],
    ['Popliteal artery aneurysm',
     'Popliteal artery',
     '70% of peripheral aneurysms; 60% bilateral; 50% associated with AAA. Presents as pulsatile mass, emboli (blue toe syndrome), or acute thrombosis.'],
    ['Popliteal artery entrapment syndrome',
     'Popliteal artery',
     'Young athletes; aberrant insertion of medial head of gastrocnemius compresses artery → exertional claudication. MRI/MRA diagnostic.'],
    ['Compartment syndrome',
     'All leg compartments',
     'Raised intracompartmental pressure >30 mmHg (or within 30 mmHg of diastolic BP) → ischaemia. Requires emergency fasciotomy. 6 Ps: Pain, Paresthesia, Pallor, Pulselessness, Paralysis, Poikilothermia.'],
    ['Leriche syndrome',
     'Aortoiliac occlusion',
     'Triad: bilateral hip/thigh/buttock claudication, impotence, absent femoral pulses. Treated with aortobifemoral bypass.'],
    ['Diabetic foot ischaemia',
     'Tibial and fibular arteries (distal disease)',
     'Medial calcification + atherosclerosis → non-healing ulcers. ABI may be falsely elevated; use toe-brachial index (TBI < 0.7 = ischaemia).'],
    ['Deep vein thrombosis (DVT) — venous counterpart',
     'Femoral/popliteal veins (correspond to arteries)',
     'Occlusion of femoral vein (NOT artery) → DVT. Risk: Virchow\'s triad. Homan\'s sign unreliable.'],
]
story.append(make_table(headers, rows, [4*cm, 4.5*cm, 8.5*cm]))
story.append(sp(10))
story.append(PageBreak())

# ══════════════════════════════════════════════════════════════════════════════
# SECTION 14 — MASTER SUMMARY TABLES
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_header('14.  MASTER SUMMARY TABLES', color=DARK_RED))
story.append(sp(8))

story.append(sub_section('Table A — Arterial Segments: Key Transition Points'))
trans_rows = [
    ['External iliac → Femoral', 'At the inguinal ligament (entering femoral triangle)'],
    ['Femoral → Popliteal', 'At the adductor hiatus in adductor magnus'],
    ['Popliteal → Anterior tibial + Posterior tibial', 'At the inferior border of popliteus muscle'],
    ['Anterior tibial → Dorsalis pedis', 'As it crosses the ankle joint (anterior to the ankle)'],
    ['Posterior tibial → Medial + Lateral plantar', 'In the sole of the foot (after tarsal tunnel)'],
    ['Dorsalis pedis → Deep plantar artery', 'Between the heads of the 1st dorsal interosseous muscle'],
    ['Lateral plantar → Deep plantar arch', 'Curves medially across metatarsal bases'],
]
story.append(make_table(['Transition', 'Location'], trans_rows, [7*cm, 10*cm], header_color=DARK_RED))
story.append(sp(6))

story.append(sub_section('Table B — All Branches at a Glance'))
all_rows = [
    ['External iliac a.', 'Inferior epigastric, deep circumflex iliac, cremasteric (♂), round ligament (♀)'],
    ['Femoral a.', 'Superficial epigastric, superficial circumflex iliac, superficial external pudendal, deep external pudendal, profunda femoris, descending genicular'],
    ['Profunda femoris', 'LCFA (ascending, descending, transverse), MCFA (ascending, transverse), 3× perforating arteries'],
    ['Popliteal a.', 'Superior medial/lateral genicular, middle genicular, inferior medial/lateral genicular, sural ×2, posterior tibial recurrent → Ant. tibial + Post. tibial (terminal)'],
    ['Anterior tibial a.', 'Anterior tibial recurrent, muscular branches, anterior medial malleolar, anterior lateral malleolar → Dorsalis pedis (terminal)'],
    ['Dorsalis pedis a.', 'Medial tarsal, lateral tarsal, arcuate (→ 3 dorsal metatarsals), 1st dorsal metatarsal, deep plantar artery (terminal)'],
    ['Posterior tibial a.', 'Circumflex fibular, fibular a. (major), nutrient of tibia, muscular branches → Medial + Lateral plantar arteries (terminal)'],
    ['Fibular a.', 'Muscular, nutrient of fibula, perforating branch, posterior lateral malleolar, calcaneal branches'],
    ['Medial plantar a.', 'Superficial branch (great toe, medial sole), deep branch (1st plantar metatarsal anastomosis)'],
    ['Lateral plantar a.', 'Muscular branches → DEEP PLANTAR ARCH (→ 4 plantar metatarsal → common + proper plantar digital arteries)'],
]
story.append(make_table(['Artery', 'Named Branches'], all_rows, [4.5*cm, 12.5*cm], header_color=NAVY))
story.append(sp(6))

story.append(sub_section('Table C — Compartment Blood Supply'))
comp_rows = [
    ['Anterior compartment (leg)', 'Anterior tibial artery', 'Tibialis anterior, EHL, EDL, fibularis tertius'],
    ['Lateral compartment (leg)', 'Fibular artery (perforating branches)', 'Fibularis longus and brevis'],
    ['Posterior compartment (leg) — superficial', 'Posterior tibial + sural branches of popliteal', 'Gastrocnemius, soleus, plantaris'],
    ['Posterior compartment (leg) — deep', 'Posterior tibial + fibular arteries', 'Tibialis posterior, FDL, FHL, popliteus'],
    ['Anterior compartment (thigh)', 'Femoral artery (direct muscular branches)', 'Quadriceps femoris, sartorius'],
    ['Medial compartment (thigh)', 'Profunda femoris + obturator artery', 'Adductor group, gracilis, obturator externus'],
    ['Posterior compartment (thigh)', '3 perforating arteries (profunda femoris)', 'Hamstrings, short head of biceps femoris'],
    ['Gluteal region', 'Superior and inferior gluteal arteries (internal iliac)', 'Gluteus maximus/medius/minimus, short lateral rotators'],
]
story.append(make_table(['Compartment', 'Main Artery', 'Muscles Supplied'],
                        comp_rows, [4.5*cm, 5*cm, 7.5*cm], header_color=DARK_RED))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════════════════════
# BACK COVER / MNEMONICS PAGE
# ══════════════════════════════════════════════════════════════════════════════
story.append(PageBreak())
story.append(section_header('MNEMONICS & QUICK RECALL', color=DARK_RED))
story.append(sp(8))

mnemo_data = [
    ['FEMORAL TRIANGLE contents (lateral → medial)',
     'N A V E L  =  Nerve, Artery, Vein, Empty space, Lymphatics\n(Or: the artery is at the mid-inguinal point)'],
    ['TARSAL TUNNEL contents (medial → lateral)',
     'Tom, Dick AND Harry  =  Tibialis posterior, flexor Digitorum longus, posterior tibial Artery + vein (× 2), tibial Nerve, flexor Hallucis longus'],
    ['PROFUNDA FEMORIS branches',
     'Lateral comes first (LCFA), then Medial (MCFA), then 3 Perforators  →  "Lateral, Medial, then Perforate"'],
    ['Cruciate anastomosis contributors',
     'IMFP  =  Inferior gluteal, Medial circumflex femoral, First perforating artery, lateral circumflex femoral (Partial)'],
    ['POPLITEAL FOSSA layers (superficial → deep)',
     'Vein superficial to artery  (opposite of femoral triangle). Order: Tibial nerve → Popliteal vein → Popliteal artery (deepest)'],
    ['ABI interpretation shortcut',
     '>1.3 = calcified  |  1–1.3 = normal  |  0.9–1.0 = borderline  |  <0.9 = PAD  |  <0.4 = critical ischaemia'],
    ['Dorsalis pedis absent in',
     '~8% of normal individuals — always check posterior tibial pulse before labelling as absent'],
    ['AVN risk with femoral neck fractures',
     'SUBcapital > TRANScervical > BASIcervical  (remember SUB = highest risk)'],
]
mdata = [[Paragraph(f'<b>{r[0]}</b>', h3_style), Paragraph(r[1], body_style)] for r in mnemo_data]
mtbl = Table(mdata, colWidths=[6*cm, 11*cm])
mtbl.setStyle(TableStyle([
    ('ROWBACKGROUNDS', (0,0), (-1,-1), [LIGHT_GRAY, WHITE]),
    ('GRID', (0,0), (-1,-1), 0.3, MID_GRAY),
    ('VALIGN', (0,0), (-1,-1), 'TOP'),
    ('TOPPADDING', (0,0), (-1,-1), 6),
    ('BOTTOMPADDING', (0,0), (-1,-1), 6),
    ('LEFTPADDING', (0,0), (-1,-1), 8),
    ('BOX', (0,0), (-1,-1), 1, CRIMSON),
]))
story.append(mtbl)
story.append(sp(12))

footer_data = [[Paragraph(
    '<font color="#8B0000"><b>Orris Medical Education</b></font>  ·  '
    'Lower Limb Arteries Study Guide  ·  '
    'Sources: Gray\'s Anatomy for Students; THIEME Atlas of Anatomy',
    make_style('Footer', 'Normal', fontSize=8, alignment=TA_CENTER,
               textColor=SLATE, leading=12))]]
ftbl = Table(footer_data, colWidths=[PAGE_W - 2*MARGIN])
ftbl.setStyle(TableStyle([
    ('TOPPADDING', (0,0), (-1,-1), 4),
    ('LINEABOVE', (0,0), (-1,-1), 0.5, MID_GRAY),
]))
story.append(ftbl)

# ── Build ────────────────────────────────────────────────────────────────────
doc.build(story)
print("PDF generated successfully.")
Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.

Create a detailed study guide PDF with arterial branches and tables for exam preparation

Running Command

ls /home/daytona/workspace/lower-limb-arteries/ && python3 -c "from reportlab.lib.pagesizes import A4; print('reportlab ok')"

Running Command

cd /home/daytona/workspace/lower-limb-arteries && python3 generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/lower-limb-arteries/Lower_Limb_Arteries_Study_Guide.pdf

Your study guide PDF is ready!

Lower Limb Arteries Study Guide

PDF Document · PDF


What's inside (9 sections across ~10 pages):
SectionContent
Cover + TOCColour-coded title page with full contents list
1. Arterial Sequence TreeFull branching tree from aorta to digital arteries in a monospaced box
2. External Iliac ArteryBranches table + corona mortis clinical note
3. Femoral ArteryCourse (femoral triangle → adductor canal → adductor hiatus), pulse point, branches table
4. Profunda FemorisLCFA (ascending/descending/transverse), MCFA, 3× perforating arteries — each with detailed sub-tables
5. Popliteal ArteryAll 8 branches tabulated + genicular anastomosis explanation
6–7. Anterior Tibial & Dorsalis PedisCourse, branches, pulse palpation
8–9. Posterior Tibial & FibularTarsal tunnel mnemonic, all branches
10. Plantar Arteries & Deep Plantar ArchMedial + lateral plantar, arch formation, digital arteries
11. AnastomosesCruciate, trochanteric, genicular, malleolar — all four named
12. Peripheral PulsesTable with location + technique + ABI interpretation chart
13. Clinical CorrelatesAVN, PAD, Leriche syndrome, compartment syndrome, popliteal aneurysm, diabetic foot
14. Master Summary TablesTransition points, all branches at a glance, compartment blood supply
Mnemonics pageNAVEL, Tom Dick AND Harry, ABI shortcut, AVN risk order, and more

Pdf document is not opening

Running Command

cd /home/daytona/workspace/lower-limb-arteries && python3 -c " from pypdf import PdfReader try: r = PdfReader('Lower_Limb_Arteries_Study_Guide.pdf') print(f'Pages: {len(r.pages)}') print('PDF is valid') except Exception as e: print(f'Error: {e}') "

Running Command

cd /home/daytona/workspace/lower-limb-arteries && python3 generate_pdf.py && ls -lh Lower_Limb_Arteries_Study_Guide.pdf && file Lower_Limb_Arteries_Study_Guide.pdf

The PDF is a valid 17-page document (PDF 1.4). Here is the fresh download link:

Lower Limb Arteries Study Guide

PDF Document · PDF

If it still won't open, a few things to try:
  1. Right-click the link → Save link as — then open the downloaded file locally
  2. Browser compatibility — some browsers block inline PDF rendering; saving first always works
  3. PDF reader — open with Adobe Acrobat, Foxit, or your OS default PDF viewer after downloading
  4. File size — it's only 38 KB so it's not a size/corruption issue; the file is confirmed valid
If you're on mobile, you may need a dedicated PDF app (e.g. Adobe Acrobat for Android/iOS) to open it after downloading.
This is a shared conversation. Sign in to Orris to start your own chat.