I now have comprehensive content from all sections. Let me now write the complete exam notes: --- # CONCEPT OF SWELLINGS — EXAM NOTES ### A Concise Textbook of Surgery — Chapter 9 (Cysts) & Chapter 10 (Common Tumours & Miscellaneous Lesions of the Skin), Pages 94–155 --- ## PART I: CYSTS (Chapter 9, Page 94) --- ### DEFINITION A **soft fluctuant swelling containing fluid** in a sac lined by **epithelium or endothelium** is called a cyst. (Word "cyst" = Greek for "bladder") --- ### CLASSIFICATION #### Type I: True Cysts vs False Cysts (Pseudocysts) **1. True Cysts** — lined by epithelium or endothelium (if infected → lined by granulation tissue) Fluid contents: - Serous/mucoid (colourless to brown — altered blood; may contain **cholesterol crystals**) - Porridge/toothpaste-like — from desquamated epithelium (found in **dermoid, epidermoid, branchial, sebaceous cysts**) **2. False Cysts (Pseudocysts)** | Type | Examples | |------|---------| | Exudation cysts | Pseudopancreatic cyst (lesser sac), tuberculous peritonitis fluid, vaginal hydrocele, bursa | | Degeneration cysts | Central degeneration of malignant tumour (haemorrhage/ischaemic/colliquative necrosis); e.g. Apoplectic cyst | --- #### Type II: Congenital vs Acquired **Congenital Cysts:** | Type | Description | Examples | |------|-------------|---------| | **Sequestration dermoid** | Develops at line of closure of embryonic clefts — dermal cells buried in fusion line | Angular dermoid (outer angle of orbit); Midline neck cysts; **Branchial cyst** (persistence of precervical pouch) | | **Tubulo-embryonic (Tubulo-dermoid)** | Develop in tract of ectodermal tube | **Thyroglossal cyst** (from thyroglossal duct); Post-anal dermoid (from post-anal gut); Ependymal cyst; Pituitary cyst (from Rathke's pouch) | | **Cysts of embryonic remnants** | From embryonic tubules/ducts that normally disappear | Urachal cyst; Vitello-intestinal duct cyst; Hydatid of Morgagni (paramesonephric duct); Organ of Giraldes (mesonephric/Wolffian duct) | **Acquired Cysts:** | Type | Examples | |------|---------| | **Retention cyst** | Obstruction of gland duct → retained secretion: **sebaceous cyst**, breast cysts, mucous cysts of lips/cheeks, pancreatic cyst, parotid cyst, Bartholin's cyst | | **Implantation dermoid** | Squamous epithelium driven into subcutaneous tissue by penetrating injury; common in fingers/palm | | **Parasitic cysts** | Hydatid cyst (Echinococcus granulosus); cysticercosis | | **Distension cysts** | Abnormal distension of existing cavity: ganglion, hygroma, hydrocele, Baker's cyst | | **Degeneration cysts** | Cystic degeneration of tumour/tissue | --- ### IMPORTANT INDIVIDUAL CYSTS #### 1. Sebaceous (Epidermoid) Cyst - Retention cyst from obstruction of sebaceous gland duct - Contains: cheesy, foul-smelling keratin/desquamated epithelium (NOT sebum) - Characteristic: **punctum** (blocked duct opening) on surface - Sites: scalp (most common), face, neck, back, scrotum, vulva - Multiple on scalp → **"Pilar cysts"** - **Complications:** Infection → abscess; sebaceous horn; **cock's peculiar tumour** (ulceration + calcification — rare malignant change) - Treatment: **Complete excision** including the entire sac wall (incomplete → recurrence) #### 2. Dermoid Cyst - Contains: skin and skin appendages (hair follicles, sweat glands, sebaceous glands) - Types: Sequestration dermoid (fusion line) | Teratomatous dermoid (ovary — most common benign ovarian tumour) - Angular dermoid: outer angle of orbit — **does NOT transilluminate** - Treatment: Excision #### 3. Thyroglossal Cyst - Congenital; from non-obliterated thyroglossal duct remnant - **Location:** Midline of neck, at or below hyoid bone - **Moves upward on protrusion of tongue** (pathognomonic) - May contain functional thyroid tissue - Treatment: **Sistrunk's operation** — excise cyst + middle third of hyoid bone + tract up to foramen caecum #### 4. Branchial Cyst - From persistence of precervical pouch/branchial cleft (2nd arch most common) - **Location:** Anterior triangle of neck; upper 1/3; anterior to upper sternomastoid; emerges between ECA and ICA - **Contents:** Thick creamy fluid rich in **cholesterol crystals** - Fluctuant, transilluminates - Treatment: Complete surgical excision #### 5. Ganglion - Distension cyst of a tendon sheath or joint capsule - Sites: **dorsum of wrist** (most common); volar wrist; foot - Contains: thick gelatinous fluid - Treatment: Aspiration OR excision (recurrence common after aspiration) #### 6. Implantation Dermoid - Squamous epithelium implanted by puncture wound → grows into subcutaneous tissue - Site: **fingers and palm** (occupational — seamstresses) - Contains: toothpaste-like desquamated epithelium - Treatment: Excision --- ## PART II: COMMON TUMOURS AND MISCELLANEOUS LESIONS (Chapter 10, Pages 102–155) --- ### CLASSIFICATION OF SWELLINGS / TUMOURS **Broad Classification:** 1. **Benign tumours** (neoplastic — non-invasive) 2. **Malignant tumours** (neoplastic — invasive) 3. **Cysts** (as above) 4. **Inflammatory swellings** (abscess, lymph node enlargement) 5. **Traumatic swellings** (haematoma) 6. **Physiological swellings** (pregnancy uterus, hypertrophied muscle) --- ### BENIGN vs MALIGNANT TUMOURS — MASTER COMPARISON TABLE | Feature | Benign | Malignant | |---------|--------|-----------| | **Age** | Any age | Usually after 40 years | | **Size** | Usually small (occasionally enormous) | Usually large | | **Growth** | Slow; expansive; erratic progress; may stop growing | Rapid; progressive; never stops | | **Capsule** | Well circumscribed; **capsule present** | Ill-defined; NO capsule; invasive | | **Differentiation** | Well differentiated; resembles parent tissue | Poorly differentiated; **pleomorphic** | | **Mitosis** | Rare/absent | Frequent; abnormal mitotic figures | | **Invasion** | NO invasion of surrounding tissue | **Invasion = hallmark** (hence "cancer" = crab) | | **Metastasis** | **NEVER metastasise** | Almost always metastasise | | **Ulceration/haemorrhage** | Rare | Common | | **Recurrence** | Rare after complete excision | Common | | **Effect on patient** | Pressure symptoms; hormone secretion | Anaemia, cachexia, malnutrition; hormone secretion | | **Radiosensitivity** | Variable | Many carcinomas sensitive; sarcomas **radioresistant** | > ★ Capsule = benign | Invasiveness = malignant hallmark | Pleomorphism = malignant characteristic > ★ Sarcomas are almost completely **RADIORESISTANT** --- ### AETIOLOGY OF MALIGNANT TUMOURS **Physical agents:** - Ionizing radiation (X-rays, radium, UV light) - UV light → squamous cell carcinoma + rodent ulcer (BCC) of skin - Chronic irritation **Chemical carcinogens:** - Aniline dye workers → carcinoma of urinary bladder (Group I) - **Carcinogenic azocompounds** (Group II) - **Polycyclic hydrocarbons** (coal tar, soot, mineral oils) → scrotal cancer in chimney sweeps (Pott, 1775 — first occupational cancer described) - Betel nut + tobacco → carcinoma of cheek/mouth **Viral agents:** - EBV → Burkitt's lymphoma, nasopharyngeal carcinoma - HPV → carcinoma cervix - Hepatitis B/C → hepatocellular carcinoma **Hormonal factors:** - Oestrogen → carcinoma of breast, endometrium - Testosterone → carcinoma of prostate **Genetic/hereditary:** - Familial polyposis coli → carcinoma colon - Xeroderma pigmentosum → skin cancer > ★ First occupational cancer = **scrotal cancer in chimney sweeps** (Percivall Pott, 1775) > ★ Incidence of cancer increases with age — in >90 years it is about **100%** --- ### SPREAD OF MALIGNANT TUMOURS **1. Local Spread / Direct Invasion:** - Along fascial planes, nerves, blood vessels - Into adjacent organs **2. Lymphatic Spread:** - Most common in **carcinoma** - Carcinoma shows particular tendency to invade lymphatics - "Permeation" — continuous growth along lymphatics - OR "Emboli" — discrete tumour clumps carried in lymph - First to regional lymph nodes → then distant nodes **3. Blood-borne (Haematogenous) Spread:** - More common in **sarcoma** (appears VERY EARLY in sarcoma) - Tumour cells invade thin-walled veins → carried in blood stream - **Carcinoma:** Commonest site of blood-borne metastasis = **LIVER**; others = lungs, brain, bones, kidneys, adrenals - **Sarcoma:** Commonest site = **LUNG**; skeletal deposits rare - Special: Direct communication between bronchial veins + vertebral plexus → explains frequency of **lung cancer → brain metastasis** **4. Transcoelomic Spread:** - Tumour invades serosal layer → cells detach into cavity → "seedlings" on walls - Examples: gastric/colonic/ovarian carcinomata → peritoneal seedlings - **Krukenberg tumour** = transperitoneal spread to BOTH ovaries from gastric/colonic/breast cancer; ovary enlarged with smooth surface; mucoid carcinoma - Transpleural spread: lung and breast cancer - Subarachnoid spread: **medulloblastoma** characteristic; also other gliomata **5. Spread along natural passages:** - Along bronchus, ureter → papilloma of renal pelvis → ureter → bladder - Cancer of lower lip → opposing surface of upper lip **6. Inoculation:** - Clumsy surgical technique → implantation of cancer cells on incised tissues - During biopsy - Example: breast cancer → skin flap → tumour in thigh scar > ★ Krukenberg tumour = metastasis to BOTH ovaries (gastric/colonic/breast primary) > ★ Carcinoma spreads mainly by **LYMPHATICS**; Sarcoma spreads by **BLOOD** (early) > ★ Carcinoma metastasis commonest site = **LIVER**; Sarcoma = **LUNG** > ★ Medulloblastoma spreads by **subarachnoid** route (transcoelomic) --- ### CARCINOMA vs SARCOMA — COMPARISON | Feature | Carcinoma | Sarcoma | |---------|-----------|---------| | **Age** | Middle and old age; COMMON | All ages; COMMON IN YOUNG; less common | | **Structure** | Groups and columns; well-formed stroma | Diffuse sheets; poorly-formed stroma; extensive haemorrhage + necrosis | | **Growth** | Somewhat slowly growing | VERY RAPID growth | | **Lymph node spread** | EARLY lymphatic spread | Rare lymphatic spread | | **Blood-borne spread** | Later; liver → others | VERY EARLY blood-borne spread | | **Commonest metastasis site** | LIVER | LUNG | | **Radiosensitivity** | Many highly radiosensitive | Almost completely RADIORESISTANT | --- ## BENIGN TUMOURS IN DETAIL --- ### 1. PAPILLOMA - Common benign sessile or pedunculated tumour - Composed of squamous epithelium + core of connective tissue (blood vessels + lymphatics) - Simple overgrowth of ALL layers of skin - Arises from epidermis OR mucous membrane - **Examples:** Warts (viral — HPV); skin tags; fibroepithelial polyps --- ### 2. LIPOMA - Most common benign soft tissue tumour - Composed of adult fat cells - **Site:** Subcutaneous tissue anywhere; back of neck, shoulder, back (most common) - **Characteristics:** - Soft, lobulated, non-tender - **Slip sign** (edge slips under examining fingers) - Mobile; NOT attached to skin - Pseudo-fluctuation present (NOT true fluctuation) - **Strangulated (angiolipoma)** — tender lipoma - **Diffuse lipomatosis** — multiple lipomas - **Dercum's disease** — painful fatty deposits (usually in obese women) - **Treatment:** Excision --- ### 3. FIBROMA (FIBROUS TISSUE TUMOUR) **Types:** | Type | Features | |------|---------| | **Hard fibroma** | Dense mature fibrous tissue; collagen-rich; slightly mobile; rubbery; firm | | **Soft fibroma** | Loose myxomatous tissue; soft; myxofibroma | | **Desmoid tumour** | Locally malignant; arises from muscular aponeuroses; very firm; NO capsule; does NOT metastasise but invades locally; recurs after excision | **Desmoid tumour:** - Arises in: muscular aponeuroses, especially **rectus abdominis** (post-pregnancy) and **extra-abdominal** = region of shoulder, thigh, buttock - May arise in **surgical scar** - Extra-abdominal desmoids: most often in region of old scars - Associated with **Gardner's syndrome** (familial polyposis + desmoids + osteomas) - Treatment: Wide excision; high recurrence rate --- ### 4. HAEMANGIOMA (BLOOD VESSEL TUMOUR) > ★ Haemangioma is often present since birth and it **NEVER turns malignant** — two key features #### Types: **A. Capillary Haemangioma — Three Subtypes:** | Subtype | Features | |---------|---------| | **(i) Strawberry/Raspberry Angioma** | Red mark 1–3 weeks after birth → grows for months → strawberry/raspberry like swelling; compressible; NOT pulsatile; **INVOLUTES BY AGE 7–8 YEARS** | | **(ii) Port-wine Stain (Naevus flammeus)** | Present since birth; deep purple-red; face/shoulders/neck/buttock; **NO definite swelling** — diffuse vascular deformity; colour pales on pressure but **takes time to return** (feeding vessels also abnormal) | | **(iii) Salmon Patch** | Present since birth; midline (forehead/occiput); **disappears before first birthday** | > ★ **Sturge-Weber syndrome:** Facial port-wine stain + haemangioma of **ipsilateral cerebral hemisphere** → Jacksonian epilepsy **B. Cavernous Haemangioma:** - Multiple dilated **venous channels** → spongy swelling - Compressible; empties completely on pressure → refills slowly on release - Does NOT pulsate - Does NOT transilluminate - Treatment: Injection sclerotherapy; excision; embolization **C. Arterial (Plexiform) Haemangioma:** - Congenital arteriovenous fistula - **PULSATILE** and associated with **BRUIT** (thrill on palpation) - Warm; skin over it may show dilated veins - Treatment: Surgical excision or embolization --- ### 5. NEUROFIBROMA / NEURILEMMOMA (SCHWANNOMA) **Neurofibroma:** - Arises from endoneurium - Fusiform swelling ON nerve - **Moves perpendicular to nerve axis ONLY** (not along it) — diagnostic sign - Attached to nerve; cannot be enucleated without damaging nerve - Part of Von Recklinghausen's disease in multiple form **Neurilemmoma (Schwannoma):** - Arises from Schwann cells - Eccentric on nerve; encapsulated - Can be enucleated without damaging nerve - **NEVER undergoes malignant transformation** (unlike neurofibroma) **Von

