How I make in Latex the modulus, or absolute value, match the size of the expression within? I want to know what are the sizes available.
Example:
$$\mid\frac{\partial I}{\partial M}\mid
= \frac{T^2 dg}{4\pi^2}$$
How I make in Latex the modulus, or absolute value, match the size of the expression within? I want to know what are the sizes available.
Example:
$$\mid\frac{\partial I}{\partial M}\mid
= \frac{T^2 dg}{4\pi^2}$$
I suggest you load the mathtools package and define a macro called \abs as follows:
\usepackage{mathtools} % for '\DeclarePairedDelimiter' macro
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
Then, in the body of the document, you'd write
\[
\abs*{\frac{\partial I}{\partial M}} = \frac{T^2 dg}{4\pi^2}
\]
The * ("star" or "asterisk") symbol after \abs indicates to LaTeX that the delimiter symbols (here: plain vertical bars) should be scaled vertically to the height and depth of the macro's argument.
Here's a screenshot to compare the look of the auto-sized fences (which happens to corresponds to \bigg) and of the look that results from choosing \Big manually. Speaking for myself, I have slight preference for look produced by the manually-chosen size.
\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\begin{document}
auto-sized (\texttt{\textbackslash bigg}):
[
\abs*{\frac{\partial I}{\partial M}} = \frac{T^2 dg}{4\pi^2}
]
\bigskip
using \texttt{\textbackslash Big} directly:
[
\abs[\Big]{\frac{\partial I}{\partial M}} = \frac{T^2 dg}{4\pi^2}
]
\end{document}
Use
\[\left|\frac{\partial I}{\partial M}\right|
= \frac{T^2 dg}{4\pi^2}\]
instead. Note that \mid is a relation symbol, and not appropriate here. It produces different spacing, for one.
The \left…\right construction can be used with all kinds of parentheses, brackets, and the like.
(Incidentally, replaced $$ by proper math delimiters.)
\[ … \] preferable to $$? suffices
– egreg
May 02 '16 at 19:42
\midbut biggest. How I make this? What are the sizes that I can choose? – Carmen González Apr 14 '16 at 14:00$$\mid\frac{\partial I}{\partial M}\mid = \frac{T^2 dg}{4\pi^2}$$in this context I wanna the\midbiggest to the partial derivation fit here. – Carmen González Apr 14 '16 at 14:06$$\left|\frac{\partial I}{\partial M}\right| = \frac{T^2 dg}{4\pi^2}$$a solution to your question? – Harald Hanche-Olsen Apr 14 '16 at 14:24\midis clearly not the correct symbol here as it does not scale (as it is not a fence). I even see users using||x||for norms which is also wrong. You might want to look up the definition of\absin themathtoolspackage (it is an example of the\DeclarePairedDelimitermacro) – daleif Apr 14 '16 at 14:41$$for display maths if you are using LaTeX unless your system is at least 20 years out of date. – cfr Apr 14 '16 at 23:31