Biochemistry mbbs 1st year, mujhe ( lipid chemistry and metabolism ) give me the 1 to 10 years pyqs related with this chapter direct or indirect question and answer

Reading File
Finding Sources
Searching the Web

MBBS 1st year biochemistry lipid chemistry metabolism PYQ past year questions university exam 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023

Reading Web Page

https://medical-junction.com/biochemistry-previous-year-ques…

Finding Sources
Finding Sources
Searching the Web

MBBS 1st year biochemistry lipid PYQ "beta oxidation" "ketone bodies" "fatty acid synthesis" "cholesterol" question answer university exam India

Finding Sources
Finding Sources
Reading File
Finding Sources
Ab mere paas sufficient information hai. Comprehensive PYQ answer guide compile karta hoon.

πŸ“š MBBS 1st Year Biochemistry

Lipid Chemistry & Metabolism - Past 10 Years PYQs (with Answers)

(Sources: WBUHS 2010-2023, Various Indian Universities, Lippincott Biochemistry 8e)

πŸ”΄ SECTION A: LONG ANSWER QUESTIONS (LAQ) β€” 10-12 Marks


Q1. Describe the beta-oxidation of palmitic acid. Calculate the net ATP yield. How does oxidation of oleic acid differ from palmitic acid? [WBUHS 2017-S, Frequently asked 2013-2022]

Answer:
Beta-Oxidation of Palmitic Acid (C16:0)
Beta-oxidation occurs in the mitochondrial matrix. Palmitic acid (16 carbons) undergoes 7 cycles of beta-oxidation to yield 8 Acetyl CoA.
Activation (Cytoplasm):
  • Palmitate + CoA + ATP β†’ Palmitoyl CoA + AMP + PPi
  • Cost: -2 ATP equivalents
Carnitine Shuttle:
  • Palmitoyl CoA cannot cross inner mitochondrial membrane directly
  • Carnitine palmitoyltransferase I (CPT-I) on outer membrane transfers acyl group to carnitine
  • CPT-II on inner membrane regenerates Palmitoyl CoA inside mitochondria
  • CPT-I is the rate-limiting step β€” inhibited by malonyl CoA (prevents futile cycling)
4 Reactions of Each Beta-Oxidation Cycle:
StepEnzymeProduct
1. DehydrogenationAcyl CoA dehydrogenase (FAD)Trans-2-enoyl CoA + FADH2
2. HydrationEnoyl CoA hydrataseL-3-hydroxyacyl CoA
3. Dehydrogenation3-hydroxyacyl CoA dehydrogenase (NAD+)3-ketoacyl CoA + NADH
4. ThiolysisBeta-ketothiolaseAcetyl CoA + (shorter acyl CoA)
ATP Calculation for Palmitic Acid:
SourceNumberATP eachTotal ATP
Acetyl CoA (Γ—8) via TCA81080
NADH from beta-ox (Γ—7)72.517.5
FADH2 from beta-ox (Γ—7)71.510.5
Activation cost--2-2
Net ATP~106 ATP
(Using modern P/O ratios: NADH=2.5, FADH2=1.5)
Difference for Oleic Acid (18:1, Ξ”9 = one double bond):
  • After 3 cycles of beta-oxidation, a cis-3-enoyl CoA is produced (instead of trans-2-enoyl CoA)
  • Extra enzyme needed: 3,2-enoyl CoA isomerase converts cis-3 to trans-2 derivative
  • One FADH2 is NOT produced in that step (the isomerase bypasses the acyl CoA dehydrogenase step)
  • Net ATP for oleic acid = ~106 - 1.5 = ~104.5 ATP less than palmitic acid (net difference = ~1.5 ATP less)

Q2. Describe the synthesis of cholesterol. Name the regulatory enzyme. Explain reverse cholesterol transport. [WBUHS 2013-2023, Most frequently asked]

Answer:
Cholesterol Synthesis (de novo, in liver)
All 27 carbons come from Acetyl CoA. Synthesis occurs in cytosol and SER.
Key Stages:
Stage 1 - Synthesis of HMG CoA (mitochondria/cytosol):
  • 2 Acetyl CoA β†’ Acetoacetyl CoA
  • Acetoacetyl CoA + Acetyl CoA β†’ HMG CoA (via HMG CoA synthase)
Stage 2 - Synthesis of Mevalonate (Rate-limiting step):
  • HMG CoA + 2 NADPH β†’ Mevalonate (via HMG CoA reductase)
  • This is the committed, rate-limiting step
  • Statins (e.g., atorvastatin) competitively inhibit HMG CoA reductase
Stage 3 - Mevalonate β†’ Isopentenyl pyrophosphate (IPP, 5C)
Stage 4 - Squalene synthesis:
  • 6 IPP units β†’ Squalene (30C)
Stage 5 - Squalene β†’ Lanosterol β†’ Cholesterol (27C)
Regulation of HMG CoA Reductase:
  • Inhibited by: high cholesterol (SREBP pathway), glucagon, glucocorticoids
  • Activated by: insulin, T3
  • Feedback regulation: LDL receptor-mediated uptake reduces SREBP activation
  • Statins competitively inhibit it to lower plasma cholesterol
Reverse Cholesterol Transport (RCT):
  • Process by which excess cholesterol is returned from peripheral tissues β†’ liver for excretion
  • HDL is the key vehicle
  • Steps:
    1. Lipid-poor apoA-I/nascent HDL picks up cholesterol from peripheral cells via ABCA1 transporter
    2. LCAT (Lecithin-Cholesterol Acyl Transferase) esterifies cholesterol β†’ HDL becomes mature (spherical, HDL3 β†’ HDL2)
    3. CETP transfers cholesterol esters from HDL to LDL/VLDL in exchange for TGs
    4. Liver takes up HDL cholesterol via SR-B1 receptor (selective uptake)
    5. Cholesterol is converted to bile acids and excreted
Clinical Importance: Low HDL = impaired RCT = atherosclerosis risk. HDL is "good cholesterol."

Q3. Describe fatty acid synthesis (de novo). Name the enzymes of fatty acid synthase complex. [WBUHS 2014-2021]

Answer:
Key Features:
  • Occurs in cytosol (opposite of beta-oxidation in mitochondria)
  • Requires NADPH (from PPP and malic enzyme) and HCO3- as CO2 donor
  • Product is palmitate (16C)
  • Main site: liver and adipose tissue
Step 1 - Carboxylation of Acetyl CoA:
  • Acetyl CoA + CO2 + ATP β†’ Malonyl CoA (via Acetyl CoA Carboxylase, ACC)
  • ACC is the rate-limiting/regulatory enzyme
  • Activated by: citrate, insulin; Inhibited by: palmitoyl CoA, glucagon, AMPK