I notice your message was cut off at "Von Recklinghausen's disease..." - it looks like the exam notes were still continuing. Could you share what you'd like me to do with this content?
Asking for Preferences

What would you like me to do with these exam notes?

Also, your notes were cut off mid-sentence. Should I export what you've shared so far, or do you have the remaining content to add first?
Asking for Preferences

The notes were cut off at Von Recklinghausen's disease. Should I export the partial content now, or wait for the rest?

I'll read the PDF skill first, then generate a well-formatted PDF from your exam notes.
Reading File
Reading File
Good. I have enough to proceed. I'll now generate a well-formatted PDF using ReportLab with proper headings, tables, callout boxes, and styling suited for exam notes.
Running Command

mkdir -p /tmp/workspace/swellings-exam-notes

Writing File

~/swellings-exam-notes/generate_pdf.py

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

# ── Colour palette ──────────────────────────────────────────────
C_DARK_BLUE   = HexColor("#1A3A5C")   # main headings
C_MED_BLUE    = HexColor("#2E6DA4")   # section headings
C_LIGHT_BLUE  = HexColor("#D6E8F7")   # table header bg
C_STAR_BG     = HexColor("#FFF8DC")   # star/callout box bg
C_STAR_BORDER = HexColor("#D4A017")   # star box border
C_RED_NOTE    = HexColor("#C0392B")   # important labels
C_GREY_LINE   = HexColor("#CCCCCC")   # divider
C_SUBSEC_BG   = HexColor("#EAF2FB")   # sub-section heading bg
C_WHITE       = colors.white

