Create a pdf of notes on virology section of microbiology Source : Anathanarayana book of microbiology Generate pdf of notes important for neet MDS point of view containing important mcq points diagrams wherever necessary flow charts for understanding pneumonics and highlighted previous asked questions from the topic and turn it into important stared bullet points Please help in creating pdf on virology section

Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/virology-notes && echo "Directory ready"

!

Failed to create session: bad request: failed to resolve container IP after 3 attempts: no IP address found. Is the Sandbox started?

We encountered an error while processing your request. Please try again or reach out to us for help.

Try again

Running Command

mkdir -p /home/daytona/workspace/virology-notes && echo "OK"

Writing File

~/virology-notes/generate_virology_pdf.py

#!/usr/bin/env python3
"""
NEET MDS Virology Notes PDF Generator
Source: Ananthanarayan & Paniker's Textbook of Microbiology
"""

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, ListFlowable, ListItem, PageBreak
)
from reportlab.platypus.flowables import Flowable
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.graphics.shapes import Drawing, Rect, String, Line, Arrow, Polygon, Circle
from reportlab.graphics.charts.barcharts import VerticalBarChart
from reportlab.graphics import renderPDF
import os

OUTPUT_PATH = "/home/daytona/workspace/virology-notes/Virology_NEET_MDS_Notes.pdf"

# ── Colour palette ──────────────────────────────────────────────────────────
C_TITLE      = colors.HexColor("#1A237E")   # deep indigo
C_HEAD1      = colors.HexColor("#283593")   # section heading
C_HEAD2      = colors.HexColor("#1565C0")   # sub-heading
C_HEAD3      = colors.HexColor("#1976D2")   # sub-sub-heading
C_STAR       = colors.HexColor("#B71C1C")   # starred/important – red
C_MCQ_BG     = colors.HexColor("#E3F2FD")   # MCQ box background – light blue
C_MCQ_BORDER = colors.HexColor("#1565C0")
C_MNEM_BG   = colors.HexColor("#FFF9C4")   # mnemonic box – light yellow
C_MNEM_BORD = colors.HexColor("#F57F17")
C_PREV_BG   = colors.HexColor("#FCE4EC")   # prev-asked box – light pink
C_PREV_BORD = colors.HexColor("#880E4F")
C_FLOW_BG   = colors.HexColor("#E8F5E9")   # flowchart – light green
C_FLOW_BORD = colors.HexColor("#2E7D32")
C_WARN_BG   = colors.HexColor("#FFF3E0")   # note/warning box – orange tint
C_WARN_BORD = colors.HexColor("#E65100")
C_TABLE_H   = colors.HexColor("#283593")
C_TABLE_ALT = colors.HexColor("#EEF2FF")
C_BULLET    = colors.HexColor("#1565C0")

PAGE_W, PAGE_H = A4

# ── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

def make_style(name, parent='Normal', **kw):
    return ParagraphStyle(name, parent=styles[parent], **kw)

S_TITLE   = make_style('MyTitle',   fontSize=22, textColor=C_TITLE,
                        fontName='Helvetica-Bold', spaceAfter=4, alignment=TA_CENTER)
S_SUBTITLE= make_style('MySub',     fontSize=12, textColor=C_HEAD2,
                        fontName='Helvetica', spaceAfter=2, alignment=TA_CENTER)
S_H1      = make_style('MyH1',      fontSize=14, textColor=C_HEAD1,
                        fontName='Helvetica-Bold', spaceBefore=10, spaceAfter=4,
                        borderPad=3)
S_H2      = make_style('MyH2',      fontSize=12, textColor=C_HEAD2,
                        fontName='Helvetica-Bold', spaceBefore=8, spaceAfter=3)
S_H3      = make_style('MyH3',      fontSize=11, textColor=C_HEAD3,
                        fontName='Helvetica-Bold', spaceBefore=6, spaceAfter=2)
S_BODY    = make_style('MyBody',    fontSize=9.5, leading=14, spaceAfter=3,
                        textColor=colors.black, alignment=TA_JUSTIFY)
S_BULLET  = make_style('MyBullet',  fontSize=9.5, leading=13, leftIndent=14,
                        firstLineIndent=-10, spaceAfter=2)
S_STAR    = make_style('MyStar',    fontSize=9.5, leading=13, leftIndent=14,
                        firstLineIndent=-10, spaceAfter=2,
                        textColor=C_STAR, fontName='Helvetica-Bold')
S_MCQ     = make_style('MyMCQ',     fontSize=9, leading=13, leftIndent=6,
                        textColor=colors.HexColor("#0D47A1"))
S_MNEM    = make_style('MyMnem',    fontSize=9.5, leading=13, leftIndent=6,
                        textColor=colors.HexColor("#4A148C"), fontName='Helvetica-Bold')
S_PREV    = make_style('MyPrev',    fontSize=9.5, leading=13, leftIndent=6,
                        textColor=C_PREV_BORD, fontName='Helvetica-BoldOblique')
S_TABLE_H = make_style('MyTblH',    fontSize=9, fontName='Helvetica-Bold',
                        textColor=colors.white, alignment=TA_CENTER, leading=12)
S_TABLE_B = make_style('MyTblB',    fontSize=8.5, leading=11, alignment=TA_LEFT)
S_FLOW    = make_style('MyFlow',    fontSize=9, leading=13, leftIndent=6,
                        textColor=colors.HexColor("#1B5E20"))
S_NOTE    = make_style('MyNote',    fontSize=9, leading=12, leftIndent=6,
                        textColor=colors.HexColor("#4E342E"), fontName='Helvetica-Oblique')
S_CAPTION = make_style('MyCaption', fontSize=8.5, leading=11, alignment=TA_CENTER,
                        textColor=colors.grey, fontName='Helvetica-Oblique')

# ── Helper flowables ──────────────────────────────────────────────────────────

def hr(color=C_HEAD1, thickness=1):
    return HRFlowable(width="100%", thickness=thickness, color=color, spaceAfter=4, spaceBefore=4)

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

def h1(txt):
    return Paragraph(f"▌ {txt}", S_H1)

def h2(txt):
    return Paragraph(f"◆ {txt}", S_H2)

def h3(txt):
    return Paragraph(f"→ {txt}", S_H3)

def body(txt):
    return Paragraph(txt, S_BODY)

def bullet(txt, star=False):
    s = S_STAR if star else S_BULLET
    marker = "★" if star else "•"
    return Paragraph(f"{marker}  {txt}", s)

def star(txt):
    return bullet(txt, star=True)

def note(txt):
    return Paragraph(f"📝  {txt}", S_NOTE)

# Coloured box
def colbox(content_paras, bg, border, label="", label_color=None):
    if label_color is None:
        label_color = border
    rows = []
    if label:
        rows.append([Paragraph(f"<b>{label}</b>", ParagraphStyle('lbl', fontSize=9.5,
                     textColor=label_color, fontName='Helvetica-Bold'))])
    for p in content_paras:
        rows.append([p])
    t = Table(rows, colWidths=[PAGE_W - 4.2*cm])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), bg),
        ('BOX', (0,0), (-1,-1), 1.5, border),
        ('TOPPADDING',    (0,0), (-1,-1), 5),
        ('BOTTOMPADDING', (0,0), (-1,-1), 5),
        ('LEFTPADDING',   (0,0), (-1,-1), 8),
        ('RIGHTPADDING',  (0,0), (-1,-1), 8),
        ('ROWBACKGROUNDS',(0,0), (-1,-1), [bg]),
    ]))
    return t

def mcq_box(items):
    paras = [Paragraph(f"<b>★ MCQ POINT</b>", ParagraphStyle('mh', fontSize=9.5,
              textColor=C_MCQ_BORDER, fontName='Helvetica-Bold'))]
    for i in items:
        paras.append(Paragraph(f"▶  {i}", S_MCQ))
    return colbox(paras[0:1] + paras[1:], C_MCQ_BG, C_MCQ_BORDER)

def mnemonic_box(mnem, meaning=""):
    paras = [Paragraph("🔤 MNEMONIC", ParagraphStyle('mnh', fontSize=9.5,
              textColor=C_MNEM_BORD, fontName='Helvetica-Bold'))]
    paras.append(Paragraph(f"<b>{mnem}</b>", S_MNEM))
    if meaning:
        paras.append(Paragraph(meaning, S_NOTE))
    return colbox(paras, C_MNEM_BG, C_MNEM_BORD)

def prev_asked_box(items):
    paras = [Paragraph("📌 PREVIOUSLY ASKED (NEET MDS)", ParagraphStyle('pvh', fontSize=9.5,
              textColor=C_PREV_BORD, fontName='Helvetica-Bold'))]
    for i in items:
        paras.append(Paragraph(f"★  {i}", S_PREV))
    return colbox(paras, C_PREV_BG, C_PREV_BORD)

def flow_box(lines):
    paras = [Paragraph("🔄 FLOWCHART / PATHWAY", ParagraphStyle('flh', fontSize=9.5,
              textColor=C_FLOW_BORD, fontName='Helvetica-Bold'))]
    for l in lines:
        paras.append(Paragraph(l, S_FLOW))
    return colbox(paras, C_FLOW_BG, C_FLOW_BORD)

def warn_box(txt, label="⚠ IMPORTANT NOTE"):
    paras = [Paragraph(label, ParagraphStyle('wh', fontSize=9.5,
              textColor=C_WARN_BORD, fontName='Helvetica-Bold')),
             Paragraph(txt, S_NOTE)]
    return colbox(paras, C_WARN_BG, C_WARN_BORD)

