give diagram of eye



| Layer | Structure | Function |
|---|---|---|
| Outer | Sclera / Cornea | Protection / light entry |
| Middle (Uvea) | Choroid / Ciliary body / Iris | Nutrition / accommodation / pupil control |
| Inner | Retina (neural + pigment) | Phototransduction |
| Chambers | Anterior + Posterior (aqueous humor) | Nutrition of avascular structures |
| Posterior cavity | Vitreous chamber | Maintains eye shape |
write an essay on structure of skin in easy way

In thick skin (like on the palms of hands and soles of feet), there is an extra layer called the stratum lucidum between the granulosum and corneum.
| Cell | % of Epidermis | Job |
|---|---|---|
| Melanocytes | ~5% | Make melanin pigment to protect DNA from UV radiation |
| Langerhans cells | 2-5% | Immune defense - identify and present antigens |
| Merkel cells | 6-10% | Detect light touch and texture (mechanoreceptors) |
| Receptor | Location | Detects |
|---|---|---|
| Free nerve endings | Epidermis | Pain, heat, cold, fine touch |
| Merkel corpuscles | Dermal-epidermal junction | Sustained pressure, texture |
| Meissner corpuscles | Dermal papillae | Light touch |
| Pacinian corpuscles | Deep dermis / hypodermis | Deep pressure, vibration |
| Ruffini corpuscles | Deep dermis | Skin stretch and torque |
| Function | How Skin Does It |
|---|---|
| Protection | Sclera layer + keratin + melanin blocks physical, chemical, and UV damage |
| Sensation | Multiple nerve receptors detect touch, pain, heat, pressure |
| Temperature regulation | Sweat cools; fat insulates; blood vessels dilate/constrict |
| Vitamin D synthesis | UV light converts precursor to Vitamin D3 in skin cells |
| Immune defense | Langerhans cells, dermal dendritic cells, and macrophages patrol for pathogens |
| Waterproofing | Lipid barrier in stratum granulosum prevents excessive water loss/gain |
Create a study guide PDF on skin structure and functions
ls /home/daytona/workspace/ 2>/dev/null && echo "---" && python3 -c "import repo…
mkdir -p /home/daytona/workspace/skin-study-guide && echo "dir created"
~/skin-study-guide/generate_pdf.py
import requests
import os
from io import BytesIO
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, Image, KeepTogether, PageBreak
)
from reportlab.platypus.flowables import HRFlowable
from reportlab.pdfgen import canvas
OUTPUT = "/home/daytona/workspace/skin-study-guide/Skin_Structure_Study_Guide.pdf"
# ── Color palette ────────────────────────────────────────────────
SKIN_TAN = colors.HexColor("#F4A460")
SKIN_PINK = colors.HexColor("#E8A090")
DERM_BLUE = colors.HexColor("#2E4057")
ACCENT = colors.HexColor("#048A81")
LIGHT_BG = colors.HexColor("#FFF8F0")
HEADER_BG = colors.HexColor("#2E4057")
TABLE_HDR = colors.HexColor("#048A81")
TABLE_ALT = colors.HexColor("#F0FAF9")
YELLOW_HL = colors.HexColor("#FFF3CD")
RED_SOFT = colors.HexColor("#FDECEA")
# ── Styles ───────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
title_style = S("Title",
fontSize=28, textColor=colors.white, alignment=TA_CENTER,
fontName="Helvetica-Bold", spaceAfter=4, leading=34)
subtitle_style = S("Subtitle",
fontSize=13, textColor=colors.HexColor("#A8D8EA"),
alignment=TA_CENTER, fontName="Helvetica", spaceAfter=2)
section_h1 = S("H1",
fontSize=16, textColor=colors.white, fontName="Helvetica-Bold",
spaceAfter=6, spaceBefore=14, leading=20,
backColor=DERM_BLUE, leftIndent=-8, rightIndent=-8,
borderPad=6)
section_h2 = S("H2",
fontSize=13, textColor=DERM_BLUE, fontName="Helvetica-Bold",
spaceAfter=4, spaceBefore=10, leading=16,
borderPad=3)
section_h3 = S("H3",
fontSize=11, textColor=ACCENT, fontName="Helvetica-Bold",
spaceAfter=3, spaceBefore=7, leading=14)
body = S("Body",
fontSize=10, textColor=colors.HexColor("#1a1a1a"),
fontName="Helvetica", spaceAfter=5, leading=15,
alignment=TA_JUSTIFY)
bullet_style = S("Bullet",
fontSize=10, textColor=colors.HexColor("#1a1a1a"),
fontName="Helvetica", spaceAfter=3, leading=14,
leftIndent=14, bulletIndent=4)
caption_style = S("Caption",
fontSize=8, textColor=colors.grey, fontName="Helvetica-Oblique",
alignment=TA_CENTER, spaceAfter=4)
key_term = S("KeyTerm",
fontSize=10, textColor=DERM_BLUE, fontName="Helvetica-Bold",
spaceAfter=2, leading=14)
box_style = S("Box",
fontSize=10, textColor=colors.HexColor("#1a1a1a"),
fontName="Helvetica", spaceAfter=4, leading=14,
backColor=YELLOW_HL, borderPad=6, leftIndent=6)
# ── Helper: colored heading band ────────────────────────────────
def heading_band(text, bg=DERM_BLUE, fg=colors.white, size=15):
data = [[Paragraph(f"<font color='white'><b>{text}</b></font>",
ParagraphStyle("hb", fontSize=size, textColor=fg,
fontName="Helvetica-Bold", leading=size+4))]]
t = Table(data, colWidths=[175*mm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING", (0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
]))
return t
def sub_heading(text, bg=ACCENT):
data = [[Paragraph(f"<font color='white'><b>{text}</b></font>",
ParagraphStyle("sh", fontSize=12, textColor=colors.white,
fontName="Helvetica-Bold", leading=15))]]
t = Table(data, colWidths=[175*mm])
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), 10),
]))
return t
def info_box(title, text, bg=YELLOW_HL, title_color=DERM_BLUE):
inner = [
[Paragraph(f"<b>{title}</b>",
ParagraphStyle("ibt", fontSize=10, textColor=title_color,
fontName="Helvetica-Bold", leading=14))],
[Paragraph(text,
ParagraphStyle("ibb", fontSize=9.5, textColor=colors.HexColor("#1a1a1a"),
fontName="Helvetica", leading=13))]
]
t = Table(inner, colWidths=[170*mm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#CCC")),
("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 bullet(text):
return Paragraph(f"• {text}", bullet_style)
def sp(h=4):
return Spacer(1, h*mm)
def hr():
return HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#CCCCCC"), spaceAfter=4)
# ── Download diagram image ───────────────────────────────────────
DIAGRAM_URL = "https://cdn.orris.care/cdss_images/dfa992647ec952b8f0ced9cc2efc45b077c3b741aefe6dc840d5415215a8d9e8.png"
img_path = "/home/daytona/workspace/skin-study-guide/skin_diagram.png"
if not os.path.exists(img_path):
r = requests.get(DIAGRAM_URL, timeout=30)
with open(img_path, "wb") as f:
f.write(r.content)
print("Image downloaded")
# ── Build story ──────────────────────────────────────────────────
story = []
# ════════════════════════════════════════════
# COVER PAGE
# ════════════════════════════════════════════
def cover_page(canvas_obj, doc):
w, h = A4
# Background gradient-like fill
canvas_obj.setFillColor(DERM_BLUE)
canvas_obj.rect(0, 0, w, h, fill=1, stroke=0)
# Decorative stripe
canvas_obj.setFillColor(ACCENT)
canvas_obj.rect(0, h*0.38, w, 8, fill=1, stroke=0)
canvas_obj.setFillColor(SKIN_TAN)
canvas_obj.rect(0, h*0.38-10, w, 4, fill=1, stroke=0)
# Cover content via story (rendered over cover_page background via onFirstPage)
story.append(Spacer(1, 50*mm))
cover_title_data = [[
Paragraph("<font color='white'><b>SKIN STRUCTURE</b></font>",
ParagraphStyle("ct1", fontSize=36, fontName="Helvetica-Bold",
alignment=TA_CENTER, leading=42, textColor=colors.white)),
]]
ct = Table(cover_title_data, colWidths=[175*mm])
ct.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),colors.transparent)]))
story.append(ct)
story.append(sp(2))
cover_sub_data = [[
Paragraph("<font color='#A8D8EA'>& FUNCTIONS</font>",
ParagraphStyle("ct2", fontSize=26, fontName="Helvetica-Bold",
alignment=TA_CENTER, leading=32, textColor=colors.HexColor("#A8D8EA"))),
]]
cs = Table(cover_sub_data, colWidths=[175*mm])
cs.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),colors.transparent)]))
story.append(cs)
story.append(sp(6))
# Big decorative label
badge_data = [[
Paragraph("<font color='white'><b>STUDY GUIDE</b></font>",
ParagraphStyle("badge", fontSize=14, fontName="Helvetica-Bold",
alignment=TA_CENTER, textColor=colors.white))
]]
badge = Table(badge_data, colWidths=[60*mm])
badge.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), ACCENT),
("BOX",(0,0),(-1,-1),2,colors.white),
("TOPPADDING",(0,0),(-1,-1),6),
("BOTTOMPADDING",(0,0),(-1,-1),6),
("ALIGN",(0,0),(-1,-1),"CENTER"),
]))
story.append(Table([[badge]], colWidths=[175*mm],
style=[("ALIGN",(0,0),(-1,-1),"CENTER")]))
story.append(sp(8))
# Skin diagram on cover
if os.path.exists(img_path):
img = Image(img_path, width=130*mm, height=75*mm)
story.append(Table([[img]], colWidths=[175*mm],
style=[("ALIGN",(0,0),(-1,-1),"CENTER")]))
story.append(sp(6))
story.append(Paragraph(
"<font color='#CCCCCC'>Anatomy · Histology · Physiology · Clinical Relevance</font>",
ParagraphStyle("footer_cover", fontSize=11, fontName="Helvetica",
alignment=TA_CENTER, textColor=colors.HexColor("#CCCCCC"))))
story.append(Paragraph(
"<font color='#888888'>Sources: Histology: A Text & Atlas (Ross & Pawlina, 8th Ed.) | Junqueira's Basic Histology, 17e | Fitzpatrick's Dermatology, 9e</font>",
ParagraphStyle("sources_cover", fontSize=8, fontName="Helvetica",
alignment=TA_CENTER, textColor=colors.HexColor("#888888"),
spaceBefore=4)))
story.append(PageBreak())
# ════════════════════════════════════════════
# PAGE 2 — OVERVIEW
# ════════════════════════════════════════════
story.append(heading_band("🧬 Overview: What is Skin?"))
story.append(sp(3))
story.append(Paragraph(
"Skin (integument) is the <b>largest organ</b> of the human body. It forms a continuous outer covering "
"that separates the internal environment from the external world. The total surface area of adult skin "
"is approximately <b>1.5–2.0 m²</b>, and it accounts for about <b>15% of total body weight</b>.",
body))
story.append(sp(2))
# 3-layer summary table
story.append(sub_heading("The Three Main Layers"))
story.append(sp(2))
layer_data = [
["Layer", "Also Called", "Composition", "Depth"],
["Epidermis", "Outer skin", "Stratified squamous keratinized epithelium", "0.05–1.5 mm"],
["Dermis", "True skin", "Dense irregular connective tissue", "1–4 mm"],
["Hypodermis","Subcutaneous / superficial fascia", "Loose CT + adipose tissue", "Variable"],
]
lt = Table(layer_data, colWidths=[35*mm, 38*mm, 72*mm, 30*mm])
lt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TABLE_HDR),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, TABLE_ALT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(lt)
story.append(sp(4))
story.append(info_box(
"💡 Key Fact",
"The epidermis has NO blood vessels — it gets all its oxygen and nutrients by diffusion from "
"capillaries in the dermal papillae just below it.",
bg=YELLOW_HL))
story.append(sp(4))
# Functions overview table
story.append(sub_heading("Key Functions of the Skin"))
story.append(sp(2))
func_data = [
["Function", "Mechanism"],
["Protection", "Keratin barrier, melanin (UV shield), Langerhans cells (immune)"],
["Sensation", "Free nerve endings, Meissner, Pacinian, Ruffini, Merkel corpuscles"],
["Thermoregulation", "Eccrine sweating, vasodilation/constriction, subcutaneous fat insulation"],
["Vitamin D synthesis","UV light converts 7-dehydrocholesterol → Vitamin D3 in keratinocytes"],
["Waterproofing", "Lamellar body lipids in stratum granulosum form permeability barrier"],
["Excretion", "Sweat removes urea, salts, and excess electrolytes"],
["Immunity", "Langerhans cells (APCs), dermal dendritic cells, T-resident memory cells"],
["Sexual signaling", "Pigmentation, hair, apocrine pheromones act as visual/chemical signals"],
]
ft = Table(func_data, colWidths=[52*mm, 123*mm])
ft.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TABLE_HDR),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, TABLE_ALT]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("FONTNAME", (0,0), (0,-1), "Helvetica-Bold"),
]))
story.append(ft)
story.append(PageBreak())
# ════════════════════════════════════════════
# PAGE 3 — EPIDERMIS
# ════════════════════════════════════════════
story.append(heading_band("Layer 1: The Epidermis", bg=colors.HexColor("#5C4033")))
story.append(sp(3))
story.append(Paragraph(
"The epidermis is the outermost, avascular layer composed primarily of <b>keratinocytes (85%)</b> "
"that undergo continuous differentiation from base to surface. Total epidermal turnover time is "
"approximately <b>47 days</b>. Thickness varies from <b>0.05 mm</b> on eyelids to <b>1.5 mm</b> on palms and soles.",
body))
story.append(sp(3))
story.append(sub_heading("The 4 (or 5) Strata of the Epidermis", bg=colors.HexColor("#8B5E3C")))
story.append(sp(3))
strata_data = [
["Stratum", "Nickname", "Key Features", "Mnemonic"],
["Stratum Basale\n(deepest)", "Germinative layer",
"• Single row of cuboidal/columnar cells\n• Mitotically active (stem cells)\n• Contains melanocytes\n• Attached by hemidesmosomes to basement membrane",
"BASE = Birth of cells"],
["Stratum Spinosum", "Spiny layer",
"• Several layers of polygonal keratinocytes\n• Connected by desmosomes at spine-like processes\n• Langerhans cells reside here\n• Keratin filaments (tonofilaments) visible",
"SPINY = Strength"],
["Stratum Granulosum", "Granular layer",
"• 3–5 layers of flattened cells\n• Keratohyalin granules (filaggrin precursor)\n• Lamellar bodies → lipid waterproof barrier\n• Cells begin to die here",
"GRAINS = Going away"],
["Stratum Lucidum\n(thick skin only)", "Clear layer",
"• Only in thick skin (palms, soles)\n• Translucent, dead cells\n• Filled with eleidin (pre-keratin)",
"LUCID = Looks clear"],
["Stratum Corneum\n(outermost)", "Horny layer",
"• 15–20 layers of dead, anucleate cells\n• Packed with hard keratin\n• Constantly desquamating\n• Main barrier to environment",
"CORNEUM = Corny tough skin"],
]
st = Table(strata_data, colWidths=[34*mm, 30*mm, 75*mm, 36*mm])
st.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#8B5E3C")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, colors.HexColor("#FFF5EE")]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(st)
story.append(sp(4))
story.append(info_box(
"🔑 Memory Trick — Layers from deep to superficial:",
"\"<b>Baby Skin Grows Like Crazy</b>\" → Basale · Spinosum · Granulosum · Lucidum · Corneum",
bg=colors.HexColor("#E8F4FD")))
story.append(sp(4))
# Special cells
story.append(sub_heading("Special Cells of the Epidermis", bg=colors.HexColor("#8B5E3C")))
story.append(sp(2))
cell_data = [
["Cell Type", "%", "Location", "Function"],
["Keratinocytes", "~85%", "All layers", "Produce keratin; form structural/barrier layers"],
["Melanocytes", "~5%", "Stratum basale", "Produce melanin → UV protection; donate pigment to keratinocytes"],
["Langerhans cells", "2–5%", "Stratum spinosum","Antigen-presenting cells (APCs); immune surveillance"],
["Merkel cells", "6–10%","Stratum basale", "Mechanoreceptors for fine touch; associated with nerve endings"],
]
ct2 = Table(cell_data, colWidths=[38*mm, 14*mm, 38*mm, 85*mm])
ct2.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#8B5E3C")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, colors.HexColor("#FFF5EE")]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(ct2)
story.append(PageBreak())
# ════════════════════════════════════════════
# PAGE 4 — DERMIS
# ════════════════════════════════════════════
story.append(heading_band("Layer 2: The Dermis", bg=colors.HexColor("#1B4332")))
story.append(sp(3))
story.append(Paragraph(
"The dermis is the thick middle layer of connective tissue that gives skin its <b>strength, "
"elasticity, and flexibility</b>. It is composed primarily of <b>type I collagen</b> (the most "
"abundant protein), elastic fibers, and ground substance. The dermis is <b>1–4 mm thick</b> and "
"houses blood vessels, lymphatics, nerves, and skin appendages.",
body))
story.append(sp(3))
story.append(sub_heading("Two Layers of the Dermis", bg=colors.HexColor("#2D6A4F")))
story.append(sp(2))
dermis_data = [
["Feature", "Papillary Layer (upper)", "Reticular Layer (lower)"],
["Composition", "Loose connective tissue", "Dense irregular connective tissue"],
["Collagen", "Type I + III (thin fibers)", "Type I (thick bundles)"],
["Blood vessels", "Rich capillary plexus", "Larger arteries and veins"],
["Nerve endings", "Meissner corpuscles, free endings", "Pacinian, Ruffini corpuscles"],
["Special feature", "Dermal papillae (fingerprints!)", "Sebaceous glands, hair follicles"],
["Primary function", "Nourish epidermis, fine sensation", "Structural strength, elasticity"],
]
dt = Table(dermis_data, colWidths=[42*mm, 66*mm, 67*mm])
dt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#2D6A4F")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("TEXTCOLOR", (0,1), (0,-1), colors.HexColor("#1B4332")),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, colors.HexColor("#D8F3DC")]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(dt)
story.append(sp(4))
story.append(sub_heading("Sensory Receptors in the Skin", bg=colors.HexColor("#2D6A4F")))
story.append(sp(2))
receptor_data = [
["Receptor", "Location", "Detects", "Type"],
["Free nerve endings", "Epidermis", "Pain, heat, cold, itch", "Non-encapsulated"],
["Merkel corpuscles", "Dermo-epidermal jxn","Sustained pressure, texture","Non-encapsulated"],
["Meissner corpuscles", "Dermal papillae", "Light touch, 2-pt discrimination","Encapsulated"],
["Pacinian corpuscles", "Deep dermis / hypodermis","Deep pressure, vibration","Encapsulated"],
["Ruffini corpuscles", "Deep dermis", "Skin stretch and torque", "Encapsulated"],
]
rt = Table(receptor_data, colWidths=[45*mm, 40*mm, 55*mm, 35*mm])
rt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#2D6A4F")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, colors.HexColor("#D8F3DC")]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(rt)
story.append(sp(4))
story.append(sub_heading("Immune Cells of the Dermis", bg=colors.HexColor("#2D6A4F")))
story.append(sp(2))
story.append(bullet("<b>Dermal fibroblasts</b> — Express toll-like receptors; produce inflammatory cytokines when they detect pathogens"))
story.append(bullet("<b>Dermal dendritic cells</b> — Present antigens to T-cells; migrate to lymph nodes to initiate immune response"))
story.append(bullet("<b>Resident macrophages</b> — Yolk sac-derived APCs; respond to foreign substances and tissue damage"))
story.append(bullet("<b>T-resident memory (T<sub>rm</sub>) cells</b> — Non-circulating memory T-cells that provide rapid local immunity"))
story.append(PageBreak())
# ════════════════════════════════════════════
# PAGE 5 — HYPODERMIS + APPENDAGES
# ════════════════════════════════════════════
story.append(heading_band("Layer 3: Hypodermis & Skin Appendages", bg=colors.HexColor("#4A235A")))
story.append(sp(3))
story.append(sub_heading("Hypodermis (Subcutaneous Tissue)", bg=colors.HexColor("#6C3483")))
story.append(sp(2))
story.append(Paragraph(
"The hypodermis lies beneath the dermis and connects skin to underlying fascia and muscle. "
"It is <b>not technically part of the skin</b> itself but is functionally inseparable from it.",
body))
story.append(sp(2))
hypo_data = [
["Component", "Function"],
["Adipocytes (fat cells)", "Energy storage, thermal insulation, mechanical cushioning"],
["Areolar connective tissue","Loose framework allowing skin mobility over deep structures"],
["Large blood vessels", "Feed the dermal capillary network"],
["Nerve trunks", "Branch into smaller nerve fibers supplying dermis and epidermis"],
["Pacinian corpuscles","Deep pressure and vibration sensing"],
]
ht = Table(hypo_data, colWidths=[60*mm, 115*mm])
ht.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#6C3483")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, colors.HexColor("#F5EEF8")]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(ht)
story.append(sp(4))
story.append(sub_heading("Skin Appendages", bg=colors.HexColor("#6C3483")))
story.append(sp(3))
appendage_data = [
["Appendage", "Origin", "Structure", "Function"],
["Hair follicle", "Epidermis", "Tube extending into dermis/hypodermis; hair bulb at base with matrix cells","Thermoregulation, sensory, protection; stem cell reservoir"],
["Sebaceous glands","Epidermis", "Acinar glands; secretion via pilosebaceous canal","Produce sebum (holocrine); moisturize hair and skin; antimicrobial"],
["Eccrine sweat\nglands","Epidermis","Coiled tubular; open directly on skin surface","Thermoregulation via evaporative cooling; found all over body"],
["Apocrine sweat\nglands","Epidermis","Coiled tubular; open into hair follicle","Protein-rich secretion; pheromone signaling; limited to axillae, groin"],
["Nails", "Epidermis", "Hard keratin plates; grow from nail root (nail matrix)","Protection of fingertips; fine manipulation"],
["Arrector pili\nmuscle","Dermis", "Smooth muscle attached to hair follicle","Contracts in cold/fear → erects hair → 'goosebumps' (piloerection)"],
]
at = Table(appendage_data, colWidths=[30*mm, 22*mm, 65*mm, 58*mm])
at.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#6C3483")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, colors.HexColor("#F5EEF8")]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(at)
story.append(PageBreak())
# ════════════════════════════════════════════
# PAGE 6 — DIAGRAM + CLINICAL NOTES
# ════════════════════════════════════════════
story.append(heading_band("Skin Diagram + Clinical Relevance", bg=DERM_BLUE))
story.append(sp(3))
if os.path.exists(img_path):
img2 = Image(img_path, width=155*mm, height=92*mm)
story.append(Table([[img2]], colWidths=[175*mm],
style=[("ALIGN",(0,0),(-1,-1),"CENTER")]))
story.append(Paragraph(
"Cross-section of skin showing all three main layers with hair follicles, blood vessels, dermal papillae, "
"sensory receptors, and adipocytes. (Source: Junqueira's Basic Histology, 17e)",
caption_style))
story.append(sp(3))
story.append(sub_heading("Clinical Relevance", bg=ACCENT))
story.append(sp(3))
clinical = [
("Melanoma", "Malignant transformation of melanocytes; excess UV exposure is the main risk factor. "
"ABCDE rule: Asymmetry, Border, Color, Diameter, Evolution."),
("Psoriasis","Rapid epidermal turnover (7 days vs normal 47 days) due to immune-mediated inflammation. "
"Results in thickened, scaly plaques from stratum corneum buildup."),
("Burns", "Classified by depth of skin damage:\n"
"• 1st degree: Epidermis only (sunburn)\n"
"• 2nd degree: Epidermis + partial dermis (blisters)\n"
"• 3rd degree: Full thickness (epidermis + all dermis, may need grafting)"),
("Pressure Ulcers","Prolonged pressure occludes dermal capillaries → ischemia → necrosis, "
"starting deep in the hypodermis and progressing outward."),
("Vitiligo", "Autoimmune destruction of melanocytes → patchy loss of skin pigmentation."),
("Acne Vulgaris","Blockage of pilosebaceous canal by excess sebum + dead keratinocytes + "
"Cutibacterium acnes colonization → follicular inflammation."),
]
for title, text in clinical:
story.append(info_box(title, text, bg=colors.HexColor("#EBF5FB"),
title_color=DERM_BLUE))
story.append(sp(2))
story.append(PageBreak())
# ════════════════════════════════════════════
# PAGE 7 — QUICK REVIEW / FLASHCARD SECTION
# ════════════════════════════════════════════
story.append(heading_band("Quick Review: Key Facts & Q&A", bg=colors.HexColor("#922B21")))
story.append(sp(3))
story.append(sub_heading("Important Numbers to Remember", bg=colors.HexColor("#C0392B")))
story.append(sp(2))
numbers_data = [
["Fact", "Value"],
["Epidermal turnover time", "~47 days"],
["Skin surface area (adult)", "1.5–2.0 m²"],
["% body weight", "~15%"],
["Epidermis thickness (thin skin)", "0.05–0.1 mm"],
["Epidermis thickness (thick skin)", "Up to 1.5 mm"],
["Dermis thickness", "1–4 mm"],
["Keratinocytes % in epidermis", "~85%"],
["Melanocytes % in epidermis", "~5%"],
["Langerhans cells % in epidermis", "2–5%"],
["Merkel cells % in epidermis", "6–10%"],
["UV wavelength (damage range)", "280–320 nm (UVB)"],
]
nt = Table(numbers_data, colWidths=[110*mm, 65*mm])
nt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#C0392B")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 9),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, colors.HexColor("#FDEDEC")]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(nt)
story.append(sp(5))
story.append(sub_heading("Practice Q&A", bg=colors.HexColor("#C0392B")))
story.append(sp(3))
qa = [
("Q1. Which layer of the epidermis forms the main waterproof barrier?",
"A. Stratum granulosum — lamellar bodies release lipids that form the epidermal permeability barrier."),
("Q2. Why does the epidermis have no blood vessels?",
"A. It is avascular; all nutrients diffuse from capillaries in the dermal papillae (papillary dermis)."),
("Q3. What are the functions of melanocytes and where are they located?",
"A. Located in stratum basale; produce melanin in melanosomes and donate it to keratinocytes; "
"melanin acts as a UV shield to protect nuclear DNA."),
("Q4. What is the difference between eccrine and apocrine sweat glands?",
"A. Eccrine: found all over body, open directly on skin surface, produce watery sweat for thermoregulation. "
"Apocrine: found in axillae/groin, open into hair follicles, produce protein-rich secretion involved in signaling."),
("Q5. Name the 5 strata of thick skin from deep to superficial.",
"A. Basale → Spinosum → Granulosum → Lucidum → Corneum. "
"Memory: 'Baby Skin Grows Like Crazy'"),
("Q6. What is the role of dermal papillae?",
"A. Finger-like upward projections of dermis that interdigitate with epidermal ridges, "
"increasing surface area for attachment; contain capillaries and sensory nerve endings; "
"form the basis of fingerprints."),
("Q7. Which receptor detects vibration and deep pressure?",
"A. Pacinian corpuscles (located in deep dermis and hypodermis)."),
("Q8. What is sebum and how is it secreted?",
"A. Sebum is an oily substance produced by sebaceous glands via holocrine secretion "
"(the entire cell breaks down to release its contents); lubricates hair and skin."),
]
for i, (q, a) in enumerate(qa):
qcolor = colors.HexColor("#FDEDEC") if i % 2 == 0 else colors.HexColor("#FFF5F5")
qa_data = [
[Paragraph(q, ParagraphStyle("qp", fontSize=9.5, fontName="Helvetica-Bold",
textColor=colors.HexColor("#922B21"), leading=13))],
[Paragraph(a, ParagraphStyle("ap", fontSize=9, fontName="Helvetica",
textColor=colors.HexColor("#1a1a1a"), leading=13))],
]
qt = Table(qa_data, colWidths=[175*mm])
qt.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), colors.HexColor("#FDEDEC")),
("BACKGROUND", (0,1), (0,1), colors.white),
("BOX", (0,0), (-1,-1), 0.5, colors.HexColor("#CCCCCC")),
("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(qt)
story.append(sp(2))
story.append(PageBreak())
# ════════════════════════════════════════════
# PAGE 8 — SUMMARY TABLE (MASTER OVERVIEW)
# ════════════════════════════════════════════
story.append(heading_band("Master Summary Table", bg=colors.HexColor("#0B3954")))
story.append(sp(3))
master_data = [
["Structure", "Layer", "Cell/Component", "Key Function"],
# Epidermis
["Stratum Basale", "Epidermis", "Keratinocytes, melanocytes, Merkel cells","Cell division, pigment production, touch reception"],
["Stratum Spinosum", "Epidermis", "Keratinocytes, Langerhans cells","Structural strength, immune surveillance"],
["Stratum Granulosum", "Epidermis", "Keratinocytes + lamellar bodies","Waterproofing (lipid barrier), keratinization"],
["Stratum Lucidum", "Epidermis\n(thick skin only)","Dead keratinocytes with eleidin","Transitional clear zone"],
["Stratum Corneum", "Epidermis", "Anucleate keratinocytes (squames)","Main protective barrier, desquamation"],
# Dermis
["Papillary layer", "Dermis", "Loose CT, capillaries, Meissner corpuscles","Nourish epidermis, light touch"],
["Reticular layer", "Dermis", "Dense CT, collagen I, elastic fibers","Strength, elasticity, houses appendages"],
["Dermal papillae", "Dermis", "Capillary loops + nerve endings","Fingerprints, epidermal nutrition"],
# Hypodermis
["Hypodermis", "Subcutaneous", "Adipocytes, loose CT","Insulation, energy, cushioning"],
# Appendages
["Sebaceous gland", "Appendage", "Sebocytes", "Sebum production (holocrine), lubrication"],
["Eccrine sweat gland", "Appendage", "Secretory + ductal cells","Thermoregulation (watery sweat)"],
["Apocrine gland", "Appendage", "Secretory cells", "Pheromone signaling (axillae/groin)"],
["Hair follicle", "Appendage", "Matrix cells, bulge stem cells","Hair formation, stem cell niche"],
["Nail", "Appendage", "Hard keratin plate", "Finger protection, fine manipulation"],
["Arrector pili", "Appendage", "Smooth muscle", "Piloerection (goosebumps)"],
]
mst = Table(master_data, colWidths=[38*mm, 28*mm, 52*mm, 57*mm])
mst.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), colors.HexColor("#0B3954")),
("TEXTCOLOR", (0,0), (-1,0), colors.white),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,-1), 8.5),
("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.white, colors.HexColor("#EBF5FB")]),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#BBBBBB")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 4),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
# Color-code rows by section
("BACKGROUND", (0,1), (-1,5), colors.HexColor("#FFF8F0")), # epidermis
("BACKGROUND", (0,6), (-1,9), colors.HexColor("#F0FAF0")), # dermis
("BACKGROUND", (0,10), (-1,10), colors.HexColor("#FAF0FA")), # hypodermis
("BACKGROUND", (0,11), (-1,-1), colors.HexColor("#F0F0FA")), # appendages
]))
story.append(mst)
story.append(sp(5))
story.append(Paragraph(
"<b>Color coding:</b> "
"<font color='#A0522D'>■</font> Epidermis "
"<font color='#2D6A4F'>■</font> Dermis "
"<font color='#6C3483'>■</font> Hypodermis "
"<font color='#2E4057'>■</font> Appendages",
ParagraphStyle("legend", fontSize=9, fontName="Helvetica",
alignment=TA_CENTER, textColor=colors.HexColor("#555555"))))
story.append(sp(5))
story.append(hr())
story.append(sp(2))
story.append(Paragraph(
"<i>Sources: Histology: A Text & Atlas (Ross & Pawlina, 8th Ed.) | "
"Junqueira's Basic Histology, 17e | Fitzpatrick's Dermatology, 9th Ed. | "
"Campbell-Walsh-Wein Urology, 12e</i>",
ParagraphStyle("bib", fontSize=8, fontName="Helvetica-Oblique",
alignment=TA_CENTER, textColor=colors.grey)))
# ── Build PDF ────────────────────────────────────────────────────
def on_first_page(c, doc):
w, h = A4
c.saveState()
c.setFillColor(DERM_BLUE)
c.rect(0, 0, w, h, fill=1, stroke=0)
c.setFillColor(ACCENT)
c.rect(0, h*0.38, w, 8, fill=1, stroke=0)
c.setFillColor(SKIN_TAN)
c.rect(0, h*0.38-10, w, 4, fill=1, stroke=0)
c.restoreState()
def on_later_pages(c, doc):
w, h = A4
c.saveState()
# Header bar
c.setFillColor(DERM_BLUE)
c.rect(0, h-15*mm, w, 15*mm, fill=1, stroke=0)
c.setFillColor(colors.white)
c.setFont("Helvetica-Bold", 9)
c.drawString(18*mm, h-9*mm, "SKIN STRUCTURE & FUNCTIONS — STUDY GUIDE")
c.setFont("Helvetica", 9)
c.drawRightString(w-18*mm, h-9*mm, f"Page {doc.page}")
# Footer bar
c.setFillColor(colors.HexColor("#EEEEEE"))
c.rect(0, 0, w, 10*mm, fill=1, stroke=0)
c.setFillColor(colors.HexColor("#888888"))
c.setFont("Helvetica", 7)
c.drawCentredString(w/2, 3.5*mm,
"Sources: Histology: A Text & Atlas (Ross & Pawlina, 8e) | Junqueira's Basic Histology, 17e | Fitzpatrick's Dermatology, 9e")
c.restoreState()
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
topMargin=20*mm, bottomMargin=15*mm,
leftMargin=17*mm, rightMargin=17*mm,
title="Skin Structure & Functions Study Guide",
author="Orris Medical"
)
doc.build(story,
onFirstPage=on_first_page,
onLaterPages=on_later_pages)
print(f"PDF created: {OUTPUT}")
cd /home/daytona/workspace/skin-study-guide && python3 generate_pdf.py 2>&1
ls -lh /home/daytona/workspace/skin-study-guide/Skin_Structure_Study_Guide.pdf
Skin Structure Study Guide
PDF Document · PDF
| Page | Content |
|---|---|
| 1 - Cover | Title page with the full skin cross-section diagram |
| 2 - Overview | What skin is, the 3-layer summary table, 8 key functions table |
| 3 - Epidermis | All 5 strata with features + mnemonic, special cells table (melanocytes, Langerhans, Merkel) |
| 4 - Dermis | Papillary vs reticular layer comparison, sensory receptors table, immune cells |
| 5 - Hypodermis & Appendages | Hypodermis components, all 6 appendages (hair, sebaceous, eccrine, apocrine, nails, arrector pili) |
| 6 - Diagram + Clinical | Labeled skin diagram, 6 clinical conditions (melanoma, psoriasis, burns, acne, vitiligo, pressure ulcers) |
| 7 - Quick Review Q&A | Key numbers table + 8 practice questions with full answers |
| 8 - Master Summary | Color-coded mega-table covering every structure, layer, cell, and function |
rough diagram of pituitary gland
Rough hand-drawn style anatomical diagram of the pituitary gland (hypophysis) showing: anterior lobe (adenohypophysis) and posterior lobe (neurohypophysis), pars tuberalis, pars intermedia, infundibulum/pituitary stalk connecting to hypothalamus, optic chiasm above, sella turcica bony cavity, labeled arrows pointing to each part, simple sketch style with clear labels
400, message: Got more than 4194304 bytes when reading: b'data: {"candidates": [{"content": {"role": "model","parts": [{"inlineData": {"mimeType": "image/png"...'.
We encountered an error while processing your request. Please try again or reach out to us for help.