6 Mathematics, Equations, Tables, and Figures
A scientific document must do more than contain correct calculations. It must communicate what was calculated, why the calculation matters, and how the reader can evaluate the evidence. A mathematical expression that is difficult to read, a table without units, or a graph without a meaningful caption can obscure an otherwise sound analysis. Quarto provides a common source for these elements, allowing authors to concentrate on the logical organization of their work rather than manually numbering objects in several different publications.
Consider a researcher comparing waiting times at two clinics. The report needs a definition of the mean, a table of descriptive statistics, a graph of the observations, and an interpretation that acknowledges missing data. A mathematics instructor faces a similar challenge when presenting a function, its derivative, and a graphical illustration of a tangent line. In both cases, the mathematical notation and the visual evidence must support the narrative. This chapter develops a workflow for doing so.
6.1 Learning objectives
- Distinguish inline and display mathematics and use appropriate LaTeX notation.
- Organize definitions, theorems, proofs, and examples.
- Label and cross-reference equations, tables, figures, and subfigures.
- Design accessible statistical tables and graphics with explicit units.
- Produce equivalent computational figures using R and Python.
- Evaluate the portability of technical content across HTML, PDF, and Word.
6.2 Mathematical notation
LaTeX notation describes mathematical structure rather than specifying the position of every symbol. In Quarto, single dollar signs delimit inline mathematics, while pairs of dollar signs delimit display mathematics. Inline notation is appropriate for short expressions that belong grammatically to a sentence. Display notation is appropriate for important relationships, lengthy expressions, and derivations that readers need to examine independently.
The sample contains $n=5$ observations.
$$
\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i
$$The first expression becomes part of a paragraph. The second appears as a separate equation. The braces in \frac{1}{n} group the numerator and denominator; the underscore introduces a subscript and the caret introduces a superscript. Braces are particularly important when a subscript or exponent contains several characters. For example, x_{ij} denotes an entry indexed by both \(i\) and \(j\), whereas x_ij applies the subscript only to the first character.
| Purpose | Source | Result |
|---|---|---|
| Fraction | \frac{a}{b} |
\(\frac{a}{b}\) |
| Square root | \sqrt{x} |
\(\sqrt{x}\) |
| Greek letter | \mu |
\(\mu\) |
| Inequality | x\leq 5 |
\(x\leq 5\) |
| Summation | \sum_{i=1}^{n}x_i |
\(\sum_{i=1}^{n}x_i\) |
| Integral | \int_0^1 x^2\,dx |
\(\int_0^1 x^2\,dx\) |
| Probability | P(A\mid B) |
\(P(A\mid B)\) |
| Text in math | \text{if } x>0 |
\(\text{if } x>0\) |
Use \text{} for ordinary words inside an equation and \mathrm{} for upright mathematical symbols where convention requires them. Do not use mathematical italics for long phrases. In a clinical report, write \(t=15\ \text{minutes}\) rather than allowing the unit to be interpreted as a product of variables. Avoid using a display equation merely to make a short number more prominent.
6.2.1 Matrices and vectors
A matrix is a rectangular arrangement of quantities. In a LaTeX matrix environment, ampersands separate columns and double backslashes separate rows. The following example represents a linear model with an intercept and one predictor:
\begin{bmatrix}
1 & 2 \\
1 & 4 \\
1 & 6
\end{bmatrix}\[ X=\begin{bmatrix}1&2\\1&4\\1&6\end{bmatrix},\qquad \boldsymbol{\beta}=\begin{bmatrix}\beta_0\\\beta_1\end{bmatrix}. \]
The product \(X\boldsymbol{\beta}\) contains three predicted values. Each row represents an observation, while the first column represents the intercept. Explain the dimensions before presenting a matrix product; readers should not have to infer the meaning of a row or column from notation alone.
6.2.2 Aligned derivations and piecewise functions
Use an aligned environment inside display delimiters to organize related steps. The ampersand marks the alignment point, usually an equality sign. For \(f(x)=x^2+1\), the tangent at \(x=2\) is obtained as follows:
\[ \begin{aligned} f'(x)&=2x,\\ f'(2)&=4,\\ y-f(2)&=4(x-2),\\ y&=4x-3. \end{aligned} \]
A piecewise function uses the cases environment. For instance, an indicator for a waiting time exceeding twenty minutes is
\[ I(t)=\begin{cases}1,&t>20,\\0,&t\leq20.\end{cases} \]
The strict inequality is intentional: an appointment lasting exactly twenty minutes receives a zero. Mathematical notation is part of the operational definition of a variable, not merely decoration.
6.3 Numbering and cross-referencing
A reference should identify an object by its meaning rather than its position on the page. Quarto resolves references to labeled objects when the document is rendered. Use descriptive identifiers with the appropriate prefix, such as eq-, fig-, and tbl-. Keep identifiers unique across the entire book. A chapter-specific identifier such as eq-ch06-mean reduces the risk of collisions.
$$
\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i
$$ {#eq-ch06-mean}
The sample mean is defined in @eq-ch06-mean.\[ \bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i \tag{6.1}\]
The formula in Equation 6.1 uses the number of observed values, not necessarily the number of records in a dataset. This distinction matters when some records have missing outcomes.
Do not type “Equation 6.1” manually. Inserting another equation earlier in the chapter can change the numbering. Automatic references preserve the connection between the text and the intended object. Render the complete book to check references that point across chapters. A standalone preview may not resolve references to objects in another file.
6.4 Definitions, theorems, and proofs
Mathematics textbooks benefit from a consistent hierarchy of formal statements. A definition introduces terminology, a theorem states a proposition that requires justification, and a proof explains why the proposition follows from the assumptions. Examples illustrate the concepts without replacing the proof.
::: {#def-ch06-mean}
## Arithmetic mean
The arithmetic mean of $n$ observed numbers is their sum divided by $n$.
:::Definition 6.1 (Arithmetic mean) The arithmetic mean of \(n\) observed numbers is their sum divided by \(n\), where \(n>0\).
Theorem 6.1 (Translation of the mean) If \(y_i=x_i+c\) for every observation, then \(\bar{y}=\bar{x}+c\).
Proof. By linearity of summation,
\[ \bar{y}=\frac{1}{n}\sum_{i=1}^n(x_i+c) =\bar{x}+\frac{nc}{n}=\bar{x}+c. \]
Theorem 6.1 explains why a uniform correction to every waiting time changes the mean by exactly the correction. It does not justify adding a constant to observations when the measurement error is unknown. Use theorem environments for logical claims and callouts for advice, warnings, or practical instructions. Check the appearance of these environments in each target format; styling can differ.
6.5 Designing tables
A table supports exact comparisons. Begin with the question the table is intended to answer, then choose columns that provide the necessary evidence. A table of clinic waiting times should identify the group, the number of records, the number observed, and the unit of measurement. Reporting a mean without a denominator makes it difficult to judge the completeness of the evidence.
| Clinic | Records | Observed | Missing | Mean (min) | SD (min) |
|---|---|---|---|---|---|
| A | 5 | 5 | 0 | 16.0 | 5.87 |
| B | 6 | 5 | 1 | 12.0 | 3.54 |
The colon following the table introduces its caption. Alignment markers in the header separator control column alignment. Numeric columns are normally right-aligned, while labels are left-aligned. Table 6.2 distinguishes records from observed outcomes, preventing the reader from mistakenly assuming that all eleven waiting times were available.
Use consistent precision within a column, but do not round the data before computing statistics. Report missing values explicitly rather than replacing them with zero. A zero-minute wait is a possible measurement; a missing waiting time is an absence of information. Keep tables compact enough to fit the page. If a table is too wide, consider splitting it by scientific purpose rather than reducing the font to an unreadable size.
6.5.1 Generated tables
A manually typed table is suitable for a small fixed example. For a changing dataset, generate the table from code. This prevents discrepancies between the analysis and the publication. In R, knitr::kable() can produce a Markdown table; in Python, DataFrame.to_markdown() requires the tabulate package. The standalone examples supplied with this chapter demonstrate both approaches. Keep the computation at full precision and format only the displayed result.
6.6 Designing figures
A figure reveals patterns that are difficult to see in a table. The choice of graph depends on the question: a scatterplot shows the relationship between quantitative variables, a dot plot shows individual measurements, and a line graph can show a mathematical function or a sequence over time. Connecting unordered observations with lines implies an ordering that may not exist.
Figure 6.1 complements Table 6.2 by showing the distribution of the observed values. Clinic A has a higher observed mean and a wider observed range. These small synthetic samples do not establish a population difference or a causal effect of clinic assignment.
A caption should identify what is displayed and explain essential conventions. Alternative text should communicate the visual information to readers who cannot see the image. A caption and alternative text have overlapping purposes but are not interchangeable. Use meaningful axis labels with units, readable type, sufficient contrast, and redundant visual encodings such as marker shapes or line styles when groups must be distinguished without color.
6.6.1 Resolution and dimensions
Raster images contain pixels. A six-inch-wide image at 300 dots per inch contains 1800 pixels across. Increasing the DPI metadata of a small existing image does not restore lost detail. Generate the image at the intended dimensions from the original code. Vector formats such as SVG and PDF preserve geometric detail when scaled, although support varies by output format. PNG is a practical portable choice for many textbook figures.
Distinguish the physical size of the generated figure from its displayed width. A figure may be generated at six inches and displayed at 90 percent of the text column. Inspect the final output at the intended reading size. Large source images can still become unreadable if the labels are too small relative to the figure.
6.7 Worked investigation: a tangent line
Consider \(f(x)=x^2+1\). The derivative gives the instantaneous slope. At \(x=2\), the point on the curve is \((2,5)\) and the slope is 4. The tangent line is \(L(x)=4x-3\). A useful graphical illustration should show both curves on the same coordinate system and identify the point of tangency. The vertical difference is \(f(x)-L(x)=(x-2)^2\), which is nonnegative and equals zero only at the point of tangency.
6.7.1 R implementation
The following code is displayed for study. The executable version is supplied in examples/ch06/tangent-r.qmd.
x <- seq(-1, 4, length.out = 301)
f <- x^2 + 1
L <- 4*x - 3
plot(x, f, type = "l", lwd = 2,
xlab = "x", ylab = "y", ylim = range(f, L))
lines(x, L, lty = 2, lwd = 2)
points(2, 5, pch = 19)
legend("topleft", c("Function", "Tangent"),
lty = c(1, 2), lwd = 2, bty = "n")The sequence contains 301 points, providing a smooth approximation to the continuous function. The ylim argument includes both curves; otherwise the tangent may be clipped. The dashed line distinguishes the tangent even in grayscale. The point is added after the lines so that it remains visible.
6.7.2 Python implementation
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-1, 4, 301)
f = x**2 + 1
L = 4*x - 3
fig, ax = plt.subplots(figsize=(6, 4))
ax.plot(x, f, label="Function")
ax.plot(x, L, linestyle="--", label="Tangent")
ax.scatter([2], [5], color="black", zorder=3)
ax.set(xlabel="x", ylabel="y")
ax.legend(frameon=False)
fig.tight_layout()
plt.show()NumPy constructs the grid and evaluates the expressions element by element. Matplotlib separates the figure container from the axes. This separation becomes useful when building multi-panel figures. Neither program estimates the derivative numerically; both use the analytic result. The graph is evidence of consistency with the derivation, not a substitute for it.
6.8 Multi-panel figures
When two related graphics answer complementary questions, group them into a single figure. The following source illustrates the layout syntax using the two chapter figures. The panels have their own identifiers and captions, and the containing division supplies the overall caption.
::: {#fig-ch06-panels layout-ncol=2}
{#fig-ch06-panel-a fig-alt="Waiting times"}
{#fig-ch06-panel-b fig-alt="Tangent line"}
Examples of statistical and mathematical graphics.
:::For an actual research report, combine panels only when they serve a common scientific purpose. A plot of raw data and a plot of residuals may be a useful pair. Keep axis scales comparable when readers are expected to compare magnitudes. Inspect the layout in PDF and Word, where available page width may be more restrictive than in HTML.
6.9 Mathematical typography laboratory
Mathematical typography is a form of scientific communication. Begin by deciding which symbols denote variables, which denote fixed parameters, and which denote named operations. In a model of concentration, \(C(t)\) denotes a function of time, \(C_0\) denotes its initial value, and \(k\) denotes a rate constant. The notation \(\exp(-kt)\) makes the exponential operation explicit. The product \(kt\) must be dimensionless: if time is measured in hours, the rate constant has units of inverse hours. A typeset equation can be visually attractive and still be dimensionally incorrect.
6.9.1 From a verbal statement to an equation
Suppose an illustrative concentration decreases at a rate proportional to its current value. Translate the statement into a differential equation before choosing the software implementation. The proportionality constant is positive, and the minus sign indicates decay. The initial condition determines the multiplicative constant.
\[ \frac{dC}{dt}=-kC,\qquad C(0)=C_0,\qquad k>0. \tag{6.2}\]
For \(C_0>0\), separate variables and integrate. The logarithm of a ratio is dimensionless, which motivates writing the intermediate expression in the following form:
\[ \begin{aligned} \int_{C_0}^{C(t)}\frac{du}{u}&=-\int_0^t k\,ds,\\ \ln\left(\frac{C(t)}{C_0}\right)&=-kt,\\ C(t)&=C_0\exp(-kt). \end{aligned} \tag{6.3}\]
The solution in Equation 6.3 satisfies Equation 6.2 by direct differentiation. In a manuscript, use an aligned derivation when each line follows from the preceding line; do not align unrelated equations merely to make their equal signs coincide. Number a group of steps as one equation when the narrative refers to the derivation as a whole. If individual steps require independent references, use separate labeled display blocks.
6.9.2 Operators, delimiters and notation choices
| Concept | LaTeX source | Interpretation |
|---|---|---|
| Natural logarithm | \ln(x) |
Named operator with upright letters |
| Conditional expectation | E(Y\mid X=x) |
Mean of a conditional distribution |
| Partial derivative | \frac{\partial f}{\partial x} |
Change with respect to one variable |
| Gradient | \nabla f |
Vector of partial derivatives |
| Matrix transpose | X^{\mathsf T} |
Interchange rows and columns |
| Estimated parameter | \widehat{\beta}_1 |
Estimate of a population coefficient |
| Absolute value | \lvert x\rvert |
Nonnegative magnitude |
| Norm | \lVert v\rVert_2 |
Euclidean length |
Use \left and \right when delimiters must accommodate a tall expression, but avoid oversized parentheses around simple variables. Use \mid for conditional probability and set-builder notation rather than a plain vertical bar when the spacing matters. A hat denotes an estimate; it does not denote a population parameter. Define notation before using it and retain the same convention across chapters.
6.9.3 Formal statements and assumptions
Theorem 6.2 (Half-life of an exponential model) If \(C(t)=C_0\exp(-kt)\) with \(C_0>0\) and \(k>0\), then the time required for the concentration to reach half its initial value is \(t_{1/2}=\ln(2)/k\).
Proof. Set \(C(t)=C_0/2\). Dividing by the positive initial concentration gives \(\exp(-kt)=1/2\). Taking natural logarithms gives \(-kt=-\ln(2)\). Division by \(-k\) yields the stated result. Since the exponential function is strictly decreasing for positive \(k\), this time is unique.
The assumptions in Theorem 6.2 are essential. When \(k=0\), the concentration is constant and there is no finite half-life. A negative rate constant produces growth rather than decay. This is an idealized teaching model, not a dosing recommendation or a validated model for a particular medication.
6.10 Worked investigation: communicating a mathematical model
Take \(C_0=80\) arbitrary concentration units and \(k=0.2\) per hour. The half-life is approximately 3.466 hours. The derivative at the origin is \(-16\) concentration units per hour, so the linear approximation near the origin is \(L(t)=80-16t\). This approximation is local: at five hours it predicts zero, whereas the exponential model remains positive. A graph should not silently imply that the linear approximation remains valid indefinitely.
| Time (hours) | Exponential model | Linear approximation | Exact minus linear |
|---|---|---|---|
| 0 | 80.00 | 80.00 | 0.00 |
| 1 | 65.50 | 64.00 | 1.50 |
| 2 | 53.63 | 48.00 | 5.63 |
| 5 | 29.43 | 0.00 | 29.43 |
The table provides exact comparisons at selected times, while Figure 6.3 reveals the changing approximation error. Neither replaces the derivation. The exponential curve is convex because its second derivative is positive. Consequently its tangent at zero lies below the curve. This geometric fact explains the nonnegative differences in Table 6.4.
6.10.1 R implementation
C0 <- 80
k <- 0.2
t <- c(0, 1, 2, 5)
exact <- C0 * exp(-k*t)
linear <- C0 - k*C0*t
result <- data.frame(time = t, exact, linear,
error = exact-linear)
knitr::kable(result, digits = 2)
log(2)/kThe multiplication and exponential operations apply to each element of the time vector. The table is rounded only when printed. In a standalone executable Quarto report, give the cell a tbl- label and a tbl-cap option so that the generated table can be referenced in the narrative. Do not add a second manual caption to the same output.
6.10.2 Python implementation
import numpy as np
import pandas as pd
from IPython.display import Markdown, display
C0, k = 80, 0.2
t = np.array([0, 1, 2, 5])
exact = C0 * np.exp(-k*t)
linear = C0 - k*C0*t
result = pd.DataFrame({"Time (h)": t,
"Exact": exact,
"Linear": linear,
"Error": exact-linear})
display(Markdown(result.to_markdown(index=False,
floatfmt=".2f")))The Python table uses the optional tabulate dependency. In a Quarto cell intended to emit Markdown directly, use output: asis and print the Markdown string instead of displaying it as a Python string representation. The accompanying executable report uses that approach. Check the generated table in each format; an HTML-specific styling method may not translate to Word or PDF.
6.11 Linear algebra and statistical notation laboratory
Consider a hypothetical linear relationship between a predictor \(x\) and a response \(y\). Three observations have predictor values 2, 4 and 6, and responses 5, 8 and 11. The design matrix includes a column of ones. The least-squares problem is to minimize \(\lVert y-X\beta\rVert_2^2\). The normal equations are
\[ X^{\mathsf T}X\widehat{\beta}=X^{\mathsf T}y. \tag{6.4}\]
Here the matrix has dimensions \(3\times2\) and full column rank. The fitted coefficients are \(\widehat{\beta}_0=2\) and \(\widehat{\beta}_1=1.5\). In production numerical work, prefer a least-squares solver based on a stable factorization rather than explicitly inverting \(X^{\mathsf T}X\). The normal equations explain the mathematics but need not dictate the computational algorithm.
X <- cbind(1, c(2, 4, 6))
y <- c(5, 8, 11)
qr.solve(X, y)X = np.column_stack((np.ones(3), [2, 4, 6]))
y = np.array([5, 8, 11])
beta, residuals, rank, singular = np.linalg.lstsq(X, y, rcond=None)
print(beta)This deliberately exact dataset is suitable for illustrating notation and matrix dimensions, not for meaningful inference about a population. A residual plot would contain only numerical rounding error. Do not present a perfect fit to three constructed points as evidence of predictive accuracy.
6.12 Probability figures and meaningful shading
Suppose a hypothetical measurement follows a normal distribution with mean 120 and standard deviation 10. The probability of exceeding 140 is
\[ P(X>140)=1-\Phi\left(\frac{140-120}{10}\right) =1-\Phi(2)\approx0.02275. \tag{6.5}\]
The shaded region represents probability, not the height of the density at 140. The theoretical tail extends to infinity even though a finite plotting window is necessary. A caption should disclose this distinction. In this example the normal distribution is a hypothetical teaching assumption; it is not a clinical reference distribution or a diagnostic rule.
pnorm(140, mean=120, sd=10, lower.tail=FALSE)from scipy.stats import norm
norm.sf(140, loc=120, scale=10)The survival function is preferable to subtracting a cumulative probability from one when computing very small upper-tail probabilities, because subtraction can lose numerical precision. For visual comparison of two distributions, use the same horizontal scale and density scale. Otherwise a narrower distribution can appear misleadingly similar to a wider one.
6.13 Multi-panel publishing laboratory
A two-panel figure can connect a mathematical model to its approximation error. The first panel displays the exponential curve and tangent, and the second displays the difference \(C(t)-L(t)\). Both panels use the same time scale but different vertical quantities. The caption must identify these quantities rather than suggesting that the vertical axes are interchangeable.
Reference Figure 6.5 (a) when discussing the model and Figure 6.5 (b) when discussing the error. Reference Figure 6.5 when discussing the relationship between them. Panel identifiers must be unique even when the same image file is reused. If a narrow printed page makes the labels difficult to read, stack the panels vertically rather than reducing the text size excessively.
6.14 Format-aware quality assurance laboratory
Create a disposable copy of the supplied technical report. First render the unchanged version. Then introduce one defect at a time: remove an equation delimiter, change a figure identifier without updating its reference, replace a unit-bearing axis label with a vague label, and reduce the figure display width. Restore the original after each trial. Record whether the defect causes a rendering error, an unresolved reference, or a scientifically misleading but successfully rendered output. These categories require different remedies.
A PDF can contain a correctly rendered equation but an unreadably small plot. An HTML report can contain an accessible heading structure but an unresolved equation reference. A Word document can contain a table that exceeds the page width. Review the final document rather than relying exclusively on a successful command exit status. For Jupyter-generated figures, set default dimensions and resolution at document or project level; for knitr, cell-level dimensions can also be useful. Consult the format-specific options before assuming that a setting behaves identically across engines.
6.15 Additional guided practice
- Derive the half-life for \(k=0.1\) per hour. Explain why doubling the rate constant halves the half-life.
- Calculate the exponential prediction and linear approximation at three hours. Add the results to a generated table.
- Change the initial concentration to 100 while keeping the rate constant fixed. Explain which features of the graph change and which remain invariant.
- Typeset a gradient for \(f(x,y)=x^2+3y^2\) and evaluate it at \((1,2)\).
- Modify the matrix example by adding an observation \((8,14)\). Explain the new dimensions and verify the coefficients.
- Calculate the probability of exceeding 130 under the hypothetical normal model. Update the shading and caption together.
- Produce a figure at 6.5 inches wide and 300 DPI. Determine the required pixel width.
- Design a table with a missing outcome and a genuine zero. Explain how both should be displayed and analyzed.
- Introduce a broken cross-reference in a disposable copy. Record the actual behavior of your installed Quarto version.
- Render the technical report in two available formats and document at least three visual or structural checks.
6.16 Extended applied project: a mathematical publishing portfolio
Prepare a technical teaching portfolio containing a numbered mathematical derivation, a formal theorem and proof, a generated table, a multi-panel figure, and a probability visualization. Use the hypothetical decay model and normal distribution introduced in this chapter, or substitute a clearly documented mathematical model with comparable complexity. Include an executable R or Python source, a dependency record, and a concise explanation of assumptions. A peer should be able to regenerate the numerical evidence without manually copying results from the finished publication.
| Criterion | Points |
|---|---|
| Correct mathematical notation, derivations and assumptions | 8 |
| Reproducible computations and tables | 6 |
| Professional figures, captions and alternative text | 6 |
| Stable cross-references and document hierarchy | 5 |
| Format-specific review and reproducibility evidence | 5 |
| Total | 30 |
6.17 Guided practice
6.17.1 Activity 1: Repair mathematical notation
Write the sample variance using a summation, a fraction, and a squared deviation. Label the equation and refer to it in a complete sentence. Explain why the denominator is \(n-1\) for the usual sample variance and why the formula requires at least two observations.
6.17.2 Activity 2: Improve a table
A colleague reports clinic means of 16 and 12 with no units or sample sizes. Reconstruct the table using the data in data/clinic-ch04.csv. Include total records, observed records, missing outcomes, mean, and sample SD. Explain the distinction between a missing value and zero.
6.17.3 Activity 3: Modify a tangent-line figure
Change the tangent point to \(x=1\). Derive the new line before editing either computational example. Verify that the function and tangent have the same value and slope at the selected point. Update the caption and alternative text.
6.17.4 Activity 4: Audit a publication
Render one standalone example to HTML and PDF. Compare equation placement, figure size, and table readability. Record the software versions and any format-specific differences. If PDF rendering is unavailable, document the missing dependency rather than claiming a successful render.
6.18 Troubleshooting
| Symptom | Likely cause | Diagnostic action |
|---|---|---|
| Equation appears as raw text | Unbalanced math delimiters | Test a minimal equation in a new file |
| Reference is unresolved | Missing or duplicate identifier | Search the project for the exact label |
| Figure is missing | Incorrect relative path | Resolve the path from the source document |
| Table exceeds page width | Too many columns | Split by scientific purpose |
| Figure labels are tiny | Display size too small | Increase label size or simplify the plot |
| Code appears but does not run | Plain code fence | Use an executable language fence |
| PDF render fails | Missing TeX dependency | Run quarto check and inspect the first error |
6.19 Chapter summary
Technical publishing combines mathematical structure, computational evidence, and readable design. Use automatic references rather than manual numbering, distinguish missing data from observed zeros, and generate tables and figures from the same analysis whenever possible. Choose figure dimensions deliberately and provide both meaningful captions and alternative text. Verify the rendered publication in its intended format.
6.20 Review exercises
- Explain the difference between inline and display mathematics.
- Typeset the quadratic formula with a square root and fraction.
- Write a two-by-two matrix and identify its row and column separators.
- Typeset a piecewise indicator for a systolic blood pressure of at least 140 mmHg.
- Explain why automatic equation references are preferable to manual numbers.
- Write a labeled definition of the median.
- Prove that multiplying all observations by a constant multiplies their mean by that constant.
- Explain why the clinic table contains both observed and total counts.
- Calculate the mean difference between the two clinics.
- Calculate the sample standard deviation of Clinic A.
- Determine the pixel width of a seven-inch image at 300 DPI.
- Explain the difference between a caption and alternative text.
- Derive the tangent line to \(x^2+1\) at \(x=3\).
- Modify the R or Python example to display that tangent line.
- Explain when two panels should share an axis scale.
- Describe three checks to perform before distributing a PDF research report.
6.21 Applied project: a technical teaching report
Create a Quarto report for a first-year health-science mathematics course. Introduce a quadratic model of a hypothetical response, \(g(t)=t^2+2t+3\), where \(t\) is a dimensionless teaching variable. This is an illustrative mathematical model, not a validated physiological model. Derive the tangent at \(t=2\), explain its slope, and compare the exact function with its linear approximation at \(t=1.9,2,2.1\). Present the results in a generated table and a labeled figure. Use either R or Python and include a numbered definition, equation references, a caption, and alternative text. Render to HTML and one additional format if available. Submit the source, output, and a short reproducibility note.
| Criterion | Points |
|---|---|
| Correct mathematical derivation and interpretation | 6 |
| Reproducible computational table | 5 |
| Readable figure, caption, and alternative text | 5 |
| Document structure and cross-references | 5 |
| Rendering evidence and reproducibility note | 4 |
| Total | 25 |
6.22 Further reading
Consult the official Quarto guides on mathematics, cross-references, figures, and tables.
6.23 Supplemental assessment
- Conceptual (4 points). Explain why a tangent approximation is local.
- Technical (8 points). For C(t)=80 exp(-0.2t), calculate C(2), C prime(2), and the tangent estimate at t=2.5.
- Applied (8 points). Create a numbered equation and an accessible figure comparing the exact and tangent models.
See the student assessment packet in the source package for submission guidance and any required datasets.
6.24 Looking ahead
Connect mathematical objects to scholarly sources and cross-references in Chapter 7.
6.25 Interactive learning lab
Explore the activity below, then explain what changed and why.