Step 2 - Fatty Acid Synthase (FAS) Complex: FAS is a multifunctional enzyme with 7 catalytic activities and 2 subunits (homodimer):
Domain/EnzymeFunction
ACP (Acyl Carrier Protein)Carries intermediates (has 4'-phosphopantetheine)
Acetyl transacylaseTransfers acetyl group to Cys-SH
Malonyl transacylaseTransfers malonyl to ACP-SH
Beta-ketoacyl synthase (condensing enzyme)Condensation reaction
Beta-ketoacyl reductaseUses NADPH
Beta-hydroxyacyl dehydrataseDehydration
Enoyl reductaseUses NADPH
ThioesteraseReleases palmitate
4 reactions per elongation cycle (reverse of beta-oxidation):
  1. Condensation (releases CO2)
  2. Reduction (NADPH)
  3. Dehydration
  4. Reduction (NADPH)
  • 7 cycles β†’ Palmitate (C16)

🟑 SECTION B: SHORT NOTES (SN) β€” 5-7 Marks


Q4. Ketone Bodies - Formation, Utilization, and Clinical Significance [WBUHS 2010-2022, Very frequently asked]

Formation (Ketogenesis - in liver mitochondria):
  • Occurs when Acetyl CoA exceeds TCA cycle capacity (starvation, DM, high fat diet)
  • Steps:
    • 2 Acetyl CoA β†’ Acetoacetyl CoA (thiolase)
    • Acetoacetyl CoA + Acetyl CoA β†’ HMG CoA (HMG CoA synthase)
    • HMG CoA β†’ Acetoacetate + Acetyl CoA (HMG CoA lyase) ← key step
    • Acetoacetate β†’ Beta-hydroxybutyrate (by BHB dehydrogenase, NADH)
    • Acetoacetate β†’ Acetone (spontaneous decarboxylation)
Ketone Bodies: Acetoacetate, Beta-hydroxybutyrate, Acetone
Utilization (Ketolysis - in extrahepatic tissues: brain, heart, muscle):
  • Beta-hydroxybutyrate β†’ Acetoacetate β†’ Acetoacetyl CoA (succinyl CoA transferase / thiophorase)
  • Acetoacetyl CoA β†’ 2 Acetyl CoA β†’ TCA β†’ ATP
  • Liver CANNOT use ketone bodies (lacks thiophorase/succinyl CoA transferase)
Diabetic Ketoacidosis (DKA):
  • In T1D: absence of insulin β†’ unrestrained lipolysis + glucagon excess
  • Excess Acetyl CoA floods into ketogenesis
  • Blood pH falls (metabolic acidosis), Kussmaul breathing, fruity breath (acetone)
  • Urine: ketonuria + glycosuria

Q5. Lipoproteins - Classification, Composition, and Functions [Frequently asked 2011-2023]

LipoproteinDensityTG contentMajor ApolipoproteinFunction
ChylomicronLowest (<0.95)~85%ApoB-48Transport dietary (exogenous) TG
VLDL0.95-1.006~55%ApoB-100Transport endogenous TG from liver
IDL1.006-1.01931%ApoB-100Intermediate in VLDL→LDL conversion
LDL1.019-1.063~10%ApoB-100Transport cholesterol to tissues; atherogenic
HDLHighest (1.063-1.21)~5%ApoA-IReverse cholesterol transport; protective
Key Enzymes:
  • Lipoprotein Lipase (LPL): Hydrolyzes TG in chylomicrons/VLDL on capillary endothelium; activated by ApoC-II; inhibited by ApoC-III
  • LCAT: Forms cholesterol esters in HDL (needed for RCT)
  • CETP: Transfers CE from HDL to LDL/VLDL

Q6. Phospholipids - Classification, Structure of Lecithin, Phospholipases [WBUHS 2013, 2018, 2019-S]

Classification of Phospholipids:
A. Glycerophospholipids (based on glycerol):
  • Phosphatidylcholine (Lecithin) - most abundant
  • Phosphatidylethanolamine (Cephalin)
  • Phosphatidylserine
  • Phosphatidylinositol
  • Phosphatidylglycerol
  • Cardiolipin (in inner mitochondrial membrane)
  • Plasmalogen (Ether phospholipid)
B. Sphingophospholipids (based on sphingosine):
  • Sphingomyelin (in myelin sheath)
Structure of Lecithin (Phosphatidylcholine):
  • Glycerol backbone
  • Position 1 (sn-1): Saturated fatty acid (e.g., palmitate) via ester bond
  • Position 2 (sn-2): Unsaturated fatty acid (e.g., arachidonate) via ester bond
  • Position 3 (sn-3): Phosphocholine head group
Phospholipases:
EnzymeSite of Action
Phospholipase A1Cleaves fatty acid at sn-1 position
Phospholipase A2Cleaves fatty acid at sn-2 (releases arachidonic acid β†’ prostaglandins)
Phospholipase B (Lysophospholipase)Removes remaining fatty acid from lyso-phospholipid
Phospholipase CCleaves glycerol-phosphate bond β†’ DAG + phosphocholine
Phospholipase DCleaves phosphate-head group bond β†’ phosphatidic acid + choline
Clinical: Phospholipase A2 is activated in inflammation; lysophospholipids are surfactants.

Q7. Fatty Liver and Lipotropic Factors [Frequently asked 2012-2020]

Fatty Liver (Hepatic Steatosis):
  • Excess TG accumulation in hepatocytes (>5% of liver weight)
Causes:
  • Excess FFA delivery to liver (obesity, DM, starvation)
  • Increased TG synthesis
  • Decreased VLDL secretion (most common cause)
  • Alcoholism (increases NADH β†’ diverts OAA from gluconeogenesis, promotes TG synthesis)
  • Choline deficiency, protein deficiency
Lipotropic Factors (promote removal of fat from liver by VLDL synthesis):
  • Choline (most important)
  • Methionine (methyl group donor for choline synthesis)
  • Inositol
  • Betaine
  • Vitamin B12, Folic acid (for methyl group transfer)
  • Mechanism: These provide methyl groups for phosphatidylcholine (lecithin) synthesis, which is required for VLDL assembly

Q8. Essential Fatty Acids (EFA) [Frequently asked 2010-2022]

Definition: Fatty acids that cannot be synthesized in the body and must be taken in diet.
EFAStructureSource
Linoleic acid (Omega-6)18:2(Ξ”9,12)Vegetable oils (sunflower, corn)
Alpha-linolenic acid (Omega-3)18:3(Ξ”9,12,15)Flaxseed, fish oil
Derivatives:
  • Linoleic β†’ Arachidonic acid (20:4, Ξ”5,8,11,14) β†’ Prostaglandins, Leukotrienes, Thromboxanes
  • Alpha-linolenic β†’ EPA, DHA (important for brain and retina)
Functions:
  1. Structural component of cell membranes (maintain fluidity)
  2. Precursors of eicosanoids (PGs, LTs, TXs)
  3. Required for skin integrity (deficiency β†’ scaly dermatitis)
  4. Helps in cholesterol transport as cholesterol esters
Deficiency: Scaly dermatitis, poor wound healing, impaired growth, increased susceptibility to infections

Q9. Cholesterol - Biomedical Importance and Role in Atherosclerosis [WBUHS 2011-2023]

Functions of Cholesterol:
  1. Structural component of cell membranes (maintains fluidity)
  2. Precursor of bile acids (for fat digestion)
  3. Precursor of steroid hormones (glucocorticoids, mineralocorticoids, sex hormones)
  4. Precursor of Vitamin D (skin, UV light)
  5. Precursor of oxysterols (regulate cholesterol metabolism)
Role in Atherosclerosis:
  • Elevated LDL β†’ enters arterial intima β†’ oxidized by ROS β†’ taken up by macrophages via scavenger receptors β†’ foam cells β†’ fatty streaks β†’ fibrous plaque β†’ atherosclerosis
  • LDL/HDL ratio is important: High LDL + Low HDL = high risk
  • Familial Hypercholesterolemia: defective LDL receptor β†’ very high LDL β†’ premature atherosclerosis
Normal values:
  • Total cholesterol: <200 mg/dL
  • LDL: <100 mg/dL (optimal)
  • HDL: >40 mg/dL (males), >50 mg/dL (females)
  • TG: <150 mg/dL

Q10. VLDL Metabolism [WBUHS 2013-2020]

VLDL (Very Low Density Lipoprotein) - "Endogenous TG Transport"
Synthesis: In liver from endogenous TG + Cholesterol + ApoB-100 + ApoC + ApoE
Metabolic Fate:
  1. VLDL secreted into blood
  2. In capillaries: LPL (activated by ApoC-II) hydrolyzes TG β†’ FFAs go to tissues
  3. VLDL becomes smaller β†’ IDL (remnant)
  4. 50% of IDL taken up by liver (via ApoE and LDL receptor)
  5. Remaining IDL acted on by Hepatic Lipase β†’ becomes LDL
  6. LDL taken up by tissues via LDL receptor (ApoB-100 recognition)
"VLDL β†’ IDL β†’ LDL" cascade is key

🟒 SECTION C: SHORT NOTES β€” 2-3 Marks (Very Frequently Asked)

TopicKey Points to Remember
Carnitine ShuttleCPT-I (outer), Translocase, CPT-II (inner); activated by carnitine; inhibited by malonyl CoA; needed for LCFA entry into mitochondria
HMG CoA reductaseRate-limiting enzyme of cholesterol synthesis; target of statins; SREBP regulation
SphingolipidsCeramide backbone; includes sphingomyelin, cerebrosides, gangliosides; deficiency = sphingolipidoses (Gaucher's, Niemann-Pick, Tay-Sachs)
ProstaglandinsEicosanoids from arachidonic acid; via COX pathway; inhibited by NSAIDs/aspirin
LipaseHormone-sensitive lipase (adipose) activated by glucagon/epinephrine; LPL activated by ApoC-II
Malonyl CoAMade by ACC; inhibits CPT-I (prevents futile cycling); first committed step in FA synthesis
Arachidonic acid20:4 (Ξ”5,8,11,14); derived from linoleic acid; precursor of eicosanoids

πŸ”΅ SECTION D: EXPLAIN THE REASON (EQ Questions) β€” 2-3 Marks


Q11. "Fat can be synthesized from glucose but glucose cannot be synthesized from fat." [WBUHS - Repeatedly asked]

Answer:
  • Glucose β†’ Pyruvate β†’ Acetyl CoA (irreversible - pyruvate dehydrogenase reaction)
  • Acetyl CoA can be used for FA synthesis (fat from glucose βœ“)
  • Acetyl CoA cannot be converted back to pyruvate - there is no reverse pyruvate dehydrogenase in mammals
  • OAA can be formed from some amino acids but NOT from Acetyl CoA directly
  • Therefore, net synthesis of glucose from Acetyl CoA (i.e., from fat) is not possible
  • Exception: Glycerol from TG breakdown CAN be converted to glucose via DHAP - but this is minor

Q12. "Defective beta-oxidation leads to hypoglycemia." [WBUHS 2015-2020]

Answer:
  • In fasting, liver uses beta-oxidation of fatty acids to generate ATP for gluconeogenesis
  • Beta-oxidation generates: NADH, ATP, Acetyl CoA β†’ these drive gluconeogenesis
  • Acetyl CoA allosterically activates pyruvate carboxylase (first step of gluconeogenesis)
  • If beta-oxidation is defective (e.g., MCAD deficiency): no acetyl CoA generated β†’ pyruvate carboxylase not activated β†’ gluconeogenesis fails β†’ hypoglycemia
  • Also, body cannot spare glucose (uses fat for energy) β†’ glucose levels drop
Example disorder: MCAD (Medium-Chain Acyl CoA Dehydrogenase) deficiency

⭐ HIGH-FREQUENCY TOPIC SUMMARY (For Quick Revision)

RankTopicExam Years
1Beta-oxidation of palmitic acid + ATP calculation2013, 2015, 2017, 2018, 2019, 2020, 2021, 2022
2Cholesterol synthesis + HMG CoA reductase2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2023
3Ketone bodies2010, 2012, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021
4Lipoproteins (esp. VLDL metabolism, RCT)2011, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020
5Fatty acid synthesis/FAS complex2014, 2015, 2016, 2017, 2018, 2019, 2021
6Phospholipids + Lecithin + Phospholipases2010, 2013, 2018, 2019, 2022
7Fatty liver + Lipotropic factors2012, 2014, 2016, 2018, 2020
8Essential fatty acids2010, 2013, 2014, 2015, 2017, 2019
9Carnitine shuttle2011, 2013, 2015, 2018, 2020
10Sphingolipids and sphingolipidoses2013, 2015, 2016, 2018, 2020

Sources: WBUHS Biochemistry PYQ Bank 2010-2023 (via Medical Junction), Lippincott's Illustrated Reviews in Biochemistry 8e, Harper's Illustrated Biochemistry, Quora MBBS Important Questions. Answers prepared from authoritative textbook content.
Exam tip: Beta-oxidation ATP calculation, cholesterol synthesis pathway (HMG CoA reductase), ketone body formation, and lipoprotein metabolism are the most repeated topics - ek baar ye 4 properly samajh lo toh lipid ka 70% syllabus cover ho jata hai. Diagrams bana ke likhna - examiner ko zyada marks milta hai!

Create a quick reference PDF with flowcharts of beta-oxidation and cholesterol synthesis

Reading File
Running Command

ls /home/daytona/workspace/

Running Command

mkdir -p /home/daytona/workspace/lipid-pdf && python3 -c "import reportlab; print('reportlab ok')" && python3 -c "from reportlab.lib.pagesizes import A4; print('A4 ok')"

Writing File

~/lipid-pdf/generate_lipid_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.pdfgen import canvas
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import Paragraph
from reportlab.lib.enums import TA_CENTER, TA_LEFT
import os

OUTPUT = "/home/daytona/workspace/lipid-pdf/Lipid_Quick_Reference.pdf"
W, H = A4   # 595.27 x 841.89 pts

# ── Colour palette ────────────────────────────────────────────
C_DARK_BLUE   = colors.HexColor("#1a3a5c")
C_BLUE        = colors.HexColor("#2563a8")
C_LIGHT_BLUE  = colors.HexColor("#dbeafe")
C_GREEN       = colors.HexColor("#16a34a")
C_LIGHT_GREEN = colors.HexColor("#dcfce7")
C_ORANGE      = colors.HexColor("#ea580c")
C_LIGHT_ORANGE= colors.HexColor("#ffedd5")
C_PURPLE      = colors.HexColor("#7c3aed")
C_LIGHT_PURPLE= colors.HexColor("#ede9fe")
C_RED         = colors.HexColor("#dc2626")
C_YELLOW      = colors.HexColor("#fef08a")
C_DARK        = colors.HexColor("#1e293b")
C_GRAY        = colors.HexColor("#64748b")
C_LIGHT_GRAY  = colors.HexColor("#f1f5f9")
C_WHITE       = colors.white
C_TEAL        = colors.HexColor("#0d9488")
C_LIGHT_TEAL  = colors.HexColor("#ccfbf1")

# ── Helpers ───────────────────────────────────────────────────
def draw_rounded_box(c, x, y, w, h, fill, stroke=None, radius=6):
    c.setFillColor(fill)
    if stroke:
        c.setStrokeColor(stroke)
        c.setLineWidth(1.2)
    else:
        c.setStrokeColor(fill)
        c.setLineWidth(0)
    c.roundRect(x, y, w, h, radius, fill=1, stroke=1 if stroke else 0)

def draw_text(c, text, x, y, size=9, color=C_DARK, bold=False, align="center", max_width=None):
    c.setFillColor(color)
    font = "Helvetica-Bold" if bold else "Helvetica"
    c.setFont(font, size)
    if align == "center":
        c.drawCentredString(x, y, text)
    elif align == "left":
        c.drawString(x, y, text)
    elif align == "right":
        c.drawRightString(x, y, text)

def draw_arrow_down(c, x, y, length=18, color=C_GRAY):
    c.setStrokeColor(color)
    c.setFillColor(color)
    c.setLineWidth(1.5)
    c.line(x, y, x, y - length + 6)
    # arrowhead
    p = c.beginPath()
    p.moveTo(x, y - length)
    p.lineTo(x - 5, y - length + 8)
    p.lineTo(x + 5, y - length + 8)
    p.close()
    c.drawPath(p, fill=1, stroke=0)

def draw_arrow_right(c, x, y, length=22, color=C_GRAY):
    c.setStrokeColor(color)
    c.setFillColor(color)
    c.setLineWidth(1.5)
    c.line(x, y, x + length - 6, y)
    p = c.beginPath()
    p.moveTo(x + length, y)
    p.lineTo(x + length - 8, y + 5)
    p.lineTo(x + length - 8, y - 5)
    p.close()
    c.drawPath(p, fill=1, stroke=0)

def step_box(c, cx, y, w, h, label, sublabel="", fill=C_LIGHT_BLUE, stroke=C_BLUE,
             label_color=C_DARK_BLUE, sub_color=C_GRAY, bold_label=True):
    x = cx - w/2
    draw_rounded_box(c, x, y - h, w, h, fill, stroke, radius=7)
    if sublabel:
        draw_text(c, label, cx, y - h*0.38, size=8.5, color=label_color, bold=bold_label)
        draw_text(c, sublabel, cx, y - h*0.72, size=7, color=sub_color)
    else:
        draw_text(c, label, cx, y - h*0.55, size=8.5, color=label_color, bold=bold_label)

def side_label(c, x, y, text, color=C_ORANGE, size=7):
    """Small italic enzyme label to the side of an arrow"""
    c.setFillColor(color)
    c.setFont("Helvetica-Oblique", size)
    c.drawString(x, y, text)

# ═══════════════════════════════════════════════════════════════
#  PAGE 1 β€” Cover
# ═══════════════════════════════════════════════════════════════
def draw_cover(c):
    # Background gradient-like effect
    c.setFillColor(C_DARK_BLUE)
    c.rect(0, 0, W, H, fill=1, stroke=0)

    # Top accent stripe
    c.setFillColor(C_BLUE)
    c.rect(0, H - 120, W, 120, fill=1, stroke=0)

    # Decorative circles
    for (cx2, cy2, r, alpha) in [(500, 750, 120, 0.08), (80, 200, 90, 0.06), (300, 400, 200, 0.04)]:
        c.setFillColor(colors.HexColor("#ffffff"))
        c.setFillAlpha(alpha)
        c.circle(cx2, cy2, r, fill=1, stroke=0)
    c.setFillAlpha(1)

    # Title block
    c.setFillColor(C_WHITE)
    c.setFont("Helvetica-Bold", 32)
    c.drawCentredString(W/2, H - 200, "LIPID BIOCHEMISTRY")
    c.setFont("Helvetica-Bold", 22)
    c.setFillColor(colors.HexColor("#93c5fd"))
    c.drawCentredString(W/2, H - 235, "Quick Reference Guide")

    # Subtitle
    c.setFont("Helvetica", 13)
    c.setFillColor(colors.HexColor("#cbd5e1"))
    c.drawCentredString(W/2, H - 265, "MBBS 1st Year  Β·  Biochemistry")

    # Divider line
    c.setStrokeColor(colors.HexColor("#3b82f6"))
    c.setLineWidth(2)
    c.line(80, H - 285, W - 80, H - 285)

    # Contents
    topics = [
        ("πŸ“‹", "Beta-Oxidation of Palmitic Acid", "Step-by-step flowchart + ATP calculation"),
        ("πŸ”¬", "Cholesterol Synthesis", "HMG CoA β†’ Cholesterol pathway + regulation"),
        ("⚑", "Key Enzymes & Regulation", "Rate-limiting steps, inhibitors, activators"),
        ("πŸ§ͺ", "ATP Yield Summary", "Complete energy accounting table"),
    ]
    y0 = H - 330
    for icon, title, desc in topics:
        draw_rounded_box(c, 70, y0 - 42, W - 140, 46, fill=colors.HexColor("#1e3a5f"), stroke=colors.HexColor("#3b82f6"), radius=8)
        c.setFillColor(C_WHITE)
        c.setFont("Helvetica-Bold", 11)
        c.drawString(90, y0 - 18, f"{icon}  {title}")
        c.setFillColor(colors.HexColor("#94a3b8"))
        c.setFont("Helvetica", 9)
        c.drawString(90, y0 - 33, desc)
        y0 -= 58

    # For exam badge
    draw_rounded_box(c, W/2 - 130, 80, 260, 50, fill=colors.HexColor("#854d0e"), stroke=colors.HexColor("#f59e0b"), radius=10)
    c.setFillColor(colors.HexColor("#fef08a"))
    c.setFont("Helvetica-Bold", 11)
    c.drawCentredString(W/2, 113, "⭐  HIGH YIELD FOR UNIVERSITY EXAMS")
    c.setFont("Helvetica", 8.5)
    c.setFillColor(colors.HexColor("#fde68a"))
    c.drawCentredString(W/2, 96, "Most repeated topics 2013–2023")

    # Page number placeholder
    c.setFillColor(colors.HexColor("#475569"))
    c.setFont("Helvetica", 8)
    c.drawCentredString(W/2, 40, "Page 1 of 4")

# ═══════════════════════════════════════════════════════════════
#  PAGE 2 β€” Beta-Oxidation Flowchart
# ═══════════════════════════════════════════════════════════════
def draw_beta_ox(c):
    # Header
    c.setFillColor(C_DARK_BLUE)
    c.rect(0, H - 55, W, 55, fill=1, stroke=0)
    c.setFillColor(C_WHITE)
    c.setFont("Helvetica-Bold", 17)
    c.drawCentredString(W/2, H - 22, "Ξ²-OXIDATION OF PALMITIC ACID (C16:0)")
    c.setFont("Helvetica", 9)
    c.setFillColor(colors.HexColor("#93c5fd"))
    c.drawCentredString(W/2, H - 40, "Mitochondrial Matrix  Β·  7 cycles β†’ 8 Acetyl CoA")

    # ── LEFT column: Pre-oxidation steps ──────────────────────
    col_l = W * 0.25
    col_r = W * 0.72
    BW = 155  # box width
    BH = 36   # box height

    # === ACTIVATION (cytoplasm) ===
    y = H - 80
    draw_rounded_box(c, 20, y - 22, W - 40, 22, fill=colors.HexColor("#fef9c3"), stroke=colors.HexColor("#ca8a04"), radius=4)
    c.setFillColor(colors.HexColor("#78350f"))
    c.setFont("Helvetica-Bold", 8.5)
    c.drawString(30, y - 16, "STEP 0  β€”  ACTIVATION  (Cytoplasm, Outer Mitochondrial Membrane)")

    y -= 35
    step_box(c, col_l, y, BW, BH, "Palmitic Acid (C16)",
             "Free fatty acid", fill=C_LIGHT_ORANGE, stroke=C_ORANGE, label_color=C_ORANGE)

    side_label(c, col_l + BW/2 + 5, y - BH - 5, "Acyl CoA Synthetase", color=C_ORANGE)
    side_label(c, col_l + BW/2 + 5, y - BH - 15, "ATP β†’ AMP + PPi", color=C_GRAY)
    draw_arrow_down(c, col_l, y - BH - 2, 22)

    y -= BH + 28
    step_box(c, col_l, y, BW, BH, "Palmitoyl CoA",
             "Activated form (-2 ATP)", fill=C_LIGHT_ORANGE, stroke=C_ORANGE, label_color=C_ORANGE)

    # === CARNITINE SHUTTLE ===
    y -= BH + 10
    draw_rounded_box(c, 20, y - 22, W - 40, 22, fill=C_LIGHT_PURPLE, stroke=C_PURPLE, radius=4)
    c.setFillColor(C_PURPLE)
    c.setFont("Helvetica-Bold", 8.5)
    c.drawString(30, y - 16, "CARNITINE SHUTTLE  β€”  Transport across Inner Mitochondrial Membrane")

    shuttle_items = [
        ("Palmitoyl CoA", "Cytosol side"),
        ("Palmitoylcarnitine", "CPT-I converts (RATE-LIMITING)"),
        ("Palmitoyl CoA", "Matrix side (CPT-II regenerates)"),
    ]
    y -= 30
    sx = 55
    for i, (name, note) in enumerate(shuttle_items):
        draw_rounded_box(c, sx, y - BH, 140, BH, fill=C_LIGHT_PURPLE, stroke=C_PURPLE, radius=6)
        c.setFillColor(C_PURPLE)
        c.setFont("Helvetica-Bold", 8)
        c.drawCentredString(sx + 70, y - BH*0.38, name)
        c.setFillColor(C_GRAY)
        c.setFont("Helvetica", 7)
        c.drawCentredString(sx + 70, y - BH*0.72, note)
        if i < 2:
            draw_arrow_right(c, sx + 140, y - BH/2, 22)
            sx += 162
    # CPT-I inhibited by malonyl CoA
    c.setFillColor(C_RED)
    c.setFont("Helvetica-Bold", 7.5)
    c.drawString(55 + 140 + 5, y - BH + 5, "βŠ— Inhibited by Malonyl CoA (prevents futile cycle)")

    # === BETA-OXIDATION CYCLE ===
    y -= BH + 22
    draw_rounded_box(c, 20, y - 22, W - 40, 22, fill=C_LIGHT_GREEN, stroke=C_GREEN, radius=4)
    c.setFillColor(C_GREEN)
    c.setFont("Helvetica-Bold", 8.5)
    c.drawString(30, y - 16, "Ξ²-OXIDATION CYCLE  Γ—7  (4 reactions per cycle β€” inside Mitochondrial Matrix)")

    # Draw 4-step cycle in two rows
    cycle_steps = [
        ("β‘  Dehydrogenation", "Acyl CoA Dehydrogenase\n(FAD β†’ FADHβ‚‚)", C_LIGHT_BLUE, C_BLUE),
        ("β‘‘ Hydration", "Enoyl CoA Hydratase\n(adds Hβ‚‚O)", C_LIGHT_GREEN, C_GREEN),
        ("β‘’ Dehydrogenation", "3-OH Acyl CoA Dehydrogenase\n(NAD⁺ β†’ NADH)", C_LIGHT_ORANGE, C_ORANGE),
        ("β‘£ Thiolysis", "Beta-Ketothiolase\n(+ CoA β†’ Acetyl CoA)", C_LIGHT_PURPLE, C_PURPLE),
    ]
    y -= 30
    cx_start = 80
    dx = 118
    for i, (title, enzyme, fill, stroke) in enumerate(cycle_steps):
        bx = cx_start + i * dx
        draw_rounded_box(c, bx, y - 48, 108, 48, fill=fill, stroke=stroke, radius=7)
        c.setFillColor(stroke)
        c.setFont("Helvetica-Bold", 8)
        c.drawCentredString(bx + 54, y - 16, title)
        lines = enzyme.split("\n")
        c.setFillColor(C_DARK)
        c.setFont("Helvetica", 7)
        c.drawCentredString(bx + 54, y - 29, lines[0])
        c.setFillColor(C_GRAY)
        c.drawCentredString(bx + 54, y - 40, lines[1])
        if i < 3:
            draw_arrow_right(c, bx + 108, y - 24, 10)

    # Curved "Γ—7" arrow back
    y -= 48
    draw_rounded_box(c, W/2 - 90, y - 28, 180, 28, fill=colors.HexColor("#fef9c3"), stroke=colors.HexColor("#d97706"), radius=6)
    c.setFillColor(colors.HexColor("#92400e"))
    c.setFont("Helvetica-Bold", 9)
    c.drawCentredString(W/2, y - 11, "πŸ”  Repeat Γ—7   β†’   7 FADHβ‚‚  +  7 NADH  +  8 Acetyl CoA")

    # Product boxes
    y -= 42
    draw_rounded_box(c, 20, y - 22, W - 40, 22, fill=C_LIGHT_GRAY, stroke=C_GRAY, radius=4)
    c.setFillColor(C_DARK)
    c.setFont("Helvetica-Bold", 8.5)
    c.drawString(30, y - 16, "PRODUCTS ENTER  β€”β€”  8 Acetyl CoA β†’ TCA Cycle  Β·  FADHβ‚‚ + NADH β†’ ETC")

    # === ATP TABLE ===
    y -= 38
    draw_rounded_box(c, 20, y - 22, W - 40, 22, fill=C_DARK_BLUE, stroke=C_DARK_BLUE, radius=4)
    c.setFillColor(C_WHITE)
    c.setFont("Helvetica-Bold", 9)
    c.drawCentredString(W/2, y - 15, "⚑  NET ATP YIELD FROM PALMITIC ACID (C16:0)")

    headers = ["Source", "Count", "ATP each", "Total ATP"]
    col_x = [30, 210, 310, 420]
    col_w = [180, 95, 95, 95]
    y -= 28

    # Table header
    for i, (hdr, cx2) in enumerate(zip(headers, col_x)):
        draw_rounded_box(c, cx2, y - 18, col_w[i] - 4, 18, fill=C_BLUE, stroke=C_BLUE, radius=3)
        c.setFillColor(C_WHITE)
        c.setFont("Helvetica-Bold", 8)
        c.drawCentredString(cx2 + col_w[i]/2 - 2, y - 12, hdr)

    rows = [
        ("8 Γ— Acetyl CoA  (via TCA cycle)", "8", "10", "80"),
        ("7 Γ— NADH  (from Ξ²-oxidation)", "7", "2.5", "17.5"),
        ("7 Γ— FADHβ‚‚  (from Ξ²-oxidation)", "7", "1.5", "10.5"),
        ("Activation cost (ATP β†’ AMP)", "1", "-2", "-2"),
    ]
    fills = [C_LIGHT_GREEN, C_LIGHT_BLUE, C_LIGHT_ORANGE, colors.HexColor("#fee2e2")]

    y -= 22
    for j, (row, rf) in enumerate(zip(rows, fills)):
        for i, (val, cx2) in enumerate(zip(row, col_x)):
            draw_rounded_box(c, cx2, y - 16, col_w[i] - 4, 16, fill=rf, stroke=colors.HexColor("#e2e8f0"), radius=2)
            c.setFillColor(C_DARK)
            c.setFont("Helvetica-Bold" if i == 0 else "Helvetica", 8)
            c.drawCentredString(cx2 + col_w[i]/2 - 2, y - 11, val)
        y -= 18

    # Total row
    draw_rounded_box(c, 30, y - 20, W - 70, 20, fill=C_DARK_BLUE, stroke=C_DARK_BLUE, radius=4)
    c.setFillColor(C_WHITE)
    c.setFont("Helvetica-Bold", 10)
    c.drawString(40, y - 14, "NET ATP  =  80 + 17.5 + 10.5 - 2  =")
    c.setFillColor(C_YELLOW)
    c.setFont("Helvetica-Bold", 12)
    c.drawString(310, y - 14, "106 ATP")

    # Footer
    c.setFillColor(C_GRAY)
    c.setFont("Helvetica", 7.5)
    c.drawString(30, 22, "* Using modern P/O ratios: NADH = 2.5 ATP, FADHβ‚‚ = 1.5 ATP  |  Oleic acid (C18:1) yields ~2 ATP less (one FADHβ‚‚ saved by isomerase step)")
    c.setFont("Helvetica", 8)
    c.drawCentredString(W/2, 10, "Page 2 of 4")

# ═══════════════════════════════════════════════════════════════
#  PAGE 3 β€” Cholesterol Synthesis Flowchart
# ═══════════════════════════════════════════════════════════════
def draw_cholesterol(c):
    # Header
    c.setFillColor(C_GREEN)
    c.rect(0, H - 55, W, 55, fill=1, stroke=0)
    c.setFillColor(C_WHITE)
    c.setFont("Helvetica-Bold", 17)
    c.drawCentredString(W/2, H - 22, "CHOLESTEROL SYNTHESIS  (de novo)")
    c.setFont("Helvetica", 9)
    c.setFillColor(C_LIGHT_GREEN)
    c.drawCentredString(W/2, H - 40, "Cytosol & SER  Β·  All 27 carbons from Acetyl CoA  Β·  Site: Liver (mainly)")

    CX = W / 2   # centre column
    BW2 = 230
    BH2 = 34
    y = H - 75

    stages = [
        # (label, sublabel, fill, stroke, enzyme_label, cosubstrate, stage_header)
        ("Acetyl CoA  (2C)", "Starting material β€” from pyruvate/FA oxidation",
         C_LIGHT_ORANGE, C_ORANGE, None, None,
         "STAGE 1  β€”  Formation of HMG CoA  (Mitochondria & Cytosol)"),

        ("Acetoacetyl CoA  (4C)", "Thiolase reaction",
         C_LIGHT_ORANGE, C_ORANGE, "Thiolase (2 Acetyl CoA β†’ 1 Acetoacetyl CoA)", None, None),

        ("HMG CoA  (6C)", "3-Hydroxy-3-Methylglutaryl CoA",
         C_LIGHT_ORANGE, C_ORANGE, "HMG CoA Synthase", None, None),

        ("Mevalonate  (6C)", "β˜… RATE-LIMITING STEP",
         C_LIGHT_GREEN, C_GREEN, "β˜… HMG CoA Reductase  (2 NADPH used)",
         "← Target of STATINS", "STAGE 2  β€”  Mevalonate Synthesis  (RATE-LIMITING)"),

        ("Mevalonate-5-Phosphate", "Phosphorylation step",
         C_LIGHT_BLUE, C_BLUE, "Mevalonate Kinase (ATP)", None,
         "STAGE 3  β€”  Activation & Decarboxylation"),

        ("Mevalonate-5-Pyrophosphate", "Second phosphorylation",
         C_LIGHT_BLUE, C_BLUE, "Phosphomevalonate Kinase (ATP)", None, None),

        ("Isopentenyl Pyrophosphate (IPP, 5C)", "Active isoprene unit",
         C_LIGHT_BLUE, C_BLUE, "Mevalonate-PP Decarboxylase (COβ‚‚ released, ATP)", None, None),

        ("Geranyl-PP (10C)  β†’  Farnesyl-PP (15C)", "2 IPP units β†’ GPP β†’ 3 IPP β†’ FPP",
         C_LIGHT_PURPLE, C_PURPLE, "Geranyl / Farnesyl Transferases", None,
         "STAGE 4  β€”  Squalene Synthesis"),

        ("Squalene  (30C)", "2 Γ— Farnesyl-PP β†’ Squalene",
         C_LIGHT_PURPLE, C_PURPLE, "Squalene Synthase  (2 NADPH)", None, None),

        ("Lanosterol  (30C)", "First sterol intermediate β€” ring formation",
         colors.HexColor("#fce7f3"), colors.HexColor("#db2777"),
         "Squalene Monooxygenase + Cyclase (Oβ‚‚, NADPH)", None,
         "STAGE 5  β€”  Cyclization & Side-chain Modifications  (SER)"),

        ("Cholesterol  (27C)", "Final product β€” 3 carbons lost",
         C_LIGHT_GREEN, C_GREEN, "~19 enzyme steps (demethylation, reduction, desaturation)", None, None),
    ]

    y -= 5
    prev_had_header = True
    for i, item in enumerate(stages):
        label, sublabel, fill, stroke, enzyme, cosub, stage_hdr = item

        if stage_hdr:
            if not prev_had_header:
                y -= 6
            draw_rounded_box(c, 20, y - 18, W - 40, 18, fill=C_DARK_BLUE, stroke=C_DARK_BLUE, radius=3)
            c.setFillColor(C_WHITE)
            c.setFont("Helvetica-Bold", 7.5)
            c.drawString(28, y - 13, stage_hdr)
            y -= 22
            prev_had_header = True
        else:
            prev_had_header = False

        # Enzyme label above arrow
        if enzyme and i > 0:
            enz_lines = enzyme.split(" (")
            c.setFillColor(C_ORANGE)
            c.setFont("Helvetica-Oblique", 7)
            c.drawCentredString(CX + BW2/2 + 45, y - 6, enz_lines[0])
            if len(enz_lines) > 1:
                c.setFillColor(C_GRAY)
                c.drawCentredString(CX + BW2/2 + 45, y - 14, "(" + enz_lines[1])
            if cosub:
                c.setFillColor(C_RED)
                c.setFont("Helvetica-Bold", 7)
                c.drawCentredString(CX + BW2/2 + 45, y - 22, cosub)
            draw_arrow_down(c, CX, y - 2, 18, color=C_GREEN if stroke == C_GREEN else C_GRAY)
            y -= 22

        step_box(c, CX, y, BW2, BH2, label, sublabel, fill=fill, stroke=stroke,
                 label_color=stroke, sub_color=C_GRAY)
        y -= BH2 + 2

    # Regulation box on right side
    reg_x = W - 165
    reg_y = H - 280
    draw_rounded_box(c, reg_x, reg_y - 220, 150, 220, fill=colors.HexColor("#fff7ed"), stroke=colors.HexColor("#d97706"), radius=8)
    c.setFillColor(colors.HexColor("#92400e"))
    c.setFont("Helvetica-Bold", 9)
    c.drawCentredString(reg_x + 75, reg_y - 14, "βš™  REGULATION")
    c.drawCentredString(reg_x + 75, reg_y - 26, "HMG CoA Reductase")

    reg_items = [
        ("βœ… ACTIVATORS:", C_GREEN, True),
        ("Insulin", C_DARK, False),
        ("Thyroid hormone (T3)", C_DARK, False),
        ("", C_DARK, False),
        ("βŠ— INHIBITORS:", C_RED, True),
        ("Cholesterol (SREBP↓)", C_DARK, False),
        ("Glucagon", C_DARK, False),
        ("Glucocorticoids", C_DARK, False),
        ("Statins (drugs)", C_DARK, False),
        ("", C_DARK, False),
        ("πŸ’Š STATINS:", colors.HexColor("#7c3aed"), True),
        ("Competitive inhibitors", C_DARK, False),
        ("↓ LDL cholesterol", C_DARK, False),
        ("e.g. Atorvastatin,", C_DARK, False),
        ("Rosuvastatin", C_DARK, False),
    ]
    ry = reg_y - 44
    for text, color, bold in reg_items:
        if text:
            c.setFillColor(color)
            c.setFont("Helvetica-Bold" if bold else "Helvetica", 7.5)
            c.drawString(reg_x + 8, ry, text)
        ry -= 12

    # Footnote
    c.setFillColor(C_GRAY)
    c.setFont("Helvetica", 7.5)
    c.drawString(20, 25, "Downstream products of Mevalonate pathway: Cholesterol, Dolichol, Ubiquinone, Isoprenoids, Farnesyl groups (protein prenylation)")
    c.setFont("Helvetica", 8)
    c.drawCentredString(W/2, 10, "Page 3 of 4")

# ═══════════════════════════════════════════════════════════════
#  PAGE 4 β€” Key Enzymes, Regulation & Exam Tips
# ═══════════════════════════════════════════════════════════════
def draw_summary(c):
    # Header
    c.setFillColor(C_PURPLE)
    c.rect(0, H - 55, W, 55, fill=1, stroke=0)
    c.setFillColor(C_WHITE)
    c.setFont("Helvetica-Bold", 17)
    c.drawCentredString(W/2, H - 22, "KEY ENZYMES, REGULATION & EXAM TIPS")
    c.setFont("Helvetica", 9)
    c.setFillColor(C_LIGHT_PURPLE)
    c.drawCentredString(W/2, H - 40, "High-Yield Summary for University Exams  Β·  Lipid Biochemistry")

    y = H - 75

    # ── Comparison table: Beta-ox vs FA Synthesis ─────────────
    draw_rounded_box(c, 15, y - 18, W - 30, 18, fill=C_DARK_BLUE, stroke=C_DARK_BLUE, radius=4)
    c.setFillColor(C_WHITE)
    c.setFont("Helvetica-Bold", 9)
    c.drawCentredString(W/2, y - 13, "BETA-OXIDATION  vs  FATTY ACID SYNTHESIS  β€”  Key Differences")
    y -= 24

    comp_headers = ["Feature", "Ξ²-Oxidation", "FA Synthesis"]
    comp_rows = [
        ("Location",          "Mitochondrial matrix",      "Cytosol"),
        ("Carrier",           "CoA",                        "ACP (Acyl Carrier Protein)"),
        ("Coenzyme",          "FAD, NAD⁺ (oxidation)",     "NADPH (reduction)"),
        ("COβ‚‚ / HCO₃⁻",     "Not used",                   "HCO₃⁻ required (malonyl CoA)"),
        ("Rate-limiting enz.","Carnitine Palmitoyltransfer-I","Acetyl CoA Carboxylase (ACC)"),
        ("Regulation",        "Inhibited by malonyl CoA",  "Inhibited by palmitoyl CoA"),
        ("Main product",      "Acetyl CoA + FADHβ‚‚ + NADH", "Palmitate (C16:0)"),
        ("Activated by",      "Glucagon, epinephrine",     "Insulin, citrate"),
    ]
    col_x2 = [15, 160, 375]
    col_w2 = [145, 210, 205]
    hdr_fills = [C_BLUE, C_BLUE, C_GREEN]
    for i, (hdr, cx2, cw) in enumerate(zip(comp_headers, col_x2, col_w2)):
        draw_rounded_box(c, cx2, y - 16, cw - 3, 16, fill=hdr_fills[i], stroke=hdr_fills[i], radius=2)
        c.setFillColor(C_WHITE)
        c.setFont("Helvetica-Bold", 8)
        c.drawCentredString(cx2 + cw/2 - 1.5, y - 11, hdr)
    y -= 18

    for j, row in enumerate(comp_rows):
        rf = C_LIGHT_GRAY if j % 2 == 0 else C_WHITE
        for i, (val, cx2, cw) in enumerate(zip(row, col_x2, col_w2)):
            cell_fill = rf if i > 0 else colors.HexColor("#e0f2fe")
            draw_rounded_box(c, cx2, y - 15, cw - 3, 15, fill=cell_fill, stroke=colors.HexColor("#cbd5e1"), radius=2)
            c.setFillColor(C_DARK)
            c.setFont("Helvetica-Bold" if i == 0 else "Helvetica", 7.5)
            c.drawCentredString(cx2 + cw/2 - 1.5, y - 10, val)
        y -= 16

    y -= 10

    # ── Two column section ─────────────────────────────────────
    # Left: Disorders | Right: Exam tips
    col1_x = 15
    col2_x = W/2 + 5
    col_width = W/2 - 25

    # Disorders box
    draw_rounded_box(c, col1_x, y - 18, col_width, 18, fill=C_RED, stroke=C_RED, radius=4)
    c.setFillColor(C_WHITE)
    c.setFont("Helvetica-Bold", 9)
    c.drawCentredString(col1_x + col_width/2, y - 13, "⚠  CLINICAL DISORDERS")
    y -= 22

    disorders = [
        ("MCAD Deficiency",    "Medium-chain acyl CoA dehydrogenase def.\nHypoglycemia on fasting, no ketones"),
        ("Refsum Disease",     "Phytanoyl CoA Ξ±-hydroxylase def.\nPhytanic acid accumulation, neuropathy"),
        ("Zellweger Syndrome", "Peroxisome biogenesis disorder\nVLCFA accumulation, neurological defects"),
        ("X-ALD",              "VLCFA transport across peroxisomal membrane\nAdrenal + CNS demyelination"),
        ("Familial Hyper-     \ncholesterolemia",
                               "LDL receptor defect\nElevated LDL, xanthomas, early MI"),
    ]
    dy = y
    for dis, desc in disorders:
        draw_rounded_box(c, col1_x, dy - 34, col_width, 34, fill=colors.HexColor("#fff1f2"), stroke=colors.HexColor("#fca5a5"), radius=5)
        c.setFillColor(C_RED)
        c.setFont("Helvetica-Bold", 8)
        c.drawString(col1_x + 6, dy - 12, dis)
        lines = desc.split("\n")
        c.setFillColor(C_DARK)
        c.setFont("Helvetica", 7)
        c.drawString(col1_x + 6, dy - 22, lines[0])
        if len(lines) > 1:
            c.drawString(col1_x + 6, dy - 31, lines[1])
        dy -= 38

    # Exam tips box
    draw_rounded_box(c, col2_x, y - 18, col_width, 18, fill=colors.HexColor("#d97706"), stroke=colors.HexColor("#d97706"), radius=4)
    c.setFillColor(C_WHITE)
    c.setFont("Helvetica-Bold", 9)
    c.drawCentredString(col2_x + col_width/2, y - 13, "⭐  EXAM HIGH-YIELD POINTS")

    tips = [
        "ATP from palmitic acid = 106 (learn calculation steps)",
        "Oleic acid: 1 isomerase needed β†’ ~2 ATP less than palmitate",
        "Beta-oxidation INHIBITED by malonyl CoA (CPT-I block)",
        "Acetyl CoA Carboxylase: rate-limiting in FA synthesis",
        "HMG CoA Reductase: rate-limiting in cholesterol synthesis",
        "Statins = competitive inhibitors of HMG CoA Reductase",
        "Carnitine needed only for LONG chain FA (>12C)",
        "Liver CANNOT use ketone bodies (lacks thiophorase)",
        "HDL = reverse cholesterol transport = 'good cholesterol'",
        "ApoC-II activates LPL; ApoB-100 = LDL receptor ligand",
        "Choline = most important lipotropic factor",
        "Linoleic acid (18:2, Ο‰-6) = precursor of arachidonic acid",
        "LCAT esterifies cholesterol in HDL (needed for RCT)",
        "SREBP pathway: cholesterol ↑ β†’ SREBP ↓ β†’ HMG CoA red ↓",
    ]
    ty = y - 22
    for i, tip in enumerate(tips):
        bg = C_LIGHT_GREEN if i % 2 == 0 else C_YELLOW
        draw_rounded_box(c, col2_x, ty - 14, col_width, 14, fill=bg, stroke=colors.HexColor("#d1d5db"), radius=2)
        c.setFillColor(C_DARK)
        c.setFont("Helvetica", 7.5)
        c.drawString(col2_x + 6, ty - 10, f"βœ“  {tip}")
        ty -= 15

    # Footer
    c.setFillColor(C_GRAY)
    c.setFont("Helvetica", 7.5)
    c.drawCentredString(W/2, 25, "Sources: Lippincott's Illustrated Reviews Biochemistry 8e Β· Harper's Illustrated Biochemistry Β· WBUHS PYQ Bank 2010–2023")
    c.setFont("Helvetica-Bold", 8)
    c.setFillColor(C_DARK_BLUE)
    c.drawCentredString(W/2, 13, "Page 4 of 4  Β·  Lipid Biochemistry Quick Reference β€” MBBS 1st Year")

# ═══════════════════════════════════════════════════════════════
#  MAIN
# ═══════════════════════════════════════════════════════════════
c = canvas.Canvas(OUTPUT, pagesize=A4)
c.setTitle("Lipid Biochemistry Quick Reference")
c.setAuthor("Orris Medical")
c.setSubject("MBBS 1st Year Biochemistry β€” Lipid Chemistry & Metabolism")

draw_cover(c);    c.showPage()
draw_beta_ox(c);  c.showPage()
draw_cholesterol(c); c.showPage()
draw_summary(c);  c.showPage()

c.save()
print(f"PDF saved: {OUTPUT}")
Running Command

cd /home/daytona/workspace/lipid-pdf && python3 generate_lipid_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/lipid-pdf/Lipid_Quick_Reference.pdf

PDF ready hai! Download karo:

Lipid Quick Reference

PDF Document Β· PDF


PDF mein 4 pages hain:
PageContent
Page 1 - CoverTitle page with topic list
Page 2 - Beta-OxidationStep-by-step flowchart: Activation β†’ Carnitine Shuttle β†’ 4-reaction cycle (Γ—7) β†’ ATP yield table (106 ATP)
Page 3 - Cholesterol SynthesisFull pathway: Acetyl CoA β†’ Mevalonate β†’ IPP β†’ Squalene β†’ Lanosterol β†’ Cholesterol, with regulation box (Statins, SREBP)
Page 4 - SummaryBeta-ox vs FA Synthesis comparison table Β· Clinical disorders (MCAD, Refsum, Familial Hypercholesterolemia) Β· 14 high-yield exam points
Color coding:
  • 🟠 Orange = Activation steps
  • 🟒 Green = Rate-limiting / cholesterol
  • πŸ”΅ Blue = Intermediate steps
  • 🟣 Purple = Carnitine shuttle / squalene
  • πŸ”΄ Red = Clinical disorders / inhibitors

Generate the pdf of all questions and answers u generated usko ek pdf mai convert kar doo flow chart ke saath

Writing File

~/lipid-pdf/generate_full_pyq.py

"""
MBBS 1st Year Biochemistry β€” Lipid Chemistry & Metabolism
Complete PYQ + Answers + Flowcharts PDF
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.pdfgen import canvas as rl_canvas
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    PageBreak, HRFlowable, KeepTogether
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus.flowables import Flowable
import io

OUTPUT = "/home/daytona/workspace/lipid-pdf/Lipid_Complete_PYQ_Guide.pdf"
W, H = A4

# ── Colours ──────────────────────────────────────────────────
C_DARK_BLUE   = colors.HexColor("#1a3a5c")
C_BLUE        = colors.HexColor("#2563a8")
C_LIGHT_BLUE  = colors.HexColor("#dbeafe")
C_GREEN       = colors.HexColor("#16a34a")
C_LIGHT_GREEN = colors.HexColor("#dcfce7")
C_ORANGE      = colors.HexColor("#ea580c")
C_LIGHT_ORANGE= colors.HexColor("#ffedd5")
C_PURPLE      = colors.HexColor("#7c3aed")
C_LIGHT_PURPLE= colors.HexColor("#ede9fe")
C_RED         = colors.HexColor("#dc2626")
C_LIGHT_RED   = colors.HexColor("#fee2e2")
C_YELLOW      = colors.HexColor("#fef08a")
C_TEAL        = colors.HexColor("#0d9488")
C_LIGHT_TEAL  = colors.HexColor("#ccfbf1")
C_DARK        = colors.HexColor("#1e293b")
C_GRAY        = colors.HexColor("#64748b")
C_LIGHT_GRAY  = colors.HexColor("#f1f5f9")
C_WHITE       = colors.white
C_AMBER       = colors.HexColor("#d97706")
C_LIGHT_AMBER = colors.HexColor("#fef3c7")

# ════════════════════════════════════════════════════════════════
#  CUSTOM FLOWABLES
# ════════════════════════════════════════════════════════════════

class ColorBox(Flowable):
    """A colored rounded rectangle with title + body text."""
    def __init__(self, title, body_lines, fill, stroke, title_color=None,
                 width=None, padding=8, title_size=10, body_size=8.5):
        Flowable.__init__(self)
        self.title = title
        self.body_lines = body_lines  # list of (text, bold, color, indent)
        self.fill = fill
        self.stroke = stroke
        self.title_color = title_color or stroke
        self.width = width or (W - 80)
        self.padding = padding
        self.title_size = title_size
        self.body_size = body_size
        # Estimate height
        self.height = 20 + len(body_lines) * (body_size + 3) + padding * 2

    def draw(self):
        c = self.canv
        w, h = self.width, self.height
        # Background
        c.setFillColor(self.fill)
        c.setStrokeColor(self.stroke)
        c.setLineWidth(1.2)
        c.roundRect(0, 0, w, h, 7, fill=1, stroke=1)
        # Title bar
        c.setFillColor(self.stroke)
        c.roundRect(0, h - 22, w, 22, 7, fill=1, stroke=0)
        c.rect(0, h - 22, w, 11, fill=1, stroke=0)  # flatten bottom corners
        c.setFillColor(C_WHITE)
        c.setFont("Helvetica-Bold", self.title_size)
        c.drawString(self.padding, h - 15, self.title)
        # Body
        y = h - 28
        for (text, bold, col, indent) in self.body_lines:
            c.setFillColor(col or C_DARK)
            c.setFont("Helvetica-Bold" if bold else "Helvetica", self.body_size)
            c.drawString(self.padding + indent, y, text)
            y -= self.body_size + 3


class QuestionBox(Flowable):
    """Styled question header box."""
    def __init__(self, qnum, qtext, marks="", year="", width=None):
        Flowable.__init__(self)
        self.qnum = qnum
        self.qtext = qtext
        self.marks = marks
        self.year = year
        self.width = width or (W - 80)
        self.height = 36

    def draw(self):
        c = self.canv
        w, h = self.width, self.height
        c.setFillColor(C_DARK_BLUE)
        c.roundRect(0, 0, w, h, 6, fill=1, stroke=0)
        # Q number badge
        c.setFillColor(C_YELLOW)
        c.roundRect(6, 8, 28, 20, 4, fill=1, stroke=0)
        c.setFillColor(C_DARK)
        c.setFont("Helvetica-Bold", 9)
        c.drawCentredString(20, 15, self.qnum)
        # Question text
        c.setFillColor(C_WHITE)
        c.setFont("Helvetica-Bold", 9)
        c.drawString(42, 22, self.qtext[:85])
        if len(self.qtext) > 85:
            c.drawString(42, 10, self.qtext[85:165])
        # Marks / year badge
        if self.marks or self.year:
            badge = []
            if self.marks: badge.append(self.marks)
            if self.year:  badge.append(self.year)
            badge_text = "  |  ".join(badge)
            c.setFillColor(C_ORANGE)
            c.roundRect(w - 115, 10, 108, 16, 4, fill=1, stroke=0)
            c.setFillColor(C_WHITE)
            c.setFont("Helvetica-Bold", 7.5)
            c.drawCentredString(w - 61, 15, badge_text)


class AnswerSection(Flowable):
    """Thin green answer label."""
    def __init__(self, width=None):
        Flowable.__init__(self)
        self.width = width or (W - 80)
        self.height = 16

    def draw(self):
        c = self.canv
        c.setFillColor(C_LIGHT_GREEN)
        c.setStrokeColor(C_GREEN)
        c.setLineWidth(0.8)
        c.roundRect(0, 0, self.width, self.height, 4, fill=1, stroke=1)
        c.setFillColor(C_GREEN)
        c.setFont("Helvetica-Bold", 8)
        c.drawString(8, 4, "βœ…  ANSWER")


class SectionHeader(Flowable):
    """Big section divider."""
    def __init__(self, text, sub="", fill=C_DARK_BLUE, width=None):
        Flowable.__init__(self)
        self.text = text
        self.sub = sub
        self.fill = fill
        self.width = width or (W - 80)
        self.height = 42 if sub else 30

    def draw(self):
        c = self.canv
        c.setFillColor(self.fill)
        c.roundRect(0, 0, self.width, self.height, 7, fill=1, stroke=0)
        c.setFillColor(C_WHITE)
        c.setFont("Helvetica-Bold", 13)
        c.drawCentredString(self.width/2, self.height - 18, self.text)
        if self.sub:
            c.setFillColor(colors.HexColor("#93c5fd"))
            c.setFont("Helvetica", 8.5)
            c.drawCentredString(self.width/2, 6, self.sub)


class BetaOxFlowchart(Flowable):
    """Beta-oxidation flowchart as a Flowable."""
    def __init__(self, width=None):
        Flowable.__init__(self)
        self.width = width or (W - 80)
        self.height = 480

    def _arrow(self, c, x, y, length=16, color=C_GRAY):
        c.setStrokeColor(color)
        c.setFillColor(color)
        c.setLineWidth(1.4)
        c.line(x, y, x, y - length + 5)
        p = c.beginPath()
        p.moveTo(x, y - length)
        p.lineTo(x - 4, y - length + 7)
        p.lineTo(x + 4, y - length + 7)
        p.close()
        c.drawPath(p, fill=1, stroke=0)

    def _arrowr(self, c, x, y, length=20, color=C_GRAY):
        c.setStrokeColor(color)
        c.setFillColor(color)
        c.setLineWidth(1.4)
        c.line(x, y, x + length - 5, y)
        p = c.beginPath()
        p.moveTo(x + length, y)
        p.lineTo(x + length - 7, y + 4)
        p.lineTo(x + length - 7, y - 4)
        p.close()
        c.drawPath(p, fill=1, stroke=0)

    def _box(self, c, cx, y, w, h, label, sub="", fill=C_LIGHT_BLUE, stroke=C_BLUE):
        c.setFillColor(fill)
        c.setStrokeColor(stroke)
        c.setLineWidth(1)
        c.roundRect(cx - w/2, y - h, w, h, 6, fill=1, stroke=1)
        c.setFillColor(stroke)
        c.setFont("Helvetica-Bold", 8)
        if sub:
            c.drawCentredString(cx, y - h*0.35, label)
            c.setFillColor(C_GRAY)
            c.setFont("Helvetica", 7)
            c.drawCentredString(cx, y - h*0.72, sub)
        else:
            c.drawCentredString(cx, y - h*0.57, label)

    def _enz(self, c, x, y, text, color=C_ORANGE):
        c.setFillColor(color)
        c.setFont("Helvetica-Oblique", 6.5)
        c.drawString(x, y, text)

    def draw(self):
        c = self.canv
        CX = self.width / 2
        BW = 170
        BH = 30
        y = self.height - 5

        # Title
        c.setFillColor(C_DARK_BLUE)
        c.roundRect(0, y - 22, self.width, 22, 5, fill=1, stroke=0)
        c.setFillColor(C_WHITE)
        c.setFont("Helvetica-Bold", 10)
        c.drawCentredString(CX, y - 15, "Ξ²-OXIDATION FLOWCHART β€” Palmitic Acid (C16:0)")
        y -= 28

        # ACTIVATION
        c.setFillColor(C_LIGHT_AMBER)
        c.setStrokeColor(C_AMBER)
        c.setLineWidth(0.8)
        c.roundRect(0, y - 16, self.width, 16, 3, fill=1, stroke=1)
        c.setFillColor(colors.HexColor("#92400e"))
        c.setFont("Helvetica-Bold", 7.5)
        c.drawString(6, y - 11, "STEP 0 β€” ACTIVATION (Cytoplasm)")
        y -= 22

        self._box(c, CX, y, BW, BH, "Palmitic Acid (C16:0)", "Free fatty acid in cytoplasm",
                  fill=C_LIGHT_ORANGE, stroke=C_ORANGE)
        self._enz(c, CX + BW/2 + 4, y - 8, "Acyl CoA Synthetase")
        self._enz(c, CX + BW/2 + 4, y - 16, "ATP β†’ AMP + PPi  (cost: 2 ATP)", color=C_RED)
        self._arrow(c, CX, y - BH, 18, C_ORANGE)
        y -= BH + 22

        self._box(c, CX, y, BW, BH, "Palmitoyl CoA", "Activated fatty acid",
                  fill=C_LIGHT_ORANGE, stroke=C_ORANGE)
        y -= BH + 8

        # CARNITINE SHUTTLE
        c.setFillColor(C_LIGHT_PURPLE)
        c.setStrokeColor(C_PURPLE)
        c.setLineWidth(0.8)
        c.roundRect(0, y - 16, self.width, 16, 3, fill=1, stroke=1)
        c.setFillColor(C_PURPLE)
        c.setFont("Helvetica-Bold", 7.5)
        c.drawString(6, y - 11, "CARNITINE SHUTTLE β€” Transport into Mitochondria")
        y -= 20

        sx = 10
        for i, (nm, nt) in enumerate([
            ("Palmitoyl CoA", "Outer membrane"),
            ("Palmitoyl-Carnitine", "CPT-I (rate-limiting)"),
            ("Palmitoyl CoA", "Matrix (CPT-II)")
        ]):
            self._box(c, sx + 75, y, 140, 26, nm, nt, fill=C_LIGHT_PURPLE, stroke=C_PURPLE)
            if i < 2:
                self._arrowr(c, sx + 145, y - 13, 18, C_PURPLE)
            sx += 158
        # malonyl CoA inhibition note
        c.setFillColor(C_RED)
        c.setFont("Helvetica-Bold", 6.5)
        c.drawString(6, y - 30, "βŠ— CPT-I inhibited by Malonyl CoA (prevents futile cycling when FA synthesis is active)")
        y -= BH + 20

        # 4-STEP CYCLE
        c.setFillColor(C_LIGHT_GREEN)
        c.setStrokeColor(C_GREEN)
        c.setLineWidth(0.8)
        c.roundRect(0, y - 16, self.width, 16, 3, fill=1, stroke=1)
        c.setFillColor(C_GREEN)
        c.setFont("Helvetica-Bold", 7.5)
        c.drawString(6, y - 11, "Ξ²-OXIDATION CYCLE Γ— 7  (4 reactions per cycle β€” Mitochondrial Matrix)")
        y -= 22

        steps4 = [
            ("① Dehydrogenation", "Acyl CoA\nDehydrogenase", "FAD→FADH₂", C_LIGHT_BLUE, C_BLUE),
            ("β‘‘ Hydration", "Enoyl CoA\nHydratase", "+Hβ‚‚O", C_LIGHT_GREEN, C_GREEN),
            ("β‘’ Dehydrogenation", "3-OH Acyl CoA\nDehydrogenase", "NAD⁺→NADH", C_LIGHT_ORANGE, C_ORANGE),
            ("④ Thiolysis", "Beta-Ketothiolase", "+CoA→Acetyl CoA", C_LIGHT_PURPLE, C_PURPLE),
        ]
        bw4 = (self.width - 10) / 4 - 6
        sx4 = 5
        for i, (step, enz, cofactor, fill, stroke) in enumerate(steps4):
            c.setFillColor(fill)
            c.setStrokeColor(stroke)
            c.setLineWidth(1)
            c.roundRect(sx4, y - 44, bw4, 44, 5, fill=1, stroke=1)
            c.setFillColor(stroke)
            c.setFont("Helvetica-Bold", 7.5)
            c.drawCentredString(sx4 + bw4/2, y - 12, step)
            e_lines = enz.split("\n")
            c.setFillColor(C_DARK)
            c.setFont("Helvetica", 6.5)
            c.drawCentredString(sx4 + bw4/2, y - 23, e_lines[0])
            if len(e_lines) > 1:
                c.drawCentredString(sx4 + bw4/2, y - 31, e_lines[1])
            c.setFillColor(C_ORANGE)
            c.setFont("Helvetica-Bold", 6.5)
            c.drawCentredString(sx4 + bw4/2, y - 40, cofactor)
            if i < 3:
                self._arrowr(c, sx4 + bw4, y - 22, 6, stroke)
            sx4 += bw4 + 6

        y -= 52
        c.setFillColor(C_LIGHT_AMBER)
        c.setStrokeColor(C_AMBER)
        c.setLineWidth(0.8)
        c.roundRect(0, y - 16, self.width, 16, 4, fill=1, stroke=1)
        c.setFillColor(colors.HexColor("#92400e"))
        c.setFont("Helvetica-Bold", 8)
        c.drawCentredString(CX, y - 10,
            "πŸ”  Repeat Γ— 7  β†’  Products: 7 FADHβ‚‚  +  7 NADH  +  8 Acetyl CoA")
        y -= 22

        # ATP TABLE
        c.setFillColor(C_DARK_BLUE)
        c.roundRect(0, y - 16, self.width, 16, 3, fill=1, stroke=0)
        c.setFillColor(C_WHITE)
        c.setFont("Helvetica-Bold", 8)
        c.drawCentredString(CX, y - 11, "⚑  NET ATP YIELD")
        y -= 20

        rows = [
            ("Source", "Count", "ATP/unit", "Subtotal", True),
            ("8 Γ— Acetyl CoA  β†’  TCA cycle", "8", "Γ—10", "= 80", False),
            ("7 Γ— NADH  β†’  ETC", "7", "Γ—2.5", "= 17.5", False),
            ("7 Γ— FADHβ‚‚  β†’  ETC", "7", "Γ—1.5", "= 10.5", False),
            ("Activation cost  (ATP→AMP)", "—", "-2", "= -2", False),
            ("NET TOTAL ATP", "", "", "= 106 ATP ⭐", True),
        ]
        fills_atp = [C_BLUE, C_LIGHT_GREEN, C_LIGHT_BLUE, C_LIGHT_ORANGE, C_LIGHT_RED, C_DARK_BLUE]
        txt_cols = [C_WHITE, C_DARK, C_DARK, C_DARK, C_DARK, C_WHITE]
        col_xw = [(0, self.width*0.44), (self.width*0.44, self.width*0.14),
                  (self.width*0.58, self.width*0.17), (self.width*0.75, self.width*0.25)]
        for ri, (row, rf, tc) in enumerate(zip(rows, fills_atp, txt_cols)):
            rx = 0
            for ci, (val, (cx2, cw)) in enumerate(zip(row[:4], col_xw)):
                c.setFillColor(rf)
                c.setStrokeColor(colors.HexColor("#cbd5e1"))
                c.setLineWidth(0.5)
                c.rect(rx, y - 14, cw - 1, 14, fill=1, stroke=1)
                font = "Helvetica-Bold" if row[4] else "Helvetica"
                c.setFillColor(tc)
                c.setFont(font, 7.5 if ri > 0 else 8)
                c.drawCentredString(rx + cw/2, y - 9.5, val)
                rx += cw
            y -= 14


class CholSynthFlowchart(Flowable):
    """Cholesterol synthesis flowchart as a Flowable."""
    def __init__(self, width=None):
        Flowable.__init__(self)
        self.width = width or (W - 80)
        self.height = 500

    def _arrow(self, c, x, y, length=16, color=C_GREEN):
        c.setStrokeColor(color)
        c.setFillColor(color)
        c.setLineWidth(1.4)
        c.line(x, y, x, y - length + 5)
        p = c.beginPath()
        p.moveTo(x, y - length)
        p.lineTo(x - 4, y - length + 7)
        p.lineTo(x + 4, y - length + 7)
        p.close()
        c.drawPath(p, fill=1, stroke=0)

    def draw(self):
        c = self.canv
        CX = self.width / 2
        BW = 190
        BH = 30
        y = self.height - 5

        # Title
        c.setFillColor(C_GREEN)
        c.roundRect(0, y - 22, self.width, 22, 5, fill=1, stroke=0)
        c.setFillColor(C_WHITE)
        c.setFont("Helvetica-Bold", 10)
        c.drawCentredString(CX, y - 15, "CHOLESTEROL SYNTHESIS (de novo)")
        y -= 28

        # Stage headers + steps
        stages = [
            # (stage_hdr, steps_list)
            # steps: (label, sublabel, fill, stroke, enzyme, is_rate_limiting)
            ("STAGE 1 β€” HMG CoA Formation  (Cytosol / Mitochondria)", C_ORANGE, [
                ("Acetyl CoA  (2C)", "Starting material", C_LIGHT_ORANGE, C_ORANGE, None, False),
                ("Acetoacetyl CoA  (4C)", "2 Acetyl CoA condensed", C_LIGHT_ORANGE, C_ORANGE, "Thiolase", False),
                ("HMG CoA  (6C)", "3-Hydroxy-3-Methylglutaryl CoA", C_LIGHT_ORANGE, C_ORANGE, "HMG CoA Synthase", False),
            ]),
            ("STAGE 2 β€” Mevalonate Synthesis  β˜… RATE-LIMITING", C_RED, [
                ("Mevalonate  (6C)", "β˜… RATE-LIMITING  |  Target of Statins", C_LIGHT_GREEN, C_GREEN,
                 "β˜… HMG CoA Reductase  (2 NADPH used)", True),
            ]),
            ("STAGE 3 β€” Activation & Decarboxylation  (Cytosol)", C_BLUE, [
                ("Mevalonate-5-Phosphate", "ATP used", C_LIGHT_BLUE, C_BLUE, "Mevalonate Kinase", False),
                ("Mevalonate-5-Pyrophosphate", "Second phosphorylation", C_LIGHT_BLUE, C_BLUE, "Phosphomevalonate Kinase", False),
                ("Isopentenyl-PP  (IPP, 5C)", "Active isoprene unit  |  COβ‚‚ released", C_LIGHT_BLUE, C_BLUE,
                 "Mevalonate-PP Decarboxylase (ATP, CO₂↑)", False),
            ]),
            ("STAGE 4 β€” Squalene Synthesis", C_PURPLE, [
                ("Geranyl-PP (10C)  β†’  Farnesyl-PP (15C)", "2 IPP β†’ GPP; 3 IPP β†’ FPP", C_LIGHT_PURPLE, C_PURPLE,
                 "Geranyl / Farnesyl Transferases", False),
                ("Squalene  (30C)", "2 Γ— FPP joined  (2 NADPH)", C_LIGHT_PURPLE, C_PURPLE,
                 "Squalene Synthase", False),
            ]),
            ("STAGE 5 β€” Ring Formation & Modifications  (SER)", C_TEAL, [
                ("Lanosterol  (30C)", "First sterol β€” ring cyclization", C_LIGHT_TEAL, C_TEAL,
                 "Squalene Monooxygenase + Cyclase (Oβ‚‚, NADPH)", False),
                ("Cholesterol  (27C)", "Final product  |  ~19 steps, 3C lost", C_LIGHT_GREEN, C_GREEN,
                 "Multiple demethylation/reduction enzymes", False),
            ]),
        ]

        for stage_label, stage_color, steps in stages:
            # Stage header
            c.setFillColor(stage_color)
            c.roundRect(0, y - 16, self.width, 16, 3, fill=1, stroke=0)
            c.setFillColor(C_WHITE)
            c.setFont("Helvetica-Bold", 7.5)
            c.drawString(6, y - 11, stage_label)
            y -= 20

            for (lbl, sub, fill, stroke, enz, is_rl) in steps:
                # Enzyme label + arrow
                if enz:
                    enz_color = C_RED if is_rl else C_ORANGE
                    c.setFillColor(enz_color)
                    c.setFont("Helvetica-Bold" if is_rl else "Helvetica-Oblique", 6.5)
                    c.drawCentredString(CX + BW/2 + 45, y - 5, enz)
                    self._arrow(c, CX, y, 14, C_GREEN)
                    y -= 17

                # Compound box
                c.setFillColor(fill)
                c.setStrokeColor(stroke)
                c.setLineWidth(1.2 if is_rl else 0.8)
                c.roundRect(CX - BW/2, y - BH, BW, BH, 6, fill=1, stroke=1)
                c.setFillColor(stroke)
                c.setFont("Helvetica-Bold", 8)
                c.drawCentredString(CX, y - BH*0.38, lbl)
                c.setFillColor(C_GRAY)
                c.setFont("Helvetica", 6.5)
                c.drawCentredString(CX, y - BH*0.75, sub)
                y -= BH + 2

            y -= 4

        # Downstream products note
        c.setFillColor(C_LIGHT_AMBER)
        c.setStrokeColor(C_AMBER)
        c.setLineWidth(0.8)
        c.roundRect(0, y - 22, self.width, 22, 5, fill=1, stroke=1)
        c.setFillColor(C_AMBER)
        c.setFont("Helvetica-Bold", 8)
        c.drawString(6, y - 9, "Other products of Mevalonate pathway:")
        c.setFillColor(C_DARK)
        c.setFont("Helvetica", 7)
        c.drawString(6, y - 18,
            "Dolichol (protein glycosylation)  Β·  Ubiquinone (ETC)  Β·  Isoprenoids  Β·  Farnesyl groups (protein prenylation)")


# ════════════════════════════════════════════════════════════════
#  STYLES
# ════════════════════════════════════════════════════════════════
styles = getSampleStyleSheet()

def S(name, **kw):
    """Create a ParagraphStyle."""
    return ParagraphStyle(name, **kw)

sNormal = S("MyNormal", fontName="Helvetica", fontSize=8.5, leading=13,
            textColor=C_DARK, spaceAfter=4)
sBold   = S("MyBold", fontName="Helvetica-Bold", fontSize=8.5, leading=13,
            textColor=C_DARK, spaceAfter=4)
sBody   = S("MyBody", fontName="Helvetica", fontSize=8.5, leading=13.5,
            textColor=C_DARK, spaceAfter=3, leftIndent=6)
sPoint  = S("MyPoint", fontName="Helvetica", fontSize=8.5, leading=13,
            textColor=C_DARK, spaceAfter=2, leftIndent=14)
sSubHdr = S("MySubHdr", fontName="Helvetica-Bold", fontSize=9, leading=14,
            textColor=C_DARK_BLUE, spaceAfter=3, spaceBefore=5)
sNote   = S("MyNote", fontName="Helvetica-Oblique", fontSize=7.5, leading=11,
            textColor=C_GRAY, spaceAfter=3)
sTableHdr = S("TH", fontName="Helvetica-Bold", fontSize=8, leading=10,
              textColor=C_WHITE, alignment=TA_CENTER)
sTableCell= S("TC", fontName="Helvetica", fontSize=7.5, leading=10,
              textColor=C_DARK, alignment=TA_LEFT)
sTableCellB=S("TCB", fontName="Helvetica-Bold", fontSize=7.5, leading=10,
              textColor=C_DARK, alignment=TA_LEFT)


def p(text, style=None):
    return Paragraph(text, style or sBody)

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

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


def make_table(headers, rows, col_widths, hdr_fill=C_BLUE):
    data = [[Paragraph(h, sTableHdr) for h in headers]]
    for row in rows:
        data.append([Paragraph(str(cell), sTableCell) for cell in row])
    t = Table(data, colWidths=col_widths)
    style_cmds = [
        ('BACKGROUND', (0, 0), (-1, 0), hdr_fill),
        ('TEXTCOLOR',  (0, 0), (-1, 0), C_WHITE),
        ('ROWBACKGROUNDS', (0, 1), (-1, -1), [C_LIGHT_GRAY, C_WHITE]),
        ('GRID', (0, 0), (-1, -1), 0.5, colors.HexColor("#cbd5e1")),
        ('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
        ('TOPPADDING', (0, 0), (-1, -1), 4),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 4),
        ('LEFTPADDING', (0, 0), (-1, -1), 5),
        ('RIGHTPADDING', (0, 0), (-1, -1), 5),
        ('FONTSIZE', (0, 0), (-1, 0), 8),
    ]
    t.setStyle(TableStyle(style_cmds))
    return t


# ════════════════════════════════════════════════════════════════
#  PAGE TEMPLATE (header / footer on every page)
# ════════════════════════════════════════════════════════════════
PAGE_NUM = [0]

def on_page(canvas, doc):
    PAGE_NUM[0] += 1
    canvas.saveState()
    # Header strip
    canvas.setFillColor(C_DARK_BLUE)
    canvas.rect(0, H - 28, W, 28, fill=1, stroke=0)
    canvas.setFillColor(C_WHITE)
    canvas.setFont("Helvetica-Bold", 8.5)
    canvas.drawString(20, H - 18, "MBBS 1st Year Biochemistry  Β·  Lipid Chemistry & Metabolism  Β·  PYQ Guide")
    canvas.setFillColor(C_YELLOW)
    canvas.setFont("Helvetica-Bold", 8)
    canvas.drawRightString(W - 20, H - 18, f"Page {PAGE_NUM[0]}")
    # Footer strip
    canvas.setFillColor(C_LIGHT_GRAY)
    canvas.rect(0, 0, W, 18, fill=1, stroke=0)
    canvas.setFillColor(C_GRAY)
    canvas.setFont("Helvetica", 6.5)
    canvas.drawCentredString(W/2, 5,
        "Sources: WBUHS PYQ Bank 2010–2023  Β·  Lippincott's Illustrated Reviews Biochemistry 8e  Β·  Harper's Illustrated Biochemistry")
    canvas.restoreState()


# ════════════════════════════════════════════════════════════════
#  BUILD CONTENT
# ════════════════════════════════════════════════════════════════
story = []
SP = sp

# ─── COVER ────────────────────────────────────────────────────
# (cover is page 1, drawn in on_page header)
story.append(sp(30))
story.append(SectionHeader(
    "LIPID CHEMISTRY & METABOLISM",
    sub="Complete PYQ Guide with Answers & Flowcharts  Β·  MBBS 1st Year Biochemistry",
    fill=C_DARK_BLUE))
story.append(sp(10))
story.append(SectionHeader("MBBS 1st Year β€” University Exam 2013–2023",
                            sub="WBUHS & Other Indian Universities",
                            fill=C_BLUE))
story.append(sp(12))

toc_data = [
    ["Section", "Topics Covered", "Page"],
    ["A. Long Answer (LAQ)", "Beta-oxidation Β· Cholesterol synthesis Β· FA synthesis Β· VLDL", "2–5"],
    ["B. Short Notes (SN)", "Ketone bodies Β· Lipoproteins Β· Phospholipids Β· Fatty liver", "5–8"],
    ["C. Explain the Reason (EQ)", "Fatβ†’Glucose Β· Beta-ox β†’ Hypoglycemia", "8–9"],
    ["D. Flowchart: Beta-Oxidation", "Step-by-step with ATP table", "10"],
    ["E. Flowchart: Cholesterol", "HMG CoA β†’ Cholesterol pathway", "11"],
    ["F. High-Yield Summary Table", "Comparison, disorders, exam tips", "12"],
]
story.append(make_table(
    ["Section", "Topics Covered", "Page"],
    toc_data[1:],
    [120, 270, 50],
    hdr_fill=C_DARK_BLUE
))
story.append(sp(8))

# Frequency chart
freq = [
    ("Beta-oxidation + ATP calculation", "β˜…β˜…β˜…β˜…β˜…", "2013,15,17,18,19,20,21,22"),
    ("Cholesterol synthesis + HMG CoA reductase", "β˜…β˜…β˜…β˜…β˜…", "2013–2023 almost every year"),
    ("Ketone bodies", "β˜…β˜…β˜…β˜…β˜…", "2010,12,14,15,16,17,18,19,20,21"),
    ("Lipoproteins / VLDL / RCT", "β˜…β˜…β˜…β˜…", "2011,13,14,15,16,17,18,19,20"),
    ("Fatty acid synthesis / FAS complex", "β˜…β˜…β˜…β˜…", "2014,15,16,17,18,19,21"),
    ("Phospholipids / Lecithin / Phospholipases", "β˜…β˜…β˜…", "2010,13,18,19,22"),
    ("Fatty liver + Lipotropic factors", "β˜…β˜…β˜…", "2012,14,16,18,20"),
    ("Essential fatty acids", "β˜…β˜…β˜…", "2010,13,14,15,17,19"),
]
story.append(SectionHeader("⭐ FREQUENCY TABLE β€” Most Repeated Topics", fill=C_AMBER))
story.append(sp(4))
story.append(make_table(
    ["Topic", "Frequency", "Exam Years"],
    freq,
    [200, 70, 170],
    hdr_fill=C_AMBER
))
story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
#  SECTION A: LONG ANSWER QUESTIONS
# ════════════════════════════════════════════════════════════════
story.append(SectionHeader("SECTION A β€” LONG ANSWER QUESTIONS (LAQ)  |  10–12 Marks",
                            sub="Essay-type questions requiring detailed answers with diagrams",
                            fill=C_DARK_BLUE))
story.append(sp(8))

# ── Q1 Beta-oxidation ─────────────────────────────────────────
story.append(QuestionBox("Q1",
    "Describe beta-oxidation of palmitic acid. Calculate net ATP. How does oxidation of oleic acid differ?",
    "[8+2+2]", "WBUHS 2017-S, 2015, 2019, 2020"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))

story.append(p("<b>BETA-OXIDATION OF PALMITIC ACID (C16:0)</b>", sSubHdr))
story.append(p("Beta-oxidation is the major pathway for oxidation of fatty acids. It occurs in the <b>mitochondrial matrix</b>. Palmitic acid (16 carbons) undergoes <b>7 cycles</b> to yield <b>8 Acetyl CoA</b>.", sBody))
story.append(sp(4))

story.append(p("<b>Step 0 β€” Activation (Cytoplasm):</b>", sBold))
story.append(p("Palmitate + CoA + ATP β†’ Palmitoyl CoA + AMP + PPi  (catalysed by Acyl CoA Synthetase / Thiokinase)", sBody))
story.append(p("Cost = 2 ATP equivalents (ATP β†’ AMP = 2 high-energy bonds broken)", sPoint))

story.append(p("<b>Carnitine Shuttle (transport across inner mitochondrial membrane):</b>", sBold))
story.append(p("β€’ Palmitoyl CoA + Carnitine β†’ Palmitoyl-Carnitine  (CPT-I, outer membrane)", sPoint))
story.append(p("β€’ Palmitoyl-Carnitine crosses via Translocase (antiport with free carnitine)", sPoint))
story.append(p("β€’ Palmitoyl-Carnitine + CoA β†’ Palmitoyl CoA + Carnitine  (CPT-II, inner membrane)", sPoint))
story.append(p("β€’ <b>CPT-I is the rate-limiting step</b> β€” inhibited by <b>Malonyl CoA</b> (prevents futile cycling)", sPoint))

story.append(sp(4))
story.append(p("<b>4 Reactions of Each Beta-Oxidation Cycle:</b>", sBold))
story.append(make_table(
    ["Step", "Reaction", "Enzyme", "Coenzyme/Product"],
    [
        ["β‘  Dehydrogenation", "Acyl CoA β†’ Trans-2-Enoyl CoA", "Acyl CoA Dehydrogenase", "FAD β†’ FADHβ‚‚"],
        ["β‘‘ Hydration", "Enoyl CoA β†’ L-3-Hydroxyacyl CoA", "Enoyl CoA Hydratase", "Hβ‚‚O added"],
        ["β‘’ Dehydrogenation", "Hydroxyacyl CoA β†’ 3-Ketoacyl CoA", "3-OH Acyl CoA Dehydrogenase", "NAD⁺ β†’ NADH"],
        ["β‘£ Thiolysis", "Ketoacyl CoA β†’ Acetyl CoA + shortened acyl CoA", "Beta-Ketothiolase", "CoA-SH consumed"],
    ],
    [55, 155, 130, 100],
    hdr_fill=C_BLUE
))
story.append(sp(4))

story.append(p("<b>ATP Calculation:</b>", sBold))
story.append(make_table(
    ["Source", "Count", "ATP/unit", "Subtotal"],
    [
        ["8 Γ— Acetyl CoA β†’ TCA cycle", "8", "Γ— 10", "= 80"],
        ["7 Γ— NADH β†’ ETC (P/O ratio 2.5)", "7", "Γ— 2.5", "= 17.5"],
        ["7 Γ— FADHβ‚‚ β†’ ETC (P/O ratio 1.5)", "7", "Γ— 1.5", "= 10.5"],
        ["Activation cost (ATP β†’ AMP = 2 bonds)", "1", "βˆ’2", "= βˆ’2"],
    ],
    [200, 60, 80, 100],
    hdr_fill=C_GREEN
))
story.append(p("<b>Net ATP from Palmitic Acid = 80 + 17.5 + 10.5 βˆ’ 2 = 106 ATP</b>", sSubHdr))
story.append(sp(4))

story.append(p("<b>Difference for Oleic Acid (C18:1, Ξ”9):</b>", sBold))
story.append(p("β€’ After 3 normal beta-oxidation cycles, a <b>cis-3-enoyl CoA</b> intermediate is produced", sPoint))
story.append(p("β€’ Extra enzyme needed: <b>3,2-Enoyl CoA Isomerase</b> converts cis-3 to trans-2 derivative", sPoint))
story.append(p("β€’ This isomerase step bypasses the Acyl CoA Dehydrogenase step β†’ <b>1 FADHβ‚‚ not produced</b>", sPoint))
story.append(p("β€’ Net ATP for oleic acid β‰ˆ 106 βˆ’ 1.5 = <b>~104.5 ATP</b> (approximately 2 ATP less than palmitate)", sPoint))
story.append(p("β€’ Linoleic acid (C18:2, Ξ”9,12) needs both the isomerase AND an NADPH-dependent 2,4-dienoyl CoA reductase β†’ even fewer ATP", sPoint))
story.append(sp(6))
story.append(hr())

# ── Q2 Cholesterol Synthesis ───────────────────────────────────
story.append(QuestionBox("Q2",
    "Describe biosynthesis of cholesterol. Name regulatory enzyme. Explain reverse cholesterol transport.",
    "[8+2+2]", "WBUHS 2013–2023 (Most frequent)"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))

story.append(p("<b>CHOLESTEROL SYNTHESIS (de novo)</b>", sSubHdr))
story.append(p("β€’ All 27 carbons derived from <b>Acetyl CoA</b> | Site: mainly <b>liver</b>, also intestine, adrenal, gonads", sBody))
story.append(p("β€’ Location: Cytosol + Smooth Endoplasmic Reticulum (SER)", sBody))
story.append(sp(4))

chol_steps = [
    ["Stage 1 β€” HMG CoA", "2 Acetyl CoA β†’ Acetoacetyl CoA (Thiolase)\nAcetoacetyl CoA + Acetyl CoA β†’ HMG CoA (HMG CoA Synthase)", "Cytosol / Mitochondria"],
    ["Stage 2 β€” Mevalonate β˜…", "HMG CoA + 2NADPH β†’ Mevalonate\nβ˜… HMG CoA Reductase (RATE-LIMITING)", "Cytosol (ER membrane)"],
    ["Stage 3 — Activation", "Mevalonate → Mevalonate-5-P → Mevalonate-5-PP\n→ Isopentenyl-PP (IPP, 5C) + CO₂", "Cytosol"],
    ["Stage 4 β€” Squalene", "3 IPP β†’ Farnesyl-PP (15C)\n2 Farnesyl-PP β†’ Squalene (30C) by Squalene Synthase", "Cytosol"],
    ["Stage 5 β€” Cholesterol", "Squalene β†’ Lanosterol (ring cyclization, Oβ‚‚ needed)\nLanosterol β†’ Cholesterol (~19 steps, 3C lost)", "SER"],
]
story.append(make_table(
    ["Stage", "Key Reactions", "Location"],
    chol_steps,
    [100, 240, 100],
    hdr_fill=C_GREEN
))
story.append(sp(4))

story.append(p("<b>Regulatory Enzyme β€” HMG CoA Reductase:</b>", sBold))
story.append(p("β€’ <b>Rate-limiting enzyme</b> of cholesterol synthesis", sPoint))
story.append(p("β€’ <b>Activated by:</b> Insulin, Thyroid hormone (T3)", sPoint))
story.append(p("β€’ <b>Inhibited by:</b> High cholesterol (via SREBP↓), Glucagon, Glucocorticoids", sPoint))
story.append(p("β€’ <b>Statins</b> (e.g., Atorvastatin, Rosuvastatin) = competitive inhibitors β†’ ↓ LDL cholesterol", sPoint))
story.append(p("β€’ SREBP (Sterol Regulatory Element Binding Protein): when cholesterol is low, SREBP is activated β†’ increases HMG CoA reductase expression", sPoint))
story.append(sp(4))

story.append(p("<b>Reverse Cholesterol Transport (RCT):</b>", sBold))
story.append(p("Process by which excess cholesterol is returned from <b>peripheral tissues β†’ liver</b> for excretion.", sBody))
story.append(make_table(
    ["Step", "Process", "Key Player"],
    [
        ["1", "Lipid-poor ApoA-I (nascent HDL) picks up free cholesterol from peripheral cells", "ABCA1 transporter"],
        ["2", "Free cholesterol esterified on HDL surface (HDL3 β†’ HDL2)", "LCAT enzyme"],
        ["3", "Some CE transferred from HDL to LDL/VLDL in exchange for TGs", "CETP (Cholesteryl Ester Transfer Protein)"],
        ["4", "Liver selectively takes up cholesterol esters from mature HDL", "SR-B1 receptor"],
        ["5", "Cholesterol β†’ Bile acids β†’ Excreted in bile", "Liver enzymes"],
    ],
    [30, 260, 140],
    hdr_fill=C_TEAL
))
story.append(p("<b>Clinical:</b> Low HDL = impaired RCT = increased atherosclerosis risk. HDL is called 'good cholesterol'.", sNote))
story.append(sp(6))
story.append(hr())

# ── Q3 Fatty Acid Synthesis ────────────────────────────────────
story.append(QuestionBox("Q3",
    "Describe de novo fatty acid synthesis. Name enzymes of fatty acid synthase complex.",
    "[10+2]", "WBUHS 2014–2021"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))

story.append(p("<b>FATTY ACID SYNTHESIS (de novo)</b>", sSubHdr))
story.append(p("Occurs in <b>cytosol</b>. Requires <b>NADPH</b> (from PPP + malic enzyme) and HCO₃⁻. Main product = <b>Palmitate (C16:0)</b>. Site: liver and adipose tissue.", sBody))
story.append(sp(4))

story.append(p("<b>Step 1 β€” Carboxylation (Rate-limiting step):</b>", sBold))
story.append(p("Acetyl CoA + COβ‚‚ + ATP β†’ <b>Malonyl CoA</b>  (via <b>Acetyl CoA Carboxylase, ACC</b>)", sBody))
story.append(p("β€’ ACC is the <b>rate-limiting enzyme</b> of FA synthesis", sPoint))
story.append(p("β€’ <b>Activated by:</b> Citrate, Insulin | <b>Inhibited by:</b> Palmitoyl CoA, Glucagon, AMPK", sPoint))
story.append(sp(4))

story.append(p("<b>Fatty Acid Synthase (FAS) Complex β€” 7 Domains:</b>", sBold))
story.append(make_table(
    ["Domain / Enzyme", "Function", "Notes"],
    [
        ["ACP (Acyl Carrier Protein)", "Carries growing fatty acid chain", "4'-phosphopantetheine as prosthetic group"],
        ["Acetyl Transacylase", "Transfers acetyl group to Cys-SH of KS", "Primer loading"],
        ["Malonyl Transacylase", "Transfers malonyl to ACP-SH", "Extender loading"],
        ["Beta-Ketoacyl Synthase (condensing enz.)", "Condensation β€” releases COβ‚‚", "C-C bond formation"],
        ["Beta-Ketoacyl Reductase", "Reduction of keto group", "Uses NADPH"],
        ["Beta-Hydroxyacyl Dehydratase", "Dehydration", "Removes Hβ‚‚O"],
        ["Enoyl Reductase", "Final reduction", "Uses NADPH"],
        ["Thioesterase", "Releases palmitate from ACP", "After 7 elongation cycles"],
    ],
    [145, 150, 145],
    hdr_fill=C_PURPLE
))
story.append(sp(4))
story.append(p("<b>Each elongation cycle uses:</b> 1 Malonyl CoA + 2 NADPH | 7 cycles β†’ Palmitate (C16)", sBody))
story.append(p("<b>Overall equation:</b> 8 Acetyl CoA + 7 ATP + 14 NADPH β†’ Palmitate + 8 CoA + 7 ADP + 7 Pi + 14 NADP⁺ + 6 Hβ‚‚O", sNote))
story.append(sp(6))
story.append(hr())

# ── Q4 VLDL ──────────────────────────────────────────────────
story.append(QuestionBox("Q4",
    "Write the metabolism of VLDL. Explain reverse cholesterol transport.",
    "[8+4]", "WBUHS 2013–2020"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))

story.append(p("<b>VLDL (Very Low Density Lipoprotein) METABOLISM</b>", sSubHdr))
story.append(p("VLDL = endogenous lipid transport vehicle | Carries TG made in <b>liver</b> to peripheral tissues", sBody))
story.append(sp(4))

story.append(make_table(
    ["Step", "Event", "Enzyme/Receptor"],
    [
        ["1. Synthesis", "Liver assembles TG + Cholesterol + ApoB-100 + ApoC-II + ApoE β†’ VLDL particle", "MTP (Microsomal Triglyceride Transfer Protein)"],
        ["2. Secretion", "VLDL secreted into blood via Golgi", "β€”"],
        ["3. TG Hydrolysis", "In capillaries of muscle/adipose: TG hydrolysed β†’ FFAs enter cells", "LPL (activated by ApoC-II)"],
        ["4. VLDL β†’ IDL", "VLDL loses TG β†’ becomes denser IDL (remnant)", "β€”"],
        ["5. IDL fate (50%)", "Taken up by liver via LDL receptor (ApoE recognition)", "LDL receptor"],
        ["6. IDL β†’ LDL (50%)", "Remaining IDL: TG further removed β†’ LDL (most cholesterol-rich)", "Hepatic Lipase"],
        ["7. LDL clearance", "LDL taken up by liver/tissues via LDL receptor (ApoB-100 ligand)", "LDL receptor"],
    ],
    [55, 220, 155],
    hdr_fill=C_BLUE
))
story.append(sp(4))
story.append(p("<b>VLDL β†’ IDL β†’ LDL</b> is the key cascade. LDL is the main cholesterol carrier in blood.", sBody))
story.append(p("<b>Clinical:</b> Elevated VLDL β†’ hypertriglyceridemia. Elevated LDL β†’ atherosclerosis. Familial hypercholesterolemia = defective LDL receptor.", sNote))
story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
#  SECTION B: SHORT NOTES
# ════════════════════════════════════════════════════════════════
story.append(SectionHeader("SECTION B β€” SHORT NOTES (SN)  |  5–7 Marks",
                            sub="Brief but complete answers required",
                            fill=C_TEAL))
story.append(sp(8))

# ── SN1: Ketone Bodies ────────────────────────────────────────
story.append(QuestionBox("SN1",
    "Ketone bodies β€” formation, utilization, and clinical significance (Diabetic Ketoacidosis)",
    "[5–7 marks]", "WBUHS 2010–2022 (Very frequent)"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))

story.append(p("<b>Ketone Bodies:</b> Acetoacetate, Beta-hydroxybutyrate (BHB), Acetone", sSubHdr))
story.append(p("<b>Site of Formation (Ketogenesis):</b> Liver mitochondria only", sBody))
story.append(p("<b>When formed?</b> Starvation, T1 Diabetes, high-fat diet β†’ excess Acetyl CoA exceeds TCA cycle capacity", sBody))
story.append(sp(3))

story.append(p("<b>Steps of Ketogenesis:</b>", sBold))
story.append(make_table(
    ["Step", "Reaction", "Enzyme"],
    [
        ["1", "2 Acetyl CoA β†’ Acetoacetyl CoA", "Thiolase"],
        ["2", "Acetoacetyl CoA + Acetyl CoA β†’ HMG CoA (6C)", "HMG CoA Synthase (mitochondrial)"],
        ["3", "HMG CoA β†’ Acetoacetate + Acetyl CoA  ← KEY STEP", "HMG CoA Lyase"],
        ["4", "Acetoacetate + NADH β†’ Beta-hydroxybutyrate", "BHB Dehydrogenase"],
        ["5", "Acetoacetate β†’ Acetone + COβ‚‚  (spontaneous)", "Spontaneous decarboxylation"],
    ],
    [30, 230, 170],
    hdr_fill=C_ORANGE
))
story.append(sp(3))

story.append(p("<b>Utilization (Ketolysis β€” in extrahepatic tissues: brain, heart, muscle, kidney):</b>", sBold))
story.append(p("β€’ BHB β†’ Acetoacetate (BHB dehydrogenase, NAD⁺)", sPoint))
story.append(p("β€’ Acetoacetate + Succinyl CoA β†’ Acetoacetyl CoA + Succinate (via Succinyl CoA Transferase / Thiophorase)", sPoint))
story.append(p("β€’ Acetoacetyl CoA β†’ 2 Acetyl CoA β†’ TCA β†’ ATP", sPoint))
story.append(p("β€’ <b>Liver CANNOT use ketone bodies</b> β€” it lacks succinyl CoA transferase (thiophorase)", sPoint))
story.append(sp(3))

story.append(p("<b>Diabetic Ketoacidosis (DKA):</b>", sBold))
story.append(p("β€’ In T1D: absent insulin β†’ unrestrained lipolysis (HSL active) + excess glucagon", sPoint))
story.append(p("β€’ Massive FFA release β†’ flood liver with Acetyl CoA β†’ excessive ketogenesis", sPoint))
story.append(p("β€’ Blood ketones ↑ β†’ metabolic acidosis β†’ pH falls", sPoint))
story.append(p("β€’ Signs: Kussmaul breathing, fruity breath (acetone), ketonuria, glycosuria, dehydration", sPoint))
story.append(p("β€’ Treatment: Insulin + IV fluids + electrolyte correction", sPoint))
story.append(sp(6))
story.append(hr())

# ── SN2: Lipoproteins ──────────────────────────────────────────
story.append(QuestionBox("SN2",
    "Classify lipoproteins. Write composition, functions, and clinical significance.",
    "[5–7 marks]", "WBUHS 2011–2023"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))

story.append(make_table(
    ["Lipoprotein", "Density", "TG %", "Chol %", "Apo-protein", "Function"],
    [
        ["Chylomicron", "<0.95", "85%", "5%", "ApoB-48, ApoC-II, ApoE", "Transport dietary (exogenous) TG from gut"],
        ["VLDL", "0.95–1.006", "55%", "15%", "ApoB-100, ApoC-II, ApoE", "Transport endogenous TG from liver"],
        ["IDL", "1.006–1.019", "31%", "22%", "ApoB-100, ApoE", "Intermediate in VLDLβ†’LDL conversion"],
        ["LDL", "1.019–1.063", "10%", "45%", "ApoB-100", "Deliver cholesterol to tissues; atherogenic"],
        ["HDL", "1.063–1.21", "5%", "20%", "ApoA-I, ApoA-II", "Reverse cholesterol transport; protective"],
    ],
    [65, 55, 35, 40, 125, 120],
    hdr_fill=C_BLUE
))
story.append(sp(3))
story.append(p("<b>Key Enzymes:</b>", sBold))
story.append(p("β€’ <b>LPL</b> (Lipoprotein Lipase): hydrolyzes TG in chylomicrons/VLDL on capillary endothelium; activated by ApoC-II; inhibited by ApoC-III", sPoint))
story.append(p("β€’ <b>LCAT</b> (Lecithin-Cholesterol Acyl Transferase): esterifies free cholesterol in HDL; activated by ApoA-I", sPoint))
story.append(p("β€’ <b>CETP</b>: transfers CE from HDL to LDL/VLDL in exchange for TG", sPoint))
story.append(p("β€’ <b>Hepatic Lipase</b>: removes TG from IDL β†’ LDL; removes TG from HDL2 β†’ HDL3", sPoint))
story.append(sp(6))
story.append(hr())

# ── SN3: Phospholipids ────────────────────────────────────────
story.append(QuestionBox("SN3",
    "Classify phospholipids with examples. Draw structure of lecithin. Write action of phospholipases.",
    "[10+2] or [3+1+4+4]", "WBUHS 2013, 2018, 2019-S"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))

story.append(p("<b>Classification of Phospholipids:</b>", sSubHdr))
story.append(p("<b>A. Glycerophospholipids</b> (glycerol backbone):", sBold))
story.append(make_table(
    ["Phospholipid", "Head Group", "Location / Function"],
    [
        ["Phosphatidylcholine (Lecithin)", "Choline", "Most abundant; RBC membrane; pulmonary surfactant"],
        ["Phosphatidylethanolamine (Cephalin)", "Ethanolamine", "Inner leaflet cell membranes; blood clotting"],
        ["Phosphatidylserine", "Serine", "Inner leaflet; apoptosis signal when exposed"],
        ["Phosphatidylinositol", "Inositol", "Second messenger (IP₃ pathway); inner leaflet"],
        ["Cardiolipin", "Glycerol+phosphate", "Inner mitochondrial membrane; ETC function"],
        ["Plasmalogen", "Ether-linked FA", "Heart, brain; antioxidant function"],
    ],
    [145, 80, 215],
    hdr_fill=C_PURPLE
))
story.append(sp(3))
story.append(p("<b>B. Sphingophospholipids:</b> Sphingomyelin β€” sphingosine backbone; in myelin sheath and cell membranes", sBody))
story.append(sp(3))

story.append(p("<b>Structure of Lecithin (Phosphatidylcholine):</b>", sBold))
story.append(p("β€’ sn-1 position: Saturated FA (e.g., palmitate, 16:0) β€” ester bond to glycerol C1", sPoint))
story.append(p("β€’ sn-2 position: Unsaturated FA (e.g., arachidonate, 20:4) β€” ester bond to glycerol C2", sPoint))
story.append(p("β€’ sn-3 position: Phosphocholine head group β€” phosphodiester bond to glycerol C3", sPoint))
story.append(sp(3))

story.append(p("<b>Phospholipases β€” Action on Lecithin:</b>", sBold))
story.append(make_table(
    ["Enzyme", "Bond Cleaved", "Products", "Significance"],
    [
        ["Phospholipase A1", "Ester at sn-1", "Free FA (sn-1) + 2-lysophospholipid", "Digestion"],
        ["Phospholipase A2", "Ester at sn-2", "Free FA (sn-2) + 1-lysophospholipid", "Releases arachidonic acid β†’ eicosanoids; activated in inflammation"],
        ["Phospholipase B (Lysophospholipase)", "Ester at sn-1 or sn-2 on lyso-PL", "Glycerophosphocholine + FA", "Digestion of lyso-phospholipids"],
        ["Phospholipase C", "Glycerol-phosphate bond", "DAG + phosphocholine", "Signal transduction (IP₃/DAG pathway)"],
        ["Phospholipase D", "Phosphate-head group bond", "Phosphatidic acid + choline", "Signal transduction"],
    ],
    [90, 90, 120, 140],
    hdr_fill=C_TEAL
))
story.append(sp(6))
story.append(hr())

# ── SN4: Fatty Liver ─────────────────────────────────────────
story.append(QuestionBox("SN4",
    "Fatty liver and lipotropic factors",
    "[5 marks]", "WBUHS 2012–2020"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))

story.append(p("<b>Fatty Liver (Hepatic Steatosis):</b>", sSubHdr))
story.append(p("Accumulation of >5% TG in liver by weight. Normal liver contains <5% lipid.", sBody))
story.append(sp(3))
story.append(p("<b>Causes:</b>", sBold))
story.append(make_table(
    ["Cause", "Mechanism"],
    [
        ["Excess FFA delivery", "Obesity, DM, starvation β†’ ↑ lipolysis β†’ ↑ FFA to liver"],
        ["Increased TG synthesis", "↑ glucose β†’ ↑ Acetyl CoA β†’ ↑ FA synthesis β†’ ↑ TG"],
        ["↓ VLDL secretion (most common)", "Choline/protein deficiency β†’ impaired apolipoprotein/phospholipid for VLDL assembly"],
        ["Alcohol (most common cause)", "↑ NADH β†’ diverts OAA from gluconeogenesis; inhibits FAO; ↑ TG synthesis"],
        ["CClβ‚„ poisoning", "Inhibits VLDL secretion (damages smooth ER)"],
    ],
    [140, 300],
    hdr_fill=C_RED
))
story.append(sp(3))

story.append(p("<b>Lipotropic Factors</b> (promote fat removal from liver by enhancing VLDL synthesis):", sBold))
story.append(make_table(
    ["Factor", "Role"],
    [
        ["Choline (most important)", "Provides phosphocholine for phosphatidylcholine synthesis β†’ needed for VLDL assembly"],
        ["Methionine", "Methyl donor for choline synthesis via transmethylation; also provides S-adenosylmethionine"],
        ["Inositol", "For phosphatidylinositol synthesis (membrane component of VLDL)"],
        ["Betaine", "Alternate methyl donor; choline precursor"],
        ["Vitamin B12 + Folate", "Needed for methyl transfer reactions in choline synthesis"],
    ],
    [140, 300],
    hdr_fill=C_GREEN
))
story.append(sp(6))
story.append(hr())

# ── SN5: Essential Fatty Acids ────────────────────────────────
story.append(QuestionBox("SN5",
    "Essential fatty acids β€” definition, examples, functions, deficiency",
    "[5 marks]", "WBUHS 2010–2022"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))

story.append(p("<b>Definition:</b> Fatty acids that cannot be synthesised in the body (lack Ξ”9 desaturase beyond C9 in humans) and must be supplied in diet.", sBody))
story.append(sp(3))
story.append(make_table(
    ["EFA", "Structure", "Family", "Dietary Source", "Derivative"],
    [
        ["Linoleic acid", "18:2 (Ξ”9,12)", "Omega-6 (Ο‰-6)", "Sunflower, corn, soybean oil", "Arachidonic acid (20:4, Ξ”5,8,11,14)"],
        ["Alpha-linolenic acid", "18:3 (Ξ”9,12,15)", "Omega-3 (Ο‰-3)", "Flaxseed, fish oil, walnuts", "EPA (20:5) and DHA (22:6)"],
    ],
    [80, 85, 60, 120, 95],
    hdr_fill=C_ORANGE
))
story.append(sp(3))
story.append(p("<b>Functions:</b>", sBold))
story.append(p("1. Structural component of cell membranes β€” maintain fluidity (especially DHA in brain/retina)", sPoint))
story.append(p("2. Precursors of <b>eicosanoids</b> (arachidonic acid β†’ Prostaglandins, Thromboxanes, Leukotrienes via COX and LOX)", sPoint))
story.append(p("3. Required for <b>skin integrity</b> (maintain permeability barrier)", sPoint))
story.append(p("4. Needed for normal growth, development, reproduction", sPoint))
story.append(p("5. Transport cholesterol as cholesterol esters (linoleic acid used by LCAT)", sPoint))
story.append(sp(3))
story.append(p("<b>Deficiency signs:</b> Scaly dermatitis, poor wound healing, impaired growth, increased susceptibility to infections, abnormal liver function", sBody))
story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
#  SECTION C: EXPLAIN THE REASON (EQ)
# ════════════════════════════════════════════════════════════════
story.append(SectionHeader("SECTION C β€” EXPLAIN THE REASON (EQ Questions)  |  2–3 Marks",
                            sub="Write biochemical justification clearly",
                            fill=C_PURPLE))
story.append(sp(8))

# EQ1
story.append(QuestionBox("EQ1",
    "Fat can be synthesized from glucose, but glucose cannot be synthesized from fat.",
    "[2–3 marks]", "WBUHS β€” Repeated multiple times"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))
story.append(p("β€’ Glucose β†’ Pyruvate (glycolysis) β†’ Acetyl CoA (by <b>Pyruvate Dehydrogenase</b> β€” IRREVERSIBLE)", sPoint))
story.append(p("β€’ Acetyl CoA can enter FA synthesis β†’ fats are formed <b>(glucose β†’ fat is possible βœ“)</b>", sPoint))
story.append(p("β€’ Acetyl CoA <b>cannot be converted back to Pyruvate</b> β€” no reverse pyruvate dehydrogenase in mammals", sPoint))
story.append(p("β€’ Acetyl CoA cannot provide net carbon for gluconeogenesis (enters TCA but OAA is not increased net)", sPoint))
story.append(p("β€’ Therefore fat (as Acetyl CoA) <b>cannot generate glucose net</b> in mammals <b>(fat β†’ glucose is NOT possible βœ—)</b>", sPoint))
story.append(p("β€’ Exception: Glycerol from TG breakdown β†’ DHAP β†’ glucose (minor pathway, not significant)", sNote))
story.append(sp(6))
story.append(hr())

# EQ2
story.append(QuestionBox("EQ2",
    "Defective beta-oxidation leads to hypoglycemia.",
    "[2–3 marks]", "WBUHS 2015–2020"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))
story.append(p("β€’ During fasting, the body depends on <b>beta-oxidation</b> to generate ATP for gluconeogenesis", sPoint))
story.append(p("β€’ Beta-oxidation β†’ Acetyl CoA β†’ allosterically activates <b>Pyruvate Carboxylase</b> (1st step of gluconeogenesis)", sPoint))
story.append(p("β€’ Beta-oxidation β†’ NADH + ATP β†’ provide energy needed to drive gluconeogenesis", sPoint))
story.append(p("β€’ If beta-oxidation is defective (e.g., <b>MCAD deficiency</b> β€” medium-chain acyl CoA dehydrogenase):", sPoint))
story.append(p("  – No Acetyl CoA generated β†’ Pyruvate Carboxylase not activated β†’ gluconeogenesis fails", sPoint))
story.append(p("  – No ATP generated from fats β†’ glucose consumed rapidly β†’ <b>hypoglycemia</b>", sPoint))
story.append(p("  – Normally fats spare glucose by being the primary fuel during fasting", sPoint))
story.append(p("β€’ <b>Clinical:</b> MCAD deficiency β€” hypoglycemic crisis in infants after overnight fast; no ketonemia (can't produce ketones either)", sNote))
story.append(sp(6))
story.append(hr())

# EQ3 bonus
story.append(QuestionBox("EQ3",
    "Explain why liver cannot use ketone bodies.",
    "[2 marks]", "Commonly asked indirect question"))
story.append(sp(4))
story.append(AnswerSection())
story.append(sp(4))
story.append(p("β€’ Ketone body utilization (ketolysis) requires <b>Succinyl CoA Transferase (Thiophorase)</b> to activate acetoacetate to acetoacetyl CoA", sPoint))
story.append(p("β€’ <b>Liver lacks succinyl CoA transferase</b> β€” this is a physiological adaptation", sPoint))
story.append(p("β€’ This ensures liver continues to export ketone bodies to brain/muscle during starvation rather than using them itself", sPoint))
story.append(p("β€’ During starvation, ketone bodies become the <b>primary fuel for brain</b> (replaces glucose after 3–4 days fast)", sPoint))
story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
#  SECTION D: BETA-OXIDATION FLOWCHART (full page)
# ════════════════════════════════════════════════════════════════
story.append(SectionHeader("SECTION D β€” FLOWCHART: Beta-Oxidation of Palmitic Acid",
                            sub="Complete pathway with ATP yield table",
                            fill=C_BLUE))
story.append(sp(8))
story.append(BetaOxFlowchart(width=W - 80))
story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
#  SECTION E: CHOLESTEROL SYNTHESIS FLOWCHART
# ════════════════════════════════════════════════════════════════
story.append(SectionHeader("SECTION E β€” FLOWCHART: Cholesterol Synthesis (de novo)",
                            sub="Acetyl CoA β†’ Mevalonate β†’ Squalene β†’ Cholesterol  |  Regulation & clinical notes",
                            fill=C_GREEN))
story.append(sp(8))
story.append(CholSynthFlowchart(width=W - 80))
story.append(PageBreak())

# ════════════════════════════════════════════════════════════════
#  SECTION F: HIGH-YIELD SUMMARY
# ════════════════════════════════════════════════════════════════
story.append(SectionHeader("SECTION F β€” HIGH-YIELD SUMMARY & EXAM TIPS",
                            sub="Last-minute revision: key facts, comparisons, and disorders",
                            fill=C_AMBER))
story.append(sp(8))

# Comparison Beta-ox vs FA Synthesis
story.append(p("<b>Beta-Oxidation vs Fatty Acid Synthesis β€” Key Differences (Frequently Asked)</b>", sSubHdr))
story.append(make_table(
    ["Feature", "Ξ²-Oxidation", "FA Synthesis"],
    [
        ["Location", "Mitochondrial matrix", "Cytosol"],
        ["Carrier", "CoA", "ACP (Acyl Carrier Protein)"],
        ["Coenzymes", "FAD, NAD⁺ (oxidized)", "NADPH (reduced)"],
        ["COβ‚‚ / HCO₃⁻", "Not used", "HCO₃⁻ required (Malonyl CoA)"],
        ["Rate-limiting enzyme", "CPT-I (transport step)", "Acetyl CoA Carboxylase (ACC)"],
        ["Main product", "Acetyl CoA + FADHβ‚‚ + NADH", "Palmitate (C16:0)"],
        ["Activated by", "Glucagon, Epinephrine, Low insulin", "Insulin, Citrate"],
        ["Inhibited by", "Malonyl CoA (via CPT-I)", "Palmitoyl CoA, Glucagon, AMPK"],
        ["Stereospecificity", "L-3-hydroxyacyl CoA intermediate", "D-3-hydroxyacyl-ACP intermediate"],
    ],
    [130, 170, 140],
    hdr_fill=C_DARK_BLUE
))
story.append(sp(8))

# Disorders table
story.append(p("<b>Clinical Disorders of Lipid Metabolism (High-Yield)</b>", sSubHdr))
story.append(make_table(
    ["Disorder", "Defect", "Key Features"],
    [
        ["MCAD Deficiency", "Medium-chain Acyl CoA Dehydrogenase", "Hypoglycemia, no ketonemia, fasting intolerance; SIDS risk"],
        ["Refsum Disease", "Phytanoyl CoA Ξ±-Hydroxylase (peroxisomal)", "Phytanic acid accumulation; peripheral neuropathy, retinitis"],
        ["Zellweger Syndrome", "Peroxisome biogenesis (PEX genes)", "VLCFA accumulation; severe neurological defects; fatal early"],
        ["X-linked ALD", "VLCFA transporter (ABCD1) in peroxisomal membrane", "VLCFA accumulation; adrenal insufficiency + CNS demyelination"],
        ["Familial Hypercholesterolemia", "LDL receptor defect (autosomal dominant)", "Very high LDL; xanthomas, xanthelasma; premature MI"],
        ["Tangier Disease", "ABCA1 transporter defect", "Almost no HDL; cholesterol deposits in tonsils (orange tonsils)"],
        ["Gaucher Disease", "Glucocerebrosidase (Ξ²-glucosidase)", "Glucocerebroside accumulation in macrophages; hepatosplenomegaly"],
        ["Niemann-Pick Disease", "Sphingomyelinase", "Sphingomyelin accumulation; cherry-red spot; neurodegeneration"],
        ["Tay-Sachs Disease", "Hexosaminidase A", "GM2 ganglioside accumulation; cherry-red spot; fatal by age 4"],
    ],
    [115, 135, 190],
    hdr_fill=C_RED
))
story.append(sp(8))

# Exam tips
story.append(p("<b>⭐ High-Yield Exam Points β€” Memorise These</b>", sSubHdr))
tips_data = [
    ["1", "Net ATP from palmitic acid = 106 (learn each step of calculation)"],
    ["2", "Oleic acid (C18:1): uses isomerase β†’ 1 FADHβ‚‚ less β†’ ~2 ATP less than palmitic"],
    ["3", "CPT-I is rate-limiting for beta-oxidation transport; inhibited by Malonyl CoA"],
    ["4", "ACC (Acetyl CoA Carboxylase) is rate-limiting for FA synthesis; makes Malonyl CoA"],
    ["5", "HMG CoA Reductase is rate-limiting for cholesterol synthesis; target of Statins"],
    ["6", "Statins = competitive inhibitors of HMG CoA Reductase β†’ ↓ LDL cholesterol"],
    ["7", "Carnitine shuttle is required only for long-chain FA (>C12); short/medium chain enter freely"],
    ["8", "Liver CANNOT use ketone bodies (lacks thiophorase); it only makes them"],
    ["9", "Ketone bodies are the preferred fuel of brain during starvation (after 3–4 days)"],
    ["10", "HDL = reverse cholesterol transport = 'good cholesterol'; ApoA-I activates LCAT"],
    ["11", "ApoC-II activates LPL; ApoB-100 is the LDL receptor ligand; ApoE for remnant clearance"],
    ["12", "Choline is the most important lipotropic factor; prevents fatty liver"],
    ["13", "Linoleic acid (18:2, Ο‰-6) β†’ Arachidonic acid β†’ Prostaglandins / Thromboxanes / Leukotrienes"],
    ["14", "LCAT esterifies cholesterol in HDL using phosphatidylcholine as FA donor"],
    ["15", "SREBP pathway: ↓ cholesterol β†’ SREBP activated β†’ ↑ HMG CoA Reductase + LDL receptor"],
    ["16", "Normal cholesterol: <200 mg/dL; LDL <100 mg/dL; HDL >40 (M) or >50 (F) mg/dL; TG <150 mg/dL"],
]
story.append(make_table(
    ["#", "High-Yield Point"],
    tips_data,
    [25, 415],
    hdr_fill=C_AMBER
))

story.append(sp(10))
story.append(SectionHeader(
    "ALL THE BEST FOR YOUR EXAMS! πŸŽ“",
    sub="Prepared from WBUHS PYQ Bank 2010–2023  Β·  Lippincott's Biochemistry 8e  Β·  Harper's Illustrated Biochemistry",
    fill=C_DARK_BLUE))

# ════════════════════════════════════════════════════════════════
#  BUILD PDF
# ════════════════════════════════════════════════════════════════
PAGE_NUM[0] = 0
doc = SimpleDocTemplate(
    OUTPUT, pagesize=A4,
    topMargin=38, bottomMargin=26,
    leftMargin=40, rightMargin=40,
    title="Lipid Biochemistry Complete PYQ Guide β€” MBBS 1st Year",
    author="Orris Medical",
)
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF saved: {OUTPUT}")
Running Command

cd /home/daytona/workspace/lipid-pdf && python3 generate_full_pyq.py 2>&1

Running Command

ls -lh /home/daytona/workspace/lipid-pdf/Lipid_Complete_PYQ_Guide.pdf

Tumhara complete PDF ready hai! Download karo:

Lipid Complete PYQ Guide

PDF Document Β· PDF


PDF mein ye sab ek jagah hai:
SectionContent
Cover + TOCFrequency table β€” kitni baar kaun sa topic aaya
Section A β€” LAQQ1: Beta-oxidation + ATP calc Β· Q2: Cholesterol synthesis + RCT Β· Q3: FA synthesis / FAS complex Β· Q4: VLDL metabolism
Section B β€” Short NotesKetone bodies + DKA Β· Lipoproteins (full table) Β· Phospholipids + Lecithin + Phospholipases Β· Fatty liver + Lipotropic factors Β· Essential Fatty Acids
Section C — EQFat→Glucose explain · Beta-ox → Hypoglycemia · Liver cannot use ketone bodies
Section D β€” FlowchartBeta-oxidation step-by-step (Activation β†’ Carnitine Shuttle β†’ 4-reactions Γ— 7 cycles β†’ ATP table = 106)
Section E β€” FlowchartCholesterol synthesis (Acetyl CoA β†’ all 5 stages β†’ Cholesterol) with regulation box
Section F β€” SummaryBeta-ox vs FA Synthesis comparison Β· Clinical disorders table (MCAD, Gaucher, Niemann-Pick, FH, etc.) Β· 16 high-yield exam points
Har page pe header + footer aur color-coded sections hain β€” easy navigation ke liye. All the best! πŸŽ“

Generate on topic on carbohydrates chemistry and metabolism 15 years pyqs

Searching the Web

MBBS 1st year biochemistry carbohydrate chemistry metabolism PYQ past year questions WBUHS university exam 2008-2023 glycolysis TCA cycle glycogen

Finding Sources
Finding Sources
Reading Web Page

https://medical-junction.com/biochemistry-previous-year-ques…

Finding Sources
Finding Sources
This is a shared conversation. Sign in to Orris to start your own chat.