dolanmiu / docx

Easily generate and modify .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
https://docx.js.org/
MIT License
4.24k stars 480 forks source link

FontSize Math formulas in lastest version docx #2703

Open Behemoth0 opened 2 months ago

Behemoth0 commented 2 months ago

How can I make the font size of the formula itself in this code in the latest version of docx size 14, by default formulas are created in size 10. here is the code:


const paragraph33 = new Paragraph({
                    children: [
                        new Math({
                            children: [
                                new MathRun(`Std=${window.STD.Sj}+${vaValuesJ2[i]}×`),
                                new MathFraction({
                                    numerator: [new MathRun(`${optionT3_2}`)],
                                    denominator: [new MathRun("7.2")],

                                }),
                                new MathRun(`-${window.STD.L}-${window.STD.C}=${Number(window.jResult['J2'].std[`va${i + 1}`]).toFixed(2)}`),

                            ],
                        }),
                    ],
                });
                paragraphs.push(paragraph33);

Thnx for answer)

Behemoth0 commented 2 months ago

I will be very grateful if you show me an example of part of my code that I provided)

Behemoth0 commented 2 months ago

Will someone answer me here or not? This is really important to me for the project.

Behemoth0 commented 2 months ago

Where is developer?

Behemoth0 commented 1 month ago

Is anyone alive? Is the project already dead or what? Developer?

Behemoth0 commented 1 month ago

@dolanmiu

anti-the-social commented 1 month ago

I do not investigate open source related issues if someone demands it. But since its open source you can investigate yourself and propose changes to the library yourself if needed and/or something missing.

Behemoth0 commented 1 month ago

@anti-the-social So I said what the problem is: in Math you cannot set the font size in the formula. And he asked how this could be solved. And as an option, I propose to add to the new version of the library the ability to edit the Math font size