PAGE_W, PAGE_H = A4
MARGIN = 20 * mm

# ── Document ─────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    "/tmp/workspace/swellings-exam-notes/Swellings_Exam_Notes.pdf",
    pagesize=A4,
    leftMargin=MARGIN, rightMargin=MARGIN,
    topMargin=MARGIN, bottomMargin=MARGIN,
    title="Concept of Swellings — Exam Notes",
    author="A Concise Textbook of Surgery"
)

styles = getSampleStyleSheet()

# ── Custom styles ────────────────────────────────────────────────
def S(name, **kw):
    return ParagraphStyle(name, **kw)

st_cover_title = S("CoverTitle",
    fontName="Helvetica-Bold", fontSize=26, textColor=C_DARK_BLUE,
    spaceAfter=6, leading=32, alignment=TA_CENTER)

st_cover_sub = S("CoverSub",
    fontName="Helvetica", fontSize=13, textColor=C_MED_BLUE,
    spaceAfter=4, leading=18, alignment=TA_CENTER)

st_cover_meta = S("CoverMeta",
    fontName="Helvetica-Oblique", fontSize=10, textColor=colors.grey,
    spaceAfter=4, leading=14, alignment=TA_CENTER)

st_part = S("Part",
    fontName="Helvetica-Bold", fontSize=15, textColor=C_WHITE,
    spaceBefore=14, spaceAfter=6, leading=20, alignment=TA_CENTER,
    backColor=C_DARK_BLUE, borderPadding=(5, 8, 5, 8))

st_h1 = S("H1",
    fontName="Helvetica-Bold", fontSize=13, textColor=C_DARK_BLUE,
    spaceBefore=12, spaceAfter=4, leading=17,
    borderPadding=(3, 6, 3, 6), backColor=C_SUBSEC_BG)

st_h2 = S("H2",
    fontName="Helvetica-Bold", fontSize=11, textColor=C_MED_BLUE,
    spaceBefore=10, spaceAfter=3, leading=15)

st_h3 = S("H3",
    fontName="Helvetica-BoldOblique", fontSize=10, textColor=C_DARK_BLUE,
    spaceBefore=7, spaceAfter=2, leading=14)

st_body = S("Body",
    fontName="Helvetica", fontSize=9.5, textColor=colors.black,
    spaceBefore=2, spaceAfter=2, leading=14, alignment=TA_JUSTIFY)

