Give me all the important points to remember for all vitamins and minerals

Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
I now have comprehensive data. Let me compile the complete, authoritative reference for all vitamins and minerals.

Vitamins and Minerals - Complete Clinical Reference

Sources: Goldman-Cecil Medicine (26th Ed.), Basic Medical Biochemistry (6th Ed.), The Washington Manual of Medical Therapeutics, Costanzo Physiology (7th Ed.)

FAT-SOLUBLE VITAMINS (A, D, E, K)

Key principle: Fat-soluble vitamins are absorbed via micellar phase - any fat malabsorption state (Crohn's, celiac, cystic fibrosis, cholestasis) causes deficiency of ALL four. They are stored in the body and toxicity is possible with excess intake.

Vitamin A (Retinol)

FeatureDetails
RDAWomen: 700 µg RAE / Men: 900 µg RAE
UL3,000 µg/day
SourcesLiver, dairy, eggs (preformed); dark orange/yellow and leafy green vegetables (beta-carotene provitamin)
Active formsRetinol (storage/transport), retinal (vision), retinoic acid (gene regulation)
FunctionsVision (rhodopsin synthesis), epithelial differentiation, immune function, reproduction, bone growth
Deficiency signs:
  • Night blindness (earliest sign)
  • Bitot's spots (foamy/white plaques on conjunctiva)
  • Xerophthalmia (dry eyes) → Keratomalacia (corneal ulceration/blindness)
  • Follicular hyperkeratosis ("toad skin" - hyperkeratotic papules around hair follicles)
  • Increased infection susceptibility (especially measles, diarrhea in children)
  • At-risk populations: malabsorptive states (proximal small bowel disease), chronic liver disease, strict vegetarians
Toxicity (Hypervitaminosis A):
  • Acute: headache, vomiting, blurred vision, skin peeling
  • Chronic: alopecia, dry skin, hepatotoxicity (hepatic fibrosis/necrosis), hypercalcemia, pseudotumor cerebri (intracranial hypertension)
  • Teratogenic - causes birth defects (isotretinoin warning)
Key mnemonics:
  • Night blindness → Bitot spots → Xerophthalmia → Keratomalacia (progressive severity)
  • Retinoic acid regulates transcription of genes → growth and differentiation

Vitamin D (Calciferol)

FeatureDetails
RDA600 IU (15 µg) for adults under 70; 800 IU for >70 years
UL4,000 IU/day
SourcesSunlight (skin synthesis), fatty fish, fortified dairy/orange juice, egg yolk
Active form1,25-dihydroxycholecalciferol (calcitriol) - made in kidney
Metabolism pathway: Skin (D3 from 7-dehydrocholesterol + UV) → Liver (25-hydroxylation) → Kidney (1α-hydroxylation by PTH stimulation) → Active calcitriol
Functions: Increases intestinal Ca²⁺ and phosphate absorption; bone mineralization; immune modulation; cell differentiation
Deficiency signs:
  • Children: Rickets (soft, bowed bones; craniotabes; rachitic rosary; widened epiphyseal plates)
  • Adults: Osteomalacia (bone pain, pathologic fractures, proximal muscle weakness, waddling gait)
  • Hypocalcemia → tetany, seizures
  • At-risk: dark-skinned individuals, exclusively breastfed infants (no vitamin D in breast milk), limited sun exposure (elderly, institutionalized), malabsorptive states, chronic liver/kidney disease, obesity
Toxicity:
  • Hypercalcemia (nausea, vomiting, polyuria, polydipsia, constipation, confusion)
  • Metastatic calcifications (kidneys, vessels, soft tissue)
  • Nephrolithiasis, nephrocalcinosis
Key points:
  • Only vitamin synthesized by skin (hence "sunshine vitamin")
  • Parathyroid hormone (PTH) stimulates 1α-hydroxylation in kidney
  • 25(OH)D is the best measure of vitamin D status (half-life ~3 weeks)

Vitamin E (Tocopherol)

FeatureDetails
RDA15 mg α-tocopherol/day
UL1,000 mg/day
SourcesVegetable oils, wheat germ, nuts, seeds, green leafy vegetables
Active formα-tocopherol (most biologically active)
Functions: Major lipid-soluble antioxidant; protects cell membranes from peroxidation; maintains red blood cell integrity; required for normal neurologic function
Deficiency signs:
  • Hemolytic anemia (especially in premature infants)
  • Spinocerebellar ataxia (progressive neurologic degeneration)
  • Peripheral neuropathy (demyelination of posterior column and spinocerebellar tracts)
  • Ophthalmoplegia, areflexia
  • Retinopathy in premature infants
  • At-risk: premature neonates (primary risk group), fat malabsorption syndromes, abetalipoproteinemia
Toxicity: Inhibits platelet aggregation (bleeding tendency); antagonizes vitamin K; hemorrhage at very high doses
Key points:
  • Works synergistically with selenium (both are antioxidants)
  • Abetalipoproteinemia → profound Vit E deficiency due to no chylomicron/VLDL transport

Vitamin K

FeatureDetails
AIWomen: 90 µg/day / Men: 120 µg/day
SourcesK1 (phylloquinone) from leafy green vegetables; K2 (menaquinone) from gut bacteria, fermented foods; K3 (menadione) = synthetic
No established UL-
Functions:
  • Cofactor for gamma-carboxylation of glutamate residues (required for coagulation factors II, VII, IX, X, and proteins C, S, Z)
  • Required for osteocalcin synthesis (bone mineralization)
Deficiency signs:
  • Bleeding diathesis - elevated PT/INR (prolonged clotting time)
  • Hemorrhagic disease of the newborn (HDN) - neonates have no gut bacteria, little placental transfer → prophylactic K injection at birth
  • Spontaneous bruising, hematuria, GI bleeding
  • At-risk: newborns, broad-spectrum antibiotic use (kills gut flora), fat malabsorption, warfarin therapy
Toxicity: K1 and K2 - essentially non-toxic. Synthetic K3 (menadione) can cause hemolytic anemia and kernicterus in infants.
Key points:
  • Warfarin antagonizes Vitamin K (blocks VKOR enzyme)
  • Clotting factors made in liver - check PT to assess Vitamin K status
  • Proteins C and S are anticoagulant and also require Vitamin K (warfarin initially procoagulant → transient thrombosis risk)
  • Vitamin K does NOT cross placenta well; newborns require injection

WATER-SOLUBLE VITAMINS (B-complex + Vitamin C)

Key principle: Excess is generally excreted in urine (less toxicity risk). Deficiency develops faster than fat-soluble vitamins since storage is limited. Most B vitamins act as coenzymes in metabolic reactions.

Vitamin B1 (Thiamine)

FeatureDetails
RDAWomen: 1.1 mg / Men: 1.2 mg
SourcesWhole grains, enriched cereals, legumes, pork, nuts, seeds
Active formThiamine pyrophosphate (TPP)
Functions (as TPP):
  • Cofactor for pyruvate dehydrogenase (pyruvate → acetyl-CoA)
  • Cofactor for α-ketoglutarate dehydrogenase (TCA cycle)
  • Cofactor for transketolase (pentose phosphate pathway)
  • Required for branched-chain amino acid catabolism
Deficiency signs:
  • Beriberi:
    • Wet beriberi: high-output cardiac failure, dilated cardiomyopathy, edema (cardiovascular form)
    • Dry beriberi: peripheral neuropathy (distal sensorimotor polyneuropathy - worse in legs)
  • Wernicke's encephalopathy (triad: confusion/ophthalmoplegia/ataxia) - acute, reversible with thiamine
  • Korsakoff's syndrome (anterograde amnesia, confabulation) - chronic, often irreversible
  • At-risk: alcoholics (primary risk group), malnutrition, prolonged IV glucose without thiamine, dialysis, hyperemesis gravidarum, gastric bypass patients
Key points:
  • Always give thiamine BEFORE glucose in suspected deficiency (glucose infusion worsens Wernicke's)
  • Alcoholism depletes thiamine by reduced intake + impaired absorption + impaired utilization
  • Transketolase activity in RBCs is the most sensitive test

Vitamin B2 (Riboflavin)

FeatureDetails
RDAWomen: 1.1 mg / Men: 1.3 mg
SourcesDairy products, lean meats, enriched cereals, eggs, leafy vegetables
Active formsFMN (flavin mononucleotide), FAD (flavin adenine dinucleotide)
Functions: Electron carrier in oxidation-reduction reactions (ETC); required for fatty acid β-oxidation; antioxidant enzyme cofactor (glutathione reductase)
Deficiency - "Ariboflavinosis":
  • Cheilosis (cracking at corners of mouth) and angular stomatitis
  • Glossitis (magenta tongue)
  • Seborrheic dermatitis (scrotum, vulva, nasolabial folds)
  • Corneal vascularization (photophobia)
  • Normochromic normocytic anemia
  • At-risk: alcoholics, malabsorption, elderly on poor diets
Key points:
  • Riboflavin is fluorescent (yellow-green); urine turns yellow on supplementation
  • Required for activation of B6 and folate
  • Phenothiazines, tricyclics, and probenecid impair riboflavin absorption

Vitamin B3 (Niacin / Nicotinamide)

FeatureDetails
RDAWomen: 14 mg NE / Men: 16 mg NE
UL35 mg/day
SourcesMeat, poultry, fish, peanuts, enriched cereals; also synthesized from tryptophan (60 mg Trp = 1 mg niacin)
Active formsNAD⁺/NADH and NADP⁺/NADPH
Functions: Central coenzyme in redox reactions - glycolysis, TCA, fatty acid synthesis/oxidation, oxidative phosphorylation
Deficiency - "Pellagra" (3 Ds + 1 D = 4 Ds):
  • Dermatitis: Casal's necklace (hyperpigmented rash on sun-exposed skin, especially neck and dorsum of hands)
  • Diarrhea
  • Dementia (neuropsychiatric symptoms)
  • Death (if untreated)
  • At-risk: corn-based diets (corn has bound niacin in niacytin form), alcoholics, Hartnup disease (impaired tryptophan absorption), carcinoid syndrome (tryptophan diverted to serotonin), isoniazid therapy
Pharmacologic doses (1-3 g/day) - used for dyslipidemia:
  • Decreases VLDL → LDL; increases HDL (best drug for raising HDL)
  • Side effects: flushing (prostaglandin-mediated, prevented by aspirin), hepatotoxicity, hyperglycemia, hyperuricemia
Key points:
  • Hartnup disease: defect in neutral amino acid transport → tryptophan not absorbed → pellagra-like symptoms
  • Carcinoid syndrome: tryptophan → 5-HT → pellagra
  • Isoniazid chelates pyridoxine → impairs tryptophan → niacin conversion

Vitamin B5 (Pantothenic Acid)

FeatureDetails
AI5 mg/day
SourcesWidely distributed in all foods (Greek pantos = "everywhere"); liver, egg yolk, avocado
Active formCoenzyme A (CoA)
Functions: Central to all CoA-dependent reactions - fatty acid synthesis and oxidation, TCA cycle (acetyl-CoA, succinyl-CoA), synthesis of steroids, heme, acetylcholine
Deficiency:
  • Extremely rare due to ubiquitous distribution
  • "Burning feet syndrome" (paresthesias, painful burning of feet)
  • Irritability, fatigue, headache, nausea
  • Seen in severe malnutrition

Vitamin B6 (Pyridoxine)

FeatureDetails
RDA1.3 mg/day (adults)
UL100 mg/day
SourcesMeat, poultry, fish, potatoes, bananas, fortified cereals
Active formPyridoxal phosphate (PLP)
Functions (PLP is cofactor for):
  • Transamination (aminotransferases - ALT, AST)
  • Decarboxylation of amino acids → neurotransmitters (serotonin from tryptophan, dopamine from DOPA, GABA from glutamate, histamine from histidine)
  • Glycogenolysis (glycogen phosphorylase)
  • Heme synthesis (ALA synthase - condensation of glycine + succinyl-CoA)
  • Cystathionine synthesis (homocysteine → cysteine)
Deficiency:
  • Seborrheic dermatitis, cheilosis, glossitis (similar to B2 deficiency)
  • Microcytic sideroblastic anemia (impaired heme synthesis - iron-laden ring sideroblasts)
  • Peripheral neuropathy
  • Convulsions/seizures (decreased GABA synthesis)
  • Depression, confusion
  • Elevated homocysteine (risk for cardiovascular disease)
  • At-risk: alcoholics, isoniazid use (INH binds and inactivates PLP → give B6 prophylactically), penicillamine therapy, oral contraceptives
Toxicity (>200 mg/day):
  • Sensory neuropathy (the only B vitamin with significant neurotoxic effects in excess)

Vitamin B7 (Biotin)

FeatureDetails
AI30 µg/day
SourcesLiver, egg yolk, nuts, legumes; intestinal bacteria synthesize some
Functions: Cofactor for carboxylation reactions (CO₂ fixation):
  • Pyruvate carboxylase (pyruvate → oxaloacetate)
  • Acetyl-CoA carboxylase (acetyl-CoA → malonyl-CoA, fatty acid synthesis)
  • Propionyl-CoA carboxylase (propionyl-CoA → methylmalonyl-CoA)
Deficiency:
  • Alopecia (hair loss)
  • Dermatitis (periorificial, scaly rash around eyes, nose, mouth, genitals)
  • Conjunctivitis
  • CNS abnormalities (lethargy, depression, hallucinations)
  • At-risk: raw egg white consumption (avidin in egg white binds biotin irreversibly), prolonged TPN without biotin, biotinidase deficiency

Vitamin B9 (Folate / Folic Acid)

FeatureDetails
RDA400 µg DFE/day; 600 µg in pregnancy; 500 µg while lactating
UL1,000 µg/day (supplemental folate only)
SourcesLeafy green vegetables (spinach, asparagus), legumes, fortified cereals, citrus fruits, liver
Active formTetrahydrofolate (THF)
Functions: One-carbon transfer reactions:
  • Purine synthesis (de novo)
  • Thymidylate synthesis (dTMP from dUMP)
  • Amino acid metabolism (homocysteine → methionine, requires B12 as cofactor; serine → glycine)
Deficiency:
  • Megaloblastic macrocytic anemia (impaired DNA synthesis → large, hypersegmented neutrophils + oval macrocytes)
  • Neural tube defects (spina bifida, anencephaly) - critical in first 4 weeks of pregnancy
  • Elevated homocysteine (cardiovascular risk)
  • NO neurologic symptoms (unlike B12 deficiency - key distinguishing feature)
  • At-risk: pregnancy (increased demand), alcoholics (malabsorption + poor diet), elderly, methotrexate/trimethoprim/phenytoin use, celiac disease, Crohn's disease
Key points:
  • Folate supplementation (400-800 µg/day) recommended for ALL women of childbearing age
  • B12 deficiency causes "folate trap" (folate accumulates as N5-methyl-THF, unable to convert back to active THF) - the "methylfolate trap"
  • Methotrexate/trimethoprim/pyrimethamine inhibit dihydrofolate reductase (DHFR)

Vitamin B12 (Cobalamin)

FeatureDetails
RDA2.4 µg/day
SourcesExclusively animal products (meat, fish, dairy, eggs); vegans need supplements
Active formsMethylcobalamin, adenosylcobalamin
Absorption pathway: Dietary B12 + intrinsic factor (IF, from gastric parietal cells) → ileum absorption → transport by transcobalamin II → tissues
Functions:
  • Methylcobalamin: cofactor for methionine synthase (homocysteine + methyl-THF → methionine + THF - links B12 to folate cycle)
  • Adenosylcobalamin: cofactor for methylmalonyl-CoA mutase (methylmalonyl-CoA → succinyl-CoA)
Deficiency:
  • Megaloblastic macrocytic anemia (same as folate)
  • Subacute combined degeneration of spinal cord (posterior columns + lateral corticospinal tracts):
    • Loss of vibration sense and proprioception (posterior columns)
    • Upper motor neuron signs (lateral corticospinal tract)
    • Peripheral neuropathy
  • Glossitis (beefy red, smooth tongue)
  • Elevated methylmalonic acid (MMA) + elevated homocysteine (both elevated, vs. folate where only homocysteine is elevated)
  • Neuropsychiatric symptoms (dementia, depression, psychosis)
Causes of deficiency:
  • Pernicious anemia (autoimmune destruction of parietal cells - most common in adults, anti-IF antibodies)
  • Strict veganism (no animal products)
  • Gastrectomy (no IF)
  • Terminal ileal disease/resection (Crohn's, short bowel syndrome)
  • Bacterial overgrowth (bacteria consume B12)
  • Fish tapeworm (Diphyllobothrium latum)
  • Metformin use (impairs absorption)
Key distinguishing features vs. folate deficiency:
FeatureB12 DeficiencyFolate Deficiency
Megaloblastic anemia
Neurologic symptoms✓ (subacute combined degeneration)
Elevated homocysteine
Elevated MMA

Vitamin C (Ascorbic Acid)

FeatureDetails
RDAWomen: 75 mg / Men: 90 mg; Smokers +35 mg
UL2,000 mg/day
SourcesCitrus fruits, strawberries, kiwi, broccoli, bell peppers, potatoes
Functions:
  • Cofactor for prolyl and lysyl hydroxylase (collagen synthesis - hydroxylation of proline and lysine)
  • Iron absorption enhancer (reduces Fe³⁺ to Fe²⁺ for absorption)
  • Antioxidant (regenerates Vitamin E)
  • Dopamine-β-hydroxylase cofactor (dopamine → norepinephrine)
  • Carnitine synthesis
Deficiency - "Scurvy":
  • Perifollicular hemorrhages (corkscrew hairs)
  • Gingival bleeding and gingivitis (swollen, spongy, bleeding gums)
  • Poor wound healing
  • Petechiae and ecchymoses (bruising)
  • Hyperkeratosis
  • Corkscrew hairs (pathognomonic)
  • Musculoskeletal pain (periosteal hemorrhage)
  • Infants: Frankel's sign (corner fractures of long bones), Pelkan spurs
  • At-risk: elderly on restricted diets, alcoholics, smokers, food insecurity
Key point:
  • Defective collagen → hemorrhage (blood vessels lose structural integrity)
  • Vitamin C does NOT cure the common cold (common myth)

MINERALS

Calcium (Ca²⁺)

FeatureDetails
RDA1,000 mg (adults 19-50); 1,200 mg (women >50, all >70)
UL2,500 mg/day
SourcesDairy products, fortified foods, leafy greens (kale, bok choy), sardines
AbsorptionRegulated by calcitriol (Vitamin D); 20-30% absorbed normally
Functions: Bone and teeth structure (99% in skeleton), muscle contraction, nerve transmission, coagulation, second messenger signaling
Deficiency/Hypocalcemia:
  • Tetany (Chvostek's sign - tapping facial nerve → facial twitching; Trousseau's sign - BP cuff inflation → carpal spasm)
  • Seizures, paresthesias
  • Prolonged QT interval (cardiac arrhythmias)
  • Osteoporosis (chronic inadequate intake)
  • Rickets/osteomalacia (secondary to Vitamin D deficiency)
Toxicity/Hypercalcemia ("Bones, Stones, Groans, Psychic Moans"):
  • Kidney stones (nephrolithiasis)
  • Bone pain
  • Constipation, nausea
  • Confusion, depression, psychosis

Phosphorus

FeatureDetails
RDA700 mg/day
SourcesWidely distributed; dairy, meat, fish, nuts, legumes, cola drinks
Functions: Bone mineralization (hydroxyapatite); ATP; phospholipids; DNA/RNA; enzyme regulation (phosphorylation)
Deficiency/Hypophosphatemia:
  • Muscle weakness, bone pain, hemolytic anemia
  • Respiratory failure (ATP depletion in diaphragm)
  • Refeeding syndrome (dramatic fall in phosphate after refeeding malnourished patients → cardiac arrest, seizures, respiratory failure)
Key point: Refeeding syndrome = hypophosphatemia + hypokalemia + hypomagnesemia after carbohydrate refeeding

Magnesium (Mg²⁺)

FeatureDetails
RDAWomen: 310-320 mg / Men: 400-420 mg
UL350 mg (supplemental)
SourcesNuts, seeds, whole grains, leafy greens, legumes, dark chocolate
Functions: Cofactor for >300 enzymes; ATP stabilization (Mg-ATP complex); protein synthesis; DNA replication; muscle relaxation; neuromuscular transmission
Deficiency/Hypomagnesemia:
  • Hypocalcemia (Mg required for PTH release and action)
  • Hypokalemia (renal K⁺ wasting)
  • Muscle cramps, tremors, tetany
  • Cardiac arrhythmias (torsades de pointes)
  • Personality changes, nystagmus, seizures
  • At-risk: alcoholics (most common cause), diuretics (loop/thiazide), PPI use (chronic), diarrhea, Gitelman syndrome, diabetics
Key points:
  • Refractory hypocalcemia and hypokalemia → always check and replenish Mg first
  • IV magnesium sulfate: treatment of eclampsia seizures and torsades de pointes

Iron (Fe²⁺/³⁺)

FeatureDetails
RDAWomen 19-50: 18 mg; Men: 8 mg; Pregnancy: 27 mg
SourcesHeme iron (meat, especially red meat - 15-35% absorbed); non-heme iron (legumes, fortified cereals, spinach - 2-10% absorbed); Vitamin C enhances non-heme absorption
Functions: Hemoglobin (O₂ transport), myoglobin, cytochromes (ETC), enzymes (catalase, peroxidase)
Deficiency - most common nutritional deficiency worldwide:
  • Microcytic hypochromic anemia (stages: iron depletion → iron-deficient erythropoiesis → iron deficiency anemia)
  • Fatigue, pallor, decreased exercise tolerance
  • Koilonychia (spoon nails)
  • Pica (craving for non-food items: ice, clay, starch)
  • Plummer-Vinson syndrome (iron deficiency + dysphagia + esophageal web)
  • Glossitis, angular stomatitis
  • At-risk: reproductive-age females (menstruation), pregnancy, infants/children, vegetarians, post-gastric bypass, celiac disease, chronic GI bleeding
Iron studies in deficiency:
  • Low serum iron, low ferritin (best marker of stores), high TIBC/transferrin, low transferrin saturation
Toxicity/Hemosiderosis:
  • Hereditary hemochromatosis (HFE gene, C282Y mutation)
  • Hemochromatosis triad: cirrhosis + diabetes + bronze skin ("bronze diabetes")
  • Cardiac failure, hypogonadism, arthropathy
  • Acute poisoning: acute gastroenteritis → shock → hepatic failure (in children from accidental ingestion)

Zinc (Zn²⁺)

FeatureDetails
RDAWomen: 8 mg / Men: 11 mg
UL40 mg/day
SourcesOysters (richest), red meat, poultry, beans, nuts, fortified cereals
Functions: Cofactor for >100 enzymes (DNA polymerase, RNA polymerase, carbonic anhydrase); zinc finger transcription factors; wound healing; taste and smell; immune function; spermatogenesis
Deficiency:
  • Acrodermatitis enteropathica (periorificial and acral skin rash - around mouth, eyes, genitals, hands/feet)
  • Alopecia (hair loss)
  • Hypogonadism (impaired testosterone synthesis)
  • Growth retardation in children
  • Dysgeusia/dysosmia (impaired taste and smell)
  • Poor wound healing
  • Impaired immune function
  • Night blindness (Zinc needed for Vitamin A mobilization from liver)
  • At-risk: alcoholics, chronic diarrhea, high-phytate diets (phytate in cereals/legumes chelates zinc), malabsorptive states, fistulas/ostomies, nephrotic syndrome, sickle cell disease, HIV, pregnancy, post-gastric bypass
Key conditions:
  • Acrodermatitis enteropathica = inherited zinc malabsorption (SLC39A4 gene mutation)
Toxicity: High-dose zinc competes with copper absorption → copper deficiency

Copper (Cu²⁺)

FeatureDetails
RDA900 µg/day
SourcesLiver, shellfish (oysters), nuts, seeds, dark chocolate, whole grains
Functions: Cofactor for key enzymes:
  • Ceruloplasmin (iron oxidation/transport)
  • Cytochrome c oxidase (ETC complex IV)
  • Superoxide dismutase (antioxidant)
  • Dopamine-β-hydroxylase (catecholamine synthesis)
  • Lysyl oxidase (collagen/elastin cross-linking)
  • Tyrosinase (melanin synthesis)
Deficiency:
  • Hypochromic normocytic or macrocytic anemia (rarely microcytic) + neutropenia + thrombocytopenia (mimics B12/folate deficiency hematologically)
  • Osteoporosis, pathologic fractures
  • Depigmentation of skin and hair
  • Neurological features (myelopathy similar to subacute combined degeneration)
  • At-risk: excessive zinc intake (zinc competes for absorption), chronic diarrhea, high-protein formula feeding in infants
Genetic disorders:
  • Menkes disease (X-linked): impaired copper transport (ATP7A mutation) → defective lysyl oxidase → "kinky hair," neurodegeneration, connective tissue fragility
  • Wilson's disease: impaired copper excretion (ATP7B mutation) → copper accumulation → liver disease, Kayser-Fleischer rings (eye), neuropsychiatric symptoms

Iodine (I⁻)

FeatureDetails
RDA150 µg/day; 220 µg in pregnancy; 290 µg lactation
SourcesIodized salt, seafood, dairy, seaweed
Functions: Required exclusively for thyroid hormone synthesis (T3/T4)
Deficiency:
  • Goiter (thyroid hyperplasia due to elevated TSH)
  • Hypothyroidism (fatigue, cold intolerance, constipation, weight gain)
  • Cretinism (in utero deficiency → irreversible intellectual disability, short stature, deafness, hypothyroidism)
  • Myxedematous cretinism vs. neurological cretinism
  • At-risk: those without access to iodized salt (inland/mountainous regions - "goiter belt")
Excess iodine:
  • Can paradoxically cause hypothyroidism (Wolff-Chaikoff effect) or hyperthyroidism (Jod-Basedow effect)

Selenium (Se)

FeatureDetails
RDA55 µg/day
UL400 µg/day
SourcesBrazil nuts (highest known food source), seafood, meat, cereals (soil-dependent)
Functions: Component of selenoproteins - glutathione peroxidase (antioxidant), thioredoxin reductase, iodothyronine deiodinase (T4 → T3 conversion)
Deficiency:
  • Keshan disease (endemic cardiomyopathy in China - selenium-deficient soil)
  • Kashin-Beck disease (endemic osteoarthropathy in China)
  • Myopathy, muscle pain
  • Hypothyroidism (impaired T4→T3 conversion)
  • At-risk: total parenteral nutrition (TPN) without selenium, Crohn's disease, renal dialysis, endemic low-soil areas (China, New Zealand)
Toxicity - Selenosis:
  • Garlic-breath odor (selenide compounds)
  • Alopecia, nail changes, peripheral neuropathy
  • Nausea, diarrhea

Chromium (Cr³⁺)

FeatureDetails
AI25-35 µg/day
SourcesWhole grains, broccoli, nuts, meat, cheese
Functions: Potentiates insulin signaling (part of "glucose tolerance factor")
Deficiency:
  • Glucose intolerance (insulin resistance)
  • Peripheral neuropathy
  • Mostly seen with long-term TPN (rare otherwise)

Manganese (Mn²⁺)

FeatureDetails
AIWomen: 1.8 mg / Men: 2.3 mg
SourcesWhole grains, nuts, legumes, tea, leafy vegetables
Functions: Cofactor for manganese superoxide dismutase, arginase, pyruvate carboxylase, glycosyltransferases (glycosaminoglycan synthesis)
Deficiency:
  • Hypercholesterolemia, dermatitis, weight loss (rare)
Toxicity (inhalation > ingestion):
  • Manganism - neurologic syndrome resembling Parkinson's disease (tremor, rigidity, behavioral changes)

Fluoride (F⁻)

FeatureDetails
AI3-4 mg/day
UL10 mg/day
SourcesFluoridated water, toothpaste, tea, seafood
Functions: Incorporated into hydroxyapatite (bone and teeth) → resistance to acid dissolution (dental caries prevention)
Deficiency: Increased dental caries (tooth decay)
Toxicity:
  • Dental fluorosis (mottled/pitted enamel, white spots) - from chronic mild excess during tooth development
  • Skeletal fluorosis (osteosclerosis, joint stiffness) - from chronic high exposure
  • Acute: nausea, vomiting, hypocalcemia, cardiac arrhythmias

Molybdenum

FeatureDetails
RDA45 µg/day
UL2,000 µg/day
SourcesLegumes, whole grains, nuts
Functions: Cofactor for xanthine oxidase (purine catabolism), sulfite oxidase, aldehyde oxidase
Deficiency: Very rare; seen with prolonged TPN - neurologic symptoms, accumulation of sulfite/xanthine

QUICK REFERENCE SUMMARY TABLES

Vitamin Deficiency Key Buzzwords

VitaminClassic Sign/Symptom
ANight blindness → Bitot spots → Keratomalacia
DRickets (children), Osteomalacia (adults)
EHemolytic anemia in premature infants; Spinocerebellar ataxia
KBleeding (elevated PT); Hemorrhagic disease of newborn
B1 (Thiamine)Beriberi (wet/dry); Wernicke-Korsakoff (alcoholics)
B2 (Riboflavin)Ariboflavinosis: Cheilosis, magenta tongue
B3 (Niacin)Pellagra: Dermatitis, Diarrhea, Dementia, Death
B5 (Pantothenic acid)Burning feet syndrome (rare)
B6 (Pyridoxine)Sideroblastic anemia; Seizures; Peripheral neuropathy
B7 (Biotin)Alopecia; Dermatitis (raw egg white/avidin)
B9 (Folate)Megaloblastic anemia; Neural tube defects (NO neuro symptoms)
B12 (Cobalamin)Megaloblastic anemia + Subacute combined degeneration
C (Ascorbic acid)Scurvy: Perifollicular hemorrhage, gingival bleeding, corkscrew hairs

Minerals - Deficiency Key Buzzwords

MineralClassic Sign/Symptom
CalciumTetany (Chvostek/Trousseau), seizures, osteoporosis
PhosphorusRefeeding syndrome; Respiratory failure
MagnesiumRefractory hypokalemia/hypocalcemia; Torsades; Eclampsia
IronMicrocytic anemia; Koilonychia; Pica; Plummer-Vinson
ZincAcrodermatitis enteropathica; Alopecia; Hypogonadism; Poor wound healing
CopperNormocytic/macrocytic anemia + neutropenia (mimics B12/folate)
IodineGoiter; Cretinism; Hypothyroidism
SeleniumKeshan disease (cardiomyopathy); Kashin-Beck disease
FluorideDental caries (deficiency); Dental/skeletal fluorosis (excess)
ChromiumGlucose intolerance
ManganeseToxicity → Parkinsonism (manganism)

"Only" Facts - High-Yield Points

  • Only vitamin made by skin: Vitamin D
  • Only vitamin found exclusively in animal products: Vitamin B12
  • Only fat-soluble vitamins: A, D, E, K (ADEK)
  • Only B vitamin with significant neurotoxicity in excess: B6 (pyridoxine)
  • Only vitamin/mineral to treat eclampsia: Magnesium sulfate
  • Only mineral to treat torsades de pointes: Magnesium
  • Only antidote for warfarin: Vitamin K
  • Coenzyme A backbone: Pantothenic acid (B5)
  • Most common nutritional deficiency worldwide: Iron deficiency anemia
  • Only 2 trace minerals measured by elevated serum levels: Iron (ferritin) and iodine (TSH surrogate)
  • Methylmalonic acid elevated in: B12 deficiency ONLY (not folate) - useful to distinguish

Goldman-Cecil Medicine (Vol. 2, Ch. 199) - Mason & Booth; Basic Medical Biochemistry (6th Ed.) - Lieberman et al.; The Washington Manual of Medical Therapeutics; Costanzo Physiology (7th Ed.)

Make a printable pdf

Reading File
Running Command

ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "created"

Running Command

mkdir -p /tmp/workspace/vitamins-minerals && cat > /tmp/workspace/vitamins-minerals/make_pdf.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether, PageBreak ) from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from reportlab.platypus import Flowable OUTPUT = "/tmp/workspace/vitamins-minerals/Vitamins_and_Minerals_Reference.pdf" doc = SimpleDocTemplate( OUTPUT, pagesize=A4, rightMargin=1.8*cm, leftMargin=1.8*cm, topMargin=2*cm, bottomMargin=2*cm, title="Vitamins & Minerals - Complete Clinical Reference", author="Orris Medical" ) W = A4[0] - 3.6*cm # usable width # ── Colour palette ──────────────────────────────────────────────────────────── C_NAVY = colors.HexColor("#1A3A5C") C_TEAL = colors.HexColor("#1B6B8A") C_TEAL2 = colors.HexColor("#2596be") C_GOLD = colors.HexColor("#D4A017") C_GREEN = colors.HexColor("#2E7D32") C_RED = colors.HexColor("#C62828") C_ORANGE = colors.HexColor("#E65100") C_PURPLE = colors.HexColor("#6A1B9A") C_LBLUE = colors.HexColor("#E3F2FD") C_LGREEN = colors.HexColor("#E8F5E9") C_LPUR = colors.HexColor("#F3E5F5") C_LORANGE = colors.HexColor("#FFF3E0") C_LYELLOW = colors.HexColor("#FFFDE7") C_LGRAY = colors.HexColor("#F5F5F5") C_TH_BG = colors.HexColor("#1A3A5C") C_TH2_BG = colors.HexColor("#1B6B8A") C_STRIPE = colors.HexColor("#EEF4FB") C_BORDER = colors.HexColor("#B0BEC5") styles = getSampleStyleSheet() # ── Custom paragraph styles ─────────────────────────────────────────────────── def S(name, **kw): base = kw.pop("parent", "Normal") s = ParagraphStyle(name, parent=styles[base], **kw) return s ST = { "title": S("T_title", fontSize=22, textColor=C_NAVY, leading=28, alignment=TA_CENTER, spaceAfter=4, fontName="Helvetica-Bold"), "subtitle": S("T_sub", fontSize=10, textColor=C_TEAL, leading=14, alignment=TA_CENTER, spaceAfter=2, fontName="Helvetica"), "h1": S("T_h1", fontSize=14, textColor=colors.white, leading=18, fontName="Helvetica-Bold", spaceAfter=0, spaceBefore=4), "h2": S("T_h2", fontSize=11, textColor=C_NAVY, leading=15, fontName="Helvetica-Bold", spaceBefore=8, spaceAfter=2), "h3": S("T_h3", fontSize=9.5,textColor=C_TEAL, leading=13, fontName="Helvetica-Bold", spaceBefore=5, spaceAfter=2), "body": S("T_body", fontSize=8.5,textColor=colors.black, leading=12, fontName="Helvetica", spaceAfter=2), "bullet": S("T_bullet", fontSize=8.5,textColor=colors.black, leading=12, fontName="Helvetica", spaceAfter=1, leftIndent=10, bulletIndent=0), "note": S("T_note", fontSize=8, textColor=C_TEAL, leading=11, fontName="Helvetica-Oblique", spaceAfter=2), "th": S("T_th", fontSize=8.5,textColor=colors.white, leading=11, fontName="Helvetica-Bold", alignment=TA_CENTER), "td": S("T_td", fontSize=8, textColor=colors.black, leading=11, fontName="Helvetica"), "tdg": S("T_tdg", fontSize=8, textColor=C_GREEN, leading=11, fontName="Helvetica-Bold"), "tdr": S("T_tdr", fontSize=8, textColor=C_RED, leading=11, fontName="Helvetica-Bold"), "footer": S("T_foot", fontSize=7, textColor=colors.grey, leading=9, alignment=TA_CENTER), "tag_fat": S("T_fat", fontSize=8, textColor=colors.white, leading=10, fontName="Helvetica-Bold", alignment=TA_CENTER), "tag_water":S("T_water", fontSize=8, textColor=colors.white, leading=10, fontName="Helvetica-Bold", alignment=TA_CENTER), "tag_min": S("T_min", fontSize=8, textColor=colors.white, leading=10, fontName="Helvetica-Bold", alignment=TA_CENTER), "callout": S("T_callout",fontSize=8.5,textColor=C_NAVY, leading=12, fontName="Helvetica", spaceAfter=2, leftIndent=8), } def p(text, style="body"): return Paragraph(text, ST[style]) def bp(text): return Paragraph(f"• {text}", ST["bullet"]) def hr(color=C_BORDER, thickness=0.5): return HRFlowable(width="100%", thickness=thickness, color=color, spaceAfter=4, spaceBefore=4) # ── Section header band ──────────────────────────────────────────────────────── def section_header(title, bg=C_NAVY): tbl = Table([[Paragraph(title, ST["h1"])]], colWidths=[W]) tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), bg), ("TOPPADDING", (0,0),(-1,-1), 6), ("BOTTOMPADDING", (0,0),(-1,-1), 6), ("LEFTPADDING", (0,0),(-1,-1), 10), ("RIGHTPADDING", (0,0),(-1,-1), 10), ("ROUNDEDCORNERS",(0,0),(-1,-1), [4,4,4,4]), ])) return tbl # ── Vitamin card builder ─────────────────────────────────────────────────────── def vit_card(name, tag_label, tag_color, rda, ul, sources, functions, deficiency_items, deficiency_label="Deficiency Signs", toxicity_items=None, key_points=None, at_risk=None, bg=C_LGRAY): elems = [] # Title row title_row = [ [Paragraph(name, S("vt_name", parent="Normal", fontSize=11, fontName="Helvetica-Bold", textColor=C_NAVY, leading=14)), Table([[Paragraph(tag_label, ST["tag_fat"])]], colWidths=[2*cm], style=TableStyle([("BACKGROUND",(0,0),(-1,-1),tag_color), ("TOPPADDING",(0,0),(-1,-1),3), ("BOTTOMPADDING",(0,0),(-1,-1),3), ("LEFTPADDING",(0,0),(-1,-1),4), ("RIGHTPADDING",(0,0),(-1,-1),4), ])) ] ] hdr = Table(title_row, colWidths=[W - 2.3*cm, 2.3*cm]) hdr.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), bg), ("TOPPADDING",(0,0),(-1,-1), 6), ("BOTTOMPADDING",(0,0),(-1,-1), 4), ("LEFTPADDING",(0,0),(-1,-1), 8), ("RIGHTPADDING",(0,0),(-1,-1), 6), ("VALIGN",(0,0),(-1,-1),"MIDDLE"), ])) elems.append(hdr) # Info table info_rows = [ [p("<b>RDA/AI:</b>","body"), p(rda,"body")], ] if ul: info_rows.append([p("<b>UL:</b>","body"), p(ul,"body")]) info_rows.append([p("<b>Sources:</b>","body"), p(sources,"body")]) info_rows.append([p("<b>Functions:</b>","body"), p(functions,"body")]) if at_risk: info_rows.append([p("<b>At-risk:</b>","body"), p(at_risk,"body")]) info = Table(info_rows, colWidths=[2.2*cm, W-2.4*cm]) info.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), colors.white), ("TOPPADDING",(0,0),(-1,-1), 3), ("BOTTOMPADDING",(0,0),(-1,-1), 3), ("LEFTPADDING",(0,0),(-1,-1), 8), ("RIGHTPADDING",(0,0),(-1,-1), 6), ("VALIGN",(0,0),(-1,-1),"TOP"), ("LINEBELOW",(0,-1),(-1,-1), 0.3, C_BORDER), ])) elems.append(info) # Deficiency / Toxicity / Key points columns def_items_p = [bp(i) for i in deficiency_items] tox_items_p = [bp(i) for i in toxicity_items] if toxicity_items else [p("Not established / minimal","note")] kp_items_p = [bp(i) for i in key_points] if key_points else [] # Deficiency box def_header = Table([[p(f"<b>⚠ {deficiency_label}</b>","body")]], colWidths=[W]) def_header.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), colors.HexColor("#FFEBEE")), ("TOPPADDING",(0,0),(-1,-1), 3),("BOTTOMPADDING",(0,0),(-1,-1), 3), ("LEFTPADDING",(0,0),(-1,-1), 8),("RIGHTPADDING",(0,0),(-1,-1), 6), ])) tox_header = Table([[p("<b>☠ Toxicity</b>","body")]], colWidths=[W]) tox_header.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), colors.HexColor("#FFF3E0")), ("TOPPADDING",(0,0),(-1,-1), 3),("BOTTOMPADDING",(0,0),(-1,-1), 3), ("LEFTPADDING",(0,0),(-1,-1), 8),("RIGHTPADDING",(0,0),(-1,-1), 6), ])) # Two-column layout for deficiency + toxicity if toxicity_items: col_w = (W - 0.3*cm) / 2 def_cell = [def_header] + def_items_p tox_cell = [tox_header] + tox_items_p two_col = Table([[def_cell, tox_cell]], colWidths=[col_w, col_w]) two_col.setStyle(TableStyle([ ("VALIGN",(0,0),(-1,-1),"TOP"), ("LEFTPADDING",(0,0),(-1,-1), 0), ("RIGHTPADDING",(0,0),(-1,-1), 0), ("TOPPADDING",(0,0),(-1,-1), 0), ("BOTTOMPADDING",(0,0),(-1,-1), 0), ])) elems.append(two_col) else: elems.append(def_header) for i in def_items_p: elems.append(i) if kp_items_p: kp_header = Table([[p("<b>★ Key Points</b>","body")]], colWidths=[W]) kp_header.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), colors.HexColor("#E8F5E9")), ("TOPPADDING",(0,0),(-1,-1), 3),("BOTTOMPADDING",(0,0),(-1,-1), 3), ("LEFTPADDING",(0,0),(-1,-1), 8),("RIGHTPADDING",(0,0),(-1,-1), 6), ])) kp_items_wrap = Table([[kp_header] + kp_items_p], colWidths=[W]) kp_items_wrap.setStyle(TableStyle([ ("LEFTPADDING",(0,0),(-1,-1), 0), ("RIGHTPADDING",(0,0),(-1,-1), 0), ("TOPPADDING",(0,0),(-1,-1), 0), ("BOTTOMPADDING",(0,0),(-1,-1), 0), ])) elems.append(kp_header) for i in kp_items_p: elems.append(i) # Wrap all in a border box card_inner = [[e] for e in elems] card = Table(card_inner, colWidths=[W]) card.setStyle(TableStyle([ ("BOX",(0,0),(-1,-1), 0.8, C_TEAL2), ("LEFTPADDING",(0,0),(-1,-1), 0), ("RIGHTPADDING",(0,0),(-1,-1), 0), ("TOPPADDING",(0,0),(-1,-1), 0), ("BOTTOMPADDING",(0,0),(-1,-1), 0), ])) return KeepTogether([card, Spacer(1, 0.25*cm)]) # ── Simple table helper ──────────────────────────────────────────────────────── def simple_table(headers, rows, col_widths=None, stripe=True): header_row = [Paragraph(h, ST["th"]) for h in headers] data = [header_row] for i, row in enumerate(rows): bg = C_STRIPE if (stripe and i % 2 == 0) else colors.white data.append([Paragraph(str(c), ST["td"]) for c in row]) if col_widths is None: col_widths = [W / len(headers)] * len(headers) tbl = Table(data, colWidths=col_widths, repeatRows=1) style = [ ("BACKGROUND", (0,0), (-1,0), C_TH_BG), ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"), ("FONTSIZE", (0,0), (-1,0), 8.5), ("TEXTCOLOR", (0,0), (-1,0), colors.white), ("ALIGN", (0,0), (-1,0), "CENTER"), ("VALIGN", (0,0), (-1,-1), "TOP"), ("FONTSIZE", (0,1), (-1,-1), 8), ("ROWBACKGROUNDS",(0,1), (-1,-1), [C_STRIPE, colors.white]), ("GRID", (0,0), (-1,-1), 0.3, C_BORDER), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 5), ("RIGHTPADDING", (0,0), (-1,-1), 5), ] tbl.setStyle(TableStyle(style)) return tbl # ══════════════════════════════════════════════════════════════════════════════ # BUILD CONTENT # ══════════════════════════════════════════════════════════════════════════════ story = [] # ── Cover / Title ───────────────────────────────────────────────────────────── story.append(Spacer(1, 0.5*cm)) story.append(p("Vitamins & Minerals", "title")) story.append(p("Complete Clinical Reference — Important Points to Remember", "subtitle")) story.append(p("Sources: Goldman-Cecil Medicine · Basic Medical Biochemistry · Washington Manual · Costanzo Physiology", "footer")) story.append(hr(C_TEAL2, 2)) story.append(Spacer(1, 0.3*cm)) # Key principle box kp_box_data = [[ Paragraph("KEY PRINCIPLES", S("kp_hdr", parent="Normal", fontSize=9, fontName="Helvetica-Bold", textColor=colors.white, leading=12)), Paragraph( "<b>Fat-soluble vitamins (A, D, E, K):</b> absorbed via micellar phase; stored in body; " "any fat malabsorption causes simultaneous deficiency; toxicity possible with excess.<br/>" "<b>Water-soluble vitamins (B-complex, C):</b> excess excreted in urine; limited storage; " "deficiency develops faster; most act as coenzymes.<br/>" "<b>Minerals:</b> essential for enzyme cofactors, structural roles, fluid balance, and signalling.", S("kp_body", parent="Normal", fontSize=8, fontName="Helvetica", textColor=colors.black, leading=12) ) ]] kp_box = Table(kp_box_data, colWidths=[2.5*cm, W-2.5*cm]) kp_box.setStyle(TableStyle([ ("BACKGROUND", (0,0), (0,0), C_NAVY), ("BACKGROUND", (1,0), (1,0), C_LYELLOW), ("VALIGN", (0,0), (-1,-1), "MIDDLE"), ("TOPPADDING", (0,0), (-1,-1), 8), ("BOTTOMPADDING",(0,0),(-1,-1), 8), ("LEFTPADDING",(0,0),(-1,-1), 8), ("RIGHTPADDING",(0,0),(-1,-1), 8), ("BOX", (0,0),(-1,-1), 1, C_NAVY), ])) story.append(kp_box) story.append(Spacer(1, 0.4*cm)) # ══════════════════════════════════════════════════════════════════════════════ # FAT-SOLUBLE VITAMINS # ══════════════════════════════════════════════════════════════════════════════ story.append(section_header("FAT-SOLUBLE VITAMINS (A · D · E · K)", C_NAVY)) story.append(Spacer(1, 0.2*cm)) story.append(vit_card( name="Vitamin A (Retinol / Retinoic Acid)", tag_label="FAT-SOLUBLE", tag_color=C_TEAL, rda="Women: 700 µg RAE/day | Men: 900 µg RAE/day", ul="3,000 µg/day (teratogenic in excess)", sources="Liver, dairy, eggs (preformed retinol); dark orange/yellow & leafy green vegetables (β-carotene provitamin)", functions="Vision (rhodopsin synthesis - retinal); Epithelial differentiation (retinoic acid - gene regulation); Immune function; Reproduction; Bone growth", deficiency_items=[ "Night blindness — earliest sign", "Bitot's spots (foamy white plaques on conjunctiva)", "Xerophthalmia (dry eyes) → Keratomalacia (corneal ulceration/blindness)", "Follicular hyperkeratosis ('toad skin')", "Increased susceptibility to infection (especially measles, diarrhea in children)", ], toxicity_items=[ "Acute: headache, vomiting, blurred vision, skin peeling", "Chronic: alopecia, dry skin, hepatotoxicity, pseudotumor cerebri", "TERATOGENIC — isotretinoin causes birth defects", "Hypercalcemia with chronic excess", ], key_points=[ "Progression: Night blindness → Bitot spots → Xerophthalmia → Keratomalacia", "Retinoic acid regulates gene transcription → growth and differentiation", "At-risk: fat malabsorption, chronic liver disease, strict vegetarians", ], at_risk="Malabsorptive states (proximal small bowel disease), chronic liver disease, strict vegetarians", bg=colors.HexColor("#FFF8E1") )) story.append(vit_card( name="Vitamin D (Calciferol — the 'Sunshine Vitamin')", tag_label="FAT-SOLUBLE", tag_color=C_TEAL, rda="600 IU (15 µg) under age 70; 800 IU over age 70", ul="4,000 IU/day", sources="Skin synthesis (UV + 7-dehydrocholesterol); fatty fish, fortified dairy/OJ, egg yolk", functions="Increases intestinal Ca²⁺ & phosphate absorption; bone mineralization; immune modulation; cell differentiation", deficiency_items=[ "Children: RICKETS — soft/bowed bones, craniotabes, rachitic rosary, widened epiphyseal plates", "Adults: OSTEOMALACIA — bone pain, pathologic fractures, proximal muscle weakness, waddling gait", "Hypocalcemia → tetany, seizures", ], toxicity_items=[ "Hypercalcemia: nausea, vomiting, polyuria, polydipsia, constipation, confusion", "Metastatic calcifications (kidneys, vessels, soft tissue)", "Nephrolithiasis and nephrocalcinosis", ], key_points=[ "Metabolism: Skin (D3) → Liver (25-OH) → Kidney (1,25-OH₂ = calcitriol) — PTH stimulates 1α-hydroxylation", "25(OH)D is the BEST serum marker of Vitamin D status (half-life ~3 weeks)", "At-risk: dark skin, exclusively breastfed infants, elderly/institutionalized, obesity, chronic liver/kidney disease", ], at_risk="Dark-skinned individuals, exclusively breastfed infants, limited sun exposure, obesity, malabsorptive states, chronic liver/kidney disease", bg=colors.HexColor("#FFF8E1") )) story.append(vit_card( name="Vitamin E (Tocopherol)", tag_label="FAT-SOLUBLE", tag_color=C_TEAL, rda="15 mg α-tocopherol/day", ul="1,000 mg/day", sources="Vegetable oils, wheat germ, nuts, seeds, green leafy vegetables", functions="Major lipid-soluble ANTIOXIDANT; protects cell membranes from peroxidation; RBC integrity; normal neurologic function", deficiency_items=[ "Hemolytic anemia — especially in premature infants (primary risk group)", "Spinocerebellar ataxia (progressive neurologic degeneration)", "Peripheral neuropathy (demyelination — posterior columns + spinocerebellar tracts)", "Ophthalmoplegia, areflexia, retinopathy in premature infants", ], toxicity_items=[ "Inhibits platelet aggregation → bleeding tendency", "Antagonizes Vitamin K → risk of hemorrhage at very high doses", ], key_points=[ "Works synergistically with selenium (both antioxidants)", "Abetalipoproteinemia → profound Vit E deficiency (no chylomicron/VLDL transport)", "At-risk: premature neonates, fat malabsorption syndromes", ], at_risk="Premature neonates, fat malabsorption syndromes, abetalipoproteinemia", bg=colors.HexColor("#FFF8E1") )) story.append(vit_card( name="Vitamin K (Phylloquinone K1 / Menaquinone K2)", tag_label="FAT-SOLUBLE", tag_color=C_TEAL, rda="Women: 90 µg/day | Men: 120 µg/day (AI — no UL established)", ul="No established UL (K1/K2 essentially non-toxic; K3 menadione toxic)", sources="K1: leafy green vegetables; K2: gut bacteria + fermented foods; K3: synthetic form", functions="Cofactor for γ-carboxylation: Clotting factors II, VII, IX, X + Proteins C, S, Z; Osteocalcin synthesis (bone mineralization)", deficiency_items=[ "Bleeding diathesis — elevated PT/INR (prolonged clotting time)", "HEMORRHAGIC DISEASE OF NEWBORN (HDN) — no gut bacteria, little placental transfer → prophylactic K injection at birth", "Spontaneous bruising, hematuria, GI bleeding", ], toxicity_items=[ "K1/K2: essentially non-toxic even in large amounts", "Synthetic K3 (menadione): hemolytic anemia and kernicterus in infants", ], key_points=[ "Warfarin antagonizes Vitamin K (blocks VKOR enzyme)", "Proteins C and S are anticoagulant and ALSO require Vitamin K — warfarin initially procoagulant", "All newborns receive prophylactic IM Vitamin K injection at birth", "At-risk: newborns, broad-spectrum antibiotics, fat malabsorption, warfarin therapy", ], at_risk="Newborns, broad-spectrum antibiotic use, fat malabsorption, warfarin therapy", bg=colors.HexColor("#FFF8E1") )) # ══════════════════════════════════════════════════════════════════════════════ # WATER-SOLUBLE VITAMINS # ══════════════════════════════════════════════════════════════════════════════ story.append(PageBreak()) story.append(section_header("WATER-SOLUBLE VITAMINS (B-Complex · Vitamin C)", C_TEAL)) story.append(Spacer(1, 0.2*cm)) story.append(vit_card( name="Vitamin B1 — Thiamine", tag_label="WATER-SOLUBLE", tag_color=C_GREEN, rda="Women: 1.1 mg/day | Men: 1.2 mg/day", ul="No UL established", sources="Whole grains, enriched cereals, legumes, pork, nuts, seeds", functions="As TPP: Pyruvate dehydrogenase (pyruvate→acetyl-CoA); α-ketoglutarate dehydrogenase (TCA); Transketolase (pentose phosphate pathway); Branched-chain AA catabolism", deficiency_items=[ "WET BERIBERI — high-output cardiac failure, dilated cardiomyopathy, edema", "DRY BERIBERI — peripheral neuropathy (distal sensorimotor polyneuropathy, legs > arms)", "WERNICKE'S ENCEPHALOPATHY (triad): Confusion + Ophthalmoplegia + Ataxia — acute, reversible", "KORSAKOFF'S SYNDROME: anterograde amnesia + confabulation — chronic, often irreversible", ], toxicity_items=[ "No known toxicity — excess excreted in urine", ], key_points=[ "ALWAYS give thiamine BEFORE glucose in suspected deficiency (glucose worsens Wernicke's)", "Primary risk group: ALCOHOLICS (reduced intake + impaired absorption + impaired utilization)", "Also at-risk: prolonged IV glucose without thiamine, dialysis, hyperemesis gravidarum, gastric bypass", "Most sensitive test: RBC transketolase activity", ], at_risk="Alcoholics, malnutrition, prolonged IV glucose without thiamine, dialysis, hyperemesis gravidarum, gastric bypass", bg=C_LGREEN )) story.append(vit_card( name="Vitamin B2 — Riboflavin", tag_label="WATER-SOLUBLE", tag_color=C_GREEN, rda="Women: 1.1 mg/day | Men: 1.3 mg/day", ul="No UL established", sources="Dairy products, lean meats, enriched cereals, eggs, leafy vegetables", functions="As FMN/FAD: electron carrier in redox reactions (ETC); fatty acid β-oxidation; glutathione reductase (antioxidant); required for B6 and folate activation", deficiency_items=[ "ARIBOFLAVINOSIS: Cheilosis + angular stomatitis (cracking at corners of mouth)", "Glossitis — magenta tongue", "Seborrheic dermatitis (scrotum, vulva, nasolabial folds)", "Corneal vascularization, photophobia", "Normochromic normocytic anemia", ], toxicity_items=[ "No known significant toxicity", "Urine turns yellow-green (fluorescent) on supplementation", ], key_points=[ "Required for activation of Vitamin B6 and Folate", "Phenothiazines, tricyclics, and probenecid impair riboflavin absorption", ], at_risk="Alcoholics, malabsorption, elderly on poor diets", bg=C_LGREEN )) story.append(vit_card( name="Vitamin B3 — Niacin / Nicotinamide", tag_label="WATER-SOLUBLE", tag_color=C_GREEN, rda="Women: 14 mg NE/day | Men: 16 mg NE/day", ul="35 mg/day (supplemental)", sources="Meat, poultry, fish, peanuts, enriched cereals; also synthesized from tryptophan (60 mg Trp = 1 mg niacin)", functions="As NAD⁺/NADH and NADP⁺/NADPH: central coenzyme in redox reactions — glycolysis, TCA cycle, fatty acid synthesis/oxidation, oxidative phosphorylation", deficiency_items=[ "PELLAGRA — The 4 Ds: Dermatitis + Diarrhea + Dementia + Death", "Casal's necklace — hyperpigmented rash on sun-exposed skin (neck, dorsum of hands)", "Bright red tongue, confusion, neuropsychiatric symptoms", ], toxicity_items=[ "Pharmacologic doses (1-3g): FLUSHING (prostaglandin-mediated → prevent with aspirin)", "Hepatotoxicity (esp. sustained-release forms)", "Hyperglycemia, hyperuricemia (at high therapeutic doses)", ], key_points=[ "Pellagra-causing conditions: Corn-based diets (niacytin form of niacin unabsorbable), ALCOHOLICS", "Hartnup disease: defective neutral AA transport → low tryptophan → pellagra-like symptoms", "Carcinoid syndrome: tryptophan diverted to serotonin → pellagra", "Isoniazid (INH) impairs tryptophan → niacin conversion (give B6 with INH)", "High-dose niacin: best agent for RAISING HDL-C", ], at_risk="Corn-based diets, alcoholics, Hartnup disease, carcinoid syndrome, INH therapy", bg=C_LGREEN )) story.append(vit_card( name="Vitamin B5 — Pantothenic Acid", tag_label="WATER-SOLUBLE", tag_color=C_GREEN, rda="AI: 5 mg/day (both sexes)", ul="No UL established", sources="Ubiquitous in all foods (Greek: pantos = 'everywhere'); liver, egg yolk, avocado are richest sources", functions="As Coenzyme A (CoA): central to ALL CoA-dependent reactions — fatty acid synthesis & oxidation, TCA cycle (acetyl-CoA, succinyl-CoA), steroid synthesis, heme synthesis, acetylcholine synthesis", deficiency_items=[ "Extremely rare due to ubiquitous distribution", "'Burning feet syndrome' — painful paresthesias and burning of feet", "Irritability, fatigue, headache, nausea in severe malnutrition", ], key_points=[ "Backbone of Coenzyme A — essential for ALL acyl-group transfer reactions", "Almost never seen in clinical practice except in extreme starvation", ], bg=C_LGREEN )) story.append(PageBreak()) story.append(vit_card( name="Vitamin B6 — Pyridoxine", tag_label="WATER-SOLUBLE", tag_color=C_GREEN, rda="1.3 mg/day (adults)", ul="100 mg/day", sources="Meat, poultry, fish, potatoes, bananas, fortified cereals", functions="As PLP (Pyridoxal Phosphate): Transamination (ALT, AST); Decarboxylation → neurotransmitters (serotonin, dopamine, GABA, histamine); Heme synthesis (ALA synthase); Glycogenolysis; Cystathionine synthesis (homocysteine→cysteine)", deficiency_items=[ "Seborrheic dermatitis, cheilosis, glossitis (similar to B2 deficiency)", "MICROCYTIC SIDEROBLASTIC ANEMIA — impaired heme synthesis; ring sideroblasts on bone marrow", "PERIPHERAL NEUROPATHY", "CONVULSIONS/SEIZURES — decreased GABA synthesis", "Depression, confusion; elevated homocysteine (cardiovascular risk)", ], toxicity_items=[ "SENSORY NEUROPATHY at >200 mg/day — only B vitamin with significant neurotoxicity", "Ataxia, proprioception loss, irreversible nerve damage with megadose use", ], key_points=[ "Isoniazid (INH) binds and inactivates PLP → give B6 (25-50 mg/day) prophylactically with INH", "Penicillamine and oral contraceptives also deplete B6", "Key memory: B6 needed for EVERY step of neurotransmitter and heme biosynthesis", ], at_risk="Alcoholics, isoniazid therapy, penicillamine, oral contraceptives", bg=C_LGREEN )) story.append(vit_card( name="Vitamin B7 — Biotin", tag_label="WATER-SOLUBLE", tag_color=C_GREEN, rda="AI: 30 µg/day", ul="No UL established", sources="Liver, egg yolk (cooked), nuts, legumes; gut bacteria produce some", functions="Cofactor for carboxylation reactions (CO₂ fixation): Pyruvate carboxylase (pyruvate→OAA); Acetyl-CoA carboxylase (acetyl-CoA→malonyl-CoA, fatty acid synthesis); Propionyl-CoA carboxylase; β-methylcrotonyl-CoA carboxylase", deficiency_items=[ "ALOPECIA (hair loss) — hallmark sign", "PERIORIFICIAL DERMATITIS — scaly rash around eyes, nose, mouth, genitals", "Conjunctivitis", "CNS abnormalities: lethargy, depression, hallucinations", ], key_points=[ "RAW EGG WHITES contain AVIDIN — binds biotin irreversibly → biotin deficiency (cooking denatures avidin)", "Biotinidase deficiency — inherited disorder causing biotin deficiency in infants", "Prolonged TPN without biotin supplementation is a risk", ], at_risk="Raw egg white consumption, prolonged TPN, biotinidase deficiency", bg=C_LGREEN )) story.append(vit_card( name="Vitamin B9 — Folate / Folic Acid", tag_label="WATER-SOLUBLE", tag_color=C_GREEN, rda="400 µg DFE/day; 600 µg in PREGNANCY; 500 µg lactation", ul="1,000 µg/day (supplemental folate only)", sources="Leafy green vegetables (spinach, asparagus), legumes, fortified cereals, citrus fruits, liver", functions="As THF (Tetrahydrofolate): One-carbon transfer reactions — purine synthesis, thymidylate synthesis (dTMP from dUMP), homocysteine→methionine (requires B12)", deficiency_items=[ "MEGALOBLASTIC MACROCYTIC ANEMIA — impaired DNA synthesis; large hypersegmented neutrophils + oval macrocytes", "NEURAL TUBE DEFECTS (spina bifida, anencephaly) — critical in first 4 weeks of pregnancy", "Elevated homocysteine → cardiovascular risk", "NO NEUROLOGIC SYMPTOMS (key difference from B12 deficiency)", ], toxicity_items=[ "Can MASK B12 deficiency (corrects anemia but not neurologic damage)", "Seizure threshold may be lowered at very high doses", ], key_points=[ "400-800 µg/day recommended for ALL women of childbearing age (pre-conceptionally)", "METHYLFOLATE TRAP: B12 deficiency → folate accumulates as inactive N5-methyl-THF", "Drug interactions: Methotrexate, trimethoprim, pyrimethamine → inhibit DHFR", "Phenytoin and sulfasalazine impair folate absorption", ], at_risk="Pregnancy, alcoholics, elderly, methotrexate/TMP use, celiac disease, Crohn's disease", bg=C_LGREEN )) story.append(vit_card( name="Vitamin B12 — Cobalamin", tag_label="WATER-SOLUBLE", tag_color=C_GREEN, rda="2.4 µg/day", ul="No UL established", sources="EXCLUSIVELY animal products (meat, fish, dairy, eggs) — vegans MUST supplement", functions="Methylcobalamin: methionine synthase (homocysteine→methionine, regenerates THF); Adenosylcobalamin: methylmalonyl-CoA mutase (methylmalonyl-CoA→succinyl-CoA)", deficiency_items=[ "MEGALOBLASTIC MACROCYTIC ANEMIA (same as folate)", "SUBACUTE COMBINED DEGENERATION OF SPINAL CORD: posterior columns (↓vibration/proprioception) + lateral corticospinal tracts (UMN signs) + peripheral neuropathy", "Glossitis — beefy red, smooth tongue", "Elevated METHYLMALONIC ACID (MMA) + elevated homocysteine (both elevated vs. folate only homocysteine)", "Neuropsychiatric symptoms: dementia, depression, psychosis", ], toxicity_items=[ "No known toxicity — water soluble, excess excreted", ], key_points=[ "Absorption: B12 + Intrinsic Factor (parietal cells) → ILEUM (terminal ileum is exclusive absorption site)", "PERNICIOUS ANEMIA: autoimmune parietal cell destruction → no IF → B12 malabsorption", "MMA elevated ONLY in B12 deficiency (not folate) — use to distinguish the two", "Metformin impairs B12 absorption — monitor B12 in long-term metformin users", "Other causes: gastrectomy, ileal disease/resection, bacterial overgrowth, D. latum tapeworm", ], at_risk="Strict vegans, pernicious anemia, gastrectomy, ileal resection, bacterial overgrowth, metformin use, elderly", bg=C_LGREEN )) story.append(PageBreak()) story.append(vit_card( name="Vitamin C — Ascorbic Acid", tag_label="WATER-SOLUBLE", tag_color=C_GREEN, rda="Women: 75 mg/day | Men: 90 mg/day | Smokers +35 mg/day", ul="2,000 mg/day", sources="Citrus fruits, strawberries, kiwi, bell peppers, broccoli, potatoes", functions="Cofactor for prolyl/lysyl hydroxylase (collagen synthesis); Iron absorption enhancer (Fe³⁺→Fe²⁺); Antioxidant (regenerates Vitamin E); Dopamine-β-hydroxylase (dopamine→norepinephrine); Carnitine synthesis", deficiency_items=[ "SCURVY — defective collagen → vascular/tissue fragility", "PERIFOLLICULAR HEMORRHAGES + CORKSCREW HAIRS (pathognomonic)", "Gingival bleeding and gingivitis (swollen, spongy, bleeding gums)", "Poor wound healing", "Petechiae and ecchymoses (bruising)", "Infants: Frankel's sign (corner fractures of long bones), Pelkan spurs", ], toxicity_items=[ "GI upset (diarrhea) at >2 g/day", "Oxalate kidney stones with chronic very high intake", "Hemolysis in G6PD-deficient individuals", ], key_points=[ "Corkscrew hairs are PATHOGNOMONIC for scurvy", "Vitamin C enhances non-heme iron absorption — take together", "Does NOT prevent the common cold (evidence does not support this)", "At-risk: elderly on restricted diets, alcoholics, smokers, food insecurity", ], at_risk="Elderly on restricted diets, alcoholics, smokers, food insecurity", bg=C_LGREEN )) # ══════════════════════════════════════════════════════════════════════════════ # MINERALS # ══════════════════════════════════════════════════════════════════════════════ story.append(section_header("MINERALS (Macro & Trace)", colors.HexColor("#4A148C"))) story.append(Spacer(1, 0.2*cm)) PURPLE = colors.HexColor("#F3E5F5") story.append(vit_card( name="Calcium (Ca²⁺)", tag_label="MACROMINERAL", tag_color=C_PURPLE, rda="1,000 mg/day (adults 19-50); 1,200 mg (women >50, all >70)", ul="2,500 mg/day", sources="Dairy products, fortified foods, leafy greens (kale, bok choy), sardines (with bones)", functions="Bone & teeth structure (99% in skeleton as hydroxyapatite); muscle contraction; nerve transmission; coagulation (factor activation); second messenger signalling (Ca²⁺-calmodulin)", deficiency_items=[ "HYPOCALCEMIA: Tetany — Chvostek's sign (tap facial nerve → facial twitch) + Trousseau's sign (BP cuff → carpal spasm)", "Seizures, perioral/digital paresthesias", "Prolonged QT interval → cardiac arrhythmias", "Chronic inadequate intake → OSTEOPOROSIS", ], toxicity_items=[ "'Bones, Stones, Groans, Psychic Moans' (Hypercalcemia mnemonic)", "Kidney stones (nephrolithiasis), constipation, nausea", "Bone pain, confusion, depression, psychosis", "Hypercalcemia causes: primary hyperparathyroidism (most common outpatient), malignancy (most common inpatient)", ], key_points=[ "Absorption requires calcitriol (active Vitamin D) — Vitamin D deficiency → secondary hypocalcemia", "PTH and Vitamin D are the major regulators of calcium homeostasis", "Refractory hypocalcemia → always check and correct MAGNESIUM first", ], at_risk="Postmenopausal women, elderly, low dairy intake, Vitamin D deficiency", bg=PURPLE )) story.append(vit_card( name="Magnesium (Mg²⁺)", tag_label="MACROMINERAL", tag_color=C_PURPLE, rda="Women: 310-320 mg/day | Men: 400-420 mg/day", ul="350 mg/day (supplemental only)", sources="Nuts, seeds, whole grains, leafy greens (spinach), legumes, dark chocolate", functions="Cofactor for >300 enzymes; ATP stabilization (Mg-ATP complex); protein synthesis; DNA replication; muscle relaxation; neuromuscular junction function", deficiency_items=[ "HYPOCALCEMIA refractory to calcium replacement (Mg required for PTH secretion and action)", "HYPOKALEMIA (renal K⁺ wasting — cannot correct K⁺ without first correcting Mg²⁺)", "Muscle cramps, tremors, tetany", "TORSADES DE POINTES and other cardiac arrhythmias", "Personality changes, nystagmus, seizures", ], toxicity_items=[ "Respiratory depression (used therapeutically: IV Mg for eclampsia — monitor respiratory rate)", "Hypotension, cardiac arrest at very high IV levels", "Diarrhea with oral high-dose Mg (osmotic effect)", ], key_points=[ "Most common cause of hypomagnesemia: ALCOHOLISM", "Also: loop/thiazide diuretics, PPIs (chronic use), diarrhea, Gitelman syndrome, DM", "IV Magnesium Sulfate: treatment of eclampsia seizures AND torsades de pointes", "Patellar reflex is clinical monitor for Mg toxicity during IV infusion", ], at_risk="Alcoholics, diuretics (loop/thiazide), chronic PPI use, diarrhea, diabetes", bg=PURPLE )) story.append(vit_card( name="Phosphorus", tag_label="MACROMINERAL", tag_color=C_PURPLE, rda="700 mg/day", ul="4,000 mg/day", sources="Widely distributed; dairy, meat, fish, nuts, legumes, cola drinks (phosphoric acid)", functions="Bone mineralization (hydroxyapatite); ATP (energy currency); phospholipids (cell membranes); DNA/RNA backbone; enzyme regulation via phosphorylation/dephosphorylation", deficiency_items=[ "Muscle weakness, bone pain, hemolytic anemia", "Respiratory failure (ATP depletion → diaphragm failure)", "REFEEDING SYNDROME — dramatic phosphate fall after carbohydrate refeeding of malnourished patients → cardiac arrest, seizures, respiratory failure", ], key_points=[ "Refeeding syndrome triad: Hypophosphatemia + Hypokalemia + Hypomagnesemia", "Prevention: start refeeding slowly; monitor and supplement phosphate", "Hyperphosphatemia in chronic kidney disease → secondary hyperparathyroidism and renal osteodystrophy", ], bg=PURPLE )) story.append(PageBreak()) story.append(vit_card( name="Iron (Fe²⁺/Fe³⁺)", tag_label="TRACE MINERAL", tag_color=colors.HexColor("#B71C1C"), rda="Women 19-50: 18 mg; Men: 8 mg; Pregnancy: 27 mg", ul="45 mg/day", sources="Heme iron (red meat, organ meats — 15-35% absorbed); Non-heme iron (legumes, fortified cereals, spinach — 2-10% absorbed); Vitamin C enhances non-heme absorption", functions="Hemoglobin (O₂ transport), myoglobin (muscle O₂ storage), cytochromes (electron transport chain), catalase/peroxidase enzymes", deficiency_items=[ "MICROCYTIC HYPOCHROMIC ANEMIA — fatigue, pallor, decreased exercise tolerance", "KOILONYCHIA (spoon-shaped nails)", "PICA (craving ice, clay, starch)", "PLUMMER-VINSON SYNDROME: iron deficiency + dysphagia + esophageal web", "Glossitis, angular stomatitis, restless leg syndrome", "Labs: low ferritin (best marker), low serum iron, high TIBC, low transferrin saturation", ], toxicity_items=[ "HEREDITARY HEMOCHROMATOSIS: HFE gene (C282Y mutation) — 'bronze diabetes' triad (cirrhosis + diabetes + bronze skin)", "Also: cardiac failure, hypogonadism, arthropathy, hepatocellular carcinoma risk", "Acute poisoning (children): gastroenteritis → shock → hepatic failure", "Treatment: phlebotomy (hereditary); deferoxamine (acute toxicity)", ], key_points=[ "Most common nutritional deficiency worldwide", "Heme iron absorbed 5-10x better than non-heme iron", "Serum ferritin is the BEST marker of iron stores (acute phase reactant — falsely elevated in inflammation)", "At-risk: reproductive-age females, pregnancy, infants, vegetarians, GI bleeding, post-gastric bypass, celiac", ], at_risk="Reproductive-age females, pregnancy, infants/children, vegetarians, post-gastric bypass, celiac disease, chronic GI bleeding", bg=colors.HexColor("#FFEBEE") )) story.append(vit_card( name="Zinc (Zn²⁺)", tag_label="TRACE MINERAL", tag_color=colors.HexColor("#B71C1C"), rda="Women: 8 mg/day | Men: 11 mg/day", ul="40 mg/day", sources="Oysters (richest source), red meat, poultry, beans, nuts, fortified cereals", functions="Cofactor for >100 enzymes (DNA polymerase, RNA polymerase, carbonic anhydrase); zinc finger transcription factors; wound healing; taste/smell; immune function; spermatogenesis; Vitamin A mobilization from liver", deficiency_items=[ "ACRODERMATITIS ENTEROPATHICA — periorificial and acral rash (around mouth, eyes, genitals, hands/feet)", "ALOPECIA (hair loss)", "HYPOGONADISM + growth retardation in children", "DYSGEUSIA/DYSOSMIA (impaired taste and smell)", "Poor wound healing; impaired immune function", "Night blindness (zinc needed to mobilize Vitamin A from liver)", ], toxicity_items=[ "High-dose zinc COMPETITIVELY INHIBITS copper absorption → copper deficiency (anemia + neutropenia)", "Nausea, vomiting, diarrhea, gastric irritation", ], key_points=[ "Acrodermatitis enteropathica = inherited zinc malabsorption (SLC39A4 mutation)", "High-phytate diets (cereals, legumes) chelate zinc → reduced absorption", "Chronic diarrhea and fistulas are major risk factors", ], at_risk="Alcoholics, chronic diarrhea, high-phytate diets, malabsorptive states, nephrotic syndrome, pregnancy, post-gastric bypass, HIV, sickle cell", bg=colors.HexColor("#FFEBEE") )) story.append(vit_card( name="Copper (Cu²⁺)", tag_label="TRACE MINERAL", tag_color=colors.HexColor("#B71C1C"), rda="900 µg/day", ul="10,000 µg/day", sources="Liver, shellfish (oysters), nuts, seeds, dark chocolate, whole grains", functions="Ceruloplasmin (iron oxidation/transport); Cytochrome c oxidase (ETC complex IV); Superoxide dismutase (antioxidant); Dopamine-β-hydroxylase; Lysyl oxidase (collagen/elastin cross-linking); Tyrosinase (melanin synthesis)", deficiency_items=[ "HYPOCHROMIC NORMOCYTIC OR MACROCYTIC ANEMIA + NEUTROPENIA + thrombocytopenia (mimics B12/folate hematologically)", "Osteoporosis, pathologic fractures", "Depigmentation of skin and hair", "Myelopathy resembling subacute combined degeneration", ], toxicity_items=[ "WILSON'S DISEASE (ATP7B mutation): copper accumulation → liver disease + Kayser-Fleischer rings + neuropsychiatric symptoms", "Nausea, vomiting, hemolytic anemia, liver failure", ], key_points=[ "MENKES DISEASE (X-linked, ATP7A mutation): impaired copper transport → kinky hair + neurodegeneration + connective tissue fragility (defective lysyl oxidase)", "Excess zinc intake → copper deficiency (competitive inhibition of absorption)", "Ceruloplasmin is the main copper-carrying protein (also an acute-phase reactant — low in Wilson's)", ], at_risk="Excessive zinc intake, chronic diarrhea, Menkes disease, high-protein infant formula", bg=colors.HexColor("#FFEBEE") )) story.append(vit_card( name="Iodine (I⁻)", tag_label="TRACE MINERAL", tag_color=colors.HexColor("#B71C1C"), rda="150 µg/day; 220 µg pregnancy; 290 µg lactation", ul="1,100 µg/day", sources="Iodized salt (most important source), seafood, dairy, seaweed", functions="Required EXCLUSIVELY for thyroid hormone synthesis (T3/T4)", deficiency_items=[ "GOITER — thyroid hyperplasia due to chronically elevated TSH", "HYPOTHYROIDISM: fatigue, cold intolerance, constipation, weight gain, myxedema", "CRETINISM (in utero deficiency): irreversible intellectual disability, short stature, deafness, hypothyroidism (myxedematous vs. neurological cretinism)", ], toxicity_items=[ "Paradoxical HYPOTHYROIDISM via Wolff-Chaikoff effect (excess I⁻ transiently inhibits thyroid peroxidase)", "Jod-Basedow effect: iodine loading → HYPERTHYROIDISM in previously iodine-deficient glands", ], key_points=[ "Iodine deficiency is the leading preventable cause of intellectual disability worldwide", "Universal salt iodization is the primary prevention strategy", "At-risk: inland/mountainous populations ('goiter belt') without access to iodized salt", ], at_risk="Inland/mountainous populations without iodized salt, pregnancy", bg=colors.HexColor("#FFEBEE") )) story.append(PageBreak()) story.append(vit_card( name="Selenium (Se)", tag_label="TRACE MINERAL", tag_color=colors.HexColor("#B71C1C"), rda="55 µg/day", ul="400 µg/day", sources="Brazil nuts (single highest food source), seafood, meat, cereals (soil-dependent content)", functions="Component of selenoproteins: glutathione peroxidase (antioxidant); thioredoxin reductase; iodothyronine deiodinase (T4 → T3 conversion — works with Vitamin E/iodine)", deficiency_items=[ "KESHAN DISEASE — endemic cardiomyopathy in selenium-deficient areas of China", "KASHIN-BECK DISEASE — endemic osteoarthropathy", "Myopathy, muscle pain", "Hypothyroidism (impaired T4→T3 conversion)", ], toxicity_items=[ "SELENOSIS: garlic-breath odor (selenide compounds in breath/urine)", "Alopecia, nail brittleness/changes, peripheral neuropathy", "Nausea, diarrhea, fatigue", ], key_points=[ "Works synergistically with Vitamin E (both antioxidants)", "At-risk: TPN without selenium supplementation, Crohn's disease, renal dialysis, endemic low-soil areas (China, New Zealand)", ], at_risk="TPN without selenium, Crohn's disease, renal dialysis, selenium-depleted soil regions", bg=colors.HexColor("#FFEBEE") )) story.append(vit_card( name="Fluoride (F⁻)", tag_label="TRACE MINERAL", tag_color=colors.HexColor("#B71C1C"), rda="AI: Women 3 mg/day | Men 4 mg/day", ul="10 mg/day", sources="Fluoridated water (main source), toothpaste, tea, seafood", functions="Incorporated into hydroxyapatite (bone and teeth) → resistance to acid dissolution and caries prevention", deficiency_items=[ "Increased dental caries (tooth decay)", ], toxicity_items=[ "DENTAL FLUOROSIS: mottled/pitted enamel, white spots (chronic mild excess during tooth development)", "SKELETAL FLUOROSIS: osteosclerosis, joint stiffness (chronic high exposure)", "Acute (rare): nausea, vomiting, hypocalcemia, cardiac arrhythmias", ], key_points=[ "Optimal water fluoridation: 0.7 mg/L (US recommendation)", "Benefit (caries prevention) occurs at low levels; toxicity only with excess", ], bg=colors.HexColor("#FFEBEE") )) story.append(vit_card( name="Chromium (Cr³⁺) · Manganese (Mn²⁺) · Molybdenum", tag_label="TRACE MINERAL", tag_color=colors.HexColor("#B71C1C"), rda="Chromium: AI 25-35 µg/day | Manganese: AI Women 1.8 mg, Men 2.3 mg | Molybdenum: RDA 45 µg/day", ul="Cr: not established | Mn: 11 mg/day | Mo: 2,000 µg/day", sources="Chromium: whole grains, broccoli, nuts; Manganese: whole grains, nuts, legumes, tea; Molybdenum: legumes, whole grains, nuts", functions="Chromium: potentiates insulin signaling ('glucose tolerance factor'); Manganese: cofactor for SOD, arginase, pyruvate carboxylase, glycosyltransferases; Molybdenum: cofactor for xanthine oxidase, sulfite oxidase, aldehyde oxidase", deficiency_items=[ "Chromium: glucose intolerance, insulin resistance, peripheral neuropathy (mainly TPN-related)", "Manganese: hypercholesterolemia, dermatitis, weight loss (very rare)", "Molybdenum: neurologic symptoms, accumulation of sulfite/xanthine (very rare — seen with TPN)", ], toxicity_items=[ "Manganese INHALATION toxicity: MANGANISM — Parkinson's-like syndrome (tremor, rigidity, behavioral changes) seen in miners/welders", "Chromium Cr⁶⁺ (hexavalent, industrial): lung cancer risk by inhalation", ], key_points=[ "Manganism is the main clinically important toxicity in this group", "These deficiencies are almost exclusively seen in prolonged TPN without trace element supplementation", ], bg=colors.HexColor("#FFEBEE") )) # ══════════════════════════════════════════════════════════════════════════════ # QUICK REFERENCE SUMMARY TABLES # ══════════════════════════════════════════════════════════════════════════════ story.append(PageBreak()) story.append(section_header("QUICK REFERENCE SUMMARY TABLES", colors.HexColor("#1A237E"))) story.append(Spacer(1, 0.3*cm)) # ── Vitamin deficiency buzzwords ────────────────────────────────────────────── story.append(p("<b>Vitamin Deficiency — Classic Signs & Buzzwords</b>", "h2")) vit_rows = [ ["Vitamin A", "Night blindness → Bitot's spots → Xerophthalmia → Keratomalacia"], ["Vitamin D", "Rickets (children) — bowed legs, rachitic rosary; Osteomalacia (adults) — bone pain, proximal weakness"], ["Vitamin E", "Hemolytic anemia in premature infants; Spinocerebellar ataxia; Peripheral neuropathy"], ["Vitamin K", "Bleeding diathesis (elevated PT/INR); Hemorrhagic disease of the newborn (HDN)"], ["B1 Thiamine", "WET Beriberi (cardiac failure/edema); DRY Beriberi (peripheral neuropathy); Wernicke-Korsakoff (alcoholics)"], ["B2 Riboflavin", "Ariboflavinosis: Cheilosis, Angular stomatitis, Magenta tongue, Seborrheic dermatitis"], ["B3 Niacin", "PELLAGRA — 4 Ds: Dermatitis (Casal's necklace), Diarrhea, Dementia, Death"], ["B5 Pantothenic acid", "Burning feet syndrome (rare — seen in severe malnutrition only)"], ["B6 Pyridoxine", "Microcytic sideroblastic anemia; Peripheral neuropathy; Seizures (low GABA); Elevated homocysteine"], ["B7 Biotin", "Alopecia + Periorificial dermatitis + CNS symptoms (raw egg white / avidin)"], ["B9 Folate", "Megaloblastic macrocytic anemia; Neural tube defects (pregnancy); NO neurologic symptoms"], ["B12 Cobalamin", "Megaloblastic anemia + SUBACUTE COMBINED DEGENERATION (posterior & lateral columns) + elevated MMA"], ["Vitamin C", "SCURVY: Perifollicular hemorrhages, Corkscrew hairs (pathognomonic), Gingival bleeding, Poor wound healing"], ] story.append(simple_table( ["Vitamin", "Classic Deficiency Findings"], vit_rows, col_widths=[2.5*cm, W-2.5*cm] )) story.append(Spacer(1, 0.4*cm)) # ── Mineral deficiency buzzwords ────────────────────────────────────────────── story.append(p("<b>Mineral Deficiency — Classic Signs & Buzzwords</b>", "h2")) min_rows = [ ["Calcium", "Tetany (Chvostek/Trousseau signs), Seizures, Prolonged QT; Chronic → Osteoporosis"], ["Magnesium", "Refractory hypokalemia/hypocalcemia; Torsades de pointes; Seizures (most common cause: alcoholism)"], ["Phosphorus", "Refeeding syndrome (hypophosphatemia after refeeding malnourished patients → cardiac arrest, respiratory failure)"], ["Iron", "Microcytic hypochromic anemia; Koilonychia (spoon nails); Pica; Plummer-Vinson syndrome"], ["Zinc", "Acrodermatitis enteropathica (periorificial rash); Alopecia; Hypogonadism; Poor wound healing; Dysgeusia"], ["Copper", "Normocytic/macrocytic anemia + NEUTROPENIA (mimics B12/folate); Osteoporosis; Myelopathy"], ["Iodine", "Goiter; Hypothyroidism; Cretinism (irreversible intellectual disability if in utero deficiency)"], ["Selenium", "Keshan disease (endemic cardiomyopathy); Kashin-Beck disease (osteoarthropathy); Hypothyroidism"], ["Fluoride", "DEFICIENCY: Dental caries; EXCESS: Dental/Skeletal fluorosis"], ["Manganese", "TOXICITY (inhalation): Manganism — Parkinson's-like syndrome (miners, welders)"], ["Chromium", "Glucose intolerance (mainly in TPN patients); Cr⁶⁺ toxicity → lung cancer risk"], ] story.append(simple_table( ["Mineral", "Classic Deficiency/Toxicity Findings"], min_rows, col_widths=[2.5*cm, W-2.5*cm] )) story.append(Spacer(1, 0.4*cm)) # ── B12 vs Folate table ──────────────────────────────────────────────────────── story.append(p("<b>B12 Deficiency vs. Folate Deficiency — Key Differences</b>", "h2")) bf_rows = [ ["Megaloblastic macrocytic anemia", "✓ YES", "✓ YES"], ["Neurologic symptoms (subacute combined degeneration)", "✓ YES", "✗ NO"], ["Elevated homocysteine", "✓ YES", "✓ YES"], ["Elevated methylmalonic acid (MMA)", "✓ YES", "✗ NO"], ["Responds to folate supplementation", "Partially (corrects anemia only; NOT neuro)", "✓ YES"], ["Neural tube defect risk in pregnancy", "✗ NO", "✓ YES"], ] story.append(simple_table( ["Feature", "B12 Deficiency", "Folate Deficiency"], bf_rows, col_widths=[W*0.55, W*0.22, W*0.23] )) story.append(Spacer(1, 0.4*cm)) # ── "Only" facts ────────────────────────────────────────────────────────────── story.append(p("<b>High-Yield 'Only' Facts</b>", "h2")) only_rows = [ ["Only vitamin synthesized by the skin", "Vitamin D"], ["Only vitamin found exclusively in animal products", "Vitamin B12"], ["Only B vitamin with significant neurotoxicity in excess", "Vitamin B6 (pyridoxine) — sensory neuropathy >200 mg/day"], ["Only fat-soluble vitamins", "A, D, E, K (mnemonic: ADEK / 'Fat DEKA')"], ["Only antidote/reversal for warfarin", "Vitamin K"], ["Most common nutritional deficiency worldwide", "Iron deficiency anemia"], ["Only vitamin to treat eclampsia / torsades de pointes", "Magnesium sulfate (IV)"], ["Coenzyme A backbone vitamin", "Vitamin B5 (Pantothenic acid)"], ["Elevated MMA = diagnostic of", "Vitamin B12 deficiency ONLY (not folate) — key distinguishing marker"], ["Methylfolate trap caused by", "Vitamin B12 deficiency → folate accumulates as inactive N5-methyl-THF"], ["Corkscrew hairs = pathognomonic for", "Scurvy (Vitamin C deficiency)"], ["Excess zinc → causes deficiency of", "Copper (competitive absorption inhibition → anemia + neutropenia)"], ["'Give thiamine BEFORE glucose' rule", "Suspected Wernicke's encephalopathy — glucose alone worsens the condition"], ["Iodine: leading cause of preventable intellectual disability", "Iodine deficiency → cretinism (in utero)"], ["Refeeding syndrome: watch for", "Severe hypophosphatemia + hypokalemia + hypomagnesemia"], ] story.append(simple_table( ["Key Fact", "Answer"], only_rows, col_widths=[W*0.5, W*0.5] )) # ── Footer ──────────────────────────────────────────────────────────────────── story.append(Spacer(1, 0.5*cm)) story.append(hr(C_TEAL2)) story.append(p("Sources: Goldman-Cecil Medicine (Vol.2 Ch.199) · Basic Medical Biochemistry 6e · Washington Manual of Medical Therapeutics · Costanzo Physiology 7e", "footer")) story.append(p("Generated by Orris Medical AI · For educational purposes only", "footer")) # ── BUILD ───────────────────────────────────────────────────────────────────── doc.build(story) print(f"PDF saved: {OUTPUT}") PYEOF echo "Script written"

Running Command

cd /tmp/workspace/vitamins-minerals && python make_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/vitamins-minerals/Vitamins_and_Minerals_Reference.pdf

Your printable PDF is ready:

Vitamins and Minerals Reference

PDF Document · PDF

What's inside (6 pages, A4, print-ready):
  • Cover page with a key principles summary box
  • Fat-Soluble Vitamins section (A, D, E, K) — each as a color-coded card with RDA, sources, functions, deficiency signs, toxicity, and key points
  • Water-Soluble Vitamins section (B1 through B12, Vitamin C) — same format
  • Minerals section (Calcium, Magnesium, Phosphorus, Iron, Zinc, Copper, Iodine, Selenium, Fluoride, Chromium, Manganese, Molybdenum)
  • Quick Reference Summary Tables:
    • Vitamin deficiency buzzwords table
    • Mineral deficiency/toxicity buzzwords table
    • B12 vs Folate deficiency comparison table
    • High-yield "Only Facts" table

Make it concise and in easy table format for quick learning But make sure that the tables doesn't go outside the page

Running Command

cat > /tmp/workspace/vitamins-minerals/make_concise_pdf.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak, KeepTogether ) from reportlab.lib.styles import ParagraphStyle from reportlab.lib.enums import TA_CENTER, TA_LEFT OUTPUT = "/tmp/workspace/vitamins-minerals/Vitamins_Minerals_Quick_Reference.pdf" PAGE_W, PAGE_H = A4 L_MARGIN = R_MARGIN = 1.5*cm T_MARGIN = B_MARGIN = 1.8*cm USABLE_W = PAGE_W - L_MARGIN - R_MARGIN # ~17.7 cm doc = SimpleDocTemplate( OUTPUT, pagesize=A4, leftMargin=L_MARGIN, rightMargin=R_MARGIN, topMargin=T_MARGIN, bottomMargin=B_MARGIN, title="Vitamins & Minerals Quick Reference" ) # ── Colours ──────────────────────────────────────────────────────────────────── NAVY = colors.HexColor("#1A3A5C") TEAL = colors.HexColor("#1B6B8A") GREEN = colors.HexColor("#2E7D32") RED = colors.HexColor("#B71C1C") PURPLE = colors.HexColor("#4A148C") ORANGE = colors.HexColor("#E65100") GOLD = colors.HexColor("#F57F17") LBLUE = colors.HexColor("#E3F2FD") LGREEN = colors.HexColor("#E8F5E9") LRED = colors.HexColor("#FFEBEE") LPURP = colors.HexColor("#F3E5F5") LYELL = colors.HexColor("#FFFDE7") LGRAY = colors.HexColor("#F5F5F5") STRIPE = colors.HexColor("#EEF4FB") BORDER = colors.HexColor("#90A4AE") WHITE = colors.white # ── Styles ───────────────────────────────────────────────────────────────────── def S(name, **kw): return ParagraphStyle(name, **kw) TH = S("th", fontName="Helvetica-Bold", fontSize=7.5, textColor=WHITE, leading=10, alignment=TA_CENTER) TH2 = S("th2", fontName="Helvetica-Bold", fontSize=7, textColor=WHITE, leading=9, alignment=TA_CENTER) TD = S("td", fontName="Helvetica", fontSize=7, textColor=colors.black, leading=9, alignment=TA_LEFT) TDB = S("tdb", fontName="Helvetica-Bold", fontSize=7, textColor=colors.black, leading=9, alignment=TA_LEFT) TDR = S("tdr", fontName="Helvetica-Bold", fontSize=7, textColor=RED, leading=9, alignment=TA_LEFT) TDG = S("tdg", fontName="Helvetica-Bold", fontSize=7, textColor=GREEN, leading=9, alignment=TA_LEFT) H1 = S("h1", fontName="Helvetica-Bold", fontSize=11, textColor=WHITE, leading=14, alignment=TA_LEFT) H2 = S("h2", fontName="Helvetica-Bold", fontSize=9, textColor=NAVY, leading=12, alignment=TA_LEFT) TTL = S("ttl", fontName="Helvetica-Bold", fontSize=18, textColor=NAVY, leading=22, alignment=TA_CENTER) SUB = S("sub", fontName="Helvetica", fontSize=9, textColor=TEAL, leading=12, alignment=TA_CENTER) FTR = S("ftr", fontName="Helvetica", fontSize=6.5, textColor=colors.grey, leading=9, alignment=TA_CENTER) NOTE= S("note",fontName="Helvetica-Oblique",fontSize=7, textColor=TEAL, leading=9, alignment=TA_LEFT) def p(txt, style=TD): return Paragraph(txt, style) def pb(txt): return Paragraph(txt, TDB) def pr(txt): return Paragraph(txt, TDR) def pg(txt): return Paragraph(txt, TDG) def hr(col=BORDER, t=0.5): return HRFlowable(width="100%", thickness=t, color=col, spaceAfter=3, spaceBefore=3) # ── Section banner ───────────────────────────────────────────────────────────── def banner(title, bg=NAVY): t = Table([[Paragraph(title, H1)]], colWidths=[USABLE_W]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), bg), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 8), ("RIGHTPADDING", (0,0),(-1,-1), 8), ])) return t # ── Generic table builder with fixed total width = USABLE_W ─────────────────── def make_table(headers, rows, col_fracs, header_bg=NAVY, row_bgs=None): """ col_fracs: list of fractions that sum to 1.0 Guarantees total width == USABLE_W so nothing bleeds off-page. """ col_widths = [USABLE_W * f for f in col_fracs] header_row = [p(h, TH) for h in headers] data = [header_row] for row in rows: data.append([p(str(c), TD) if not isinstance(c, Paragraph) else c for c in row]) if row_bgs is None: row_bgs = [STRIPE, WHITE] tbl = Table(data, colWidths=col_widths, repeatRows=1) style = TableStyle([ ("BACKGROUND", (0,0), (-1,0), header_bg), ("ROWBACKGROUNDS",(0,1), (-1,-1), row_bgs), ("GRID", (0,0), (-1,-1), 0.3, BORDER), ("VALIGN", (0,0), (-1,-1), "TOP"), ("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING", (0,0), (-1,-1), 3), ("LEFTPADDING", (0,0), (-1,-1), 4), ("RIGHTPADDING", (0,0), (-1,-1), 4), ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"), ("FONTSIZE", (0,0), (-1,0), 7.5), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("FONTSIZE", (0,1), (-1,-1), 7), ]) tbl.setStyle(style) return tbl # ══════════════════════════════════════════════════════════════════════════════ # DATA # ══════════════════════════════════════════════════════════════════════════════ # FAT-SOLUBLE VITAMINS TABLE # Cols: Vitamin | RDA | Key Sources | Functions | Deficiency | Toxicity | High-Yield Note fat_sol_rows = [ ["A (Retinol)", "M: 900 µg\nF: 700 µg\nUL: 3000 µg", "Liver, dairy, eggs;\nβ-carotene from dark veg", "Vision (rhodopsin); epithelial differentiation; immune function; reproduction", "Night blindness (1st sign); Bitot's spots; Xerophthalmia; Keratomalacia; follicular hyperkeratosis", "Acute: headache, vomiting\nChronic: alopecia, hepatotoxicity, pseudotumor cerebri\nTERATOGENIC", "Progression: Night blindness→Bitot spots→Xerophthalmia→Keratomalacia"], ["D (Calciferol)", "< 70 yr: 600 IU\n> 70 yr: 800 IU\nUL: 4000 IU", "Sunlight (skin); fatty fish; fortified dairy", "Ca²⁺/PO₄ absorption; bone mineralisation; immune modulation", "Children: RICKETS (bowed legs, rachitic rosary)\nAdults: OSTEOMALACIA (bone pain, proximal weakness, waddling gait)", "Hypercalcaemia (polyuria, constipation, confusion); nephrolithiasis; metastatic calcification", "25(OH)D = best serum marker\nPTH stimulates 1α-hydroxylation in kidney\nOnly vitamin made by skin"], ["E (Tocopherol)", "15 mg/day\nUL: 1000 mg", "Veg oils, wheat germ, nuts, seeds, leafy greens", "Lipid-soluble antioxidant; protects RBC membranes; neurological function", "Premature infants: HAEMOLYTIC ANAEMIA\nSpinoc. ataxia; peripheral neuropathy (posterior columns); ophthalmoplegia", "Inhibits platelets → bleeding risk\nAntagonises Vitamin K", "Works synergistically with selenium\nAbetalipoproteinaemia → severe deficiency"], ["K (Phylloquinone)", "M: 120 µg (AI)\nF: 90 µg (AI)\nNo UL", "K1: leafy greens\nK2: gut bacteria, fermented food", "γ-carboxylation: clotting factors II, VII, IX, X; Proteins C, S, Z; osteocalcin", "Bleeding (elevated PT/INR); HAEMORRHAGIC DISEASE OF NEWBORN (HDN); bruising, haematuria, GI bleed", "K1/K2: essentially non-toxic\nK3 (menadione-synthetic): haemolytic anaemia, kernicterus in infants", "Warfarin blocks VKOR enzyme\nAll newborns receive prophylactic IM Vit K\nProteins C & S also need Vit K → warfarin initially procoagulant"], ] # WATER-SOLUBLE VITAMINS TABLE water_sol_rows = [ ["B1\nThiamine", "M: 1.2 mg\nF: 1.1 mg\nNo UL", "Whole grains, pork, legumes, nuts", "TPP cofactor: pyruvate DH; α-KG DH; transketolase (PPP); BCAA catabolism", "WET BERIBERI: cardiomyopathy, high-output failure, oedema\nDRY BERIBERI: peripheral neuropathy\nWERNICKE'S: confusion + ophthalmoplegia + ataxia\nKORSAKOFF'S: amnesia + confabulation", "None known", "Give THIAMINE BEFORE glucose in suspected deficiency\nPrimary risk: alcoholics\nBest test: RBC transketolase"], ["B2\nRiboflavin", "M: 1.3 mg\nF: 1.1 mg\nNo UL", "Dairy, meats, enriched cereals, eggs", "FMN/FAD: redox reactions, ETC; fatty acid β-oxidation; activates B6 & folate", "ARIBOFLAVINOSIS:\nCheilosis + angular stomatitis\nMagenta tongue (glossitis)\nSeborrhoeic dermatitis\nCorneal vascularisation", "None known\n(Urine turns yellow-green)", "Required to activate B6 and folate\nPhenothiazines impair absorption"], ["B3\nNiacin", "M: 16 mg NE\nF: 14 mg NE\nUL: 35 mg", "Meat, fish, peanuts; made from tryptophan (60 mg Trp = 1 mg niacin)", "NAD⁺/NADH, NADP⁺/NADPH: central coenzyme in glycolysis, TCA, FAO, OXPHOS", "PELLAGRA — 4 Ds:\nDermatitis (Casal's necklace)\nDiarrhoea\nDementia\nDeath", "Pharmacologic doses:\nFlushing (give aspirin to prevent)\nHepatotoxicity\nHyperglycaemia, hyperuricaemia", "Pellagra causes: corn diet, alcoholism, Hartnup disease, carcinoid syndrome, INH therapy\nHigh-dose niacin = best HDL-raising agent"], ["B5\nPantothenic acid", "AI: 5 mg\nNo UL", "Ubiquitous (liver, egg yolk, avocado are richest)", "Coenzyme A backbone: ALL acyl-transfer reactions — FA synthesis/oxidation, TCA, steroid synthesis", "RARE: burning feet syndrome\nIrritability, fatigue (severe malnutrition only)", "None known", "Deficiency almost never seen clinically\nGreek: pantos = 'everywhere'"], ["B6\nPyridoxine", "1.3 mg/day\nUL: 100 mg", "Meat, fish, potatoes, bananas, fortified cereals", "PLP cofactor: transamination (ALT/AST); neurotransmitter synthesis (serotonin, dopamine, GABA); heme synthesis (ALA synthase); cystathionine synthesis", "Microcytic SIDEROBLASTIC anaemia (ring sideroblasts)\nPeripheral neuropathy\nSEIZURES (↓GABA)\nDermatitis; ↑homocysteine", "SENSORY NEUROPATHY at >200 mg/day\n(Only B vitamin with significant neurotoxicity)", "INH inactivates PLP → give B6 with INH\nB6 needed for EVERY neurotransmitter biosynthesis step"], ["B7\nBiotin", "AI: 30 µg\nNo UL", "Liver, cooked egg yolk, nuts, legumes", "Carboxylation cofactor: pyruvate carboxylase; acetyl-CoA carboxylase; propionyl-CoA carboxylase", "ALOPECIA (hallmark)\nPeriorificial dermatitis (around mouth, eyes, genitals)\nConjunctivitis; CNS abnormalities", "None known", "Raw egg white AVIDIN binds biotin irreversibly → cooking destroys avidin\nBiotinidase deficiency in infants"], ["B9\nFolate", "400 µg DFE\nPregnancy: 600 µg\nUL: 1000 µg", "Leafy greens, legumes, fortified cereals, citrus, liver", "THF: one-carbon transfers — purine & thymidylate synthesis; homocysteine→methionine", "MEGALOBLASTIC MACROCYTIC anaemia\nNEURAL TUBE DEFECTS (spina bifida, anencephaly)\n↑Homocysteine\nNO neurologic symptoms", "Masks B12 deficiency (corrects anaemia but not neuro damage)", "400-800 µg/day for ALL women of childbearing age\nMETHYLFOLATE TRAP (B12 deficiency)\nMTX/TMP inhibit DHFR"], ["B12\nCobalamin", "2.4 µg/day\nNo UL", "ONLY animal products (meat, fish, dairy, eggs)\nVegans must supplement", "Methionine synthase (methylcobalamin); methylmalonyl-CoA mutase (adenosylcobalamin)", "MEGALOBLASTIC MACROCYTIC anaemia\nSUBACUTE COMBINED DEGENERATION (posterior + lateral columns)\n↑MMA + ↑homocysteine\nGlossitis; neuropsychiatric symptoms", "None known", "Absorbed ONLY in terminal ileum (needs intrinsic factor)\nPernicious anaemia = anti-IF antibodies\nElevated MMA = B12 only (not folate)\nMetformin impairs B12 absorption"], ["C\nAscorbic acid", "M: 90 mg\nF: 75 mg\nSmokers +35 mg\nUL: 2000 mg", "Citrus, kiwi, strawberries, bell peppers, broccoli", "Prolyl/lysyl hydroxylase (collagen); Fe³⁺→Fe²⁺ (iron absorption); antioxidant; dopamine-β-hydroxylase; carnitine synthesis", "SCURVY:\nCorkscrew hairs (PATHOGNOMONIC)\nPerifollicular haemorrhages\nGingival bleeding\nPoor wound healing\nPetechiae, ecchymoses", "GI upset (>2 g/day)\nOxalate kidney stones\nHaemolysis in G6PD deficiency", "Corkscrew hairs = pathognomonic for scurvy\nVit C enhances non-heme iron absorption\nDoes NOT prevent common cold"], ] # MINERALS TABLE mineral_rows = [ # Macrominerals ["CALCIUM\nCa²⁺", "19-50 yr: 1000 mg\n>50F/>70 all: 1200 mg\nUL: 2500 mg", "Dairy, fortified foods, leafy greens (kale), sardines", "Bone structure (99% in skeleton); muscle contraction; nerve transmission; coagulation; 2nd messenger", "HYPOCALCAEMIA:\nChvostek's sign (facial tap → twitch)\nTrousseau's sign (BP cuff → carpal spasm)\nProlonged QT; seizures\nChronic: OSTEOPOROSIS", "HYPERCALCAEMIA ('Bones Stones Groans Moans'):\nKidney stones; bone pain\nConstipation, nausea\nConfusion, depression", "Refractory hypocalcaemia → check Mg first\nVit D required for absorption\nCauses: hyperPTH (outpatient), malignancy (inpatient)"], ["MAGNESIUM\nMg²⁺", "M: 400-420 mg\nF: 310-320 mg\nUL: 350 mg (suppl)", "Nuts, seeds, whole grains, spinach, legumes, dark chocolate", "Cofactor for >300 enzymes; ATP stabilisation; protein/DNA synthesis; muscle relaxation", "Refractory HYPOKALAEMIA\nRefractory HYPOCALCAEMIA\nTORSADES DE POINTES\nSeizures; tetany; personality changes", "IV: respiratory depression, hypotension, cardiac arrest\nOral: diarrhoea (osmotic)", "Most common cause: ALCOHOLISM\nAlso: loop/thiazide diuretics, PPIs, Gitelman syndrome\nIV MgSO₄ = treatment for ECLAMPSIA and torsades\nMonitor patellar reflex during IV infusion"], ["PHOSPHORUS", "700 mg/day\nUL: 4000 mg", "Dairy, meat, fish, nuts, legumes, cola drinks", "Bone mineralisation; ATP; phospholipids; DNA/RNA; enzyme phosphorylation", "REFEEDING SYNDROME:\nhypophosphataemia after re-feeding malnourished patient → cardiac arrest, respiratory failure, seizures", "Hyperphosphataemia in CKD → secondary hyperPTH, renal osteodystrophy", "Refeeding syndrome triad: ↓PO₄ + ↓K⁺ + ↓Mg²⁺\nPrevent: refeed slowly + supplement PO₄"], # Trace minerals ["IRON\nFe²⁺/³⁺", "M: 8 mg\nF 19-50: 18 mg\nPregnancy: 27 mg\nUL: 45 mg", "Heme iron: red meat (15-35% absorbed)\nNon-heme: legumes, fortified cereals (2-10%)\nVit C enhances absorption", "Haemoglobin; myoglobin; cytochromes (ETC); catalase/peroxidase", "MICROCYTIC HYPOCHROMIC ANAEMIA\nKOILONYCHIA (spoon nails)\nPICA (craving ice, clay)\nPLUMMER-VINSON: Fe def + dysphagia + oesophageal web\nGlossitis; restless legs", "HAEMOCHROMATOSIS (HFE, C282Y): 'Bronze diabetes' (cirrhosis + DM + bronze skin)\nCardiac failure; hypogonadism; arthropathy\nAcute ingestion (children): GE → shock → liver failure", "Most common nutritional deficiency worldwide\nFerritin = BEST marker of iron stores (↑ in inflammation)\nTx: phlebotomy (hereditary); deferoxamine (acute toxicity)"], ["ZINC\nZn²⁺", "M: 11 mg\nF: 8 mg\nUL: 40 mg", "Oysters (richest), red meat, beans, nuts, fortified cereals", "Cofactor for >100 enzymes (DNA/RNA pol, carbonic anhydrase); zinc finger TFs; wound healing; taste/smell; spermatogenesis", "ACRODERMATITIS ENTEROPATHICA (periorificial + acral rash)\nALOPECIA\nHYPOGONADISM + growth retardation\nDysgeusia/dysosmia\nPoor wound healing; night blindness", "High-dose Zn → COPPER DEFICIENCY (competitive inhibition → anaemia + neutropenia)\nNausea, vomiting, GI irritation", "AE = inherited Zn malabsorption (SLC39A4 mutation)\nPhytate in cereals/legumes chelates zinc\nHigh-phytate diets and chronic diarrhoea = major risk factors"], ["COPPER\nCu²⁺", "900 µg/day\nUL: 10,000 µg", "Liver, oysters, nuts, seeds, dark chocolate, whole grains", "Ceruloplasmin (Fe transport); cytochrome c oxidase (ETC IV); SOD; dopamine-β-hydroxylase; lysyl oxidase (collagen/elastin cross-linking); tyrosinase (melanin)", "NORMOCYTIC/MACROCYTIC ANAEMIA + NEUTROPENIA + thrombocytopenia (mimics B12/folate)\nOsteoporosis; pathological fractures\nMyelopathy (like SCD); depigmentation", "WILSON'S DISEASE (ATP7B mutation): liver disease + KAYSER-FLEISCHER rings + neuropsychiatric symptoms", "MENKES DISEASE (X-linked, ATP7A): kinky hair + neurodegeneration + connective tissue fragility\nExcess Zn → Cu deficiency\nCeruloplasmin: main Cu-carrying protein (LOW in Wilson's)"], ["IODINE\nI⁻", "150 µg/day\nPregnancy: 220 µg\nLactation: 290 µg\nUL: 1100 µg", "Iodised salt (most important), seafood, dairy, seaweed", "Required EXCLUSIVELY for thyroid hormone synthesis (T3, T4)", "GOITRE (thyroid hyperplasia, ↑TSH)\nHYPOTHYROIDISM\nCRETINISM (in utero): irreversible intellectual disability, short stature, deafness", "Wolff-Chaikoff: excess I⁻ → paradoxical HYPOTHYROIDISM\nJod-Basedow: I⁻ loading → HYPERTHYROIDISM", "Leading preventable cause of intellectual disability worldwide\nUniversal salt iodisation = primary prevention\nAt-risk: inland/mountainous regions"], ["SELENIUM\nSe", "55 µg/day\nUL: 400 µg", "Brazil nuts (highest), seafood, meat, cereals (soil-dependent)", "Glutathione peroxidase (antioxidant); iodothyronine deiodinase (T4→T3 conversion); thioredoxin reductase", "KESHAN DISEASE (endemic cardiomyopathy, China)\nKASHIN-BECK DISEASE (osteoarthropathy)\nMyopathy; hypothyroidism", "SELENOSIS: garlic-breath odour, alopecia, nail changes, peripheral neuropathy, nausea", "Synergistic with Vitamin E (both antioxidants)\nAt-risk: TPN without Se, Crohn's, renal dialysis, low-selenium soil areas"], ["FLUORIDE\nF⁻", "M: 4 mg (AI)\nF: 3 mg (AI)\nUL: 10 mg", "Fluoridated water (main source), toothpaste, tea, seafood", "Incorporated into hydroxyapatite → resistance to acid dissolution; dental caries prevention", "DEFICIENCY: Increased dental caries", "DENTAL FLUOROSIS: mottled enamel (chronic mild excess in childhood)\nSKELETAL FLUOROSIS: osteosclerosis, joint stiffness\nAcute: hypocalcaemia, cardiac arrhythmia", "Optimal water fluoridation: 0.7 mg/L\nBenefit at low levels; toxicity only with excess"], ["CHROMIUM\nCr³⁺", "AI: 25-35 µg\nNo UL", "Whole grains, broccoli, nuts, meat", "Potentiates insulin signalling ('glucose tolerance factor')", "Glucose intolerance (insulin resistance)\nPeripheral neuropathy\n(Mainly TPN-related — rare otherwise)", "Cr⁶⁺ (hexavalent, industrial): LUNG CANCER risk by inhalation", "Deficiency almost exclusively in prolonged TPN\nCr³⁺ is dietary form (safe); Cr⁶⁺ is industrial toxin"], ["MANGANESE\nMn²⁺", "M: 2.3 mg (AI)\nF: 1.8 mg (AI)\nUL: 11 mg", "Whole grains, nuts, legumes, tea, leafy veg", "Cofactor: Mn-SOD; arginase; pyruvate carboxylase; glycosyltransferases", "Hypercholesterolaemia, dermatitis, weight loss (very rare — TPN)", "MANGANISM (inhalation): Parkinson's-like syndrome — tremor, rigidity, behavioural changes (miners/welders)", "Toxicity more clinically relevant than deficiency\nManganism occurs with chronic Mn INHALATION"], ["MOLYBDENUM", "RDA: 45 µg\nUL: 2000 µg", "Legumes, whole grains, nuts", "Cofactor: xanthine oxidase (purine catabolism); sulfite oxidase; aldehyde oxidase", "Neurologic symptoms; sulfite/xanthine accumulation\n(Only in prolonged TPN without trace elements)", "Gout-like symptoms at very high intake (↑xanthine oxidase → ↑uric acid)", "Clinically rare — almost exclusively TPN-related"], ] # HIGH-YIELD SUMMARY summary_rows = [ ["Only vitamin made by the skin", "Vitamin D"], ["Only vitamin EXCLUSIVELY in animal products", "Vitamin B12"], ["Fat-soluble vitamins (mnemonic)", "A, D, E, K — 'ADEK'"], ["Only B vitamin neurotoxic in excess", "B6 pyridoxine (sensory neuropathy >200 mg/day)"], ["Give THIAMINE before glucose — why?", "Glucose alone worsens Wernicke's encephalopathy"], ["Corkscrew hairs = pathognomonic for", "Scurvy (Vitamin C deficiency)"], ["Elevated MMA = diagnostic of", "Vitamin B12 deficiency ONLY (not folate)"], ["Methylfolate trap caused by", "B12 deficiency → folate trapped as inactive N5-methyl-THF"], ["B12 vs folate: key neuro difference", "B12 → subacute combined degeneration of spinal cord; Folate → NO neuro symptoms"], ["Antidote / reversal for warfarin", "Vitamin K"], ["Most common nutritional deficiency worldwide", "Iron deficiency anaemia"], ["Refractory hypoK + hypoCa → check first", "Magnesium (must correct Mg before K or Ca will respond)"], ["IV MgSO₄ used to treat", "Eclampsia (seizures) AND torsades de pointes"], ["Refeeding syndrome triad", "↓Phosphate + ↓Potassium + ↓Magnesium"], ["Excess zinc → causes deficiency of", "Copper → normocytic anaemia + neutropenia"], ["Acrodermatitis enteropathica", "Inherited zinc malabsorption (SLC39A4 mutation)"], ["Menkes disease", "X-linked Cu transport defect (ATP7A) → kinky hair + neurodegeneration"], ["Wilson's disease", "Cu excretion defect (ATP7B) → Kayser-Fleischer rings + liver disease"], ["Pernicious anaemia", "Anti-intrinsic factor antibodies → B12 malabsorption"], ["Iodine deficiency: leading cause of", "Preventable intellectual disability worldwide (cretinism)"], ["Pellagra: 4 Ds", "Dermatitis (Casal's necklace), Diarrhoea, Dementia, Death"], ["Keshan disease", "Selenium deficiency → endemic cardiomyopathy (China)"], ["Manganism (Mn inhalation toxicity)", "Parkinson's-like syndrome (miners, welders)"], ["Raw egg white causes deficiency of", "Biotin (avidin binds irreversibly; destroyed by cooking)"], ["Vitamin needed for GABA synthesis", "Vitamin B6 (PLP — decarboxylation of glutamate)"], ["Neural tube defect prevention", "Folic acid 400-800 µg/day pre-conceptionally"], ["Ferritin: clinical note", "BEST marker of iron stores; falsely elevated in inflammation (acute-phase reactant)"], ["Hartnup disease → pellagra-like symptoms", "Defective tryptophan absorption → can't synthesise niacin"], ["Carcinoid syndrome → pellagra", "Tryptophan diverted to serotonin → niacin deficiency"], ["INH therapy: give prophylactic", "Vitamin B6 (INH binds/inactivates PLP)"], ] # B12 vs Folate comparison b12_vs_fol_rows = [ ["Megaloblastic macrocytic anaemia", "YES", "YES"], ["Neurologic symptoms (SCD of cord)","YES", "NO"], ["Elevated homocysteine", "YES", "YES"], ["Elevated methylmalonic acid (MMA)","YES", "NO"], ["Neural tube defect risk", "NO", "YES"], ["Source", "Only animal products", "Green veg, fortified grains"], ["Absorption site", "Terminal ileum (needs IF)", "Proximal small intestine"], ["Key drug interactions", "Metformin (↓absorption)", "Methotrexate, TMP (inhibit DHFR)"], ] # ══════════════════════════════════════════════════════════════════════════════ # BUILD STORY # ══════════════════════════════════════════════════════════════════════════════ story = [] # ── Title ────────────────────────────────────────────────────────────────────── story.append(Spacer(1, 0.3*cm)) story.append(Paragraph("Vitamins & Minerals", TTL)) story.append(Paragraph("Quick Reference — Important Points for Rapid Learning", SUB)) story.append(hr(TEAL, 2)) story.append(Spacer(1, 0.2*cm)) # Key principle box (compact) kp = Table([[ Paragraph("<b>FAT-SOLUBLE (A,D,E,K):</b> stored in body; absorbed via micellar phase; fat malabsorption → all 4 deficient simultaneously; toxicity possible.<br/>" "<b>WATER-SOLUBLE (B1-B12, C):</b> limited storage; excess excreted; deficiency faster; most are coenzymes.<br/>" "<b>MINERALS:</b> enzyme cofactors, structural (bone/teeth), fluid balance, signalling.", S("kpb", fontName="Helvetica", fontSize=7.5, textColor=colors.black, leading=11)) ]], colWidths=[USABLE_W]) kp.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), LYELL), ("BOX", (0,0),(-1,-1), 1, GOLD), ("TOPPADDING", (0,0),(-1,-1), 6), ("BOTTOMPADDING", (0,0),(-1,-1), 6), ("LEFTPADDING", (0,0),(-1,-1), 8), ("RIGHTPADDING", (0,0),(-1,-1), 8), ])) story.append(kp) story.append(Spacer(1, 0.3*cm)) # ── FAT-SOLUBLE VITAMINS ─────────────────────────────────────────────────────── story.append(banner("FAT-SOLUBLE VITAMINS (A · D · E · K)", NAVY)) story.append(Spacer(1, 0.15*cm)) fat_headers = ["Vitamin", "RDA / UL", "Key Sources", "Functions", "Deficiency Signs", "Toxicity", "High-Yield Notes"] fat_fracs = [0.08, 0.09, 0.12, 0.15, 0.21, 0.17, 0.18] # sums to 1.0 story.append(make_table(fat_headers, fat_sol_rows, fat_fracs, header_bg=NAVY, row_bgs=[LBLUE, WHITE])) story.append(Spacer(1, 0.35*cm)) # ── WATER-SOLUBLE VITAMINS ───────────────────────────────────────────────────── story.append(PageBreak()) story.append(banner("WATER-SOLUBLE VITAMINS (B1 · B2 · B3 · B5 · B6 · B7 · B9 · B12 · Vitamin C)", TEAL)) story.append(Spacer(1, 0.15*cm)) ws_headers = ["Vitamin", "RDA / UL", "Key Sources", "Functions", "Deficiency Signs", "Toxicity", "High-Yield Notes"] ws_fracs = [0.07, 0.09, 0.12, 0.17, 0.21, 0.14, 0.20] story.append(make_table(ws_headers, water_sol_rows, ws_fracs, header_bg=TEAL, row_bgs=[LGREEN, WHITE])) story.append(Spacer(1, 0.35*cm)) # ── B12 vs FOLATE ────────────────────────────────────────────────────────────── story.append(banner("B12 vs FOLATE DEFICIENCY — Key Differences", colors.HexColor("#2E7D32"))) story.append(Spacer(1, 0.15*cm)) story.append(make_table( ["Feature", "B12 (Cobalamin)", "Folate (B9)"], b12_vs_fol_rows, [0.42, 0.29, 0.29], header_bg=GREEN )) story.append(Spacer(1, 0.35*cm)) # ── MINERALS ─────────────────────────────────────────────────────────────────── story.append(PageBreak()) story.append(banner("MINERALS (Macrominerals: Ca · Mg · P | Trace: Fe · Zn · Cu · I · Se · F · Cr · Mn · Mo)", PURPLE)) story.append(Spacer(1, 0.15*cm)) min_headers = ["Mineral", "RDA / UL", "Key Sources", "Functions", "Deficiency Signs", "Toxicity", "High-Yield Notes"] min_fracs = [0.08, 0.09, 0.12, 0.15, 0.21, 0.17, 0.18] story.append(make_table(min_headers, mineral_rows, min_fracs, header_bg=PURPLE, row_bgs=[LPURP, WHITE])) story.append(Spacer(1, 0.35*cm)) # ── HIGH-YIELD SUMMARY ───────────────────────────────────────────────────────── story.append(PageBreak()) story.append(banner("HIGH-YIELD SUMMARY — Must-Know Facts", colors.HexColor("#BF360C"))) story.append(Spacer(1, 0.15*cm)) story.append(make_table( ["Key Fact / Question", "Answer"], summary_rows, [0.44, 0.56], header_bg=ORANGE, row_bgs=[LRED, WHITE] )) story.append(Spacer(1, 0.4*cm)) # Footer story.append(hr(TEAL, 1)) story.append(Paragraph( "Sources: Goldman-Cecil Medicine · Basic Medical Biochemistry 6e · Washington Manual of Medical Therapeutics · Costanzo Physiology 7e | Generated by Orris Medical AI · For educational use only", FTR )) doc.build(story) print(f"PDF saved: {OUTPUT}") PYEOF echo "Script written"

Running Command

cd /tmp/workspace/vitamins-minerals && python make_concise_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/vitamins-minerals/Vitamins_Minerals_Quick_Reference.pdf

Here's your new concise printable PDF:

Vitamins Minerals Quick Reference

PDF Document · PDF

What's in this version (4 pages, A4, table-only format):
PageContent
1Key principle box + Fat-Soluble Vitamins table (A, D, E, K)
2Water-Soluble Vitamins table (B1–B12, Vit C) + B12 vs Folate comparison table
3Minerals table (Ca, Mg, P, Fe, Zn, Cu, I, Se, F, Cr, Mn, Mo)
4High-Yield Summary — 30 must-know facts in Q&A table format
Every table has 7 columns: Vitamin/Mineral · RDA/UL · Sources · Functions · Deficiency · Toxicity · High-Yield Notes — all strictly within the page margins with colour-coded sections for easy scanning.

Make the first page in horizontal format of the above pdf

Running Command

cat > /tmp/workspace/vitamins-minerals/make_mixed_pdf.py << 'PYEOF' """ Build a multi-page PDF where: • Page 1 = LANDSCAPE (fat-soluble vitamins table) • Pages 2+ = PORTRAIT (water-soluble, minerals, B12vsFolate, summary) Strategy: build two separate PDFs with ReportLab, then merge with pypdf. """ from reportlab.lib.pagesizes import A4, landscape from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak ) from reportlab.lib.styles import ParagraphStyle from reportlab.lib.enums import TA_CENTER, TA_LEFT from pypdf import PdfWriter, PdfReader import io # ── Page sizes ───────────────────────────────────────────────────────────────── PORT_W, PORT_H = A4 # 595 x 842 pt LAND_W, LAND_H = landscape(A4) # 842 x 595 pt L_MAR = R_MAR = 1.5*cm T_MAR = B_MAR = 1.6*cm # ── Colours ──────────────────────────────────────────────────────────────────── NAVY = colors.HexColor("#1A3A5C") TEAL = colors.HexColor("#1B6B8A") GREEN = colors.HexColor("#2E7D32") RED = colors.HexColor("#B71C1C") PURPLE = colors.HexColor("#4A148C") ORANGE = colors.HexColor("#E65100") GOLD = colors.HexColor("#F57F17") LBLUE = colors.HexColor("#E3F2FD") LGREEN = colors.HexColor("#E8F5E9") LRED = colors.HexColor("#FFEBEE") LPURP = colors.HexColor("#F3E5F5") LYELL = colors.HexColor("#FFFDE7") STRIPE = colors.HexColor("#EEF4FB") BORDER = colors.HexColor("#90A4AE") WHITE = colors.white # ── Styles ───────────────────────────────────────────────────────────────────── def S(name, **kw): return ParagraphStyle(name, **kw) TH = S("th", fontName="Helvetica-Bold", fontSize=8, textColor=WHITE, leading=10, alignment=TA_CENTER) TD = S("td", fontName="Helvetica", fontSize=7.5, textColor=colors.black, leading=10, alignment=TA_LEFT) TDB = S("tdb", fontName="Helvetica-Bold", fontSize=7.5, textColor=colors.black, leading=10, alignment=TA_LEFT) H1 = S("h1", fontName="Helvetica-Bold", fontSize=12, textColor=WHITE, leading=15, alignment=TA_LEFT) TTL = S("ttl", fontName="Helvetica-Bold", fontSize=20, textColor=NAVY, leading=24, alignment=TA_CENTER) SUB = S("sub", fontName="Helvetica", fontSize=9, textColor=TEAL, leading=12, alignment=TA_CENTER) FTR = S("ftr", fontName="Helvetica", fontSize=6.5, textColor=colors.grey, leading=9, alignment=TA_CENTER) def p(txt, style=TD): return Paragraph(txt, style) def pb(txt): return Paragraph(txt, TDB) def hr(col=BORDER, t=0.5): return HRFlowable(width="100%", thickness=t, color=col, spaceAfter=3, spaceBefore=3) def banner(title, usable_w, bg=NAVY): t = Table([[Paragraph(title, H1)]], colWidths=[usable_w]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), bg), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 8), ("RIGHTPADDING", (0,0),(-1,-1), 8), ])) return t def make_table(headers, rows, col_fracs, usable_w, header_bg=NAVY, row_bgs=None): col_widths = [usable_w * f for f in col_fracs] if row_bgs is None: row_bgs = [STRIPE, WHITE] header_row = [p(h, TH) for h in headers] data = [header_row] for row in rows: data.append([p(str(c), TD) if not isinstance(c, Paragraph) else c for c in row]) tbl = Table(data, colWidths=col_widths, repeatRows=1) tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), header_bg), ("ROWBACKGROUNDS",(0,1), (-1,-1), row_bgs), ("GRID", (0,0), (-1,-1), 0.3, BORDER), ("VALIGN", (0,0), (-1,-1), "TOP"), ("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING", (0,0), (-1,-1), 3), ("LEFTPADDING", (0,0), (-1,-1), 4), ("RIGHTPADDING", (0,0), (-1,-1), 4), ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"), ("FONTSIZE", (0,0), (-1,0), 8), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("FONTSIZE", (0,1), (-1,-1), 7.5), ])) return tbl # ══════════════════════════════════════════════════════════════════════════════ # DATA — same as before # ══════════════════════════════════════════════════════════════════════════════ fat_sol_rows = [ ["A\n(Retinol)", "M: 900 µg\nF: 700 µg\nUL: 3000 µg", "Liver, dairy, eggs\n(preformed);\nβ-carotene from dark\norange/green veg", "Vision (rhodopsin — retinal);\nepithelial differentiation\n(retinoic acid);\nimmune function;\nreproduction; bone growth", "Night blindness (1st sign)\nBitot's spots (conjunctiva)\nXerophthalmia (dry eyes)\nKeratomalacia (corneal ulcer/blindness)\nFollicular hyperkeratosis ('toad skin')\nIncreased infection susceptibility", "Acute: headache, vomiting, skin peeling\nChronic: alopecia, hepatotoxicity,\npseudotumour cerebri\nTERATOGENIC (isotretinoin)\nHypercalcaemia", "Progression: Night blindness → Bitot spots → Xerophthalmia → Keratomalacia\nAt-risk: fat malabsorption, chronic liver disease, strict vegetarians\nRetinoic acid regulates gene transcription"], ["D\n(Calciferol)", "<70 yr: 600 IU\n>70 yr: 800 IU\nUL: 4000 IU", "Skin + UV light\n(main source);\nFatty fish;\nFortified dairy/OJ;\nEgg yolk", "Increases intestinal Ca²⁺ & PO₄\nabsorption; bone mineralisation;\nimmune modulation;\ncell differentiation", "Children: RICKETS\n(bowed legs, rachitic rosary,\ncraniotabes, widened epiphysis)\nAdults: OSTEOMALACIA\n(bone pain, pathological fractures,\nproximal muscle weakness,\nwaddling gait)\nHypocalcaemia → tetany, seizures", "HYPERCALCAEMIA:\nnausea, vomiting, polyuria,\npolydipsia, constipation, confusion\nNephrolithiasis\nMetastatic calcifications", "ONLY vitamin synthesised by skin\nMetabolism: Skin (D3) → Liver (25-OH) → Kidney (1,25-OH₂ = calcitriol)\nPTH stimulates 1α-hydroxylation in kidney\n25(OH)D = BEST serum marker\nAt-risk: dark skin, exclusively breastfed infants, elderly, obesity"], ["E\n(Tocopherol)", "15 mg/day\nUL: 1000 mg", "Vegetable oils,\nwheat germ,\nnuts, seeds,\nleafy greens", "Major lipid-soluble ANTIOXIDANT;\nprotects cell membranes from\nlipid peroxidation;\nRBC integrity;\nnormal neurological function", "Premature infants: HAEMOLYTIC ANAEMIA\nSpinocerebellar ataxia\n(progressive neurodegeneration)\nPeripheral neuropathy\n(posterior columns + spinocerebellar)\nOphthalmoplegia; areflexia", "Inhibits platelet aggregation\n→ bleeding tendency\nAntagonises Vitamin K\n→ haemorrhage risk", "Works synergistically with selenium (both antioxidants)\nAbetalipoproteinaemia → profound Vit E deficiency\n(no chylomicron/VLDL transport)\nAt-risk: premature neonates, fat malabsorption"], ["K\n(Phylloquinone\n/Menaquinone)", "M: 120 µg AI\nF: 90 µg AI\nNo UL", "K1: leafy green veg\nK2: gut bacteria,\nfermented foods\nK3: synthetic\n(menadione)", "γ-carboxylation cofactor:\nClotting factors II,VII,IX,X;\nProteins C, S, Z;\nOsteocalcin (bone mineralisation)", "BLEEDING DIATHESIS\n(elevated PT/INR)\nHAEMORRHAGIC DISEASE OF NEWBORN\n(HDN) — no gut bacteria, minimal\nplacental transfer\nSpontaneous bruising,\nhaematuria, GI bleed", "K1/K2: essentially non-toxic\nK3 (menadione-synthetic):\nhaemolytic anaemia,\nkernicterus in infants", "Warfarin blocks VKOR enzyme (antagonises Vit K)\nAll newborns receive prophylactic IM Vit K injection\nProteins C & S also need Vit K → warfarin initially PROCOAGULANT\nAt-risk: newborns, broad-spectrum antibiotics, fat malabsorption"], ] water_sol_rows = [ ["B1\nThiamine", "M: 1.2 mg\nF: 1.1 mg", "Whole grains, pork, legumes, nuts", "TPP cofactor: pyruvate DH; α-KG DH; transketolase (PPP); BCAA catabolism", "WET BERIBERI: cardiomyopathy, high-output failure, oedema\nDRY BERIBERI: peripheral neuropathy\nWERNICKE'S: confusion + ophthalmoplegia + ataxia\nKORSAKOFF'S: amnesia + confabulation", "None known", "Give THIAMINE BEFORE glucose (prevents Wernicke's worsening)\nPrimary risk: alcoholics\nBest test: RBC transketolase activity"], ["B2\nRiboflavin", "M: 1.3 mg\nF: 1.1 mg", "Dairy, meats, enriched cereals, eggs", "FMN/FAD: redox reactions, ETC; fatty acid β-oxidation; activates B6 & folate", "ARIBOFLAVINOSIS:\nCheilosis + angular stomatitis\nMagenta tongue (glossitis)\nSeborrhoeic dermatitis\nCorneal vascularisation", "None known\n(Urine turns yellow-green)", "Required to activate Vitamins B6 and Folate\nPhenothiazines impair absorption"], ["B3\nNiacin", "M: 16 mg NE\nF: 14 mg NE\nUL: 35 mg", "Meat, fish, peanuts;\nmade from tryptophan\n(60 mg Trp = 1 mg niacin)", "NAD⁺/NADH, NADP⁺/NADPH: glycolysis, TCA, FA oxidation, OXPHOS", "PELLAGRA — 4 Ds:\nDermatitis (Casal's necklace)\nDiarrhoea\nDementia\nDeath", "Pharmacologic doses:\nFlushing (give aspirin)\nHepatotoxicity\nHyperglycaemia, hyperuricaemia", "Pellagra: corn diets, alcoholism, Hartnup disease, carcinoid syndrome, INH\nHigh-dose niacin = best HDL-raising agent"], ["B5\nPantothenic\nacid", "AI: 5 mg\nNo UL", "Ubiquitous (liver, egg yolk, avocado richest)", "Coenzyme A backbone: ALL acyl-transfer reactions — FA synthesis/oxidation, TCA, steroids", "RARE: burning feet syndrome\nIrritability, fatigue\n(severe malnutrition only)", "None known", "Greek pantos = 'everywhere' — deficiency almost never seen clinically"], ["B6\nPyridoxine", "1.3 mg/day\nUL: 100 mg", "Meat, fish, potatoes, bananas, fortified cereals", "PLP cofactor: transamination (ALT/AST); neurotransmitter synthesis (5-HT, DA, GABA); heme synthesis; cystathionine synthesis", "Microcytic SIDEROBLASTIC anaemia\n(ring sideroblasts on BM)\nPeripheral neuropathy\nSEIZURES (↓GABA)\nDermatitis; ↑homocysteine", "SENSORY NEUROPATHY\n>200 mg/day\n(Only B vitamin with neurotoxicity)", "INH inactivates PLP → give B6 prophylactically with INH\nB6 needed for every neurotransmitter biosynthesis step"], ["B7\nBiotin", "AI: 30 µg\nNo UL", "Liver, cooked egg yolk, nuts, legumes", "Carboxylation cofactor: pyruvate carboxylase; acetyl-CoA carboxylase; propionyl-CoA carboxylase", "ALOPECIA (hallmark)\nPeriorificial dermatitis\n(around mouth, eyes, genitals)\nConjunctivitis; CNS abnormalities", "None known", "Raw egg white AVIDIN binds biotin irreversibly → cooking destroys avidin\nBiotinidase deficiency in infants"], ["B9\nFolate", "400 µg DFE\nPregnancy: 600 µg\nUL: 1000 µg", "Leafy greens, legumes, fortified cereals, citrus, liver", "THF: one-carbon transfers — purine & thymidylate synthesis; homocysteine→methionine", "MEGALOBLASTIC MACROCYTIC anaemia\nNEURAL TUBE DEFECTS\n(spina bifida, anencephaly)\n↑Homocysteine\nNO neurologic symptoms", "Masks B12 deficiency\n(corrects anaemia not neuro damage)", "400-800 µg/day for ALL women of childbearing age\nMETHYLFOLATE TRAP (caused by B12 deficiency)\nMTX/TMP inhibit DHFR"], ["B12\nCobalamin", "2.4 µg/day\nNo UL", "ONLY animal products\n(meat, fish, dairy, eggs)\nVegans must supplement", "Methionine synthase (methylcobalamin); methylmalonyl-CoA mutase (adenosylcobalamin)", "MEGALOBLASTIC MACROCYTIC anaemia\nSUBACUTE COMBINED DEGENERATION\n(posterior + lateral columns)\n↑MMA + ↑homocysteine\nGlossitis; neuropsychiatric symptoms", "None known", "Absorbed ONLY in terminal ileum (needs intrinsic factor)\nPernicious anaemia = anti-IF antibodies\nElevated MMA = B12 ONLY (not folate)\nMetformin impairs B12 absorption"], ["C\nAscorbic acid", "M: 90 mg\nF: 75 mg\n+35 mg smokers\nUL: 2000 mg", "Citrus, kiwi, strawberries, bell peppers, broccoli", "Prolyl/lysyl hydroxylase (collagen); Fe³⁺→Fe²⁺; antioxidant; dopamine-β-hydroxylase; carnitine synthesis", "SCURVY:\nCorkscrew hairs (PATHOGNOMONIC)\nPerifollicular haemorrhages\nGingival bleeding\nPoor wound healing\nPetechiae, ecchymoses", "GI upset >2 g/day\nOxalate kidney stones\nHaemolysis in G6PD deficiency", "Corkscrew hairs = pathognomonic for scurvy\nVit C enhances non-heme iron absorption\nDoes NOT prevent common cold"], ] mineral_rows = [ ["CALCIUM\nCa²⁺", "19-50: 1000 mg\n>50F/>70: 1200 mg\nUL: 2500 mg", "Dairy, fortified foods, leafy greens (kale), sardines", "Bone structure (99% in skeleton); muscle contraction; nerve transmission; coagulation; 2nd messenger", "HYPOCALCAEMIA:\nChvostek's sign (facial tap→twitch)\nTrousseau's sign (BP cuff→carpal spasm)\nProlonged QT; seizures\nChronic: OSTEOPOROSIS", "HYPERCALCAEMIA\n('Bones Stones Groans Moans'):\nKidney stones; bone pain\nConstipation, nausea\nConfusion, depression", "Refractory hypoCa → check Mg first\nVit D required for absorption\nCauses: hyperPTH (outpatient), malignancy (inpatient)"], ["MAGNESIUM\nMg²⁺", "M: 400-420 mg\nF: 310-320 mg\nUL: 350 mg (suppl)", "Nuts, seeds, whole grains, spinach, legumes, dark chocolate", "Cofactor for >300 enzymes; ATP stabilisation; protein/DNA synthesis; muscle relaxation", "Refractory HYPOKALAEMIA\nRefractory HYPOCALCAEMIA\nTORSADES DE POINTES\nSeizures; tetany; personality changes", "IV: respiratory depression,\nhypotension, cardiac arrest\nOral: diarrhoea (osmotic)", "Most common cause: ALCOHOLISM\nAlso: loop/thiazide diuretics, PPIs, Gitelman\nIV MgSO₄ = ECLAMPSIA + torsades\nMonitor patellar reflex during IV infusion"], ["PHOSPHORUS", "700 mg/day\nUL: 4000 mg", "Dairy, meat, fish, nuts, legumes, cola drinks", "Bone mineralisation; ATP; phospholipids; DNA/RNA; enzyme phosphorylation", "REFEEDING SYNDROME:\nDramatic ↓PO₄ after refeeding malnourished patient → cardiac arrest, respiratory failure, seizures", "Hyperphosphataemia in CKD\n→ secondary hyperPTH\n→ renal osteodystrophy", "Refeeding triad: ↓PO₄ + ↓K⁺ + ↓Mg²⁺\nRefeed slowly + supplement PO₄"], ["IRON\nFe²⁺/³⁺", "M: 8 mg\nF 19-50: 18 mg\nPregnancy: 27 mg\nUL: 45 mg", "Heme iron: red meat\n(15-35% absorbed)\nNon-heme: legumes,\nfortified cereals\n(2-10%)\nVit C enhances absorption", "Haemoglobin; myoglobin; cytochromes (ETC); catalase/peroxidase", "MICROCYTIC HYPOCHROMIC ANAEMIA\nKOILONYCHIA (spoon nails)\nPICA (craving ice, clay)\nPLUMMER-VINSON:\n(Fe def + dysphagia + oesophageal web)\nGlossitis; restless legs", "HAEMOCHROMATOSIS (HFE/C282Y):\n'Bronze diabetes'\n(cirrhosis + DM + bronze skin)\nCardiac failure; hypogonadism\nAcute (children): GE→shock→liver failure", "Most common nutritional deficiency worldwide\nFerritin = BEST stores marker (↑ in inflammation)\nTx: phlebotomy (hereditary); deferoxamine (acute)"], ["ZINC\nZn²⁺", "M: 11 mg\nF: 8 mg\nUL: 40 mg", "Oysters (richest), red meat, beans, nuts, fortified cereals", "Cofactor for >100 enzymes; zinc finger TFs; wound healing; taste/smell; spermatogenesis; Vit A mobilisation", "ACRODERMATITIS ENTEROPATHICA\n(periorificial + acral rash)\nALOPECIA\nHYPOGONADISM + growth retardation\nDysgeusia/dysosmia\nPoor wound healing; night blindness", "High-dose Zn → COPPER DEFICIENCY\n(competitive inhibition)\n→ anaemia + neutropenia\nNausea, vomiting, GI irritation", "AE = inherited Zn malabsorption (SLC39A4 mutation)\nPhytate chelates zinc → high-phytate diets = risk\nHigh dose zinc supplementation causes Cu deficiency"], ["COPPER\nCu²⁺", "900 µg/day\nUL: 10,000 µg", "Liver, oysters, nuts, seeds, dark chocolate, whole grains", "Ceruloplasmin (Fe transport); cytochrome c oxidase (ETC IV); SOD; dopamine-β-hydroxylase; lysyl oxidase; tyrosinase", "NORMOCYTIC/MACROCYTIC ANAEMIA\n+ NEUTROPENIA\n(mimics B12/folate!)\nOsteoporosis; myelopathy;\ndepigmentation", "WILSON'S DISEASE (ATP7B):\nliver disease + Kayser-Fleischer\nrings + neuropsychiatric symptoms", "MENKES DISEASE (X-linked, ATP7A): kinky hair + neurodegeneration + connective tissue fragility\nExcess Zn → Cu deficiency\nCeruloplasmin LOW in Wilson's disease"], ["IODINE\nI⁻", "150 µg/day\nPregnancy: 220 µg\nLactation: 290 µg\nUL: 1100 µg", "Iodised salt (most important), seafood, dairy, seaweed", "Required EXCLUSIVELY for thyroid hormone synthesis (T3, T4)", "GOITRE (thyroid hyperplasia, ↑TSH)\nHYPOTHYROIDISM\nCRETINISM (in utero):\nirreversible intellectual disability,\nshort stature, deafness", "Wolff-Chaikoff:\nexcess I⁻ → paradoxical HYPOTHYROIDISM\nJod-Basedow:\nI⁻ loading → HYPERTHYROIDISM", "Leading preventable cause of intellectual disability worldwide\nUniversal salt iodisation = primary prevention"], ["SELENIUM\nSe", "55 µg/day\nUL: 400 µg", "Brazil nuts (highest), seafood, meat, cereals (soil-dependent)", "Glutathione peroxidase (antioxidant); iodothyronine deiodinase (T4→T3 conversion); thioredoxin reductase", "KESHAN DISEASE\n(endemic cardiomyopathy — China)\nKASHIN-BECK DISEASE (osteoarthropathy)\nMyopathy; hypothyroidism", "SELENOSIS:\nGarlic-breath odour\nAlopecia; nail changes\nPeripheral neuropathy; nausea", "Synergistic with Vitamin E\nAt-risk: TPN without Se, Crohn's, renal dialysis, low-selenium soil regions"], ["FLUORIDE\nF⁻", "M: 4 mg AI\nF: 3 mg AI\nUL: 10 mg", "Fluoridated water (main), toothpaste, tea, seafood", "Incorporated into hydroxyapatite → resistance to acid dissolution; dental caries prevention", "DEFICIENCY: Increased dental caries", "Dental fluorosis: mottled enamel\nSkeletal fluorosis: osteosclerosis\nAcute: hypocalcaemia, arrhythmia", "Optimal water fluoridation: 0.7 mg/L\nBenefit at low levels; toxicity only with excess"], ["CHROMIUM Cr³⁺\nMANGANESE Mn²⁺\nMOLYBDENUM", "Cr: AI 25-35 µg\nMn: AI 1.8-2.3 mg\nMo: RDA 45 µg", "Cr: whole grains, broccoli\nMn: whole grains, nuts, tea\nMo: legumes, whole grains", "Cr: insulin signalling (glucose tolerance factor)\nMn: Mn-SOD, arginase, pyruvate carboxylase\nMo: xanthine oxidase, sulfite oxidase", "Cr: glucose intolerance (TPN)\nMn: hypercholesterolaemia, dermatitis (rare)\nMo: neurologic symptoms (TPN only)", "Mn INHALATION: MANGANISM\n(Parkinson's-like: tremor, rigidity)\n— miners/welders\nCr⁶⁺: lung cancer (industrial)", "Deficiencies almost exclusively in prolonged TPN without trace elements\nManganism is the main clinical toxicity in this group"], ] b12_vs_fol_rows = [ ["Megaloblastic macrocytic anaemia", "YES", "YES"], ["Neurologic symptoms (SCD of cord)", "YES", "NO"], ["Elevated homocysteine", "YES", "YES"], ["Elevated methylmalonic acid (MMA)", "YES — diagnostic", "NO"], ["Neural tube defect risk in pregnancy", "NO", "YES"], ["Source", "Only animal products", "Green veg, fortified grains"], ["Absorption site", "Terminal ileum (needs IF)", "Proximal small intestine"], ["Key drug interactions", "Metformin (↓absorption)", "Methotrexate, TMP (inhibit DHFR)"], ] summary_rows = [ ["Only vitamin made by the skin", "Vitamin D"], ["Only vitamin exclusively in animal products", "Vitamin B12"], ["Fat-soluble vitamins mnemonic", "A, D, E, K — 'ADEK'"], ["Only B vitamin neurotoxic in excess", "B6 pyridoxine (sensory neuropathy >200 mg/day)"], ["Give THIAMINE before glucose — why?", "Glucose alone worsens Wernicke's encephalopathy"], ["Corkscrew hairs = pathognomonic for", "Scurvy (Vitamin C deficiency)"], ["Elevated MMA = diagnostic of", "Vitamin B12 deficiency ONLY (not folate)"], ["Methylfolate trap caused by", "B12 deficiency → folate trapped as inactive N5-methyl-THF"], ["B12 vs folate: neurological difference", "B12 → subacute combined degeneration of spinal cord; Folate → NO neuro symptoms"], ["Antidote / reversal for warfarin", "Vitamin K"], ["Most common nutritional deficiency worldwide", "Iron deficiency anaemia"], ["Refractory hypoK + hypoCa → check first", "Magnesium (must correct Mg first)"], ["IV MgSO₄ used to treat", "Eclampsia (seizures) AND torsades de pointes"], ["Refeeding syndrome triad", "↓Phosphate + ↓Potassium + ↓Magnesium"], ["Excess zinc → causes deficiency of", "Copper → normocytic anaemia + neutropenia"], ["Acrodermatitis enteropathica", "Inherited zinc malabsorption (SLC39A4 mutation)"], ["Menkes disease", "X-linked Cu transport defect (ATP7A) → kinky hair + neurodegeneration"], ["Wilson's disease", "Cu excretion defect (ATP7B) → Kayser-Fleischer rings + liver disease"], ["Pernicious anaemia", "Anti-intrinsic factor antibodies → B12 malabsorption"], ["Iodine deficiency: leading cause of", "Preventable intellectual disability worldwide (cretinism)"], ["Pellagra 4 Ds", "Dermatitis (Casal's necklace), Diarrhoea, Dementia, Death"], ["Keshan disease", "Selenium deficiency → endemic cardiomyopathy (China)"], ["Manganism", "Mn inhalation toxicity → Parkinson's-like syndrome (miners, welders)"], ["Raw egg white causes deficiency of", "Biotin (avidin binds irreversibly; destroyed by cooking)"], ["Neural tube defect prevention", "Folic acid 400-800 µg/day pre-conceptionally"], ["Ferritin: clinical note", "BEST iron stores marker; falsely elevated in inflammation"], ["Hartnup disease → pellagra-like", "Defective tryptophan absorption → can't synthesise niacin"], ["Carcinoid syndrome → pellagra", "Tryptophan diverted to serotonin → niacin deficiency"], ["INH therapy: give prophylactic", "Vitamin B6 (INH inactivates PLP)"], ["Vitamin needed for GABA synthesis", "Vitamin B6 (PLP — decarboxylation of glutamate)"], ] # ══════════════════════════════════════════════════════════════════════════════ # BUILD LANDSCAPE PAGE 1 (fat-soluble vitamins) # ══════════════════════════════════════════════════════════════════════════════ LAND_UW = LAND_W - L_MAR - R_MAR def build_landscape_page(): buf = io.BytesIO() doc = SimpleDocTemplate(buf, pagesize=landscape(A4), leftMargin=L_MAR, rightMargin=R_MAR, topMargin=T_MAR, bottomMargin=B_MAR) story = [] story.append(Paragraph("Vitamins & Minerals — Quick Reference", TTL)) story.append(Paragraph("Page 1 of 4 | Fat-Soluble Vitamins (A · D · E · K)", SUB)) story.append(hr(TEAL, 1.5)) # Key principle strip kp = Table([[Paragraph( "<b>FAT-SOLUBLE (A,D,E,K):</b> stored in body; absorbed via micellar phase; " "any fat malabsorption → all 4 deficient simultaneously; toxicity possible with excess. " " <b>WATER-SOLUBLE:</b> limited storage; excess excreted; deficiency develops faster; most act as coenzymes.", S("kpb", fontName="Helvetica", fontSize=8, textColor=colors.black, leading=11)) ]], colWidths=[LAND_UW]) kp.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), LYELL), ("BOX", (0,0),(-1,-1), 1, GOLD), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 8), ("RIGHTPADDING", (0,0),(-1,-1), 8), ])) story.append(kp) story.append(Spacer(1, 0.2*cm)) story.append(banner("FAT-SOLUBLE VITAMINS (A · D · E · K)", LAND_UW, NAVY)) story.append(Spacer(1, 0.1*cm)) fat_headers = ["Vitamin", "RDA / UL", "Key Sources", "Functions", "Deficiency Signs", "Toxicity", "High-Yield Notes"] # Wider columns thanks to landscape fat_fracs = [0.06, 0.09, 0.12, 0.15, 0.22, 0.17, 0.19] # sum = 1.0 story.append(make_table(fat_headers, fat_sol_rows, fat_fracs, LAND_UW, header_bg=NAVY, row_bgs=[LBLUE, WHITE])) story.append(Spacer(1, 0.3*cm)) story.append(hr(TEAL, 0.5)) story.append(Paragraph( "Sources: Goldman-Cecil Medicine · Basic Medical Biochemistry 6e · Washington Manual · Costanzo Physiology 7e | Orris Medical AI", FTR)) doc.build(story) buf.seek(0) return buf # ══════════════════════════════════════════════════════════════════════════════ # BUILD PORTRAIT PAGES 2-4 # ══════════════════════════════════════════════════════════════════════════════ PORT_UW = PORT_W - L_MAR - R_MAR def build_portrait_pages(): buf = io.BytesIO() doc = SimpleDocTemplate(buf, pagesize=A4, leftMargin=L_MAR, rightMargin=R_MAR, topMargin=T_MAR, bottomMargin=B_MAR) story = [] # ── Page 2: Water-soluble vitamins ───────────────────────────────────────── story.append(banner("WATER-SOLUBLE VITAMINS (B1 · B2 · B3 · B5 · B6 · B7 · B9 · B12 · Vitamin C)", PORT_UW, TEAL)) story.append(Spacer(1, 0.1*cm)) ws_headers = ["Vitamin", "RDA / UL", "Key Sources", "Functions", "Deficiency Signs", "Toxicity", "High-Yield Notes"] ws_fracs = [0.07, 0.09, 0.12, 0.17, 0.21, 0.14, 0.20] story.append(make_table(ws_headers, water_sol_rows, ws_fracs, PORT_UW, header_bg=TEAL, row_bgs=[LGREEN, WHITE])) story.append(Spacer(1, 0.3*cm)) # B12 vs Folate story.append(banner("B12 vs FOLATE DEFICIENCY — Key Differences", PORT_UW, GREEN)) story.append(Spacer(1, 0.1*cm)) story.append(make_table( ["Feature", "B12 (Cobalamin)", "Folate (B9)"], b12_vs_fol_rows, [0.44, 0.28, 0.28], PORT_UW, header_bg=GREEN )) # ── Page 3: Minerals ─────────────────────────────────────────────────────── story.append(PageBreak()) story.append(banner("MINERALS (Ca · Mg · P | Fe · Zn · Cu · I · Se · F · Cr · Mn · Mo)", PORT_UW, PURPLE)) story.append(Spacer(1, 0.1*cm)) min_headers = ["Mineral", "RDA / UL", "Key Sources", "Functions", "Deficiency Signs", "Toxicity", "High-Yield Notes"] min_fracs = [0.08, 0.09, 0.12, 0.15, 0.21, 0.17, 0.18] story.append(make_table(min_headers, mineral_rows, min_fracs, PORT_UW, header_bg=PURPLE, row_bgs=[LPURP, WHITE])) # ── Page 4: High-yield summary ───────────────────────────────────────────── story.append(PageBreak()) story.append(banner("HIGH-YIELD SUMMARY — Must-Know Facts", PORT_UW, colors.HexColor("#BF360C"))) story.append(Spacer(1, 0.1*cm)) story.append(make_table( ["Key Fact / Question", "Answer"], summary_rows, [0.44, 0.56], PORT_UW, header_bg=ORANGE, row_bgs=[LRED, WHITE] )) story.append(Spacer(1, 0.3*cm)) story.append(hr(TEAL, 1)) story.append(Paragraph( "Sources: Goldman-Cecil Medicine · Basic Medical Biochemistry 6e · Washington Manual of Medical Therapeutics · Costanzo Physiology 7e | Orris Medical AI · Educational use only", FTR)) doc.build(story) buf.seek(0) return buf # ══════════════════════════════════════════════════════════════════════════════ # MERGE both PDFs # ══════════════════════════════════════════════════════════════════════════════ print("Building landscape page 1...") land_buf = build_landscape_page() print("Building portrait pages 2-4...") port_buf = build_portrait_pages() print("Merging...") writer = PdfWriter() reader1 = PdfReader(land_buf) for page in reader1.pages: writer.add_page(page) reader2 = PdfReader(port_buf) for page in reader2.pages: writer.add_page(page) OUTPUT = "/tmp/workspace/vitamins-minerals/Vitamins_Minerals_Mixed_Orientation.pdf" with open(OUTPUT, "wb") as f: writer.write(f) import os size_kb = os.path.getsize(OUTPUT) / 1024 print(f"Done! PDF saved: {OUTPUT} ({size_kb:.1f} KB, {len(writer.pages)} pages)") PYEOF echo "Script written."