# Data table
def dtable(headers, rows, col_widths=None):
    if col_widths is None:
        n = len(headers)
        col_widths = [(PAGE_W - 4.2*cm)/n] * n
    data = [[Paragraph(h, S_TABLE_H) for h in headers]]
    for i, row in enumerate(rows):
        bg = C_TABLE_ALT if i % 2 == 0 else colors.white
        data.append([Paragraph(str(c), S_TABLE_B) for c in row])
    t = Table(data, colWidths=col_widths)
    ts = [
        ('BACKGROUND', (0,0), (-1,0), C_TABLE_H),
        ('GRID',       (0,0), (-1,-1), 0.5, colors.HexColor("#BBDEFB")),
        ('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), 'MIDDLE'),
    ]
    for i in range(1, len(rows)+1):
        bg = C_TABLE_ALT if i % 2 == 0 else colors.white
        ts.append(('BACKGROUND', (0,i), (-1,i), bg))
    t.setStyle(TableStyle(ts))
    return t

# ── Cover page ────────────────────────────────────────────────────────────────
def cover_elements():
    elems = []
    elems.append(sp(50))
    # Big title box
    title_data = [[Paragraph(
        "<b>VIROLOGY</b>",
        ParagraphStyle('cvt', fontSize=36, textColor=colors.white,
                       fontName='Helvetica-Bold', alignment=TA_CENTER)
    )]]
    t = Table(title_data, colWidths=[PAGE_W - 3*cm])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), C_TITLE),
        ('BOX',        (0,0), (-1,-1), 2, C_HEAD1),
        ('TOPPADDING',    (0,0), (-1,-1), 20),
        ('BOTTOMPADDING', (0,0), (-1,-1), 20),
        ('LEFTPADDING',   (0,0), (-1,-1), 10),
    ]))
    elems.append(t)
    elems.append(sp(15))
    elems.append(Paragraph(
        "<b>NEET MDS Preparation Notes</b>",
        ParagraphStyle('cvs', fontSize=16, textColor=C_HEAD2,
                       fontName='Helvetica-Bold', alignment=TA_CENTER)
    ))
    elems.append(sp(6))
    elems.append(Paragraph(
        "Source: Ananthanarayan &amp; Paniker's Textbook of Microbiology",
        ParagraphStyle('cvsrc', fontSize=11, textColor=colors.HexColor("#37474F"),
                       fontName='Helvetica-Oblique', alignment=TA_CENTER)
    ))
    elems.append(sp(4))
    elems.append(Paragraph(
        "| Jawetz Melnick &amp; Adelberg's Medical Microbiology |",
        ParagraphStyle('cvsrc2', fontSize=10, textColor=colors.HexColor("#546E7A"),
                       fontName='Helvetica-Oblique', alignment=TA_CENTER)
    ))
    elems.append(sp(30))
    features = [
        ("★ MCQ Points", "High-yield facts from previous NEET MDS papers"),
        ("🔤 Mnemonics",  "Easy-to-remember shortcuts for all key lists"),
        ("🔄 Flowcharts", "Step-by-step pathways for replication &amp; pathogenesis"),
        ("📌 Prev. Asked","Starred questions from actual NEET MDS exams"),
        ("📊 Tables",     "Quick comparison tables for rapid revision"),
    ]
    feat_data = [[Paragraph(f"<b>{k}</b>", ParagraphStyle('fk', fontSize=10,
                  textColor=C_HEAD1, fontName='Helvetica-Bold')),
                  Paragraph(v, ParagraphStyle('fv', fontSize=9.5, textColor=colors.black))]
                 for k, v in features]
    ft = Table(feat_data, colWidths=[5*cm, PAGE_W-4.2*cm-5*cm])
    ft.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), C_MCQ_BG),
        ('BOX',        (0,0), (-1,-1), 1, C_MCQ_BORDER),
        ('INNERGRID',  (0,0), (-1,-1), 0.3, C_MCQ_BORDER),
        ('TOPPADDING',    (0,0), (-1,-1), 5),
        ('BOTTOMPADDING', (0,0), (-1,-1), 5),
        ('LEFTPADDING',   (0,0), (-1,-1), 8),
    ]))
    elems.append(ft)
    elems.append(PageBreak())
    return elems

# ══════════════════════════════════════════════════════════════════════════════
# CONTENT SECTIONS
# ══════════════════════════════════════════════════════════════════════════════

def section_general_properties():
    e = []
    e.append(h1("CHAPTER 1: GENERAL PROPERTIES OF VIRUSES"))
    e.append(hr())
    e.append(h2("1.1 Definition & Basic Concepts"))
    e.append(bullet("Viruses are the <b>smallest infectious agents</b> (20–300 nm) — can pass through Seitz/Chamberland filters"))
    e.append(bullet("Contain <b>only ONE type of nucleic acid</b> — either DNA or RNA (never both)"))
    e.append(bullet("Obligate <b>intracellular parasites</b> — replicate only inside living cells"))
    e.append(bullet("Lack ribosomes, mitochondria, cell wall — not cells"))
    e.append(bullet("Cannot be grown on cell-free media (unlike bacteria)"))
    e.append(star("Viruses are acellular — they are NOT cells; they are <b>genetic parasites</b>"))
    e.append(sp(4))
    e.append(mcq_box([
        "Smallest virus: <b>Parvovirus / Circoviridae</b> (~18–26 nm)",
        "Largest virus: <b>Poxvirus (Smallpox)</b> — visible under light microscope (~300 nm)",
        "Only virus visible under light microscope: <b>Poxvirus</b>",
        "Viruses contain only ONE type of nucleic acid — key exam point",
        "Viruses are <b>filterable agents</b> — pass through bacterial filters",
    ]))
    e.append(sp(6))

    e.append(h2("1.2 Virus Morphology – Key Terms"))
    headers = ["Term", "Definition"]
    rows = [
        ["Virion",       "Complete, mature, extracellular virus particle — the infectious unit"],
        ["Capsid",       "Protein shell enclosing the nucleic acid; made of capsomeres"],
        ["Capsomere",    "Morphological unit of capsid; made of protomers (protein subunits)"],
        ["Nucleocapsid", "Nucleic acid + capsid together"],
        ["Envelope",     "Lipid bilayer membrane derived from host cell (NOT present in all viruses)"],
        ["Peplomers",    "Glycoprotein spikes on the envelope surface (e.g., HA, NA of Influenza)"],
        ["Defective virus","Virus that lacks complete genetic info — needs helper virus to replicate"],
        ["Viroid",       "Smallest infectious agent — naked RNA, no protein coat (plant pathogens)"],
        ["Prion",        "Proteinaceous infectious particle — no nucleic acid at all"],
    ]
    e.append(dtable(headers, rows, col_widths=[4*cm, PAGE_W-4.2*cm-4*cm]))
    e.append(sp(6))

    e.append(h2("1.3 Symmetry of Viruses"))
    e.append(bullet("<b>Icosahedral (Cubic) symmetry:</b> 20 equilateral triangle faces, 12 vertices, 5-3-2-fold axes — most efficient closed shell"))
    e.append(bullet("  → Examples: Adenovirus, Herpesvirus, Picornavirus, Parvovirus"))
    e.append(bullet("<b>Helical symmetry:</b> Capsomeres arranged in a helix around the nucleic acid"))
    e.append(bullet("  → Examples: Influenza, Measles, Mumps, Rabies, Tobacco mosaic virus (TMV)"))
    e.append(bullet("<b>Complex symmetry:</b> Neither icosahedral nor helical — unique structures"))
    e.append(bullet("  → Examples: Poxvirus (brick-shaped), Bacteriophage (binal/combined)"))
    e.append(sp(4))
    e.append(mnemonic_box("'I Hear Pox'",
        "<b>I</b>cosahedral → <b>H</b>elical → <b>P</b>ox (complex). "
        "For icosahedral: '<b>HAPPP</b>' = Herpes, Adeno, Papova, Parvo, Picorna"))
    e.append(sp(4))
    e.append(mcq_box([
        "<b>Tobacco Mosaic Virus (TMV)</b> = prototype of helical symmetry",
        "Adenovirus = prototype of icosahedral symmetry — 252 capsomeres (240 hexons + 12 pentons)",
        "Bacteriophage T4 = prototype of complex/binal symmetry",
        "Poxvirus has <b>complex symmetry</b> — largest DNA virus",
        "All animal viruses with helical symmetry are <b>enveloped</b>",
    ]))
    e.append(sp(6))

    e.append(h2("1.4 Enveloped vs. Non-Enveloped Viruses"))
    headers = ["Feature", "Enveloped", "Non-Enveloped (Naked)"]
    rows = [
        ["Envelope",        "Present (lipid bilayer from host)",   "Absent"],
        ["Stability",       "Less stable, sensitive to ether/detergent", "More stable, resistant to ether"],
        ["Transmission",    "Droplet, direct contact",             "Faecal-oral, respiratory, fomites"],
        ["Examples (DNA)",  "Herpes, Pox, HBV (hepadna)",         "Adeno, Parvo, HPV, Polyoma"],
        ["Examples (RNA)",  "Influenza, HIV, Measles, Rabies",     "Polio, Coxsackie, Rhino, Rota, Calici"],
    ]
    e.append(dtable(headers, rows, col_widths=[4*cm, (PAGE_W-4.2*cm-4*cm)/2, (PAGE_W-4.2*cm-4*cm)/2]))
    e.append(sp(4))
    e.append(star("Ether sensitivity test → differentiates enveloped (sensitive) from non-enveloped (resistant) viruses"))
    e.append(prev_asked_box([
        "Which virus is sensitive to ether? → Herpes simplex virus (enveloped)",
        "Non-enveloped viruses are resistant to: ether, bile salts, detergents",
        "Poxvirus: enveloped + complex symmetry — frequently asked combination",
    ]))
    e.append(PageBreak())
    return e