st_bullet = S("Bullet",
    fontName="Helvetica", fontSize=9.5, textColor=colors.black,
    spaceBefore=1, spaceAfter=1, leading=13,
    leftIndent=14, firstLineIndent=-10)

st_bullet2 = S("Bullet2",
    fontName="Helvetica", fontSize=9, textColor=HexColor("#333333"),
    spaceBefore=1, spaceAfter=1, leading=12,
    leftIndent=26, firstLineIndent=-10)

st_star = S("Star",
    fontName="Helvetica-Bold", fontSize=9.5, textColor=HexColor("#7B4400"),
    spaceBefore=2, spaceAfter=2, leading=13, leftIndent=6)

st_tbl_hdr = S("TblHdr",
    fontName="Helvetica-Bold", fontSize=9, textColor=C_WHITE,
    leading=12, alignment=TA_CENTER)

st_tbl_cell = S("TblCell",
    fontName="Helvetica", fontSize=8.8, textColor=colors.black,
    leading=12, alignment=TA_LEFT)

st_tbl_cell_c = S("TblCellC",
    fontName="Helvetica", fontSize=8.8, textColor=colors.black,
    leading=12, alignment=TA_CENTER)

st_label = S("Label",
    fontName="Helvetica-Bold", fontSize=9, textColor=C_RED_NOTE,
    spaceBefore=4, spaceAfter=0, leading=12)

st_definition = S("Def",
    fontName="Helvetica", fontSize=9.5, textColor=colors.black,
    spaceBefore=3, spaceAfter=3, leading=14,
    leftIndent=10, borderPadding=(4, 8, 4, 8),
    backColor=HexColor("#F0F8FF"))

# ── Helpers ──────────────────────────────────────────────────────
def h1(txt):  return Paragraph(txt, st_h1)
def h2(txt):  return Paragraph(txt, st_h2)
def h3(txt):  return Paragraph(txt, st_h3)
def body(txt): return Paragraph(txt, st_body)
def bullet(txt, level=1):
    marker = "•" if level == 1 else "–"
    st = st_bullet if level == 1 else st_bullet2
    return Paragraph(f"{marker}  {txt}", st)
def sp(h=4):  return Spacer(1, h * mm)
def hr():     return HRFlowable(width="100%", thickness=0.5, color=C_GREY_LINE, spaceAfter=3)

def star_box(lines):
    """Yellow callout box with star bullets."""
    items = []
    for line in lines:
        items.append(Paragraph(f"★  {line}", st_star))
    t = Table([[items]], colWidths=[PAGE_W - 2*MARGIN])
    t.setStyle(TableStyle([
        ("BOX",        (0,0), (-1,-1), 1.2, C_STAR_BORDER),
        ("BACKGROUND", (0,0), (-1,-1), C_STAR_BG),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
        ("RIGHTPADDING",  (0,0), (-1,-1), 8),
    ]))
    return t

def part_banner(txt):
    t = Table([[Paragraph(txt, st_part)]], colWidths=[PAGE_W - 2*MARGIN])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), C_DARK_BLUE),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
    ]))
    return t

def make_table(headers, rows, col_widths=None):
    """Build a styled table. headers = list of strings, rows = list of lists."""
    usable = PAGE_W - 2*MARGIN
    if col_widths is None:
        w = usable / len(headers)
        col_widths = [w] * len(headers)
    data = [[Paragraph(h, st_tbl_hdr) for h in headers]]
    for row in rows:
        data.append([Paragraph(str(c), st_tbl_cell) for c in row])
    t = Table(data, colWidths=col_widths)
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0),  C_DARK_BLUE),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, C_LIGHT_BLUE]),
        ("GRID",          (0,0), (-1,-1), 0.4, C_GREY_LINE),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 5),
        ("RIGHTPADDING",  (0,0), (-1,-1), 5),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ]))
    return t

# ════════════════════════════════════════════════════════════════
# BUILD STORY
# ════════════════════════════════════════════════════════════════
story = []

# ── COVER PAGE ──────────────────────────────────────────────────
story += [
    sp(30),
    Paragraph("CONCEPT OF SWELLINGS", st_cover_title),
    sp(3),
    Paragraph("EXAM NOTES", S("CT2", fontName="Helvetica-Bold", fontSize=18,
              textColor=C_MED_BLUE, alignment=TA_CENTER, spaceAfter=4)),
    sp(6),
    HRFlowable(width="60%", thickness=2, color=C_MED_BLUE, hAlign="CENTER"),
    sp(6),
    Paragraph("A Concise Textbook of Surgery", st_cover_sub),
    Paragraph("Chapter 9 (Cysts) & Chapter 10 (Common Tumours & Miscellaneous Lesions of the Skin)", st_cover_meta),
    Paragraph("Pages 94–155", st_cover_meta),
    sp(20),
    Paragraph("Contents: Cysts · Classification · Individual Cysts · Tumours · Carcinoma vs Sarcoma · Spread of Malignancy · Benign Tumours in Detail", st_cover_meta),
    PageBreak(),
]

# ════════════════════════════════════════════════════════════════
# PART I — CYSTS
# ════════════════════════════════════════════════════════════════
story += [
    part_banner("PART I:  CYSTS  (Chapter 9, Page 94)"),
    sp(4),
]

# DEFINITION
story += [
    h1("DEFINITION"),
    body("A <b>soft fluctuant swelling containing fluid</b> in a sac lined by <b>epithelium or endothelium</b> is called a cyst."),
    body("(Word "cyst" = Greek for "bladder")"),
    sp(3),
]