Running Command

cd /tmp/workspace/vitamins-minerals && python make_mixed_pdf.py 2>&1

Your updated PDF is ready:

Vitamins Minerals Mixed Orientation

PDF Document · PDF

What changed:
PageOrientationContent
1Landscape (horizontal)Title + Key principle box + Fat-Soluble Vitamins table (A, D, E, K) — extra-wide columns for easier reading
2PortraitWater-Soluble Vitamins (B1–B12, Vit C) + B12 vs Folate comparison
3PortraitMinerals (Ca, Mg, P, Fe, Zn, Cu, I, Se, F, Cr, Mn, Mo)
4PortraitHigh-Yield Summary — 30 must-know facts
The landscape page gives the fat-soluble vitamins table significantly more horizontal space, so each column is wider and easier to read without squinting.

Make the first page in horizontal format of the above pdf Also add a page of marasmus vs kwashiorkor al the last

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

cat > /tmp/workspace/vitamins-minerals/make_final_pdf.py << 'PYEOF' """ Final PDF: Page 1 = LANDSCAPE — Fat-Soluble Vitamins Pages 2-4 = PORTRAIT — Water-soluble, Minerals, Summary Page 5 = PORTRAIT — Marasmus vs Kwashiorkor (new) """ from reportlab.lib.pagesizes import A4, landscape from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak ) from reportlab.lib.styles import ParagraphStyle from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from pypdf import PdfWriter, PdfReader import io PORT_W, PORT_H = A4 LAND_W, LAND_H = landscape(A4) L = R = 1.5*cm T = B = 1.6*cm LAND_UW = LAND_W - L - R PORT_UW = PORT_W - L - R # ── Colours ──────────────────────────────────────────────────────────────────── NAVY = colors.HexColor("#1A3A5C") TEAL = colors.HexColor("#1B6B8A") GREEN = colors.HexColor("#2E7D32") RED = colors.HexColor("#B71C1C") PURPLE = colors.HexColor("#4A148C") ORANGE = colors.HexColor("#E65100") GOLD = colors.HexColor("#F57F17") DKRED = colors.HexColor("#7B1FA2") LBLUE = colors.HexColor("#E3F2FD") LGREEN = colors.HexColor("#E8F5E9") LRED = colors.HexColor("#FFEBEE") LPURP = colors.HexColor("#F3E5F5") LYELL = colors.HexColor("#FFFDE7") LORANGE= colors.HexColor("#FFF3E0") STRIPE = colors.HexColor("#EEF4FB") BORDER = colors.HexColor("#90A4AE") WHITE = colors.white def S(name, **kw): return ParagraphStyle(name, **kw) TH = S("th", fontName="Helvetica-Bold", fontSize=8, textColor=WHITE, leading=10, alignment=TA_CENTER) TD = S("td", fontName="Helvetica", fontSize=7.5, textColor=colors.black, leading=10, alignment=TA_LEFT) TDB = S("tdb", fontName="Helvetica-Bold", fontSize=7.5, textColor=colors.black, leading=10, alignment=TA_LEFT) H1 = S("h1", fontName="Helvetica-Bold", fontSize=12, textColor=WHITE, leading=15, alignment=TA_LEFT) TTL = S("ttl", fontName="Helvetica-Bold", fontSize=20, textColor=NAVY, leading=24, alignment=TA_CENTER) SUB = S("sub", fontName="Helvetica", fontSize=9, textColor=TEAL, leading=12, alignment=TA_CENTER) FTR = S("ftr", fontName="Helvetica", fontSize=6.5, textColor=colors.grey, leading=9, alignment=TA_CENTER) H2S = S("h2s", fontName="Helvetica-Bold", fontSize=10, textColor=WHITE, leading=13, alignment=TA_LEFT) NRM = S("nrm", fontName="Helvetica", fontSize=8, textColor=colors.black, leading=11, alignment=TA_LEFT) def p(txt, style=TD): return Paragraph(txt, style) def pb(txt): return Paragraph(txt, TDB) def pn(txt): return Paragraph(txt, NRM) def hr(col=BORDER, t=0.5): return HRFlowable(width="100%", thickness=t, color=col, spaceAfter=3, spaceBefore=3) def banner(title, uw, bg=NAVY, style=H1): t = Table([[Paragraph(title, style)]], colWidths=[uw]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,-1), bg), ("TOPPADDING", (0,0),(-1,-1), 5), ("BOTTOMPADDING", (0,0),(-1,-1), 5), ("LEFTPADDING", (0,0),(-1,-1), 8), ("RIGHTPADDING", (0,0),(-1,-1), 8), ])) return t def make_table(headers, rows, col_fracs, uw, header_bg=NAVY, row_bgs=None): col_widths = [uw * f for f in col_fracs] if row_bgs is None: row_bgs = [STRIPE, WHITE] data = [[p(h, TH) for h in headers]] for row in rows: data.append([p(str(c), TD) if not isinstance(c, Paragraph) else c for c in row]) tbl = Table(data, colWidths=col_widths, repeatRows=1) tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0),(-1,0), header_bg), ("ROWBACKGROUNDS",(0,1),(-1,-1), row_bgs), ("GRID", (0,0),(-1,-1), 0.3, BORDER), ("VALIGN", (0,0),(-1,-1), "TOP"), ("TOPPADDING", (0,0),(-1,-1), 3), ("BOTTOMPADDING", (0,0),(-1,-1), 3), ("LEFTPADDING", (0,0),(-1,-1), 4), ("RIGHTPADDING", (0,0),(-1,-1), 4), ("FONTSIZE", (0,0),(-1,0), 8), ("FONTNAME", (0,0),(-1,0), "Helvetica-Bold"), ("TEXTCOLOR", (0,0),(-1,0), WHITE), ("FONTSIZE", (0,1),(-1,-1), 7.5), ])) return tbl # ═══════════════════════════════════════════════════════════════════ # ALL DATA (reused from previous script) # ═══════════════════════════════════════════════════════════════════ fat_sol_rows = [ ["A\n(Retinol)","M: 900 µg\nF: 700 µg\nUL: 3000 µg", "Liver, dairy, eggs\n(preformed);\nβ-carotene from dark\norange/green veg", "Vision (rhodopsin — retinal);\nepithelial differentiation\n(retinoic acid);\nimmune function;\nreproduction; bone growth", "Night blindness (1st sign)\nBitot's spots (conjunctiva)\nXerophthalmia (dry eyes)\nKeratomalacia (corneal ulcer/blindness)\nFollicular hyperkeratosis ('toad skin')\nIncreased infection susceptibility", "Acute: headache, vomiting, skin peeling\nChronic: alopecia, hepatotoxicity,\npseudotumour cerebri\nTERATOGENIC (isotretinoin)\nHypercalcaemia", "Progression: Night blindness→Bitot spots→Xerophthalmia→Keratomalacia\nAt-risk: fat malabsorption, chronic liver disease, strict vegetarians"], ["D\n(Calciferol)","<70 yr: 600 IU\n>70 yr: 800 IU\nUL: 4000 IU", "Skin + UV light\n(main source);\nFatty fish;\nFortified dairy/OJ;\nEgg yolk", "Increases intestinal Ca²⁺ & PO₄\nabsorption; bone mineralisation;\nimmune modulation;\ncell differentiation", "Children: RICKETS\n(bowed legs, rachitic rosary,\ncraniotabes, widened epiphysis)\nAdults: OSTEOMALACIA\n(bone pain, pathological fractures,\nproximal muscle weakness,\nwaddling gait)\nHypocalcaemia → tetany, seizures", "HYPERCALCAEMIA: nausea, vomiting,\npolyuria, polydipsia, constipation,\nconfusion; nephrolithiasis;\nmetastatic calcifications", "ONLY vitamin synthesised by skin\nMetabolism: Skin (D3)→Liver (25-OH)→Kidney (1,25-OH₂ calcitriol)\nPTH stimulates 1α-hydroxylation\n25(OH)D = BEST serum marker"], ["E\n(Tocopherol)","15 mg/day\nUL: 1000 mg", "Vegetable oils,\nwheat germ,\nnuts, seeds,\nleafy greens", "Major lipid-soluble ANTIOXIDANT;\nprotects cell membranes from\nlipid peroxidation;\nRBC integrity;\nnormal neurological function", "Premature infants: HAEMOLYTIC ANAEMIA\nSpinocerebellar ataxia\nPeripheral neuropathy\n(posterior columns + spinocerebellar)\nOphthalmoplegia; areflexia", "Inhibits platelet aggregation\n→ bleeding tendency\nAntagonises Vitamin K\n→ haemorrhage risk", "Synergistic with selenium (both antioxidants)\nAbetalipoproteinaemia → profound Vit E deficiency\nAt-risk: premature neonates, fat malabsorption"], ["K\n(Phylloquinone\n/Menaquinone)","M: 120 µg AI\nF: 90 µg AI\nNo UL", "K1: leafy green veg\nK2: gut bacteria,\nfermented foods\nK3: synthetic\n(menadione)", "γ-carboxylation cofactor:\nClotting factors II,VII,IX,X;\nProteins C, S, Z;\nOsteocalcin (bone)", "BLEEDING DIATHESIS\n(elevated PT/INR)\nHAEMORRHAGIC DISEASE OF NEWBORN\n(no gut bacteria, low placental transfer)\nSpontaneous bruising,\nhaematuria, GI bleed", "K1/K2: essentially non-toxic\nK3 (menadione-synthetic):\nhaemolytic anaemia,\nkernicterus in infants", "Warfarin blocks VKOR (antagonises Vit K)\nAll newborns receive prophylactic IM Vit K\nProteins C & S need Vit K → warfarin initially procoagulant\nAt-risk: newborns, broad-spectrum ABx, fat malabsorption"], ] water_sol_rows = [ ["B1\nThiamine","M: 1.2 mg\nF: 1.1 mg", "Whole grains, pork, legumes, nuts", "TPP cofactor: pyruvate DH; α-KG DH; transketolase (PPP); BCAA catabolism", "WET BERIBERI: cardiomyopathy, high-output failure, oedema\nDRY BERIBERI: peripheral neuropathy\nWERNICKE'S: confusion + ophthalmoplegia + ataxia\nKORSAKOFF'S: amnesia + confabulation", "None known","Give THIAMINE BEFORE glucose (prevents Wernicke's worsening)\nPrimary risk: ALCOHOLICS\nBest test: RBC transketolase activity"], ["B2\nRiboflavin","M: 1.3 mg\nF: 1.1 mg", "Dairy, meats, enriched cereals, eggs", "FMN/FAD: redox reactions, ETC; FA β-oxidation; activates B6 & folate", "ARIBOFLAVINOSIS:\nCheilosis + angular stomatitis\nMagenta tongue (glossitis)\nSeborrhoeic dermatitis\nCorneal vascularisation", "None known\n(Urine turns yellow-green)","Required to activate B6 and folate\nPhenothiazines impair absorption"], ["B3\nNiacin","M: 16 mg NE\nF: 14 mg NE\nUL: 35 mg", "Meat, fish, peanuts;\nmade from tryptophan\n(60 mg Trp = 1 mg niacin)", "NAD⁺/NADH, NADP⁺/NADPH: glycolysis, TCA, FA oxidation, OXPHOS", "PELLAGRA — 4 Ds:\nDermatitis (Casal's necklace)\nDiarrhoea\nDementia\nDeath", "Pharmacologic doses:\nFlushing (give aspirin)\nHepatotoxicity\nHyperglycaemia, hyperuricaemia", "Causes: corn diet, alcoholism, Hartnup disease, carcinoid, INH\nHigh-dose niacin = best HDL-raising agent"], ["B5\nPantothenic\nacid","AI: 5 mg\nNo UL", "Ubiquitous (liver, egg yolk, avocado richest)", "Coenzyme A backbone: ALL acyl-transfer reactions — FA synthesis/oxidation, TCA, steroids", "RARE: burning feet syndrome\nIrritability, fatigue\n(severe malnutrition only)", "None known","Greek pantos = 'everywhere' — deficiency almost never seen clinically"], ["B6\nPyridoxine","1.3 mg/day\nUL: 100 mg", "Meat, fish, potatoes, bananas, fortified cereals", "PLP cofactor: transamination (ALT/AST); neurotransmitter synthesis (5-HT, DA, GABA); heme synthesis (ALA synthase); cystathionine synthesis", "Microcytic SIDEROBLASTIC anaemia\n(ring sideroblasts on BM)\nPeripheral neuropathy\nSEIZURES (↓GABA)\nDermatitis; ↑homocysteine", "SENSORY NEUROPATHY\n>200 mg/day\n(Only B vitamin with neurotoxicity)", "INH inactivates PLP → give B6 prophylactically with INH\nB6 needed for every neurotransmitter biosynthesis step"], ["B7\nBiotin","AI: 30 µg\nNo UL", "Liver, cooked egg yolk, nuts, legumes", "Carboxylation cofactor: pyruvate carboxylase; acetyl-CoA carboxylase; propionyl-CoA carboxylase", "ALOPECIA (hallmark)\nPeriorificial dermatitis\n(around mouth, eyes, genitals)\nConjunctivitis; CNS abnormalities", "None known", "Raw egg white AVIDIN binds biotin irreversibly → cooking destroys avidin\nBiotinidase deficiency in infants"], ["B9\nFolate","400 µg DFE\nPregnancy: 600 µg\nUL: 1000 µg", "Leafy greens, legumes, fortified cereals, citrus, liver", "THF: one-carbon transfers — purine & thymidylate synthesis; homocysteine→methionine", "MEGALOBLASTIC MACROCYTIC anaemia\nNEURAL TUBE DEFECTS\n(spina bifida, anencephaly)\n↑Homocysteine\nNO neurologic symptoms", "Masks B12 deficiency\n(corrects anaemia not neuro damage)", "400-800 µg/day for ALL women of childbearing age\nMETHYLFOLATE TRAP (caused by B12 deficiency)\nMTX/TMP inhibit DHFR"], ["B12\nCobalamin","2.4 µg/day\nNo UL", "ONLY animal products\n(meat, fish, dairy, eggs)\nVegans must supplement", "Methionine synthase (methylcobalamin); methylmalonyl-CoA mutase (adenosylcobalamin)", "MEGALOBLASTIC MACROCYTIC anaemia\nSUBACUTE COMBINED DEGENERATION\n(posterior + lateral columns)\n↑MMA + ↑homocysteine\nGlossitis; neuropsychiatric symptoms", "None known", "Absorbed ONLY in terminal ileum (needs intrinsic factor)\nPernicious anaemia = anti-IF antibodies\nElevated MMA = B12 ONLY (not folate)\nMetformin impairs B12 absorption"], ["C\nAscorbic acid","M: 90 mg\nF: 75 mg\n+35 mg smokers\nUL: 2000 mg", "Citrus, kiwi, strawberries, bell peppers, broccoli", "Prolyl/lysyl hydroxylase (collagen); Fe³⁺→Fe²⁺; antioxidant; dopamine-β-hydroxylase; carnitine synthesis", "SCURVY:\nCorkscrew hairs (PATHOGNOMONIC)\nPerifollicular haemorrhages\nGingival bleeding\nPoor wound healing\nPetechiae, ecchymoses", "GI upset >2 g/day\nOxalate kidney stones\nHaemolysis in G6PD deficiency", "Corkscrew hairs = pathognomonic for scurvy\nVit C enhances non-heme iron absorption\nDoes NOT prevent common cold"], ] mineral_rows = [ ["CALCIUM\nCa²⁺","19-50: 1000 mg\n>50F/>70: 1200 mg\nUL: 2500 mg", "Dairy, fortified foods, leafy greens (kale), sardines", "Bone structure (99% in skeleton); muscle contraction; nerve transmission; coagulation; 2nd messenger", "HYPOCALCAEMIA:\nChvostek's + Trousseau's signs\nProlonged QT; seizures\nChronic: OSTEOPOROSIS", "HYPERCALCAEMIA ('Bones Stones Groans Moans'):\nKidney stones; bone pain\nConstipation; confusion, depression", "Refractory hypoCa → check Mg first\nVit D required for absorption\nCauses: hyperPTH (outpatient), malignancy (inpatient)"], ["MAGNESIUM\nMg²⁺","M: 400-420 mg\nF: 310-320 mg\nUL: 350 mg (suppl)", "Nuts, seeds, whole grains, spinach, legumes, dark chocolate", "Cofactor for >300 enzymes; ATP stabilisation; protein/DNA synthesis; muscle relaxation", "Refractory HYPOKALAEMIA\nRefractory HYPOCALCAEMIA\nTORSADES DE POINTES\nSeizures; tetany; personality changes", "IV: respiratory depression,\nhypotension, cardiac arrest\nOral: diarrhoea (osmotic)", "Most common cause: ALCOHOLISM\nAlso: loop/thiazide diuretics, PPIs, Gitelman\nIV MgSO₄ = ECLAMPSIA + torsades\nMonitor patellar reflex during IV infusion"], ["PHOSPHORUS","700 mg/day\nUL: 4000 mg", "Dairy, meat, fish, nuts, legumes, cola drinks", "Bone mineralisation; ATP; phospholipids; DNA/RNA; enzyme phosphorylation", "REFEEDING SYNDROME:\n↓PO₄ after refeeding malnourished patient → cardiac arrest, respiratory failure, seizures", "Hyperphosphataemia in CKD\n→ secondary hyperPTH\n→ renal osteodystrophy", "Refeeding triad: ↓PO₄ + ↓K⁺ + ↓Mg²⁺\nRefeed slowly + supplement PO₄"], ["IRON\nFe²⁺/³⁺","M: 8 mg\nF 19-50: 18 mg\nPregnancy: 27 mg\nUL: 45 mg", "Heme iron: red meat\n(15-35% absorbed)\nNon-heme: legumes,\nfortified cereals\n(2-10%)\nVit C enhances absorption", "Haemoglobin; myoglobin; cytochromes (ETC); catalase/peroxidase", "MICROCYTIC HYPOCHROMIC ANAEMIA\nKOILONYCHIA (spoon nails)\nPICA (craving ice, clay)\nPLUMMER-VINSON: Fe def + dysphagia + oesophageal web\nGlossitis; restless legs", "HAEMOCHROMATOSIS (HFE/C282Y):\n'Bronze diabetes'\n(cirrhosis + DM + bronze skin)\nCardiac failure; hypogonadism\nAcute (children): GE→shock→liver failure", "Most common nutritional deficiency worldwide\nFerritin = BEST stores marker\nTx: phlebotomy (hereditary); deferoxamine (acute)"], ["ZINC\nZn²⁺","M: 11 mg\nF: 8 mg\nUL: 40 mg", "Oysters (richest), red meat, beans, nuts, fortified cereals", "Cofactor for >100 enzymes; zinc finger TFs; wound healing; taste/smell; spermatogenesis; Vit A mobilisation", "ACRODERMATITIS ENTEROPATHICA\n(periorificial + acral rash)\nALOPECIA\nHYPOGONADISM + growth retardation\nDysgeusia/dysosmia\nPoor wound healing; night blindness", "High-dose Zn → COPPER DEFICIENCY\n→ anaemia + neutropenia\nNausea, vomiting, GI irritation", "AE = inherited Zn malabsorption (SLC39A4 mutation)\nPhytate chelates zinc\nHigh-dose zinc supplementation causes Cu deficiency"], ["COPPER\nCu²⁺","900 µg/day\nUL: 10,000 µg", "Liver, oysters, nuts, seeds, dark chocolate, whole grains", "Ceruloplasmin (Fe transport); cytochrome c oxidase (ETC IV); SOD; dopamine-β-hydroxylase; lysyl oxidase; tyrosinase", "NORMOCYTIC/MACROCYTIC ANAEMIA\n+ NEUTROPENIA\n(mimics B12/folate!)\nOsteoporosis; myelopathy;\ndepigmentation", "WILSON'S DISEASE (ATP7B):\nliver disease + Kayser-Fleischer\nrings + neuropsychiatric symptoms", "MENKES DISEASE (X-linked, ATP7A): kinky hair + neurodegeneration\nExcess Zn → Cu deficiency\nCeruloplasmin LOW in Wilson's disease"], ["IODINE\nI⁻","150 µg/day\nPregnancy: 220 µg\nLactation: 290 µg\nUL: 1100 µg", "Iodised salt (most important), seafood, dairy, seaweed", "Required EXCLUSIVELY for thyroid hormone synthesis (T3, T4)", "GOITRE (thyroid hyperplasia, ↑TSH)\nHYPOTHYROIDISM\nCRETINISM (in utero):\nirreversible intellectual disability,\nshort stature, deafness", "Wolff-Chaikoff:\nexcess I⁻ → paradoxical HYPOTHYROIDISM\nJod-Basedow:\nI⁻ loading → HYPERTHYROIDISM", "Leading preventable cause of intellectual disability worldwide\nUniversal salt iodisation = primary prevention"], ["SELENIUM\nSe","55 µg/day\nUL: 400 µg", "Brazil nuts (highest), seafood, meat, cereals (soil-dependent)", "Glutathione peroxidase (antioxidant); iodothyronine deiodinase (T4→T3 conversion); thioredoxin reductase", "KESHAN DISEASE\n(endemic cardiomyopathy — China)\nKASHIN-BECK DISEASE (osteoarthropathy)\nMyopathy; hypothyroidism", "SELENOSIS:\nGarlic-breath odour\nAlopecia; nail changes\nPeripheral neuropathy; nausea", "Synergistic with Vitamin E\nAt-risk: TPN without Se, Crohn's, renal dialysis, low-selenium soil regions"], ["FLUORIDE\nF⁻","M: 4 mg AI\nF: 3 mg AI\nUL: 10 mg", "Fluoridated water (main), toothpaste, tea, seafood", "Incorporated into hydroxyapatite → resistance to acid dissolution; dental caries prevention", "DEFICIENCY: Increased dental caries", "Dental fluorosis: mottled enamel\nSkeletal fluorosis: osteosclerosis\nAcute: hypocalcaemia, arrhythmia", "Optimal water fluoridation: 0.7 mg/L\nBenefit at low levels; toxicity only with excess"], ["CHROMIUM\nMANGANESE\nMOLYBDENUM","Cr: AI 25-35 µg\nMn: AI 1.8-2.3 mg\nMo: RDA 45 µg", "Cr: whole grains, broccoli\nMn: whole grains, nuts, tea\nMo: legumes, whole grains", "Cr: insulin signalling (glucose tolerance factor)\nMn: Mn-SOD, arginase, pyruvate carboxylase\nMo: xanthine oxidase, sulfite oxidase", "Cr: glucose intolerance (TPN)\nMn: hypercholesterolaemia, dermatitis (rare)\nMo: neurologic symptoms (TPN only)", "Mn INHALATION: MANGANISM\n(Parkinson's-like: tremor, rigidity)\n— miners/welders\nCr⁶⁺: lung cancer (industrial)", "Deficiencies almost exclusively in prolonged TPN\nManganism = main clinical toxicity in this group"], ] b12_fol_rows = [ ["Megaloblastic macrocytic anaemia", "YES", "YES"], ["Neurologic symptoms (SCD of cord)", "YES", "NO"], ["Elevated homocysteine", "YES", "YES"], ["Elevated methylmalonic acid (MMA)", "YES — diagnostic", "NO"], ["Neural tube defect risk in pregnancy", "NO", "YES"], ["Source", "Only animal products", "Green veg, fortified grains"], ["Absorption site", "Terminal ileum (needs IF)", "Proximal small intestine"], ["Key drug interactions", "Metformin (↓absorption)", "Methotrexate, TMP (inhibit DHFR)"], ] summary_rows = [ ["Only vitamin made by the skin", "Vitamin D"], ["Only vitamin exclusively in animal products", "Vitamin B12"], ["Fat-soluble vitamins mnemonic", "A, D, E, K — 'ADEK'"], ["Only B vitamin neurotoxic in excess", "B6 pyridoxine (sensory neuropathy >200 mg/day)"], ["Give THIAMINE before glucose — why?", "Glucose alone worsens Wernicke's encephalopathy"], ["Corkscrew hairs = pathognomonic for", "Scurvy (Vitamin C deficiency)"], ["Elevated MMA = diagnostic of", "Vitamin B12 deficiency ONLY (not folate)"], ["Methylfolate trap caused by", "B12 deficiency → folate trapped as inactive N5-methyl-THF"], ["B12 vs folate: neurological difference", "B12 → subacute combined degeneration of spinal cord; Folate → NO neuro symptoms"], ["Antidote / reversal for warfarin", "Vitamin K"], ["Most common nutritional deficiency worldwide", "Iron deficiency anaemia"], ["Refractory hypoK + hypoCa → check first", "Magnesium (must correct Mg first)"], ["IV MgSO₄ used to treat", "Eclampsia (seizures) AND torsades de pointes"], ["Refeeding syndrome triad", "↓Phosphate + ↓Potassium + ↓Magnesium"], ["Excess zinc → causes deficiency of", "Copper → normocytic anaemia + neutropenia"], ["Acrodermatitis enteropathica", "Inherited zinc malabsorption (SLC39A4 mutation)"], ["Menkes disease", "X-linked Cu transport defect (ATP7A) → kinky hair + neurodegeneration"], ["Wilson's disease", "Cu excretion defect (ATP7B) → Kayser-Fleischer rings + liver disease"], ["Pernicious anaemia", "Anti-intrinsic factor antibodies → B12 malabsorption"], ["Iodine deficiency: leading cause of", "Preventable intellectual disability worldwide (cretinism)"], ["Pellagra 4 Ds", "Dermatitis (Casal's necklace), Diarrhoea, Dementia, Death"], ["Keshan disease", "Selenium deficiency → endemic cardiomyopathy (China)"], ["Manganism", "Mn inhalation toxicity → Parkinson's-like syndrome (miners, welders)"], ["Raw egg white causes deficiency of", "Biotin (avidin binds irreversibly; destroyed by cooking)"], ["Neural tube defect prevention", "Folic acid 400-800 µg/day pre-conceptionally"], ["Ferritin: clinical note", "BEST iron stores marker; falsely elevated in inflammation"], ["Hartnup disease → pellagra-like", "Defective tryptophan absorption → can't synthesise niacin"], ["Carcinoid syndrome → pellagra", "Tryptophan diverted to serotonin → niacin deficiency"], ["INH therapy: give prophylactic", "Vitamin B6 (INH inactivates PLP)"], ["Vitamin needed for GABA synthesis", "Vitamin B6 (PLP — decarboxylation of glutamate)"], ] # ═══════════════════════════════════════════════════════════════════ # MARASMUS vs KWASHIORKOR DATA # ═══════════════════════════════════════════════════════════════════ mkw_comparison = [ ["Definition / Aetiology", "Severe global calorie (protein + energy) deficiency\n< 60% expected weight for age", "Protein deficiency disproportionate to calorie deficiency\n60-80% expected weight (masked by oedema)"], ["Pathophysiology", "Adaptive response: somatic protein (muscle) catabolised to provide amino acids for energy\nVisceral protein largely PRESERVED\nHigh cortisol → lipolysis of subcutaneous fat", "Non-adaptive: visceral protein compartment severely DEPLETED\nHypoalbuminaemia → generalised oedema\nRelative preservation of muscle and subcutaneous fat"], ["Oedema", "ABSENT — hallmark of marasmus", "PRESENT (generalised/dependent) — hallmark of kwashiorkor\nAscites; puffiness of face, hands, legs"], ["Body weight appearance", "Grossly underweight\nExtremes of wasting — 'skin and bones'\nHead appears too large for emaciated body", "Weight may appear near-normal (masked by oedema)\nPot-belly (ascites) common"], ["Muscle wasting", "SEVERE — generalised atrophy of skeletal muscle\nSpindly limbs; prominent ribs", "LESS SEVERE — partially masked by oedema"], ["Subcutaneous fat", "SEVERELY DEPLETED — loss of buccal fat pad ('old man face')\nLoss of perirenal and abdominal fat", "RELATIVELY PRESERVED (masked by oedema)"], ["Serum albumin", "Normal or MILDLY reduced\n(visceral protein largely spared)", "SEVERELY reduced (< 2.8 g/dL)\n→ oncotic pressure ↓ → oedema"], ["Skin changes", "Thin, wrinkled, lax skin\nNo typical rash", "'Flaky paint' dermatosis:\nAlternating zones of hyperpigmentation, desquamation, and hypopigmentation"], ["Hair changes", "Sparse, thin, brittle hair\n(less specific)", "Flag sign (alternating bands of light and dark pigmentation)\nEasy pluckability; straightening; depigmentation (reddish-yellow)"], ["Liver", "NOT enlarged\nNo fatty change", "ENLARGED, FATTY LIVER (hepatic steatosis)\nCaused by ↓apoprotein synthesis → impaired VLDL export → fat accumulates"], ["Mental / behaviour", "Alert, wide-eyed, hungry (though weak)", "Apathetic, listless, irritable, anorexic\nMiserable expression ('kwashi' face)"], ["Immunity / infections", "IMPAIRED (esp. T-cell mediated)\nConcurrent infections common", "IMPAIRED (similar defects)\nConcurrent infections common"], ["Anaemia", "Present (multifactorial: iron, folate, B12 deficiency)", "Present (multifactorial)\n+/- haemolytic anaemia"], ["GI changes", "Villous atrophy → malabsorption\n(worsens nutritional state)", "Villous atrophy → malabsorption\nAlso seen"], ["Age group / typical setting", "Infants < 1 year; severe food shortage/famine\nWasting in older children with chronic illness", "Children 1-4 years after early weaning onto carbohydrate diet\nClassic: weaned child displaced by new baby"], ["Origin of term", "Greek: marasmos = 'wasting'", "Ga language (Ghana): 'disease of the displaced/deposed child'"], ] # Treatment comparison mkw_tx = [ ["Acute stabilisation (Phase 1)", "Treat hypoglycaemia, hypothermia, dehydration\nTreat infections (amoxicillin)\nCorrect electrolytes (avoid IV fluids if possible — risk of heart failure)\nStart F-75 therapeutic milk (75 kcal/100 mL)", "SAME — treat hypoglycaemia, infections\nAVOID aggressive fluid resuscitation (oedema worsens)\nCorrect electrolytes; do NOT give IV albumin"], ["Transition / catch-up growth (Phase 2)", "Gradually increase to F-100 (100 kcal/100 mL)\nOr RUTF (Ready-to-Use Therapeutic Food)\nHigh protein + energy", "Reduce oedema first, then increase protein intake\nF-100 / RUTF once oedema resolving"], ["Micronutrient supplementation", "Vitamins A, D, folate, zinc, copper\n(Give on day 2, after initial stabilisation)", "Same micronutrients\n(Avoid excess vitamin A on day 1 — risk of toxicity)"], ["Monitoring", "Weight gain, mid-upper arm circumference (MUAC)\nTarget: >5 g/kg/day weight gain", "Monitor oedema resolution\nBilateral pitting oedema + MUAC for discharge criteria"], ["Discharge criteria", "MUAC ≥ 12.5 cm\nNo oedema, no acute illness\nEating well", "MUAC ≥ 12.5 cm + oedema resolved\nNo acute illness"], ] # Key distinguishing features box mkw_key_facts = [ ["Key distinguishing feature", "WASTING without oedema", "OEDEMA is the cardinal sign"], ["Mnemonic", "'MAR-ASMUS = Marked wasting, No Oedema'", "'KWAshiorkor = K-WAter = Wet = Oedema'"], ["Serum albumin", "Normal / mildly ↓", "Severely ↓ (< 2.8 g/dL)"], ["Liver", "Normal", "Enlarged + fatty"], ["'Flaky paint' skin", "Absent", "PRESENT"], ["'Flag sign' of hair", "Absent", "PRESENT"], ["Behaviour", "Alert but weak", "Apathetic, miserable, anorexic"], ["WHO weight-for-height", "< -3 SD (severe wasting)", "Oedema present regardless of weight"], ["Visceral protein", "PRESERVED", "SEVERELY DEPLETED"], ["Somatic protein (muscle)", "SEVERELY DEPLETED", "Relatively preserved"], ] # ═══════════════════════════════════════════════════════════════════ # BUILD PAGE 1 — LANDSCAPE # ═══════════════════════════════════════════════════════════════════ def build_page1(): buf = io.BytesIO() doc = SimpleDocTemplate(buf, pagesize=landscape(A4), leftMargin=L, rightMargin=R, topMargin=T, bottomMargin=B) story = [] story.append(Paragraph("Vitamins & Minerals — Quick Reference", TTL)) story.append(Paragraph("Page 1 of 5 | Fat-Soluble Vitamins (A · D · E · K)", SUB)) story.append(hr(TEAL, 1.5)) kp = Table([[Paragraph( "<b>FAT-SOLUBLE (A,D,E,K):</b> stored in body; absorbed via micellar phase; any fat malabsorption → all 4 deficient simultaneously; toxicity possible. " "<b>WATER-SOLUBLE (B1-B12, C):</b> limited storage; excess excreted in urine; deficiency develops faster; most act as coenzymes.", S("kpb", fontName="Helvetica", fontSize=8, textColor=colors.black, leading=11)) ]], colWidths=[LAND_UW]) kp.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1),LYELL), ("BOX",(0,0),(-1,-1),1,GOLD), ("TOPPADDING",(0,0),(-1,-1),5), ("BOTTOMPADDING",(0,0),(-1,-1),5), ("LEFTPADDING",(0,0),(-1,-1),8), ("RIGHTPADDING",(0,0),(-1,-1),8), ])) story.append(kp) story.append(Spacer(1, 0.2*cm)) story.append(banner("FAT-SOLUBLE VITAMINS (A · D · E · K)", LAND_UW, NAVY)) story.append(Spacer(1, 0.1*cm)) story.append(make_table( ["Vitamin", "RDA / UL", "Key Sources", "Functions", "Deficiency Signs", "Toxicity", "High-Yield Notes"], fat_sol_rows, [0.06, 0.09, 0.12, 0.15, 0.22, 0.17, 0.19], LAND_UW, header_bg=NAVY, row_bgs=[LBLUE, WHITE] )) story.append(Spacer(1, 0.3*cm)) story.append(hr(TEAL, 0.5)) story.append(Paragraph("Sources: Goldman-Cecil Medicine · Basic Medical Biochemistry 6e · Washington Manual · Costanzo Physiology 7e | Orris Medical AI", FTR)) doc.build(story) buf.seek(0) return buf # ═══════════════════════════════════════════════════════════════════ # BUILD PAGES 2-4 — PORTRAIT # ═══════════════════════════════════════════════════════════════════ def build_pages2_4(): buf = io.BytesIO() doc = SimpleDocTemplate(buf, pagesize=A4, leftMargin=L, rightMargin=R, topMargin=T, bottomMargin=B) story = [] # Page 2 story.append(banner("WATER-SOLUBLE VITAMINS (B1 · B2 · B3 · B5 · B6 · B7 · B9 · B12 · Vitamin C)", PORT_UW, TEAL)) story.append(Spacer(1, 0.1*cm)) story.append(make_table( ["Vitamin", "RDA / UL", "Key Sources", "Functions", "Deficiency Signs", "Toxicity", "High-Yield Notes"], water_sol_rows, [0.07, 0.09, 0.12, 0.17, 0.21, 0.14, 0.20], PORT_UW, header_bg=TEAL, row_bgs=[LGREEN, WHITE] )) story.append(Spacer(1, 0.25*cm)) story.append(banner("B12 vs FOLATE DEFICIENCY — Key Differences", PORT_UW, GREEN)) story.append(Spacer(1, 0.1*cm)) story.append(make_table( ["Feature", "B12 (Cobalamin)", "Folate (B9)"], b12_fol_rows, [0.44, 0.28, 0.28], PORT_UW, header_bg=GREEN )) # Page 3 story.append(PageBreak()) story.append(banner("MINERALS (Ca · Mg · P | Fe · Zn · Cu · I · Se · F · Cr · Mn · Mo)", PORT_UW, PURPLE)) story.append(Spacer(1, 0.1*cm)) story.append(make_table( ["Mineral", "RDA / UL", "Key Sources", "Functions", "Deficiency Signs", "Toxicity", "High-Yield Notes"], mineral_rows, [0.08, 0.09, 0.12, 0.15, 0.21, 0.17, 0.18], PORT_UW, header_bg=PURPLE, row_bgs=[LPURP, WHITE] )) # Page 4 story.append(PageBreak()) story.append(banner("HIGH-YIELD SUMMARY — Must-Know Facts", PORT_UW, colors.HexColor("#BF360C"))) story.append(Spacer(1, 0.1*cm)) story.append(make_table( ["Key Fact / Question", "Answer"], summary_rows, [0.44, 0.56], PORT_UW, header_bg=ORANGE, row_bgs=[LRED, WHITE] )) story.append(Spacer(1, 0.3*cm)) story.append(hr(TEAL, 1)) story.append(Paragraph( "Sources: Goldman-Cecil Medicine · Basic Medical Biochemistry 6e · Washington Manual · Costanzo Physiology 7e | Orris Medical AI · Educational use only", FTR)) doc.build(story) buf.seek(0) return buf # ═══════════════════════════════════════════════════════════════════ # BUILD PAGE 5 — MARASMUS vs KWASHIORKOR (PORTRAIT) # ═══════════════════════════════════════════════════════════════════ def build_page5(): buf = io.BytesIO() doc = SimpleDocTemplate(buf, pagesize=A4, leftMargin=L, rightMargin=R, topMargin=T, bottomMargin=B) story = [] # Title banner story.append(banner("PROTEIN-ENERGY MALNUTRITION | Marasmus vs Kwashiorkor", PORT_UW, colors.HexColor("#4E342E"))) story.append(Spacer(1, 0.15*cm)) # Intro note intro = Table([[Paragraph( "<b>Protein-Energy Malnutrition (PEM)</b> encompasses a spectrum from <b>marasmus</b> (global calorie starvation) to " "<b>kwashiorkor</b> (predominantly protein deficiency). Both are forms of severe acute malnutrition (SAM) and carry high mortality. " "The key clinical distinction is <b>oedema</b> — present in kwashiorkor, absent in marasmus. " "<i>Source: Robbins & Cotran Pathologic Basis of Disease; Park's Preventive & Social Medicine</i>", S("intro", fontName="Helvetica", fontSize=7.5, textColor=colors.black, leading=11)) ]], colWidths=[PORT_UW]) intro.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), colors.HexColor("#EFEBE9")), ("BOX",(0,0),(-1,-1), 0.8, colors.HexColor("#4E342E")), ("TOPPADDING",(0,0),(-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1), 5), ("LEFTPADDING",(0,0),(-1,-1), 8), ("RIGHTPADDING",(0,0),(-1,-1), 8), ])) story.append(intro) story.append(Spacer(1, 0.2*cm)) # KEY DISTINGUISHING FEATURES (compact at top) story.append(Paragraph( Paragraph("KEY DISTINGUISHING FEATURES AT A GLANCE", H2S), H2S) if False else None) key_banner = Table([[Paragraph("KEY DISTINGUISHING FEATURES AT A GLANCE", H2S)]], colWidths=[PORT_UW]) key_banner.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), colors.HexColor("#BF360C")), ("TOPPADDING",(0,0),(-1,-1), 4), ("BOTTOMPADDING",(0,0),(-1,-1), 4), ("LEFTPADDING",(0,0),(-1,-1), 8), ("RIGHTPADDING",(0,0),(-1,-1), 8), ])) story.append(key_banner) story.append(Spacer(1, 0.05*cm)) # Key features table (3 cols) TH_MK = S("thmk", fontName="Helvetica-Bold", fontSize=8, textColor=WHITE, leading=10, alignment=TA_CENTER) TDM = S("tdm", fontName="Helvetica", fontSize=7.5, textColor=colors.black, leading=10, alignment=TA_LEFT) TDB_M = S("tdbm", fontName="Helvetica-Bold", fontSize=7.5, textColor=colors.HexColor("#1A237E"), leading=10, alignment=TA_LEFT) TDB_K = S("tdbk", fontName="Helvetica-Bold", fontSize=7.5, textColor=colors.HexColor("#B71C1C"), leading=10, alignment=TA_LEFT) kf_header = [p("Feature", TH_MK), p("MARASMUS", TH_MK), p("KWASHIORKOR", TH_MK)] kf_data = [kf_header] kf_row_bgs = [colors.HexColor("#EFEBE9"), WHITE] M_COL = colors.HexColor("#E3F2FD") K_COL = colors.HexColor("#FCE4EC") for i, row in enumerate(mkw_key_facts): bg_m = M_COL if i % 2 == 0 else colors.HexColor("#BBDEFB") bg_k = K_COL if i % 2 == 0 else colors.HexColor("#F8BBD0") kf_data.append([ Paragraph(row[0], TDB_M), Paragraph(row[1], TDM), Paragraph(row[2], TDM), ]) kf_fracs = [0.30, 0.35, 0.35] kf_col_w = [PORT_UW * f for f in kf_fracs] kf_tbl = Table(kf_data, colWidths=kf_col_w) kf_style = [ ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#BF360C")), ("BACKGROUND", (1,1), (1,-1), M_COL), ("BACKGROUND", (2,1), (2,-1), K_COL), ("ROWBACKGROUNDS",(0,1), (0,-1), [colors.HexColor("#EFEBE9"), WHITE]), ("GRID", (0,0), (-1,-1), 0.3, BORDER), ("VALIGN", (0,0), (-1,-1), "TOP"), ("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING", (0,0), (-1,-1), 3), ("LEFTPADDING", (0,0), (-1,-1), 4), ("RIGHTPADDING", (0,0), (-1,-1), 4), ] kf_tbl.setStyle(TableStyle(kf_style)) story.append(kf_tbl) story.append(Spacer(1, 0.2*cm)) # DETAILED COMPARISON TABLE det_banner = Table([[Paragraph("DETAILED CLINICAL COMPARISON", H2S)]], colWidths=[PORT_UW]) det_banner.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), colors.HexColor("#4E342E")), ("TOPPADDING",(0,0),(-1,-1), 4), ("BOTTOMPADDING",(0,0),(-1,-1), 4), ("LEFTPADDING",(0,0),(-1,-1), 8), ("RIGHTPADDING",(0,0),(-1,-1), 8), ])) story.append(det_banner) story.append(Spacer(1, 0.05*cm)) det_header = [p("Feature", TH_MK), p("MARASMUS", TH_MK), p("KWASHIORKOR", TH_MK)] det_data = [det_header] for row in mkw_comparison: det_data.append([Paragraph(row[0], TDB_M), Paragraph(row[1], TDM), Paragraph(row[2], TDM)]) det_col_w = [PORT_UW * f for f in [0.22, 0.39, 0.39]] det_tbl = Table(det_data, colWidths=det_col_w, repeatRows=1) det_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#4E342E")), ("BACKGROUND", (1,1), (1,-1), M_COL), ("BACKGROUND", (2,1), (2,-1), K_COL), ("ROWBACKGROUNDS",(0,1), (0,-1), [colors.HexColor("#EFEBE9"), WHITE]), ("GRID", (0,0), (-1,-1), 0.3, BORDER), ("VALIGN", (0,0), (-1,-1), "TOP"), ("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING", (0,0), (-1,-1), 3), ("LEFTPADDING", (0,0), (-1,-1), 4), ("RIGHTPADDING", (0,0), (-1,-1), 4), ])) story.append(det_tbl) story.append(Spacer(1, 0.2*cm)) # MANAGEMENT TABLE tx_banner = Table([[Paragraph("MANAGEMENT PRINCIPLES (WHO SAM Protocol)", H2S)]], colWidths=[PORT_UW]) tx_banner.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), GREEN), ("TOPPADDING",(0,0),(-1,-1), 4), ("BOTTOMPADDING",(0,0),(-1,-1), 4), ("LEFTPADDING",(0,0),(-1,-1), 8), ("RIGHTPADDING",(0,0),(-1,-1), 8), ])) story.append(tx_banner) story.append(Spacer(1, 0.05*cm)) tx_header = [p("Phase", TH_MK), p("MARASMUS", TH_MK), p("KWASHIORKOR", TH_MK)] tx_data = [tx_header] for row in mkw_tx: tx_data.append([Paragraph(row[0], TDB_M), Paragraph(row[1], TDM), Paragraph(row[2], TDM)]) tx_col_w = [PORT_UW * f for f in [0.22, 0.39, 0.39]] tx_tbl = Table(tx_data, colWidths=tx_col_w, repeatRows=1) tx_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), GREEN), ("ROWBACKGROUNDS",(0,1), (-1,-1), [LGREEN, WHITE]), ("GRID", (0,0), (-1,-1), 0.3, BORDER), ("VALIGN", (0,0), (-1,-1), "TOP"), ("TOPPADDING", (0,0), (-1,-1), 3), ("BOTTOMPADDING", (0,0), (-1,-1), 3), ("LEFTPADDING", (0,0), (-1,-1), 4), ("RIGHTPADDING", (0,0), (-1,-1), 4), ])) story.append(tx_tbl) story.append(Spacer(1, 0.25*cm)) story.append(hr(colors.HexColor("#4E342E"), 1)) story.append(Paragraph( "Sources: Robbins & Cotran Pathologic Basis of Disease (10e) · Robbins & Kumar Basic Pathology · Park's Preventive & Social Medicine · WHO Guidelines for SAM Management | Orris Medical AI · Educational use only", FTR)) doc.build(story) buf.seek(0) return buf # ═══════════════════════════════════════════════════════════════════ # MERGE ALL # ═══════════════════════════════════════════════════════════════════ print("Building page 1 (landscape)...") buf1 = build_page1() print("Building pages 2-4 (portrait)...") buf24 = build_pages2_4() print("Building page 5 (marasmus vs kwashiorkor)...") buf5 = build_page5() print("Merging...") writer = PdfWriter() for buf in [buf1, buf24, buf5]: reader = PdfReader(buf) for page in reader.pages: writer.add_page(page) OUTPUT = "/tmp/workspace/vitamins-minerals/Vitamins_Minerals_Final.pdf" with open(OUTPUT, "wb") as f: writer.write(f) import os sz = os.path.getsize(OUTPUT) / 1024 npg = sum(1 for _ in writer.pages) print(f"Done! {OUTPUT} ({sz:.1f} KB, {npg} pages)") PYEOF echo "Script written."

Running Command

cd /tmp/workspace/vitamins-minerals && python make_final_pdf.py 2>&1

Your updated PDF is ready:

Vitamins Minerals Final

PDF Document · PDF

What's inside (8 pages):
PageOrientationContent
1LandscapeKey principle box + Fat-Soluble Vitamins table (A, D, E, K)
2PortraitWater-Soluble Vitamins (B1–B12, Vit C) + B12 vs Folate table
3PortraitMinerals (Ca, Mg, P, Fe, Zn, Cu, I, Se, F, Cr, Mn, Mo)
4PortraitHigh-Yield Summary — 30 must-know facts
5PortraitMarasmus vs Kwashiorkor — 3 tables:
• Key distinguishing features at a glance (colour-coded: blue = marasmus, pink = kwashiorkor)
• Detailed clinical comparison (16 features: oedema, albumin, liver, skin, hair, behaviour, etc.)
• WHO SAM management protocol (Phase 1, Phase 2, micronutrients, monitoring, discharge)
The Marasmus vs Kwashiorkor page is sourced directly from Robbins & Cotran Pathologic Basis of Disease and Park's Preventive & Social Medicine.
This is a shared conversation. Sign in to Orris to start your own chat.