def section_classification():
    e = []
    e.append(h1("CHAPTER 2: CLASSIFICATION OF VIRUSES"))
    e.append(hr())
    e.append(body("The <b>Baltimore classification</b> (David Baltimore, Nobel 1975) is based on the relationship between viral genome and mRNA. The <b>ICTV (International Committee on Taxonomy of Viruses)</b> provides the official taxonomy."))
    e.append(sp(4))

    e.append(h2("2.1 Baltimore Classification (7 Groups)"))
    headers = ["Class", "Genome", "mRNA Strategy", "Examples"]
    rows = [
        ["Class I",   "dsDNA",           "Direct transcription",         "Adeno, Herpes, Pox, HPV, HBV*"],
        ["Class II",  "ssDNA (+)",       "Replicate via dsDNA",          "Parvovirus, AAV"],
        ["Class III", "dsRNA",           "RNA-dep RNA polymerase",       "Reovirus, Rotavirus"],
        ["Class IV",  "ssRNA (+) sense", "Acts directly as mRNA",        "Picorna (Polio), Flavi, Corona"],
        ["Class V",   "ssRNA (-) sense", "RNA-dep RNA pol → mRNA",       "Influenza, Measles, Rabies, RSV"],
        ["Class VI",  "ssRNA (+) Retro", "Reverse transcriptase → DNA",  "HIV, HTLV"],
        ["Class VII", "dsDNA + RT",      "RNA intermediate + RT",        "HBV (Hepadnavirus)"],
    ]
    e.append(dtable(headers, rows, col_widths=[1.8*cm, 2.5*cm, 4.5*cm, PAGE_W-4.2*cm-1.8*cm-2.5*cm-4.5*cm]))
    e.append(sp(4))
    e.append(mnemonic_box("'<b>Double Single Double Single Single Retro Retro</b>'",
        "Class I=dsDNA, II=ssDNA, III=dsRNA, IV=ss(+)RNA, V=ss(-)RNA, VI=ssRNA+RT, VII=dsDNA+RT"))
    e.append(sp(4))
    e.append(mcq_box([
        "HBV = <b>Class VII (Hepadnavirus)</b> — uses reverse transcriptase despite being a DNA virus",
        "HIV = <b>Class VI (Retrovirus)</b> — ssRNA(+) with reverse transcriptase",
        "Rotavirus = <b>Class III</b> — dsRNA virus (11 segments)",
        "Poliovirus = <b>Class IV</b> — ss(+)RNA — RNA itself is infectious",
        "Baltimore classification based on mRNA synthesis strategy",
    ]))
    e.append(sp(6))

    e.append(h2("2.2 DNA Virus Families — Quick Reference"))
    e.append(mnemonic_box("'<b>HHAPPPA</b>' for DNA Viruses",
        "<b>H</b>erpes, <b>H</b>epadna, <b>A</b>deno, <b>P</b>apova (HPV+Polyoma), <b>P</b>arvo, <b>P</b>ox, <b>A</b>nello(TTV)"))
    headers = ["Family", "Envelope", "Symmetry", "Genome", "Key Virus"]
    rows = [
        ["Herpesviridae",    "Yes", "Icosahedral", "dsDNA linear",    "HSV-1, HSV-2, CMV, EBV, VZV"],
        ["Adenoviridae",     "No",  "Icosahedral", "dsDNA linear",    "Adenovirus 1–51"],
        ["Papovaviridae",    "No",  "Icosahedral", "dsDNA circular",  "HPV (warts, cancer), Polyoma, SV40"],
        ["Poxviridae",       "Yes", "Complex",     "dsDNA linear",    "Smallpox, Vaccinia, Molluscum"],
        ["Parvoviridae",     "No",  "Icosahedral", "ssDNA linear",    "B19 (fifth disease), AAV"],
        ["Hepadnaviridae",   "Yes", "Icosahedral", "dsDNA circular",  "HBV (Hepatitis B)"],
        ["Polyomaviridae",   "No",  "Icosahedral", "dsDNA circular",  "JC virus, BK virus"],
    ]
    e.append(dtable(headers, rows, col_widths=[3.5*cm, 1.5*cm, 2.5*cm, 2.5*cm, PAGE_W-4.2*cm-3.5*cm-1.5*cm-2.5*cm-2.5*cm]))
    e.append(sp(4))

    e.append(h2("2.3 RNA Virus Families — Quick Reference"))
    e.append(mnemonic_box("'<b>PORN FRiC</b>' for (+)sense RNA Viruses",
        "<b>P</b>icorna, <b>O</b>rbivirus(Reovir), <b>R</b>habdo... + <b>F</b>lavi, <b>R</b>etro, <b>i</b>=Corona, <b>C</b>alici/Toga"))
    headers = ["Family", "Envelope", "Genome (sense)", "Segments", "Key Virus"]
    rows = [
        ["Picornaviridae", "No",  "ss(+)RNA",   "1",  "Poliovirus, Coxsackie, Echovirus, HAV, Rhinovirus"],
        ["Flaviviridae",   "Yes", "ss(+)RNA",   "1",  "Dengue, Yellow Fever, JEV, HCV, Zika"],
        ["Togaviridae",    "Yes", "ss(+)RNA",   "1",  "Rubella, Alphavirus (Chikungunya)"],
        ["Coronaviridae",  "Yes", "ss(+)RNA",   "1",  "SARS-CoV-2, MERS, OC43"],
        ["Caliciviridae",  "No",  "ss(+)RNA",   "1",  "Norovirus, Hepatitis E (HEV)"],
        ["Reoviridae",     "No",  "dsRNA",      "10–12", "Rotavirus (11 seg), Orbivirus, Reovirus"],
        ["Orthomyxoviridae","Yes","ss(-)RNA",   "8",  "Influenza A, B, C"],
        ["Paramyxoviridae","Yes", "ss(-)RNA",   "1",  "Measles, Mumps, RSV, Parainfluenza"],
        ["Rhabdoviridae",  "Yes", "ss(-)RNA",   "1",  "Rabies, VSV"],
        ["Filoviridae",    "Yes", "ss(-)RNA",   "1",  "Ebola, Marburg"],
        ["Arenaviridae",   "Yes", "ss(-)RNA",   "2",  "Lassa fever, LCMV"],
        ["Bunyaviridae",   "Yes", "ss(-)RNA",   "3",  "Hantavirus, Crimean-Congo HF"],
        ["Retroviridae",   "Yes", "ss(+)RNA+RT","2 copies", "HIV-1, HIV-2, HTLV-1"],
        ["Deltaviridae",   "Yes", "ssRNA (circ)","1", "HDV (Hepatitis D) — needs HBV"],
    ]
    e.append(dtable(headers, rows, col_widths=[3.8*cm, 1.5*cm, 2.5*cm, 2*cm, PAGE_W-4.2*cm-3.8*cm-1.5*cm-2.5*cm-2*cm]))
    e.append(sp(4))
    e.append(mcq_box([
        "Only segmented DNA virus: <b>None</b> (segmentation is an RNA virus feature)",
        "Segmented RNA viruses: Influenza (8), Bunyavirus (3), Arenavirus (2), Rotavirus (11), Reovirus (10)",
        "<b>Mnemonic '8-3-2-11-10'</b> = Influenza-Bunya-Arena-Rota-Reo",
        "Only naked (+)RNA virus causing hepatitis: <b>HAV (Picorna)</b> and <b>HEV (Calici)</b>",
        "Hepatitis D (delta) = defective virus — requires HBV as helper virus",
    ]))
    e.append(prev_asked_box([
        "Largest RNA virus: <b>Reovirus / Filovirus (Ebola)</b>",
        "Smallest RNA virus: <b>Hepatitis delta (HDV)</b> — satellite virus",
        "Only arbovirus causing hepatitis: <b>Yellow Fever virus</b>",
        "Virus with largest genome: <b>Poxvirus (dsDNA)</b>",
        "Negative sense RNA virus: Influenza, Measles, Mumps, Rabies (mnemonic: <b>IMMR</b>)",
    ]))
    e.append(PageBreak())
    return e


def section_replication():
    e = []
    e.append(h1("CHAPTER 3: VIRAL REPLICATION"))
    e.append(hr())
    e.append(h2("3.1 Steps of Viral Replication — General"))
    e.append(flow_box([
        "① ADSORPTION (Attachment) → Viral surface protein binds to specific host cell receptor",
        "      ↓",
        "② PENETRATION (Entry) → Endocytosis or membrane fusion",
        "      ↓",
        "③ UNCOATING → Capsid removed, viral genome released into cytoplasm",
        "      ↓",
        "④ ECLIPSE PHASE → No infectious virus detectable; genome replication + protein synthesis",
        "      ↓",
        "⑤ ASSEMBLY / MATURATION → New virions assembled from components",
        "      ↓",
        "⑥ RELEASE → Budding (enveloped) or cell lysis (non-enveloped)",
    ]))
    e.append(sp(4))
    e.append(star("Eclipse period = time after uncoating when NO infectious virus is detectable (not even by cell disruption)"))
    e.append(star("Latent period = time from inoculation to first appearance of virus in medium (includes eclipse)"))
    e.append(bullet("Rise period = exponential increase in virus after latent period"))
    e.append(sp(4))
    e.append(mcq_box([
        "Shortest eclipse period: <b>Bacteriophage T4</b> (~12 min); longest in DNA viruses",
        "During eclipse phase — cell disruption does NOT release virus",
        "Non-enveloped viruses released by <b>cell lysis</b> (cytolytic)",
        "Enveloped viruses released by <b>budding</b> (non-cytolytic initially)",
        "Receptor for HIV: <b>CD4 + CCR5 or CXCR4</b> co-receptor",
    ]))
    e.append(sp(6))

    e.append(h2("3.2 Replication Sites"))
    headers = ["Virus Type", "DNA Replication Site", "mRNA Synthesis Site", "Assembly"]
    rows = [
        ["Most DNA viruses",   "Nucleus",    "Nucleus",    "Nucleus → cytoplasm"],
        ["Poxvirus (DNA)",     "Cytoplasm",  "Cytoplasm",  "Cytoplasm (unique!)"],
        ["Herpesviruses",      "Nucleus",    "Nucleus",    "Nucleus (envelopment at nuclear membrane)"],
        ["(+)ssRNA viruses",   "Cytoplasm",  "Cytoplasm",  "Cytoplasm"],
        ["(-)ssRNA viruses",   "Cytoplasm",  "Cytoplasm",  "Cytoplasm"],
        ["Retroviruses (HIV)", "Nucleus (provirus)", "Nucleus (provirus)", "Cytoplasm → budding"],
        ["Influenza (RNA)",    "Nucleus",    "Nucleus",    "Cytoplasm + budding at membrane"],
    ]
    e.append(dtable(headers, rows, col_widths=[3.5*cm, 2.5*cm, 2.5*cm, PAGE_W-4.2*cm-3.5*cm-2.5*cm-2.5*cm]))
    e.append(sp(4))
    e.append(star("Poxvirus = ONLY DNA virus that replicates entirely in the CYTOPLASM"))
    e.append(star("Influenza = RNA virus that replicates in the NUCLEUS (unique among RNA viruses)"))
    e.append(sp(4))
    e.append(prev_asked_box([
        "DNA virus replicating in cytoplasm: <b>Poxvirus</b>",
        "RNA virus replicating in nucleus: <b>Influenza virus</b>",
        "Virus that integrates into host chromosome: <b>Retroviruses (HIV, HTLV)</b> and Herpesviruses (latency)",
        "Retroviruses integrate as <b>provirus</b> using integrase enzyme",
    ]))
    e.append(sp(6))

    e.append(h2("3.3 Viral Enzymes — NEET MDS High Yield"))
    headers = ["Enzyme", "Virus", "Function"]
    rows = [
        ["Reverse Transcriptase (RT)", "HIV, HTLV, HBV",          "ssRNA → dsDNA"],
        ["RNA-dependent RNA polymerase (RdRp)", "All RNA viruses",  "RNA replication + mRNA synthesis"],
        ["Neuraminidase (NA)",          "Influenza",               "Cleaves sialic acid — virus release from cells"],
        ["Hemagglutinin (HA)",          "Influenza",               "Binds sialic acid receptor on host cells"],
        ["Integrase",                   "HIV",                     "Integrates viral DNA into host chromosome"],
        ["Protease",                    "HIV",                     "Cleaves polyprotein into functional units"],
        ["Thymidine kinase (TK)",       "HSV, VZV",                "Phosphorylates acyclovir (drug activation)"],
        ["DNA polymerase",              "All DNA viruses",         "dsDNA replication"],
        ["Transcriptase",               "Reovirus/Rotavirus",      "dsRNA → mRNA (within virion)"],
        ["Lysozyme",                    "Bacteriophage T4",        "Lyses bacterial cell wall"],
    ]
    e.append(dtable(headers, rows, col_widths=[4.5*cm, 3.5*cm, PAGE_W-4.2*cm-4.5*cm-3.5*cm]))
    e.append(sp(4))
    e.append(mcq_box([
        "Reverse transcriptase = <b>RNA-dependent DNA polymerase</b> (discovered by Baltimore & Temin, Nobel 1975)",
        "Neuraminidase inhibitors: <b>Oseltamivir (Tamiflu)</b>, Zanamivir — anti-influenza drugs",
        "Acyclovir works ONLY if HSV/VZV <b>thymidine kinase</b> is present (resistance = TK mutation)",
        "Influenza antigen shift = major change in HA/NA → pandemic; antigen drift = minor change → epidemic",
    ]))
    e.append(PageBreak())
    return e


