Magnesium and other minerals which gets from diet and also helps to build testosterone in mens and other how the affect in women's and mens too
magnesium zinc minerals testosterone levels men women hormonal effects diet
magnesium zinc testosterone hormones
PMID: 37697053
minerals testosterone women estrogen progesterone effect magnesium zinc selenium boron
| Mineral | Primary food sources | Effect in Men | Effect in Women |
|---|---|---|---|
| Magnesium | Greens, nuts, dark chocolate | Raises free testosterone, boosts Leydig cell function | Reduces PMS, supports thyroid/estrogen |
| Zinc | Oysters, meat, pumpkin seeds | Boosts LH, inhibits aromatase, raises testosterone | Supports progesterone, reduces PCOS risk |
| Selenium | Brazil nuts, tuna, eggs | Protects Leydig cells from oxidative damage | T3/T4 conversion, fertility support |
| Boron | Prunes, avocados, almonds | Raises free testosterone, reduces estradiol | Raises estradiol and testosterone post-menopause |
| Iron | Red meat, spinach, lentils | Supports thyroid/testosterone (less direct) | Corrects hormonal disruption from blood-loss anemia |
| Iodine | Iodized salt, seaweed, seafood | Maintains thyroid - permissive for testosterone | Required for menstrual cycle regularity |
| Calcium | Dairy, greens, almonds | Supports hormonal signaling | Reduces PMS by 41% |
Clinical note from a 2024 systematic review (Morgado et al., Int J Impot Res): A review of 52 studies on "testosterone boosters" found that most supplements, including zinc/magnesium blends, failed to consistently increase total testosterone across healthy men, athletes, and men with hypogonadism. The greatest benefits were in men with confirmed deficiencies. Always test mineral levels before supplementing.
Create a minerals & hormones quick reference guide (PDF) with food sources
ls -la /home/daytona/workspace/
mkdir -p /home/daytona/workspace/minerals-hormones-guide
~/minerals-hormones-guide/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import os
OUTPUT = "/home/daytona/workspace/minerals-hormones-guide/Minerals_Hormones_Quick_Reference.pdf"
# ── Colour palette ─────────────────────────────────────────────────────────
C_TEAL = colors.HexColor("#1A7A7A")
C_TEAL_LIGHT = colors.HexColor("#E6F7F7")
C_TEAL_MID = colors.HexColor("#B2E0E0")
C_ORANGE = colors.HexColor("#E07B39")
C_ORANGE_LIGHT = colors.HexColor("#FFF0E8")
C_PURPLE = colors.HexColor("#6B4FA0")
C_PURPLE_LIGHT = colors.HexColor("#F2ECF9")
C_NAVY = colors.HexColor("#1C3557")
C_GREY_DARK = colors.HexColor("#3A3A3A")
C_GREY_MID = colors.HexColor("#6B7280")
C_GREY_LIGHT = colors.HexColor("#F4F6F8")
C_WHITE = colors.white
C_GOLD = colors.HexColor("#D4A017")
C_GREEN = colors.HexColor("#2E7D32")
C_GREEN_LIGHT= colors.HexColor("#E8F5E9")
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.5*cm, rightMargin=1.5*cm,
topMargin=2*cm, bottomMargin=2*cm
)
W, H = A4
content_width = W - 3*cm
styles = getSampleStyleSheet()
# ── Custom styles ───────────────────────────────────────────────────────────
def S(name, **kw):
return ParagraphStyle(name, **kw)
title_style = S("TitleStyle",
fontSize=26, fontName="Helvetica-Bold",
textColor=C_WHITE, alignment=TA_CENTER,
spaceAfter=4, leading=30)
subtitle_style = S("SubTitle",
fontSize=12, fontName="Helvetica",
textColor=C_TEAL_LIGHT, alignment=TA_CENTER,
spaceAfter=2, leading=15)
tagline_style = S("Tagline",
fontSize=9, fontName="Helvetica-Oblique",
textColor=C_TEAL_LIGHT, alignment=TA_CENTER,
spaceAfter=0, leading=12)
section_header = S("SectionHeader",
fontSize=13, fontName="Helvetica-Bold",
textColor=C_WHITE, alignment=TA_LEFT,
leftIndent=6, spaceAfter=0, leading=16)
mineral_name = S("MineralName",
fontSize=11, fontName="Helvetica-Bold",
textColor=C_NAVY, spaceAfter=2, leading=14)
body_style = S("BodyStyle",
fontSize=8.5, fontName="Helvetica",
textColor=C_GREY_DARK, spaceAfter=2,
leading=12, alignment=TA_JUSTIFY)
bold_body = S("BoldBody",
fontSize=8.5, fontName="Helvetica-Bold",
textColor=C_GREY_DARK, spaceAfter=1, leading=12)
small_label = S("SmallLabel",
fontSize=7.5, fontName="Helvetica-Bold",
textColor=C_TEAL, spaceAfter=1, leading=10)
cell_header = S("CellHeader",
fontSize=8, fontName="Helvetica-Bold",
textColor=C_WHITE, alignment=TA_CENTER, leading=10)
cell_body = S("CellBody",
fontSize=7.5, fontName="Helvetica",
textColor=C_GREY_DARK, alignment=TA_LEFT, leading=10)
cell_body_center = S("CellBodyCenter",
fontSize=7.5, fontName="Helvetica",
textColor=C_GREY_DARK, alignment=TA_CENTER, leading=10)
footnote_style = S("Footnote",
fontSize=7, fontName="Helvetica-Oblique",
textColor=C_GREY_MID, alignment=TA_CENTER, leading=9)
tip_style = S("Tip",
fontSize=8, fontName="Helvetica",
textColor=C_NAVY, leading=11, alignment=TA_LEFT)
tip_bold = S("TipBold",
fontSize=8, fontName="Helvetica-Bold",
textColor=C_NAVY, leading=11)
# ── Helper: header banner ───────────────────────────────────────────────────
def header_banner(text, bg=C_TEAL):
data = [[Paragraph(text, section_header)]]
t = Table(data, colWidths=[content_width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("ROWBACKGROUNDS", (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),
("ROUNDEDCORNERS", [4,4,4,4]),
]))
return t
# ── Helper: title banner (full-width coloured box) ──────────────────────────
def title_banner():
data = [
[Paragraph("MINERALS & HORMONES", title_style)],
[Paragraph("Quick Reference Guide", subtitle_style)],
[Paragraph("Dietary sources · Effects in Men & Women · Key Mechanisms", tagline_style)],
]
t = Table(data, colWidths=[content_width])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), C_TEAL),
("TOPPADDING", (0,0), (0,0), 14),
("BOTTOMPADDING", (0,2), (0,2), 14),
("TOPPADDING", (0,1), (0,2), 2),
("BOTTOMPADDING", (0,0), (0,1), 2),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("ROUNDEDCORNERS", [6,6,6,6]),
]))
return t
# ── Mineral data ─────────────────────────────────────────────────────────────
minerals = [
{
"name": "MAGNESIUM (Mg)",
"emoji": "🌿",
"rda": "Men: 400–420 mg/day | Women: 310–320 mg/day",
"foods": [
("Spinach (cooked, 1 cup)", "157 mg"),
("Pumpkin seeds (28 g)", "150 mg"),
("Dark chocolate 70%+ (28 g)", "65 mg"),
("Almonds (28 g)", "80 mg"),
("Avocado (1 medium)", "58 mg"),
("Black beans (1 cup)", "120 mg"),
("Whole wheat bread (2 slices)", "46 mg"),
],
"men": [
"Raises free testosterone by lowering SHBG",
"Boosts Leydig cell mitochondrial energy for testosterone synthesis",
"Supports deep sleep — peak testosterone is produced during sleep",
"450 mg/day raised testosterone by ~24% in 4 weeks (athletes)",
"Synergistic with exercise; gains are greater in active men",
],
"women": [
"Regulates estrogen metabolism and progesterone activity",
"Reduces PMS symptoms — supplementing before menstruation gives significant relief",
"Low magnesium predicts worse PMS and menstrual cramps",
"Supports thyroid hormone (T3/T4) production",
"Aids melatonin synthesis, improving sleep quality",
],
"mechanism": "Inhibits SHBG binding → more free testosterone; cofactor in >300 enzyme reactions including steroidogenesis",
"color": C_TEAL,
"light": C_TEAL_LIGHT,
},
{
"name": "ZINC (Zn)",
"emoji": "⚡",
"rda": "Men: 11 mg/day | Women: 8 mg/day",
"foods": [
("Oysters (6 medium)", "32 mg"),
("Beef (85 g, cooked)", "5.3 mg"),
("Pumpkin seeds (28 g)", "2.2 mg"),
("Cashews (28 g)", "1.6 mg"),
("Chickpeas (1 cup)", "2.5 mg"),
("Cheddar cheese (28 g)", "1.3 mg"),
("Eggs (1 large)", "0.6 mg"),
],
"men": [
"Directly stimulates LH (Luteinizing Hormone) → signals testes to make testosterone",
"Inhibits aromatase — the enzyme that converts testosterone to estrogen",
"Zinc deficiency causes a 75% drop in testosterone within 6 months",
"30 mg/day supplementation raised free testosterone in deficient men",
"Critical for sperm production and male fertility",
],
"women": [
"Supports progesterone production (required for ovulation and luteal phase)",
"Zinc + Iron supplementation reduced PMS symptoms by 30–35%",
"Zinc deficiency worsens testosterone-to-estrogen imbalance — key driver of PCOS",
"Supports T4→T3 thyroid hormone conversion",
"Important for follicle development and egg quality",
],
"mechanism": "Stimulates LH secretion; inhibits aromatase (CYP19A1); acts as cofactor in testosterone biosynthesis enzymes",
"color": C_ORANGE,
"light": C_ORANGE_LIGHT,
},
{
"name": "SELENIUM (Se)",
"emoji": "🧬",
"rda": "Men & Women: 55 mcg/day",
"foods": [
("Brazil nuts (1–2 nuts)", "68–90 mcg"),
("Tuna, yellowfin (85 g)", "92 mcg"),
("Sardines in oil (85 g)", "45 mcg"),
("Eggs (1 large)", "15 mcg"),
("Sunflower seeds (28 g)", "19 mcg"),
("Beef kidney (85 g)", "140 mcg"),
("Turkey breast (85 g)", "27 mcg"),
],
"men": [
"Antioxidant defense (glutathione peroxidase) protects Leydig cells from oxidative damage",
"Oxidative stress in testes directly reduces testosterone production",
"Essential for sperm motility and morphology",
"Cofactor in selenoproteins required for testosterone biosynthesis",
"Deficiency linked to reduced sperm count and male infertility",
],
"women": [
"Critical for deiodinase enzymes that convert inactive T4 → active T3",
"Selenium deficiency is a leading cause of hypothyroidism in women",
"Low selenium linked to thyroid autoimmunity (Hashimoto's thyroiditis)",
"Supports normal menstrual cycle via thyroid-gonadal axis",
"Antioxidant protection for ovarian follicles",
],
"mechanism": "Component of selenoproteins (glutathione peroxidase, thioredoxin reductase, deiodinases); protects steroidogenic tissues from oxidative damage",
"color": C_PURPLE,
"light": C_PURPLE_LIGHT,
},
{
"name": "BORON (B)",
"emoji": "💎",
"rda": "No official RDA — safe intake: 1–3 mg/day from food",
"foods": [
("Prunes (100 g)", "1.1 mg"),
("Raisins (100 g)", "2.2 mg"),
("Avocado (1 medium)", "1.1 mg"),
("Almonds (100 g)", "2.8 mg"),
("Peanuts (100 g)", "1.8 mg"),
("Red wine (150 mL)", "0.5 mg"),
("Apples (1 medium)", "0.7 mg"),
],
"men": [
"10 mg/day raised free testosterone by ~25% within one week",
"Reduces SHBG — unlocks more bioavailable testosterone",
"Reduced estradiol by ~50% in healthy men at 6–10 mg/day",
"Synergistic with vitamin D and magnesium",
"Lowers inflammatory markers (CRP) that suppress testosterone",
],
"women": [
"3 mg/day doubled estradiol in postmenopausal women (from 21 → 41 pg/mL)",
"Also raises testosterone in women — supports bone density and libido post-menopause",
"Reduces urinary calcium and magnesium losses — protects bones",
"Boron deficiency reduces androgen status in women",
"CAUTION: high doses (>3 mg/day supplement) may raise estrogen — avoid in estrogen-sensitive conditions",
],
"mechanism": "Reduces SHBG; inhibits enzymes that degrade sex steroids; reduces inflammation via NF-κB pathway suppression",
"color": C_GREEN,
"light": C_GREEN_LIGHT,
},
{
"name": "IRON (Fe)",
"emoji": "🔴",
"rda": "Men: 8 mg/day | Women (premenopausal): 18 mg/day",
"foods": [
("Beef liver (85 g)", "5.2 mg"),
("Oysters (85 g)", "8 mg"),
("Lentils (1 cup, cooked)", "6.6 mg"),
("Spinach (1 cup, cooked)", "6.4 mg"),
("Tofu (½ cup)", "3.4 mg"),
("Dark chocolate 70%+ (28 g)", "3.3 mg"),
("Kidney beans (1 cup)", "5.2 mg"),
],
"men": [
"Cofactor in thyroid hormone synthesis — thyroid supports testosterone production",
"Severe deficiency can reduce testosterone indirectly",
"Essential for oxygen delivery to steroidogenic tissues",
"Iron overload (hemochromatosis) deposits in testes → hypogonadism",
"Balance is key — excess iron generates free radicals damaging Leydig cells",
],
"women": [
"Heavy menstrual blood loss makes iron deficiency most common nutritional deficiency in women",
"Deficiency suppresses thyroid and adrenal function → lowered estrogen, libido, energy",
"Iron + zinc supplementation reduced PMS by 30–35%",
"Required for ovarian follicle development and implantation",
"Non-heme iron absorption enhanced by vitamin C",
],
"mechanism": "Cofactor in thyroid peroxidase (TPO) — needed for T3/T4 synthesis; oxygen transport via hemoglobin to all endocrine tissues",
"color": colors.HexColor("#C0392B"),
"light": colors.HexColor("#FDEDEC"),
},
{
"name": "IODINE (I)",
"emoji": "🌊",
"rda": "Men & Women: 150 mcg/day",
"foods": [
("Seaweed / kelp (1 g)", "16–2984 mcg"),
("Cod fish (85 g)", "99 mcg"),
("Iodized salt (¼ tsp)", "71 mcg"),
("Shrimp (85 g)", "35 mcg"),
("Plain yogurt (1 cup)", "75 mcg"),
("Cow's milk (1 cup)", "56 mcg"),
("Eggs (1 large)", "24 mcg"),
],
"men": [
"Building block of thyroid hormones T3 and T4",
"Thyroid hormones are permissive for normal testicular function",
"Hypothyroidism from iodine deficiency lowers testosterone",
"Supports metabolic rate — low thyroid slows steroidogenesis",
"Deficiency causes goiter; severe deficiency causes infertility",
],
"women": [
"Essential for T3/T4 synthesis — regulates metabolism, weight, temperature, mood",
"Hypothyroidism disrupts menstrual cycle (oligomenorrhea or amenorrhea)",
"Iodine deficiency is the #1 preventable cause of intellectual disability (in pregnancy)",
"Required for normal fetal brain development during pregnancy",
"Hashimoto's thyroiditis (most common in women) is worsened by iodine excess — balance matters",
],
"mechanism": "Iodine is incorporated into tyrosine residues on thyroglobulin → T3 (triiodothyronine) and T4 (thyroxine) via thyroid peroxidase",
"color": colors.HexColor("#1565C0"),
"light": colors.HexColor("#E3F2FD"),
},
{
"name": "CALCIUM (Ca)",
"emoji": "🦴",
"rda": "Men: 1000–1200 mg/day | Women: 1000–1200 mg/day",
"foods": [
("Plain yogurt (1 cup)", "415 mg"),
("Sardines with bones (85 g)", "325 mg"),
("Cow's milk (1 cup)", "305 mg"),
("Cheddar cheese (28 g)", "202 mg"),
("Tofu, firm (½ cup)", "253 mg"),
("Almonds (28 g)", "76 mg"),
("Bok choy (1 cup, cooked)", "158 mg"),
],
"men": [
"Second messenger in testosterone signaling cascades within cells",
"Adequate calcium lowers PTH → supports vitamin D activation → supports testosterone",
"Calcium regulates LH pulse frequency from the pituitary",
"Structural mineral for bones — testosterone also builds bone density",
"Hypercalcemia can paradoxically reduce testosterone via pituitary suppression",
],
"women": [
"High calcium intake reduced monthly PMS likelihood by 41% (2005 study)",
"Calcium + vitamin D is first-line for PMS management per ACOG guidelines",
"Postmenopausal estrogen drop causes calcium loss from bone (osteoporosis)",
"Supports nerve transmission in uterine smooth muscle",
"Calcium regulates FSH and LH release from the pituitary gland",
],
"mechanism": "Intracellular Ca²⁺ acts as second messenger in gonadotropin signaling; regulates PTH which controls vitamin D activation and steroid hormone amplification",
"color": colors.HexColor("#5D4037"),
"light": colors.HexColor("#EFEBE9"),
},
]
# ── Summary table data ────────────────────────────────────────────────────────
summary_headers = ["Mineral", "Key Hormones\nAffected", "Primary Effect\nin MEN", "Primary Effect\nin WOMEN", "Top Food\nSource", "Daily\nTarget"]
summary_rows = [
["Magnesium", "Testosterone\nEstrogen\nT3/T4\nMelatonin", "↑ Free testosterone\n↓ SHBG", "↓ PMS\n↑ Thyroid function", "Pumpkin seeds\nSpinach\nDark chocolate", "Men: 400–420 mg\nWomen: 310–320 mg"],
["Zinc", "Testosterone\nLH\nProgesterone", "↑ LH\n↓ Aromatase\n↑ Testosterone", "↑ Progesterone\n↓ PCOS risk", "Oysters\nBeef\nPumpkin seeds", "Men: 11 mg\nWomen: 8 mg"],
["Selenium", "T3/T4\nTestosterone", "Protects Leydig cells\nfrom oxidative damage", "T4→T3 conversion\nThyroid protection", "Brazil nuts\n(1–2 nuts/day)", "55 mcg"],
["Boron", "Testosterone\nEstrogen\nSHBG", "↑ Free testosterone\n↓ SHBG\n↓ Estradiol", "↑ Estradiol (post-\nmenopause)\n↑ Testosterone", "Raisins\nAlmonds\nAvocado", "1–3 mg (food)\n3–10 mg (supp)*"],
["Iron", "T3/T4\nCortisol", "Supports thyroid\n→ testosterone", "↓ PMS with zinc\nMenstrual replenishment", "Liver\nLentils\nDark chocolate", "Men: 8 mg\nWomen: 18 mg"],
["Iodine", "T3/T4", "Thyroid support\nfor testosterone", "Menstrual regularity\nPregnancy/fetal brain", "Seaweed\nIodized salt\nCod fish", "150 mcg"],
["Calcium", "LH, FSH\nTestosterone", "Testosterone cell\nsignaling support", "↓ PMS by 41%\nBone health", "Yogurt\nSardines\nMilk", "1000–1200 mg"],
]
# ═══════════════════════════════════════════════════════════════════════════
# Build document
# ═══════════════════════════════════════════════════════════════════════════
story = []
# ── PAGE 1: Title + Summary Table ──────────────────────────────────────────
story.append(title_banner())
story.append(Spacer(1, 10))
# Intro paragraph
intro = Paragraph(
"<b>Minerals are the silent drivers of hormonal health.</b> Unlike vitamins, they are "
"inorganic elements that the body cannot synthesize — they must come entirely from diet. "
"Deficiencies in these seven minerals are among the most common and correctable causes of "
"testosterone imbalance in men and hormonal disruption in women.",
body_style)
story.append(intro)
story.append(Spacer(1, 8))
# Summary table
story.append(header_banner("AT-A-GLANCE SUMMARY", C_NAVY))
story.append(Spacer(1, 4))
col_w = [content_width * x for x in [0.10, 0.15, 0.18, 0.18, 0.17, 0.22]]
tbl_data = [[Paragraph(h, cell_header) for h in summary_headers]]
for row in summary_rows:
tbl_data.append([Paragraph(cell, cell_body) for cell in row])
summ_style = TableStyle([
("BACKGROUND", (0,0), (-1,0), C_NAVY),
("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, C_GREY_LIGHT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
("FONTSIZE", (0,0), (-1,-1), 7.5),
("ROWBACKGROUNDS",(0,1), (-1,-1), [colors.white, C_GREY_LIGHT]),
])
summ_tbl = Table(tbl_data, colWidths=col_w, repeatRows=1)
summ_tbl.setStyle(summ_style)
story.append(summ_tbl)
story.append(Spacer(1, 6))
footnote = Paragraph(
"* Supplement doses shown are from research studies — consult a healthcare provider before supplementing. "
"Mineral benefits are most pronounced in individuals with existing deficiencies. "
"Supplementing when levels are already adequate rarely increases hormones further.",
footnote_style)
story.append(footnote)
story.append(Spacer(1, 10))
# ── Key principles box ─────────────────────────────────────────────────────
principles_title = Paragraph("<b>5 KEY PRINCIPLES</b>", S("PT", fontSize=9, fontName="Helvetica-Bold", textColor=C_NAVY, leading=12))
principles = [
"1. <b>Deficiency correction</b> drives most hormonal benefits — supplements help mainly when you are deficient.",
"2. <b>Diet first, supplements second.</b> Whole foods provide minerals in bioavailable forms with cofactors.",
"3. <b>Synergy matters:</b> Magnesium + Zinc + Vitamin D + Boron work together more powerfully than individually.",
"4. <b>Exercise amplifies</b> the testosterone-raising effects of minerals, especially magnesium.",
"5. <b>Women need minerals for estrogen, progesterone, thyroid and cortisol</b> — not just testosterone.",
]
prin_rows = [[principles_title]] + [[Paragraph(p, tip_style)] for p in principles]
prin_tbl = Table(prin_rows, colWidths=[content_width])
prin_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#EFF6FF")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("LINEBELOW", (0,0), (-1,0), 0.5, C_NAVY),
("BOX", (0,0), (-1,-1), 0.8, C_NAVY),
]))
story.append(prin_tbl)
# ── PAGE 2+: Individual mineral cards ─────────────────────────────────────
for mineral in minerals:
story.append(Spacer(1, 14))
# Mineral header
story.append(header_banner(f"{mineral['emoji']} {mineral['name']}", mineral["color"]))
story.append(Spacer(1, 3))
# RDA row
rda_data = [[
Paragraph("<b>Daily Requirement:</b> " + mineral["rda"], S("RDA", fontSize=8, fontName="Helvetica", textColor=C_NAVY, leading=11))
]]
rda_tbl = Table(rda_data, colWidths=[content_width])
rda_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), mineral["light"]),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("BOX", (0,0), (-1,-1), 0.5, mineral["color"]),
]))
story.append(rda_tbl)
story.append(Spacer(1, 5))
# 3-column layout: Food sources | Men | Women
col1_w = content_width * 0.30
col2_w = content_width * 0.35
col3_w = content_width * 0.35
# Column headers
hdr_row = [
Paragraph("🍽 FOOD SOURCES", S("CH", fontSize=8, fontName="Helvetica-Bold", textColor=C_WHITE, leading=10)),
Paragraph("♂ EFFECTS IN MEN", S("CH2", fontSize=8, fontName="Helvetica-Bold", textColor=C_WHITE, leading=10)),
Paragraph("♀ EFFECTS IN WOMEN", S("CH3", fontSize=8, fontName="Helvetica-Bold", textColor=C_WHITE, leading=10)),
]
# Build food rows (zip to same length as effects)
max_rows = max(len(mineral["foods"]), len(mineral["men"]), len(mineral["women"]))
foods = mineral["foods"] + [("", "")] * (max_rows - len(mineral["foods"]))
men_e = mineral["men"] + [""] * (max_rows - len(mineral["men"]))
wom_e = mineral["women"] + [""] * (max_rows - len(mineral["women"]))
body_rows = []
for i in range(max_rows):
food, amount = foods[i]
me = men_e[i]
we = wom_e[i]
food_cell = Paragraph(f"<b>{food}</b><br/><font size='7' color='#6B7280'>{amount}</font>" if food else "", cell_body)
men_cell = Paragraph(f"• {me}" if me else "", cell_body)
wom_cell = Paragraph(f"• {we}" if we else "", cell_body)
body_rows.append([food_cell, men_cell, wom_cell])
all_rows = [hdr_row] + body_rows
col_colors = [mineral["color"]] * 3
card_tbl = Table(all_rows, colWidths=[col1_w, col2_w, col3_w])
card_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), mineral["color"]),
("BACKGROUND", (1,0), (1,0), mineral["color"]),
("BACKGROUND", (2,0), (2,0), mineral["color"]),
("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, mineral["light"]]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
("LINEBELOW", (0,0), (-1,0), 1, C_WHITE),
("BOX", (0,0), (-1,-1), 0.8, mineral["color"]),
]))
story.append(card_tbl)
# Mechanism row
mech_data = [[
Paragraph(f"<b>Mechanism:</b> {mineral['mechanism']}", S("Mech", fontSize=7.5, fontName="Helvetica-Oblique", textColor=mineral["color"], leading=10))
]]
mech_tbl = Table(mech_data, colWidths=[content_width])
mech_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), mineral["light"]),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
("LINEABOVE", (0,0), (-1,0), 0.5, mineral["color"]),
("BOX", (0,0), (-1,-1), 0.5, mineral["color"]),
]))
story.append(mech_tbl)
# ── Final page: Hormone-Mineral Matrix ────────────────────────────────────
story.append(Spacer(1, 14))
story.append(header_banner("HORMONE–MINERAL DEPENDENCY MATRIX", C_NAVY))
story.append(Spacer(1, 4))
matrix_intro = Paragraph(
"This matrix shows which minerals are required for each hormone's synthesis, regulation, or receptor activity. "
"✅ = direct requirement | 🔄 = indirect/supportive role | ⚠ = excess is harmful",
body_style)
story.append(matrix_intro)
story.append(Spacer(1, 5))
matrix_headers = ["Hormone", "Function", "Mg", "Zn", "Se", "B", "Fe", "I", "Ca"]
matrix_data_rows = [
["Testosterone", "Libido, muscle, bone (both sexes)", "✅", "✅", "✅", "✅", "🔄", "🔄", "🔄"],
["Estrogen", "Fertility, mood, bone, reproduction", "✅", "🔄", "🔄", "✅", "🔄", "🔄", "🔄"],
["Progesterone", "Ovulation, luteal phase, pregnancy", "🔄", "✅", "🔄", "🔄", "✅", "🔄", "🔄"],
["T3 / T4 (Thyroid)", "Metabolism, temperature, mood, growth", "✅", "✅", "✅", "🔄", "✅", "✅", "🔄"],
["LH / FSH", "Pituitary gonadotropins — drive gonads", "🔄", "✅", "🔄", "✅", "🔄", "🔄", "✅"],
["Cortisol", "Stress response — suppresses sex hormones", "✅", "✅", "🔄", "✅", "🔄", "🔄", "🔄"],
["Melatonin", "Sleep — controls overnight testosterone", "✅", "✅", "🔄", "🔄", "🔄", "🔄", "🔄"],
["Insulin", "Blood sugar — high insulin lowers testosterone", "✅", "✅", "✅", "🔄", "🔄", "🔄", "🔄"],
["Parathyroid (PTH)", "Calcium regulation — affects vitamin D", "⚠", "🔄", "🔄", "✅", "🔄", "🔄", "⚠"],
]
mx_col_w = [content_width * x for x in [0.18, 0.30, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065, 0.065]]
mx_tbl_data = [[Paragraph(h, cell_header) for h in matrix_headers]]
for row in matrix_data_rows:
styled = [Paragraph(row[0], S("MR", fontSize=8, fontName="Helvetica-Bold", textColor=C_NAVY, leading=11))]
styled += [Paragraph(row[1], cell_body)]
styled += [Paragraph(c, S("MC", fontSize=9, fontName="Helvetica", alignment=TA_CENTER, leading=12)) for c in row[2:]]
mx_tbl_data.append(styled)
mx_tbl = Table(mx_tbl_data, colWidths=mx_col_w, repeatRows=1)
mx_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), C_NAVY),
("ROWBACKGROUNDS",(0,1), (-1,-1), [C_WHITE, C_GREY_LIGHT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#D1D5DB")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 4),
("RIGHTPADDING", (0,0), (-1,-1), 4),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("ALIGN", (2,0), (-1,-1), "CENTER"),
("BOX", (0,0), (-1,-1), 0.8, C_NAVY),
]))
story.append(mx_tbl)
story.append(Spacer(1, 8))
# Warning box
warn_text = (
"<b>⚠ Important Clinical Note:</b> A 2024 systematic review (Morgado et al., <i>Int J Impot Res</i>) "
"examined 52 studies on testosterone boosters including zinc/magnesium supplements. Most failed to "
"consistently raise total testosterone in healthy men. Benefits were greatest in people with confirmed "
"deficiencies. Always test mineral levels before supplementing, and consult a healthcare provider for "
"doses exceeding dietary reference intakes."
)
warn_data = [[Paragraph(warn_text, S("Warn", fontSize=8, fontName="Helvetica", textColor=colors.HexColor("#7B341E"), leading=11))]]
warn_tbl = Table(warn_data, colWidths=[content_width])
warn_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#FFF8E1")),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#D4A017")),
("LINEABOVE", (0,0), (-1,0), 2, colors.HexColor("#D4A017")),
]))
story.append(warn_tbl)
story.append(Spacer(1, 6))
footer = Paragraph(
"Compiled from: Harper's Illustrated Biochemistry 32nd Ed | Tietz Textbook of Laboratory Medicine 7th Ed | "
"Morgado et al. 2024 Int J Impot Res | Cinar et al. 2011 Biol Trace Elem Res | Prasad et al. 1996 Nutrition | Nielsen et al. 1987",
footnote_style)
story.append(footer)
# ── Build ────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT}")
cd /home/daytona/workspace/minerals-hormones-guide && python generate_pdf.py
ls -lh /home/daytona/workspace/minerals-hormones-guide/
Minerals Hormones Quick Reference
PDF Document · PDF
Pulses should be taken in diet for gout disease or not
pulses legumes gout uric acid
pulses lentils beans gout diet safe or avoid uric acid 2024
gout diet hyperuricemia plant protein legumes
ACR gout guidelines 2020 2024 legumes pulses purine vegetables recommendation
| Food Category | Recommendation | Reason |
|---|---|---|
| Pulses (lentils, beans, chickpeas, peas) | ✅ Safe - eat freely | Plant purines do not raise uric acid meaningfully |
| Organ meats (liver, kidney) | ❌ Avoid | Very high animal purines |
| Shellfish | ❌ Avoid | High animal purines |
| Sardines, anchovies, mackerel | ❌ Avoid/limit | High animal purines |
| Red meat (beef, lamb) | ⚠ Limit to 85-170 g/day | Moderate-high animal purines |
| Alcohol (especially beer) | ❌ Avoid or minimise | Raises uric acid, inhibits renal excretion |
| Sugary drinks/HFCS | ❌ Avoid | Fructose raises uric acid independently |
| Low-fat dairy (milk, yogurt) | ✅ Beneficial | Actively promotes uric acid excretion |
| Vegetables (all, including spinach, mushrooms) | ✅ Safe | Plant purines are not harmful in gout |
| Water (2-3 litres/day) | ✅ Essential | Promotes uric acid excretion through kidneys |
| Coffee (up to 3 cups/day) | ✅ Safe | Associated with lower uric acid levels |
| Whole grains | ✅ Beneficial | Lower gout risk (2025 study, Arthritis Care & Research) |
- Robbins & Kumar Basic Pathology, p. 57 (gout treatment overview)
- 2020 ACR Guideline for Management of Gout (FitzGerald et al., Arthritis Care & Research, PMID: 32391934)
- Li et al. 2018 - plant purines not correlated with gout risk
- National Kidney Foundation 2025 dietary guidance
How coffee support gout?
coffee uric acid gout hyperuricemia
how does coffee reduce uric acid gout mechanism xanthine oxidase evidence
coffee consumption gout risk hyperuricemia meta-analysis
https://e-nrp.org/DOIx.php?id=10.4162%2Fnrp.2025.19.5.649
PMID: 41098399
PMID: 39289820
| Coffee Type | Effect on Uric Acid |
|---|---|
| Regular (caffeinated) | ✅ Best protective effect overall |
| Decaffeinated | ✅ Moderate protective effect |
| Tea (black/green) | ❌ No benefit; may slightly increase risk |
| Sugary coffee drinks | ⚠ The added high-fructose corn syrup negates the benefit |
| Mechanism | Coffee Compound | Outcome |
|---|---|---|
| Blocks xanthine oxidase (like allopurinol) | Chlorogenic acid, trimethylxanthine | Less uric acid produced |
| Increases kidney filtration (eGFR) | Caffeine | More uric acid excreted |
| Improves insulin sensitivity | Chlorogenic acid | Less insulin-driven uric acid retention |
| Suppresses COX-2/NF-κB inflammation | Cafestol, kahweol | Less gout flare severity |
Sources: Hong & Kim 2025, Nutr Res Pract (PMID: 41098399) | Chi et al. 2024, Int J Food Sci Nutr (PMID: 39289820) | Basic Medical Biochemistry 6th Ed., p. 254 | Katzung's Basic & Clinical Pharmacology 16th Ed.