# CLASSIFICATION
story += [
    h1("CLASSIFICATION"),
    h2("Type I: True Cysts vs False Cysts (Pseudocysts)"),
    h3("1. True Cysts — lined by epithelium or endothelium (if infected → lined by granulation tissue)"),
    bullet("Fluid contents: Serous/mucoid (colourless to brown — altered blood; may contain <b>cholesterol crystals</b>)"),
    bullet("Porridge/toothpaste-like — from desquamated epithelium (found in <b>dermoid, epidermoid, branchial, sebaceous cysts</b>)"),
    sp(2),
    h3("2. False Cysts (Pseudocysts)"),
    make_table(
        ["Type", "Examples"],
        [
            ["Exudation cysts", "Pseudopancreatic cyst (lesser sac), tuberculous peritonitis fluid, vaginal hydrocele, bursa"],
            ["Degeneration cysts", "Central degeneration of malignant tumour (haemorrhage/ischaemic/colliquative necrosis); e.g. Apoplectic cyst"],
        ],
        col_widths=[60*mm, 110*mm]
    ),
    sp(4),
    h2("Type II: Congenital vs Acquired"),
    h3("Congenital Cysts"),
    make_table(
        ["Type", "Description", "Examples"],
        [
            ["Sequestration dermoid",
             "Develops at line of closure of embryonic clefts — dermal cells buried in fusion line",
             "Angular dermoid (outer angle of orbit); Midline neck cysts; Branchial cyst (persistence of precervical pouch)"],
            ["Tubulo-embryonic (Tubulo-dermoid)",
             "Develop in tract of ectodermal tube",
             "Thyroglossal cyst (from thyroglossal duct); Post-anal dermoid (from post-anal gut); Ependymal cyst; Pituitary cyst (from Rathke's pouch)"],
            ["Cysts of embryonic remnants",
             "From embryonic tubules/ducts that normally disappear",
             "Urachal cyst; Vitello-intestinal duct cyst; Hydatid of Morgagni (paramesonephric duct); Organ of Giraldes (mesonephric/Wolffian duct)"],
        ],
        col_widths=[45*mm, 65*mm, 65*mm]
    ),
    sp(4),
    h3("Acquired Cysts"),
    make_table(
        ["Type", "Examples"],
        [
            ["Retention cyst",
             "Obstruction of gland duct → retained secretion: sebaceous cyst, breast cysts, mucous cysts of lips/cheeks, pancreatic cyst, parotid cyst, Bartholin's cyst"],
            ["Implantation dermoid",
             "Squamous epithelium driven into subcutaneous tissue by penetrating injury; common in fingers/palm"],
            ["Parasitic cysts",
             "Hydatid cyst (Echinococcus granulosus); cysticercosis"],
            ["Distension cysts",
             "Abnormal distension of existing cavity: ganglion, hygroma, hydrocele, Baker's cyst"],
            ["Degeneration cysts",
             "Cystic degeneration of tumour/tissue"],
        ],
        col_widths=[60*mm, 110*mm]
    ),
    sp(6),
]

# INDIVIDUAL CYSTS
story += [
    h1("IMPORTANT INDIVIDUAL CYSTS"),
    sp(2),
]

# 1. Sebaceous
story += [
    h2("1.  Sebaceous (Epidermoid) Cyst"),
    bullet("Retention cyst from obstruction of sebaceous gland duct"),
    bullet("Contains: cheesy, foul-smelling keratin/desquamated epithelium (<b>NOT sebum</b>)"),
    bullet("Characteristic: <b>punctum</b> (blocked duct opening) on surface"),
    bullet("Sites: scalp (most common), face, neck, back, scrotum, vulva"),
    bullet("Multiple on scalp → <b>"Pilar cysts"</b>"),
    bullet("<b>Complications:</b> Infection → abscess; sebaceous horn; <b>cock's peculiar tumour</b> (ulceration + calcification — rare malignant change)"),
    bullet("<b>Treatment:</b> Complete excision including the entire sac wall (incomplete → recurrence)"),
    sp(3),
]

# 2. Dermoid
story += [
    h2("2.  Dermoid Cyst"),
    bullet("Contains: skin and skin appendages (hair follicles, sweat glands, sebaceous glands)"),
    bullet("Types: Sequestration dermoid (fusion line) | Teratomatous dermoid (ovary — most common benign ovarian tumour)"),
    bullet("Angular dermoid: outer angle of orbit — <b>does NOT transilluminate</b>"),
    bullet("<b>Treatment:</b> Excision"),
    sp(3),
]

# 3. Thyroglossal
story += [
    h2("3.  Thyroglossal Cyst"),
    bullet("Congenital; from non-obliterated thyroglossal duct remnant"),
    bullet("<b>Location:</b> Midline of neck, at or below hyoid bone"),
    bullet("<b>Moves upward on protrusion of tongue</b> (pathognomonic)"),
    bullet("May contain functional thyroid tissue"),
    bullet("<b>Treatment: Sistrunk's operation</b> — excise cyst + middle third of hyoid bone + tract up to foramen caecum"),
    sp(3),
]

# 4. Branchial
story += [
    h2("4.  Branchial Cyst"),
    bullet("From persistence of precervical pouch/branchial cleft (2nd arch most common)"),
    bullet("<b>Location:</b> Anterior triangle of neck; upper 1/3; anterior to upper sternomastoid; emerges between ECA and ICA"),
    bullet("<b>Contents:</b> Thick creamy fluid rich in <b>cholesterol crystals</b>"),
    bullet("Fluctuant, transilluminates"),
    bullet("<b>Treatment:</b> Complete surgical excision"),
    sp(3),
]

# 5. Ganglion
story += [
    h2("5.  Ganglion"),
    bullet("Distension cyst of a tendon sheath or joint capsule"),
    bullet("Sites: <b>dorsum of wrist</b> (most common); volar wrist; foot"),
    bullet("Contains: thick gelatinous fluid"),
    bullet("<b>Treatment:</b> Aspiration OR excision (recurrence common after aspiration)"),
    sp(3),
]

# 6. Implantation Dermoid
story += [
    h2("6.  Implantation Dermoid"),
    bullet("Squamous epithelium implanted by puncture wound → grows into subcutaneous tissue"),
    bullet("Site: <b>fingers and palm</b> (occupational — seamstresses)"),
    bullet("Contains: toothpaste-like desquamated epithelium"),
    bullet("<b>Treatment:</b> Excision"),
    sp(4),
    PageBreak(),
]

# ════════════════════════════════════════════════════════════════
# PART II — TUMOURS
# ════════════════════════════════════════════════════════════════
story += [
    part_banner("PART II:  COMMON TUMOURS & MISCELLANEOUS LESIONS  (Chapter 10, Pages 102–155)"),
    sp(4),
    h1("CLASSIFICATION OF SWELLINGS / TUMOURS"),
    body("<b>Broad Classification:</b>"),
    bullet("Benign tumours (neoplastic — non-invasive)"),
    bullet("Malignant tumours (neoplastic — invasive)"),
    bullet("Cysts (as above)"),
    bullet("Inflammatory swellings (abscess, lymph node enlargement)"),
    bullet("Traumatic swellings (haematoma)"),
    bullet("Physiological swellings (pregnancy uterus, hypertrophied muscle)"),
    sp(4),
]