def section_dna_viruses():
    e = []
    e.append(h1("CHAPTER 4: DNA VIRUSES — NEET MDS HIGH YIELD"))
    e.append(hr())

    # ── HERPESVIRUS ──
    e.append(h2("4.1 Herpesviruses"))
    e.append(bullet("Family: <b>Herpesviridae</b> | Envelope: Yes | Symmetry: Icosahedral | Genome: dsDNA linear"))
    e.append(bullet("Unique feature: <b>Latency</b> — virus hides in nerve ganglia, reactivated by stress/immunosuppression"))
    e.append(bullet("Tegument: unique layer between capsid and envelope — contains virion host shutoff (vhs) proteins"))
    e.append(sp(4))
    headers = ["Virus", "Primary Site", "Latency Site", "Disease", "Key Drug"]
    rows = [
        ["HSV-1",  "Oral mucosa",    "Trigeminal ganglion", "Cold sores, herpetic gingivostomatitis, encephalitis", "Acyclovir"],
        ["HSV-2",  "Genital mucosa", "Sacral ganglia (S2-S4)", "Genital herpes, neonatal herpes", "Acyclovir"],
        ["VZV",    "Skin/mucosa",    "Dorsal root ganglia", "Chickenpox (1°), Shingles/Zoster (2°)", "Acyclovir, Valacyclovir"],
        ["EBV",    "B lymphocytes",  "B lymphocytes",       "Infectious mononucleosis, Burkitt's lymphoma, NPC", "Supportive"],
        ["CMV",    "Epithelial cells","Monocytes/macrophages","Congenital CMV, retinitis (AIDS), pneumonitis", "Ganciclovir"],
        ["HHV-6",  "T cells (CD4)", "Monocytes",           "Roseola infantum (6th disease, exanthem subitum)", "Ganciclovir"],
        ["HHV-7",  "T cells",       "T cells",             "Roseola infantum (some cases)", "—"],
        ["HHV-8",  "Endothelium",   "B cells",             "Kaposi's sarcoma (AIDS), PEL, Castleman disease", "—"],
    ]
    e.append(dtable(headers, rows, col_widths=[1.5*cm, 2.8*cm, 2.8*cm, 4.5*cm, PAGE_W-4.2*cm-1.5*cm-2.8*cm-2.8*cm-4.5*cm]))
    e.append(sp(4))
    e.append(mnemonic_box("'<b>CVE BHH KKK</b>' or '<b>1,2,3,4,5,6,7,8</b>'",
        "HSV1, HSV2, VZV(3), EBV(4), CMV(5), HHV6, HHV7, HHV8. "
        "Cancers: EBV→Burkitt's lymphoma (c-myc translocation t(8;14)), HHV8→Kaposi's"))
    e.append(sp(4))
    e.append(mcq_box([
        "Downey cells (atypical lymphocytes) = hallmark of <b>EBV infectious mononucleosis</b>",
        "Paul-Bunnell (Monospot) test detects <b>heterophile antibodies</b> in EBV",
        "EBV receptor: <b>CD21 (CR2)</b> on B cells",
        "CMV 'owl eye' inclusion bodies in nucleus (Cowdry type A in herpes)",
        "Tzanck smear: multinucleated giant cells with intranuclear inclusions → HSV / VZV",
        "Congenital CMV: most common cause of <b>non-hereditary sensorineural hearing loss</b>",
        "TORCH infections: Toxoplasma, Others, Rubella, <b>CMV</b>, Herpes",
        "Shingles (VZV reactivation) → follows dermatomal distribution",
    ]))
    e.append(sp(4))
    e.append(prev_asked_box([
        "Burkitt's lymphoma — EBV + t(8;14) translocation involving c-myc",
        "Nasopharyngeal carcinoma (NPC) — EBV associated, high in SE Asia",
        "HSV encephalitis → temporal lobe involvement; drug of choice = IV Acyclovir",
        "Neonatal herpes acquired during passage through birth canal (HSV-2)",
        "Ramsay Hunt syndrome = VZV reactivation in geniculate ganglion of facial nerve (CNVII)",
    ]))
    e.append(sp(6))

    # ── ADENOVIRUS ──
    e.append(h2("4.2 Adenovirus"))
    e.append(bullet("Family: <b>Adenoviridae</b> | No envelope | Icosahedral | dsDNA | 252 capsomeres"))
    e.append(bullet("252 capsomeres = <b>240 hexons</b> (faces) + <b>12 pentons</b> (vertices)"))
    e.append(bullet("Fiber antigen on penton = attaches to receptor, causes haemagglutination and cytotoxicity"))
    e.append(bullet("Hexon = group-specific antigen; Fiber = type-specific antigen"))
    e.append(sp(4))
    e.append(mcq_box([
        "Adenovirus causes: <b>ARD</b> (acute respiratory disease), <b>Pharyngoconjunctival fever</b>, epidemic keratoconjunctivitis, enteric disease",
        "Types 40 &amp; 41: enteric adenoviruses — gastroenteritis in children",
        "Types 3 &amp; 7: acute respiratory disease (military recruits)",
        "Adenovirus can transform cells (oncogenic in rodents) — NOT proven in humans",
        "Penton fiber = toxic to cells — responsible for CPE",
        "Adenovirus is used as <b>vaccine vector</b> (e.g., COVID-19 vaccines)",
    ]))
    e.append(sp(6))

    # ── POXVIRUS ──
    e.append(h2("4.3 Poxvirus"))
    e.append(star("Largest virus — visible under light microscope (~300 nm)"))
    e.append(star("ONLY DNA virus that replicates entirely in the CYTOPLASM"))
    e.append(bullet("Complex symmetry (brick-shaped) | Enveloped | dsDNA linear"))
    e.append(bullet("Contains its own DNA-dependent RNA polymerase (transcribes in cytoplasm)"))
    e.append(sp(4))
    headers = ["Poxvirus", "Disease", "Special Feature"]
    rows = [
        ["Variola (Smallpox)",  "Smallpox — eradicated 1980 (WHO)",        "Last natural case: Somalia 1977; Guarnieri bodies (cytoplasm inclusion)"],
        ["Vaccinia",            "Vaccine strain — no natural disease",       "Used in Jennerian vaccination; source of 1st vaccine (Jenner 1796)"],
        ["Molluscum contagiosum","Pearly umbilicated papules",              "Common in children &amp; HIV patients; Henderson-Paterson bodies"],
        ["Orf virus",           "Ecthyma contagiosum (hands)",              "From sheep/goats — zoonosis"],
        ["Cowpox",              "Pox on cow's udder → human vesicles",      "Used by Jenner for original vaccination"],
        ["Monkeypox",           "Smallpox-like, rash including palms/soles","Zoonosis (rodents); B-virus; 2022 global outbreak"],
    ]
    e.append(dtable(headers, rows, col_widths=[3.2*cm, 3.5*cm, PAGE_W-4.2*cm-3.2*cm-3.5*cm]))
    e.append(sp(4))
    e.append(mcq_box([
        "Smallpox eradicated by <b>WHO on October 26, 1979</b>; declared eradicated in 1980",
        "Smallpox vaccine = live attenuated <b>Vaccinia virus</b>",
        "Guarnieri bodies = cytoplasmic inclusions in smallpox (also called Paschen bodies for elementary bodies)",
        "Molluscum contagiosum: <b>Henderson-Paterson bodies</b> (intracytoplasmic inclusions)",
        "Poxvirus uses its own RNA polymerase — does NOT need host cell nucleus",
    ]))
    e.append(sp(6))

    # ── HPV ──
    e.append(h2("4.4 Human Papillomavirus (HPV)"))
    e.append(bullet("Family: <b>Papillomaviridae</b> | No envelope | Icosahedral | dsDNA circular"))
    e.append(bullet("Over 200 HPV types; <b>oncogenic types: 16, 18</b> (E6, E7 proteins inactivate p53 and Rb)"))
    e.append(sp(4))
    headers = ["HPV Type", "Disease / Association"]
    rows = [
        ["HPV 1, 2, 4",   "Common warts (Verruca vulgaris)"],
        ["HPV 3, 10",     "Flat warts (Verruca plana)"],
        ["HPV 6, 11",     "Genital warts (Condylomata acuminata), Laryngeal papilloma (low risk)"],
        ["HPV 16, 18",    "Cervical carcinoma, oropharyngeal carcinoma (HIGH RISK)"],
        ["HPV 31, 33, 45","Cervical intraepithelial neoplasia (high risk)"],
        ["HPV 5, 8",      "Epidermodysplasia verruciformis"],
    ]
    e.append(dtable(headers, rows, col_widths=[2.5*cm, PAGE_W-4.2*cm-2.5*cm]))
    e.append(sp(4))
    e.append(star("Koilocytes (perinuclear halo cells) = cytopathic effect of HPV — diagnostic in Pap smear"))
    e.append(mcq_box([
        "HPV 16 &amp; 18 are the MOST common cause of cervical cancer worldwide",
        "HPV vaccine: <b>Gardasil 9</b> (9-valent: 6,11,16,18,31,33,45,52,58) and Cervarix (bivalent: 16,18)",
        "E6 protein → degrades <b>p53</b> tumor suppressor",
        "E7 protein → degrades <b>Rb (retinoblastoma)</b> protein",
        "HPV cannot be grown in standard cell culture — detected by PCR/in situ hybridization",
    ]))
    e.append(sp(6))

    # ── HBV ──
    e.append(h2("4.5 Hepatitis B Virus (HBV)"))
    e.append(bullet("Family: <b>Hepadnaviridae</b> | Enveloped | Icosahedral | dsDNA circular (partially) | Uses reverse transcriptase"))
    e.append(bullet("Dane particle = complete virion (42 nm) | Filamentous and spherical particles = non-infectious (excess HBsAg)"))
    e.append(sp(4))
    headers = ["Antigen/Antibody", "Significance"]
    rows = [
        ["HBsAg (Surface Ag)",   "First to appear; indicates active infection or carrier state"],
        ["Anti-HBs",             "Appears after recovery or vaccination — indicates immunity"],
        ["HBcAg (Core Ag)",      "Found only in hepatocytes (not in serum)"],
        ["Anti-HBc IgM",         "First antibody to appear; indicates ACUTE infection"],
        ["Anti-HBc IgG",         "Indicates past infection or chronic infection"],
        ["HBeAg (e Antigen)",    "High infectivity; indicates active viral replication"],
        ["Anti-HBe",             "Low infectivity; appears as replication decreases"],
        ["HBV DNA",              "Most sensitive marker for active replication"],
        ["'Window period'",      "HBsAg gone, Anti-HBs not yet appeared — only Anti-HBc IgM positive"],
    ]
    e.append(dtable(headers, rows, col_widths=[4*cm, PAGE_W-4.2*cm-4*cm]))
    e.append(sp(4))
    e.append(mnemonic_box("'<b>HBsAg = Healthy Blood Suspect</b>'",
        "HBsAg positive = may be acute, chronic, or carrier. "
        "Seroconversion: HBsAg → Anti-HBs = recovery/immunity"))
    e.append(mcq_box([
        "HBV: only <b>DNA virus</b> that uses reverse transcriptase (like a retrovirus)",
        "Most sensitive marker of HBV replication: <b>HBV DNA by PCR</b>",
        "Vaccine is against HBsAg (recombinant yeast-derived)",
        "HBV + HDV (hepatitis D) → superinfection or coinfection → <b>worse prognosis</b>",
        "Chronic HBV → <b>hepatocellular carcinoma</b> (via HBx protein + cirrhosis)",
        "Ground glass hepatocytes = chronic HBV (HBsAg in smooth ER)",
    ]))
    e.append(prev_asked_box([
        "Marker present in both acute and chronic HBV: <b>HBsAg</b>",
        "Best marker for infectivity: <b>HBeAg</b>",
        "Only marker present in window period: <b>Anti-HBc IgM</b>",
        "HBV incubation period: 45–180 days (average 90 days — longest among hepatitis viruses)",
    ]))
    e.append(PageBreak())
    return e


