Simple question -- how do you make latex equations fit inline with text? I've tried messing around with the code but it forces me to make it in display format. Thanks!
Instead of `\[ \]`, use `\( \)` for inline text.
I doubt it will be every day that you will need to include some text within an equation. However, sometimes it needs to be done. Just sticking the text straight in the maths environment won't give you the results you want. For example: \begin{equation} 50 apples \times 100 apples = lots of apples \end{equation} Equation with no distinct words There are two noticeable problems. Firstly, there are no spaces between numbers and text, nor spaces between multiple words. Secondly, the words don't look quite right --- the letters are more spaced out than normal. Both issues are simply artifacts of the maths mode, in that it doesn't expect to see words. Any spaces that you type in maths mode are ignored and LaTeX spaces elements according to its own rules. It is assumed that any characters represent variable names. To emphasise that each symbol is an individual, they are not positioned as closely together as with normal text. There are a number of ways that text can be added properly. The typical way is to wrap the text with the \mbox{...} command. This command hasn't been introduced before, however, it's job is basically to create a text box just width enough to contain the supplied text. Text within this box cannot be broken across lines. Let's see what happens when the above equation code is adapted: Equation using mboxes to display distinct words using mbox The text looks better. However, there are no gaps between the numbers and the words. Unfortunately, you are required to explicitly add these. There are many ways to add spaces between maths elements, however, for the sake of simplicity, I find it easier, in this instance at least, just to literally add the space character in the affected \mbox(s) itself (just before the text.) \begin{equation} 50 \mbox{ apples} \times 100 \mbox{ apples} = \mbox{lots of apples} \end{equation}
Thanks guys! The first reply was what I was looking for, but I am definitely glad to know that \mbox wrapping now. Will definitely make things a little bit better now :)
Join our real-time social learning platform and learn together with your friends!