Write me about rectus sheath for amb s exam long answer questions and also provide diagrams for possible with good presentation

| Layer | Composition |
|---|---|
| Anterior wall | Aponeurosis of external oblique + anterior lamella of internal oblique |
| Posterior wall | Posterior lamella of internal oblique + aponeurosis of transversus abdominis |
| Behind posterior wall | Transversalis fascia + preperitoneal fat + parietal peritoneum |
| Layer | Composition |
|---|---|
| Anterior wall | ALL three aponeuroses (external oblique + internal oblique + transversus abdominis) pass in front |
| Posterior wall | ABSENT - only transversalis fascia + peritoneum remain |
Key Exam Point: Below the arcuate line, the rectus abdominis lies directly on the transversalis fascia. This makes the lower abdomen a relatively weaker zone and explains the site of certain hernias.




| Region | Anterior Wall | Posterior Wall |
|---|---|---|
| Above the arcuate line | External oblique aponeurosis + Anterior lamella of internal oblique | Posterior lamella of internal oblique + Transversus abdominis aponeurosis |
| Below the arcuate line | External oblique + Full internal oblique + Transversus abdominis (all three) | ABSENT - only transversalis fascia + peritoneum |
| Structure | Relation |
|---|---|
| Linea alba | Midline fusion of both rectus sheaths - from xiphoid to pubis |
| Semilunar (Spighelian) line | Lateral margin of the rectus sheath; site of Spighelian hernia |
| Tendinous inscriptions | Fused to anterior sheath only - NOT to posterior sheath |
| Linea semilunaris | Surface marking of the lateral edge of rectus abdominis |
Can you give a pdf of the same in a handwritten form with good presentation for exam
ls /home/daytona/workspace/ 2>/dev/null || mkdir -p /home/daytona/workspace/rectus-sheath
mkdir -p /home/daytona/workspace/rectus-sheath && ls /home/daytona/workspace/rectus-sheath
python3 -c " import urllib.request, os # Download Caveat (handwriting) font from Google Fonts CDN fonts = { 'Caveat-Regular.ttf': 'https://github.com/google/fonts/raw/main/ofl/caveat/Caveat-Regular.ttf', 'Caveat-Bold.ttf': 'https://github.com/google/fonts/raw/main/ofl/caveat/Caveat-Bold.ttf', } os.makedirs('/home/daytona/workspace/rectus-sheath/fonts', exist_ok=True) for fname, url in fonts.items(): dest = f'/home/daytona/workspace/rectus-sheath/fonts/{fname}' try: urllib.request.urlretrieve(url, dest) print(f'Downloaded {fname}: {os.path.getsize(dest)} bytes') except Exception as e: print(f'Failed {fname}: {e}') "
python3 -c " import urllib.request, os os.makedirs('/home/daytona/workspace/rectus-sheath/fonts', exist_ok=True) # Try correct GitHub raw URL for Caveat font urls = [ ('Caveat-Regular.ttf', 'https://github.com/google/fonts/raw/refs/heads/main/ofl/caveat/Caveat%5Bwght%5D.ttf'), ('Patrick-Regular.ttf', 'https://github.com/google/fonts/raw/refs/heads/main/ofl/patrickhandsc/PatrickHandSC-Regular.ttf'), ('IndieFlower.ttf', 'https://github.com/google/fonts/raw/refs/heads/main/ofl/indieflower/IndieFlower-Regular.ttf'), ] for fname, url in urls: dest = f'/home/daytona/workspace/rectus-sheath/fonts/{fname}' try: urllib.request.urlretrieve(url, dest) print(f'OK {fname}: {os.path.getsize(dest)} bytes') except Exception as e: print(f'FAIL {fname}: {e}') # Also check system fonts import subprocess r = subprocess.run(['fc-list'], capture_output=True, text=True) for line in r.stdout.split('\n'): if any(x in line.lower() for x in ['handwrite','caveat','cursive','hand','comic','patrick','indie']): print('SYS:', line) "
~/rectus-sheath/generate_pdf.py
#!/usr/bin/env python3
"""
Rectus Sheath - Handwritten-style Exam PDF
Uses ReportLab with Caveat (handwriting) font, ruled-paper background,
embedded anatomical diagrams, color-coded sections.
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.pdfgen import canvas
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.lib.utils import ImageReader
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, HRFlowable
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
import urllib.request, io, os, math
# ββ Paths ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
OUT_DIR = "/home/daytona/workspace/rectus-sheath"
FONT_DIR = f"{OUT_DIR}/fonts"
OUTPUT = f"{OUT_DIR}/Rectus_Sheath_Exam_Notes.pdf"
# ββ Register fonts βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
pdfmetrics.registerFont(TTFont("Caveat", f"{FONT_DIR}/Caveat-Regular.ttf"))
pdfmetrics.registerFont(TTFont("CaveatBold", f"{FONT_DIR}/Caveat-Regular.ttf")) # use same, drawn bold via size
pdfmetrics.registerFont(TTFont("IndieFlower", f"{FONT_DIR}/IndieFlower.ttf"))
pdfmetrics.registerFont(TTFont("PatrickHand", f"{FONT_DIR}/Patrick-Regular.ttf"))
# ββ Colour palette βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
PAGE_BG = colors.HexColor("#FDFAF3") # warm cream (notebook paper)
LINE_COLOR = colors.HexColor("#C8D8E8") # soft blue ruled lines
MARGIN_COLOR = colors.HexColor("#F4C2C2") # red left margin line
HEADING_COLOR = colors.HexColor("#1A237E") # deep navy
SUBHEAD_COLOR = colors.HexColor("#BF360C") # deep red
BODY_COLOR = colors.HexColor("#1B1B2F") # very dark ink
BOX_FILL = colors.HexColor("#E8F5E9") # light green box
BOX_STROKE = colors.HexColor("#388E3C") # green box border
TABLE_HEAD_BG = colors.HexColor("#1A237E")
TABLE_ROW1 = colors.HexColor("#EEF2FF")
TABLE_ROW2 = colors.HexColor("#FFFFFF")
HIGHLIGHT_YELLOW = colors.HexColor("#FFF9C4")
HIGHLIGHT_BLUE = colors.HexColor("#E3F2FD")
STAR_COLOR = colors.HexColor("#F57F17")
W, H = A4 # 595.27 x 841.89 pt
LEFT_M = 2.2 * cm
RIGHT_M = 1.5 * cm
TOP_M = 2.0 * cm
BOT_M = 1.8 * cm
# ββ Image URLs βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
IMG_URLS = [
("d399afe1ebc962411adff6401877c2d90659d0be6289cbb84843057f8eeb9c5a",
"Fig. 1 β Rectus Sheath Cross Sections (Gray's Anatomy for Students)\nA: Upper 3/4 (above arcuate line) B: Lower 1/4 (below arcuate line)"),
("b5bf893ddb34f7c0bf478a4da7b184c330cafb1192b4cc1e521caca02c0e8667",
"Fig. 2 β Detailed Cross-Sections A/B the Arcuate Line (Mulholland & Greenfield Surgery)"),
("1c382623161ac894c9d15835ce7b321e004e9df9db04a6977e5bead7c547d237",
"Fig. 3 β All Abdominal Wall Layers & Rectus Sheath (THIEME Atlas)"),
("dd6f178ab7e37fe0400884b0dab70b09ab9542f28c4220263e591f0069bc8f83",
"Fig. 4 β Posterior View: Arcuate Line & Rectus Sheath (THIEME Atlas)"),
("dbb4cc67bd849e388f06eeb6c020ef2b86947d821fc8691b2f6a6365648d947f",
"Fig. 5 β Laparoscopic View: Arcuate Line & Inferior Epigastric Vessels (Mulholland & Greenfield)"),
]
def fetch_img(hash_id):
url = f"https://cdn.orris.care/cdss_images/{hash_id}.png"
try:
with urllib.request.urlopen(url, timeout=15) as r:
return ImageReader(io.BytesIO(r.read()))
except Exception as e:
print(f" IMG FAIL {hash_id[:10]}: {e}")
return None
print("Fetching images...")
images = [(fetch_img(h), cap) for h, cap in IMG_URLS]
print("Images ready.")
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Background painter β ruled paper effect
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
LINE_SPACING = 22 # pt between ruled lines
def draw_background(c, doc):
c.saveState()
# Cream background
c.setFillColor(PAGE_BG)
c.rect(0, 0, W, H, fill=1, stroke=0)
# Ruled lines
c.setStrokeColor(LINE_COLOR)
c.setLineWidth(0.4)
y = H - TOP_M - 6
while y > BOT_M:
c.line(LEFT_M - 2, y, W - RIGHT_M + 2, y)
y -= LINE_SPACING
# Red left margin line
c.setStrokeColor(MARGIN_COLOR)
c.setLineWidth(1.2)
c.line(LEFT_M - 6*mm, 0, LEFT_M - 6*mm, H)
# Page number (bottom right)
c.setFillColor(BODY_COLOR)
c.setFont("Caveat", 11)
c.drawRightString(W - RIGHT_M, 12*mm, f"β {doc.page} β")
c.restoreState()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Paragraph Styles
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def make_styles():
styles = {}
styles["title"] = ParagraphStyle("title",
fontName="Caveat", fontSize=28, textColor=HEADING_COLOR,
alignment=TA_CENTER, spaceAfter=4, leading=34,
borderPad=4)
styles["subtitle"] = ParagraphStyle("subtitle",
fontName="IndieFlower", fontSize=13, textColor=SUBHEAD_COLOR,
alignment=TA_CENTER, spaceAfter=10, leading=18)
styles["h1"] = ParagraphStyle("h1",
fontName="Caveat", fontSize=20, textColor=HEADING_COLOR,
spaceBefore=12, spaceAfter=4, leading=26,
borderPad=2)
styles["h2"] = ParagraphStyle("h2",
fontName="Caveat", fontSize=16, textColor=SUBHEAD_COLOR,
spaceBefore=8, spaceAfter=3, leading=22)
styles["h3"] = ParagraphStyle("h3",
fontName="Caveat", fontSize=14, textColor=colors.HexColor("#4A148C"),
spaceBefore=6, spaceAfter=2, leading=20)
styles["body"] = ParagraphStyle("body",
fontName="Caveat", fontSize=13, textColor=BODY_COLOR,
leading=LINE_SPACING, spaceAfter=2, alignment=TA_JUSTIFY,
leftIndent=2)
styles["bullet"] = ParagraphStyle("bullet",
fontName="Caveat", fontSize=13, textColor=BODY_COLOR,
leading=LINE_SPACING, spaceAfter=1, leftIndent=14,
bulletIndent=0)
styles["subbullet"] = ParagraphStyle("subbullet",
fontName="Caveat", fontSize=12, textColor=BODY_COLOR,
leading=LINE_SPACING - 2, spaceAfter=0, leftIndent=28,
bulletIndent=14)
styles["keypoint"] = ParagraphStyle("keypoint",
fontName="Caveat", fontSize=13, textColor=colors.HexColor("#1A237E"),
leading=LINE_SPACING, spaceAfter=2, leftIndent=8,
backColor=HIGHLIGHT_YELLOW, borderPad=4, borderRadius=3)
styles["important"] = ParagraphStyle("important",
fontName="Caveat", fontSize=13, textColor=colors.HexColor("#B71C1C"),
leading=LINE_SPACING, spaceAfter=2, leftIndent=8,
backColor=colors.HexColor("#FFEBEE"), borderPad=4)
styles["caption"] = ParagraphStyle("caption",
fontName="IndieFlower", fontSize=10, textColor=colors.HexColor("#546E7A"),
alignment=TA_CENTER, spaceAfter=6, leading=14)
styles["mnemonic"] = ParagraphStyle("mnemonic",
fontName="Caveat", fontSize=13, textColor=colors.HexColor("#006064"),
leading=LINE_SPACING, spaceAfter=2, leftIndent=8,
backColor=colors.HexColor("#E0F7FA"), borderPad=4)
return styles
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Helper: embed image with caption
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def img_element(img_reader, caption, max_w_pt, styles):
"""Returns (image_flowable, caption_flowable) or just caption on failure."""
from reportlab.platypus import Image as RLImage
items = []
if img_reader:
iw, ih = img_reader._image.size
ratio = ih / iw
disp_w = min(max_w_pt, iw)
disp_h = disp_w * ratio
# Cap height
max_h = 12 * cm
if disp_h > max_h:
disp_h = max_h
disp_w = disp_h / ratio
img = RLImage(img_reader._image if hasattr(img_reader, '_image') else img_reader,
width=disp_w, height=disp_h)
# Wrap in a centered table
t = Table([[img]], colWidths=[max_w_pt])
t.setStyle(TableStyle([
('ALIGN', (0,0), (-1,-1), 'CENTER'),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('BOX', (0,0), (-1,-1), 0.8, colors.HexColor("#90A4AE")),
('BACKGROUND', (0,0), (-1,-1), colors.white),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
]))
items.append(t)
items.append(Paragraph(caption, styles["caption"]))
return items
# Helper: coloured section rule
def section_rule(color=HEADING_COLOR, w=2):
return HRFlowable(width="100%", thickness=w, color=color, spaceAfter=4, spaceBefore=4)
# Helper: boxed key point
def key_box(text, styles, title="β
KEY EXAM POINT"):
data = [[Paragraph(f'<font color="#F57F17"><b>{title}</b></font><br/>{text}',
styles["body"])]]
t = Table(data, colWidths=[W - LEFT_M - RIGHT_M - 2*mm])
t.setStyle(TableStyle([
('BOX', (0,0), (-1,-1), 1.5, BOX_STROKE),
('BACKGROUND', (0,0), (-1,-1), BOX_FILL),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
]))
return t
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# BUILD CONTENT
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def build_story(styles, images):
S = []
cw = W - LEFT_M - RIGHT_M # content width
def h1(text): S.append(Paragraph(text, styles["h1"]))
def h2(text): S.append(Paragraph(text, styles["h2"]))
def h3(text): S.append(Paragraph(text, styles["h3"]))
def body(text): S.append(Paragraph(text, styles["body"]))
def bullet(text, lvl=1):
sym = "β’" if lvl == 1 else "β¦"
indent = 14 if lvl == 1 else 28
st = styles["bullet"] if lvl == 1 else styles["subbullet"]
S.append(Paragraph(f"{sym} {text}", st))
def sp(n=1): S.append(Spacer(1, n * LINE_SPACING * 0.5))
def rule(c=HEADING_COLOR): S.append(section_rule(c))
def keypoint(text): S.append(key_box(text, styles))
def mnemonic(text): S.append(Paragraph(text, styles["mnemonic"]))
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# TITLE PAGE BLOCK
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
S.append(Spacer(1, 0.5*cm))
S.append(Paragraph("RECTUS SHEATH", styles["title"]))
S.append(Paragraph("AMB Surgery Β· Long Answer Notes Β· Anatomy & Clinical", styles["subtitle"]))
rule(HEADING_COLOR)
sp(1)
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 1: Introduction
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
h1("1. Introduction")
rule(SUBHEAD_COLOR)
body("The rectus sheath is a strong fibro-aponeurotic compartment enclosing the "
"rectus abdominis (and pyramidalis) muscles. It is formed by the interlacing "
"aponeuroses of the three flat muscles of the anterolateral abdominal wall:")
bullet("External oblique")
bullet("Internal oblique (splits into anterior and posterior lamellae)")
bullet("Transversus abdominis")
body("The sheaths of both sides fuse medially at the linea alba and are bounded "
"laterally by the semilunar (Spighelian) line.")
sp()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 2: Formation
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
h1("2. Formation of the Rectus Sheath")
rule(SUBHEAD_COLOR)
body("The sheath is formed differently above and below the arcuate line (line of Douglas). "
"This difference is the most tested fact in examinations.")
sp()
h2("2a. Above the Arcuate Line (Upper ΒΎ of rectus abdominis)")
body("The internal oblique aponeurosis splits (bifurcates) at the lateral margin of the rectus muscle:")
bullet("Anterior wall = Aponeurosis of External Oblique + Anterior lamella of Internal Oblique")
bullet("Posterior wall = Posterior lamella of Internal Oblique + Aponeurosis of Transversus Abdominis")
bullet("Behind the posterior wall: Transversalis fascia β Preperitoneal fat β Parietal peritoneum")
bullet("Note: Transversus abdominis does NOT contribute to the anterior sheath above the umbilicus", 2)
sp()
h2("2b. Below the Arcuate Line (Lower ΒΌ of rectus abdominis)")
bullet("Anterior wall = ALL three aponeuroses pass anterior to rectus (External + Internal + Transversus)")
bullet("Posterior wall = ABSENT β only transversalis fascia + peritoneum remain")
bullet("Rectus abdominis lies directly on transversalis fascia in this zone", 2)
sp()
keypoint("Below the arcuate line, ALL aponeuroses shift anteriorly.\n"
"The posterior wall is ABSENT β making this zone relatively weak\n"
"and predisposing to Spigelian hernia.")
sp()
# Diagram 1
if images[0][0]:
for elem in img_element(images[0][0], images[0][1], cw, styles):
S.append(elem)
sp()
# Diagram 2
if images[1][0]:
for elem in img_element(images[1][0], images[1][1], cw, styles):
S.append(elem)
sp()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 3: SUMMARY TABLE
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
S.append(PageBreak())
h1("3. Summary Table β Composition")
rule(SUBHEAD_COLOR)
sp(0.5)
table_data = [
["Region", "Anterior Wall", "Posterior Wall"],
["Above arcuate line\n(Upper ΒΎ)",
"External oblique aponeurosis\n+ Anterior lamella of\nInternal oblique",
"Posterior lamella of\nInternal oblique\n+ Transversus abdominis\naponeurosis"],
["Below arcuate line\n(Lower ΒΌ)",
"ALL three:\nExternal oblique +\nInternal oblique +\nTransversus abdominis",
"ABSENT\n(only Transversalis fascia\n+ Peritoneum)"],
]
col_ws = [4.5*cm, 7.5*cm, 6.5*cm]
tbl = Table(table_data, colWidths=col_ws, repeatRows=1)
tbl.setStyle(TableStyle([
# Header row
("BACKGROUND", (0,0), (-1,0), TABLE_HEAD_BG),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Caveat"),
("FONTSIZE", (0,0), (-1,0), 13),
("ALIGN", (0,0), (-1,0), "CENTER"),
# Body rows
("FONTNAME", (0,1), (-1,-1), "Caveat"),
("FONTSIZE", (0,1), (-1,-1), 12),
("BACKGROUND", (0,1), (-1,1), TABLE_ROW1),
("BACKGROUND", (0,2), (-1,2), colors.HexColor("#FFF3E0")),
("TEXTCOLOR", (2,2), (2,2), colors.HexColor("#B71C1C")),
("FONTNAME", (2,2), (2,2), "Caveat"),
("ALIGN", (0,1), (-1,-1), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("GRID", (0,0), (-1,-1), 0.8, colors.HexColor("#90A4AE")),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("ROWBACKGROUNDS",(0,0),(-1,-1),[TABLE_HEAD_BG, TABLE_ROW1, colors.HexColor("#FFF3E0")]),
]))
S.append(tbl)
sp()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 4: Arcuate Line
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
h1("4. The Arcuate Line (Line of Douglas)")
rule(SUBHEAD_COLOR)
bullet("Location: midway between the umbilicus and pubic symphysis (approx. 3β5 cm below umbilicus)")
bullet("Represents the lower free curved margin of the posterior wall of the rectus sheath")
bullet("Below this line: all aponeuroses shift anteriorly")
bullet("Inferior epigastric vessels enter the rectus muscle from the posterior surface at this level")
bullet("Clinically important in Spigelian hernia and rectus sheath hematoma")
sp()
# Diagram 4 (posterior view showing arcuate line clearly)
if images[3][0]:
for elem in img_element(images[3][0], images[3][1], cw, styles):
S.append(elem)
sp()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 5: Contents
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
h1("5. Contents of the Rectus Sheath")
rule(SUBHEAD_COLOR)
sp(0.3)
h2("5a. Rectus Abdominis Muscle")
bullet("Origin: Pubic symphysis and pubic crest")
bullet("Insertion: Xiphoid process + costal cartilages of ribs 5β7")
bullet("Action: Trunk flexion + compression of abdominal viscera")
bullet("Has 3 tendinous inscriptions β fused to ANTERIOR wall ONLY (not posterior)")
sp(0.5)
h2("5b. Pyramidalis Muscle")
bullet("Small triangular muscle, variable (may be absent)")
bullet("Origin: Pubic crest | Insertion: Linea alba")
bullet("Surgical use: identifies midline during surgery")
sp(0.5)
h2("5c. Superior Epigastric Artery")
bullet("Terminal branch of internal thoracic (internal mammary) artery")
bullet("Enters rectus sheath below the costal margin through the posterior wall")
bullet("Runs on posterior surface of rectus abdominis")
bullet("Anastomoses with inferior epigastric artery near the umbilicus")
sp(0.5)
h2("5d. Inferior Epigastric Artery")
bullet("Branch of external iliac artery")
bullet("Enters rectus sheath below the arcuate line (through transversalis fascia)")
bullet("Lies lateral to deep inguinal ring")
bullet("SURGICAL LANDMARK: distinguishes Direct vs Indirect inguinal hernia", 2)
bullet(" Direct hernia β medial to inferior epigastric vessels", 2)
bullet(" Indirect hernia β lateral to inferior epigastric vessels", 2)
sp(0.5)
h2("5e. Lower Intercostal & Subcostal Nerves (T7βT12)")
bullet("Enter rectus sheath by piercing its lateral wall")
bullet("Supply rectus abdominis + overlying skin (segmental innervation)")
bullet("Anterior cutaneous branches pierce the anterior wall to supply abdominal skin")
sp(0.5)
h2("5f. Lymphatics")
bullet("Drain superiorly to para-aortic nodes")
bullet("Drain inferiorly to inguinal nodes")
sp()
# Diagram 3
if images[2][0]:
for elem in img_element(images[2][0], images[2][1], cw, styles):
S.append(elem)
sp()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 6: Related Structures
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
S.append(PageBreak())
h1("6. Related Structures")
rule(SUBHEAD_COLOR)
rel_data = [
["Structure", "Relation / Description"],
["Linea alba", "Midline fusion of both rectus sheaths β xiphoid to pubis"],
["Semilunar line", "Lateral margin of the rectus sheath β site of Spigelian hernia"],
["Tendinous inscriptions", "Fused to anterior sheath ONLY β NOT to posterior sheath"],
["Linea semilunaris", "Surface marking on skin of the lateral edge of rectus abdominis"],
["Transversalis fascia", "Deep to the rectus sheath; sole posterior covering below arcuate line"],
["Preperitoneal space", "Between transversalis fascia and peritoneum; used in TEP hernia repair"],
]
rel_tbl = Table(rel_data, colWidths=[5.5*cm, 13.0*cm], repeatRows=1)
rel_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TABLE_HEAD_BG),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,-1), "Caveat"),
("FONTSIZE", (0,0), (-1,-1), 12),
("ALIGN", (0,0), (-1,0), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ROWBACKGROUNDS",(0,1),(-1,-1),[TABLE_ROW1, TABLE_ROW2]),
("GRID", (0,0), (-1,-1), 0.7, colors.HexColor("#90A4AE")),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 6),
]))
S.append(rel_tbl)
sp()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 7: Clinical Significance
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
h1("7. Clinical Significance β
")
rule(SUBHEAD_COLOR)
sp(0.3)
h2("7a. Rectus Sheath Hematoma")
bullet("Blood collects within the sheath β usually from rupture of inferior epigastric artery")
bullet("Causes: blunt trauma, vigorous coughing, anticoagulants, pregnancy")
bullet("Above arcuate line: confined to one side (posterior wall intact)")
bullet("Below arcuate line: can spread freely across midline (no posterior wall)")
bullet("Fothergill's sign: mass does NOT move with muscle contraction")
bullet("Treatment: conservative (most cases); surgical evacuation if large/expanding")
sp(0.5)
h2("7b. Spigelian (Semilunar) Hernia")
bullet("Hernia through the lateral edge of the rectus sheath (semilunar line)")
bullet("Most common at or below the arcuate line β weakest zone")
bullet("Interparietal hernia β lies between abdominal wall layers")
bullet("Often missed clinically; ultrasound/CT needed for diagnosis")
sp(0.5)
h2("7c. Surgical Incisions Through the Rectus Sheath")
bullet("Midline incision: through linea alba β avascular, minimal nerve damage")
bullet("Paramedian incision: anterior sheath incised, rectus retracted medially, posterior sheath incised β stronger")
bullet("Pfannenstiel incision: transverse incision through anterior sheath only β gynecological/obstetric surgery")
sp(0.5)
h2("7d. Hernia Repair β Rives-Stoppa / Retrorectus Repair")
bullet("Mesh placed in the retrorectus space (between posterior sheath and rectus abdominis)")
bullet("Exploits the natural plane between tendinous inscriptions and posterior sheath")
bullet("Extended posteriorly through transversalis fascia for large defects")
sp(0.5)
h2("7e. TRAM / DIEP Flap (Breast Reconstruction)")
bullet("Rectus abdominis + inferior epigastric vessels used as a pedicled/free flap")
bullet("Knowledge of rectus sheath anatomy essential for flap harvest and closure")
sp(0.5)
h2("7f. Rectus Sheath Block (Regional Anaesthesia)")
bullet("Local anaesthetic injected between rectus abdominis and posterior rectus sheath")
bullet("Blocks T9βT11 anterior cutaneous branches")
bullet("Used for midline abdominal incision analgesia")
sp()
# Diagram 5 β Laparoscopic view
if images[4][0]:
for elem in img_element(images[4][0], images[4][1], cw, styles):
S.append(elem)
sp()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 8: Mnemonics
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
S.append(PageBreak())
h1("8. Mnemonics for Quick Recall")
rule(SUBHEAD_COLOR)
sp(0.5)
mnemonic("β
ABOVE arcuate line β ANTERIOR WALL:\n"
" \"E + A\" β External oblique + Anterior lamella of Internal oblique")
sp(0.5)
mnemonic("β
ABOVE arcuate line β POSTERIOR WALL:\n"
" \"P + T\" β Posterior lamella of Internal oblique + Transversus aponeurosis")
sp(0.5)
mnemonic("β
BELOW arcuate line:\n"
" \"ALL go to the FRONT β nothing behind but Transversalis fascia\"\n"
" Posterior wall = ABSENT")
sp(0.5)
mnemonic("β
Contents mnemonic \"SRNIL\":\n"
" S = Superior epigastric artery\n"
" R = Rectus abdominis\n"
" N = Nerves (T7βT12)\n"
" I = Inferior epigastric artery\n"
" L = Lymphatics")
sp(0.5)
mnemonic("β
Direct vs Indirect hernia:\n"
" Direct β Medial to inferior epigastric vessels (through Hesselbach's triangle)\n"
" Indirect β Lateral to inferior epigastric vessels (through deep inguinal ring)")
sp()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 9: Quick Revision Box
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
h1("9. Quick Revision β Must Know Points")
rule(SUBHEAD_COLOR)
sp(0.3)
qr_data = [
["#", "Key Fact"],
["1", "Rectus sheath formed by aponeuroses of External oblique, Internal oblique, Transversus abdominis"],
["2", "Above arcuate line: distinct anterior + posterior walls present"],
["3", "Below arcuate line: ALL aponeuroses anterior β posterior wall ABSENT"],
["4", "Arcuate line = midway between umbilicus and pubic symphysis"],
["5", "Tendinous inscriptions fused to anterior sheath ONLY"],
["6", "Superior + inferior epigastric arteries anastomose near umbilicus inside the sheath"],
["7", "Inferior epigastric artery: lateral to deep inguinal ring β key landmark for hernia"],
["8", "Spigelian hernia occurs through the semilunar line, most common below arcuate line"],
["9", "Rectus sheath hematoma below arcuate line can cross the midline"],
["10","Retrorectus space used for mesh in Rives-Stoppa hernia repair"],
]
qr_tbl = Table(qr_data, colWidths=[1.0*cm, 17.5*cm], repeatRows=1)
qr_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TABLE_HEAD_BG),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,-1), "Caveat"),
("FONTSIZE", (0,0), (-1,-1), 12),
("ALIGN", (0,0), (0,-1), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ROWBACKGROUNDS",(0,1),(-1,-1),[TABLE_ROW1, TABLE_ROW2]),
("GRID", (0,0), (-1,-1), 0.7, colors.HexColor("#90A4AE")),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,1), (0,-1), 6),
("LEFTPADDING", (1,1), (1,-1), 8),
]))
S.append(qr_tbl)
sp()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Footer note
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
rule(colors.HexColor("#78909C"))
S.append(Paragraph(
"Sources: Gray's Anatomy for Students Β· THIEME Atlas of Anatomy Β· "
"Mulholland & Greenfield's Surgery Β· Schwartz's Principles of Surgery 11e Β· "
"Berek & Novak's Gynecology Β· Fischer's Mastery of Surgery 8e",
styles["caption"]))
return S
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# RENDER
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def build_pdf():
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=LEFT_M,
rightMargin=RIGHT_M,
topMargin=TOP_M,
bottomMargin=BOT_M,
title="Rectus Sheath β AMB Surgery Exam Notes",
author="Orris Medical",
)
styles = make_styles()
story = build_story(styles, images)
doc.build(story, onFirstPage=draw_background, onLaterPages=draw_background)
size = os.path.getsize(OUTPUT) / 1024
print(f"\nβ PDF saved: {OUTPUT} ({size:.1f} KB)")
build_pdf()
cd /home/daytona/workspace/rectus-sheath && python3 generate_pdf.py 2>&1
~/rectus-sheath/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rectus-sheath/generate_pdf.py'
~/rectus-sheath/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rectus-sheath/generate_pdf.py'
~/rectus-sheath/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rectus-sheath/generate_pdf.py'
cd /home/daytona/workspace/rectus-sheath && python3 generate_pdf.py 2>&1
cd /home/daytona/workspace/rectus-sheath && gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=Rectus_Sheath_Exam_Notes_compressed.pdf Rectus_Sheath_Exam_Notes.pdf 2>&1 && ls -lh Rectus_Sheath_Exam_Notes*.pdf
python3 -c " # Compress images in the PDF using Pillow before generating - resize large images from PIL import Image import os img_dir = '/home/daytona/workspace/rectus-sheath/imgs' for f in os.listdir(img_dir): path = os.path.join(img_dir, f) img = Image.open(path) w, h = img.size # Resize if wider than 1800px (still very sharp for print) if w > 1800: ratio = 1800 / w img = img.resize((1800, int(h * ratio)), Image.LANCZOS) img.save(path, 'PNG', optimize=True) print(f'Resized {f}: {w}x{h} -> {img.size}') else: print(f'OK {f}: {w}x{h}') "
cd /home/daytona/workspace/rectus-sheath && python3 generate_pdf.py 2>&1 && ls -lh Rectus_Sheath_Exam_Notes.pdf
python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/rectus-sheath/Rectus_Sheath_Exam_Notes.pdf') print(f'Pages: {len(r.pages)}') print(f'Title: {r.metadata.title}') "
Rectus Sheath Exam Notes
PDF Document Β· PDF
| Feature | Details |
|---|---|
| Font | Caveat (handwriting style) throughout |
| Background | Cream ruled notebook paper with red left-margin line |
| Diagrams | 5 full-color anatomical diagrams from Gray's Anatomy, THIEME Atlas, Mulholland & Greenfield Surgery |
| Sections | Introduction β Formation β Summary Table β Arcuate Line β Contents β Related Structures β Clinical Significance β Mnemonics β Quick Revision |
| Tables | Color-coded composition table, related structures table, 10-point quick revision table |
| Key Boxes | Green-bordered exam key points, blue mnemonic boxes, yellow highlights |
| Page numbers | Bottom right on every page |
I am not able to open the pdf
python3 -c " from pypdf import PdfReader try: r = PdfReader('/home/daytona/workspace/rectus-sheath/Rectus_Sheath_Exam_Notes.pdf') print(f'Pages: {len(r.pages)}') for i, p in enumerate(r.pages): txt = p.extract_text() print(f' Page {i+1}: {len(txt)} chars') print('PDF reads OK') except Exception as e: print(f'ERROR: {e}') "
python3 -c " from PIL import Image import os img_dir = '/home/daytona/workspace/rectus-sheath/imgs' jpg_dir = '/home/daytona/workspace/rectus-sheath/imgs_jpg' os.makedirs(jpg_dir, exist_ok=True) for f in os.listdir(img_dir): if not f.endswith('.png'): continue src = os.path.join(img_dir, f) dst = os.path.join(jpg_dir, f.replace('.png', '.jpg')) img = Image.open(src).convert('RGB') w, h = img.size # Keep max 1400px wide if w > 1400: ratio = 1400/w img = img.resize((1400, int(h*ratio)), Image.LANCZOS) img.save(dst, 'JPEG', quality=72, optimize=True) orig_kb = os.path.getsize(src)//1024 new_kb = os.path.getsize(dst)//1024 print(f'{f[:20]} {orig_kb}KB -> {new_kb}KB') print('Done') "
~/rectus-sheath/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rectus-sheath/generate_pdf.py'
cd /home/daytona/workspace/rectus-sheath && python3 generate_pdf.py 2>&1 && ls -lh Rectus_Sheath_Exam_Notes.pdf
Rectus Sheath Exam Notes
PDF Document Β· PDF
Still it's showing error when I open it
python3 -c "import weasyprint; print('weasyprint ok')" 2>&1; python3 -c "import fpdf; print('fpdf ok')" 2>&1; python3 -c "from fpdf import FPDF; print('fpdf2 ok')" 2>&1; python3 -c "import pdfkit; print('pdfkit ok')" 2>&1; which wkhtmltopdf 2>&1; which chromium 2>&1; which google-chrome 2>&1
chromium --version 2>&1; chromium --headless --print-to-pdf=/tmp/test.pdf --no-sandbox /dev/null 2>&1 | head -5; ls -lh /tmp/test.pdf 2>/dev/null || echo "no test file"
~/rectus-sheath/rectus_sheath.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rectus Sheath β AMB Surgery Exam Notes</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&family=Indie+Flower&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }
@page {
size: A4;
margin: 18mm 16mm 16mm 22mm;
@bottom-center {
content: "β " counter(page) " β";
font-family: 'Caveat', cursive;
font-size: 11pt;
color: #555;
}
}
body {
font-family: 'Caveat', cursive;
font-size: 14pt;
color: #1B1B2F;
background: #FDFAF3;
line-height: 1.65;
}
/* Ruled-paper lines via repeating gradient */
body::before {
content: '';
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background-image:
repeating-linear-gradient(
to bottom,
transparent 0px,
transparent 29px,
#C8D8E8 29px,
#C8D8E8 30px
);
z-index: -2;
pointer-events: none;
}
/* Red left margin line */
body::after {
content: '';
position: fixed;
top: 0; bottom: 0;
left: 12mm;
width: 1.5px;
background: #F4C2C2;
z-index: -1;
pointer-events: none;
}
/* ββ TITLE BLOCK ββ */
.title-block {
text-align: center;
padding: 10px 0 6px;
border-bottom: 3px solid #1A237E;
margin-bottom: 14px;
}
.title-block h1 {
font-size: 32pt;
color: #1A237E;
font-weight: 700;
letter-spacing: 1px;
}
.title-block .subtitle {
font-family: 'Indie Flower', cursive;
font-size: 12pt;
color: #BF360C;
margin-top: 4px;
}
/* ββ SECTION HEADINGS ββ */
h2 {
font-size: 19pt;
color: #1A237E;
margin: 18px 0 4px;
border-bottom: 2px solid #BF360C;
padding-bottom: 2px;
page-break-after: avoid;
}
h3 {
font-size: 15pt;
color: #BF360C;
margin: 12px 0 3px;
page-break-after: avoid;
}
h4 {
font-size: 13.5pt;
color: #4A148C;
margin: 10px 0 2px;
page-break-after: avoid;
}
/* ββ BODY TEXT ββ */
p { margin-bottom: 5px; text-align: justify; }
/* ββ BULLETS ββ */
ul { margin: 4px 0 6px 22px; padding: 0; }
ul li { margin-bottom: 3px; list-style: disc; }
ul.sub { margin-left: 38px; }
ul.sub li { list-style: circle; font-size: 13pt; color: #333; }
/* ββ KEY EXAM BOX ββ */
.key-box {
background: #E8F5E9;
border: 2px solid #388E3C;
border-radius: 6px;
padding: 8px 12px;
margin: 10px 0;
page-break-inside: avoid;
}
.key-box .box-title {
font-size: 13pt;
color: #F57F17;
font-weight: 700;
margin-bottom: 3px;
}
.key-box p { color: #1B5E20; margin: 0; font-size: 13.5pt; }
/* ββ MNEMONIC BOX ββ */
.mnemonic-box {
background: #E0F7FA;
border-left: 5px solid #00838F;
border-radius: 4px;
padding: 8px 12px;
margin: 8px 0;
page-break-inside: avoid;
}
.mnemonic-box p { color: #006064; margin: 0; font-size: 13.5pt; }
/* ββ IMPORTANT BOX ββ */
.important-box {
background: #FFEBEE;
border-left: 5px solid #C62828;
border-radius: 4px;
padding: 8px 12px;
margin: 8px 0;
page-break-inside: avoid;
}
.important-box p { color: #B71C1C; margin: 0; font-size: 13.5pt; }
/* ββ TABLES ββ */
table {
width: 100%;
border-collapse: collapse;
margin: 10px 0 14px;
font-size: 12.5pt;
page-break-inside: avoid;
}
thead tr {
background: #1A237E;
color: white;
}
thead th {
padding: 8px 10px;
text-align: center;
font-weight: 600;
font-size: 13pt;
}
tbody tr:nth-child(odd) { background: #EEF2FF; }
tbody tr:nth-child(even) { background: #FFFFFF; }
tbody td {
padding: 7px 10px;
vertical-align: middle;
border: 1px solid #B0BEC5;
}
.table-absent { color: #B71C1C; font-weight: 700; }
/* ββ DIAGRAMS ββ */
.diagram-wrap {
text-align: center;
margin: 12px 0 6px;
page-break-inside: avoid;
}
.diagram-wrap img {
max-width: 100%;
max-height: 260px;
border: 1px solid #90A4AE;
border-radius: 4px;
background: white;
padding: 4px;
display: inline-block;
}
.diagram-caption {
font-family: 'Indie Flower', cursive;
font-size: 10.5pt;
color: #546E7A;
margin-top: 4px;
text-align: center;
}
/* ββ PAGE BREAK ββ */
.page-break { page-break-before: always; }
/* ββ QUICK REVISION TABLE ββ */
.qr-num {
text-align: center;
font-weight: 700;
color: #1A237E;
width: 30px;
}
/* ββ FOOTER NOTE ββ */
.footer-note {
font-family: 'Indie Flower', cursive;
font-size: 9.5pt;
color: #78909C;
border-top: 1px solid #B0BEC5;
margin-top: 16px;
padding-top: 6px;
text-align: center;
}
/* ββ HORIZONTAL RULE ββ */
hr { border: none; border-top: 1.5px solid #CFD8DC; margin: 8px 0; }
/* content spacing */
section { margin-bottom: 4px; }
</style>
</head>
<body>
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββ TITLE -->
<div class="title-block">
<h1>RECTUS SHEATH</h1>
<div class="subtitle">AMB Surgery Β· Long Answer Exam Notes Β· Anatomy & Clinical</div>
</div>
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββ 1. INTRO -->
<section>
<h2>1. Introduction</h2>
<p>The <strong>rectus sheath</strong> is a strong fibro-aponeurotic compartment enclosing the <em>rectus abdominis</em> (and the small <em>pyramidalis</em>) muscles. It is formed by the interlacing aponeuroses of the three flat muscles of the anterolateral abdominal wall. The two sheaths fuse medially at the <strong>linea alba</strong> and are laterally bounded by the <strong>semilunar (Spighelian) line</strong>.</p>
<p><strong>Muscles whose aponeuroses form the sheath:</strong></p>
<ul>
<li>External oblique</li>
<li>Internal oblique <em>(splits into anterior and posterior lamellae)</em></li>
<li>Transversus abdominis</li>
</ul>
</section>
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββ 2. FORMATION -->
<section>
<h2>2. Formation of the Rectus Sheath</h2>
<p>The most examined feature: the sheath's composition changes <em>above and below the arcuate line.</em></p>
<h3>2a. Above the Arcuate Line <small style="font-size:12pt;color:#555">(Upper ΒΎ of rectus abdominis)</small></h3>
<p>The internal oblique aponeurosis <strong>splits (bifurcates)</strong> at the lateral margin of rectus abdominis:</p>
<ul>
<li><strong>Anterior wall</strong> = Aponeurosis of External Oblique + Anterior lamella of Internal Oblique</li>
<li><strong>Posterior wall</strong> = Posterior lamella of Internal Oblique + Aponeurosis of Transversus Abdominis</li>
<li>Behind posterior wall: Transversalis fascia β Preperitoneal fat β Parietal peritoneum</li>
</ul>
<ul class="sub">
<li>The transversus abdominis aponeurosis does <u>NOT</u> contribute to the anterior sheath above the umbilicus</li>
</ul>
<h3>2b. Below the Arcuate Line <small style="font-size:12pt;color:#555">(Lower ΒΌ of rectus abdominis)</small></h3>
<ul>
<li><strong>Anterior wall</strong> = ALL three aponeuroses pass anterior to rectus (External + Internal + Transversus)</li>
<li><strong>Posterior wall = ABSENT</strong> β only transversalis fascia + peritoneum remain</li>
</ul>
<ul class="sub">
<li>Rectus abdominis lies directly on transversalis fascia in this zone</li>
</ul>
<div class="key-box">
<div class="box-title">β
KEY EXAM POINT</div>
<p>Below the arcuate line, ALL aponeuroses shift anteriorly. The posterior wall is <strong>ABSENT</strong> β making this zone relatively weak and predisposing to Spigelian hernia and rectus sheath hematoma that can cross the midline.</p>
</div>
</section>
<!-- DIAGRAMS 1 & 2 -->
<div class="diagram-wrap">
<img src="imgs_jpg/d399afe1ebc962411adff6401877c2d90659d0be6289cbb84843057f8eeb9c5a.jpg" alt="Rectus Sheath Cross Sections">
<div class="diagram-caption"><strong>Fig. 1</strong> β Organization of the Rectus Sheath (Gray's Anatomy for Students)<br>A: Upper ΒΎ β above arcuate line | B: Lower ΒΌ β below arcuate line</div>
</div>
<div class="diagram-wrap">
<img src="imgs_jpg/b5bf893ddb34f7c0bf478a4da7b184c330cafb1192b4cc1e521caca02c0e8667.jpg" alt="Cross-Sections Arcuate Line">
<div class="diagram-caption"><strong>Fig. 2</strong> β Detailed Cross-Sections Above & Below the Arcuate Line (Mulholland & Greenfield Surgery)</div>
</div>
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββ 3. SUMMARY TABLE -->
<div class="page-break"></div>
<section>
<h2>3. Summary Table β Composition of the Rectus Sheath</h2>
<table>
<thead>
<tr>
<th>Region</th>
<th>Anterior Wall</th>
<th>Posterior Wall</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Above arcuate line</strong><br>(Upper ΒΎ)</td>
<td>External oblique aponeurosis<br>+ Anterior lamella of Internal oblique</td>
<td>Posterior lamella of Internal oblique<br>+ Transversus abdominis aponeurosis</td>
</tr>
<tr>
<td><strong>Below arcuate line</strong><br>(Lower ΒΌ)</td>
<td>ALL three:<br>External oblique + Internal oblique<br>+ Transversus abdominis</td>
<td class="table-absent">ABSENT<br><span style="font-weight:400;color:#555;font-size:12pt;">(Only transversalis fascia + peritoneum)</span></td>
</tr>
</tbody>
</table>
</section>
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββ 4. ARCUATE LINE -->
<section>
<h2>4. The Arcuate Line (Line of Douglas)</h2>
<ul>
<li><strong>Location:</strong> Midway between the umbilicus and pubic symphysis (~3β5 cm below umbilicus)</li>
<li>Represents the lower free curved margin of the <em>posterior wall</em> of the rectus sheath</li>
<li>Below this: all aponeuroses shift anteriorly β posterior wall becomes absent</li>
<li>Inferior epigastric vessels enter the rectus muscle from its posterior surface at this level</li>
<li>Clinically important in Spigelian hernia and rectus sheath hematoma</li>
</ul>
</section>
<!-- DIAGRAM 4 -->
<div class="diagram-wrap">
<img src="imgs_jpg/dd6f178ab7e37fe0400884b0dab70b09ab9542f28c4220263e591f0069bc8f83.jpg" alt="Posterior view with arcuate line">
<div class="diagram-caption"><strong>Fig. 3</strong> β Posterior view showing the arcuate line and posterior rectus sheath (THIEME Atlas of Anatomy)</div>
</div>
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββ 5. CONTENTS -->
<section>
<h2>5. Contents of the Rectus Sheath</h2>
<h4>5a. Rectus Abdominis Muscle</h4>
<ul>
<li><strong>Origin:</strong> Pubic symphysis and pubic crest</li>
<li><strong>Insertion:</strong> Xiphoid process + costal cartilages of ribs 5β7</li>
<li><strong>Action:</strong> Trunk flexion + compression of abdominal viscera</li>
<li>Has 3 <em>tendinous inscriptions</em> β fused to <strong>anterior sheath ONLY</strong> (not posterior)</li>
</ul>
<h4>5b. Pyramidalis Muscle</h4>
<ul>
<li>Small triangular muscle; variable (may be absent)</li>
<li>Origin: Pubic crest | Insertion: Linea alba</li>
<li>Surgical use: identifies the midline during operations</li>
</ul>
<h4>5c. Superior Epigastric Artery</h4>
<ul>
<li>Terminal branch of <em>internal thoracic (internal mammary)</em> artery</li>
<li>Enters rectus sheath below costal margin through the posterior wall</li>
<li>Anastomoses with inferior epigastric artery near the umbilicus</li>
</ul>
<h4>5d. Inferior Epigastric Artery</h4>
<ul>
<li>Branch of <em>external iliac artery</em></li>
<li>Enters rectus sheath below the arcuate line (posterior to the muscle)</li>
<li><strong>Lies lateral to the deep inguinal ring</strong></li>
</ul>
<ul class="sub">
<li>Direct hernia β medial to inferior epigastric vessels (through Hesselbach's triangle)</li>
<li>Indirect hernia β lateral to inferior epigastric vessels (through deep inguinal ring)</li>
</ul>
<h4>5e. Lower Intercostal & Subcostal Nerves (T7βT12)</h4>
<ul>
<li>Enter sheath by piercing its lateral wall (between internal oblique & transversus abdominis)</li>
<li>Supply rectus abdominis + overlying skin (segmental innervation)</li>
<li>Anterior cutaneous branches pierce anterior wall to supply abdominal skin</li>
</ul>
<h4>5f. Lymphatics</h4>
<ul>
<li>Drain superiorly β para-aortic nodes</li>
<li>Drain inferiorly β inguinal nodes</li>
</ul>
</section>
<!-- DIAGRAM 3 -->
<div class="diagram-wrap">
<img src="imgs_jpg/1c382623161ac894c9d15835ce7b321e004e9df9db04a6977e5bead7c547d237.jpg" alt="Abdominal wall layers">
<div class="diagram-caption"><strong>Fig. 4</strong> β All abdominal wall layers & rectus sheath in cross-section (THIEME Atlas of Anatomy)</div>
</div>
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββ 6. RELATED STRUCTURES -->
<div class="page-break"></div>
<section>
<h2>6. Related Structures</h2>
<table>
<thead>
<tr><th>Structure</th><th>Relation / Description</th></tr>
</thead>
<tbody>
<tr><td><strong>Linea alba</strong></td><td>Midline fusion of both rectus sheaths β xiphoid to pubis</td></tr>
<tr><td><strong>Semilunar line</strong></td><td>Lateral margin of the rectus sheath β site of Spigelian hernia</td></tr>
<tr><td><strong>Tendinous inscriptions</strong></td><td>Fused to anterior sheath <u>only</u> β NOT to posterior sheath</td></tr>
<tr><td><strong>Linea semilunaris</strong></td><td>Surface marking on skin of lateral edge of rectus abdominis</td></tr>
<tr><td><strong>Transversalis fascia</strong></td><td>Deep to the sheath; sole posterior covering below arcuate line</td></tr>
<tr><td><strong>Preperitoneal space</strong></td><td>Between transversalis fascia and peritoneum; exploited in TEP hernia repair</td></tr>
</tbody>
</table>
</section>
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββ 7. CLINICAL -->
<section>
<h2>7. Clinical Significance β
</h2>
<h3>7a. Rectus Sheath Hematoma</h3>
<ul>
<li>Blood collects within the sheath from rupture of the <em>inferior epigastric artery</em></li>
<li>Causes: blunt trauma, vigorous coughing, anticoagulant therapy, pregnancy</li>
<li><strong>Above arcuate line:</strong> contained to one side (posterior wall intact)</li>
<li><strong>Below arcuate line:</strong> can spread freely and cross midline (no posterior wall)</li>
<li><em>Fothergill's sign:</em> mass does NOT move with muscle contraction</li>
<li>Treatment: conservative (most); surgical evacuation if large/expanding</li>
</ul>
<h3>7b. Spigelian (Semilunar) Hernia</h3>
<ul>
<li>Hernia through the lateral edge of the rectus sheath (semilunar line)</li>
<li>Most common at or below the arcuate line β the weakest zone</li>
<li>Interparietal hernia β lies between the layers of abdominal wall</li>
<li>Often missed clinically; ultrasound / CT required for diagnosis</li>
</ul>
<h3>7c. Surgical Incisions Through the Rectus Sheath</h3>
<ul>
<li><strong>Midline (median) incision:</strong> through linea alba β avascular, minimal nerve damage</li>
<li><strong>Paramedian incision:</strong> anterior sheath opened, rectus retracted medially, posterior sheath incised; provides stronger closure</li>
<li><strong>Pfannenstiel incision:</strong> transverse incision through anterior sheath only; used in obstetric/gynaecological surgery</li>
</ul>
<h3>7d. Hernia Repair β Rives-Stoppa / Retrorectus Repair</h3>
<ul>
<li>Mesh placed in the retrorectus space (between posterior sheath and rectus abdominis)</li>
<li>Exploits the natural plane between tendinous inscriptions and posterior sheath</li>
</ul>
<h3>7e. TRAM / DIEP Flap (Breast Reconstruction)</h3>
<ul>
<li>Rectus abdominis + inferior epigastric vessels used as a pedicled/free flap</li>
<li>Knowledge of rectus sheath anatomy essential for flap harvest and donor-site closure</li>
</ul>
<h3>7f. Rectus Sheath Block (Regional Anaesthesia)</h3>
<ul>
<li>Local anaesthetic injected between rectus abdominis and posterior rectus sheath</li>
<li>Blocks T9βT11 anterior cutaneous branches</li>
<li>Used for analgesia of midline abdominal incisions</li>
</ul>
</section>
<!-- DIAGRAM 5 -->
<div class="diagram-wrap">
<img src="imgs_jpg/dbb4cc67bd849e388f06eeb6c020ef2b86947d821fc8691b2f6a6365648d947f.jpg" alt="Laparoscopic view arcuate line">
<div class="diagram-caption"><strong>Fig. 5</strong> β Laparoscopic view: arcuate line, inferior epigastric vessels, lateral edge of rectus sheath (Mulholland & Greenfield Surgery)</div>
</div>
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββ 8. MNEMONICS -->
<div class="page-break"></div>
<section>
<h2>8. Mnemonics for Quick Recall</h2>
<div class="mnemonic-box">
<p>β
<strong>ABOVE arcuate line β ANTERIOR WALL:</strong><br>
"E + A" β <u>E</u>xternal oblique + <u>A</u>nterior lamella of Internal oblique</p>
</div>
<div class="mnemonic-box">
<p>β
<strong>ABOVE arcuate line β POSTERIOR WALL:</strong><br>
"P + T" β <u>P</u>osterior lamella of Internal oblique + <u>T</u>ransversus aponeurosis</p>
</div>
<div class="mnemonic-box">
<p>β
<strong>BELOW arcuate line:</strong><br>
"ALL go to the FRONT β nothing behind but Transversalis fascia"<br>
Posterior wall = <strong>ABSENT</strong></p>
</div>
<div class="mnemonic-box">
<p>β
<strong>Contents β "SRNIL":</strong><br>
S = Superior epigastric artery<br>
R = Rectus abdominis (+ Pyramidalis)<br>
N = Nerves (T7βT12)<br>
I = Inferior epigastric artery<br>
L = Lymphatics</p>
</div>
<div class="mnemonic-box">
<p>β
<strong>Direct vs Indirect Hernia:</strong><br>
Direct β Medial to inferior epigastric vessels (Hesselbach's triangle)<br>
Indirect β Lateral to inferior epigastric vessels (deep inguinal ring)</p>
</div>
</section>
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββ 9. QUICK REVISION -->
<section>
<h2>9. Quick Revision β 10 Must-Know Points</h2>
<table>
<thead>
<tr><th style="width:36px">#</th><th>Key Fact</th></tr>
</thead>
<tbody>
<tr><td class="qr-num">1</td><td>Rectus sheath formed by aponeuroses of External oblique, Internal oblique, Transversus abdominis</td></tr>
<tr><td class="qr-num">2</td><td>Above arcuate line: distinct anterior + posterior walls both present</td></tr>
<tr><td class="qr-num">3</td><td>Below arcuate line: ALL aponeuroses anterior β posterior wall ABSENT</td></tr>
<tr><td class="qr-num">4</td><td>Arcuate line = midway between umbilicus and pubic symphysis</td></tr>
<tr><td class="qr-num">5</td><td>Tendinous inscriptions fused to anterior sheath ONLY (not to posterior)</td></tr>
<tr><td class="qr-num">6</td><td>Superior + inferior epigastric arteries anastomose near umbilicus inside the sheath</td></tr>
<tr><td class="qr-num">7</td><td>Inferior epigastric artery lies lateral to deep inguinal ring β key landmark for hernia</td></tr>
<tr><td class="qr-num">8</td><td>Spigelian hernia occurs through the semilunar line, most common below arcuate line</td></tr>
<tr><td class="qr-num">9</td><td>Rectus sheath hematoma below arcuate line can cross the midline (no posterior wall)</td></tr>
<tr><td class="qr-num">10</td><td>Retrorectus space (between posterior sheath and rectus) used for mesh in Rives-Stoppa repair</td></tr>
</tbody>
</table>
</section>
<div class="footer-note">
Sources: Gray's Anatomy for Students Β· THIEME Atlas of Anatomy Β·
Mulholland & Greenfield's Surgery Β· Schwartz's Principles of Surgery 11e Β·
Berek & Novak's Gynecology Β· Fischer's Mastery of Surgery 8e
</div>
</body>
</html>
cd /home/daytona/workspace/rectus-sheath && chromium \ --headless=new \ --no-sandbox \ --disable-gpu \ --disable-dev-shm-usage \ --print-to-pdf="Rectus_Sheath_Exam_Notes.pdf" \ --print-to-pdf-no-header \ --no-pdf-header-footer \ "file:///home/daytona/workspace/rectus-sheath/rectus_sheath.html" 2>&1 | grep -v "dbus\|ERROR:dbus\|bus.cc\|socket" ls -lh Rectus_Sheath_Exam_Notes.pdf
python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/rectus-sheath/Rectus_Sheath_Exam_Notes.pdf') print(f'Pages: {len(r.pages)}') print('PDF valid: OK') print(f'Size: {__import__(\"os\").path.getsize(\"/home/daytona/workspace/rectus-sheath/Rectus_Sheath_Exam_Notes.pdf\")//1024} KB') "
Rectus Sheath Exam Notes
PDF Document Β· PDF