Pathogenesis of inflammatory bowel fisease as pet robbins


| T cell subset | Key cytokines produced | Effect |
|---|---|---|
| Th1 | IFN-γ | Activates macrophages → tissue damage |
| Th17 | IL-17, IL-22 | Recruits neutrophils, perpetuates inflammation |
| Th2 (more in UC) | IL-13 | Mucosal barrier injury |
IBD arises when genetically predisposed individuals develop a failure of immune tolerance to their own gut microbiota, mediated by defects in the epithelial barrier and dysregulated mucosal immune responses (predominantly Th1/Th17-driven). The result is an inappropriately sustained inflammatory cascade that injures the bowel wall.
Genetic susceptibility (NOD2, ATG16L1, IL-10 axis)
↓
Epithelial barrier dysfunction → increased bacterial translocation
↓
Dendritic cells/macrophages sense bacterial products
↓
IL-12/IL-23 → CD4+ T cell differentiation → Th1, Th17 (and some Th2)
↓
IFN-γ, IL-17, TNF, IL-13 release
↓
Macrophage activation + neutrophil recruitment (via IL-8, IL-17)
↓
Chronic mucosal/transmural inflammation → tissue injury
| Feature | Crohn Disease | Ulcerative Colitis |
|---|---|---|
| Genetic factors | Stronger (50% twin concordance) | Weaker (20% twin concordance) |
| NOD2/autophagy genes | Yes | No |
| Dominant T-cell response | Th1 + Th17 | Th2 (IL-13) + Th17 |
| Transmural inflammation | Yes | No (mucosal only) |
| Barrier dysfunction | Well-established | Less prominent |
| Granulomas | ~35% of cases | No |
Make pdf in readable format white background
ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"
~/ibd-pathogenesis/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
import urllib.request
import os
OUTPUT = "/home/daytona/workspace/ibd-pathogenesis/IBD_Pathogenesis_Robbins.pdf"
os.makedirs("/home/daytona/workspace/ibd-pathogenesis", exist_ok=True)
# Download pathogenesis diagram
IMG_URL = "https://cdn.orris.care/cdss_images/bf21243e4ed4e92d7b5193fcc0b8f709bdfcda21f876716ccf2b843bc9cbeedf.png"
IMG_PATH = "/home/daytona/workspace/ibd-pathogenesis/pathogenesis_diagram.png"
if not os.path.exists(IMG_PATH):
urllib.request.urlretrieve(IMG_URL, IMG_PATH)
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=2*cm,
rightMargin=2*cm,
topMargin=2*cm,
bottomMargin=2*cm,
title="Pathogenesis of Inflammatory Bowel Disease",
author="Robbins Pathology"
)
W, H = A4
content_width = W - 4*cm
# ── Styles ──────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
title_style = ParagraphStyle(
"MainTitle",
fontSize=20,
fontName="Helvetica-Bold",
textColor=colors.HexColor("#1a3a5c"),
spaceAfter=4,
alignment=TA_CENTER,
)
subtitle_style = ParagraphStyle(
"Subtitle",
fontSize=11,
fontName="Helvetica-Oblique",
textColor=colors.HexColor("#4a6fa5"),
spaceAfter=16,
alignment=TA_CENTER,
)
h1_style = ParagraphStyle(
"H1",
fontSize=14,
fontName="Helvetica-Bold",
textColor=colors.white,
spaceBefore=14,
spaceAfter=6,
leftIndent=0,
borderPad=6,
backColor=colors.HexColor("#1a3a5c"),
leading=20,
)
h2_style = ParagraphStyle(
"H2",
fontSize=12,
fontName="Helvetica-Bold",
textColor=colors.HexColor("#1a3a5c"),
spaceBefore=10,
spaceAfter=4,
borderPad=4,
leftIndent=0,
borderColor=colors.HexColor("#4a6fa5"),
borderWidth=0,
leading=16,
)
h3_style = ParagraphStyle(
"H3",
fontSize=11,
fontName="Helvetica-BoldOblique",
textColor=colors.HexColor("#2c5f8a"),
spaceBefore=8,
spaceAfter=3,
leading=14,
)
body_style = ParagraphStyle(
"Body",
fontSize=10,
fontName="Helvetica",
textColor=colors.HexColor("#1a1a1a"),
spaceAfter=6,
leading=15,
alignment=TA_JUSTIFY,
)
bullet_style = ParagraphStyle(
"Bullet",
fontSize=10,
fontName="Helvetica",
textColor=colors.HexColor("#1a1a1a"),
spaceAfter=3,
leading=14,
leftIndent=16,
bulletIndent=4,
alignment=TA_LEFT,
)
sub_bullet_style = ParagraphStyle(
"SubBullet",
fontSize=10,
fontName="Helvetica",
textColor=colors.HexColor("#1a1a1a"),
spaceAfter=2,
leading=14,
leftIndent=32,
bulletIndent=20,
)
caption_style = ParagraphStyle(
"Caption",
fontSize=9,
fontName="Helvetica-Oblique",
textColor=colors.HexColor("#555555"),
spaceAfter=8,
alignment=TA_CENTER,
)
box_style = ParagraphStyle(
"Box",
fontSize=10,
fontName="Helvetica",
textColor=colors.HexColor("#1a1a1a"),
spaceAfter=4,
leading=15,
leftIndent=8,
rightIndent=8,
alignment=TA_LEFT,
)
source_style = ParagraphStyle(
"Source",
fontSize=8,
fontName="Helvetica-Oblique",
textColor=colors.HexColor("#777777"),
spaceAfter=4,
alignment=TA_CENTER,
)
story = []
# ── Title Block ─────────────────────────────────────────────────────────────
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("Pathogenesis of Inflammatory Bowel Disease", title_style))
story.append(Paragraph("As per Robbins, Cotran & Kumar — Pathologic Basis of Disease", subtitle_style))
story.append(HRFlowable(width=content_width, thickness=2, color=colors.HexColor("#1a3a5c"), spaceAfter=12))
# ── Introduction ────────────────────────────────────────────────────────────
story.append(Paragraph("Overview", h1_style))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"Inflammatory bowel disease (IBD) is a chronic inflammatory condition arising from a combination of "
"<b>abnormalities in immune regulation, host-microbe interactions, and epithelial barrier function</b> "
"in genetically susceptible individuals. IBD encompasses two entities: "
"<b>Crohn disease</b> and <b>ulcerative colitis</b>.",
body_style
))
story.append(Paragraph(
"IBD is idiopathic; mechanisms are incompletely understood. The current model incorporates four major "
"interacting pillars: genetic susceptibility, aberrant mucosal immunity, epithelial barrier dysfunction, "
"and dysbiosis of the gut microbiota.",
body_style
))
# ── Diagram ─────────────────────────────────────────────────────────────────
story.append(Spacer(1, 0.3*cm))
from reportlab.platypus import Image
try:
img = Image(IMG_PATH, width=12*cm, height=10*cm)
img.hAlign = "CENTER"
story.append(img)
story.append(Paragraph(
"Fig. 17.36 — Model of IBD pathogenesis. Bacterial components cross the epithelial barrier and "
"activate dendritic cells. IL-23 drives Th17 (→ IL-17) and IL-12 drives Th1 (→ IFN-γ) differentiation. "
"Activated macrophages release TNF. IL-8 recruits neutrophils. Th2 cells produce IL-13 (elevated in UC). "
"[Robbins, Cotran & Kumar — Pathologic Basis of Disease]",
caption_style
))
except Exception as e:
story.append(Paragraph(f"[Diagram could not be embedded: {e}]", caption_style))
# ══ PILLAR 1 ════════════════════════════════════════════════════════════════
story.append(Paragraph("1. Genetic Factors", h1_style))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"Risk for disease is increased when there is an affected family member. "
"IBD is a <b>polygenic disorder</b> — over <b>200 IBD-associated risk alleles</b> have been identified "
"by GWAS, yet these account for less than 20% of disease risk in Crohn disease and even less in UC.",
body_style
))
story.append(Paragraph("Twin Concordance", h3_style))
data = [
["IBD Type", "Monozygotic Twin Concordance", "Implication"],
["Crohn Disease", "~50%", "Strong genetic component"],
["Ulcerative Colitis", "~20%", "Genetic factors less dominant"],
]
t = Table(data, colWidths=[4.5*cm, 5.5*cm, 5.5*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#f0f4fa"), colors.white]),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#c0cfe0")),
("ALIGN", (0,0), (-1,-1), "CENTER"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
]))
story.append(t)
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("NOD2 — Key Susceptibility Gene (Crohn Disease)", h3_style))
for pt in [
"Encodes an intracellular sensor of <b>muramyl dipeptide</b>, a bacterial cell wall component.",
"On activation, stimulates <b>NF-κB</b>.",
"Disease-associated NOD2 variants are ineffective at defending against intestinal bacteria → increased bacterial penetration through epithelium → triggers inflammatory reactions.",
"The three major NOD2 risk alleles are present in only ~30% of Crohn disease patients vs. 5% of healthy individuals; even homozygous risk alleles increase Crohn risk only ~20-fold.",
"NOD2 variants are <b>rare in Asian and African populations</b> → underscores polygenic, population-variable nature of IBD.",
"<b>PTPN22 variants</b>: increase Crohn disease risk but are <b>protective</b> in ulcerative colitis.",
]:
story.append(Paragraph(f"• {pt}", bullet_style))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("Autophagy Genes (Crohn Disease-specific)", h3_style))
for pt in [
"<b>ATG16L1 and IRGM</b>: encode components of the autophagosome pathway involved in host-cell responses to intracellular bacteria and clearance of damaged organelles.",
"The ATG16L1 Crohn-associated mutation promotes degradation of ATG16L1, limiting autophagy.",
"Results in <b>structurally and functionally abnormal Paneth cell granules</b> → impaired secretion of antimicrobial peptides into the crypt lumen.",
"These genes are <b>not associated with ulcerative colitis</b> and the associations hold mainly for people of European descent.",
]:
story.append(Paragraph(f"• {pt}", bullet_style))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("Monogenic (Very Early-Onset) IBD", h3_style))
story.append(Paragraph(
"A notable exception to polygenic IBD is <b>very early-onset IBD (infantile colitis)</b>, which can be monogenic. "
"Mutations in <b>IL10, IL10RA, and IL10RB</b> are most common, causing loss of IL-10-mediated immune regulation "
"and severe early-onset colitis.",
body_style
))
story.append(Paragraph("IBD Risk Allele Overlap with Other Immune Diseases", h3_style))
story.append(Paragraph(
"IBD risk alleles overlap with those for <b>type 1 diabetes, ankylosing spondylitis, and psoriasis</b>. "
"In most cases, specific polymorphisms have consistent effects across diseases, but some that increase IBD risk "
"are protective in other diseases.",
body_style
))
# ══ PILLAR 2 ════════════════════════════════════════════════════════════════
story.append(Paragraph("2. Aberrant Mucosal Immune Responses", h1_style))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"This is the <b>central mechanism</b> driving tissue injury. The initial trigger is the presentation of "
"microbial antigens to CD4+ helper T cells. Cytokines such as <b>IL-12 and IL-23</b> (released by dendritic "
"cells and macrophages) induce differentiation of naive CD4+ T cells into <b>Th1 and Th17 cells</b>.",
body_style
))
story.append(Paragraph("T-Cell Subsets and Their Effector Functions", h3_style))
data2 = [
["T-cell Subset", "Inducing Cytokine", "Key Cytokines Produced", "Main Effect"],
["Th1", "IL-12", "IFN-γ, TNF", "Macrophage activation → tissue damage (dominant in CD)"],
["Th17", "IL-23", "IL-17, IL-22", "Neutrophil recruitment, perpetuates inflammation"],
["Th2", "—", "IL-13", "Mucosal barrier injury (elevated in UC)"],
["T-reg", "IL-10 (self)", "IL-10 (anti-inflammatory)", "Dampens immune response — DEFECTIVE in IBD"],
]
t2 = Table(data2, colWidths=[2.5*cm, 3*cm, 4*cm, 6*cm])
t2.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.HexColor("#f0f4fa"), colors.white]),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#c0cfe0")),
("ALIGN", (0,0), (-1,-1), "LEFT"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(t2)
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("Key Cytokines in IBD", h3_style))
for pt in [
"<b>TNF</b>: key proinflammatory cytokine released by activated macrophages and Th1 cells; perpetuates mucosal injury; major therapeutic target (anti-TNF biologics).",
"<b>IL-12 / IL-23</b>: drive Th1 and Th17 differentiation respectively; targeted by anti-IL-12/23p40 antibodies and anti-IL-23 biologics.",
"<b>IL-17</b>: recruits neutrophils and perpetuates mucosal inflammation (Th17-derived).",
"<b>IL-13</b>: Th2-derived; increased in UC; promotes barrier dysfunction.",
"<b>IFN-γ</b>: activates macrophages (Th1-derived).",
"<b>IL-8</b>: released by dendritic cells; recruits neutrophils.",
"<b>IL-10</b>: anti-inflammatory regulatory cytokine; loss-of-function mutations → severe early-onset IBD.",
]:
story.append(Paragraph(f"• {pt}", bullet_style))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("Therapeutic Validation of Immune Mechanisms", h3_style))
data3 = [
["Therapy Class", "Target", "Validated Mechanism"],
["Anti-TNF biologics\n(infliximab, adalimumab)", "TNF", "Inhibit inflammation; effective in both CD and UC"],
["Anti-IL-12/23p40\n(ustekinumab)", "IL-12/IL-23", "Inhibit Th1 and Th17 activation"],
["Anti-IL-23\n(risankizumab)", "IL-23", "Inhibit Th17 cells specifically"],
["JAK inhibitors\n(tofacitinib, upadacitinib)", "JAK/STAT signaling", "Block downstream cytokine signaling"],
["Anti-α4β7 integrin\n(vedolizumab)", "Lymphocyte trafficking", "Block gut-selective lymphocyte homing"],
["S1P receptor antagonists\n(ozanimod)", "Lymphocyte egress", "Block lymphocyte trafficking to gut"],
]
t3 = Table(data3, colWidths=[4.5*cm, 3.5*cm, 7.5*cm])
t3.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.HexColor("#f0f4fa"), colors.white]),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#c0cfe0")),
("ALIGN", (0,0), (-1,-1), "LEFT"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
]))
story.append(t3)
# ══ PILLAR 3 ════════════════════════════════════════════════════════════════
story.append(Paragraph("3. Epithelial Barrier Dysfunction", h1_style))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"The intestinal epithelial barrier normally limits interaction between luminal contents and the mucosal immune system. "
"Partial loss of this barrier has been directly linked to IBD pathogenesis.",
body_style
))
for pt in [
"<b>Tight junction defects</b>: reduce barrier integrity in Crohn disease patients and in ~10% of their healthy first-degree relatives. Relatives with barrier defects have a greater risk of developing IBD.",
"Barrier loss during <b>remission predicts relapse</b> of active Crohn disease.",
"Barrier dysfunction <b>cosegregates with NOD2 polymorphisms</b> and can activate both innate and adaptive mucosal immunity.",
"<b>Paneth cell dysfunction</b>: Paneth cell granules contain antimicrobial peptides that shape luminal microbiota composition. In patients with ATG16L1 mutations, Paneth cell granules are structurally and functionally abnormal → impaired antimicrobial peptide secretion → defective epithelium-microbiota crosstalk.",
"A smaller group of monogenic IBD mutations encode epithelial proteins involved in intercellular adhesion, brush border digestion, ion transport, mucin secretion, and Paneth cell antimicrobial peptide secretion.",
]:
story.append(Paragraph(f"• {pt}", bullet_style))
# ══ PILLAR 4 ════════════════════════════════════════════════════════════════
story.append(Paragraph("4. Gut Microbiota — Dysbiosis", h1_style))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"The gut microbiome is composed of bacteria, fungi, and viruses. The colon contains up to "
"<b>10¹² organisms/mL of fecal material</b> (50% of fecal mass), with significant interindividual variation "
"in composition that is modified by diet and disease.",
body_style
))
for pt in [
"Patients with IBD often show <b>dysbiosis</b>: shifts in microbial populations and reduced species diversity.",
"Dysbiosis is often established at disease presentation, but it is difficult to distinguish microbial changes that <b>trigger</b> disease from those <b>caused by</b> disease.",
"Unregulated immune responses to bacterial species in the microbiome underlie IBD, but neither the specific microbial triggers nor the precise type of immune dysregulation have been fully defined.",
"Recent research focuses on microbial <b>metabolites</b> and how these impact immune and epithelial function.",
"<b>Fecal microbial transplants</b> from healthy individuals and probiotic bacteria may benefit IBD patients (clinical trial data).",
]:
story.append(Paragraph(f"• {pt}", bullet_style))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("The Hygiene Hypothesis", h3_style))
story.append(Paragraph(
"The hygiene hypothesis proposes that the rising IBD incidence in previously low-prevalence regions (Africa, Asia, "
"South America) is related to improved food storage conditions, decreased food contamination, and changes in gut "
"microbiome composition. Reduced enteric infections early in life result in inadequate development of regulatory "
"processes that limit mucosal immune responses, allowing mucosa-associated microbes to trigger persistent "
"inflammation in susceptible hosts.",
body_style
))
# ══ Summary Pathway ══════════════════════════════════════════════════════════
story.append(Paragraph("Unifying Pathogenesis Pathway", h1_style))
story.append(Spacer(1, 0.2*cm))
pathway_data = [
["Step", "Event"],
["1", "Genetic susceptibility (NOD2, ATG16L1, IL-10 axis, >200 loci)"],
["2", "Epithelial barrier dysfunction → increased bacterial translocation into lamina propria"],
["3", "Dendritic cells & macrophages sense bacterial products via PRRs"],
["4", "IL-12/IL-23 release → CD4+ T cell differentiation into Th1 and Th17 (and some Th2 in UC)"],
["5", "IFN-γ, IL-17, TNF, IL-13 release → macrophage activation + neutrophil recruitment (via IL-8, IL-17)"],
["6", "Defective T-regulatory cell (IL-10) suppression → unchecked inflammation"],
["7", "Chronic mucosal/transmural inflammation → crypt destruction, ulceration, fibrosis, fistulae"],
]
tp = Table(pathway_data, colWidths=[1.2*cm, content_width - 1.2*cm])
tp.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9.5),
("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.HexColor("#eaf0fb"), colors.HexColor("#f7f9fd")]),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#c0cfe0")),
("ALIGN", (0,0), (0,-1), "CENTER"),
("ALIGN", (1,0), (1,-1), "LEFT"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 6),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("TEXTCOLOR", (0,1), (0,-1), colors.HexColor("#1a3a5c")),
]))
story.append(tp)
# ══ Comparison Table ══════════════════════════════════════════════════════════
story.append(Paragraph("Key Pathogenetic Differences: Crohn Disease vs. Ulcerative Colitis", h1_style))
story.append(Spacer(1, 0.2*cm))
comp_data = [
["Feature", "Crohn Disease", "Ulcerative Colitis"],
["Twin concordance", "~50% (stronger genetics)", "~20% (weaker genetics)"],
["NOD2 / autophagy genes", "Yes (strongly associated)", "No"],
["Dominant T-cell response", "Th1 + Th17", "Th2 (IL-13) + Th17"],
["TNF", "Elevated", "Elevated"],
["IFN-γ", "Markedly elevated", "Less elevated"],
["IL-13", "Mildly elevated", "Markedly elevated"],
["Transmural inflammation", "Yes — hallmark", "No — mucosal only"],
["Granulomas", "~35% of cases", "No"],
["Epithelial barrier dysfunction", "Well-established", "Less prominent"],
["Fistulae / fissures", "Yes", "No"],
["Distribution", "Any GI tract, skip lesions", "Colon only, diffuse"],
["Recurrence after surgery", "Common", "No (curative colectomy)"],
["Toxic megacolon", "No", "Yes"],
]
tc = Table(comp_data, colWidths=[5.5*cm, 4.7*cm, 5.3*cm])
tc.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#1a3a5c")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.HexColor("#f0f4fa"), colors.white]),
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#c0cfe0")),
("ALIGN", (0,0), (-1,-1), "LEFT"),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
]))
story.append(tc)
# ── Footer ──────────────────────────────────────────────────────────────────
story.append(Spacer(1, 0.5*cm))
story.append(HRFlowable(width=content_width, thickness=1, color=colors.HexColor("#4a6fa5")))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"Sources: Robbins, Cotran & Kumar — Pathologic Basis of Disease (latest edition), Chapter 17, pp. 744–745 | "
"Robbins & Kumar Basic Pathology, Chapter 13, p. 577",
source_style
))
# ── Build ────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT}")
cd /home/daytona/workspace/ibd-pathogenesis && python generate_pdf.py 2>&1
ls -lh /home/daytona/workspace/ibd-pathogenesis/IBD_Pathogenesis_Robbins.pdf
IBD Pathogenesis Robbins
PDF Document · PDF