I have my 0harmac exams so I will tell u to make a pdf of specific group of drugs so u add following details in detailed description that could easily give 9 out of 10 add inside drug definition drugs route of administration mechanism of action it's indication and contraindications and it's classification and rest add other important information that could be highlighted in exams create a beautiful pdf attractive the class of drugs is antihypertensive
mkdir -p /tmp/workspace/antihypertensive-pdf && ls /tmp/workspace/antihypertensive-pdf/
~/antihypertensive-pdf/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate
from reportlab.lib.colors import HexColor
from reportlab.pdfgen import canvas
import os
OUTPUT = "/tmp/workspace/antihypertensive-pdf/Antihypertensive_Drugs.pdf"
# ── Palette ──────────────────────────────────────────────────────────────────
DARK_BLUE = HexColor("#0D2B55") # deep navy
MID_BLUE = HexColor("#1565C0") # rich blue
ACCENT_TEAL = HexColor("#00897B") # teal accent
LIGHT_BG = HexColor("#E8F4FD") # pale blue background
PILL_GREEN = HexColor("#E8F5E9") # soft green for key points
PILL_YELLOW = HexColor("#FFFDE7") # soft yellow for warnings
PILL_RED = HexColor("#FFEBEE") # soft red for contraindications
WHITE = colors.white
BLACK = HexColor("#212121")
GRAY_LIGHT = HexColor("#ECEFF1")
GRAY_MID = HexColor("#B0BEC5")
ORANGE = HexColor("#E65100")
PURPLE = HexColor("#6A1B9A")
# ── Page header/footer ───────────────────────────────────────────────────────
def draw_page(canvas_obj, doc):
w, h = A4
# top banner
canvas_obj.setFillColor(DARK_BLUE)
canvas_obj.rect(0, h - 1.1*cm, w, 1.1*cm, fill=1, stroke=0)
canvas_obj.setFillColor(WHITE)
canvas_obj.setFont("Helvetica-Bold", 9)
canvas_obj.drawString(1*cm, h - 0.75*cm, "PHARMACOLOGY EXAM GUIDE")
canvas_obj.setFont("Helvetica", 8)
canvas_obj.drawRightString(w - 1*cm, h - 0.75*cm, "Antihypertensive Drugs — Complete Reference")
# bottom bar
canvas_obj.setFillColor(MID_BLUE)
canvas_obj.rect(0, 0, w, 0.8*cm, fill=1, stroke=0)
canvas_obj.setFillColor(WHITE)
canvas_obj.setFont("Helvetica", 8)
canvas_obj.drawCentredString(w/2, 0.25*cm, f"Page {doc.page}")
# thin accent line below header
canvas_obj.setStrokeColor(ACCENT_TEAL)
canvas_obj.setLineWidth(2)
canvas_obj.line(0, h - 1.1*cm, w, h - 1.1*cm)
doc = BaseDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=1.5*cm, leftMargin=1.5*cm,
topMargin=1.8*cm, bottomMargin=1.6*cm,
title="Antihypertensive Drugs — Pharmacology Exam Guide",
author="Orris Medical AI",
)
frame = Frame(doc.leftMargin, doc.bottomMargin,
doc.width, doc.height, id="main")
template = PageTemplate(id="std", frames=[frame], onPage=draw_page)
doc.addPageTemplates([template])
# ── Styles ────────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
title_style = S("MyTitle",
fontName="Helvetica-Bold", fontSize=26, textColor=WHITE,
leading=32, alignment=TA_CENTER, spaceAfter=4)
subtitle_style = S("MySubtitle",
fontName="Helvetica", fontSize=12, textColor=LIGHT_BG,
leading=16, alignment=TA_CENTER, spaceAfter=6)
chapter_style = S("ChapterTitle",
fontName="Helvetica-Bold", fontSize=16, textColor=WHITE,
leading=20, alignment=TA_CENTER, spaceBefore=4, spaceAfter=4)
drug_header = S("DrugHeader",
fontName="Helvetica-Bold", fontSize=14, textColor=WHITE,
leading=18, alignment=TA_LEFT, spaceBefore=2, spaceAfter=2)
section_head = S("SectionHead",
fontName="Helvetica-Bold", fontSize=11, textColor=DARK_BLUE,
leading=14, spaceBefore=6, spaceAfter=2)
body = S("Body",
fontName="Helvetica", fontSize=9.5, textColor=BLACK,
leading=14, alignment=TA_JUSTIFY, spaceBefore=2, spaceAfter=2)
body_bold = S("BodyBold",
fontName="Helvetica-Bold", fontSize=9.5, textColor=BLACK,
leading=14, spaceBefore=2, spaceAfter=2)
bullet_style = S("Bullet",
fontName="Helvetica", fontSize=9.5, textColor=BLACK,
leading=13, leftIndent=12, spaceBefore=1, spaceAfter=1,
bulletIndent=0)
warn_style = S("Warn",
fontName="Helvetica", fontSize=9, textColor=HexColor("#B71C1C"),
leading=13, leftIndent=8, spaceBefore=1, spaceAfter=1)
key_style = S("Key",
fontName="Helvetica-Bold", fontSize=9, textColor=HexColor("#1B5E20"),
leading=13, leftIndent=8, spaceBefore=1, spaceAfter=1)
toc_style = S("TOC",
fontName="Helvetica", fontSize=10, textColor=DARK_BLUE,
leading=16, leftIndent=20, spaceBefore=1)
toc_head = S("TOCHead",
fontName="Helvetica-Bold", fontSize=11, textColor=DARK_BLUE,
leading=16, spaceBefore=3)
small_gray = S("SmallGray",
fontName="Helvetica", fontSize=8, textColor=HexColor("#757575"),
leading=11, alignment=TA_CENTER)
# ── Helpers ───────────────────────────────────────────────────────────────────
def hr(color=ACCENT_TEAL, w=1.5):
return HRFlowable(width="100%", thickness=w, color=color, spaceAfter=4, spaceBefore=4)
def section_banner(text, color=MID_BLUE):
tbl = Table([[Paragraph(text, chapter_style)]], colWidths=[doc.width])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), color),
("ROUNDEDCORNERS", [6,6,6,6]),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 12),
]))
return tbl
def drug_banner(name, category, color=DARK_BLUE):
tbl = Table([[Paragraph(f"💊 {name}", drug_header),
Paragraph(category, S("Cat", fontName="Helvetica", fontSize=9,
textColor=LIGHT_BG, leading=11, alignment=2))
]], colWidths=[doc.width*0.72, doc.width*0.28])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), color),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("ROUNDEDCORNERS", [4,4,4,4]),
]))
return tbl
def labeled_box(label, items, bg=LIGHT_BG, label_color=MID_BLUE):
"""Colored box with a label and bullet items."""
content = [Paragraph(f"<b><font color='#{label_color.hexval()[1:]}' size=10>{label}</font></b>", body)]
for item in items:
content.append(Paragraph(f"• {item}", bullet_style))
tbl = Table([[content]], colWidths=[doc.width])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 0.5, GRAY_MID),
("ROUNDEDCORNERS", [4,4,4,4]),
]))
return tbl
def two_col_box(label1, items1, label2, items2, bg1=PILL_GREEN, bg2=PILL_RED):
def make_cell(label, items, bg, lc):
cell = [Paragraph(f"<b><font size=10>{label}</font></b>", body)]
for it in items:
cell.append(Paragraph(f"• {it}", bullet_style))
return cell
row = [make_cell(label1, items1, bg1, MID_BLUE),
make_cell(label2, items2, bg2, ORANGE)]
tbl = Table([row], colWidths=[doc.width/2 - 3, doc.width/2 - 3], hAlign="CENTER")
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), bg1),
("BACKGROUND", (1,0), (1,0), bg2),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (0,0), 0.5, GRAY_MID),
("BOX", (1,0), (1,0), 0.5, GRAY_MID),
("COLPADDING", (0,0), (-1,-1), 6),
]))
return tbl
def mini_table(headers, rows, col_widths=None):
if col_widths is None:
n = len(headers)
col_widths = [doc.width/n]*n
data = [[Paragraph(f"<b>{h}</b>", S("TH", fontName="Helvetica-Bold",
fontSize=9, textColor=WHITE, leading=12)) for h in headers]]
for r in rows:
data.append([Paragraph(str(c), S("TD", fontName="Helvetica",
fontSize=9, textColor=BLACK, leading=12)) for c in r])
tbl = Table(data, colWidths=col_widths, repeatRows=1)
style = [
("BACKGROUND", (0,0), (-1,0), DARK_BLUE),
("BACKGROUND", (0,1), (-1,-1), WHITE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, GRAY_LIGHT]),
("GRID", (0,0), (-1,-1), 0.4, GRAY_MID),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 7),
("RIGHTPADDING", (0,0), (-1,-1), 7),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]
tbl.setStyle(TableStyle(style))
return tbl
def exam_tip(text):
inner = [[Paragraph(f"⭐ EXAM TIP: {text}", S("ET",
fontName="Helvetica-Bold", fontSize=9,
textColor=HexColor("#E65100"), leading=13))]]
tbl = Table(inner, colWidths=[doc.width])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), PILL_YELLOW),
("BOX", (0,0), (-1,-1), 1, HexColor("#FB8C00")),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("ROUNDEDCORNERS", [4,4,4,4]),
]))
return tbl
def sp(n=6):
return Spacer(1, n)
# ══════════════════════════════════════════════════════════════════════════════
# CONTENT
# ══════════════════════════════════════════════════════════════════════════════
story = []
# ── COVER PAGE ────────────────────────────────────────────────────────────────
cover_bg = Table(
[[Paragraph("ANTIHYPERTENSIVE", title_style)],
[Paragraph("DRUGS", S("T2", fontName="Helvetica-Bold", fontSize=32,
textColor=ACCENT_TEAL, leading=36, alignment=TA_CENTER))],
[Paragraph("Complete Pharmacology Exam Reference", subtitle_style)],
[sp(8)],
[Paragraph("Classification · Mechanism · Indications · Contraindications",
S("Cov3", fontName="Helvetica", fontSize=11, textColor=GRAY_LIGHT,
leading=16, alignment=TA_CENTER))],
[sp(4)],
[Paragraph("Route of Administration · Adverse Effects · Drug Interactions",
S("Cov4", fontName="Helvetica", fontSize=11, textColor=GRAY_LIGHT,
leading=16, alignment=TA_CENTER))],
[sp(20)],
[Paragraph("Prepared for Pharmacy Examinations", small_gray)],
[Paragraph("Based on Katzung's Basic & Clinical Pharmacology, 16e |"
" Goodman & Gilman's | Brenner & Rector's Kidney",
S("src", fontName="Helvetica-Oblique", fontSize=8,
textColor=HexColor("#90A4AE"), leading=11, alignment=TA_CENTER))],
],
colWidths=[doc.width],
)
cover_bg.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 14),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 20),
("RIGHTPADDING", (0,0), (-1,-1), 20),
("ROUNDEDCORNERS", [8,8,8,8]),
]))
story.append(cover_bg)
story.append(PageBreak())
# ── TABLE OF CONTENTS ─────────────────────────────────────────────────────────
story.append(section_banner("TABLE OF CONTENTS", DARK_BLUE))
story.append(sp(10))
toc_entries = [
("1.", "Overview & Definition of Hypertension"),
("2.", "Classification of Antihypertensive Drugs"),
("3.", "DIURETICS — Thiazides, Loop, Potassium-Sparing"),
("4.", "BETA-BLOCKERS (β-Adrenergic Antagonists)"),
("5.", "CALCIUM CHANNEL BLOCKERS (CCBs)"),
("6.", "ACE INHIBITORS"),
("7.", "ANGIOTENSIN RECEPTOR BLOCKERS (ARBs)"),
("8.", "DIRECT VASODILATORS — Hydralazine, Minoxidil"),
("9.", "CENTRALLY ACTING AGENTS — Clonidine, Methyldopa"),
("10.", "ALPHA-BLOCKERS"),
("11.", "Hypertensive Emergencies — Nitroprusside, Labetalol, Fenoldopam"),
("12.", "Drug Comparison Tables & Mnemonics"),
("13.", "High-Yield Exam Facts"),
]
for num, entry in toc_entries:
story.append(Paragraph(f"<b>{num}</b> {entry}", toc_style))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 1: OVERVIEW
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("1. OVERVIEW & DEFINITION", DARK_BLUE))
story.append(sp(8))
story.append(Paragraph(
"<b>Hypertension (HTN)</b> is defined as persistently elevated arterial blood pressure "
"≥ 130/80 mmHg (ACC/AHA 2017) or ≥ 140/90 mmHg (JNC 7). It is one of the most "
"prevalent cardiovascular risk factors worldwide, classified as <b>primary (essential) ~90–95%</b> "
"or <b>secondary ~5–10%</b>.", body))
story.append(sp(6))
story.append(labeled_box("JNC 7 Classification of Blood Pressure", [
"Normal: SBP < 120 and DBP < 80 mmHg",
"Pre-hypertension: SBP 120–139 or DBP 80–89 mmHg",
"Stage 1 HTN: SBP 140–159 or DBP 90–99 mmHg",
"Stage 2 HTN: SBP ≥ 160 or DBP ≥ 100 mmHg",
"Hypertensive Crisis: SBP > 180 / DBP > 120 mmHg",
], bg=LIGHT_BG))
story.append(sp(6))
story.append(Paragraph(
"<b>Blood Pressure Equation:</b> BP = Cardiac Output (CO) × Peripheral Vascular Resistance (PVR). "
"Antihypertensives act by reducing CO, PVR, or both.", body))
story.append(sp(6))
story.append(exam_tip(
"BP = CO × PVR — know which drugs reduce CO (beta-blockers), PVR (vasodilators, CCBs), or both."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 2: CLASSIFICATION
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("2. CLASSIFICATION OF ANTIHYPERTENSIVE DRUGS", DARK_BLUE))
story.append(sp(8))
class_data = [
["CLASS", "SUBCLASS / EXAMPLES", "PRIMARY MECHANISM"],
["Diuretics", "Thiazides (HCTZ), Loop (Furosemide),\nK⁺-sparing (Spironolactone)", "↓ Blood volume → ↓ CO"],
["Beta-Blockers (β-blockers)", "Propranolol, Atenolol, Metoprolol,\nCarvedilol, Labetalol", "↓ HR, ↓ CO, ↓ Renin"],
["Calcium Channel Blockers", "Dihydropyridines: Nifedipine, Amlodipine\nNon-DHP: Verapamil, Diltiazem", "Vasodilation / ↓ HR & contractility"],
["ACE Inhibitors", "Captopril, Enalapril, Lisinopril,\nRamipril, Perindopril", "Block ACE → ↓ Ang II → vasodilation"],
["ARBs", "Losartan, Valsartan, Irbesartan,\nTelmisartan, Olmesartan", "Block AT1 receptor → vasodilation"],
["Direct Vasodilators", "Hydralazine, Minoxidil", "Relax arteriolar smooth muscle"],
["Central α₂ Agonists", "Clonidine, Methyldopa, Guanfacine", "↓ Sympathetic outflow from CNS"],
["Alpha-1 Blockers", "Prazosin, Doxazosin, Terazosin", "Vasodilation → ↓ PVR"],
["Renin Inhibitors", "Aliskiren", "Block renin → ↓ Ang I & II"],
["Emergency Agents", "Nitroprusside, Labetalol IV,\nFenoldopam, Nicardipine IV", "Rapid vasodilation / mixed"],
]
story.append(mini_table(class_data[0], class_data[1:],
[2.5*cm, 6.2*cm, 6.5*cm]))
story.append(sp(6))
story.append(exam_tip(
"First-line drugs for uncomplicated HTN (JNC 8): Thiazide diuretics, CCBs, ACEi, ARBs."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 3: DIURETICS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("3. DIURETICS", DARK_BLUE))
story.append(sp(6))
# 3A THIAZIDES
story.append(drug_banner("THIAZIDE DIURETICS", "First-Line Antihypertensive", MID_BLUE))
story.append(sp(4))
story.append(Paragraph("<b>Definition:</b> Thiazide and thiazide-like diuretics act on the distal convoluted tubule (DCT) of the nephron. They are among the most widely used first-line antihypertensives.", body))
story.append(sp(4))
story.append(Paragraph("<b>Examples:</b> Hydrochlorothiazide (HCTZ), Chlorthalidone, Indapamide, Metolazone", body_bold))
story.append(sp(4))
story.append(labeled_box("Route of Administration", ["Oral (PO) — once daily dosing", "Chlorthalidone preferred over HCTZ (longer half-life, better CV outcomes)"], LIGHT_BG))
story.append(sp(4))
story.append(labeled_box("Mechanism of Action", [
"Inhibit Na⁺/Cl⁻ co-transporter (NCC) in the distal convoluted tubule",
"Increase urinary excretion of Na⁺, Cl⁻ and water → ↓ blood volume → ↓ CO",
"Long-term: vasodilation (reduced intracellular Ca²⁺ in vascular smooth muscle)",
"Also cause K⁺ and Mg²⁺ wasting",
], LIGHT_BG))
story.append(sp(4))
story.append(two_col_box(
"✅ Indications",
["Hypertension (first-line)",
"Edema (mild heart failure, cirrhosis, nephrotic syndrome)",
"Diabetes insipidus (nephrogenic — paradoxical effect)",
"Hypercalciuria / calcium-containing kidney stones",
"Osteoporosis (increases Ca²⁺ reabsorption)"],
"❌ Contraindications",
["Anuria / severe renal failure (GFR < 30)",
"Hypokalemia / hyponatremia",
"Gout (raises uric acid)",
"Pregnancy (fetal thrombocytopenia)",
"Sulfonamide allergy (cross-reactivity)"],
))
story.append(sp(4))
story.append(labeled_box("Adverse Effects (GLUCOHH Mnemonic)", [
"G — Glucose ↑ (hyperglycemia)",
"L — Lipids ↑ (hyperlipidemia)",
"U — Urate ↑ (hyperuricemia / gout)",
"C — Ca²⁺ ↑ (hypercalcemia)",
"O — (hyp)Osmolarity — hyponatremia",
"H — Hypokalemia, Hypomagnesemia",
"H — Hypotension (orthostatic)"], PILL_YELLOW))
story.append(sp(4))
story.append(exam_tip("Thiazides RETAIN calcium (↑ serum Ca²⁺) but WASTE potassium. Opposite of loop diuretics for Ca²⁺."))
story.append(sp(8))
# 3B LOOP DIURETICS
story.append(drug_banner("LOOP DIURETICS", "Hypertensive Emergencies / Volume Overload", ACCENT_TEAL))
story.append(sp(4))
story.append(Paragraph("<b>Definition:</b> Most potent diuretics, acting on the thick ascending limb of the Loop of Henle.", body))
story.append(Paragraph("<b>Examples:</b> Furosemide, Bumetanide, Torsemide, Ethacrynic acid", body_bold))
story.append(sp(4))
story.append(labeled_box("Route of Administration", ["Oral (PO) or IV (furosemide)", "IV used in hypertensive emergencies with pulmonary edema"], LIGHT_BG))
story.append(labeled_box("Mechanism of Action", [
"Inhibit Na⁺/K⁺/2Cl⁻ co-transporter (NKCC2) in the thick ascending limb (TAL)",
"Most potent diuretics — can remove large volumes of fluid",
"Also inhibit tubuloglomerular feedback → works even in renal failure",
"Cause loss of Na⁺, K⁺, Cl⁻, Ca²⁺, Mg²⁺"], LIGHT_BG))
story.append(two_col_box(
"✅ Indications",
["Acute pulmonary edema (IV furosemide)",
"Hypertensive emergency with volume overload",
"Chronic renal failure (GFR < 30 — preferred over thiazides)",
"Heart failure, cirrhosis, nephrotic syndrome",
"Hypercalcemia",
"Hyperkalemia"],
"❌ Contraindications",
["Anuria (complete renal failure)",
"Sulfonamide allergy (except Ethacrynic acid)",
"Hypovolemia / dehydration",
"Severe hypokalemia",
"Hepatic coma (↑ ammonia risk with hypokalemia)"],
))
story.append(sp(4))
story.append(exam_tip("Ethacrynic acid is the ONLY loop diuretic safe in sulfonamide allergy. Loop diuretics WASTE calcium (used in hypercalcemia)."))
story.append(sp(8))
# 3C K+ SPARING
story.append(drug_banner("POTASSIUM-SPARING DIURETICS", "Adjunct / Aldosterone Antagonism", PURPLE))
story.append(sp(4))
story.append(Paragraph("<b>Examples:</b> Spironolactone, Eplerenone (aldosterone antagonists); Amiloride, Triamterene (Na⁺ channel blockers)", body_bold))
story.append(labeled_box("Route of Administration", ["Oral (PO)"], LIGHT_BG))
story.append(labeled_box("Mechanism of Action", [
"Spironolactone/Eplerenone: competitive aldosterone receptor antagonists → block aldosterone effects in collecting duct → ↑ Na⁺ excretion, ↓ K⁺ excretion",
"Amiloride/Triamterene: block ENaC (epithelial Na⁺ channels) in collecting duct directly",
"Weak diuretic effect alone — used in combination with thiazides/loop diuretics"], LIGHT_BG))
story.append(two_col_box(
"✅ Indications",
["Primary hyperaldosteronism (Conn syndrome) — spironolactone",
"Heart failure (spironolactone/eplerenone — reduce mortality)",
"Prevent hypokalemia with thiazide/loop diuretics",
"Liver cirrhosis with ascites",
"Resistant hypertension",
"Hirsutism, acne (spironolactone — anti-androgen)"],
"❌ Contraindications",
["Hyperkalemia (K⁺ > 5.5 mEq/L)",
"Renal failure (can worsen hyperkalemia)",
"Combined with ACEi/ARB (serious hyperkalemia risk)",
"Pregnancy (spironolactone — anti-androgen effects on fetus)",
"Addison's disease"],
))
story.append(exam_tip("Spironolactone side effect: GYNECOMASTIA (anti-androgen). Eplerenone is selective → no gynecomastia."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 4: BETA-BLOCKERS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("4. BETA-BLOCKERS (β-Adrenergic Antagonists)", DARK_BLUE))
story.append(sp(6))
story.append(Paragraph("<b>Definition:</b> Beta-blockers competitively block catecholamine binding at β-adrenergic receptors, reducing heart rate, contractility, and renin release.", body))
story.append(sp(4))
story.append(Paragraph("<b>Classification of Beta-Blockers:</b>", section_head))
bb_class = [
["TYPE", "SELECTIVITY", "EXAMPLES", "KEY FEATURE"],
["Non-selective", "β₁ + β₂", "Propranolol, Nadolol, Timolol", "First β-blocker; crosses BBB"],
["Cardioselective (β₁)", "β₁ > β₂", "Atenolol, Metoprolol, Bisoprolol", "Preferred in asthma/COPD"],
["With α₁-block", "β₁+β₂+α₁", "Labetalol, Carvedilol", "Used in HTN emergency, HF"],
["With ISA", "β₁+β₂ partial agonist", "Pindolol, Acebutolol", "Less bradycardia/bronchospasm"],
["β₃ agonist (not BB)", "β₃", "Mirabegron", "Overactive bladder — for ref"],
]
story.append(mini_table(bb_class[0], bb_class[1:], [2.5*cm, 3.5*cm, 4.8*cm, 4.4*cm]))
story.append(sp(6))
story.append(labeled_box("Route of Administration", [
"Oral (PO) — atenolol, metoprolol, propranolol, carvedilol",
"IV — labetalol (hypertensive emergency), esmolol (perioperative)",
"Topical — timolol eye drops (glaucoma)"], LIGHT_BG))
story.append(sp(4))
story.append(labeled_box("Mechanism of Action", [
"Block β₁ receptors in heart → ↓ HR (negative chronotropy), ↓ contractility (negative inotropy) → ↓ CO",
"Block β₁ in juxtaglomerular cells → ↓ renin → ↓ Ang II → ↓ aldosterone → ↓ fluid retention",
"Central action: ↓ sympathetic outflow",
"Non-selective agents also block β₂ → bronchoconstriction, vasoconstriction, ↑ hypoglycemia masking"], LIGHT_BG))
story.append(sp(4))
story.append(two_col_box(
"✅ Indications",
["Hypertension (especially with co-existing CAD)",
"Angina pectoris",
"Post-MI (reduce mortality)",
"Heart failure with reduced EF (metoprolol, carvedilol, bisoprolol)",
"Arrhythmias (SVT, AF rate control)",
"Thyrotoxicosis (control symptoms)",
"Migraine prophylaxis (propranolol)",
"Glaucoma (timolol)",
"Anxiety / performance anxiety (propranolol)",
"Hypertensive emergency (labetalol IV)"],
"❌ Contraindications",
["Asthma / COPD (non-selective BB)",
"Bradycardia / AV block (2nd/3rd degree)",
"Decompensated heart failure",
"Prinzmetal's angina (vasospastic)",
"Peripheral arterial disease",
"Pheochromocytoma (give alpha-blocker first)",
"Diabetes with hypoglycemia unawareness (masks tachycardia)",
"Abrupt withdrawal — rebound HTN"],
))
story.append(sp(4))
story.append(labeled_box("Adverse Effects", [
"Bradycardia, AV block, heart failure exacerbation",
"Bronchoconstriction (non-selective agents)",
"Masking of hypoglycemia symptoms (except sweating)",
"Cold extremities (β₂ block → peripheral vasoconstriction)",
"Fatigue, depression, nightmares (propranolol — lipophilic, crosses BBB)",
"Sexual dysfunction, dyslipidemia",
"Rebound HTN on abrupt withdrawal"], PILL_YELLOW))
story.append(sp(4))
story.append(exam_tip("In pheochromocytoma: NEVER give beta-blocker alone — must give alpha-blocker (phenoxybenzamine) FIRST to prevent hypertensive crisis from unopposed α stimulation."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 5: CALCIUM CHANNEL BLOCKERS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("5. CALCIUM CHANNEL BLOCKERS (CCBs)", DARK_BLUE))
story.append(sp(6))
story.append(Paragraph("<b>Definition:</b> CCBs block voltage-gated L-type calcium channels in vascular smooth muscle and cardiac tissue, reducing intracellular Ca²⁺ and causing vasodilation and/or decreased cardiac contractility.", body))
story.append(sp(6))
ccb_class = [
["SUBCLASS", "EXAMPLES", "PRIMARY ACTION", "CLINICAL USE"],
["Dihydropyridines (DHP)\n(Vasoselective)", "Nifedipine, Amlodipine,\nNicardipine, Felodipine,\nIsradipine", "Vascular smooth muscle\n↓ PVR, vasodilation\n↑ Reflex tachycardia", "HTN, Angina,\nRaynaud's, Subarachnoid\nhemorrhage (Nimodipine)"],
["Non-DHP\n(Cardiac selective)", "Verapamil\n(Phenylalkylamine)", "Heart > Vessels\n↓ HR, ↓ contractility\n↓ AV conduction", "SVT, AF, Angina,\nHTN"],
["Non-DHP\n(Mixed)", "Diltiazem\n(Benzothiazepine)", "Heart + Vessels\n(intermediate)", "SVT, Angina,\nHTN"],
]
story.append(mini_table(ccb_class[0], ccb_class[1:], [3.5*cm, 4.2*cm, 4.5*cm, 3.0*cm]))
story.append(sp(6))
story.append(labeled_box("Route of Administration", [
"Oral (PO) — all oral formulations (immediate and extended-release)",
"IV — Nicardipine, Verapamil, Diltiazem (emergency)",
"Amlodipine — very long half-life ~35–50 hours (once daily)"], LIGHT_BG))
story.append(sp(4))
story.append(labeled_box("Mechanism of Action", [
"Block L-type (long-lasting) voltage-gated Ca²⁺ channels in smooth muscle and heart",
"DHP: preferentially act on vascular smooth muscle → arteriolar vasodilation → ↓ PVR",
"Non-DHP: act on heart → ↓ HR (SA node), ↓ AV conduction, ↓ contractility",
"Reduction in cytoplasmic Ca²⁺ → inhibits actin-myosin interaction → relaxation"], LIGHT_BG))
story.append(sp(4))
story.append(two_col_box(
"✅ Indications",
["Hypertension (first-line — DHP preferred)",
"Stable angina (especially with HTN)",
"Vasospastic / Prinzmetal's angina (DHP)",
"SVT / AF rate control (verapamil, diltiazem)",
"Hypertrophic cardiomyopathy (verapamil)",
"Raynaud's phenomenon",
"Subarachnoid hemorrhage — nimodipine (prevents cerebral vasospasm)",
"Migraine prophylaxis (verapamil)"],
"❌ Contraindications",
["Cardiogenic shock",
"Severe bradycardia / AV block (verapamil, diltiazem)",
"Decompensated heart failure with reduced EF (non-DHP)",
"WPW syndrome + AF (verapamil — life-threatening)",
"Hypotension",
"Nifedipine short-acting: not for acute HTN (reflex tachycardia)"],
))
story.append(sp(4))
story.append(labeled_box("Adverse Effects", [
"DHP: Flushing, headache, peripheral edema (ankle), reflex tachycardia (nifedipine)",
"Verapamil: Constipation (most common!), bradycardia, AV block, negative inotropy",
"Diltiazem: Bradycardia (less than verapamil), AV block",
"Gingival hyperplasia (all CCBs)",
"Verapamil + Beta-blocker combination → severe bradycardia / heart block (dangerous!)"], PILL_YELLOW))
story.append(sp(4))
story.append(exam_tip("Verapamil = 'V'erapamil = 'V'entricular rate control, 'V'omiting (constipation). NEVER combine verapamil with beta-blockers — fatal bradycardia!"))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 6: ACE INHIBITORS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("6. ACE INHIBITORS (ACEi)", DARK_BLUE))
story.append(sp(6))
story.append(Paragraph("<b>Definition:</b> ACE inhibitors block the angiotensin-converting enzyme (ACE / kininase II), preventing conversion of angiotensin I to the potent vasoconstrictor angiotensin II, and also preventing bradykinin degradation.", body))
story.append(sp(4))
acei_examples = [
["DRUG", "PRODRUG?", "ROUTE", "ELIMINATION", "KEY NOTES"],
["Captopril", "No", "PO", "Renal", "Prototype; short-acting; contains -SH group"],
["Enalapril", "Yes → Enalaprilat", "PO / IV", "Renal", "IV form = enalaprilat"],
["Lisinopril", "No", "PO", "Renal", "Most commonly used; no hepatic conversion needed"],
["Ramipril", "Yes → Ramiprilat", "PO", "Renal", "Proven mortality benefit post-MI (HOPE trial)"],
["Perindopril", "Yes", "PO", "Renal", "Stable angina + HTN"],
["Fosinopril", "Yes", "PO", "Renal + Hepatic", "Safe in renal failure (dual elimination)"],
["Benazepril", "Yes", "PO", "Renal", "CKD + HTN"],
]
story.append(mini_table(acei_examples[0], acei_examples[1:],
[2.8*cm, 3.2*cm, 1.8*cm, 3.5*cm, 4.0*cm]))
story.append(sp(6))
story.append(labeled_box("Mechanism of Action", [
"Block ACE (Angiotensin Converting Enzyme / kininase II) in the lungs and vascular endothelium",
"ACE normally: Ang I → Ang II (vasoconstrictor) and Bradykinin → inactive peptides",
"ACEi → ↓ Ang II → vasodilation (arteriolar > venular), ↓ aldosterone (↓ Na⁺/H₂O retention), ↓ ADH",
"↑ Bradykinin (potent vasodilator; causes ACE inhibitor cough and angioedema)",
"↑ Prostaglandins (anti-platelet, vasodilatory)",
"Reduce intraglomerular pressure → renoprotective",
], LIGHT_BG))
story.append(sp(4))
story.append(two_col_box(
"✅ Indications",
["Hypertension (especially + CKD, DM, proteinuria)",
"Heart failure (reduced EF) — cornerstone therapy",
"Post-MI — reduce remodeling, mortality",
"Diabetic nephropathy — reduce proteinuria",
"Chronic kidney disease — slow progression",
"Scleroderma renal crisis",
"Left ventricular hypertrophy",
"Secondary stroke prevention"],
"❌ Contraindications",
["Bilateral renal artery stenosis (acute renal failure)",
"Pregnancy (Category D/X — fetal renal dysgenesis, oligohydramnios, skull defects — 2nd/3rd trimester)",
"Hyperkalemia (K⁺ > 5.5)",
"Angioedema (history) — lifelong",
"Combined with ARB + Aliskiren in DM (ONTARGET)",
"Severe renal failure (relative)"],
))
story.append(sp(4))
story.append(labeled_box("Adverse Effects", [
"DRY COUGH — most common (↑ bradykinin in lungs; occurs in 10–15% of patients)",
"Angioedema — rare but life-threatening (swelling of face, tongue, throat)",
"Hyperkalemia (↓ aldosterone)",
"Acute renal failure (bilateral RAS, or severe dehydration)",
"First-dose hypotension (especially in volume-depleted patients)",
"Teratogenicity (ABCDE of ACE inhibitors — Avoid in pregnancy)",
"Fetopathy if used in 2nd/3rd trimester"], PILL_YELLOW))
story.append(sp(4))
story.append(exam_tip("Dry cough = ACEi (bradykinin ↑). Switch to ARB if cough occurs. NEVER use ACEi in pregnancy (bilateral RAS risk → use CCB or methyldopa). Fosinopril = only ACEi with dual (renal + hepatic) elimination."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 7: ARBs
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("7. ANGIOTENSIN RECEPTOR BLOCKERS (ARBs / Sartans)", DARK_BLUE))
story.append(sp(6))
story.append(Paragraph("<b>Definition:</b> ARBs block the AT₁ (angiotensin II type 1) receptor, preventing all effects of angiotensin II. Unlike ACEi, they do NOT inhibit bradykinin degradation, so they do NOT cause cough.", body))
story.append(sp(4))
story.append(labeled_box("Route of Administration", ["Oral (PO) — all ARBs are oral"], LIGHT_BG))
story.append(labeled_box("Mechanism of Action", [
"Selectively block AT₁ receptors (Gq-coupled) on blood vessels, adrenals, kidneys, heart",
"Ang II is still produced but cannot act on AT₁ → vasodilation, ↓ aldosterone, ↓ remodeling",
"AT₂ receptors remain unblocked → vasodilatory, antiproliferative (beneficial)",
"↑ Bradykinin does NOT occur → NO cough"], LIGHT_BG))
story.append(sp(4))
arbs = [
["DRUG", "DOSE (mg/day)", "HALF-LIFE", "NOTES"],
["Losartan", "25–100", "~2 h (active metabolite ~6–9 h)", "First ARB; uricosuric effect"],
["Valsartan", "80–320", "~9 h", "HF, post-MI indication"],
["Irbesartan", "150–300", "~11–15 h", "DM nephropathy"],
["Telmisartan", "20–80", "~24 h (longest)", "Also PPAR-γ agonism → metabolic benefits"],
["Olmesartan", "20–40", "~13 h", "Potent; sprue-like enteropathy (rare)"],
["Candesartan", "4–32", "~9 h", "HF-reduced EF"],
]
story.append(mini_table(arbs[0], arbs[1:], [3.0*cm, 3.0*cm, 5.5*cm, 4.0*cm]))
story.append(sp(6))
story.append(two_col_box(
"✅ Indications",
["Hypertension (first-line)",
"Diabetic nephropathy",
"Heart failure (when ACEi not tolerated)",
"Post-MI with LV dysfunction",
"CKD with proteinuria",
"ACEi-induced cough (switch to ARB)",
"Stroke prevention (losartan)"],
"❌ Contraindications",
["Pregnancy (same teratogenicity as ACEi)",
"Bilateral renal artery stenosis",
"Hyperkalemia",
"Avoid dual RAAS blockade (ACEi + ARB + Aliskiren)",
"Hypersensitivity"],
))
story.append(sp(4))
story.append(exam_tip("ARBs = same indications as ACEi but NO cough, NO angioedema (well, rare). Telmisartan has longest half-life. Losartan is uricosuric (lowers uric acid) — useful in gout + HTN."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 8: DIRECT VASODILATORS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("8. DIRECT VASODILATORS", DARK_BLUE))
story.append(sp(6))
story.append(drug_banner("HYDRALAZINE", "Arteriolar Direct Vasodilator", MID_BLUE))
story.append(sp(4))
story.append(Paragraph("<b>Definition:</b> Hydralazine is a phthalazine derivative that causes direct relaxation of arteriolar smooth muscle. It dilates arterioles but NOT veins.", body))
story.append(labeled_box("Route of Administration", ["Oral (PO) and IV (hypertensive emergencies)", "Bioavailability ~25% (extensive first-pass metabolism)", "Pharmacogenetics: slow vs fast acetylators (bimodal distribution)"], LIGHT_BG))
story.append(labeled_box("Mechanism of Action", [
"Releases nitric oxide (NO) from vascular endothelium → activates guanylyl cyclase → ↑ cGMP → smooth muscle relaxation",
"Acts on arterioles (reduces PVR), NOT on veins",
"Compensatory reflex: ↑ HR (reflex tachycardia), ↑ renin, ↑ Na⁺/H₂O retention (limit antihypertensive effect)",
"Must combine with a β-blocker + diuretic to counteract compensatory effects"], LIGHT_BG))
story.append(two_col_box(
"✅ Indications",
["Severe/resistant hypertension",
"Hypertensive emergency (IV)",
"Pre-eclampsia / eclampsia (IV — drug of choice)",
"Heart failure + HTN (with nitrates when ACEi intolerant)",
"Used in combination therapy"],
"❌ Contraindications",
["CAD/angina (reflex tachycardia worsens ischemia)",
"Mitral valve rheumatic disease",
"Dissecting aortic aneurysm",
"SLE (drug-induced lupus risk)"],
))
story.append(labeled_box("Adverse Effects", [
"Reflex tachycardia, palpitations, flushing, headache",
"Na⁺/H₂O retention → edema",
"Drug-induced lupus (SLE-like) — slow acetylators at higher risk; ANA positive",
"Peripheral neuritis (pyridoxine/B₆ deficiency — treat with B₆ supplementation)",
"Angina precipitation"], PILL_YELLOW))
story.append(exam_tip("Hydralazine: Drug-induced LUPUS (check ANA) — remember 'Hydra' (monster = lupus). Preferred IV drug in PRE-ECLAMPSIA. Slow acetylators at higher lupus risk."))
story.append(sp(8))
story.append(drug_banner("MINOXIDIL", "Severe Resistant Hypertension / Alopecia", PURPLE))
story.append(sp(4))
story.append(Paragraph("<b>Definition:</b> Minoxidil is a potassium channel opener that causes potent arteriolar vasodilation. One of the most powerful oral antihypertensives.", body))
story.append(labeled_box("Route of Administration", ["Oral (PO) for hypertension", "Topical (solution/foam) for alopecia (androgenetic alopecia, alopecia areata)"], LIGHT_BG))
story.append(labeled_box("Mechanism of Action", [
"Prodrug → converted to minoxidil sulfate → opens ATP-sensitive K⁺ channels in vascular smooth muscle",
"↑ K⁺ permeability → hyperpolarization → closure of voltage-gated Ca²⁺ channels → smooth muscle relaxation",
"Acts only on arterioles (not veins)",
"Powerful compensatory: ↑ HR, ↑ Na⁺/H₂O retention, ↑ cardiac output"], LIGHT_BG))
story.append(two_col_box(
"✅ Indications",
["Severe resistant hypertension (reserved for refractory cases)",
"Renal failure with HTN",
"Topical: male and female pattern baldness"],
"❌ Contraindications",
["Pheochromocytoma",
"MI, dissecting aortic aneurysm",
"Not monotherapy — must combine with β-blocker + diuretic"],
))
story.append(labeled_box("Adverse Effects", [
"HYPERTRICHOSIS (hair growth all over body) — most distinctive side effect",
"Sodium and water retention → edema",
"Reflex tachycardia",
"Pericardial effusion (long-term, high dose)",
"ECG changes: T-wave changes"], PILL_YELLOW))
story.append(exam_tip("Minoxidil = HYPERTRICHOSIS (the irony — same drug causes hair growth topically but hypertrichosis systemically!). Most potent oral vasodilator."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 9: CENTRALLY ACTING AGENTS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("9. CENTRALLY ACTING ANTIHYPERTENSIVES", DARK_BLUE))
story.append(sp(6))
story.append(drug_banner("CLONIDINE", "Central α₂ Agonist", ACCENT_TEAL))
story.append(sp(4))
story.append(Paragraph("<b>Definition:</b> Clonidine is a centrally acting α₂-adrenergic agonist that reduces sympathetic outflow from the CNS.", body))
story.append(labeled_box("Route of Administration", ["Oral (PO), Transdermal patch (weekly), IV (rare)", "Available as TTS (transdermal therapeutic system)"], LIGHT_BG))
story.append(labeled_box("Mechanism of Action", [
"Stimulates α₂ receptors in the nucleus tractus solitarius (NTS) and rostral ventrolateral medulla (RVLM)",
"→ ↓ Sympathetic outflow → ↓ HR, ↓ CO, ↓ PVR, ↓ renin",
"Also: stimulates peripheral α₂ receptors (presynaptic) → inhibits NE release",
"Imidazoline I₁ receptor agonism also contributes to BP lowering"], LIGHT_BG))
story.append(two_col_box(
"✅ Indications",
["Hypertension (resistant/severe)",
"Hypertensive urgency (oral loading)",
"Opioid/nicotine withdrawal",
"ADHD (guanfacine)",
"Menopausal hot flashes",
"Tourette syndrome",
"Analgesia (epidural — post-op pain)"],
"❌ Contraindications",
["Severe coronary artery disease",
"Cerebrovascular disease",
"Sick sinus syndrome",
"Depression (can worsen)",
"Avoid abrupt withdrawal!"],
))
story.append(labeled_box("Adverse Effects", [
"Dry mouth (xerostomia) — most common",
"Sedation, drowsiness, fatigue",
"Bradycardia",
"REBOUND HYPERTENSION on abrupt withdrawal (catecholamine surge) — dangerous!",
"Depression",
"Transdermal: contact dermatitis"], PILL_YELLOW))
story.append(exam_tip("Clonidine: REBOUND HYPERTENSION on sudden discontinuation — taper slowly! Same mechanism (α₂ agonist) as Methyldopa. Dry mouth = most common side effect."))
story.append(sp(8))
story.append(drug_banner("METHYLDOPA", "Safe in Pregnancy HTN", MID_BLUE))
story.append(sp(4))
story.append(Paragraph("<b>Definition:</b> Methyldopa is a prodrug converted centrally to α-methylnorepinephrine, a potent α₂ agonist that reduces sympathetic outflow.", body))
story.append(labeled_box("Route of Administration", ["Oral (PO), IV (methyldopate)", "Drug of CHOICE for hypertension in PREGNANCY (Category B)"], LIGHT_BG))
story.append(labeled_box("Mechanism of Action", [
"Prodrug: methyldopa → α-methylDOPA → α-methyldopamine → α-methylnorepinephrine (false neurotransmitter)",
"α-Methylnorepinephrine stimulates central α₂ receptors → ↓ sympathetic outflow",
"Also reduces renin activity",
"Net effect: ↓ CO and ↓ PVR"], LIGHT_BG))
story.append(two_col_box(
"✅ Indications",
["Hypertension in PREGNANCY (drug of choice)",
"Hypertension in breastfeeding (safe)",
"Hypertensive urgency",
"Rarely used for non-pregnant HTN today"],
"❌ Contraindications",
["Active liver disease (hepatotoxicity risk)",
"Pheochromocytoma",
"Hemolytic anemia (history)",
"MAO inhibitor use",
"Depression"],
))
story.append(labeled_box("Adverse Effects", [
"Positive direct Coombs test (in ~20%) — hemolytic anemia rare",
"Sedation (common early)",
"Dry mouth, bradycardia",
"Hepatotoxicity (abnormal LFTs — check regularly)",
"Drug-induced SLE",
"Galactorrhea (↑ prolactin due to anti-dopaminergic effect)",
"Rebound HTN on withdrawal (less severe than clonidine)"], PILL_YELLOW))
story.append(exam_tip("Methyldopa = DRUG OF CHOICE IN PREGNANCY (along with Labetalol and Nifedipine for acute HTN in pregnancy). Causes +ve Coombs test and hemolytic anemia!"))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 10: ALPHA-BLOCKERS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("10. ALPHA-1 BLOCKERS", DARK_BLUE))
story.append(sp(6))
story.append(Paragraph("<b>Definition:</b> α₁-adrenergic blockers competitively antagonize α₁ receptors on vascular smooth muscle, causing vasodilation and reduced peripheral vascular resistance.", body))
story.append(sp(4))
story.append(labeled_box("Examples & Route", [
"Prazosin (PO) — prototype, shorter acting",
"Doxazosin (PO) — once daily, also BPH",
"Terazosin (PO) — once daily",
"Phentolamine (IV/IM) — non-selective α₁+α₂ blocker — pheochromocytoma crisis",
"Phenoxybenzamine (PO) — irreversible non-selective — pre-op pheochromocytoma"], LIGHT_BG))
story.append(labeled_box("Mechanism of Action", [
"Competitive block of postsynaptic α₁ receptors (Gq-coupled) on arterioles and veins",
"→ Vasodilation of arterioles AND veins → ↓ PVR and ↓ venous return",
"Unlike beta-blockers: do NOT affect heart rate directly",
"Phentolamine: blocks both α₁ and α₂ → prevents presynaptic NE inhibition → ↑ NE release (reflex tachycardia more marked)"], LIGHT_BG))
story.append(sp(4))
story.append(two_col_box(
"✅ Indications",
["Hypertension (3rd-line)",
"Benign Prostatic Hyperplasia — BPH (prazosin, doxazosin, terazosin)",
"Pheochromocytoma (phenoxybenzamine pre-op, phentolamine for crisis)",
"Raynaud's phenomenon",
"Hypertensive emergency (phentolamine IV)"],
"❌ Contraindications",
["First-dose phenomenon / orthostatic hypotension risk",
"Concurrent PDE-5 inhibitors (sildenafil — severe hypotension)",
"Heart failure with volume depletion",
"History of syncope"],
))
story.append(labeled_box("Adverse Effects", [
"FIRST-DOSE PHENOMENON: profound orthostatic hypotension and syncope after first dose",
"Dizziness, lightheadedness",
"Reflex tachycardia (prazosin)",
"Nasal stuffiness",
"Sodium and water retention",
"Intraoperative floppy iris syndrome (IFIS) — prior alpha-blocker use + cataract surgery"], PILL_YELLOW))
story.append(exam_tip("Alpha-blockers: FIRST-DOSE HYPOTENSION — always start low, give at bedtime! Dual benefit in BPH + HTN. Phentolamine for pheochromocytoma crisis."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 11: HYPERTENSIVE EMERGENCIES
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("11. HYPERTENSIVE EMERGENCIES — IV Agents", DARK_BLUE))
story.append(sp(6))
story.append(Paragraph(
"<b>Definition:</b> Hypertensive emergency = SBP > 180/DBP > 120 mmHg WITH evidence of acute target-organ damage (TOD). Requires immediate IV therapy in ICU.", body))
story.append(Paragraph(
"<b>Hypertensive urgency</b> = severely elevated BP WITHOUT acute TOD — treat orally over 24–48 hours.", body))
story.append(sp(6))
emergency_table = [
["DRUG", "MECHANISM", "ONSET", "SPECIAL INDICATIONS"],
["Sodium Nitroprusside", "Releases NO → cGMP → vasodilation\n(arteries + veins)", "Seconds", "Most HTN emergencies; encephalopathy\n⚠ Cyanide/thiocyanate toxicity"],
["Labetalol IV", "α₁ + β₁ + β₂ block\n(α:β ratio 1:7 IV)", "5–10 min", "Aortic dissection, pre-eclampsia,\nPost-op HTN"],
["Nicardipine IV", "DHP CCB → vasodilation", "5–15 min", "Post-op, acute ischemic stroke HTN,\nCocaine-induced HTN"],
["Fenoldopam", "Selective dopamine D₁ agonist\n↑ renal blood flow", "5–15 min", "HTN emergency with renal impairment\n(renoprotective)"],
["Hydralazine IV", "Direct arteriolar vasodilator\n(NO release)", "10–30 min", "Pre-eclampsia / eclampsia\nDrug of choice in pregnancy"],
["Esmolol IV", "Selective β₁-blocker\nUltra short-acting (t½ = 9 min)", "1–2 min", "Aortic dissection (with nitroprusside),\nPerioperative HTN"],
["Phentolamine IV", "Non-selective α-blocker", "1–5 min", "Pheochromocytoma crisis,\nCocaine/MAOI-induced HTN"],
["Nitroglycerin IV", "Venodilator > arteriodilator\n↑ NO → ↑ cGMP", "1–5 min", "Hypertensive emergency with ACS,\nAcute pulmonary edema"],
["Clevidipine IV", "Ultra-short DHP CCB", "2–4 min", "Post-cardiac surgery HTN"],
]
story.append(mini_table(emergency_table[0], emergency_table[1:], [3.2*cm, 4.5*cm, 1.8*cm, 5.7*cm]))
story.append(sp(6))
story.append(exam_tip("Aortic dissection: Reduce BP to SBP <120 in 20 min — use Labetalol or Nitroprusside + Esmolol. AVOID pure vasodilators alone (↑ shear force). Nitroprusside toxicity: cyanide poisoning (treat with sodium thiosulfate/hydroxocobalamin)."))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 12: COMPARISON TABLES
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("12. DRUG COMPARISON & COMPELLING INDICATIONS", DARK_BLUE))
story.append(sp(6))
story.append(Paragraph("<b>Compelling Indications — Preferred Drug Classes:</b>", section_head))
compelling = [
["CONDITION", "PREFERRED DRUG CLASS"],
["Diabetes + HTN + Proteinuria", "ACEi or ARB (FIRST choice)"],
["Chronic Kidney Disease", "ACEi or ARB"],
["Heart Failure (reduced EF)", "ACEi (or ARB) + Beta-blocker + Spironolactone + Loop diuretic"],
["Post-MI", "ACEi (or ARB) + Beta-blocker"],
["Coronary Artery Disease / Angina", "Beta-blocker + CCB (amlodipine)"],
["Atrial Fibrillation (rate control)", "Beta-blocker or Verapamil / Diltiazem"],
["Isolated Systolic HTN (elderly)", "Thiazide or DHP-CCB"],
["Pregnancy-induced HTN", "Labetalol, Nifedipine (acute), Methyldopa"],
["Benign Prostatic Hyperplasia + HTN", "Alpha-1 blocker (doxazosin)"],
["Gout + HTN", "Losartan (ARB — uricosuric effect)"],
["Pheochromocytoma", "Phenoxybenzamine (pre-op) then surgery"],
["Black patients", "Thiazide or DHP-CCB (ACEi less effective monotherapy)"],
["Aortic Dissection", "Labetalol IV, Esmolol + Nitroprusside"],
["Prinzmetal's Angina + HTN", "DHP-CCB (avoid beta-blockers — worsen spasm)"],
["Hypertension + Asthma/COPD", "DHP-CCB or Thiazide (AVOID beta-blockers)"],
]
story.append(mini_table(compelling[0], compelling[1:], [7.5*cm, 8.0*cm]))
story.append(sp(8))
story.append(Paragraph("<b>Drug Effects on Metabolic Parameters:</b>", section_head))
meta_table = [
["DRUG CLASS", "GLUCOSE", "K⁺", "LIPIDS", "URIC ACID", "RENAL"],
["Thiazides", "↑ (hyperglycemia)", "↓ (hypokalemia)", "↑ TG, ↑ LDL", "↑ (hyperuricemia)", "↓ GFR (mild)"],
["Loop Diuretics", "↑ (mild)", "↓↓ (wasting)", "↑ TG", "↑", "Nephroprotective (high dose)"],
["K⁺-Sparing", "Neutral", "↑ (hyperkalemia)", "Neutral", "Neutral", "↓ proteinuria"],
["Beta-Blockers", "↓ (mask hypogly.)", "↑ (mild)", "↑ TG, ↓ HDL", "Neutral", "↓ GFR (mild)"],
["CCBs", "Neutral", "Neutral", "Neutral", "Neutral", "Mild ↑ GFR"],
["ACEi / ARBs", "↓ (improve IS)", "↑ (hyperkalemia)", "Neutral", "Neutral (Losartan ↓)", "↓↓ proteinuria"],
["Alpha-blockers", "↓ (improve IS)", "Neutral", "↓ LDL, ↑ HDL", "Neutral", "Neutral"],
]
story.append(mini_table(meta_table[0], meta_table[1:], [3.0*cm, 3.2*cm, 2.3*cm, 2.5*cm, 2.5*cm, 2.0*cm]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════════
# SECTION 13: HIGH-YIELD EXAM FACTS & MNEMONICS
# ══════════════════════════════════════════════════════════════════════════════
story.append(section_banner("13. HIGH-YIELD EXAM FACTS & MNEMONICS", DARK_BLUE))
story.append(sp(8))
story.append(Paragraph("MNEMONICS", section_head))
mnemonics = [
("Thiazide adverse effects — GLUCOHH",
"G=Glucose↑, L=Lipids↑, U=Urate↑, C=Ca²⁺↑, O=Osmolarity (hyponatremia), H=Hypokalemia, H=Hypotension"),
("ACEi adverse effects — mnemonic 'CAPTOPRIL'",
"C=Cough, A=Angioedema, P=Proteinuria↓ (good), T=Teratogenic, O=Other hypotension, P=Potassium↑, R=Rash, I=Indomethacin blocks, L=Liver (captopril)"),
("Drugs causing Drug-Induced LUPUS — 'HIPPIES'",
"H=Hydralazine, I=Isoniazid, P=Procainamide, P=Phenytoin, I=quinIdine, E=Etanercept, S=Sulfasalazine"),
("Beta-Blocker Selectivity — 'A-B-E-M'",
"Acebutolol, Bisoprolol, Esmolol, Metoprolol = selective β₁ blockers (heart)"),
("Drugs safe in Pregnancy HTN — 'LMNOP'",
"L=Labetalol, M=Methyldopa, N=Nifedipine, O=nO ACEi/ARB, P=Pindolol"),
]
for title_m, desc_m in mnemonics:
row = [[Paragraph(f"<b>{title_m}</b>", body_bold),
Paragraph(desc_m, body)]]
tbl = Table(row, colWidths=[6.5*cm, 8.5*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), DARK_BLUE),
("BACKGROUND", (1,0), (1,0), PILL_GREEN),
("TEXTCOLOR", (0,0), (0,0), WHITE),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 0.5, GRAY_MID),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(tbl)
story.append(sp(4))
story.append(sp(6))
story.append(Paragraph("TOP 20 HIGH-YIELD EXAM FACTS", section_head))
facts = [
"1. ACEi cause DRY COUGH (bradykinin↑); switch to ARB if cough occurs.",
"2. NEVER use ACEi/ARB in PREGNANCY — teratogenic (oligohydramnios, renal agenesis).",
"3. Methyldopa = drug of choice for chronic HTN in PREGNANCY.",
"4. Hydralazine IV = preferred for ACUTE HTN in pregnancy (pre-eclampsia).",
"5. Thiazides RETAIN calcium, Loop diuretics WASTE calcium.",
"6. Spironolactone causes GYNECOMASTIA; Eplerenone is selective, does not.",
"7. Verapamil + Beta-blocker = dangerous combination (fatal bradycardia/AV block).",
"8. Nimodipine (CCB) used for SUBARACHNOID HEMORRHAGE (cerebral vasospasm prevention).",
"9. Minoxidil = most potent oral antihypertensive; causes HYPERTRICHOSIS.",
"10. First-dose ORTHOSTATIC HYPOTENSION with alpha-blockers (prazosin) — give at bedtime.",
"11. Clonidine: abrupt withdrawal → REBOUND HYPERTENSION (taper slowly!).",
"12. In PHEOCHROMOCYTOMA: give alpha-blocker FIRST, then beta-blocker — never reverse order.",
"13. Losartan is uricosuric — useful in HTN + GOUT.",
"14. Telmisartan has the LONGEST half-life among ARBs.",
"15. Fosinopril = only ACEi with dual elimination (renal + hepatic) — safe in renal failure.",
"16. Sodium nitroprusside toxicity: CYANIDE POISONING (treat with sodium thiosulfate/hydroxocobalamin).",
"17. Fenoldopam: only antihypertensive that INCREASES renal perfusion (D₁ agonist).",
"18. Ethacrynic acid = only non-sulfonamide loop diuretic — safe in sulfa allergy.",
"19. Captopril contains -SH (sulfhydryl) group → rash, taste disturbance, proteinuria.",
"20. JNC 8 guideline: target BP < 150/90 in patients ≥ 60 yr without DM/CKD; < 140/90 for others.",
]
for f in facts:
story.append(Paragraph(f"{'⭐' if int(f.split('.')[0]) <= 10 else '✦'} {f}", bullet_style))
story.append(sp(4))
story.append(hr())
story.append(sp(4))
story.append(Paragraph(
"Sources: Katzung's Basic and Clinical Pharmacology 16e | Goodman & Gilman's Pharmacological Basis of Therapeutics | "
"Brenner and Rector's The Kidney | JNC 7/8 Guidelines | ACC/AHA 2017 Hypertension Guidelines",
small_gray))
# ── BUILD ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT}")
cd /tmp/workspace/antihypertensive-pdf && python generate_pdf.py 2>&1
~/antihypertensive-pdf/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/antihypertensive-pdf/generate_pdf.py'
cd /tmp/workspace/antihypertensive-pdf && python generate_pdf.py 2>&1
ls -lh /tmp/workspace/antihypertensive-pdf/Antihypertensive_Drugs.pdf
Antihypertensive Drugs
PDF Document · PDF
| Section | Content |
|---|---|
| 1. Overview | Definition, JNC 7 BP classification, BP equation |
| 2. Classification | Full master table of all classes + mechanisms |
| 3. Diuretics | Thiazides, Loop, K⁺-sparing (separate drug profiles) |
| 4. Beta-Blockers | Selectivity table, all subtypes, ISA explained |
| 5. Calcium Channel Blockers | DHP vs Non-DHP comparison table |
| 6. ACE Inhibitors | Individual drug table (prodrug status, half-life), RAAS pathway |
| 7. ARBs / Sartans | Comparison table, difference from ACEi |
| 8. Direct Vasodilators | Hydralazine + Minoxidil (separate profiles) |
| 9. Centrally Acting | Clonidine + Methyldopa |
| 10. Alpha-Blockers | Prazocin, doxazosin, phentolamine, phenoxybenzamine |
| 11. HTN Emergencies | 9-drug IV agent table with onset & specific indications |
| 12. Comparison Tables | Compelling indications + metabolic effects comparison |
| 13. High-Yield Facts | 20 exam points + 5 mnemonics (GLUCOHH, HIPPIES, LMNOP…) |