def section_rna_viruses():
    e = []
    e.append(h1("CHAPTER 5: RNA VIRUSES — NEET MDS HIGH YIELD"))
    e.append(hr())

    # ── INFLUENZA ──
    e.append(h2("5.1 Influenza Virus"))
    e.append(bullet("Family: <b>Orthomyxoviridae</b> | Enveloped | Helical | ss(-)RNA | <b>8 segments</b>"))
    e.append(bullet("Two major surface antigens: <b>Hemagglutinin (HA)</b> and <b>Neuraminidase (NA)</b>"))
    e.append(bullet("Types: A (most virulent, causes pandemics), B (epidemics), C (mild, no NA)"))
    e.append(bullet("Matrix (M) protein = type-specific (distinguishes A,B,C); HA/NA = subtype-specific"))
    e.append(sp(4))
    e.append(flow_box([
        "ANTIGEN DRIFT (minor change):",
        "  Point mutations in HA/NA genes → slightly different strains",
        "  → Causes seasonal EPIDEMICS every year",
        "  ↓",
        "ANTIGEN SHIFT (major change):",
        "  Reassortment of RNA segments between two different Influenza A strains",
        "  (e.g., human + avian/swine) → completely new HA/NA subtype",
        "  → Causes PANDEMIC (global spread — no existing immunity)",
    ]))
    e.append(sp(4))
    e.append(mcq_box([
        "Influenza A subtypes: 18 HA (H1-H18), 11 NA (N1-N11) types",
        "Pandemic strains: H1N1 (1918 Spanish flu — deadliest), H2N2 (1957 Asian flu), H3N2 (1968 Hong Kong), H1N1 (2009 Swine flu)",
        "RNA virus that replicates in nucleus: <b>Influenza</b> (unique!)",
        "Influenza drugs: <b>Oseltamivir (NA inhibitor)</b>, Zanamivir, Amantadine (M2 ion channel blocker — Influenza A only)",
        "Haemagglutination (HA) function: virus attachment; Neuraminidase (NA): virus release",
        "Amantadine resistance: Influenza B (no M2 protein); also now many Influenza A strains resistant",
    ]))
    e.append(sp(4))
    e.append(prev_asked_box([
        "Antigenic shift → pandemic; antigenic drift → epidemic",
        "Influenza B does NOT undergo antigenic shift (no animal reservoir) — only causes epidemics",
        "Reye's syndrome: associated with <b>aspirin use during influenza/varicella</b> in children",
        "Cold agglutinins: Mycoplasma pneumoniae (not influenza — common confusion!)",
    ]))
    e.append(sp(6))

    # ── PARAMYXOVIRUS ──
    e.append(h2("5.2 Paramyxoviruses"))
    e.append(bullet("Family: <b>Paramyxoviridae</b> | Enveloped | Helical | ss(-)RNA | Non-segmented"))
    e.append(bullet("Largest RNA animal virus"))
    e.append(bullet("Unique: have both <b>hemagglutinin-neuraminidase (HN)</b> and <b>fusion (F) protein</b>"))
    e.append(sp(4))
    headers = ["Virus", "Disease", "Key Feature / Inclusion Body"]
    rows = [
        ["Measles (Morbillivirus)",     "Measles (Rubeola) — 3Cs (Cough, Coryza, Conjunctivitis) + Koplik spots", "Warthin-Finkeldey giant cells; Koplik spots (buccal mucosa) pathognomonic"],
        ["Mumps",                       "Parotitis, orchitis, aseptic meningitis, pancreatitis", "V-antigen (HN), S-antigen (NP); Sterility if bilateral orchitis"],
        ["RSV (Respiratory Syncytial)", "Bronchiolitis in infants — #1 cause; rhinitis in adults", "Syncytia formation; detected by DIF; palivizumab for prophylaxis"],
        ["Parainfluenza",               "Croup (laryngotracheobronchitis) in children; cold in adults", "Types 1-4; Type 1&2 → croup; Type 3 → bronchiolitis"],
        ["Nipah virus",                 "Encephalitis (SE Asia/Bangladesh); high mortality", "Zoonosis from fruit bats via pigs"],
        ["Hendra virus",                "Encephalitis + respiratory (Australia)",               "From fruit bats (flying foxes)"],
        ["HMPV",                        "Bronchiolitis, pneumonia (similar to RSV)",             "Human metapneumovirus"],
    ]
    e.append(dtable(headers, rows, col_widths=[3.5*cm, 4.5*cm, PAGE_W-4.2*cm-3.5*cm-4.5*cm]))
    e.append(sp(4))
    e.append(mnemonic_box("'<b>3 Cs of Measles</b>' + Koplik's spots",
        "<b>C</b>ough + <b>C</b>oryza + <b>C</b>onjunctivitis = Prodrome of Measles. "
        "Koplik spots appear on <b>buccal mucosa opposite lower molars</b> — pathognomonic, appear BEFORE rash"))
    e.append(mcq_box([
        "Measles (Rubeola) NOT same as Rubella (German measles) — different family!",
        "Koplik spots = pathognomonic for <b>Measles</b>",
        "Subacute sclerosing panencephalitis (SSPE) = late CNS complication of measles",
        "Mumps: most common cause of viral <b>orchitis</b>; post-pubertal → sterility risk",
        "RSV = most common cause of <b>bronchiolitis and pneumonia in infants &lt;2 years</b>",
        "Palivizumab (anti-RSV monoclonal Ab) — prophylaxis for high-risk infants",
    ]))
    e.append(sp(6))

    # ── RABIES ──
    e.append(h2("5.3 Rabies Virus"))
    e.append(bullet("Family: <b>Rhabdoviridae</b> | Enveloped | Helical | ss(-)RNA | Bullet-shaped (pathognomonic morphology)"))
    e.append(bullet("Animal reservoir: dogs (most common worldwide), bats (Americas)"))
    e.append(star("Negri bodies = intracytoplasmic eosinophilic inclusion bodies in <b>Purkinje cells</b> and pyramidal cells of <b>hippocampus (Ammon's horn)</b>"))
    e.append(sp(4))
    e.append(flow_box([
        "Inoculation (bite) → Virus replicates at bite site in muscle",
        "↓ (travels centripetally via peripheral nerves — NOT blood)",
        "Reaches spinal cord/brain → FURIOUS or DUMB rabies",
        "↓ (travels centrifugally via nerves to salivary glands)",
        "Virus shed in saliva → transmission to next host",
        "Incubation: 1–3 months (can be 7 days to 7 years)",
        "Prodrome: pain/paresthesia at bite site (FIRST symptom after incubation)",
    ]))
    e.append(sp(4))
    e.append(mcq_box([
        "Negri bodies: eosinophilic, intracytoplasmic inclusions in hippocampus &amp; Purkinje cells",
        "Negri bodies ABSENT in ~20% of rabies cases — NOT 100% sensitive",
        "Virus travels to CNS via <b>peripheral nerves (axoplasmic flow)</b> — not blood",
        "Negri body-based diagnosis: Seller's stain (histology), FAT = gold standard",
        "Post-exposure prophylaxis (PEP): wound washing + HRIG (Human Rabies Immunoglobulin) + Rabies vaccine",
        "Pre-exposure: 3 doses on days 0, 7, 21 or 28",
        "No established treatment once symptomatic — near 100% fatality",
    ]))
    e.append(prev_asked_box([
        "Negri bodies in <b>hippocampus (Ammon's horn)</b> = rabies hallmark",
        "Rabies: only the G (glycoprotein) spike on envelope is protective antigen",
        "Milwaukee protocol: induced coma — only documented survivors without vaccine",
        "Hydrophobia (aerophobia) = fear of water/air = hallmark of furious rabies",
    ]))
    e.append(sp(6))

    # ── POLIOVIRUS ──
    e.append(h2("5.4 Poliovirus"))
    e.append(bullet("Family: <b>Picornaviridae</b> | Non-enveloped | Icosahedral | ss(+)RNA"))
    e.append(bullet("3 serotypes: <b>Type 1 (Mahoney) — most epidemic; Type 2 (MEF-1) — eradicated 2015; Type 3 (Saukett)</b>"))
    e.append(bullet("Spread: <b>Faecal-oral route</b> (enterovirus)"))
    e.append(bullet("Pathogenesis: intestine → blood (viraemia) → anterior horn cells of spinal cord → flaccid paralysis"))
    e.append(sp(4))
    e.append(flow_box([
        "Poliovirus enters via mouth → replicates in oropharynx &amp; gut",
        "↓ 90-95% → subclinical infection (no symptoms)",
        "↓ ~5% → minor illness (fever, sore throat, malaise)",
        "↓ 1-2% → aseptic meningitis (non-paralytic polio)",
        "↓ &lt;1% → PARALYTIC POLIO (destruction of anterior horn motor neurons)",
        "      → Bulbar polio (cranial nerve involvement) = MOST SERIOUS form",
    ]))
    e.append(sp(4))
    e.append(mcq_box([
        "Poliovirus vaccine: <b>OPV (Sabin)</b> = live attenuated oral; <b>IPV (Salk)</b> = killed injected",
        "OPV can cause VAPP (vaccine-associated paralytic polio) — 1 in ~1 million doses",
        "India declared polio-free by WHO in <b>March 2014</b>",
        "Polio Type 2 wild virus globally eradicated in <b>2015</b>",
        "Receptor for poliovirus: <b>PVR (poliovirus receptor, CD155)</b>",
        "Paralysis is <b>FLACCID</b> (LMN type), asymmetric, no sensory loss",
    ]))
    e.append(sp(6))

    # ── HIV ──
    e.append(h2("5.5 HIV (Human Immunodeficiency Virus)"))
    e.append(bullet("Family: <b>Retroviridae</b> | Enveloped | Icosahedral core | ss(+)RNA (diploid — 2 copies) | Reverse transcriptase"))
    e.append(bullet("Two types: <b>HIV-1</b> (global pandemic) and <b>HIV-2</b> (West Africa, less virulent)"))
    e.append(bullet("Receptor: <b>gp120 binds CD4</b> (primary) + <b>CCR5</b> (macrophage-tropic, M-tropic) or <b>CXCR4</b> (T-tropic)"))
    e.append(sp(4))
    e.append(flow_box([
        "HIV gp120 binds CD4 on T-helper cells/macrophages",
        "↓ Co-receptor (CCR5 or CXCR4) binding",
        "↓ gp41 mediates fusion of viral and cell membranes",
        "↓ RNA → (Reverse Transcriptase) → dsDNA",
        "↓ dsDNA → (Integrase) → Provirus integrated into host chromosome",
        "↓ Host RNA pol transcribes proviral genes → viral mRNA + genomic RNA",
        "↓ Gag, Pol, Env polyproteins → (Protease) → cleaved into functional proteins",
        "↓ Assembly + Budding → new virions",
    ]))
    e.append(sp(4))
    e.append(mcq_box([
        "CD4 count &lt;200 cells/µL = AIDS-defining (CDC criteria)",
        "Viral Load = most sensitive early marker; p24 antigen = earliest antigen detected",
        "Western blot = confirmatory test for HIV (ELISA = screening)",
        "Window period: 3–6 weeks (p24 antigen detectable); antibody detectable by 3 months",
        "AIDS-defining illnesses: PCP (CD4 &lt;200), CMV retinitis (&lt;50), MAC (&lt;50), Cryptococcal meningitis",
        "gp120 &amp; gp41 = surface glycoproteins (from gp160 precursor) — target of entry inhibitors",
        "CCR5 mutation (Δ32 deletion) → resistance to HIV-1 M-tropic strains (homozygous = immune)",
    ]))
    e.append(prev_asked_box([
        "First line ART: <b>2 NRTIs + 1 integrase inhibitor</b> (e.g., TDF + 3TC/FTC + DTG)",
        "Mechanism: Zidovudine (AZT) = NRTI; Nevirapine = NNRTI; Raltegravir = Integrase inhibitor; Ritonavir = Protease inhibitor; Maraviroc = CCR5 antagonist; Enfuvirtide = Fusion inhibitor",
        "HIV genome: 5'-LTR-<b>gag-pol-env</b>-LTR-3'",
        "p24 antigen: earliest specific marker of HIV infection",
    ]))
    e.append(sp(6))

    # ── DENGUE ──
    e.append(h2("5.6 Dengue Virus"))
    e.append(bullet("Family: <b>Flaviviridae</b> | Enveloped | Icosahedral | ss(+)RNA | Arbovirus (Aedes aegypti vector)"))
    e.append(bullet("4 serotypes: DENV-1, 2, 3, 4 — infection with one does NOT protect against others"))
    e.append(star("Dengue Haemorrhagic Fever (DHF) and Dengue Shock Syndrome (DSS) occur due to <b>antibody-dependent enhancement (ADE)</b> in secondary infection"))
    e.append(sp(4))
    e.append(mcq_box([
        "Vector: <b>Aedes aegypti</b> (day-biting mosquito, breeds in clean stagnant water)",
        "NS1 antigen: earliest antigen detectable in dengue (days 1-9)",
        "Tourniquet test (Rumpel-Leede) = positive in dengue (capillary fragility)",
        "Thrombocytopenia + haemoconcentration = hallmarks of DHF",
        "No specific antiviral — treatment is supportive (fluid resuscitation)",
        "Secondary infection with different serotype → risk of DHF/DSS via ADE",
    ]))
    e.append(sp(6))

    # ── HEPATITIS VIRUSES ──
    e.append(h2("5.7 Hepatitis Viruses — Comparison"))
    headers = ["Feature", "HAV", "HBV", "HCV", "HDV", "HEV"]
    rows = [
        ["Family",        "Picorna", "Hepadna", "Flavi (Hepaci)", "Deltaviridae", "Calici (Hepevirus)"],
        ["Genome",        "ssRNA(+)", "dsDNA+RT", "ssRNA(+)",    "ssRNA(circ)",  "ssRNA(+)"],
        ["Envelope",      "No",      "Yes",      "Yes",          "Yes (HBsAg)",  "No"],
        ["Transmission",  "Faecal-oral", "Parenteral/sexual/vertical", "Parenteral", "Parenteral (needs HBV)", "Faecal-oral"],
        ["Incubation",    "15-45 d", "45-180 d", "14-180 d",     "Co/superinfection", "15-60 d"],
        ["Chronicity",    "Never",   "5-10%",    "70-85%",       "Worse with HBV", "Never (except pregnancy)"],
        ["Vaccine",       "Yes (killed)", "Yes (recombinant)", "No", "Prevented by HBV vax", "Yes (China only)"],
        ["Cancer risk",   "No",      "HCC",      "HCC",          "HCC (with HBV)", "No"],
    ]
    e.append(dtable(headers, rows, col_widths=[2.5*cm, 2.2*cm, 2.2*cm, 2.2*cm, 2.5*cm, PAGE_W-4.2*cm-2.5*cm-2.2*cm-2.2*cm-2.2*cm-2.5*cm]))
    e.append(sp(4))
    e.append(mnemonic_box("'<b>HAV HEV = fecal-oral; HBV HCV HDV = parenteral</b>'",
        "A and E are faecal-oral — think 'A&amp;E = Alimentary Entry'. "
        "E in pregnancy → 20% mortality (HEV genotype 1 &amp; 2)"))
    e.append(mcq_box([
        "Highest chronicity: <b>HCV (70-85%)</b> — most likely to become chronic",
        "HCV treatment: <b>Direct-acting antivirals (DAAs)</b> — Sofosbuvir + Ledipasvir/Daclatasvir (90-95% cure)",
        "HEV in pregnancy: 20% maternal mortality (genotype 1)",
        "HDV is a <b>defective satellite virus</b> — cannot replicate without HBV",
        "HCV genotype 1 = most common worldwide; genotype 3 = most common in India",
    ]))
    e.append(PageBreak())
    return e


