Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small scale in SVG output #288

Open
vladtimss opened this issue Nov 15, 2023 · 3 comments
Open

Small scale in SVG output #288

vladtimss opened this issue Nov 15, 2023 · 3 comments
Assignees

Comments

@vladtimss
Copy link

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}
@OlgaRedozubova
Copy link
Contributor

@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

@vladtimss
Copy link
Author

@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?

@OlgaRedozubova
Copy link
Contributor

MathJax v3 does not have automatic line wrapping mathjax/MathJax#3154 (comment)
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants