Presenting Code Blocks & Mathematical Notation

🔖

2. Technical Typography, Code & Math · ⏱ 3 min read
SHARE

Clear Presentation of Equations and Code

Technical tutorials combine prose, symbolic equations ($\sigma = F/A$), and executable source code.

Note Readable Line Lengths Keep body prose between 60 and 75 characters per line (max-width: 72ch) so the eye can track smoothly from the end of one line to the start of the next.

Worked Example: Computing Beam Deflection

Below is a self-contained Python calculation of maximum tip deflection $\delta_{\max} = \frac{F L^3}{3 E I}$ for a rectangular steel cantilever beam:

Example
force_N = 500.0        # Tip load in Newtons
length_m = 1.2         # Beam length in metres
E_Pa = 200e9           # Young's modulus of steel (200 GPa)
b_m, h_m = 0.04, 0.02  # Width 40 mm, thickness 20 mm

I_m4 = (b_m * (h_m ** 3)) / 12.0
deflection_m = (force_N * (length_m ** 3)) / (3.0 * E_Pa * I_m4)
print(f"Moment of inertia I = {I_m4:.3e} m^4")
print(f"Tip deflection = {deflection_m * 1000:.2f} mm")

Track your progress

Sign in to save progress →

Type 2 or more letters to search all learning resources...