# Benign vs Malignant master table
story += [
    h1("BENIGN vs MALIGNANT TUMOURS — MASTER COMPARISON TABLE"),
    sp(2),
    make_table(
        ["Feature", "Benign", "Malignant"],
        [
            ["Age", "Any age", "Usually after 40 years"],
            ["Size", "Usually small (occasionally enormous)", "Usually large"],
            ["Growth", "Slow; expansive; erratic progress; may stop growing", "Rapid; progressive; never stops"],
            ["Capsule", "Well circumscribed; capsule present", "Ill-defined; NO capsule; invasive"],
            ["Differentiation", "Well differentiated; resembles parent tissue", "Poorly differentiated; pleomorphic"],
            ["Mitosis", "Rare/absent", "Frequent; abnormal mitotic figures"],
            ["Invasion", "NO invasion of surrounding tissue", "Invasion = hallmark (hence 'cancer' = crab)"],
            ["Metastasis", "NEVER metastasise", "Almost always metastasise"],
            ["Ulceration/haemorrhage", "Rare", "Common"],
            ["Recurrence", "Rare after complete excision", "Common"],
            ["Effect on patient", "Pressure symptoms; hormone secretion", "Anaemia, cachexia, malnutrition; hormone secretion"],
            ["Radiosensitivity", "Variable", "Many carcinomas sensitive; sarcomas RADIORESISTANT"],
        ],
        col_widths=[48*mm, 67*mm, 60*mm]
    ),
    sp(3),
    star_box([
        "Capsule = benign | Invasiveness = malignant hallmark | Pleomorphism = malignant characteristic",
        "Sarcomas are almost completely RADIORESISTANT",
    ]),
    sp(4),
]

# Aetiology
story += [
    h1("AETIOLOGY OF MALIGNANT TUMOURS"),
    h3("Physical Agents"),
    bullet("Ionizing radiation (X-rays, radium, UV light)"),
    bullet("UV light → squamous cell carcinoma + rodent ulcer (BCC) of skin"),
    bullet("Chronic irritation"),
    h3("Chemical Carcinogens"),
    bullet("Aniline dye workers → carcinoma of urinary bladder (Group I)"),
    bullet("Carcinogenic azocompounds (Group II)"),
    bullet("Polycyclic hydrocarbons (coal tar, soot, mineral oils) → scrotal cancer in chimney sweeps (Pott, 1775 — first occupational cancer described)"),
    bullet("Betel nut + tobacco → carcinoma of cheek/mouth"),
    h3("Viral Agents"),
    bullet("EBV → Burkitt's lymphoma, nasopharyngeal carcinoma"),
    bullet("HPV → carcinoma cervix"),
    bullet("Hepatitis B/C → hepatocellular carcinoma"),
    h3("Hormonal Factors"),
    bullet("Oestrogen → carcinoma of breast, endometrium"),
    bullet("Testosterone → carcinoma of prostate"),
    h3("Genetic / Hereditary"),
    bullet("Familial polyposis coli → carcinoma colon"),
    bullet("Xeroderma pigmentosum → skin cancer"),
    sp(3),
    star_box([
        "First occupational cancer = scrotal cancer in chimney sweeps (Percivall Pott, 1775)",
        "Incidence of cancer increases with age — in >90 years it is about 100%",
    ]),
    sp(4),
]

# Spread
story += [
    h1("SPREAD OF MALIGNANT TUMOURS"),
    sp(2),
    h2("1.  Local Spread / Direct Invasion"),
    bullet("Along fascial planes, nerves, blood vessels"),
    bullet("Into adjacent organs"),
    h2("2.  Lymphatic Spread"),
    bullet("Most common in <b>carcinoma</b>"),
    bullet("Carcinoma shows particular tendency to invade lymphatics"),
    bullet('"Permeation" — continuous growth along lymphatics'),
    bullet('OR "Emboli" — discrete tumour clumps carried in lymph'),
    bullet("First to regional lymph nodes → then distant nodes"),
    h2("3.  Blood-borne (Haematogenous) Spread"),
    bullet("More common in <b>sarcoma</b> (appears VERY EARLY in sarcoma)"),
    bullet("Tumour cells invade thin-walled veins → carried in blood stream"),
    bullet("<b>Carcinoma:</b> Commonest site of blood-borne metastasis = <b>LIVER</b>; others = lungs, brain, bones, kidneys, adrenals"),
    bullet("<b>Sarcoma:</b> Commonest site = <b>LUNG</b>; skeletal deposits rare"),
    bullet("Special: Direct communication between bronchial veins + vertebral plexus → explains frequency of lung cancer → brain metastasis"),
    h2("4.  Transcoelomic Spread"),
    bullet("Tumour invades serosal layer → cells detach into cavity → 'seedlings' on walls"),
    bullet("Examples: gastric/colonic/ovarian carcinomata → peritoneal seedlings"),
    bullet("<b>Krukenberg tumour</b> = transperitoneal spread to BOTH ovaries from gastric/colonic/breast cancer; ovary enlarged with smooth surface; mucoid carcinoma"),
    bullet("Transpleural spread: lung and breast cancer"),
    bullet("Subarachnoid spread: <b>medulloblastoma</b> characteristic; also other gliomata"),
    h2("5.  Spread along Natural Passages"),
    bullet("Along bronchus, ureter → papilloma of renal pelvis → ureter → bladder"),
    bullet("Cancer of lower lip → opposing surface of upper lip"),
    h2("6.  Inoculation"),
    bullet("Clumsy surgical technique → implantation of cancer cells on incised tissues"),
    bullet("During biopsy"),
    bullet("Example: breast cancer → skin flap → tumour in thigh scar"),
    sp(3),
    star_box([
        "Krukenberg tumour = metastasis to BOTH ovaries (gastric/colonic/breast primary)",
        "Carcinoma spreads mainly by LYMPHATICS; Sarcoma spreads by BLOOD (early)",
        "Carcinoma metastasis commonest site = LIVER; Sarcoma = LUNG",
        "Medulloblastoma spreads by subarachnoid route (transcoelomic)",
    ]),
    sp(4),
]

