Chapter Summary
Chapter Summary
Key Points
- 1.
Match figure fonts to document fonts. Use
text.usetex=Truewith the same LaTeX preamble as your paper. For perfect integration, use the PGF backend and\input{figure.pgf}. Always use raw strings (r'...') for LaTeX commands. - 2.
Auto-generate all tables from data. Use
pandas.to_latex()for DataFrames andtabulatewithtablefmt='latex_booktabs'for professional rules. Never hand-type a results table — generate it from CSV/HDF5 with a script. - 3.
Separate simulation, visualization, and document. Simulation scripts produce raw data (CSV). Figure scripts read data and produce PDFs. LaTeX includes the PDFs. A Makefile orchestrates the pipeline and tracks dependencies.
- 4.
Script every figure. Each figure should be reproducible by running
python plot_figN.py. Use a batch script or Makefile to generate all figures withmake figures. This satisfies reproducibility requirements from IEEE and other publishers. - 5.
Use pathlib for portable paths. Never hardcode absolute paths. Use
Path(__file__).parentfor relative paths that work on any machine.
Looking Ahead
Chapter 19 covers Jupyter notebooks, Pandas, and interactive development — the exploratory side of the scientific workflow that feeds into the publication pipeline described here.