mathpix-markdown-it icon indicating copy to clipboard operation
mathpix-markdown-it copied to clipboard

Small scale in SVG output

Open vladtimss opened this issue 1 year ago • 3 comments

Hi! Many thanks for your project!

I have a problem of small scale in output. Could you give some advices how increase text in such formula syntax. I'm attaching screen and code below. I need center text and at the same time i want become something like in jupyter render

This is mathpix

image

This is jupyter

image

code

\begin{aligned}
\min\quad & 1.1 Portions_{1} + 1.43 Portions_{2} + 0.51 Portions_{3} + 0.49 Portions_{4} + 0.67 Portions_{5} + 0.72 Portions_{6} + 0.55 Portions_{7} + 0.95 Portions_{8} + 0.51 Portions_{9} + 0.32 Portions_{10} + 1.31 Portions_{11} + 1.23 Portions_{12} + 1.15 Portions_{13} + 1.17 Portions_{14} + 1.46 Portions_{15} + 2.12 Portions_{16} + 0.27 Portions_{17} + 1.67 Portions_{18} + 0.78 Portions_{19} + 0.91 Portions_{20}\\
\text{Subject to} \quad & Portions_{1} \geq 0.0\\
 & Portions_{2} \geq 0.0\\
 & Portions_{3} \geq 0.0\\
 & Portions_{4} \geq 0.0\\
 & Portions_{5} \geq 0.0\\
 & Portions_{6} \geq 0.0\\
 & Portions_{7} \geq 0.0\\
 & Portions_{8} \geq 0.0\\
 & Portions_{9} \geq 0.0\\
 & Portions_{10} \geq 0.0\\
 & Portions_{11} \geq 0.0\\
 & Portions_{12} \geq 0.0\\
 & Portions_{13} \geq 0.0\\
 & Portions_{14} \geq 0.0\\
 & Portions_{15} \geq 0.0\\
 & Portions_{16} \geq 0.0\\
 & Portions_{17} \geq 0.0\\
 & Portions_{18} \geq 0.0\\
 & Portions_{19} \geq 0.0\\
 & Portions_{20} \geq 0.0\\
\end{aligned}

vladtimss avatar Nov 15 '23 14:11 vladtimss

@vladtimss We can use nested array for it.

\begin{aligned}
\min\quad & {
\begin{array}
1.1 Portions_{1} + 1.43 Portions_{2} + 0.51 Portions_{3} + 0.49 Portions_{4} + 0.67 Portions_{5} + 0.72 Portions_{6} + 0.55 Portions_{7} + 0.95 Portions_{8} \\+ 0.51 Portions_{9} + 0.32 Portions_{10} + 1.31 Portions_{11} + 1.23 Portions_{12} + 1.15 Portions_{13} + 1.17 Portions_{14} + 1.46 Portions_{15} \\+ 2.12 Portions_{16} + 0.27 Portions_{17} + 1.67 Portions_{18} + 0.78 Portions_{19} + 0.91 Portions_{20}
\end{array}
}\\
\text{Subject to} \quad & Portions_{1} \geq 0.0\\
 & Portions_{2} \geq 0.0\\
 & Portions_{3} \geq 0.0\\
 & Portions_{4} \geq 0.0\\
 & Portions_{5} \geq 0.0\\
 & Portions_{6} \geq 0.0\\
 & Portions_{7} \geq 0.0\\
 & Portions_{8} \geq 0.0\\
 & Portions_{9} \geq 0.0\\
 & Portions_{10} \geq 0.0\\
 & Portions_{11} \geq 0.0\\
 & Portions_{12} \geq 0.0\\
 & Portions_{13} \geq 0.0\\
 & Portions_{14} \geq 0.0\\
 & Portions_{15} \geq 0.0\\
 & Portions_{16} \geq 0.0\\
 & Portions_{17} \geq 0.0\\
 & Portions_{18} \geq 0.0\\
 & Portions_{19} \geq 0.0\\
 & Portions_{20} \geq 0.0\\
 \\
 \min\quad & {
\qquad\begin{array}
1.1 Portions_{1} + 1.43 Portions_{2} + 0.51 Portions_{3} + 0.49 Portions_{4} + 0.67 Portions_{5} + 0.72 Portions_{6} + 0.55 Portions_{7} + 0.95 Portions_{8} \\+ 0.51 Portions_{9} + 0.32 Portions_{10} + 1.31 Portions_{11} + 1.23 Portions_{12} + 1.15 Portions_{13} + 1.17 Portions_{14} + 1.46 Portions_{15} \\+ 2.12 Portions_{16} + 0.27 Portions_{17} + 1.67 Portions_{18} + 0.78 Portions_{19} + 0.91 Portions_{20}
\end{array}
}
\end{aligned}
Screen Shot 2023-11-22 at 12 51 36

