1

LaTex produces the formula I want:

enter image description here

but it returns some warning messages. The is the code of the formula above, I don't know where is the mistake:

\begin{align}
\mathbb{D} (k,n) = \frac{2}{n_q} ~\text{cos} \bigg(\frac{(n-1)(k-1)\pi}{n_q /2} \bigg) \cdot 
\left\{ \begin{array}{c l l}
1/2 &  \mbox{if} & n=\{1, n_q /2+1 \}\\
1   & \multicolumn{2}{l}{\mbox{otherwise}} \\
\end{array} \right
\end{align}

marked as duplicate by egreg, TeXnician, Troy, Stefan Pinnow, user36296 Sep 18 '17 at 14:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    It should be \right. (with a period after \right). Also it should be \cos and not \text{cos}. – egreg Sep 18 '17 at 12:40
  • 1
    Use \cos instead of \text{cos} and \text instead of \mbox – user2478 Sep 18 '17 at 12:44
0
\documentclass[ngerman]{article}
\usepackage{array}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{fontspec}
\begin{document}

\begin{align}
    \mathbb{D} (k,n) = \frac{2}{n_q} ~\cos \bigg(\frac{(n-1)(k-1)\pi}{n_q /2} \bigg) 
    \cdot 
    \begin{cases} 
        1/2 &  \text{if } n=\{1, n_q /2+1 \}\\
        1   & \text{otherwise} \\
    \end{cases}
\end{align}

\end{document}

enter image description here

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