2

I have a problem with an equation which almost exceeds limits of the page. This is the code :

\documentclass[a4paper,12pt,blue,rgb,]{tubsbook}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{listings}
\usepackage{color}
\usepackage{hyperref}
\usepackage{url}
\usepackage{array,multirow}
\newcommand\mcbf[1]{\multicolumn{2}{|c|}{\textbf{#1}}}
\newcommand\mlbf[1]{\multicolumn{2}{|l|}{\textbf{#1}}}
\usepackage{graphicx}
\usepackage[activate]{pdfcprot}

\begin{document}
\begin{center}
\begin{equation}
X[k1+4.k2]=\sum_{n2=0}^{N/4-1}[(x[n2]+(-i)^{k1}x[N/4+n2]+(-1)^{k1}x[N  /2+n2]+(i)^{k1}x[3N/4+n2])W_{N}^{k1.n2}]W_{N/4}^{k2.n2}
\end{equation}
\label{eqfft4}
\end{center}
\end{document}

and i get this result :

enter image description here

how can i fix that???

4
  • broken it into more lines? is this possible option? – Zarko Sep 4 '16 at 16:31
  • What is the tubsbook class? – Bernard Sep 4 '16 at 16:34
  • Well for me it's possible and this is what i want to do if possible – A.nechi Sep 4 '16 at 16:34
  • Template of TU Braunschweig - Germany university – A.nechi Sep 4 '16 at 16:35
3

This is not really an issue of LaTeX formatting. If a formula is longer than the text width, it is hard to read and understand even if optimally typeset. I suggest to break down the formular by introducing abbreviations, e.g. in the following way. After that you can still decide to use some appropriate amsmath environment to align the equations.

\documentclass[a4paper,12pt]{scrbook}
\begin{document}
\begin{equation}
X[k1+4.k2]=\sum_{n2=0}^{N/4-1} \alpha(n2)\cdot W_{N}^{k1.n2}\cdot W_{N/4}^{k2.n2}
\label{eqfft4}
\end{equation}
where
\begin{equation}
\alpha(n2)= x[n2]+(-i)^{k1}x[N/4+n2]+(-1)^{k1}x[N  /2+n2]+(i)^{k1}x[3N/4+n2]
\end{equation}
\end{document}

enter image description here

4

I suggest you use either a multline environment or a nested equation/split environment. At least one line break is required. Select the method that better fits your aesthetic sensibilities.

I further suggest you increase the sizes of the "outer" square brackets and round parentheses slightly to help the eye with determining where the main grouping is taking place.

Incidentally, what are the various . ("dot") characters supposed to signify? Are they multiplication "dots"? If so, they should be replace with \cdot.

enter image description here

\documentclass[a4paper,12pt]{book}
\usepackage{mathtools} % for '\mathclap' macro; automatically loads 'amsmath'
\begin{document}

\begin{equation}\begin{split}
X[k1+4.k2]=\sum_{n2=0}^{\mathclap{N/4-1}}\bigl[\bigl( 
&x[n2]+(-i)^{k1}x[N/4+n2]+(-1)^{k1}x[N/2+n2]\\
&+(i)^{k1}x[3N/4+n2]\bigr) W_{N}^{k1.n2}\,\bigr] W_{N/4}^{k2.n2}
\end{split}\end{equation}

\begin{multline}
X[k1+4.k2]=\sum_{n2=0}^{\mathclap{N/4-1}} 
\bigl[\bigl (x[n2]+(-i)^{k1}x[N/4+n2]+(-1)^{k1}x[N/2+n2]\\
+(i)^{k1}x[3N/4+n2]\bigr) W_{N}^{k1.n2}\,\bigr] W_{N/4}^{k2.n2}
\end{multline}\label{eqfft4}

\end{document}
3

Used article as document class, however this will work with any of them (hopefully):

\documentclass{article}
\usepackage[utf8]{inputenc}
%\usepackage[english]{babel}
%\usepackage{lipsum}
%\usepackage{listings}
%\usepackage{color}
%\usepackage{url}
%\usepackage{array,multirow}
%\newcommand\mcbf[1]{\multicolumn{2}{|c|}{\textbf{#1}}}
%\newcommand\mlbf[1]{\multicolumn{2}{|l|}{\textbf{#1}}}
%\usepackage{graphicx}
%\usepackage[activate]{pdfcprot}
\usepackage{mathtools}
\usepackage{hyperref}% had to be last in preamble

\begin{document}
%\begin{center} <-- surplus
\begin{equation}\label{eqfft4}
    \begin{multlined}[][0.8\linewidth]
X[k1+4.k2] = \sum_{n2=0}^{N/4-1}[(x[n2]+(-i)^{k1}x[N/4+n2]  \\
                + (-1)^{k1}x[N/2+n2] 
                + (i)^{k1}x[3N/4+n2])W_{N}^{k1.n2}]W_{N/4}^{k2.n2}
    \end{multlined}
\end{equation}
%\end{center}

\begin{equation}\label{eqfft4}
    \begin{split}
X[k1+4.k2] 
    & = \sum_{n2=0}^{N/4-1}[(x[n2]+(-i)^{k1}x[N/4+n2]   \\
    &\qquad + (-1)^{k1}x[N/2+n2]                        \\
    &\qquad + (i)^{k1}x[3N/4+n2])W_{N}^{k1.n2}]W_{N/4}^{k2.n2}
    \end{split}

\end{document}

Edit: In your MWE I comment all packages which are not relevant to show your equation. Also I move hyperref package on the end of the preamble where it belong. For used math environment aligned I added package mathtools, which provide improved set of amsmath environments for writing multi lines equations.

Addendum: For completness I add one more possibiliti, hor to split equation into more lines. I have any clue in which point you like to broke the equation, so I show only a way how to do this and haven't any intention to decide this instead of you.

enter image description here

2
  • Thank you but it's not the good answer because even when it's split the equation balanced and the view is not good at all ! – A.nechi Sep 4 '16 at 16:46
  • 3
    The answer is in frame of good math typing ... however, you not gives any information about your expectation about equation looks. So your complain i fill as insulting. – Zarko Sep 4 '16 at 16:57

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.