Hot answers tagged equations
11
Here goes an answer:
\documentclass{amsart}
\begin{document}
\begin{align*}
&CoJPoD_{ \{I_1, \dots, I_{k-1}, I_{k+1}, \dots, I_{n}\} \mid I_{k} } \\
&= CoJPoD_{ \{\mathrm{system} \backslash I_{k}\} \mid I_k} \\
&= P\bigl( X_1 \ge X_d^{I_1}, \dots, X_{k-1} \ge X_d^{I_{k-1}}, X_{k+1} \ge X_d^{I_{k+1}}, \dots, X_n \ge X_d^{I_n} \mid X_k \ge ...
11
I think you are after aligned:
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\Div}{div}
\DeclareMathOperator{\Rot}{rot}
\newcommand{\parder}[2]{\frac{\partial {#1}}{\partial {#2}}}
\begin{document}
\begin{align}
\label{18.1:1}
\begin{aligned}
\Rot\vec{E} &=-\frac{1}{c}\parder{\vec{B}}{t},&
\Div\vec{B} &=0,
...
10
The following may be close to what you're looking for:
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\diag}{diag}
\begin{document}
\[
\text{Minimize\quad}
\| A^{\text{ind}} w \diag(x^{\text{ind}}) \|
\]
\[
\begin{array}{r @{}c@{} c @{}c@{} l}
\text{subject to:\quad}w&{}={}&\multicolumn{1}{@{}l}{b-s+w^0}\\
l^b &\le& b ...
9
Just use split:
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\Div}{div}
\DeclareMathOperator{\Rot}{rot}
\newcommand\parder[2]{\frac{\partial #1}{\partial #2}}
\begin{document}
\begin{align}
\label{18.1:1}
\begin{split}
\Rot\vec{E} &=-\frac{1}{c}\parder{\vec{B}}{t},
\\
\Div\vec{B} &=0,
\end{split}
\\[2ex]
\label{18.1:2}
...
8
I don't think numbering inline-math equations is wise, because
It might be difficult for your readers to locate those numbered inline equations in a block of text; inline math doesn't stand out as much from the main text as display math does.
The equation number, since it does not get flushed to the right (as it does by default in display math), may be ...
8
It would be completely acceptable to create a macro that does all of that for you. That is, both set a \label and immediately \eqref it:
\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\newcounter{peqrefcntr}
\makeatletter
\newcommand{\pseudoeqref}[1]{{% \pseudoeqref{<whatever>}
\refstepcounter{peqrefcntr}% Increment the ...
8
Just look at the definition of \eqref in amsmath.sty:
\newcommand{\eqref}[1]{\textup{\tagform@{\ref{#1}}}}
Then it's easy to define your personal command in the preamble:
\makeatletter
\newcommand{\pseudoeqref}[1]{\textup{\tagform@{#1}}}
\makeatother
Complete example:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
...
8
For any kind of display math you should load the amsmath package.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
x + (y - 2)^4 = w^2 \\
(x - 9)^2 + y_2^2 = w^2 \\
x + (y - 2)^4 = w^2 = (x - 9)^2 + y_2^2
\end{gather*}
\end{document}
7
Well, you can use the following for further improvements (you can remove \qquad, avoid \parallel etc.) but it will be progressively uglier;
\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\diagpars}{(}{)}
\newcommand{\diag}{\operatorname{diag}\diagpars}
\newcommand{\norm}[1]{\displaystyle \left\| #1 \right\|}
\begin{document}
\[
...
7
Here's one possibility; I used an align environment to align the quantified expressions; to get the left parts centered, I used some boxes with centered content; the \Ceneq command places its argument in a box whose width correspomds to the wider expression:
\documentclass{report}
\usepackage{amsmath}
\newlength\longest
\newcommand\Ceneq[1]{%
...
6
As detailed in align vs equation there are some occasions when the equation environment is more appropriate
I have moved your \text{...} into text mode in between the equation and align environment.
% arara: pdflatex
% !arara: indent: {overwrite: true, trace: true}
\documentclass{article}
\usepackage{amsmath}
\begin{document}
...
6
The empheq package is your friend. The wide box is made with a normal box, with some space left and right, that you can adjust to your likings.
\documentclass[11pt]{article}
\usepackage{empheq}
\newcommand*\widefbox[1]{\fbox{\hspace{2em}#1\hspace{2em}}}
\begin{document}
\begin{empheq}[box=\widefbox]{equation}
\bar{\nabla}^{\mu} \bar{h}_{\mu\nu} = 0
...
6
A simple solution would simply be left aligning the constraints, by using a single alignment character:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{aligned}
\text{minimize}\qquad & \| A^{\text{ind}} w \text{ diag}(x^{\text{ind}})\|\\
\text{subject to }\qquad & w=b-s+w^0\\
& l^b \le b \le u^b\\
& l^s \le s \le ...
6
And this is the solution, giving the output that you described.
\begin{align*}
CoJPoD_{ \{I_1, \cdots, I_{k-1}, I_{k+1}, \cdots, I_{n}\} | I_{k} } &= CoJPoD_{ \{system \backslash I_{k}\} | I_k} \\
\noalign{\text{$ = P\left( X_1 \ge X_d^{I_1}, \cdots, X_{k-1} \ge X_d^{I_{k-1}}, X_{k+1} \ge X_d^{I_{k+1}}, \cdots, X_n \ge X_d^{I_n} | X_k \ge ...
6
I would still avoid the expression if possible because seemingly it's blurring the fact that the inequalities are repeated for the whole index set except k which should be easy to convey for the author and to grasp for the reader. Something along the lines of
\documentclass{article}
\usepackage{mathtools} %<- Loads amsmath and enhances/fixes it.
...
6
What about this?
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{displaymath}
\overbrace{(r+\epsilon)V_t}^{\text{\clap{Required return}}}
\quad = \quad \underbrace{\overbrace{D^e_t+V_{t+1}^e}^{\text{\clap{Expected capital gain}}}
- V_t}_{\text{\clap{Total expected return on shares}}}
\end{displaymath}
...
6
Again, a modification of an answer of Andrew Stacey's does the trick:
\documentclass{article}
\usepackage{amsmath}
\usepackage{polyglossia}
\setdefaultlanguage{brazil}
\makeatletter
\let\reftagform@=\tagform@
\def\tagform@#1{\maketag@@@{(Eq.\ #1\unskip\@@italiccorr)}}
\renewcommand{\eqref}[1]{\textup{\reftagform@{\ref{#1}}}}
\makeatother
\begin{document}
...
6
You've got your math-modes mixed up.
Consider:
\begin{equation}
% In math mode now!
\( % in math mode... again?
\text{ % text exits math mode temporarily
[DIP:10.1.0.17]
$ % wait, back in math mode?
\rightarrow$ ...
6
Once you get a TeX error you should fix that error without even thinking of looking at the pdf. If you scroll past the error TeX's error recovery almost never does anything sensible.
so
! LaTeX Error: Option clash for package inputenc.
Remove
\usepackage[ansinew]{inputenc}
then
! LaTeX Error: There's no line here to end.
Remove any \\ that isn't in ...
6
Here's a possible solution. It requires xindy rather than makeindex. If you really don't want to use xindy, it's possible to adjust the code, but it's more complicated.
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
...
5
Here's an answer similar to that of Przemysław Scherwentke, but a little more structured. I think a question like this is a good opportunity to show off some of the things that clever people have done to make writing complex expressions simpler. First, the code:
\documentclass{article}
\usepackage{amsmath,mathtools}
\DeclareMathOperator{\Pod}{PoD}
...
5
Option 1:
\documentclass[preview,border=15pt]{standalone}
\usepackage{mathtools}
\begin{document}
\begin{align*}
\mathrlap{CoJPoD_{ \{I_1, \cdots, I_{k-1}, I_{k+1}, \cdots, I_{n}\} | I_{k} }} \\
&= CoJPoD_{ \{\mathrm{system} \backslash I_{k}\} | I_k} \\
&= P\left( X_1 \ge X_d^{I_1}, \cdots, X_{k-1} \ge X_d^{I_{k-1}}, X_{k+1} \ge ...
5
This is a tough formula to typeset; there is no "right way", such complex formulas often need specific treatment which depend on their size and also on subtle semantic issues.
Here is my proposal: the initial term is set on a line by itself and the two developments below it with aligned equals, indented to the right.
I changed \bigtriangleup into the ...
5
Option 1:
\documentclass[preview,border=12pt]{standalone}
\usepackage{amsmath}
\begin{document}
\begin{gather}\label{eq:2.1}
\frac{J_1(a k s)}{\sqrt{\pi } s}\\
\intertext{where $a$ is lens radius}
\begin{aligned}
k &=\frac{2 \pi }{\lambda }\\
s &=\sqrt{\left(\frac{u}{z_2}+\frac{x}{z_1}\right){}^2+\left(\frac{v}{z_2}+\frac{y}{z_1}\right){}^2}
...
5
Have you tried using the align environment?
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
m_{12}(\{Red,Blue\})&=K'*[m_1 (\{Red,Blue\})*m_2(\{Red,Blue\})\\
&\qquad +m_1(\{Red,Blue\})*m_2(\{Red,Blue,Green\})\\
&\qquad +m_2(\{Red,Blue\})*m_1(\{Red,Blue,Green\})]
...
5
Use aligned:
\begin{equation*}
\begin{aligned}
m_{12}(\{ \emph{Red},\emph{Blue} \})
= K' * \bigl[ & m_{1}(\{ \emph{Red},\emph{Blue} \})*m_{2}(\{ \emph{Red},\emph{Blue} \}) \\
+ & m_{1}(\{ \emph{Red},\emph{Blue} \})*m_{2}(\{ \emph{Red},\emph{Blue},\emph{Green} \}) \\
+ & m_{2}(\{ \emph{Red},\emph{Blue} \})*m_{1}(\{ ...
5
The point is that, aligned environment wraps its contents inside an unbreakable box. So, these commands (that is, both \displaybreak and \allowdisplaybreaks) do not have any effect.
This is true of split, gathered and alignedat environments too.
So, to get the line break to work, you might consider using align*, as suggested by egreg.
You might want to ...
5
\[ and \] are delimiters for a displayed math environment, to write a bracket you just write [ or ]. Try replacing all your \left\[ with \left[ and \right\] with \right]. Having done that, and placed your snippet in an equation environment, it compiles fine here, though the equation is far too long for a page.
5
you can treat the alignment as an array, and use \hdotsfor (defined by amsmath):
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begingroup
\setlength{\arraycolsep}{0pt}
\begin{equation*}
\begin{array}{rl}
a_0\varphi_0(x_0)+a_1\varphi_1(x_0)+\ldots+a_n\varphi_n(x_0)&{}=f_0\\
...
4
aligned starts with a thinspace, so you need to compensate with a negative thin space \! as well as adding appropriate alignment points:
\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\setlength{\parindent}{0pt}
Some text
\begin{equation}
\begin{split}
&a^2+\lambda_\phi=\phi\\
&\!\begin{aligned}
...
Only top voted, non community-wiki answers of a minimum length are eligible