# Carcinoma vs Sarcoma
story += [
    h1("CARCINOMA vs SARCOMA — COMPARISON"),
    sp(2),
    make_table(
        ["Feature", "Carcinoma", "Sarcoma"],
        [
            ["Age", "Middle and old age; COMMON", "All ages; COMMON IN YOUNG; less common overall"],
            ["Structure", "Groups and columns; well-formed stroma", "Diffuse sheets; poorly-formed stroma; extensive haemorrhage + necrosis"],
            ["Growth", "Somewhat slowly growing", "VERY RAPID growth"],
            ["Lymph node spread", "EARLY lymphatic spread", "Rare lymphatic spread"],
            ["Blood-borne spread", "Later; liver → others", "VERY EARLY blood-borne spread"],
            ["Commonest metastasis site", "LIVER", "LUNG"],
            ["Radiosensitivity", "Many highly radiosensitive", "Almost completely RADIORESISTANT"],
        ],
        col_widths=[48*mm, 67*mm, 60*mm]
    ),
    sp(6),
    PageBreak(),
]

# ── BENIGN TUMOURS IN DETAIL ─────────────────────────────────────
story += [
    part_banner("BENIGN TUMOURS IN DETAIL"),
    sp(4),
]

# 1. Papilloma
story += [
    h1("1.  PAPILLOMA"),
    bullet("Common benign sessile or pedunculated tumour"),
    bullet("Composed of squamous epithelium + core of connective tissue (blood vessels + lymphatics)"),
    bullet("Simple overgrowth of ALL layers of skin"),
    bullet("Arises from epidermis OR mucous membrane"),
    bullet("<b>Examples:</b> Warts (viral — HPV); skin tags; fibroepithelial polyps"),
    sp(4),
]

# 2. Lipoma
story += [
    h1("2.  LIPOMA"),
    bullet("Most common benign soft tissue tumour"),
    bullet("Composed of adult fat cells"),
    bullet("<b>Site:</b> Subcutaneous tissue anywhere; back of neck, shoulder, back (most common)"),
    h3("Characteristics"),
    bullet("Soft, lobulated, non-tender"),
    bullet("<b>Slip sign</b> (edge slips under examining fingers)"),
    bullet("Mobile; NOT attached to skin"),
    bullet("Pseudo-fluctuation present (NOT true fluctuation)"),
    bullet("<b>Strangulated (angiolipoma)</b> — tender lipoma"),
    bullet("<b>Diffuse lipomatosis</b> — multiple lipomas"),
    bullet("<b>Dercum's disease</b> — painful fatty deposits (usually in obese women)"),
    bullet("<b>Treatment:</b> Excision"),
    sp(4),
]

# 3. Fibroma
story += [
    h1("3.  FIBROMA (FIBROUS TISSUE TUMOUR)"),
    sp(2),
    make_table(
        ["Type", "Features"],
        [
            ["Hard fibroma", "Dense mature fibrous tissue; collagen-rich; slightly mobile; rubbery; firm"],
            ["Soft fibroma", "Loose myxomatous tissue; soft; myxofibroma"],
            ["Desmoid tumour", "Locally malignant; arises from muscular aponeuroses; very firm; NO capsule; does NOT metastasise but invades locally; recurs after excision"],
        ],
        col_widths=[50*mm, 125*mm]
    ),
    sp(3),
    h3("Desmoid Tumour (important details)"),
    bullet("Arises in: muscular aponeuroses, especially <b>rectus abdominis</b> (post-pregnancy) and extra-abdominal = region of shoulder, thigh, buttock"),
    bullet("May arise in <b>surgical scar</b>"),
    bullet("Extra-abdominal desmoids: most often in region of old scars"),
    bullet("Associated with <b>Gardner's syndrome</b> (familial polyposis + desmoids + osteomas)"),
    bullet("<b>Treatment:</b> Wide excision; high recurrence rate"),
    sp(4),
]

# 4. Haemangioma
story += [
    h1("4.  HAEMANGIOMA (BLOOD VESSEL TUMOUR)"),
    sp(2),
    star_box([
        "Haemangioma is often present since birth and it NEVER turns malignant — two key features",
    ]),
    sp(3),
    h2("A. Capillary Haemangioma — Three Subtypes"),
    sp(2),
    make_table(
        ["Subtype", "Features"],
        [
            ["(i) Strawberry/Raspberry Angioma",
             "Red mark 1–3 weeks after birth → grows for months → strawberry/raspberry like swelling; compressible; NOT pulsatile; INVOLUTES BY AGE 7–8 YEARS"],
            ["(ii) Port-wine Stain (Naevus flammeus)",
             "Present since birth; deep purple-red; face/shoulders/neck/buttock; NO definite swelling — diffuse vascular deformity; colour pales on pressure but takes time to return (feeding vessels also abnormal)"],
            ["(iii) Salmon Patch",
             "Present since birth; midline (forehead/occiput); DISAPPEARS before first birthday"],
        ],
        col_widths=[55*mm, 120*mm]
    ),
    sp(3),
    star_box([
        "Sturge-Weber syndrome: Facial port-wine stain + haemangioma of ipsilateral cerebral hemisphere → Jacksonian epilepsy",
    ]),
    sp(3),
    h2("B. Cavernous Haemangioma"),
    bullet("Multiple dilated <b>venous channels</b> → spongy swelling"),
    bullet("Compressible; empties completely on pressure → refills slowly on release"),
    bullet("Does NOT pulsate"),
    bullet("Does NOT transilluminate"),
    bullet("<b>Treatment:</b> Injection sclerotherapy; excision; embolization"),
    sp(3),
    h2("C. Arterial (Plexiform) Haemangioma"),
    bullet("Congenital arteriovenous fistula"),
    bullet("<b>PULSATILE</b> and associated with <b>BRUIT</b> (thrill on palpation)"),
    bullet("Warm; skin over it may show dilated veins"),
    bullet("<b>Treatment:</b> Surgical excision or embolization"),
    sp(4),
]