def section_other_viruses():
    e = []
    e.append(h1("CHAPTER 6: OTHER IMPORTANT VIRUSES"))
    e.append(hr())

    e.append(h2("6.1 Rotavirus"))
    e.append(bullet("Family: <b>Reoviridae</b> | Non-enveloped | Icosahedral | dsRNA | <b>11 segments</b> (10 proteins)"))
    e.append(bullet("Most common cause of <b>severe diarrhoea in children</b> under 5 worldwide"))
    e.append(bullet("Wheel-like morphology on EM (Latin: rota = wheel)"))
    e.append(bullet("5 groups (A–E); Group A causes most human disease"))
    e.append(star("Rotavirus = most common cause of infantile gastroenteritis (dehydrating diarrhoea) worldwide"))
    e.append(mcq_box([
        "Rotavirus detected by: ELISA (most common), EM, PAGE (11 bands = characteristic)",
        "Vaccine: <b>Rotarix (RV1)</b> and <b>RotaTeq (RV5)</b> — live attenuated oral vaccines",
        "Rotavirus does NOT invade bloodstream — acts by enterotoxin (NSP4) → secretory diarrhoea",
        "Treatment: oral rehydration (no specific antiviral)",
    ]))
    e.append(sp(4))

    e.append(h2("6.2 Coronaviruses"))
    e.append(bullet("Family: <b>Coronaviridae</b> | Enveloped | Helical | ss(+)RNA | <b>Largest RNA genome</b> (~30 kb)"))
    e.append(bullet("Crown-like spikes (corona = crown in Latin) give name"))
    e.append(bullet("Spike (S) protein binds ACE2 receptor on host cells"))
    e.append(sp(4))
    headers = ["Coronavirus", "Disease", "Mortality / Key Feature"]
    rows = [
        ["OC43, 229E, NL63, HKU1", "Common cold",                "~15% of common colds"],
        ["SARS-CoV (2002)",         "SARS (Severe Acute RS)",    "9.6% mortality; spread Asia 2002-2003"],
        ["MERS-CoV (2012)",         "MERS (Middle East RS)",     "35% mortality; camel reservoir; DPP4 receptor"],
        ["SARS-CoV-2 (2019)",       "COVID-19",                  "Pandemic 2020-2022; ACE2 receptor; variants: Alpha→Delta→Omicron"],
    ]
    e.append(dtable(headers, rows, col_widths=[4*cm, 3.5*cm, PAGE_W-4.2*cm-4*cm-3.5*cm]))
    e.append(sp(4))
    e.append(mcq_box([
        "SARS-CoV-2 receptor: <b>ACE2</b> (angiotensin-converting enzyme 2)",
        "MERS-CoV receptor: <b>DPP4</b> (dipeptidyl peptidase 4)",
        "COVID-19 vaccines: mRNA (Pfizer-BioNTech, Moderna), Viral vector (AstraZeneca, Janssen), Inactivated (Covaxin, Sinovac)",
        "Coronaviruses have the largest RNA genome of any known RNA virus (~26-32 kb)",
    ]))
    e.append(sp(6))

    e.append(h2("6.3 Rubella Virus"))
    e.append(bullet("Family: <b>Togaviridae</b> | Enveloped | Icosahedral | ss(+)RNA"))
    e.append(bullet("Also called <b>German measles</b> or 3-day measles"))
    e.append(bullet("Mild disease in children/adults but <b>TERATOGENIC</b> — devastating if acquired in 1st trimester"))
    e.append(star("Congenital Rubella Syndrome (CRS): <b>Cataracts + Congenital heart disease (PDA/VSD) + Sensorineural deafness</b>"))
    e.append(mcq_box([
        "Rubella: greatest teratogenic risk in <b>first trimester</b> (1st month → 80% risk)",
        "Blueberry muffin rash = congenital rubella (dermal erythropoiesis)",
        "Vaccine: MMR (Measles-Mumps-Rubella) — live attenuated, NOT for pregnant women",
        "Forchheimer spots (soft palate petechiae) in rubella (vs Koplik spots in measles)",
        "Rubella NOT transmitted by mosquito — spread by respiratory droplets",
    ]))
    e.append(sp(6))

    e.append(h2("6.4 Arboviruses — Arthropod-Borne Viruses"))
    headers = ["Virus", "Vector", "Disease", "Reservoir"]
    rows = [
        ["Dengue (Flavivirus)",          "Aedes aegypti",        "Dengue fever / DHF / DSS",            "Humans, primates"],
        ["Yellow Fever (Flavivirus)",    "Aedes aegypti",        "Yellow fever (hepatitis, haemorrhage)", "Primates"],
        ["Chikungunya (Togavirus)",      "Aedes aegypti/albopictus","Arthritis + fever",              "Primates"],
        ["Zika (Flavivirus)",            "Aedes aegypti",        "Microcephaly (congenital)",            "Primates"],
        ["JEV (Flavivirus)",             "Culex tritaeniorhynchus","Japanese encephalitis",             "Pigs, wading birds"],
        ["West Nile (Flavivirus)",       "Culex sp.",            "Encephalitis / asymptomatic",         "Birds"],
        ["CCHF (Nairovirus/Bunya)",      "Hyalomma tick",        "Crimean-Congo haemorrhagic fever",    "Livestock, hares"],
        ["Kyasanur Forest Disease (KFD)","Haemaphysalis tick",   "KFD (India — Karnataka)",             "Rodents, monkeys"],
    ]
    e.append(dtable(headers, rows, col_widths=[4*cm, 3.5*cm, 3.5*cm, PAGE_W-4.2*cm-4*cm-3.5*cm-3.5*cm]))
    e.append(sp(4))
    e.append(mnemonic_box("'<b>Aedes = Day-biting; Culex = Night-biting</b>'",
        "Aedes: Dengue, Yellow Fever, Chikungunya, Zika — all day-biters (breed in stagnant clean water). "
        "Culex: JEV, West Nile — night-biters"))
    e.append(mcq_box([
        "Yellow fever: only arbovirus causing viral <b>hepatitis</b>; vaccine = 17D live attenuated",
        "Zika virus → congenital microcephaly + Guillain-Barré syndrome",
        "KFD (Kyasanur Forest Disease) = tick-borne viral haemorrhagic fever in Karnataka, India",
        "JEV = most common cause of viral encephalitis in Asia",
    ]))
    e.append(PageBreak())
    return e


