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

Investigate using true display mode #10

Open
szhorvat opened this issue Feb 10, 2017 · 3 comments
Open

Investigate using true display mode #10

szhorvat opened this issue Feb 10, 2017 · 3 comments
Assignees

Comments

@szhorvat
Copy link
Owner

As of version 1.7, MaTeX only supports inline math. It achieves the display style look using \displaystyle.

There are certain commands that only work in display mode, such as \begin{multline} or \begin{split}. Unfortunately cropping tightly and not setting a page width with the standalone package is problematic.

TODO: Investigate if there are any good solutions for allowing true display mode. What compromises will be necessary?

@szhorvat szhorvat self-assigned this Feb 10, 2017
@szhorvat
Copy link
Owner Author

The problem with true display mode is that it expects to know the page width, which does not exist when using MaTeX.

\parbox can be used to specify an effective page width.

MaTeX[
 "\\text{\\parbox{5cm}{
 \\[ \\int_0^\\infty x^\\ell e^{-\\alpha x} \\; dx \\]
 }}"
 ]

@veltsov
Copy link

veltsov commented Apr 29, 2020

For me standalone works fine with display math. You need to use varwidth=true option.
Pdflatex of

\documentclass[10pt,varwidth=true]{standalone}
\begin{document}
$$ \alpha = \left[ \int_0^{2\pi} \sqrt{ b^2 + \sin^2 x} \, dx \right]^{-1} $$
\end{document}

produces attached pdf.
test-sa.pdf

@szhorvat
Copy link
Owner Author

Thanks for the note. I should take another look at this again someday. As I recall, there were some issues with cropping, or perhaps with determining the result dimensions so that the result can be sized accurately in Mathematica. I need to check again as I don't remember ...

Currently, if you need true display mode, you can make use of the \parbox workaround shown in the docs (search for parbox on the doc page).

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

No branches or pull requests

2 participants