digraphx 0.7__tar.gz → 0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. {digraphx-0.7 → digraphx-0.8}/CHANGELOG.md +19 -0
  2. {digraphx-0.7/src/digraphx.egg-info → digraphx-0.8}/PKG-INFO +3 -3
  3. digraphx-0.8/examples/delay_padding.py +185 -0
  4. digraphx-0.8/paper/Makefile +59 -0
  5. digraphx-0.8/paper/delay_padding.md +686 -0
  6. digraphx-0.8/paper/delay_padding.pdf +0 -0
  7. digraphx-0.8/paper/figures/circuit_ring.tikz +52 -0
  8. digraphx-0.8/paper/figures/example_tcg.tikz +25 -0
  9. digraphx-0.8/paper/figures/padding_sweep.tikz +23 -0
  10. digraphx-0.8/paper/figures/pra_gate.tikz +73 -0
  11. digraphx-0.8/paper/figures/tcgraph.tikz +15 -0
  12. digraphx-0.8/paper/ieee.csl +519 -0
  13. digraphx-0.8/paper/latex.yaml +19 -0
  14. digraphx-0.8/paper/metadata.yaml +42 -0
  15. digraphx-0.8/paper/refs.bib +252 -0
  16. {digraphx-0.7 → digraphx-0.8}/setup.cfg +2 -2
  17. {digraphx-0.7 → digraphx-0.8}/src/digraphx/__init__.py +6 -0
  18. digraphx-0.8/src/digraphx/_cost_time.py +55 -0
  19. {digraphx-0.7 → digraphx-0.8}/src/digraphx/_cycle_base.py +128 -34
  20. digraphx-0.8/src/digraphx/_parametric_api.py +43 -0
  21. digraphx-0.8/src/digraphx/_parametric_base.py +161 -0
  22. digraphx-0.8/src/digraphx/_types.py +39 -0
  23. {digraphx-0.7 → digraphx-0.8}/src/digraphx/csr_digraph.py +7 -2
  24. digraphx-0.8/src/digraphx/css.py +110 -0
  25. digraphx-0.8/src/digraphx/mcf.py +388 -0
  26. {digraphx-0.7 → digraphx-0.8}/src/digraphx/min_cycle_ratio.py +7 -11
  27. {digraphx-0.7 → digraphx-0.8}/src/digraphx/min_parametric_q.py +12 -47
  28. {digraphx-0.7 → digraphx-0.8}/src/digraphx/neg_cycle.py +7 -34
  29. {digraphx-0.7 → digraphx-0.8}/src/digraphx/neg_cycle_q.py +10 -15
  30. {digraphx-0.7 → digraphx-0.8}/src/digraphx/parametric.py +12 -39
  31. {digraphx-0.7 → digraphx-0.8/src/digraphx.egg-info}/PKG-INFO +3 -3
  32. {digraphx-0.7 → digraphx-0.8}/src/digraphx.egg-info/SOURCES.txt +21 -2
  33. {digraphx-0.7 → digraphx-0.8}/src/digraphx.egg-info/scm_file_list.json +21 -2
  34. digraphx-0.8/src/digraphx.egg-info/scm_version.json +8 -0
  35. digraphx-0.8/tests/test_cost_time_api.py +39 -0
  36. digraphx-0.8/tests/test_css.py +165 -0
  37. digraphx-0.8/tests/test_graph_contract.py +128 -0
  38. digraphx-0.8/tests/test_neg_cycle_succ_verify.py +38 -0
  39. digraphx-0.7/src/digraphx/_parametric_base.py +0 -98
  40. digraphx-0.7/src/digraphx/mcf.py +0 -335
  41. digraphx-0.7/src/digraphx.egg-info/scm_version.json +0 -8
  42. digraphx-0.7/tests/test_delay_padding_example_howard.py +0 -141
  43. digraphx-0.7/tests/test_timing_example_howard.py +0 -153
  44. {digraphx-0.7 → digraphx-0.8}/.coveragerc +0 -0
  45. {digraphx-0.7 → digraphx-0.8}/.github/workflows/jekyll-gh-pages.yml +0 -0
  46. {digraphx-0.7 → digraphx-0.8}/.github/workflows/multi-platforms.yml +0 -0
  47. {digraphx-0.7 → digraphx-0.8}/.github/workflows/python-app.yml +0 -0
  48. {digraphx-0.7 → digraphx-0.8}/.github/workflows/python-publish.yml +0 -0
  49. {digraphx-0.7 → digraphx-0.8}/.gitignore +0 -0
  50. {digraphx-0.7 → digraphx-0.8}/.isort.cfg +0 -0
  51. {digraphx-0.7 → digraphx-0.8}/.pre-commit-config.yaml +0 -0
  52. {digraphx-0.7 → digraphx-0.8}/.readthedocs.yml +0 -0
  53. {digraphx-0.7 → digraphx-0.8}/.vscode/settings.json +0 -0
  54. {digraphx-0.7 → digraphx-0.8}/AGENTS.md +0 -0
  55. {digraphx-0.7 → digraphx-0.8}/AUTHORS.md +0 -0
  56. {digraphx-0.7 → digraphx-0.8}/CONTRIBUTING.md +0 -0
  57. {digraphx-0.7 → digraphx-0.8}/GEMINI.md +0 -0
  58. {digraphx-0.7 → digraphx-0.8}/LICENSE.txt +0 -0
  59. {digraphx-0.7 → digraphx-0.8}/README.md +0 -0
  60. {digraphx-0.7 → digraphx-0.8}/benchmarks/test_benchmarks.py +0 -0
  61. {digraphx-0.7 → digraphx-0.8}/coverage.json +0 -0
  62. {digraphx-0.7 → digraphx-0.8}/docs/Makefile +0 -0
  63. {digraphx-0.7 → digraphx-0.8}/docs/_static/.gitignore +0 -0
  64. {digraphx-0.7 → digraphx-0.8}/docs/authors.md +0 -0
  65. {digraphx-0.7 → digraphx-0.8}/docs/changelog.md +0 -0
  66. {digraphx-0.7 → digraphx-0.8}/docs/conf.py +0 -0
  67. {digraphx-0.7 → digraphx-0.8}/docs/contributing.md +0 -0
  68. {digraphx-0.7 → digraphx-0.8}/docs/examples/plot_cycle_detection.py +0 -0
  69. {digraphx-0.7 → digraphx-0.8}/docs/examples/plot_tiny_digraph.py +0 -0
  70. {digraphx-0.7 → digraphx-0.8}/docs/figures_demo.md +0 -0
  71. {digraphx-0.7 → digraphx-0.8}/docs/index.md +0 -0
  72. {digraphx-0.7 → digraphx-0.8}/docs/license.md +0 -0
  73. {digraphx-0.7 → digraphx-0.8}/docs/readme.md +0 -0
  74. {digraphx-0.7 → digraphx-0.8}/docs/requirements.txt +0 -0
  75. {digraphx-0.7 → digraphx-0.8}/environment.yml +0 -0
  76. {digraphx-0.7 → digraphx-0.8}/experimental/__init__.py +0 -0
  77. {digraphx-0.7 → digraphx-0.8}/experimental/spare_tsv.py +0 -0
  78. {digraphx-0.7 → digraphx-0.8}/experimental/test_spare_tsv.py +0 -0
  79. {digraphx-0.7 → digraphx-0.8}/experiments/experi-descent-new.py +0 -0
  80. {digraphx-0.7 → digraphx-0.8}/experiments/experi-descent-old.py +0 -0
  81. {digraphx-0.7 → digraphx-0.8}/experiments/experi-descent.py +0 -0
  82. {digraphx-0.7 → digraphx-0.8}/experiments/experi.py +0 -0
  83. {digraphx-0.7 → digraphx-0.8}/experiments/plot_node_colormap.ipynb +0 -0
  84. {digraphx-0.7 → digraphx-0.8}/experiments/plot_node_colormap.py +0 -0
  85. {digraphx-0.7 → digraphx-0.8}/mypy.ini +0 -0
  86. {digraphx-0.7 → digraphx-0.8}/note.md +0 -0
  87. {digraphx-0.7 → digraphx-0.8}/pyproject.toml +0 -0
  88. {digraphx-0.7 → digraphx-0.8}/requirements/README.md +0 -0
  89. {digraphx-0.7 → digraphx-0.8}/requirements/default.txt +0 -0
  90. {digraphx-0.7 → digraphx-0.8}/requirements/doc.txt +0 -0
  91. {digraphx-0.7 → digraphx-0.8}/requirements/test.txt +0 -0
  92. {digraphx-0.7 → digraphx-0.8}/requirements.txt +0 -0
  93. {digraphx-0.7 → digraphx-0.8}/setup.py +0 -0
  94. {digraphx-0.7 → digraphx-0.8}/src/digraphx/py.typed +0 -0
  95. {digraphx-0.7 → digraphx-0.8}/src/digraphx/tiny_digraph.py +0 -0
  96. {digraphx-0.7 → digraphx-0.8}/src/digraphx.egg-info/dependency_links.txt +0 -0
  97. {digraphx-0.7 → digraphx-0.8}/src/digraphx.egg-info/not-zip-safe +0 -0
  98. {digraphx-0.7 → digraphx-0.8}/src/digraphx.egg-info/requires.txt +0 -0
  99. {digraphx-0.7 → digraphx-0.8}/src/digraphx.egg-info/top_level.txt +0 -0
  100. {digraphx-0.7 → digraphx-0.8}/tests/__init__.py +0 -0
  101. {digraphx-0.7 → digraphx-0.8}/tests/conftest.py +0 -0
  102. {digraphx-0.7 → digraphx-0.8}/tests/test_coverage_extras.py +0 -0
  103. {digraphx-0.7 → digraphx-0.8}/tests/test_csr_digraph.py +0 -0
  104. {digraphx-0.7 → digraphx-0.8}/tests/test_cycle_ratio.py +0 -0
  105. {digraphx-0.7 → digraphx-0.8}/tests/test_edge_cases.py +0 -0
  106. {digraphx-0.7 → digraphx-0.8}/tests/test_howard_cycle_cancellation.py +0 -0
  107. {digraphx-0.7 → digraphx-0.8}/tests/test_mcf.py +0 -0
  108. {digraphx-0.7 → digraphx-0.8}/tests/test_min_cycle_ratio_extra.py +0 -0
  109. {digraphx-0.7 → digraphx-0.8}/tests/test_min_cycle_ratio_property.py +0 -0
  110. {digraphx-0.7 → digraphx-0.8}/tests/test_min_parametric_q.py +0 -0
  111. {digraphx-0.7 → digraphx-0.8}/tests/test_min_parametric_q_extra.py +0 -0
  112. {digraphx-0.7 → digraphx-0.8}/tests/test_neg_cycle.py +0 -0
  113. {digraphx-0.7 → digraphx-0.8}/tests/test_neg_cycle_q.py +0 -0
  114. {digraphx-0.7 → digraphx-0.8}/tests/test_neg_cycle_q_simple_timing.py +0 -0
  115. {digraphx-0.7 → digraphx-0.8}/tests/test_neg_cycle_simple_timing.py +0 -0
  116. {digraphx-0.7 → digraphx-0.8}/tests/test_parametric.py +0 -0
  117. {digraphx-0.7 → digraphx-0.8}/tests/test_stress.py +0 -0
  118. {digraphx-0.7 → digraphx-0.8}/tests/test_timing_example.py +0 -0
  119. {digraphx-0.7 → digraphx-0.8}/tests/test_tiny_digraph.py +0 -0
  120. {digraphx-0.7 → digraphx-0.8}/tests/test_tiny_digraph_property.py +0 -0
  121. {digraphx-0.7 → digraphx-0.8}/tox.ini +0 -0
  122. {digraphx-0.7 → digraphx-0.8}/tunable_parameter.md +0 -0
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 0.8 (2026-11-20)
4
+
5
+ ### Features
6
+ - **Clock Skew Scheduling API (`css.py`)**: Added `min_cycle_ratio`, `even`, `prop`, `cprop`, and `min_clock_period`, expressing the single-parameter CSS family (Min CP, EVEN, PROP, C-PROP) as one min-ratio-cycle engine over a shared `(cost, time)` abstraction. `min_clock_period` handles the max-ratio case via the negated-cost transformation. Exported from the package root.
7
+ - **Delay-padding example and figure**: Added `examples/delay_padding.py` with a `--tikz` mode that derives `paper/figures/padding_sweep.tikz` from the same demo calls, plus a `figures` Makefile target. The output is byte-identical to the hand-written figure. (#7c3f039, #05902fa)
8
+
9
+ ### Bug Fixes
10
+ - **CSS ratio name clash**: Renamed `css.min_cycle_ratio` to `css_ratio`; the new engine shadowed the pre-existing `min_cycle_ratio` submodule, so the root re-export was not the intended object. (#67d2b75)
11
+
12
+ ### Refactoring
13
+ - **Shared parametric/cycle cores and injected strategies**: Added `_types` as the single source for `Node`/`Arc`/`Domain`/`Ratio`/`Cycle` and a real `_parametric_api` ABC; replaced the minimize/alternate_direction flag matrix with `KeepSmaller`/`KeepLarger` and `HowardSearch`/`AlternatingSearch` strategies; moved negativity checking into the relaxation strategy; unified cost/time arithmetic in `CostTimeAPI`; gave MCF explicit `Flow`/`ResidualNetwork`/constraint objects. Public API unchanged. (#8d8205a)
14
+
15
+ ### Testing & Code Quality
16
+ - **Canonical CSS tests**: Added `tests/test_css.py` with the preserved golden values. Removed the duplicated `find_beta`/`even`/`prop` helpers by deleting `test_timing_example_howard.py` and `test_delay_padding_example_howard.py`; their golden values now live in `test_css.py`.
17
+ - **Graph-contract and parity tests**: Added graph-contract, successor-verification and cost/time parity coverage alongside the refactor. (#8d8205a)
18
+
19
+ ### Documentation
20
+ - **Multi-corner delay-padding paper**: Added the paper source. (#f96413e)
21
+
3
22
  ## Version 0.7 (2026-10-09)
4
23
 
5
24
  ### Features
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: digraphx
3
- Version: 0.7
4
- Summary: Network Optimization Python Code
3
+ Version: 0.8
4
+ Summary: Directed graph algorithms for network optimization
5
5
  Home-page: https://github.com/luk036/digraphx
6
6
  Author: Wai-Shing Luk
7
7
  Author-email: luk036@gmail.com
8
8
  License: MIT
9
- Project-URL: Documentation, https://pyscaffold.org/
9
+ Project-URL: Documentation, https://luk036.github.io/digraphx/
10
10
  Platform: any
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Programming Language :: Python
@@ -0,0 +1,185 @@
1
+ """Delay padding demo on a four-flip-flop ring with a reconvergent path.
2
+
3
+ A local data path from ``FF_i`` to ``FF_j`` is ONE block of combinational logic
4
+ whose delay runs between a minimum ``d_ij`` (early/fast) and a maximum ``D_ij``
5
+ (late/slow). The two numbers describe the SAME data path: setup uses ``D_ij``,
6
+ hold uses ``d_ij``.
7
+
8
+ Delay padding inserts extra delay into that logic. The point of this demo is
9
+ that an insertion only helps when it raises ``d_ij`` without raising ``D_ij`` --
10
+ which is possible only where the minimum-delay route and the maximum-delay route
11
+ differ. On a shared segment both delays rise together and the clock period does
12
+ not move.
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+ import argparse
18
+ from pathlib import Path
19
+ from typing import Dict, List, Optional, Sequence, Tuple
20
+
21
+ from digraphx import min_clock_period
22
+
23
+ Path_ = Tuple[str, str]
24
+ Edge = Dict[str, object]
25
+ Graph = Dict[str, Dict[str, Dict[str, object]]]
26
+ Sweep = List[Tuple[float, float, float]]
27
+
28
+ DATA_PATHS: Dict[Path_, Tuple[float, float]] = {
29
+ ("A", "B"): (12.0, 3.0),
30
+ ("B", "C"): (4.0, 4.0),
31
+ ("C", "D"): (4.0, 4.0),
32
+ ("D", "A"): (4.0, 4.0),
33
+ }
34
+ """Ring ``A -> B -> C -> D -> A``; each value is ``(D_ij, d_ij)``.
35
+
36
+ ``A -> B`` is a reconvergent cone: a shared prefix (delay 2) that fans out into
37
+ a long branch (5 + 5) and a short branch (1), so ``D_AB = 12`` and ``d_AB = 3``.
38
+ """
39
+
40
+ SWEEP: Sequence[float] = (0.0, 1.0, 2.0, 3.0, 4.0, 5.0)
41
+ """Padding amounts swept by both the printed table and the paper figure."""
42
+
43
+
44
+ def build(
45
+ delta_D: Dict[Path_, float] | None = None,
46
+ delta_d: Dict[Path_, float] | None = None,
47
+ ) -> Graph:
48
+ """Build the timing constraint graph, optionally perturbing delays.
49
+
50
+ Args:
51
+ delta_D: extra delay added to ``D_ij`` (raises the setup path) per pair.
52
+ delta_d: extra delay added to ``d_ij`` (raises the hold path) per pair.
53
+ """
54
+ delta_D = delta_D or {}
55
+ delta_d = delta_d or {}
56
+ g: Graph = {}
57
+ for (i, j), (D, d) in DATA_PATHS.items():
58
+ D += delta_D.get((i, j), 0.0)
59
+ d += delta_d.get((i, j), 0.0)
60
+ g.setdefault(j, {})[i] = {"type": "s", "delay": D}
61
+ g.setdefault(i, {})[j] = {"type": "h", "delay": d}
62
+ return g
63
+
64
+
65
+ def period(
66
+ delta_D: Dict[Path_, float] | None = None,
67
+ delta_d: Dict[Path_, float] | None = None,
68
+ ) -> float:
69
+ """Minimum feasible clock period after the given perturbations."""
70
+ g = build(delta_D, delta_d)
71
+ return min_clock_period(g, {node: 0.0 for node in g})[0]
72
+
73
+
74
+ def pad_shared(amount: float) -> float:
75
+ """Pad the shared prefix of ``A -> B``: raises ``D_AB`` and ``d_AB`` together."""
76
+ return period(delta_D={("A", "B"): amount}, delta_d={("A", "B"): amount})
77
+
78
+
79
+ def pad_min_only(amount: float) -> float:
80
+ """Pad the minimum-only branch of ``A -> B``: raises ``d_AB`` alone."""
81
+ return period(delta_d={("A", "B"): amount})
82
+
83
+
84
+ def setup_floor() -> float:
85
+ """Setup-only bound: no amount of hold padding can beat it."""
86
+ return sum(D for D, _ in DATA_PATHS.values()) / len(DATA_PATHS)
87
+
88
+
89
+ def sweep() -> Sweep:
90
+ """``(padding, min-only period, shared period)`` for every padding amount."""
91
+ return [(amount, pad_min_only(amount), pad_shared(amount)) for amount in SWEEP]
92
+
93
+
94
+ def tikz(rows: Optional[Sweep] = None) -> str:
95
+ """Render the padding sweep as a pgfplots axis, ready for ``\\input``."""
96
+ rows = sweep() if rows is None else rows
97
+ min_only = "".join(f"({a:g},{p:g})" for a, p, _ in rows)
98
+ shared = "".join(f"({a:g},{p:g})" for a, _, p in rows)
99
+ x_max = max(a for a, _, _ in rows)
100
+ y_max = max(max(p, q) for _, p, q in rows) + 1.0
101
+ return f"""\\begin{{tikzpicture}}
102
+ \\begin{{axis}}[
103
+ width=0.82\\linewidth,
104
+ height=5.4cm,
105
+ xlabel={{added delay on the $A\\to B$ logic}},
106
+ ylabel={{minimum clock period}},
107
+ xmin=0, xmax={x_max:g}, ymin=0, ymax={y_max:g},
108
+ domain=0:{x_max:g},
109
+ grid=both, grid style={{gray!25}},
110
+ legend pos=north east, legend cell align=left,
111
+ every axis plot/.append style={{thick}},
112
+ ]
113
+ % padding the min-only branch lowers the period ...
114
+ \\addplot[color=red, mark=*] coordinates {{{min_only}}};
115
+ \\addlegendentry{{pad min-only branch}}
116
+ % ... padding the shared prefix moves both delays and changes nothing.
117
+ \\addplot[color=blue, mark=square*] coordinates {{{shared}}};
118
+ \\addlegendentry{{pad shared prefix}}
119
+ % setup-only floor: no hold padding can beat it.
120
+ \\addplot[color=black, dashed, mark=none] {{{setup_floor():g}}};
121
+ \\addlegendentry{{setup-only floor}}
122
+ \\end{{axis}}
123
+ \\end{{tikzpicture}}
124
+ """
125
+
126
+
127
+ def report() -> None:
128
+ """Print the narrative used in the paper."""
129
+ print("Delay padding demo: a 4-flip-flop ring with a reconvergent path\n")
130
+ print("Model")
131
+ print(" a local data path i -> j is ONE block of logic with")
132
+ print(
133
+ " D_ij = maximum path delay (setup) and d_ij = minimum path delay (hold)"
134
+ )
135
+ print(" minimum period = max over cycles of")
136
+ print(" (sum of setup delays - sum of hold delays) / (# setup edges)\n")
137
+
138
+ base = period()
139
+ print("[1] Baseline -- clock skew scheduling only")
140
+ print(f" minimum feasible clock period : {base:.2f}")
141
+ print(" limiting cycle : pair (A, B), D_AB - d_AB = 12 - 3\n")
142
+
143
+ shared = pad_shared(3.0)
144
+ print("[2] Pad the SHARED prefix of A -> B (raises D_AB and d_AB together)")
145
+ print(
146
+ f" added delay 3.00 -> period {shared:.2f} (inert: D_AB - d_AB is unchanged)"
147
+ )
148
+ print(" a simple 1-2 gate path behaves the same way: D_ij = d_ij\n")
149
+
150
+ min_only = pad_min_only(3.0)
151
+ gain = 100.0 * (base - min_only) / base
152
+ print("[3] Pad the MIN-ONLY branch of A -> B (raises d_AB alone)")
153
+ print(f" added delay 3.00 -> period {min_only:.2f} ({gain:.1f}% faster)")
154
+ print(" only a route that misses every maximum-delay route can do this\n")
155
+
156
+ print("[4] Sweep of padding on A -> B")
157
+ print(" pad min-only shared")
158
+ for amount, min_only_period, shared_period in sweep():
159
+ print(f" {amount:4.1f} {min_only_period:8.2f} {shared_period:6.2f}")
160
+ print(
161
+ f" floor at {setup_floor():.2f} = (12 + 4 + 4 + 4) / 4 setup-only bound\n"
162
+ )
163
+
164
+ print("[5] The simple paths B -> C, C -> D, D -> A have D = d,")
165
+ print(" so no insertion can separate their setup and hold delays.")
166
+
167
+
168
+ def main(argv: Optional[Sequence[str]] = None) -> None:
169
+ parser = argparse.ArgumentParser(description="Delay padding demo")
170
+ parser.add_argument(
171
+ "--tikz",
172
+ type=Path,
173
+ metavar="PATH",
174
+ help="write the padding-sweep figure as TikZ and exit",
175
+ )
176
+ args = parser.parse_args(argv)
177
+ if args.tikz is not None:
178
+ with args.tikz.open("w", encoding="utf-8", newline="\n") as handle:
179
+ handle.write(tikz())
180
+ return
181
+ report()
182
+
183
+
184
+ if __name__ == "__main__":
185
+ main()
@@ -0,0 +1,59 @@
1
+ # Build pipeline for "Novel Multi-Corner Delay Padding ...".
2
+ # Run from paper/ (`make paper` builds delay_padding.pdf).
3
+ #
4
+ # Flag rationale (see also the md-to-latex skill); recorded here so the
5
+ # knowledge is not tribal:
6
+ # - Title/author/abstract live in metadata.yaml, so the body headings start
7
+ # at `#` and map directly to \section. We therefore do NOT pass
8
+ # --shift-heading-level-by=-1 (there is no title H1 in the body).
9
+ # - --citeproc --csl=ieee.csl : IEEE numeric in-text citations and a numeric
10
+ # reference list. ieee.csl is vendored here and is self-contained (no
11
+ # <link rel="independent-parent">), so the build needs no network access.
12
+ # - -N : number sections/subsections.
13
+ # - --pdf-engine=pdflatex : every equation and caption is ASCII, so pdflatex
14
+ # is sufficient; no xelatex / Unicode font fallback is required.
15
+ # - -V geometry:margin=1in : comfortable single-column page.
16
+ #
17
+ # Figures are native TikZ pulled in with \input{figures/*.tikz}. We do not
18
+ # convert SVGs (a fontless rsvg-convert silently drops every <text>), and the
19
+ # four structural configurations ship as .tikz sources next to this Makefile.
20
+ #
21
+ # We deliberately do NOT use pandoc-crossref/cleveref: plain LaTeX
22
+ # \label/\ref/\eqref handles every cross-reference and is robust across
23
+ # document classes.
24
+
25
+ PANDOC ?= pandoc
26
+ CSL ?= ieee.csl
27
+ BIB ?= refs.bib
28
+ MD = delay_padding.md
29
+ OUT = delay_padding.pdf
30
+
31
+ PDFFLAGS = -s -t latex -N --pdf-engine=pdflatex \
32
+ --pdf-engine-opt=-interaction=nonstopmode \
33
+ --citeproc --csl=$(CSL) \
34
+ -V geometry:margin=1in
35
+
36
+ .PHONY: paper pdf html tex figures clean
37
+
38
+ paper: pdf
39
+
40
+ pdf: $(OUT)
41
+
42
+ $(OUT): $(MD) metadata.yaml latex.yaml $(BIB) $(CSL) $(wildcard figures/*.tikz)
43
+ $(PANDOC) $(PDFFLAGS) metadata.yaml latex.yaml $(MD) -o $(OUT)
44
+
45
+ figures: figures/padding_sweep.tikz
46
+
47
+ figures/padding_sweep.tikz: ../examples/delay_padding.py
48
+ python ../examples/delay_padding.py --tikz $@
49
+
50
+ html: $(MD) metadata.yaml latex.yaml $(BIB) $(CSL)
51
+ $(PANDOC) -s -t html5 --citeproc --csl=$(CSL) --mathjax --embed-resources \
52
+ metadata.yaml latex.yaml $(MD) -o delay_padding.html
53
+
54
+ tex: $(MD) metadata.yaml latex.yaml $(BIB) $(CSL)
55
+ $(PANDOC) -s -t latex -N --citeproc --csl=$(CSL) \
56
+ metadata.yaml latex.yaml $(MD) -o delay_padding.tex
57
+
58
+ clean:
59
+ rm -f $(OUT) delay_padding.tex delay_padding.html