0

I'm using the following code to generate the second figure.

\begin{equation}
\begin{array}{c}
\displaystyle \min_{W, S}J(W,S)=\frac{\sum^n_{i,j=1}\norm{W^{T}(x_{i}-x_{j})}^2S_{ij}}{\sum^n_{i=1}\norm{W^Tx_{i}}^2}+\mu\norm{S}^2 \\ \\
\displaystyle \text{s.t.} \; W^TW=I \\
\displaystyle \sum^n_{j=1}S_{ij}=1, i = 1, \dots, n
\displaystyle \\S_{ij}\geq0, i,j = 1, \dots, n
\end{array} 
\label{piel2}
\end{equation}

But Actually, I'd like to have first figure where the 's.t.' is before all of the constrains. How can I get it?

figure 1

figure 2

2
  • don't use array to make multi-line displays. Use the alignments in the amsmath package. array is designed to typeset arrays/matrices rather than full expressions. – David Carlisle Mar 28 '14 at 23:26
  • 1
    And please make your code compilable and complete with \documentclass{..} and ending at \end{document} with relevant packages. – user11232 Mar 28 '14 at 23:31
3
\documentclass[12pt,a4paper,bothsides]{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe, nomarginpar]{geometry}
\usepackage{mathtools}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}


\begin{document}

\begin{align*}
\min_{W, S}J(W,S) & =\frac{\sum^n_{i,j=1}\norm{W^{T}(x_{i}-x_{j})}^2 S_{ij}}{\sum^n_{i=1}\norm{W^Tx_{i}}^2}+μ \norm{S}^2 \\
\text{s.t.} &\\
   &{}W^TW=I \\
&{}\sum^n_{j=1}S_{ij}=1, & \hphantom{,j} i  = 1, \dots, n \\
&{}S_{ij}\geq 0,  & i,j = 1, \dots, n
\end{align*}


\end{document}

enter image description here

Or

\documentclass[12pt,a4paper,bothsides]{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe, nomarginpar]{geometry}
\usepackage{mathtools}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\usepackage{calc}

\begin{document}

\begin{align*}
\min_{W, S}J(W,S) & =\frac{\sum^n_{i,j=1}\norm{W^{T}(x_{i}-x_{j})}^2 S_{ij}}{\sum^n_{i=1}\norm{W^Tx_{i}}^2}+μ \norm{S}^2 \\
& \text{s.t.\qquad}  
\begin{aligned}[t]
W^TW=I \\
\sum^n_{j=1}S_{ij}=1, & \hphantom{,j} i  = 1, \dots, n \\
S_{ij}\geq 0,  \,\quad & i,j = 1, \dots, n
\end{aligned}
\end{align*}


\end{document}

enter image description here

2
  • 1
    You're legendary, Harish, congratulations! :) – cmhughes Mar 29 '14 at 1:11
  • 1
    @cmhughes Thank you for the kind words Chris. :) – user11232 Mar 29 '14 at 1:39
2

This seems to make what you want:

    \documentclass[12pt,a4paper,bothsides]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[showframe, nomarginpar]{geometry}
    \usepackage{mathtools}
    \DeclarePairedDelimiter{\norm}{\lVert}{\rVert}

    \begin{document}

    \begin{align*}
    \min_{W, S}J(W,S) & =\frac{\sum^n_{i,j=1}\norm{W^{T}(x_{i}-x_{j})}^2 S_{ij}}{\sum^n_{i=1}\norm{W^Tx_{i}}^2}+μ \norm{S}^2 \\
    & \text{s.t.} \begin{cases}
       W^TW=I \\
    \sum^n_{j=1}S_{ij}=1, & \hphantom{,j} i  = 1, \dots, n \\
    S_{ij}\geq 0,  & i,j = 1, \dots, n
    \end{cases}
    \end{align*}


    \end{document} 

enter image description here

0
\begin{eqnarray}
\min_{W, S}J(W,S)=\frac{\sum^n_{i,j=1} \rVert{W^{T}(x_{i}-x_{j})\rVert}^2S_{ij}}{\sum^n_{i=1}\rVert{W^Tx_{i}}\rVert^2}+\mu \rVert{S}\rVert^2 \nonumber
\end{eqnarray}
\hspace{50mm}such that,
\begin{eqnarray}
W^TW=I  \nonumber \\
\sum^n_{j=1}S_{ij}=1, i = 1, \dots, n\nonumber\\
S_{ij}\geq0, i,j = 1, \dots, n \nonumber
\end{eqnarray}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.