# make image of a mathematics formula for inclusion in OneNote

I have found the pseudo-latex in the Macos version of OneNote frustrating---I can't get the formulas to look right. What is the simplest method to use LaTeX or pdflatex to make an image of a mathematics formula that I can insert into OneNote as a picture?

My formulas will normally occupy only part of a single line of output, for example $x+y = z$. It would be ideal if Latex were to compute the size of the typeset formula, and then produce a pdf of exactly that size (or slightly bigger). If possible, I would like to avoid my usual time-consuming manual labour of repeatedly cropping and scaling the pdf, so as to get everything looking right. I found a previous discussion at LaTeX math as an image of a specific size but the solution given there involves using additional programs, whereas it seems to me that LaTeX should be able to do a job like this unaided and very well. I also found Pixel-perfect vertical alignment of image-rendered TeX snippets? but that seems to involve a lot of meticulous labour and anyway the product is html, which I don't think is relevant to my problem.

I'm not worried about alignment problems---I will almost certainly have to move the images a little manually in OneNote, no matter what method I use to produce the images.

You might use \documentclass{standalone} for this. Then, set the equation in display mode with \[. You could put other kinds of content inside a \begin{minipage} of the set width.
I highly recommend a free macOS program called LaTeXiT, which is supplied with Mac TeX distributions (or available here: https://www.chachatelier.fr/latexit/index.php ). It lets you create a library of equations and expressions that can be sized and drag-and-dropped into other applications. You can also have multiple customized preambles for different situations.