Antior triangle posterior triangle and digastric triangle detailed with diagrams in pdf ans shld be likedireclty wirrentn in anatomy rguhs exam
posterior triangle of neck boundaries and contents diagram
digastric submandibular triangle neck diagram
mkdir -p /tmp/workspace/neck-triangles/assets /tmp/workspace/neck-triangles/output && cd /tmp/workspace/neck-triangles/assets && curl -sL -o anterior_triangle.png "https://cdn.orris.care/cdss_images/c5e47c08b627b3edb056e749cd886481513041a5cb28a98ebac87503b8c71791.png" && curl -sL -o posterior_triangle.png "https://cdn.orris.care/cdss_images/a5ebf3226cf9b0142a3ee16dbbcb8515172fd2c7fefcd97086678b406fa1e430.png" && curl -sL -o digastric_triangle.png "https://cdn.orris.care/cdss_images/789313e0e9909214fc41edf27ad7ab4f83c5dd25650ac86c6cc176f648a259dc.png" && ls -la
~/neck-triangles/build_pdf.py
"""
Build an exam-oriented PDF note on:
1. Anterior Triangle of the Neck
2. Posterior Triangle of the Neck
3. Digastric (Submandibular) Triangle
Formatted for direct write-up in an Anatomy (RGUHS) exam answer.
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm, mm
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Image,
Table, TableStyle, ListFlowable, ListItem, PageBreak, HRFlowable)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY, TA_LEFT
import os
ASSETS = "/tmp/workspace/neck-triangles/assets"
OUT = "/tmp/workspace/neck-triangles/output/Triangles_of_Neck_Anatomy_Notes.pdf"
styles = getSampleStyleSheet()
title_style = ParagraphStyle('TitleX', parent=styles['Title'], fontSize=18, spaceAfter=4, textColor=colors.HexColor("#0b3d61"))
subtitle_style = ParagraphStyle('SubtitleX', parent=styles['Normal'], fontSize=10, alignment=TA_CENTER, textColor=colors.grey, spaceAfter=12)
h1 = ParagraphStyle('H1', parent=styles['Heading1'], fontSize=15, textColor=colors.white, backColor=colors.HexColor("#0b3d61"),
spaceBefore=14, spaceAfter=10, leftIndent=6, borderPadding=(6,6,6,6))
h2 = ParagraphStyle('H2', parent=styles['Heading2'], fontSize=12.5, textColor=colors.HexColor("#0b3d61"), spaceBefore=10, spaceAfter=6)
body = ParagraphStyle('BodyX', parent=styles['Normal'], fontSize=10.3, leading=15, alignment=TA_JUSTIFY, spaceAfter=6)
bullet = ParagraphStyle('BulletX', parent=styles['Normal'], fontSize=10.3, leading=14.5, alignment=TA_LEFT, leftIndent=4)
caption = ParagraphStyle('Caption', parent=styles['Normal'], fontSize=9, alignment=TA_CENTER, textColor=colors.HexColor("#444444"), spaceAfter=10, spaceBefore=3, fontName='Helvetica-Oblique')
mnemonic_style = ParagraphStyle('Mnemonic', parent=styles['Normal'], fontSize=10, leading=14, backColor=colors.HexColor("#fff8e1"),
borderColor=colors.HexColor("#d4a017"), borderWidth=0.7, borderPadding=8, spaceBefore=6, spaceAfter=10)
def table_style():
return TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor("#0b3d61")),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 9),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#999999")),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor("#eef4fa")]),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
])
def bullets(items):
return ListFlowable(
[ListItem(Paragraph(i, bullet), leftIndent=10, bulletColor=colors.HexColor("#0b3d61")) for i in items],
bulletType='bullet', start='circle', leftIndent=14, spaceBefore=2, spaceAfter=8
)
def img(path, max_w=14*cm, max_h=8*cm):
from PIL import Image as PILImage
with PILImage.open(path) as im:
w, h = im.size
ratio = min(max_w/w, max_h/h)
return Image(path, width=w*ratio, height=h*ratio, hAlign='CENTER')
story = []
# ---------- Title ----------
story.append(Paragraph("Triangles of the Neck", title_style))
story.append(Paragraph("Anterior Triangle • Posterior Triangle • Digastric (Submandibular) Triangle — Anatomy Exam Notes (RGUHS format)", subtitle_style))
story.append(HRFlowable(width="100%", thickness=1.2, color=colors.HexColor("#0b3d61"), spaceAfter=10))
# ================= 1. ANTERIOR TRIANGLE =================
story.append(Paragraph("1. ANTERIOR TRIANGLE OF THE NECK", h1))
story.append(Paragraph("Definition", h2))
story.append(Paragraph(
"The anterior triangle is a paired region on either side of the neck, situated in front of the sternocleidomastoid (SCM) muscle. "
"It is one of the two major triangles into which the SCM divides each half of the neck (the other being the posterior triangle).", body))
story.append(Paragraph("Boundaries", h2))
story.append(bullets([
"<b>Anterior (medial):</b> Midline of the neck (from chin to suprasternal notch).",
"<b>Posterior (lateral):</b> Anterior border of the sternocleidomastoid muscle.",
"<b>Superior (base):</b> Inferior border (lower border) of the body of the mandible, continued by an imaginary line to the mastoid process.",
"<b>Apex:</b> Manubrium sterni (sternal notch).",
"<b>Roof:</b> Skin, superficial fascia with platysma, deep fascia (investing layer).",
"<b>Floor:</b> Formed by the pharynx, larynx and thyroid gland covered by pretracheal fascia.",
]))
story.append(img(os.path.join(ASSETS, "anterior_triangle.png")))
story.append(Paragraph("Fig. 1 – Borders and subdivisions of the anterior triangle of the neck.", caption))
story.append(Paragraph("Subdivision (Digastric & Omohyoid muscles divide it into 4 smaller triangles)", h2))
story.append(Paragraph(
"The anterior belly of digastric, posterior belly of digastric, and superior belly of omohyoid subdivide each anterior triangle into four smaller triangles:", body))
data = [
["Sub-triangle", "Boundaries", "Important Contents"],
["Submental triangle\n(unpaired, midline)",
"Superiorly: mandibular symphysis\nLaterally (both sides): anterior belly of digastric\nBase (inferior): body of hyoid bone",
"Submental lymph nodes; small veins uniting to form anterior jugular vein"],
["Submandibular (Digastric) triangle\n(paired) – see Section 3",
"Superiorly: lower border of mandible\nAnteroinferior: anterior belly of digastric\nPosteroinferior: posterior belly of digastric",
"Submandibular salivary gland, submandibular lymph nodes, facial artery & vein, hypoglossal (XII) nerve, mylohyoid nerve"],
["Carotid triangle\n(paired)",
"Superoposterior: posterior belly of digastric & stylohyoid\nAnteroinferior: superior belly of omohyoid\nPosterior: anterior border of sternocleidomastoid",
"Common carotid artery & its bifurcation, internal & external carotid arteries, internal jugular vein, vagus (X), accessory (XI), hypoglossal (XII) nerves, superior root of ansa cervicalis"],
["Muscular triangle\n(paired)",
"Superolateral: superior belly of omohyoid\nInferolateral: anterior border of sternocleidomastoid\nMedial: midline of neck",
"Infrahyoid (strap) muscles - sternohyoid, sternothyroid, thyrohyoid; thyroid & parathyroid glands; pharynx, larynx, trachea, oesophagus"],
]
tbl_data = [[Paragraph(c, ParagraphStyle('c', parent=bullet, fontSize=8.7, leading=11.5)) for c in row] for row in data]
t = Table(tbl_data, colWidths=[4.0*cm, 6.0*cm, 6.3*cm], repeatRows=1)
t.setStyle(table_style())
story.append(t)
story.append(Spacer(1, 8))
story.append(Paragraph("Applied Anatomy", h2))
story.append(bullets([
"The carotid triangle is the surgical landmark for exposing the carotid sheath and its contents (e.g., carotid endarterectomy, carotid body tumour excision).",
"Carotid pulse is best palpated in the carotid triangle against the carotid tubercle of C6 vertebra.",
"Tracheostomy is performed through the muscular triangle in the midline below the isthmus of thyroid.",
"Ludwig's angina (cellulitis of floor of mouth) can track into the submandibular and submental triangles.",
]))
story.append(PageBreak())
# ================= 2. POSTERIOR TRIANGLE =================
story.append(Paragraph("2. POSTERIOR TRIANGLE OF THE NECK", h1))
story.append(Paragraph("Definition", h2))
story.append(Paragraph(
"The posterior triangle is a paired region on the lateral aspect of the neck, lying behind the sternocleidomastoid and in continuity "
"with the axilla/upper limb region; it transmits structures passing between the neck and the upper limb.", body))
story.append(Paragraph("Boundaries", h2))
story.append(bullets([
"<b>Anterior:</b> Posterior border of sternocleidomastoid muscle.",
"<b>Posterior:</b> Anterior border of trapezius muscle.",
"<b>Base (inferior):</b> Middle one-third of the clavicle.",
"<b>Apex (superior):</b> Meeting point of sternocleidomastoid and trapezius on the superior nuchal line, just posterior to the mastoid process.",
"<b>Roof:</b> Investing layer of deep cervical fascia, superficial fascia, platysma and skin.",
"<b>Floor:</b> Prevertebral fascia covering (from above down) splenius capitis, levator scapulae, and posterior, middle & anterior scalene muscles.",
]))
story.append(img(os.path.join(ASSETS, "posterior_triangle.png")))
story.append(Paragraph("Fig. 2 – Borders of the posterior triangle of the neck.", caption))
story.append(Paragraph("Subdivision", h2))
story.append(Paragraph(
"The inferior belly of omohyoid crosses the triangle obliquely and divides it into two parts:", body))
story.append(bullets([
"<b>Occipital triangle</b> (large, upper part) – bounded by SCM, trapezius and omohyoid.",
"<b>Supraclavicular / Subclavian (omoclavicular) triangle</b> (small, lower part) – bounded by omohyoid, SCM and clavicle; floor here is the 1st rib, related to the subclavian artery.",
]))
story.append(Paragraph("Contents", h2))
data2 = [
["Category", "Structures"],
["Muscles", "Inferior belly of omohyoid; parts of splenius capitis, levator scapulae, scalenus medius & posterior (floor)"],
["Nerves", "Accessory nerve (XI) – crosses obliquely, most commonly injured here; cutaneous branches of cervical plexus (lesser occipital, great auricular, transverse cervical, supraclavicular) emerging near Erb's point; trunks of the brachial plexus (upper part); phrenic nerve (on scalenus anterior, at the base); spinal nerve roots C3-C4 (phrenic contribution)"],
["Arteries", "Third part of subclavian artery (near base); transverse cervical & suprascapular arteries; occipital artery (near apex)"],
["Veins", "External jugular vein (draining into subclavian vein); transverse cervical & suprascapular veins"],
["Others", "Lower part of the external jugular vein; supraclavicular (level V) lymph nodes; lower part of the accessory (spinal) part of cervical lymphatics; cervical dome of pleura and apex of lung (in subclavian triangle, at risk in supraclavicular approaches)"],
]
tbl2 = [[Paragraph(c, ParagraphStyle('c2', parent=bullet, fontSize=8.7, leading=11.5)) for c in row] for row in data2]
t2 = Table(tbl2, colWidths=[3.0*cm, 13.3*cm], repeatRows=1)
t2.setStyle(table_style())
story.append(t2)
story.append(Spacer(1, 8))
story.append(Paragraph("Applied Anatomy", h2))
story.append(bullets([
"Erb's point (junction of posterior border of SCM with the great auricular nerve, ~2-3 cm above clavicle) is a key surface landmark; the accessory nerve runs about 1 cm above it - vulnerable during lymph node biopsy causing trapezius palsy (shoulder drop, winging of scapula).",
"Cervical rib or scalenus anterior syndrome can compress the subclavian artery/lower trunk of brachial plexus at the base of the triangle (thoracic outlet syndrome).",
"The posterior triangle is a common site for lymph node biopsy (level V nodes) and for supraclavicular brachial plexus block.",
"Pancoast's tumour (apex of lung) may present with signs referable to structures at the base of this triangle.",
]))
story.append(PageBreak())
# ================= 3. DIGASTRIC / SUBMANDIBULAR TRIANGLE =================
story.append(Paragraph("3. DIGASTRIC (SUBMANDIBULAR) TRIANGLE", h1))
story.append(Paragraph("Definition", h2))
story.append(Paragraph(
"The submandibular triangle is the largest and most important subdivision of the anterior triangle of the neck. "
"It is also called the <b>digastric triangle</b> because it lies between the two bellies of the digastric muscle.", body))
story.append(Paragraph("Boundaries", h2))
story.append(bullets([
"<b>Superior (base):</b> Inferior (lower) border of the body of the mandible, continued behind by a line to the mastoid process.",
"<b>Anteroinferior:</b> Anterior belly of digastric muscle.",
"<b>Posteroinferior:</b> Posterior belly of digastric muscle and stylohyoid muscle.",
"<b>Apex:</b> Behind, at the point where the two bellies of digastric are attached (near mastoid process).",
"<b>Roof:</b> Skin, superficial fascia with platysma, deep fascia; crossed by the marginal mandibular and cervical branches of the facial nerve.",
"<b>Floor (deep to gland):</b> Formed by mylohyoid anteriorly and hyoglossus + part of superior constrictor posteriorly.",
]))
story.append(img(os.path.join(ASSETS, "digastric_triangle.png")))
story.append(Paragraph("Fig. 3 – The submandibular (digastric) triangle and its contents.", caption))
story.append(Paragraph("Contents", h2))
story.append(bullets([
"<b>Submandibular salivary gland</b> – superficial part fills most of the triangle (deep part lies in the floor of the mouth).",
"<b>Submandibular lymph nodes</b> (Level Ib) – lie along the gland and facial vessels.",
"<b>Facial artery</b> – grooves the deep surface of the gland and emerges over the lower border of the mandible.",
"<b>Facial (anterior facial) vein</b> – lies superficial to the gland.",
"<b>Hypoglossal nerve (XII)</b> – deep, along the floor, superficial to hyoglossus.",
"<b>Mylohyoid nerve and vessels</b> – run on the outer surface of mylohyoid.",
"<b>Nerve to mylohyoid, submandibular ganglion</b> (near deep part of gland).",
"Part of the <b>lingual artery</b> may be encountered deep to the gland (deep to hyoglossus).",
]))
story.append(Paragraph("Applied Anatomy", h2))
story.append(bullets([
"<b>Submandibular sialadenitis / sialolithiasis:</b> Calculi commonly lodge in Wharton's duct causing painful swelling, worse on eating (\"mealtime syndrome\").",
"<b>Submandibular gland excision:</b> The marginal mandibular branch of the facial nerve (in the roof, superficial) is at risk - injury causes drooping of the angle of the mouth. The lingual nerve (superiorly, related to the deep part of the gland) and hypoglossal nerve (inferiorly) are also at risk during surgery.",
"The triangle is an important site for tuberculous cervical lymphadenitis (scrofula) presenting as submandibular lymph node enlargement.",
"Ludwig's angina (acute cellulitis of the floor of the mouth) frequently originates from infected lower molar teeth and spreads into this triangle, causing life-threatening airway compromise.",
]))
story.append(Paragraph("Quick Recall - Digastric Triangle", h2))
story.append(Paragraph(
"<b>Mnemonic for contents (superficial to deep):</b> \"<i>Vein, Gland, Nerve, Artery</i>\" — "
"Facial <b>V</b>ein (superficial) → Submandibular <b>G</b>land (fills triangle) → Hypoglossal <b>N</b>erve (deep, on floor) → Facial <b>A</b>rtery (grooves the gland, deep to it before emerging superficially over the mandible).",
mnemonic_style))
story.append(HRFlowable(width="100%", thickness=0.8, color=colors.HexColor("#999999"), spaceBefore=10, spaceAfter=6))
story.append(Paragraph(
"<i>Source: Gray's Anatomy for Students (anterior & posterior triangle of neck) and Scott-Brown's Otorhinolaryngology "
"Head & Neck Surgery (submandibular/digastric triangle) – compiled as concise exam-ready notes.</i>",
ParagraphStyle('foot', parent=styles['Normal'], fontSize=8, textColor=colors.grey)))
doc = SimpleDocTemplate(OUT, pagesize=A4,
leftMargin=1.6*cm, rightMargin=1.6*cm, topMargin=1.4*cm, bottomMargin=1.4*cm,
title="Triangles of the Neck - Anatomy Notes")
doc.build(story)
print("PDF built at:", OUT)
cd /tmp/workspace/neck-triangles && python3 build_pdf.py
cd /tmp/workspace/neck-triangles/output && ls -la && python3 -c " from pypdf import PdfReader r = PdfReader('Triangles_of_Neck_Anatomy_Notes.pdf') print('Pages:', len(r.pages)) "
Triangles of Neck Anatomy Notes
PDF Document · PDF
T M J detailed with diagrams in pdf ans shld be likedireclty wirrentn in anatomy rguhs exam
temporomandibular joint anatomy diagram articular disc ligaments
temporomandibular joint movements protrusion depression diagram
temporomandibular joint lateral view sagittal section

A composite clinical diagnostic image showing three specialized CT scan views (a, b, and c) of the mandibular condyle, illustrating a standardized evaluation approach for temporomandibular joint (TMJ) osteoarthritis. Frame (a) demonstrates a coronal CT view with the condylar head divided into three medio-lateral zones: medial (M), central (C), and lateral (L). Frame (b) shows a sagittal CT view dividing the condyle into three antero-posterior zones: anterior (A), middle (M), and posterior (P). Frame (c) presents an axial or superior view demonstrating a nine-section grid used to calculate the Destructive Change Index (DCI). The grid labels correspond to anatomical orientations: AM (antero-medial), AC (antero-central), AL (antero-lateral), MM (mid-medial), MC (mid-central), ML (mid-lateral), PM (postero-medial), PC (postero-central), and PL (postero-lateral). This methodology facilitates the objective quantification of osseous destruction, such as erosion and subchondral cysts, in patients with TMJ disorders.

Diagnostic imaging composite showcasing multiplanar reconstructions (MPR) of a human skull derived from Cone Beam Computed Tomography (CBCT). View A is a 3D volume rendering displaying a lateral perspective of the craniofacial skeleton, including the mandible and cervical vertebrae, with the Porion (PoR) cephalometric landmark marked by a red point. View B presents an axial section at the level of the skull base, showing the sphenoid sinuses, nasal cavity, and petrous part of the temporal bones. View C is a coronal reconstruction showing the craniovertebral junction and mastoid processes. View D is a sagittal section demonstrating the temporomandibular joint area and the profile of the facial soft tissues. In views B, C, and D, the PoR landmark is precisely localized at the intersection of orthodontic crosshairs, specifically identifying the most superior point of the external auditory meatus. This visualization is used in dental and maxillofacial surgery for cephalometric analysis, symmetry assessment, and surgical planning.

Postoperative cone beam computed tomography (CBCT) images of the maxillofacial region in a patient following a surgical condylectomy of the right mandible. Panel A displays a coronal section illustrating the absence of the right medial pole of the mandibular condyle. The surgical site exhibits smooth, well-defined bony margins (indicated by an arrow) with no evidence of irregular calcification or sequestration, suggesting healthy bone remodeling and wound healing. Panel B presents a three-dimensional sagittal reconstruction of the skull, providing a lateral view of the temporomandibular joint (TMJ) area. The 3D rendering (indicated by an arrow) confirms the anatomical alteration following the excision of the fractured condylar head, demonstrating the postoperative gap between the mandibular ramus and the glenoid fossa. These images are used in oral and maxillofacial surgery to evaluate the results of surgical intervention for condylar fractures and to monitor the long-term integrity of the joint space and mandibular function.
mkdir -p /tmp/workspace/tmj/assets /tmp/workspace/tmj/output && cd /tmp/workspace/tmj/assets && curl -sL -o tmj_disc.png "https://cdn.orris.care/cdss_images/2965798de181dda343be7c0ffb2c1bda6ff520e6848bc075f93df78e7c1d1992.png" && ls -la
Labeled anatomical diagram of the temporomandibular joint (TMJ) region of the skull in lateral view, showing the lateral (temporomandibular) ligament, sphenomandibular ligament, and stylomandibular ligament connecting the temporal bone, styloid process, sphenoid spine, and mandible, for a medical anatomy textbook
cd /tmp/workspace/tmj/assets && curl -sL -o tmj_ligaments.png "https://cdn.orris.care/image-gen/c504628b9a164d8e811fd62c4d522709.png" && ls -la
~/tmj/build_pdf.py
"""
TMJ (Temporomandibular Joint) - exam-ready anatomy notes with diagrams.
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Image,
Table, TableStyle, ListFlowable, ListItem, PageBreak, HRFlowable)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY, TA_LEFT
import os
ASSETS = "/tmp/workspace/tmj/assets"
OUT = "/tmp/workspace/tmj/output/TMJ_Anatomy_Notes.pdf"
styles = getSampleStyleSheet()
title_style = ParagraphStyle('TitleX', parent=styles['Title'], fontSize=18, spaceAfter=4, textColor=colors.HexColor("#0b3d61"))
subtitle_style = ParagraphStyle('SubtitleX', parent=styles['Normal'], fontSize=10, alignment=TA_CENTER, textColor=colors.grey, spaceAfter=12)
h1 = ParagraphStyle('H1', parent=styles['Heading1'], fontSize=15, textColor=colors.white, backColor=colors.HexColor("#0b3d61"),
spaceBefore=14, spaceAfter=10, leftIndent=6, borderPadding=(6,6,6,6))
h2 = ParagraphStyle('H2', parent=styles['Heading2'], fontSize=12.5, textColor=colors.HexColor("#0b3d61"), spaceBefore=10, spaceAfter=6)
body = ParagraphStyle('BodyX', parent=styles['Normal'], fontSize=10.3, leading=15, alignment=TA_JUSTIFY, spaceAfter=6)
bullet = ParagraphStyle('BulletX', parent=styles['Normal'], fontSize=10.3, leading=14.5, alignment=TA_LEFT, leftIndent=4)
caption = ParagraphStyle('Caption', parent=styles['Normal'], fontSize=9, alignment=TA_CENTER, textColor=colors.HexColor("#444444"), spaceAfter=10, spaceBefore=3, fontName='Helvetica-Oblique')
mnemonic_style = ParagraphStyle('Mnemonic', parent=styles['Normal'], fontSize=10, leading=14, backColor=colors.HexColor("#fff8e1"),
borderColor=colors.HexColor("#d4a017"), borderWidth=0.7, borderPadding=8, spaceBefore=6, spaceAfter=10)
def table_style():
return TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor("#0b3d61")),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 9),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#999999")),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor("#eef4fa")]),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
])
def bullets(items):
return ListFlowable(
[ListItem(Paragraph(i, bullet), leftIndent=10, bulletColor=colors.HexColor("#0b3d61")) for i in items],
bulletType='bullet', start='circle', leftIndent=14, spaceBefore=2, spaceAfter=8
)
def img(path, max_w=13.5*cm, max_h=8*cm):
from PIL import Image as PILImage
with PILImage.open(path) as im:
w, h = im.size
ratio = min(max_w/w, max_h/h)
return Image(path, width=w*ratio, height=h*ratio, hAlign='CENTER')
story = []
story.append(Paragraph("Temporomandibular Joint (TMJ)", title_style))
story.append(Paragraph("Anatomy Exam Notes (RGUHS format) — with labeled diagrams", subtitle_style))
story.append(HRFlowable(width="100%", thickness=1.2, color=colors.HexColor("#0b3d61"), spaceAfter=10))
story.append(Paragraph("Introduction / Type of Joint", h2))
story.append(Paragraph(
"The temporomandibular joint (TMJ), also called the craniomandibular joint, is a <b>synovial joint</b> of the "
"<b>condylar (ellipsoid) variety</b>, formed between the <b>mandibular fossa (glenoid fossa) and articular tubercle of the "
"temporal bone</b> above, and the <b>head (condyle) of the mandible</b> below. It is unique among synovial joints of the body because:", body))
story.append(bullets([
"The joint cavity is divided into <b>upper and lower compartments</b> by an intra-articular fibrocartilaginous disc.",
"The articular surfaces are covered by <b>dense fibrous tissue</b>, not hyaline cartilage (reflecting its intramembranous developmental origin).",
"A secondary (adaptive) condylar cartilage is present in the head of the condyle until adolescence.",
"It is a <b>bilateral joint</b> - both sides must move together, and movements are guided by the occlusion of the teeth.",
]))
story.append(Paragraph("Articular Surfaces", h2))
story.append(bullets([
"<b>Above:</b> Mandibular (glenoid) fossa of the squamous temporal bone and the articular tubercle (eminence) in front of it.",
"<b>Below:</b> Head (condyle) of the mandible - its anterior and superior surfaces are the true articular surfaces.",
"The condyle joins the ramus of mandible through the <b>neck of the condyle</b> - a common site of mandibular fracture; the <b>pterygoid fovea</b> on its anterior surface gives attachment to the lateral pterygoid muscle.",
]))
story.append(Paragraph("Articular Disc (Meniscus)", h2))
story.append(Paragraph(
"A dense fibrous, oval disc interposed between the condyle and the mandibular fossa, dividing the joint into an "
"<b>upper (meniscotemporal) compartment</b> - permitting gliding/translatory movement, and a <b>lower (meniscocondylar) "
"compartment</b> - permitting hinge/rotatory movement.", body))
story.append(bullets([
"In sagittal section the disc is concavo-convex above and concave below, moulding itself to both bony surfaces (self-centring mechanism).",
"Anteriorly it blends with the joint capsule and receives fibres of the superior head of lateral pterygoid.",
"Posteriorly it continues as the loose, vascular <b>bilaminar (retrodiscal) zone</b>: a vascular, elastic <b>superior lamina</b> attaching to the squamotympanic fissure, and a relatively avascular <b>inferior lamina</b> attaching to the back of the condyle.",
"The central zone of the disc is thinnest and avascular; only its periphery is vascularised.",
]))
story.append(img(os.path.join(ASSETS, "tmj_disc.png")))
story.append(Paragraph("Fig. 1 – Sagittal section of the TMJ showing the articular disc and lateral pterygoid attachment. "
"A: articular eminence; B: articular disc; C: mandibular fossa; D: condyle; E: superior (bilaminar) lamina; "
"F: inferior lamina; G: joint capsule; H: lateral pterygoid muscle.", caption))
story.append(Paragraph("Joint Capsule and Synovial Membrane", h2))
story.append(bullets([
"Attached above to the margins of the mandibular fossa (in front, up to the articular tubercle; behind, to the squamotympanic/petrotympanic fissures) and below to the neck of the condyle.",
"A thin, loose capsule that does not itself restrict movement or provide much mechanical support.",
"Lined internally by <b>synovial membrane</b> which is reflected onto the disc margins (forming separate synovial linings for the upper and lower cavities) but does not cover the load-bearing articular surfaces.",
"Synovial fluid (rich in proteoglycans) lubricates the joint; intra-articular pressure rises sharply during mastication.",
]))
story.append(PageBreak())
story.append(Paragraph("Ligaments of the TMJ", h2))
data = [
["Ligament", "Attachments", "Function"],
["Lateral (Temporomandibular) ligament\n(main/true ligament)",
"Articular tubercle -> lateral surface & posterior border of neck of condyle",
"Main ligament limiting excessive lateral/backward movement of the condyle; blends with the capsule"],
["Sphenomandibular ligament\n(accessory)",
"Spine of sphenoid -> lingula of mandible",
"Remnant of 1st (Meckel's) pharyngeal arch cartilage; slack when jaw closed, taut during protrusion"],
["Stylomandibular ligament\n(accessory)",
"Tip of styloid process & stylohyoid ligament -> angle of mandible",
"Thickened band of deep cervical fascia; limits excessive protrusion/opening; separates parotid from submandibular gland"],
["Pterygomandibular raphe",
"Pterygoid hamulus -> posterior end of mylohyoid line",
"Gives origin to buccinator (front) and superior constrictor (behind); not a true ligament of movement"],
]
tbl = [[Paragraph(c, ParagraphStyle('c', parent=bullet, fontSize=8.7, leading=11.5)) for c in row] for row in data]
t = Table(tbl, colWidths=[4.3*cm, 6.0*cm, 6.0*cm], repeatRows=1)
t.setStyle(table_style())
story.append(t)
story.append(Spacer(1, 6))
story.append(img(os.path.join(ASSETS, "tmj_ligaments.png"), max_h=7.5*cm))
story.append(Paragraph("Fig. 2 – Ligaments of the TMJ - lateral (temporomandibular), sphenomandibular and stylomandibular ligaments (schematic).", caption))
story.append(Paragraph("Movements at the TMJ", h2))
story.append(bullets([
"<b>Depression (opening):</b> Initial rotation of condyle around a transverse axis in the lower compartment, followed by forward gliding (translation) of condyle + disc down the articular eminence in the upper compartment.",
"<b>Elevation (closing):</b> Reverse of depression.",
"<b>Protrusion:</b> Condyle and disc glide forward together onto the articular eminence (upper compartment); muscles - lateral & medial pterygoids (bilaterally).",
"<b>Retrusion:</b> Condyle and disc glide backward to the mandibular fossa; muscles - posterior fibres of temporalis.",
"<b>Lateral (side-to-side) movements (chewing/grinding):</b> On one side the condyle rotates near its resting position (grinding side); on the opposite side the condyle glides forward and medially (Bennett movement) - produced by pterygoids of one side and temporalis of the other.",
"<b>Muscles of mastication</b> producing these movements: masseter, temporalis, medial and lateral pterygoids (elevation, protrusion, retrusion, and lateral excursion); digastric, geniohyoid and mylohyoid assist depression when hyoid is fixed.",
]))
story.append(Paragraph("Nerve Supply", h2))
story.append(Paragraph(
"Branches of the <b>mandibular nerve (V3)</b>: mainly the <b>auriculotemporal nerve</b>, with contributions from the "
"<b>masseteric</b> and <b>deep temporal</b> nerves. Rich proprioceptive endings are important for the reflex control of mastication.", body))
story.append(Paragraph("Blood Supply", h2))
story.append(Paragraph(
"Chiefly from the <b>superficial temporal artery</b> and the <b>maxillary artery</b> (anterior tympanic and deep auricular branches), "
"with additional contributions from the deep temporal and transverse facial arteries.", body))
story.append(Paragraph("Relations", h2))
story.append(bullets([
"<b>Superiorly:</b> Middle cranial fossa (temporal lobe of brain), separated by a thin plate of the squamous temporal bone; middle meningeal vessels lie close by.",
"<b>Anteriorly:</b> Infratemporal fossa - lateral pterygoid muscle attaches to the disc/capsule and pterygoid fovea of the condyle.",
"<b>Posteriorly:</b> External acoustic meatus and tympanic plate; parotid gland lies immediately behind and below the joint (explains referred otalgia in TMJ disease).",
"<b>Medially:</b> Maxillary artery and auriculotemporal nerve as they pass toward the infratemporal region; sphenomandibular ligament.",
"<b>Laterally:</b> Parotid gland and temporal branches of the facial nerve~/tmj/build_pdf.py
"""
TMJ (Temporomandibular Joint) - exam-ready anatomy notes with diagrams.
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Image,
Table, TableStyle, ListFlowable, ListItem, PageBreak, HRFlowable)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY, TA_LEFT
import os
ASSETS = "/tmp/workspace/tmj/assets"
OUT = "/tmp/workspace/tmj/output/TMJ_Anatomy_Notes.pdf"
styles = getSampleStyleSheet()
title_style = ParagraphStyle('TitleX', parent=styles['Title'], fontSize=18, spaceAfter=4, textColor=colors.HexColor("#0b3d61"))
subtitle_style = ParagraphStyle('SubtitleX', parent=styles['Normal'], fontSize=10, alignment=TA_CENTER, textColor=colors.grey, spaceAfter=12)
h1 = ParagraphStyle('H1', parent=styles['Heading1'], fontSize=15, textColor=colors.white, backColor=colors.HexColor("#0b3d61"),
spaceBefore=14, spaceAfter=10, leftIndent=6, borderPadding=(6,6,6,6))
h2 = ParagraphStyle('H2', parent=styles['Heading2'], fontSize=12.5, textColor=colors.HexColor("#0b3d61"), spaceBefore=10, spaceAfter=6)
body = ParagraphStyle('BodyX', parent=styles['Normal'], fontSize=10.3, leading=15, alignment=TA_JUSTIFY, spaceAfter=6)
bullet = ParagraphStyle('BulletX', parent=styles['Normal'], fontSize=10.3, leading=14.5, alignment=TA_LEFT, leftIndent=4)
caption = ParagraphStyle('Caption', parent=styles['Normal'], fontSize=9, alignment=TA_CENTER, textColor=colors.HexColor("#444444"), spaceAfter=10, spaceBefore=3, fontName='Helvetica-Oblique')
mnemonic_style = ParagraphStyle('Mnemonic', parent=styles['Normal'], fontSize=10, leading=14, backColor=colors.HexColor("#fff8e1"),
borderColor=colors.HexColor("#d4a017"), borderWidth=0.7, borderPadding=8, spaceBefore=6, spaceAfter=10)
def table_style():
return TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor("#0b3d61")),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 9),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#999999")),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor("#eef4fa")]),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
])
def bullets(items):
return ListFlowable(
[ListItem(Paragraph(i, bullet), leftIndent=10, bulletColor=colors.HexColor("#0b3d61")) for i in items],
bulletType='bullet', start='circle', leftIndent=14, spaceBefore=2, spaceAfter=8
)
def img(path, max_w=13.5*cm, max_h=8*cm):
from PIL import Image as PILImage
with PILImage.open(path) as im:
w, h = im.size
ratio = min(max_w/w, max_h/h)
return Image(path, width=w*ratio, height=h*ratio, hAlign='CENTER')
story = []
story.append(Paragraph("Temporomandibular Joint (TMJ)", title_style))
story.append(Paragraph("Anatomy Exam Notes (RGUHS format) — with labeled diagrams", subtitle_style))
story.append(HRFlowable(width="100%", thickness=1.2, color=colors.HexColor("#0b3d61"), spaceAfter=10))
story.append(Paragraph("Introduction / Type of Joint", h2))
story.append(Paragraph(
"The temporomandibular joint (TMJ), also called the craniomandibular joint, is a <b>synovial joint</b> of the "
"<b>condylar (ellipsoid) variety</b>, formed between the <b>mandibular fossa (glenoid fossa) and articular tubercle of the "
"temporal bone</b> above, and the <b>head (condyle) of the mandible</b> below. It is unique among synovial joints of the body because:", body))
story.append(bullets([
"The joint cavity is divided into <b>upper and lower compartments</b> by an intra-articular fibrocartilaginous disc.",
"The articular surfaces are covered by <b>dense fibrous tissue</b>, not hyaline cartilage (reflecting its intramembranous developmental origin).",
"A secondary (adaptive) condylar cartilage is present in the head of the condyle until adolescence.",
"It is a <b>bilateral joint</b> - both sides must move together, and movements are guided by the occlusion of the teeth.",
]))
story.append(Paragraph("Articular Surfaces", h2))
story.append(bullets([
"<b>Above:</b> Mandibular (glenoid) fossa of the squamous temporal bone and the articular tubercle (eminence) in front of it.",
"<b>Below:</b> Head (condyle) of the mandible - its anterior and superior surfaces are the true articular surfaces.",
"The condyle joins the ramus of mandible through the <b>neck of the condyle</b> - a common site of mandibular fracture; the <b>pterygoid fovea</b> on its anterior surface gives attachment to the lateral pterygoid muscle.",
]))
story.append(Paragraph("Articular Disc (Meniscus)", h2))
story.append(Paragraph(
"A dense fibrous, oval disc interposed between the condyle and the mandibular fossa, dividing the joint into an "
"<b>upper (meniscotemporal) compartment</b> - permitting gliding/translatory movement, and a <b>lower (meniscocondylar) "
"compartment</b> - permitting hinge/rotatory movement.", body))
story.append(bullets([
"In sagittal section the disc is concavo-convex above and concave below, moulding itself to both bony surfaces (self-centring mechanism).",
"Anteriorly it blends with the joint capsule and receives fibres of the superior head of lateral pterygoid.",
"Posteriorly it continues as the loose, vascular <b>bilaminar (retrodiscal) zone</b>: a vascular, elastic <b>superior lamina</b> attaching to the squamotympanic fissure, and a relatively avascular <b>inferior lamina</b> attaching to the back of the condyle.",
"The central zone of the disc is thinnest and avascular; only its periphery is vascularised.",
]))
story.append(img(os.path.join(ASSETS, "tmj_disc.png")))
story.append(Paragraph("Fig. 1 – Sagittal section of the TMJ showing the articular disc and lateral pterygoid attachment. "
"A: articular eminence; B: articular disc; C: mandibular fossa; D: condyle; E: superior (bilaminar) lamina; "
"F: inferior lamina; G: joint capsule; H: lateral pterygoid muscle.", caption))
story.append(Paragraph("Joint Capsule and Synovial Membrane", h2))
story.append(bullets([
"Attached above to the margins of the mandibular fossa (in front, up to the articular tubercle; behind, to the squamotympanic/petrotympanic fissures) and below to the neck of the condyle.",
"A thin, loose capsule that does not itself restrict movement or provide much mechanical support.",
"Lined internally by <b>synovial membrane</b> which is reflected onto the disc margins (forming separate synovial linings for the upper and lower cavities) but does not cover the load-bearing articular surfaces.",
"Synovial fluid (rich in proteoglycans) lubricates the joint; intra-articular pressure rises sharply during mastication.",
]))
story.append(PageBreak())
story.append(Paragraph("Ligaments of the TMJ", h2))
data = [
["Ligament", "Attachments", "Function"],
["Lateral (Temporomandibular) ligament\n(main/true ligament)",
"Articular tubercle to lateral surface & posterior border of neck of condyle",
"Main ligament limiting excessive lateral/backward movement of the condyle; blends with the capsule"],
["Sphenomandibular ligament\n(accessory)",
"Spine of sphenoid to lingula of mandible",
"Remnant of 1st (Meckel's) pharyngeal arch cartilage; slack when jaw closed, taut during protrusion"],
["Stylomandibular ligament\n(accessory)",
"Tip of styloid process & stylohyoid ligament to angle of mandible",
"Thickened band of deep cervical fascia; limits excessive protrusion/opening; separates parotid from submandibular gland"],
["Pterygomandibular raphe",
"Pterygoid hamulus to posterior end of mylohyoid line",
"Gives origin to buccinator (front) and superior constrictor (behind); not a true ligament of movement"],
]
tbl = [[Paragraph(c, ParagraphStyle('c', parent=bullet, fontSize=8.7, leading=11.5)) for c in row] for row in data]
t = Table(tbl, colWidths=[4.3*cm, 6.0*cm, 6.0*cm], repeatRows=1)
t.setStyle(table_style())
story.append(t)
story.append(Spacer(1, 6))
story.append(img(os.path.join(ASSETS, "tmj_ligaments.png"), max_h=7.5*cm))
story.append(Paragraph("Fig. 2 – Ligaments of the TMJ - lateral (temporomandibular), sphenomandibular and stylomandibular ligaments (schematic).", caption))
story.append(Paragraph("Movements at the TMJ", h2))
story.append(bullets([
"<b>Depression (opening):</b> Initial rotation of condyle around a transverse axis in the lower compartment, followed by forward gliding (translation) of condyle + disc down the articular eminence in the upper compartment.",
"<b>Elevation (closing):</b> Reverse of depression.",
"<b>Protrusion:</b> Condyle and disc glide forward together onto the articular eminence (upper compartment); muscles - lateral & medial pterygoids (bilaterally).",
"<b>Retrusion:</b> Condyle and disc glide backward to the mandibular fossa; muscles - posterior fibres of temporalis.",
"<b>Lateral (side-to-side) movements (chewing/grinding):</b> On one side the condyle rotates near its resting position (grinding side); on the opposite side the condyle glides forward and medially (Bennett movement) - produced by pterygoids of one side and temporalis of the other.",
"<b>Muscles of mastication</b> producing these movements: masseter, temporalis, medial and lateral pterygoids (elevation, protrusion, retrusion, and lateral excursion); digastric, geniohyoid and mylohyoid assist depression when hyoid is fixed.",
]))
story.append(Paragraph("Nerve Supply", h2))
story.append(Paragraph(
"Branches of the <b>mandibular nerve (V3)</b>: mainly the <b>auriculotemporal nerve</b>, with contributions from the "
"<b>masseteric</b> and <b>deep temporal</b> nerves. Rich proprioceptive endings are important for the reflex control of mastication.", body))
story.append(Paragraph("Blood Supply", h2))
story.append(Paragraph(
"Chiefly from the <b>superficial temporal artery</b> and the <b>maxillary artery</b> (anterior tympanic and deep auricular branches), "
"with additional contributions from the deep temporal and transverse facial arteries.", body))
story.append(Paragraph("Relations", h2))
story.append(bullets([
"<b>Superiorly:</b> Middle cranial fossa (temporal lobe of brain), separated by a thin plate of the squamous temporal bone; middle meningeal vessels lie close by.",
"<b>Anteriorly:</b> Infratemporal fossa - lateral pterygoid muscle attaches to the disc/capsule and pterygoid fovea of the condyle.",
"<b>Posteriorly:</b> External acoustic meatus and tympanic plate; parotid gland lies immediately behind and below the joint (explains referred otalgia in TMJ disease).",
"<b>Medially:</b> Maxillary artery and auriculotemporal nerve as they pass toward the infratemporal region; sphenomandibular ligament.",
"<b>Laterally:</b> Parotid gland and temporal branches of the facial nerve crossing superficial to the joint - at risk during TMJ surgery.",
]))
story.append(Paragraph("Applied Anatomy", h2))
story.append(bullets([
"<b>TMJ dislocation:</b> Most commonly anterior dislocation - during wide yawning/laughing the condyle slips forward beyond the articular tubercle and gets locked anterosuperior to it; the mouth remains open and cannot be closed. Reduced by pressing the mandible downward and backward on the molars.",
"<b>TMJ ankylosis:</b> Fibrous or bony fusion of the joint, often following trauma or infection in childhood, leading to restricted mouth opening and micrognathia if occurring before growth is complete.",
"<b>TMJ pain-dysfunction syndrome (myofascial pain / TMD):</b> Presents with pre-auricular pain, clicking sound, and limitation of jaw movement, commonly related to disc displacement or spasm of the muscles of mastication (especially lateral pterygoid).",
"<b>Clicking sound:</b> Due to anterior displacement of the articular disc relative to the condyle (the condyle reduces onto the disc with a click during opening).",
"<b>Referred pain:</b> Close relation to the external acoustic meatus and middle ear explains why TMJ disorders often present as ear pain (otalgia), requiring differentiation from primary ear disease.",
"<b>Arthrocentesis / intra-articular injection</b> is given just below the zygomatic arch, about 1-2 cm in front of the tragus, with the mouth open, to avoid injury to the temporal branch of the facial nerve.",
]))
story.append(Paragraph("Quick Recall - TMJ", h2))
story.append(Paragraph(
"<b>Mnemonic for ligaments:</b> \"<i>Lazy Sphenoids Stay</i>\" — <b>L</b>ateral (main), <b>S</b>phenomandibular and "
"<b>S</b>tylomandibular (accessory) ligaments. <br/><b>Mnemonic for disc compartments:</b> Upper = Gliding (Glenoid side), "
"Lower = Rotation (condylaR side).",
mnemonic_style))
story.append(HRFlowable(width="100%", thickness=0.8, color=colors.HexColor("#999999"), spaceBefore=10, spaceAfter=6))
story.append(Paragraph(
"<i>Source: Scott-Brown's Otorhinolaryngology Head & Neck Surgery (TMJ anatomy, disc, ligaments, innervation and vasculature) "
"compiled with standard descriptive/regional anatomy - condensed as exam-ready notes.</i>",
ParagraphStyle('foot', parent=styles['Normal'], fontSize=8, textColor=colors.grey)))
doc = SimpleDocTemplate(OUT, pagesize=A4,
leftMargin=1.6*cm, rightMargin=1.6*cm, topMargin=1.4*cm, bottomMargin=1.4*cm,
title="TMJ - Anatomy Notes")
doc.build(story)
print("PDF built at:", OUT)
rm -f /tmp/workspace/tmj/build_pdf.py && echo done
~/tmj/build_pdf.py
"""
TMJ (Temporomandibular Joint) - exam-ready anatomy notes with diagrams.
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Image,
Table, TableStyle, ListFlowable, ListItem, PageBreak, HRFlowable)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY, TA_LEFT
import os
ASSETS = "/tmp/workspace/tmj/assets"
OUT = "/tmp/workspace/tmj/output/TMJ_Anatomy_Notes.pdf"
styles = getSampleStyleSheet()
title_style = ParagraphStyle('TitleX', parent=styles['Title'], fontSize=18, spaceAfter=4, textColor=colors.HexColor("#0b3d61"))
subtitle_style = ParagraphStyle('SubtitleX', parent=styles['Normal'], fontSize=10, alignment=TA_CENTER, textColor=colors.grey, spaceAfter=12)
h1 = ParagraphStyle('H1', parent=styles['Heading1'], fontSize=15, textColor=colors.white, backColor=colors.HexColor("#0b3d61"),
spaceBefore=14, spaceAfter=10, leftIndent=6, borderPadding=(6,6,6,6))
h2 = ParagraphStyle('H2', parent=styles['Heading2'], fontSize=12.5, textColor=colors.HexColor("#0b3d61"), spaceBefore=10, spaceAfter=6)
body = ParagraphStyle('BodyX', parent=styles['Normal'], fontSize=10.3, leading=15, alignment=TA_JUSTIFY, spaceAfter=6)
bullet = ParagraphStyle('BulletX', parent=styles['Normal'], fontSize=10.3, leading=14.5, alignment=TA_LEFT, leftIndent=4)
caption = ParagraphStyle('Caption', parent=styles['Normal'], fontSize=9, alignment=TA_CENTER, textColor=colors.HexColor("#444444"), spaceAfter=10, spaceBefore=3, fontName='Helvetica-Oblique')
mnemonic_style = ParagraphStyle('Mnemonic', parent=styles['Normal'], fontSize=10, leading=14, backColor=colors.HexColor("#fff8e1"),
borderColor=colors.HexColor("#d4a017"), borderWidth=0.7, borderPadding=8, spaceBefore=6, spaceAfter=10)
def table_style():
return TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor("#0b3d61")),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 9),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#999999")),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor("#eef4fa")]),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
])
def bullets(items):
return ListFlowable(
[ListItem(Paragraph(i, bullet), leftIndent=10, bulletColor=colors.HexColor("#0b3d61")) for i in items],
bulletType='bullet', start='circle', leftIndent=14, spaceBefore=2, spaceAfter=8
)
def img(path, max_w=13.5*cm, max_h=8*cm):
from PIL import Image as PILImage
with PILImage.open(path) as im:
w, h = im.size
ratio = min(max_w/w, max_h/h)
return Image(path, width=w*ratio, height=h*ratio, hAlign='CENTER')
story = []
story.append(Paragraph("Temporomandibular Joint (TMJ)", title_style))
story.append(Paragraph("Anatomy Exam Notes (RGUHS format) — with labeled diagrams", subtitle_style))
story.append(HRFlowable(width="100%", thickness=1.2, color=colors.HexColor("#0b3d61"), spaceAfter=10))
story.append(Paragraph("Introduction / Type of Joint", h2))
story.append(Paragraph(
"The temporomandibular joint (TMJ), also called the craniomandibular joint, is a <b>synovial joint</b> of the "
"<b>condylar (ellipsoid) variety</b>, formed between the <b>mandibular fossa (glenoid fossa) and articular tubercle of the "
"temporal bone</b> above, and the <b>head (condyle) of the mandible</b> below. It is unique among synovial joints of the body because:", body))
story.append(bullets([
"The joint cavity is divided into <b>upper and lower compartments</b> by an intra-articular fibrocartilaginous disc.",
"The articular surfaces are covered by <b>dense fibrous tissue</b>, not hyaline cartilage (reflecting its intramembranous developmental origin).",
"A secondary (adaptive) condylar cartilage is present in the head of the condyle until adolescence.",
"It is a <b>bilateral joint</b> - both sides must move together, and movements are guided by the occlusion of the teeth.",
]))
story.append(Paragraph("Articular Surfaces", h2))
story.append(bullets([
"<b>Above:</b> Mandibular (glenoid) fossa of the squamous temporal bone and the articular tubercle (eminence) in front of it.",
"<b>Below:</b> Head (condyle) of the mandible - its anterior and superior surfaces are the true articular surfaces.",
"The condyle joins the ramus of mandible through the <b>neck of the condyle</b> - a common site of mandibular fracture; the <b>pterygoid fovea</b> on its anterior surface gives attachment to the lateral pterygoid muscle.",
]))
story.append(Paragraph("Articular Disc (Meniscus)", h2))
story.append(Paragraph(
"A dense fibrous, oval disc interposed between the condyle and the mandibular fossa, dividing the joint into an "
"<b>upper (meniscotemporal) compartment</b> - permitting gliding/translatory movement, and a <b>lower (meniscocondylar) "
"compartment</b> - permitting hinge/rotatory movement.", body))
story.append(bullets([
"In sagittal section the disc is concavo-convex above and concave below, moulding itself to both bony surfaces (self-centring mechanism).",
"Anteriorly it blends with the joint capsule and receives fibres of the superior head of lateral pterygoid.",
"Posteriorly it continues as the loose, vascular <b>bilaminar (retrodiscal) zone</b>: a vascular, elastic <b>superior lamina</b> attaching to the squamotympanic fissure, and a relatively avascular <b>inferior lamina</b> attaching to the back of the condyle.",
"The central zone of the disc is thinnest and avascular; only its periphery is vascularised.",
]))
story.append(img(os.path.join(ASSETS, "tmj_disc.png")))
story.append(Paragraph("Fig. 1 – Sagittal section of the TMJ showing the articular disc and lateral pterygoid attachment. "
"A: articular eminence; B: articular disc; C: mandibular fossa; D: condyle; E: superior (bilaminar) lamina; "
"F: inferior lamina; G: joint capsule; H: lateral pterygoid muscle.", caption))
story.append(Paragraph("Joint Capsule and Synovial Membrane", h2))
story.append(bullets([
"Attached above to the margins of the mandibular fossa (in front, up to the articular tubercle; behind, to the squamotympanic/petrotympanic fissures) and below to the neck of the condyle.",
"A thin, loose capsule that does not itself restrict movement or provide much mechanical support.",
"Lined internally by <b>synovial membrane</b> which is reflected onto the disc margins (forming separate synovial linings for the upper and lower cavities) but does not cover the load-bearing articular surfaces.",
"Synovial fluid (rich in proteoglycans) lubricates the joint; intra-articular pressure rises sharply during mastication.",
]))
story.append(PageBreak())
story.append(Paragraph("Ligaments of the TMJ", h2))
data = [
["Ligament", "Attachments", "Function"],
["Lateral (Temporomandibular) ligament\n(main/true ligament)",
"Articular tubercle to lateral surface & posterior border of neck of condyle",
"Main ligament limiting excessive lateral/backward movement of the condyle; blends with the capsule"],
["Sphenomandibular ligament\n(accessory)",
"Spine of sphenoid to lingula of mandible",
"Remnant of 1st (Meckel's) pharyngeal arch cartilage; slack when jaw closed, taut during protrusion"],
["Stylomandibular ligament\n(accessory)",
"Tip of styloid process & stylohyoid ligament to angle of mandible",
"Thickened band of deep cervical fascia; limits excessive protrusion/opening; separates parotid from submandibular gland"],
["Pterygomandibular raphe",
"Pterygoid hamulus to posterior end of mylohyoid line",
"Gives origin to buccinator (front) and superior constrictor (behind); not a true ligament of movement"],
]
tbl = [[Paragraph(c, ParagraphStyle('c', parent=bullet, fontSize=8.7, leading=11.5)) for c in row] for row in data]
t = Table(tbl, colWidths=[4.3*cm, 6.0*cm, 6.0*cm], repeatRows=1)
t.setStyle(table_style())
story.append(t)
story.append(Spacer(1, 6))
story.append(img(os.path.join(ASSETS, "tmj_ligaments.png"), max_h=7.5*cm))
story.append(Paragraph("Fig. 2 – Ligaments of the TMJ - lateral (temporomandibular), sphenomandibular and stylomandibular ligaments (schematic).", caption))
story.append(Paragraph("Movements at the TMJ", h2))
story.append(bullets([
"<b>Depression (opening):</b> Initial rotation of condyle around a transverse axis in the lower compartment, followed by forward gliding (translation) of condyle + disc down the articular eminence in the upper compartment.",
"<b>Elevation (closing):</b> Reverse of depression.",
"<b>Protrusion:</b> Condyle and disc glide forward together onto the articular eminence (upper compartment); muscles - lateral & medial pterygoids (bilaterally).",
"<b>Retrusion:</b> Condyle and disc glide backward to the mandibular fossa; muscles - posterior fibres of temporalis.",
"<b>Lateral (side-to-side) movements (chewing/grinding):</b> On one side the condyle rotates near its resting position (grinding side); on the opposite side the condyle glides forward and medially (Bennett movement) - produced by pterygoids of one side and temporalis of the other.",
"<b>Muscles of mastication</b> producing these movements: masseter, temporalis, medial and lateral pterygoids (elevation, protrusion, retrusion, and lateral excursion); digastric, geniohyoid and mylohyoid assist depression when hyoid is fixed.",
]))
story.append(Paragraph("Nerve Supply", h2))
story.append(Paragraph(
"Branches of the <b>mandibular nerve (V3)</b>: mainly the <b>auriculotemporal nerve</b>, with contributions from the "
"<b>masseteric</b> and <b>deep temporal</b> nerves. Rich proprioceptive endings are important for the reflex control of mastication.", body))
story.append(Paragraph("Blood Supply", h2))
story.append(Paragraph(
"Chiefly from the <b>superficial temporal artery</b> and the <b>maxillary artery</b> (anterior tympanic and deep auricular branches), "
"with additional contributions from the deep temporal and transverse facial arteries.", body))
story.append(Paragraph("Relations", h2))
story.append(bullets([
"<b>Superiorly:</b> Middle cranial fossa (temporal lobe of brain), separated by a thin plate of the squamous temporal bone; middle meningeal vessels lie close by.",
"<b>Anteriorly:</b> Infratemporal fossa - lateral pterygoid muscle attaches to the disc/capsule and pterygoid fovea of the condyle.",
"<b>Posteriorly:</b> External acoustic meatus and tympanic plate; parotid gland lies immediately behind and below the joint (explains referred otalgia in TMJ disease).",
"<b>Medially:</b> Maxillary artery and auriculotemporal nerve as they pass toward the infratemporal region; sphenomandibular ligament.",
"<b>Laterally:</b> Parotid gland and temporal branches of the facial nerve crossing superficial to the joint - at risk during TMJ surgery.",
]))
story.append(Paragraph("Applied Anatomy", h2))
story.append(bullets([
"<b>TMJ dislocation:</b> Most commonly anterior dislocation - during wide yawning/laughing the condyle slips forward beyond the articular tubercle and gets locked anterosuperior to it; the mouth remains open and cannot be closed. Reduced by pressing the mandible downward and backward on the molars.",
"<b>TMJ ankylosis:</b> Fibrous or bony fusion of the joint, often following trauma or infection in childhood, leading to restricted mouth opening and micrognathia if occurring before growth is complete.",
"<b>TMJ pain-dysfunction syndrome (myofascial pain / TMD):</b> Presents with pre-auricular pain, clicking sound, and limitation of jaw movement, commonly related to disc displacement or spasm of the muscles of mastication (especially lateral pterygoid).",
"<b>Clicking sound:</b> Due to anterior displacement of the articular disc relative to the condyle (the condyle reduces onto the disc with a click during opening).",
"<b>Referred pain:</b> Close relation to the external acoustic meatus and middle ear explains why TMJ disorders often present as ear pain (otalgia), requiring differentiation from primary ear disease.",
"<b>Arthrocentesis / intra-articular injection</b> is given just below the zygomatic arch, about 1-2 cm in front of the tragus, with the mouth open, to avoid injury to the temporal branch of the facial nerve.",
]))
story.append(Paragraph("Quick Recall - TMJ", h2))
story.append(Paragraph(
"<b>Mnemonic for ligaments:</b> \"<i>Lazy Sphenoids Stay</i>\" — <b>L</b>ateral (main), <b>S</b>phenomandibular and "
"<b>S</b>tylomandibular (accessory) ligaments. <br/><b>Mnemonic for disc compartments:</b> Upper = Gliding (Glenoid side), "
"Lower = Rotation (condylaR side).",
mnemonic_style))
story.append(HRFlowable(width="100%", thickness=0.8, color=colors.HexColor("#999999"), spaceBefore=10, spaceAfter=6))
story.append(Paragraph(
"<i>Source: Scott-Brown's Otorhinolaryngology Head & Neck Surgery (TMJ anatomy, disc, ligaments, innervation and vasculature) "
"compiled with standard descriptive/regional anatomy - condensed as exam-ready notes.</i>",
ParagraphStyle('foot', parent=styles['Normal'], fontSize=8, textColor=colors.grey)))
doc = SimpleDocTemplate(OUT, pagesize=A4,
leftMargin=1.6*cm, rightMargin=1.6*cm, topMargin=1.4*cm, bottomMargin=1.4*cm,
title="TMJ - Anatomy Notes")
doc.build(story)
print("PDF built at:", OUT)
cd /tmp/workspace/tmj && python3 build_pdf.py && python3 -c " from pypdf import PdfReader r = PdfReader('output/TMJ_Anatomy_Notes.pdf') print('Pages:', len(r.pages)) "
TMJ Anatomy Notes
PDF Document · PDF
I will give u some topics if neuroanatomy plss give the detalied ans for those question with diagrams And the question are 4th ventrical Circle of villus
I will give u some topics if neuroanatomy plss give the detalied ans in pdf and for those question with diagrams And the question are 4th ventrical Circle of villus
fourth ventricle anatomy diagram floor roof boundaries
circle of Willis diagram arteries base of brain
rhomboid fossa floor of fourth ventricle brainstem dorsal view
cerebral arterial circle anterior communicating posterior communicating artery brain base diagram
mkdir -p /tmp/workspace/neuroanatomy/assets /tmp/workspace/neuroanatomy/output && cd /tmp/workspace/neuroanatomy/assets && \ curl -sL -o csf_flow_ventricles.png "https://cdn.orris.care/cdss_images/BAILY_1760539187820_c32fced6-54a6-459b-9482-51c06453629c.png" && \ curl -sL -o anterior_posterior_circulation.png "https://cdn.orris.care/cdss_images/4f286d93f71dad33e816369a00ae5171ad75b5ffc2d5a09be9185ce277374cfc.png" && \ curl -sL -o circle_of_willis_branches.png "https://cdn.orris.care/cdss_images/7d80760f5370765337ae1b53fdae7df57de5144af4910818ac251c1ba802e1e6.png" && \ ls -la
Detailed labeled anatomical diagram of the floor of the fourth ventricle (rhomboid fossa) as seen from the dorsal view of the brainstem with the cerebellum removed, showing the facial colliculus, striae medullares, vestibular area, hypoglossal trigone, vagal trigone, sulcus limitans, median sulcus, and obex, for a medical anatomy textbook
cd /tmp/workspace/neuroanatomy/assets && curl -sL -o fourth_ventricle_floor.png "https://cdn.orris.care/image-gen/bed03b648f044406b9017a9edb4a53af.png" && ls -la
~/neuroanatomy/build_pdf.py
"""
Neuroanatomy exam notes: 4th Ventricle & Circle of Willis - with diagrams.
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Image,
Table, TableStyle, ListFlowable, ListItem, PageBreak, HRFlowable)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY, TA_LEFT
import os
ASSETS = "/tmp/workspace/neuroanatomy/assets"
OUT = "/tmp/workspace/neuroanatomy/output/Neuroanatomy_4th_Ventricle_Circle_of_Willis.pdf"
styles = getSampleStyleSheet()
title_style = ParagraphStyle('TitleX', parent=styles['Title'], fontSize=18, spaceAfter=4, textColor=colors.HexColor("#5b1a70"))
subtitle_style = ParagraphStyle('SubtitleX', parent=styles['Normal'], fontSize=10, alignment=TA_CENTER, textColor=colors.grey, spaceAfter=12)
h1 = ParagraphStyle('H1', parent=styles['Heading1'], fontSize=15, textColor=colors.white, backColor=colors.HexColor("#5b1a70"),
spaceBefore=14, spaceAfter=10, leftIndent=6, borderPadding=(6,6,6,6))
h2 = ParagraphStyle('H2', parent=styles['Heading2'], fontSize=12.5, textColor=colors.HexColor("#5b1a70"), spaceBefore=10, spaceAfter=6)
body = ParagraphStyle('BodyX', parent=styles['Normal'], fontSize=10.3, leading=15, alignment=TA_JUSTIFY, spaceAfter=6)
bullet = ParagraphStyle('BulletX', parent=styles['Normal'], fontSize=10.3, leading=14.5, alignment=TA_LEFT, leftIndent=4)
caption = ParagraphStyle('Caption', parent=styles['Normal'], fontSize=9, alignment=TA_CENTER, textColor=colors.HexColor("#444444"), spaceAfter=10, spaceBefore=3, fontName='Helvetica-Oblique')
mnemonic_style = ParagraphStyle('Mnemonic', parent=styles['Normal'], fontSize=10, leading=14, backColor=colors.HexColor("#fff8e1"),
borderColor=colors.HexColor("#d4a017"), borderWidth=0.7, borderPadding=8, spaceBefore=6, spaceAfter=10)
def table_style():
return TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor("#5b1a70")),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 9),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#999999")),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor("#f1e9f5")]),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
])
def bullets(items):
return ListFlowable(
[ListItem(Paragraph(i, bullet), leftIndent=10, bulletColor=colors.HexColor("#5b1a70")) for i in items],
bulletType='bullet', start='circle', leftIndent=14, spaceBefore=2, spaceAfter=8
)
def img(path, max_w=13.5*cm, max_h=8*cm):
from PIL import Image as PILImage
with PILImage.open(path) as im:
w, h = im.size
ratio = min(max_w/w, max_h/h)
return Image(path, width=w*ratio, height=h*ratio, hAlign='CENTER')
story = []
story.append(Paragraph("Neuroanatomy Notes", title_style))
story.append(Paragraph("4th Ventricle • Circle of Willis — Anatomy Exam Notes (RGUHS format) with labeled diagrams", subtitle_style))
story.append(HRFlowable(width="100%", thickness=1.2, color=colors.HexColor("#5b1a70"), spaceAfter=10))
# ============ TOPIC 1: FOURTH VENTRICLE ============
story.append(Paragraph("1. FOURTH VENTRICLE", h1))
story.append(Paragraph("Introduction", h2))
story.append(Paragraph(
"The fourth ventricle is a diamond (tent)-shaped cavity of the hindbrain, filled with cerebrospinal fluid (CSF), situated "
"between the pons/medulla oblongata anteriorly and the cerebellum posteriorly. It represents the cavity of the embryonic "
"hindbrain (rhombencephalon) and is continuous above with the cerebral aqueduct (of Sylvius) and below with the central canal "
"of the medulla/spinal cord.", body))
story.append(img(os.path.join(ASSETS, "csf_flow_ventricles.png")))
story.append(Paragraph("Fig. 1 – CSF flow through the ventricular system: lateral ventricles → third ventricle → "
"cerebral aqueduct → fourth ventricle → subarachnoid space.", caption))
story.append(Paragraph("Situation, Shape and Extent", h2))
story.append(bullets([
"Lies in the posterior cranial fossa, dorsal to the pons and upper half of the medulla, ventral to the cerebellum.",
"Roughly a <b>tent/diamond-shaped</b> cavity, widest at the level of the lateral recesses (foramina of Luschka).",
"Extends from the cerebral aqueduct above (apex/roof) to the obex and central canal below (floor tapers to a point).",
]))
story.append(Paragraph("Boundaries", h2))
data1 = [
["Boundary", "Description"],
["Floor (ventral wall)", "Rhomboid fossa - dorsal surfaces of pons (upper triangle) and medulla oblongata (lower triangle)"],
["Roof (dorsal wall)", "Superior part: superior medullary velum + superior cerebellar peduncles (apex directed upward to aqueduct). Inferior part: inferior medullary velum, tela choroidea and nodulus of cerebellum (apex/obex directed downward)"],
["Lateral walls", "Superiorly - superior cerebellar peduncles; Inferiorly - inferior cerebellar peduncles (restiform bodies) and gracile/cuneate tubercles"],
["Lateral recesses", "Extend around the brainstem on each side, opening as the foramen of Luschka (lateral aperture) into the subarachnoid space (cerebellopontine angle)"],
]
tbl1 = [[Paragraph(c, ParagraphStyle('c1', parent=bullet, fontSize=8.7, leading=11.5)) for c in row] for row in data1]
t1 = Table(tbl1, colWidths=[3.6*cm, 12.0*cm], repeatRows=1)
t1.setStyle(table_style())
story.append(t1)
story.append(Spacer(1, 8))
story.append(Paragraph("Floor - Rhomboid Fossa (Key Landmarks)", h2))
story.append(bullets([
"<b>Median sulcus</b> divides the floor into symmetrical halves.",
"<b>Sulcus limitans</b> on each side divides each half into a medial <b>eminence</b> (motor nuclei) and lateral <b>vestibular area</b> (sensory nuclei, containing vestibular nuclei).",
"<b>Facial colliculus</b> - a small swelling in the medial eminence produced by fibres of the facial nerve looping over the abducens nucleus.",
"<b>Striae medullares</b> - transverse fibre bundles crossing the floor at the level of the lateral recesses, marking the pontomedullary junction (arise from arcuate nuclei, cross to enter the cerebellum).",
"<b>Hypoglossal trigone (triangle)</b> - overlies the hypoglossal nucleus; <b>Vagal trigone</b> - overlies the dorsal nucleus of vagus, both in the medullary part of the floor.",
"<b>Area postrema</b> - a chemoreceptor trigger zone near the caudal tip of the fourth ventricle (lacks a complete blood-brain barrier).",
"<b>Obex</b> - the caudal-most point of the floor, at the junction with the central canal of the medulla/spinal cord; an important radiological landmark (e.g., for Chiari malformation).",
]))
story.append(img(os.path.join(ASSETS, "fourth_ventricle_floor.png")))
story.append(Paragraph("Fig. 2 – Floor of the fourth ventricle (rhomboid fossa) - dorsal view of brainstem with cerebellum removed, "
"showing facial colliculus, striae medullares, vestibular area, hypoglossal & vagal trigones, sulcus limitans and obex.", caption))
story.append(PageBreak())
story.append(Paragraph("Communications / Apertures", h2))
story.append(bullets([
"<b>Superiorly:</b> Continues into the cerebral aqueduct (of Sylvius) which connects to the third ventricle.",
"<b>Inferiorly:</b> Continues into the central canal of the caudal medulla and spinal cord.",
"<b>Median aperture (foramen of Magendie):</b> Single midline opening in the roof (inferior medullary velum/tela choroidea) draining CSF into the cisterna magna.",
"<b>Lateral apertures (foramina of Luschka):</b> Paired openings at the ends of the lateral recesses draining CSF into the cerebellopontine angle cistern.",
]))
story.append(Paragraph("Contents", h2))
story.append(bullets([
"CSF.",
"<b>Choroid plexus</b> - a T-shaped/tuft of vascular tela choroidea projecting from the roof, producing CSF; extends into the lateral recesses toward the foramina of Luschka.",
]))
story.append(Paragraph("Relations", h2))
story.append(bullets([
"<b>Anteriorly (floor):</b> Pons and medulla, containing cranial nerve nuclei of V, VI, VII, VIII, IX, X, XII.",
"<b>Posteriorly (roof):</b> Cerebellum (vermis, nodulus).",
"<b>Laterally:</b> Cerebellar peduncles (superior, middle-related, inferior) and cerebellopontine angle structures (via lateral recess).",
]))
story.append(Paragraph("Applied Anatomy", h2))
story.append(bullets([
"<b>Hydrocephalus:</b> Obstruction of the aqueduct or the outlets of the fourth ventricle (Magendie/Luschka) causes non-communicating hydrocephalus with dilatation of the ventricular system proximal to the block.",
"<b>Arnold-Chiari malformation:</b> Downward herniation of cerebellar tonsils and the fourth ventricle/medulla through the foramen magnum, often obstructing CSF flow and causing hydrocephalus.",
"<b>Dandy-Walker malformation:</b> Cystic dilatation of the fourth ventricle with agenesis of the cerebellar vermis and atresia of the foramen of Magendie.",
"<b>Medulloblastoma / Ependymoma:</b> Common posterior fossa tumours of childhood arising in/near the roof of the fourth ventricle, presenting with raised intracranial pressure and obstructive hydrocephalus.",
"<b>\"Wallenberg syndrome\" and brainstem lesions:</b> Nuclei related to the floor (vestibular nuclei, dorsal vagal nucleus, hypoglossal nucleus) can be affected by lesions near the fourth ventricle floor, producing vertigo, dysphagia, and tongue weakness.",
"<b>Area postrema:</b> Being outside the blood-brain barrier, it is stimulated by circulating toxins/drugs, mediating the vomiting (chemoreceptor trigger zone) reflex.",
]))
story.append(Paragraph("Quick Recall - Fourth Ventricle Floor", h2))
story.append(Paragraph(
"<b>Medial to lateral in each half (motor to sensory):</b> Median sulcus → Medial eminence (facial colliculus, hypoglossal & vagal trigones - "
"<i>motor nuclei</i>) → Sulcus limitans → Vestibular area (<i>sensory nuclei</i>). "
"<b>Mnemonic for apertures:</b> \"<i>1 Magendie in the Middle, 2 Luschkas on the Lateral sides</i>\".",
mnemonic_style))
story.append(PageBreak())
# ============ TOPIC 2: CIRCLE OF WILLIS ============
story.append(Paragraph("2. CIRCLE OF WILLIS (CEREBRAL ARTERIAL CIRCLE)", h1))
story.append(Paragraph("Introduction", h2))
story.append(Paragraph(
"The circle of Willis (cerebral arterial circle) is an anastomotic ring of arteries situated at the base of the brain, "
"in the interpeduncular fossa, encircling the optic chiasma, infundibulum and mammillary bodies. It unites the "
"<b>anterior circulation</b> (paired internal carotid arteries) with the <b>posterior circulation</b> (paired vertebral "
"arteries via the basilar artery), providing potential collateral blood flow to the brain.", body))
story.append(img(os.path.join(ASSETS, "anterior_posterior_circulation.png")))
story.append(Paragraph("Fig. 3 – Anterior circulation (from internal carotid arteries) and posterior circulation (from vertebral/basilar arteries) of the brain.", caption))
story.append(Paragraph("Components of the Circle (Arranged Around the Ring)", h2))
data2 = [
["Component (paired unless stated)", "Course / Connects"],
["Anterior cerebral artery (ACA)", "Terminal branch of internal carotid artery (ICA); runs medially, forward"],
["Anterior communicating artery (AComm) - single/unpaired", "Joins the two anterior cerebral arteries across the midline anteriorly"],
["Internal carotid artery (ICA) - terminal part", "Forms the anterolateral part of the circle before dividing into ACA and MCA"],
["Posterior communicating artery (PComm)", "Connects the ICA to the posterior cerebral artery, linking anterior & posterior circulations"],
["Posterior cerebral artery (PCA)", "Terminal branch of the basilar artery; forms the posterior part of the circle"],
["Basilar artery (contributes, lies behind the circle) - single", "Formed by union of the two vertebral arteries; gives off both PCAs"],
]
tbl2 = [[Paragraph(c, ParagraphStyle('c2', parent=bullet, fontSize=8.7, leading=11.5)) for c in row] for row in data2]
t2 = Table(tbl2, colWidths=[6.3*cm, 9.3*cm], repeatRows=1)
t2.setStyle(table_style())
story.append(t2)
story.append(Spacer(1, 6))
story.append(Paragraph(
"The middle cerebral artery (MCA), though the other terminal branch of the ICA, is <b>not part of the ring itself</b> - "
"it runs laterally into the lateral (Sylvian) sulcus and is often called the 'artery of the circle of Willis' because "
"it is most vulnerable to emboli arising from within the circle.", body))
story.append(img(os.path.join(ASSETS, "circle_of_willis_branches.png")))
story.append(Paragraph("Fig. 4 – The circle of Willis and its main branches (ACA, AComm, ICA, PComm, PCA and basilar artery).", caption))
story.append(Paragraph("Relations", h2))
story.append(bullets([
"<b>Anteriorly:</b> Optic chiasma and olfactory tracts.",
"<b>Posteriorly:</b> Interpeduncular fossa, crura cerebri and pons.",
"<b>Laterally:</b> Uncus of temporal lobe, and the oculomotor (III) nerve emerges close to the posterior communicating artery.",
"<b>Superiorly:</b> Hypothalamus (tuber cinereum, infundibulum, mammillary bodies) - surrounded by the circle.",
"<b>Inferiorly:</b> Pituitary gland/sella turcica lies just below and in front, related to the circle via the diaphragma sellae.",
]))
story.append(Paragraph("Branches Arising from the Circle and Its Components", h2))
story.append(bullets([
"<b>Central (perforating) branches</b> - anteromedial, anterolateral, posteromedial and posterolateral groups - pierce the base of the brain to supply the basal ganglia, internal capsule, thalamus, and hypothalamus. These are functional end-arteries with poor collateral supply.",
"<b>Cortical branches</b> - ACA, MCA and PCA supply the cerebral cortex and underlying white matter of their respective territories (frontal/medial surface, lateral surface, occipital/inferior temporal surface respectively).",
]))
story.append(Paragraph("Anatomical Variations", h2))
story.append(Paragraph(
"A complete, uniformly full-calibre circle is found in only about one-third of individuals. Common variations include "
"hypoplastic or absent posterior communicating artery (unilateral or bilateral), hypoplastic Al segment of ACA, "
"duplication or fenestration of vessels, and a fetal-type PCA (arising directly from the ICA rather than the basilar artery).", body))
story.append(Paragraph("Applied Anatomy", h2))
story.append(bullets([
"<b>Berry (saccular) aneurysms</b> most commonly develop at the bifurcation points of the circle of Willis (especially the anterior communicating artery, posterior communicating artery origin, and MCA bifurcation) - the leading cause of spontaneous subarachnoid haemorrhage, presenting as 'worst headache of life'.",
"<b>Collateral circulation:</b> A complete circle allows compensation if one contributing vessel (e.g., ICA) is occluded gradually; an incomplete circle predisposes to watershed infarcts.",
"<b>Third nerve (oculomotor) palsy:</b> A posterior communicating artery aneurysm can compress the oculomotor nerve as it passes nearby, producing a 'surgical' third nerve palsy with early pupillary dilatation (unlike diabetic/'medical' third nerve palsy which spares the pupil).",
"<b>Stroke syndromes:</b> Occlusion of ACA, MCA or PCA (or their perforators) produces distinct clinical syndromes based on the cortical/subcortical territory involved.",
"<b>Watershed infarcts:</b> Occur at boundary zones between ACA-MCA or MCA-PCA territories during systemic hypotension, since these areas depend on distal, less robust collateral flow.",
]))
story.append(Paragraph("Quick Recall - Circle of Willis", h2))
story.append(Paragraph(
"<b>Mnemonic (going around the circle):</b> \"<i>A</i>nterior cerebral - <i>A</i>Comm - <i>I</i>CA - <i>P</i>Comm - <i>P</i>CA - <i>B</i>asilar\" "
"= <b>A-A-I-P-P-B</b> (front to back on each side, joined in the midline by AComm anteriorly and the basilar posteriorly). "
"Most common site of aneurysm = <b>Anterior communicating artery</b>.",
mnemonic_style))
story.append(HRFlowable(width="100%", thickness=0.8, color=colors.HexColor("#999999"), spaceBefore=10, spaceAfter=6))
story.append(Paragraph(
"<i>Source: Gray's Anatomy for Students and Neuroscience: Exploring the Brain (ventricular system/fourth ventricle); "
"Neuroanatomy through Clinical Cases (circle of Willis, anterior & posterior circulations) - compiled as concise exam-ready notes "
"with standard descriptive neuroanatomy for applied correlations.</i>",
ParagraphStyle('foot', parent=styles['Normal'], fontSize=8, textColor=colors.grey)))
doc = SimpleDocTemplate(OUT, pagesize=A4,
leftMargin=1.6*cm, rightMargin=1.6*cm, topMargin=1.4*cm, bottomMargin=1.4*cm,
title="4th Ventricle and Circle of Willis - Neuroanatomy Notes")
doc.build(story)
print("PDF built at:", OUT)
cd /tmp/workspace/neuroanatomy && python3 build_pdf.py && python3 -c " from pypdf import PdfReader r = PdfReader('output/Neuroanatomy_4th_Ventricle_Circle_of_Willis.pdf') print('Pages:', len(r.pages)) "
Neuroanatomy 4th Ventricle Circle of Willis
PDF Document · PDF
diaphragm and mulse of mastication and larynx detailed with diagrams in pdf ans shld be likedireclty wirrentn in anatomy rguhs exam
larynx cartilages diagram thyroid cricoid arytenoid
larynx sagittal section vocal cords cartilages diagram
diaphragm inferior surface abdominal view openings
"TEMPORAL AND INFRATEMPORAL FOSSAE" in /textbooks/9780323934237
Labeled anatomical diagram of the muscles of mastication - temporalis, masseter, medial pterygoid and lateral pterygoid muscles shown on a lateral view of the skull and mandible, for a medical anatomy textbook
Labeled anatomical diagram of the laryngeal cartilages - thyroid cartilage, cricoid cartilage, epiglottis, and paired arytenoid cartilages - shown in posterior and lateral view, for a medical anatomy textbook
mkdir -p /tmp/workspace/diaphragm-mastication-larynx/assets /tmp/workspace/diaphragm-mastication-larynx/output cd /tmp/workspace/diaphragm-mastication-larynx/assets curl -sL -o diaphragm_hernia_sites.png "https://cdn.orris.care/cdss_images/BAILY_1760530385228_a92e5653-8d3e-4ea0-a8e4-0d3ebd91ea8e.png" curl -sL -o mastication_muscles.png "https://cdn.orris.care/image-gen/e5cbe4647a0447a6b6d9fc6efdc740d8.png" curl -sL -o larynx_cartilages.png "https://cdn.orris.care/image-gen/9a403ebd70d0452aac0034f28142e10f.png" curl -sL -o diaphragm_diagram.png "https://cdn.orris.care/cdss_images/dca7fa09f27f3536f7dc23c4278a4dc44254896e3d08924c3fc87762ea1ffb71.png" curl -sL -o larynx_relations.png "https://cdn.orris.care/cdss_images/439d7b432d8c5a1e318f166541a0b8069a7052737cfef721299bfcf2acb21cbb.png" ls -la
~/diaphragm-mastication-larynx/build_pdf.py
"""
Anatomy exam notes: Diaphragm, Muscles of Mastication, Larynx - with diagrams.
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Image,
Table, TableStyle, ListFlowable, ListItem, PageBreak, HRFlowable)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY, TA_LEFT
import os
ASSETS = "/tmp/workspace/diaphragm-mastication-larynx/assets"
OUT = "/tmp/workspace/diaphragm-mastication-larynx/output/Diaphragm_Mastication_Larynx_Anatomy_Notes.pdf"
styles = getSampleStyleSheet()
title_style = ParagraphStyle('TitleX', parent=styles['Title'], fontSize=18, spaceAfter=4, textColor=colors.HexColor("#1a4d2e"))
subtitle_style = ParagraphStyle('SubtitleX', parent=styles['Normal'], fontSize=10, alignment=TA_CENTER, textColor=colors.grey, spaceAfter=12)
h1 = ParagraphStyle('H1', parent=styles['Heading1'], fontSize=15, textColor=colors.white, backColor=colors.HexColor("#1a4d2e"),
spaceBefore=14, spaceAfter=10, leftIndent=6, borderPadding=(6,6,6,6))
h2 = ParagraphStyle('H2', parent=styles['Heading2'], fontSize=12.5, textColor=colors.HexColor("#1a4d2e"), spaceBefore=10, spaceAfter=6)
body = ParagraphStyle('BodyX', parent=styles['Normal'], fontSize=10.3, leading=15, alignment=TA_JUSTIFY, spaceAfter=6)
bullet = ParagraphStyle('BulletX', parent=styles['Normal'], fontSize=10.3, leading=14.5, alignment=TA_LEFT, leftIndent=4)
caption = ParagraphStyle('Caption', parent=styles['Normal'], fontSize=9, alignment=TA_CENTER, textColor=colors.HexColor("#444444"), spaceAfter=10, spaceBefore=3, fontName='Helvetica-Oblique')
mnemonic_style = ParagraphStyle('Mnemonic', parent=styles['Normal'], fontSize=10, leading=14, backColor=colors.HexColor("#fff8e1"),
borderColor=colors.HexColor("#d4a017"), borderWidth=0.7, borderPadding=8, spaceBefore=6, spaceAfter=10)
def table_style():
return TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor("#1a4d2e")),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8.7),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#999999")),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor("#e9f3ec")]),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
])
def bullets(items):
return ListFlowable(
[ListItem(Paragraph(i, bullet), leftIndent=10, bulletColor=colors.HexColor("#1a4d2e")) for i in items],
bulletType='bullet', start='circle', leftIndent=14, spaceBefore=2, spaceAfter=8
)
def img(path, max_w=13.5*cm, max_h=8*cm):
from PIL import Image as PILImage
with PILImage.open(path) as im:
w, h = im.size
ratio = min(max_w/w, max_h/h)
return Image(path, width=w*ratio, height=h*ratio, hAlign='CENTER')
def ptable(data, widths):
tbl = [[Paragraph(c, ParagraphStyle('c', parent=bullet, fontSize=8.5, leading=11)) for c in row] for row in data]
t = Table(tbl, colWidths=widths, repeatRows=1)
t.setStyle(table_style())
return t
story = []
story.append(Paragraph("Diaphragm, Muscles of Mastication & Larynx", title_style))
story.append(Paragraph("Anatomy Exam Notes (RGUHS format) — with labeled diagrams", subtitle_style))
story.append(HRFlowable(width="100%", thickness=1.2, color=colors.HexColor("#1a4d2e"), spaceAfter=10))
# ===================== 1. DIAPHRAGM =====================
story.append(Paragraph("1. DIAPHRAGM", h1))
story.append(Paragraph("Introduction", h2))
story.append(Paragraph(
"The diaphragm is a thin, dome-shaped musculotendinous sheet that forms the floor of the thoracic cavity and the roof of the "
"abdominal cavity, separating the two. It is the chief muscle of inspiration.", body))
story.append(Paragraph("Origin (Peripheral Attachments)", h2))
story.append(bullets([
"<b>Sternal part:</b> Two slips from the deep/posterior surface of the xiphoid process.",
"<b>Costal part:</b> Inner surfaces of the lower six ribs and their costal cartilages (interdigitating with transversus abdominis) on each side.",
"<b>Lumbar part - right and left crura:</b> Right crus arises from bodies of L1-L3 vertebrae (and intervening discs); left crus from bodies of L1-L2. Fibers of the right crus split to surround the esophagus (forming a physiological sphincter).",
"<b>Arcuate ligaments:</b> Medial arcuate ligament (over psoas major, from body to transverse process of L1); Lateral arcuate ligament (over quadratus lumborum, from transverse process of L1 to rib XII); Median arcuate ligament (connects the two crura across the front of the aorta at T12).",
]))
story.append(Paragraph("Insertion", h2))
story.append(Paragraph(
"All muscle fibers converge and insert into a central tendon - a trefoil (clover leaf)-shaped, strong aponeurosis with no bony attachment, "
"onto which the fibrous pericardium is fused above.", body))
story.append(img(os.path.join(ASSETS, "diaphragm_diagram.png")))
story.append(Paragraph("Fig. 1 – Diaphragm showing costal margin, crura, arcuate ligaments and openings (esophageal hiatus, aortic opening).", caption))
story.append(Paragraph("Nerve Supply", h2))
story.append(bullets([
"<b>Motor supply:</b> Phrenic nerve (C3, C4, C5) - \"C3, 4, 5 keeps the diaphragm alive\" - supplies the whole muscle including the crura, entering mainly from its abdominal (inferior) surface.",
"<b>Sensory supply</b> to the central part of diaphragm (pleura and peritoneum covering it) is also via phrenic nerve (referred pain to the shoulder tip, C4 dermatome); peripheral part is supplied by the lower intercostal nerves (T7-T11) and subcostal nerve.",
]))
story.append(Paragraph("Blood Supply", h2))
story.append(Paragraph(
"Superiorly: pericardiacophrenic and musculophrenic arteries (from internal thoracic artery), superior phrenic arteries "
"(from thoracic aorta), and branches from lower intercostal arteries. Inferiorly (main supply): paired inferior phrenic arteries, "
"usually the first branches of the abdominal aorta.", body))
story.append(PageBreak())
story.append(Paragraph("Openings of the Diaphragm and Structures Transmitted", h2))
story.append(ptable([
["Opening", "Level", "Structures passing through"],
["Vena caval opening (in central tendon)", "T8", "Inferior vena cava; branches of right phrenic nerve"],
["Esophageal hiatus (in muscular right crus)", "T10", "Esophagus; anterior & posterior vagal trunks; esophageal branches of left gastric vessels"],
["Aortic opening (behind median arcuate ligament, not truly \"through\" the diaphragm)", "T12", "Aorta; thoracic duct; sometimes azygos vein"],
["Through the crura", "-", "Greater, lesser and least splanchnic nerves; sympathetic trunk (behind medial arcuate ligament); azygos/hemiazygos veins"],
["Between crura and arcuate ligaments (posteriorly)", "-", "Subcostal nerve and vessels; sympathetic chain"],
["Foramen of Morgagni (rare, congenital hernia site)", "Anterior, next to xiphoid", "Superior epigastric vessels (potential hernia site)"],
], [6.3*cm, 2.3*cm, 7.0*cm]))
story.append(Spacer(1, 6))
story.append(img(os.path.join(ASSETS, "diaphragm_hernia_sites.png"), max_h=7*cm))
story.append(Paragraph("Fig. 2 – Inferior view of the diaphragm showing the common congenital hernia sites - foramen of Morgagni, "
"esophageal hiatus, and foramen of Bochdalek.", caption))
story.append(Paragraph("Actions", h2))
story.append(bullets([
"Chief muscle of inspiration - contraction flattens the dome, increasing the vertical (craniocaudal) diameter of the thorax, drawing air into the lungs.",
"Raises intra-abdominal pressure - aids in expulsive acts: micturition, defecation, parturition, vomiting, and forced expiration (Valsalva maneuver).",
"Helps prevent gastro-esophageal reflux by its sphincteric action at the esophageal hiatus (crural sling).",
]))
story.append(Paragraph("Applied Anatomy", h2))
story.append(bullets([
"<b>Diaphragmatic hernia:</b> Congenital - through the foramen of Bochdalek (posterolateral, more common, usually left-sided) or foramen of Morgagni (anterior, retrosternal, rare); Acquired - hiatus hernia (sliding or para-esophageal) through a weakened/widened esophageal hiatus.",
"<b>Phrenic nerve palsy:</b> Paralysis of one half of the diaphragm causes paradoxical (upward) movement on that side during inspiration, seen on fluoroscopy (\"sniff test\"); bilateral palsy causes severe respiratory embarrassment.",
"<b>Hiccup:</b> Sudden, involuntary spasmodic contraction of the diaphragm against a closed glottis.",
"<b>Referred pain:</b> Irritation of the central diaphragmatic pleura/peritoneum (phrenic nerve, C4) is referred to the shoulder tip - classically seen in subphrenic abscess or splenic/hepatic injury (Kehr's sign).",
"<b>Diaphragmatic rupture</b> from blunt trauma is more common on the left side (right side is protected by the liver), permitting abdominal viscera to enter the thorax.",
]))
story.append(PageBreak())
# ===================== 2. MUSCLES OF MASTICATION =====================
story.append(Paragraph("2. MUSCLES OF MASTICATION", h1))
story.append(Paragraph("Introduction", h2))
story.append(Paragraph(
"The muscles of mastication are four paired muscles that act on the temporomandibular joint (TMJ) to move the mandible during "
"chewing: <b>temporalis, masseter, medial pterygoid</b> and <b>lateral pterygoid</b>. All are derived embryologically from the "
"first pharyngeal (branchial) arch and are therefore all supplied by the <b>mandibular division of the trigeminal nerve (V3)</b>.", body))
story.append(img(os.path.join(ASSETS, "mastication_muscles.png")))
story.append(Paragraph("Fig. 3 – Muscles of mastication - temporalis, masseter, and the pterygoid muscles (lateral view of skull/mandible).", caption))
story.append(Paragraph("Origin, Insertion, Nerve Supply and Action", h2))
story.append(ptable([
["Muscle", "Origin", "Insertion", "Nerve", "Main Action"],
["Temporalis", "Floor of temporal fossa & deep surface of temporal fascia", "Coronoid process & anterior border of ramus of mandible", "Deep temporal branches of V3", "Elevation (closure); posterior fibres retract the protruded mandible"],
["Masseter", "Zygomatic arch & maxillary process of zygoma", "Lateral surface of ramus & coronoid process of mandible", "Masseteric branch of V3", "Powerful elevation (closure) of mandible"],
["Medial pterygoid", "Medial surface of lateral pterygoid plate & pyramidal process of palatine bone", "Medial surface of ramus & angle of mandible (forms a 'sling' with masseter)", "Nerve to medial pterygoid (V3)", "Elevation; assists protrusion; with lateral pterygoid of opposite side produces side-to-side grinding movements"],
["Lateral pterygoid\n(2 heads)", "Superior head: infratemporal surface of greater wing of sphenoid.\nInferior head: lateral surface of lateral pterygoid plate", "Pterygoid fovea on neck of mandible & capsule/articular disc of TMJ", "Nerve to lateral pterygoid (V3)", "Protrusion and depression (opening) of mandible; acting alternately - side-to-side (grinding) movements"],
]))
story.append(Spacer(1, 8))
story.append(Paragraph("Accessory Muscles Assisting Mastication", h2))
story.append(bullets([
"<b>Depression (opening) of the jaw</b> against resistance is assisted by the digastric, geniohyoid and mylohyoid (all fixing/depressing the mandible when the hyoid is fixed by infrahyoid muscles) - these are NOT true muscles of mastication and are supplied by different nerves (digastric anterior belly and mylohyoid by V3 too, but posterior belly of digastric by facial nerve VII; geniohyoid by C1 via hypoglossal).",
"<b>Buccinator</b> (facial nerve VII) keeps food between the molar teeth during chewing - a muscle of the cheek, not a true muscle of mastication.",
]))
story.append(Paragraph("Movements at the TMJ Produced", h2))
story.append(bullets([
"<b>Elevation (closing):</b> Temporalis, masseter, medial pterygoid.",
"<b>Depression (opening):</b> Lateral pterygoid (with gravity and suprahyoid/infrahyoid muscles).",
"<b>Protrusion:</b> Both lateral pterygoids acting together (assisted by medial pterygoids and superficial fibres of masseter).",
"<b>Retrusion:</b> Posterior (horizontal) fibres of temporalis.",
"<b>Lateral (side-to-side) grinding movements:</b> Alternating/unilateral action of the pterygoid muscles of one side with temporalis of the other.",
]))
story.append(Paragraph("Applied Anatomy", h2))
story.append(bullets([
"<b>Trigeminal nerve (V3) motor lesion:</b> Weakness of the muscles of mastication; on opening the mouth, jaw deviates toward the paralysed side (unopposed action of the healthy lateral pterygoid pushes the jaw to the weak side).",
"<b>Masseter hypertrophy:</b> Seen with bruxism (habitual teeth grinding), giving a 'square jaw' appearance.",
"<b>Trismus:</b> Painful spasm of the muscles of mastication (classically masseter) limiting mouth opening, seen in tetanus (\"lockjaw\") and dental/peritonsillar infections.",
"<b>Access for regional anaesthesia:</b> The mandibular (inferior alveolar) nerve block is given near the medial surface of the ramus, related to the medial pterygoid muscle.",
"<b>Masticator space infections</b> can spread along the fascial planes surrounding these muscles, causing trismus and swelling over the ramus/angle of mandible.",
]))
story.append(Paragraph("Quick Recall", h2))
story.append(Paragraph(
"<b>Mnemonic:</b> \"<i>My Time Please, Lateral pterygoid Lowers</i>\" - Elevators = <b>M</b>asseter, <b>T</b>emporalis, medial <b>P</b>terygoid; "
"Depressor/protrusor = <b>L</b>ateral pterygoid. All four muscles of mastication are supplied by <b>V3 (mandibular nerve)</b> - "
"derivatives of the <b>1st pharyngeal arch</b>.",
mnemonic_style))
story.append(PageBreak())
# ===================== 3. LARYNX =====================
story.append(Paragraph("3. LARYNX", h1))
story.append(Paragraph("Introduction", h2))
story.append(Paragraph(
"The larynx is a hollow musculo-ligamentous organ with a cartilaginous framework, situated in the anterior neck opposite "
"C3-C6 vertebrae, that caps the lower respiratory tract. It continues below as the trachea and opens above into the "
"laryngopharynx. It functions as a sphincter protecting the airway during swallowing and as the organ of voice production (phonation).", body))
story.append(img(os.path.join(ASSETS, "larynx_relations.png")))
story.append(Paragraph("Fig. 4 – Larynx in relation to the pharynx, nasal and oral cavities, and trachea (sagittal view).", caption))
story.append(Paragraph("Laryngeal Skeleton (Cartilages)", h2))
story.append(ptable([
["Cartilage", "Type & Number", "Key Features"],
["Thyroid cartilage", "Hyaline, single (2 fused laminae)", "Largest; forms laryngeal prominence (Adam's apple) anteriorly; superior & inferior horns; oblique line for strap muscle attachment"],
["Cricoid cartilage", "Hyaline, single", "Only complete cartilaginous ring in the airway; signet-ring shaped - narrow arch anteriorly, broad lamina posteriorly; articulates with thyroid and arytenoid cartilages"],
["Epiglottis", "Elastic, single, leaf-shaped", "Attached via thyro-epiglottic ligament to the thyroid angle; guards the laryngeal inlet during swallowing"],
["Arytenoid cartilages", "Hyaline, paired, pyramidal", "Base articulates with cricoid (crico-arytenoid joint); apex bears corniculate cartilage; vocal process gives attachment to vocal ligament; muscular process for intrinsic muscles"],
["Corniculate cartilages", "Elastic, paired", "Sit on apex of each arytenoid, in the ary-epiglottic fold"],
["Cuneiform cartilages", "Elastic, paired", "Small rods in the ary-epiglottic fold, support it"],
], [4.0*cm, 4.2*cm, 7.4*cm]))
story.append(Spacer(1, 6))
story.append(img(os.path.join(ASSETS, "larynx_cartilages.png")))
story.append(Paragraph("Fig. 5 – Laryngeal cartilages - thyroid, cricoid, epiglottis and paired arytenoid cartilages.", caption))
story.append(Paragraph("Joints, Membranes and Ligaments", h2))
story.append(bullets([
"<b>Cricothyroid joint</b> (synovial) - permits tilting of thyroid cartilage, tensing vocal folds; <b>crico-arytenoid joint</b> (synovial) - permits rotation/gliding of arytenoids to open/close the rima glottidis.",
"<b>Extrinsic membranes:</b> Thyrohyoid membrane (thyroid cartilage to hyoid bone, pierced by internal laryngeal nerve and superior laryngeal vessels) and cricotracheal ligament (cricoid to first tracheal ring).",
"<b>Fibro-elastic membrane of larynx:</b> Upper part = quadrangular membrane (free lower margin forms the vestibular ligament/false cord); lower part = cricovocal (conus elasticus) membrane (free upper margin forms the vocal ligament/true cord).",
]))
story.append(Paragraph("Interior of the Larynx", h2))
story.append(bullets([
"<b>Vestibular folds (false vocal cords)</b> - upper folds, contain vestibular ligament, not concerned with sound production.",
"<b>Vocal folds (true vocal cords)</b> - lower folds, contain vocal ligament and vocalis muscle; concerned with sound production; whiter and sharper edged than false cords.",
"<b>Rima glottidis</b> - gap between the vocal folds and arytenoids - the narrowest part of the larynx in adults.",
"<b>Laryngeal ventricle</b> - space between vestibular and vocal folds on each side, with the saccule projecting upward from it (contains mucous glands lubricating the cords).",
"Three regions: <b>Vestibule</b> (inlet to vestibular folds), <b>middle (glottic) cavity</b> (between the two pairs of folds), <b>infraglottic cavity</b> (vocal folds to lower border of cricoid, continuous with trachea).",
]))
story.append(PageBreak())
story.append(Paragraph("Muscles of the Larynx", h2))
story.append(Paragraph("<b>Extrinsic muscles</b> move the larynx as a whole (elevators: stylopharyngeus, thyrohyoid, stylohyoid, digastric, mylohyoid; depressors: sternothyroid, sternohyoid, omohyoid).", body))
story.append(ptable([
["Intrinsic Muscle", "Action on Vocal Folds/Rima Glottidis", "Nerve Supply"],
["Cricothyroid", "Tenses (elongates) the vocal folds by tilting thyroid cartilage forward", "External laryngeal nerve (branch of superior laryngeal nerve, vagus) - the ONLY intrinsic muscle NOT supplied by recurrent laryngeal nerve"],
["Posterior crico-arytenoid", "ONLY abductor of vocal folds - widens the rima glottidis (opens airway)", "Recurrent laryngeal nerve"],
["Lateral crico-arytenoid", "Adductor - narrows the rima glottidis", "Recurrent laryngeal nerve"],
["Transverse arytenoid (interarytenoid)", "Adductor - closes the posterior (intercartilaginous) part of rima glottidis", "Recurrent laryngeal nerve"],
["Oblique arytenoid (+ary-epiglotticus)", "Sphincter of laryngeal inlet; narrows the inlet", "Recurrent laryngeal nerve"],
["Thyro-arytenoid (incl. vocalis)", "Relaxes and shortens vocal folds; vocalis finely adjusts tension for pitch control", "Recurrent laryngeal nerve"],
], [4.4*cm, 7.3*cm, 3.9*cm]))
story.append(Spacer(1, 8))
story.append(Paragraph("Nerve Supply of the Larynx (Both Branches of Vagus, X)", h2))
story.append(bullets([
"<b>Superior laryngeal nerve</b> divides into: <b>Internal laryngeal nerve</b> - sensory to the larynx above the vocal folds + taste-like sensation, pierces thyrohyoid membrane; <b>External laryngeal nerve</b> - motor to cricothyroid only.",
"<b>Recurrent laryngeal nerve</b> - motor to ALL other intrinsic muscles; sensory below the vocal folds. Right RLN loops under the subclavian artery; left RLN loops under the arch of aorta - both ascend in the tracheoesophageal groove, closely related to the inferior thyroid artery and thyroid gland lobes.",
]))
story.append(Paragraph("Blood Supply", h2))
story.append(Paragraph(
"Superior laryngeal artery (branch of superior thyroid artery) accompanies the internal laryngeal nerve through the thyrohyoid membrane; "
"inferior laryngeal artery (branch of inferior thyroid artery) accompanies the recurrent laryngeal nerve.", body))
story.append(Paragraph("Applied Anatomy", h2))
story.append(bullets([
"<b>Recurrent laryngeal nerve palsy:</b> Most often injured during thyroidectomy (closely related to inferior thyroid artery). Unilateral injury -> hoarseness (paramedian cord position); bilateral injury -> severe stridor/airway obstruction requiring emergency tracheostomy.",
"<b>Cricothyrotomy:</b> Emergency airway access through the cricothyroid membrane (between thyroid and cricoid cartilages) - relatively avascular and superficial, the fastest surgical airway.",
"<b>Laryngeal cancer:</b> Glottic tumours (on true vocal cords) present early with hoarseness because the vocal cords are essential for a clear voice, and this region has sparse lymphatics (less nodal spread).",
"<b>Foreign body aspiration:</b> Right main bronchus is more vertical, wider and shorter than the left, so aspirated foreign bodies more often lodge on the right side.",
"<b>Rima glottidis is the narrowest part of the adult airway</b> (in infants, the cricoid ring is narrowest) - important for endotracheal tube sizing.",
]))
story.append(Paragraph("Quick Recall - Larynx", h2))
story.append(Paragraph(
"<b>Mnemonic for intrinsic muscles:</b> \"<i>CT LiPS TA</i>\" - <b>C</b>rico<b>t</b>hyroid (tensor), <b>L</b>ateral crico-arytenoid, "
"<b>P</b>osterior crico-arytenoid (only abductor - \"PCA - Posterior = oPens\"), interarytenoid (<b>S</b>) and Thyro-<b>A</b>rytenoid. "
"<b>Only abductor of vocal cords</b> = Posterior crico-arytenoid. <b>Only muscle not supplied by RLN</b> = Cricothyroid (external laryngeal nerve).",
mnemonic_style))
story.append(HRFlowable(width="100%", thickness=0.8, color=colors.HexColor("#999999"), spaceBefore=10, spaceAfter=6))
story.append(Paragraph(
"<i>Source: Gray's Anatomy for Students (diaphragm, larynx, temporal & infratemporal fossae/muscles of mastication) and "
"Cummings Otolaryngology Head and Neck Surgery - compiled with standard descriptive anatomy as concise exam-ready notes.</i>",
ParagraphStyle('foot', parent=styles['Normal'], fontSize=8, textColor=colors.grey)))
doc = SimpleDocTemplate(OUT, pagesize=A4,
leftMargin=1.6*cm, rightMargin=1.6*cm, topMargin=1.4*cm, bottomMargin=1.4*cm,
title="Diaphragm, Muscles of Mastication and Larynx - Anatomy Notes")
doc.build(story)
print("PDF built at:", OUT)
cd /tmp/workspace/diaphragm-mastication-larynx && python3 build_pdf.py && python3 -c " from pypdf import PdfReader r = PdfReader('output/Diaphragm_Mastication_Larynx_Anatomy_Notes.pdf') print('Pages:', len(r.pages)) "