def section_diagnosis():
    e = []
    e.append(h1("CHAPTER 7: LABORATORY DIAGNOSIS OF VIRAL INFECTIONS"))
    e.append(hr())

    e.append(h2("7.1 Methods of Viral Diagnosis"))
    headers = ["Method", "Principle", "Examples / Use"]
    rows = [
        ["Electron Microscopy", "Direct visualization of virus morphology", "Rotavirus (wheel), Poxvirus (brick), Rabies (bullet), Norovirus"],
        ["Cell Culture (CPE)", "Virus replication causes cytopathic effect", "HSV (ballooning degeneration), Adeno (grape clusters), CMV (focal degeneration)"],
        ["Inclusion Bodies",   "Intracellular aggregates of viral material", "See table below"],
        ["Serology (ELISA)",   "Detect antibody or antigen",               "Anti-HBs, HBsAg, Anti-HIV (screening), NS1 dengue"],
        ["PCR / RT-PCR",       "Amplify viral nucleic acid — most sensitive","HIV viral load, HCV, CMV, HSV encephalitis, COVID-19"],
        ["Hemagglutination (HA)","Virus agglutinates RBCs",               "Influenza, Paramyxoviruses, Rubella"],
        ["Neutralization test", "Antibody neutralizes virus infectivity",   "Gold standard for serotyping"],
        ["CFT (Complement fixation)", "Antibody + complement + indicator system", "Arbovirus serology, Herpes"],
        ["Western Blot",        "Electrophoresis + antibody detection",     "Confirmatory test for HIV"],
        ["Immunofluorescence (FAT)", "Fluorescent antibody technique",     "Rabies (gold standard), RSV, CMV"],
    ]
    e.append(dtable(headers, rows, col_widths=[3.5*cm, 4.5*cm, PAGE_W-4.2*cm-3.5*cm-4.5*cm]))
    e.append(sp(6))

    e.append(h2("7.2 Viral Inclusion Bodies — High Yield Table"))
    headers = ["Virus", "Location", "Inclusion Body Name", "Stain / Feature"]
    rows = [
        ["Rabies",               "Cytoplasm",         "Negri bodies",              "Eosinophilic; hippocampus &amp; Purkinje cells"],
        ["Smallpox (Poxvirus)",  "Cytoplasm",         "Guarnieri / Paschen bodies","Cytoplasmic; B bodies near nucleus"],
        ["Molluscum contagiosum","Cytoplasm",          "Henderson-Paterson bodies", "Large intracytoplasmic; push nucleus aside"],
        ["CMV",                  "Nucleus (+ cyto)",  "Owl-eye inclusion",         "Large intranuclear (Cowdry A) + cytoplasmic"],
        ["HSV / VZV",            "Nucleus",           "Cowdry type A",             "Intranuclear eosinophilic; multinucleated giant cells"],
        ["Adenovirus",           "Nucleus",           "Smudge cells / Cowdry B",   "Basophilic intranuclear inclusions"],
        ["Measles",              "Nucleus + cytoplasm","Warthin-Finkeldey cells",  "Multinucleated giant cells in lymphoid tissue"],
        ["Yellow fever",         "Cytoplasm",          "Councilman bodies",         "Acidophilic necrotic hepatocytes (not virus-specific)"],
        ["Reovirus / Rotavirus", "Cytoplasm",          "Viral factories",           "Perinuclear inclusion bodies"],
        ["Chlamydia (not virus)", "Cytoplasm",         "Halberstaedter-Prowazek",   "Inclusion bodies in epithelial cells"],
    ]
    e.append(dtable(headers, rows, col_widths=[3*cm, 2.5*cm, 3.5*cm, PAGE_W-4.2*cm-3*cm-2.5*cm-3.5*cm]))
    e.append(sp(4))
    e.append(star("Inclusion bodies are ALWAYS asked in NEET MDS — memorize location (nucleus vs cytoplasm) + staining"))
    e.append(prev_asked_box([
        "Negri bodies → Rabies; Cowdry A → HSV/VZV/CMV (intranuclear); Guarnieri → Smallpox (cytoplasmic)",
        "Henderson-Paterson bodies → Molluscum contagiosum (most common histology MCQ)",
        "Owl-eye inclusions → CMV (Cytomegalovirus)",
        "Warthin-Finkeldey giant cells → MEASLES (in lymphoid tissue/tonsils)",
    ]))
    e.append(PageBreak())
    return e


def section_antiviral():
    e = []
    e.append(h1("CHAPTER 8: ANTIVIRAL DRUGS"))
    e.append(hr())
    e.append(h2("8.1 Antiviral Drugs — Mechanisms"))
    headers = ["Drug", "Mechanism", "Target Virus"]
    rows = [
        ["Acyclovir",          "Inhibits viral DNA polymerase (after TK phosphorylation)", "HSV-1, HSV-2, VZV"],
        ["Ganciclovir",        "Inhibits viral DNA polymerase",                            "CMV (also HSV)"],
        ["Foscarnet",          "Direct viral DNA pol inhibitor (no TK needed)",            "CMV, Acyclovir-resistant HSV"],
        ["Cidofovir",          "Nucleotide analog — viral DNA pol inhibitor",              "CMV, Poxvirus, Adenovirus"],
        ["Zidovudine (AZT)",   "NRTI — chain terminator of reverse transcriptase",        "HIV"],
        ["Tenofovir (TDF)",    "NRTI (nucleotide analog)",                                "HIV, HBV"],
        ["Lamivudine (3TC)",   "NRTI",                                                    "HIV, HBV"],
        ["Efavirenz, Nevirapine","NNRTI — non-competitive RT inhibitor",                  "HIV"],
        ["Raltegravir",        "Integrase inhibitor",                                     "HIV"],
        ["Ritonavir/Lopinavir","Protease inhibitor",                                      "HIV"],
        ["Maraviroc",          "CCR5 antagonist (entry inhibitor)",                       "HIV (CCR5-tropic)"],
        ["Enfuvirtide (T-20)", "Fusion inhibitor (gp41 binding)",                        "HIV"],
        ["Oseltamivir (Tamiflu)","Neuraminidase inhibitor",                              "Influenza A &amp; B"],
        ["Zanamivir",          "Neuraminidase inhibitor (inhaled)",                       "Influenza A &amp; B"],
        ["Amantadine/Rimantadine","M2 ion channel blocker",                              "Influenza A only"],
        ["Ribavirin",          "Guanosine analog — broad spectrum",                      "HCV, RSV, Lassa, Hantavirus"],
        ["Sofosbuvir",         "NS5B polymerase inhibitor (DAA)",                        "HCV (all genotypes)"],
        ["Interferon-alpha",   "Immunomodulatory + antiviral signalling",               "HBV, HCV (older regimen)"],
    ]
    e.append(dtable(headers, rows, col_widths=[3.5*cm, 5.5*cm, PAGE_W-4.2*cm-3.5*cm-5.5*cm]))
    e.append(sp(4))
    e.append(mnemonic_box("'<b>NRTI NNRTIs Integrate Protease, Fuse</b>'",
        "Classes of HIV drugs: <b>N</b>RTI → <b>N</b>NRTI → <b>I</b>ntegrase inhibitor → <b>P</b>rotease inhibitor → <b>F</b>usion/entry inhibitors"))
    e.append(mcq_box([
        "Acyclovir MOA: requires viral TK for activation → phosphorylated → inhibits viral DNA pol",
        "Resistance to acyclovir: mutation in viral <b>thymidine kinase (TK)</b> gene → use foscarnet",
        "Ganciclovir toxicity: <b>myelosuppression</b> (most important side effect)",
        "Ribavirin: teratogenic — contraindicated in pregnancy",
        "Sofosbuvir-based regimens: &gt;95% sustained virological response (SVR) in HCV",
    ]))
    e.append(PageBreak())
    return e


def section_oncogenic():
    e = []
    e.append(h1("CHAPTER 9: ONCOGENIC VIRUSES"))
    e.append(hr())
    e.append(body("Several viruses are classified as Group 1 carcinogens by IARC."))
    e.append(sp(4))
    headers = ["Virus", "Family", "Associated Cancer", "Mechanism"]
    rows = [
        ["EBV (HHV-4)",     "Herpes",       "Burkitt's lymphoma, Hodgkin's, NPC, PTLD", "LMP1 mimics CD40; EBNA-2; t(8;14) c-myc"],
        ["HHV-8",           "Herpes",       "Kaposi's sarcoma, PEL, Castleman disease", "VFLIP, cyclin D homolog"],
        ["HPV 16, 18",      "Papilloma",    "Cervical, oropharyngeal, anal, penile cancer","E6 degrades p53; E7 degrades Rb"],
        ["HBV",             "Hepadna",      "Hepatocellular carcinoma (HCC)",           "HBx protein + cirrhosis → insertional mutagenesis"],
        ["HCV",             "Flavi",        "HCC, B-cell lymphoma",                    "Chronic inflammation + cirrhosis"],
        ["HTLV-1",          "Retrovirus",   "Adult T-cell leukaemia/lymphoma (ATLL)",  "Tax protein activates NF-κB"],
        ["HTLV-2",          "Retrovirus",   "Hairy cell leukaemia (weak assoc.)",       "—"],
        ["MCV (Merkel cell polyomavirus)","Polyoma","Merkel cell carcinoma (skin)",     "T antigen inactivates Rb"],
    ]
    e.append(dtable(headers, rows, col_widths=[2.8*cm, 2*cm, 4.5*cm, PAGE_W-4.2*cm-2.8*cm-2*cm-4.5*cm]))
    e.append(sp(4))
    e.append(mnemonic_box("'<b>EBV HKHH</b>' cancer associations",
        "EBV: <b>B</b>urkitt's, <b>H</b>odgkin's, <b>N</b>PC; HPV: <b>C</b>ervical; HBV/HCV: <b>H</b>CC; HTLV-1: <b>ATLL</b>"))
    e.append(mcq_box([
        "Burkitt's lymphoma: t(8;14) — c-myc oncogene + IgH enhancer",
        "EBV in NPC: associated with Cantonese Chinese population in SE Asia",
        "HPV E6 → p53 degradation; HPV E7 → Rb degradation — key carcinogenic mechanism",
        "HTLV-1: transmitted sexually, blood transfusion, breast milk (like HIV)",
        "HTLV-1 Tax protein → constitutive activation of NF-κB → T-cell proliferation",
    ]))
    e.append(PageBreak())
    return e