OlgaRedozubova avatar Nov 22 '23 10:11 OlgaRedozubova

@vladtimss We can use nested array for it.

\begin{aligned}
\min\quad & {
\begin{array}
1.1 Portions_{1} + 1.43 Portions_{2} + 0.51 Portions_{3} + 0.49 Portions_{4} + 0.67 Portions_{5} + 0.72 Portions_{6} + 0.55 Portions_{7} + 0.95 Portions_{8} \\+ 0.51 Portions_{9} + 0.32 Portions_{10} + 1.31 Portions_{11} + 1.23 Portions_{12} + 1.15 Portions_{13} + 1.17 Portions_{14} + 1.46 Portions_{15} \\+ 2.12 Portions_{16} + 0.27 Portions_{17} + 1.67 Portions_{18} + 0.78 Portions_{19} + 0.91 Portions_{20}
\end{array}
}\\
\text{Subject to} \quad & Portions_{1} \geq 0.0\\
 & Portions_{2} \geq 0.0\\
 & Portions_{3} \geq 0.0\\
 & Portions_{4} \geq 0.0\\
 & Portions_{5} \geq 0.0\\
 & Portions_{6} \geq 0.0\\
 & Portions_{7} \geq 0.0\\
 & Portions_{8} \geq 0.0\\
 & Portions_{9} \geq 0.0\\
 & Portions_{10} \geq 0.0\\
 & Portions_{11} \geq 0.0\\
 & Portions_{12} \geq 0.0\\
 & Portions_{13} \geq 0.0\\
 & Portions_{14} \geq 0.0\\
 & Portions_{15} \geq 0.0\\
 & Portions_{16} \geq 0.0\\
 & Portions_{17} \geq 0.0\\
 & Portions_{18} \geq 0.0\\
 & Portions_{19} \geq 0.0\\
 & Portions_{20} \geq 0.0\\
 \\
 \min\quad & {
\qquad\begin{array}
1.1 Portions_{1} + 1.43 Portions_{2} + 0.51 Portions_{3} + 0.49 Portions_{4} + 0.67 Portions_{5} + 0.72 Portions_{6} + 0.55 Portions_{7} + 0.95 Portions_{8} \\+ 0.51 Portions_{9} + 0.32 Portions_{10} + 1.31 Portions_{11} + 1.23 Portions_{12} + 1.15 Portions_{13} + 1.17 Portions_{14} + 1.46 Portions_{15} \\+ 2.12 Portions_{16} + 0.27 Portions_{17} + 1.67 Portions_{18} + 0.78 Portions_{19} + 0.91 Portions_{20}
\end{array}
}
\end{aligned}
Screen Shot 2023-11-22 at 12 51 36

unfortunately it does not work for me because of i get this content from server and i find some universal solution how increase svg scale with wrapping content. Do you have any ideas?

vladtimss avatar Jul 19 '24 08:07 vladtimss

MathJax v3 does not have automatic line wrapping https://github.com/mathjax/MathJax/issues/3154#issuecomment-1875397322 Perhaps this will be implemented in MathJax v4, but v4 is still under development

In snip-web, we use scaling to ensure that huge formulas fit into the content; this leads to a smaller formula.

If you disable this, the formula will go beyond the content You can check it here https://htmlpreview.github.io/?https://github.com/Mathpix/mathpix-markdown-it/blob/master/examples/html/input-mmd-to-html.html

Screenshot 2024-07-22 at 11 24 56

OlgaRedozubova avatar Jul 22 '24 08:07 OlgaRedozubova