UI: Clean up typesetting of Corp ingredient formulas (#819)

This commit is contained in:
Jesse Clark 2023-10-02 17:13:41 -07:00 committed by GitHub
parent 3f0c10adf4
commit 7f575eb34c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,11 +11,11 @@ export function IndustryProductEquation(props: IProps): React.ReactElement {
const reqs = [];
for (const [reqMat, reqAmt] of getRecordEntries(props.division.requiredMaterials)) {
if (!reqAmt) continue;
reqs.push(String.raw`${reqAmt}\text{ }${reqMat}`);
reqs.push(String.raw`${reqAmt}\;\textit{${reqMat}}`);
}
const prod = props.division.producedMaterials.map((p) => `1\\text{ }${p}`);
const prod = props.division.producedMaterials.map((p) => `1\\;\\textit{${p}}`);
if (props.division.makesProducts) {
prod.push("Products");
prod.push("\\textit{Products}");
}
return <MathJax>{"\\(" + reqs.join("+") + `\\Rightarrow ` + prod.join("+") + "\\)"}</MathJax>;