def section_miscellaneous():
    e = []
    e.append(h1("CHAPTER 10: MISCELLANEOUS — PRIONS, VIROIDS & RAPID REVISION"))
    e.append(hr())
    e.append(h2("10.1 Prions"))
    e.append(bullet("<b>Prion</b> = proteinaceous infectious particle — NO nucleic acid"))
    e.append(bullet("Misfolded PrP^Sc (scrapie isoform) converts normal PrP^C to abnormal form"))
    e.append(bullet("Resistant to: formaldehyde, UV, radiation, boiling, most disinfectants"))
    e.append(bullet("Inactivated by: autoclave at 134°C, NaOH, sodium hypochlorite"))
    headers = ["Prion Disease", "Species", "Key Feature"]
    rows = [
        ["Kuru",                   "Humans (Papua New Guinea)",    "Transmitted by cannibalism (eating brain); 'laughing death'"],
        ["CJD (Creutzfeldt-Jakob)","Humans",                       "Most common human prion disease; rapidly progressive dementia"],
        ["vCJD",                   "Humans",                       "Variant CJD — linked to BSE ('mad cow disease'); younger patients"],
        ["GSS syndrome",           "Humans (familial)",            "Gerstmann-Sträussler-Scheinker syndrome"],
        ["Fatal familial insomnia","Humans (familial)",            "Thalamic degeneration; progressive insomnia"],
        ["Scrapie",                "Sheep/goats",                  "First described prion disease"],
        ["BSE",                    "Cattle",                       "'Mad cow disease' — linked to vCJD in humans"],
    ]
    e.append(dtable(headers, rows, col_widths=[3.5*cm, 3.5*cm, PAGE_W-4.2*cm-3.5*cm-3.5*cm]))
    e.append(sp(4))
    e.append(star("Prions: NO nucleic acid, NO immune response, NO fever, slow/late onset, always FATAL"))
    e.append(sp(4))

    e.append(h2("10.2 Viroids"))
    e.append(bullet("Viroids = naked circular ssRNA — smallest known infectious agent (plant pathogens only)"))
    e.append(bullet("No protein coat (unlike viruses) — just RNA"))
    e.append(bullet("Examples: Potato spindle tuber viroid (PSTVd), Citrus exocortis viroid"))
    e.append(bullet("HDV (hepatitis D) is analogous to a viroid but requires protein coat from HBV"))
    e.append(sp(6))

    e.append(h2("10.3 Rapid Revision — NEET MDS Exam Flashpoints"))
    e.append(mcq_box([
        "Smallest virus: Parvovirus (~20nm) | Largest virus: Poxvirus (~300nm)",
        "Only DNA virus with no envelope: Adeno, Parvo, HPV, Polyoma",
        "Virus causing latent infection: Herpesvirus group (HSV, CMV, EBV, VZV, HHV-6/7/8)",
        "Virus associated with Kaposi's sarcoma: HHV-8",
        "Slow virus diseases: SSPE (measles), PML (JC virus), Kuru/CJD (prion)",
        "Opportunistic viral infections in AIDS: CMV, HSV, VZV, EBV (PTLD), JC virus (PML)",
        "Cold chain maintenance: OPV (most temperature-sensitive) needs -20°C",
        "Live attenuated vaccines: OPV, MMR, YF, BCG, Varicella, Rotavirus",
        "Killed/Inactivated vaccines: IPV (Salk), Rabies (HDCV), Influenza (TIV/QIV), Hepatitis A",
        "Recombinant vaccine: HBV, HPV (Gardasil, Cervarix)",
    ]))
    e.append(sp(4))
    e.append(prev_asked_box([
        "Immunofluorescence (FAT) = gold standard for rabies diagnosis",
        "Negri bodies absent in ~20% of rabies — do NOT rely solely on histology",
        "Cowdry type A inclusion = HSV, VZV, CMV (all herpesviruses)",
        "Progressive multifocal leukoencephalopathy (PML) caused by <b>JC virus</b> (polyomavirus) in AIDS",
        "BK virus → haemorrhagic cystitis in transplant patients",
        "Parvovirus B19 → 5th disease (erythema infectiosum), hydrops fetalis, aplastic crisis in sickle cell",
        "Norwalk/Norovirus → most common cause of epidemic gastroenteritis in adults",
        "Hantavirus → haemorrhagic fever with renal syndrome; Sin Nombre virus → HPS (USA)",
    ]))
    return e


# ── Build document ────────────────────────────────────────────────────────────
def build_pdf():
    doc = SimpleDocTemplate(
        OUTPUT_PATH,
        pagesize=A4,
        leftMargin=2.0*cm, rightMargin=2.0*cm,
        topMargin=2.0*cm, bottomMargin=2.0*cm,
        title="Virology - NEET MDS Notes",
        author="Orris AI Study Notes",
        subject="Microbiology Virology - Ananthanarayan",
    )

    story = []

    # ── Cover ──────────────────────────────────────────────────────────────────
    story += cover_elements()

    # ── Table of Contents (manual) ─────────────────────────────────────────────
    story.append(h1("TABLE OF CONTENTS"))
    story.append(hr())
    toc = [
        ("Chapter 1", "General Properties of Viruses",         "3"),
        ("Chapter 2", "Classification of Viruses",             "5"),
        ("Chapter 3", "Viral Replication",                     "7"),
        ("Chapter 4", "DNA Viruses — NEET MDS High Yield",     "9"),
        ("Chapter 5", "RNA Viruses — NEET MDS High Yield",     "13"),
        ("Chapter 6", "Other Important Viruses",               "18"),
        ("Chapter 7", "Laboratory Diagnosis",                  "20"),
        ("Chapter 8", "Antiviral Drugs",                       "22"),
        ("Chapter 9", "Oncogenic Viruses",                     "24"),
        ("Chapter 10","Prions, Viroids & Rapid Revision",      "25"),
    ]
    toc_data = [[Paragraph(f"<b>{c}</b>", S_TABLE_B),
                 Paragraph(t, S_TABLE_B),
                 Paragraph(f"<b>p.{p}</b>", ParagraphStyle('pn', fontSize=8.5, alignment=TA_CENTER))]
                for c,t,p in toc]
    toc_table = Table(toc_data, colWidths=[2.5*cm, PAGE_W-4.2*cm-2.5*cm-1.5*cm, 1.5*cm])
    toc_table.setStyle(TableStyle([
        ('GRID',       (0,0), (-1,-1), 0.3, colors.HexColor("#BBDEFB")),
        ('BACKGROUND', (0,0), (-1,-1), C_TABLE_ALT),
        ('TOPPADDING',    (0,0), (-1,-1), 4),
        ('BOTTOMPADDING', (0,0), (-1,-1), 4),
        ('LEFTPADDING',   (0,0), (-1,-1), 6),
    ]))
    story.append(toc_table)
    story.append(PageBreak())

    # ── Chapters ───────────────────────────────────────────────────────────────
    story += section_general_properties()
    story += section_classification()
    story += section_replication()
    story += section_dna_viruses()
    story += section_rna_viruses()
    story += section_other_viruses()
    story += section_diagnosis()
    story += section_antiviral()
    story += section_oncogenic()
    story += section_miscellaneous()

    doc.build(story)
    print(f"PDF created: {OUTPUT_PATH}")

if __name__ == "__main__":
    build_pdf()
Running Command

cd /home/daytona/workspace/virology-notes && python generate_virology_pdf.py 2>&…

Editing File

~/virology-notes/generate_virology_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/virology-notes/generate_virology_pdf.py'
Running Command

cd /home/daytona/workspace/virology-notes && python generate_virology_pdf.py 2>&…

Running Command

ls -lh /home/daytona/workspace/virology-notes/Virology_NEET_MDS_Notes.pdf

Running Command

python3 -c "from pypdf import PdfReader; r=PdfReader('/home/daytona/workspace/vi…

Your 26-page Virology NEET MDS PDF is ready for download:

Virology NEET MDS Notes

PDF Document · PDF


Here's what's inside the PDF:
ChapterContents
Ch 1General Properties of Viruses - size, structure, terminology (Virion, Capsid, Peplomers, Defective virus)
Ch 2Classification - Baltimore 7 classes, DNA virus families table, RNA virus families table
Ch 3Viral Replication - full flowchart (Adsorption→Release), eclipse vs latent period, replication sites, viral enzymes
Ch 4DNA Viruses - All 8 Herpesviruses, Adenovirus, Poxvirus, HPV (types + cancer links), HBV (all antigens/antibodies)
Ch 5RNA Viruses - Influenza (antigen drift/shift flowchart), Paramyxoviruses, Rabies (Negri bodies), Poliovirus, HIV (replication flowchart + ART), Dengue, Hepatitis comparison table
Ch 6Rotavirus, Coronaviruses (SARS/MERS/COVID-19), Rubella/CRS, Arboviruses
Ch 7Lab diagnosis methods + Inclusion Bodies table (ALL high-yield types)
Ch 8Antiviral drugs - mechanisms, targets, resistance
Ch 9Oncogenic viruses (EBV, HHV-8, HPV, HBV, HTLV-1)
Ch 10Prions, Viroids + Rapid revision flashpoints
Special features included:
  • Starred bullet points for highest priority facts
  • 📌 Pink "Previously Asked" boxes with actual NEET MDS question patterns
  • Blue MCQ point boxes with examiners' favourite facts
  • 🔤 Yellow mnemonic boxes (HAPPP, 3Cs of measles, HAV/HEV vs HBV/HCV, etc.)
  • 🔄 Green flowchart boxes (viral replication, poliovirus pathogenesis, HIV replication, antigen drift/shift)
  • 📊 Colour-coded comparison tables throughout
This is a shared conversation. Sign in to Orris to start your own chat.