# 5. Neurofibroma / Schwannoma
story += [
    h1("5.  NEUROFIBROMA / NEURILEMMOMA (SCHWANNOMA)"),
    h2("Neurofibroma"),
    bullet("Arises from endoneurium"),
    bullet("Fusiform swelling ON nerve"),
    bullet("<b>Moves perpendicular to nerve axis ONLY</b> (not along it) — diagnostic sign"),
    bullet("Attached to nerve; cannot be enucleated without damaging nerve"),
    bullet("Part of Von Recklinghausen's disease in multiple form"),
    sp(2),
    h2("Neurilemmoma (Schwannoma)"),
    bullet("Arises from Schwann cells"),
    bullet("Eccentric on nerve; encapsulated"),
    bullet("Can be enucleated without damaging nerve"),
    bullet("<b>NEVER undergoes malignant transformation</b> (unlike neurofibroma)"),
    sp(3),
    star_box([
        "Neurofibroma: moves perpendicular to nerve — attached to nerve — CAN undergo malignant change",
        "Neurilemmoma (Schwannoma): eccentric — can be enucleated — NEVER malignant",
        "Von Recklinghausen's disease = multiple neurofibromas + café-au-lait spots (NF type 1)",
    ]),
    sp(4),
]

# Footer note
story += [
    hr(),
    Paragraph(
        "<i>Notes based on: A Concise Textbook of Surgery, Chapters 9–10 (Pages 94–155). "
        "Content cut off at Von Recklinghausen's disease — remaining sections to be added.</i>",
        S("FootNote", fontName="Helvetica-Oblique", fontSize=8, textColor=colors.grey,
          leading=11, alignment=TA_CENTER, spaceBefore=4)
    ),
]

# ── BUILD ────────────────────────────────────────────────────────
doc.build(story)
print("PDF generated successfully.")
Running Command

cd /tmp/workspace/swellings-exam-notes && python generate_pdf.py 2>&1

Editing File

~/swellings-exam-notes/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/swellings-exam-notes/generate_pdf.py'
Running Command

cd /tmp/workspace/swellings-exam-notes && python generate_pdf.py 2>&1

There are several curly-quote strings embedded in double-quoted Python strings. Let me fix all of them at once with a sed command:
Running Command

cd /tmp/workspace/swellings-exam-notes && python3 -c " import re with open('generate_pdf.py', 'r', encoding='utf-8') as f: content = f.read() # Replace curly quotes inside Python strings with escaped equivalents # \u201c = left double quote, \u201d = right double quote content = content.replace('\u201c', '&ldquo;').replace('\u201d', '&rdquo;') with open('generate_pdf.py', 'w', encoding='utf-8') as f: f.write(content) print('Done') "

Running Command

cd /tmp/workspace/swellings-exam-notes && python generate_pdf.py 2>&1

Reading File
The curly quotes are still there (the script ran before the replacement). Let me do a full clean rewrite of the problem lines using a Python replace script:
Running Command

cd /tmp/workspace/swellings-exam-notes && python3 << 'PYEOF' with open('generate_pdf.py', 'r', encoding='utf-8') as f: content = f.read() # Check for any remaining curly quotes import unicodedata problem_chars = [c for c in content if unicodedata.category(c) == 'Pi' or unicodedata.category(c) == 'Pf'] unique_problem = list(set(problem_chars)) print("Problematic chars found:", [(hex(ord(c)), unicodedata.name(c)) for c in unique_problem]) PYEOF

Running Command

cd /tmp/workspace/swellings-exam-notes && python3 -c " with open('generate_pdf.py', 'rb') as f: content = f.read() # Line 282 raw bytes around the problem lines = content.split(b'\n') line = lines[281] print(repr(line[:80])) "

The issue is plain ASCII double-quotes " inside the outer "..." string — the string uses "Pilar cysts" with standard double-quotes inside a double-quoted Python string. I need to fix all such cases by using single-quote delimiters or escaping. Let me do a targeted fix:
Running Command

cd /tmp/workspace/swellings-exam-notes && python3 << 'PYEOF' with open('generate_pdf.py', 'r', encoding='utf-8') as f: content = f.read() # Fix specific problem lines fixes = [ ( 'bullet("Multiple on scalp → <b>"Pilar cysts"</b>"),', 'bullet("Multiple on scalp → <b>&ldquo;Pilar cysts&rdquo;</b>"),' ), ( '''bullet('"Permeation" — continuous growth along lymphatics'),''', '''bullet("&ldquo;Permeation&rdquo; — continuous growth along lymphatics"),''' ), ( '''bullet('OR "Emboli" — discrete tumour clumps carried in lymph'),''', '''bullet("OR &ldquo;Emboli&rdquo; — discrete tumour clumps carried in lymph"),''' ), ( """bullet("Tumour invades serosal layer → cells detach into cavity → 'seedlings' on walls"),""", """bullet("Tumour invades serosal layer → cells detach into cavity → &lsquo;seedlings&rsquo; on walls"),""" ), ( '''bullet("Examples: gastric/colonic/ovarian carcinomata → peritoneal seedlings"),''', '''bullet("Examples: gastric/colonic/ovarian carcinomata → peritoneal seedlings"),''' ), ] for old, new in fixes: if old in content: content = content.replace(old, new) print(f"Fixed: {old[:60]}") else: print(f"NOT FOUND: {old[:60]}") with open('generate_pdf.py', 'w', encoding='utf-8') as f: f.write(content) print("Done") PYEOF

Running Command

cd /tmp/workspace/swellings-exam-notes && python generate_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/swellings-exam-notes/Swellings_Exam_Notes.pdf

Your PDF is ready. Here's the download link:

Swellings Exam Notes

PDF Document · PDF


What's inside the PDF:
  • Cover page with title, subtitle, and chapter references
  • Part I — Cysts: Definition, full classification (True vs Pseudocysts, Congenital vs Acquired) with formatted tables, then all 6 individual cysts (Sebaceous, Dermoid, Thyroglossal, Branchial, Ganglion, Implantation Dermoid) with bullet points
  • Part II — Tumours: Classification, Benign vs Malignant master comparison table, Aetiology, Spread of malignancy (all 6 routes), Carcinoma vs Sarcoma comparison table
  • Benign Tumours in Detail: Papilloma, Lipoma, Fibroma (with Desmoid table), Haemangioma (Capillary subtypes table + Cavernous + Arterial), Neurofibroma/Schwannoma
  • Yellow star callout boxes throughout for all exam-critical facts (★ points)
  • Alternating row-shaded tables for all comparison content
  • A footer note marking where the content was cut off (Von Recklinghausen's disease onward)
When you have the remaining sections, paste them in and I'll append them to a second version.
This is a shared conversation. Sign in to Orris to start your own chat.