Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have this line here

$\overline{X}$ = $\sum_{i = 1}^{n}$ $\frac{x_i}{n}$

that gives me

Average

How should I modify my code to display the equal sign between i and 1?

\documentclass[paper=letterpaper, fontsize=11pt]{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage[francais]{babel}
\usepackage{amsmath,amsfonts,amsthm,amssymb,mathrsfs}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{enumerate}
\usepackage{float}
\everymath{\displaystyle}


\begin{document}


%   PROBLEME 1

\section{Question \no 1 :}

\subsection{Représentation par histogramme et diagramme de Tukey}

\subsubsection{Représentation par histogramme}

\subsubsection{Représentation par diagramme de Tukey}

\subsubsection{Commentaire}

%------------------------------------------------
%

\subsection{Analyse des données des notes}

$\overline{X}$ = $\sum_{i = 1}^{n}$ $\frac{x_i}{n}$


\end{document}
share|improve this question
    
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. The code you presented has couple issues, it would be better to write it as $\overline{X} = \sum_{i = 1}^{n} \frac{x_i}{n}$ (i.e., don't enter and leave math-mode with $ between parts of the expression). –  yo' Aug 12 at 16:18
    
I did try $\overline{X} = \sum_{i = 1}^{n} \frac{x_i}{n}$ However, neither equal signs would be displayed in this case... –  Risa Aug 12 at 16:27
    
Loading lmodern and fourier makes no sense. Either you want fourier or lmodern, not both. The \everymath{\displaystyle} bit has nothing to do with the issue, but is definitely not recommended. –  egreg Aug 12 at 16:52

3 Answers 3

EDIT BASED ON MWE

The use of fourier and lmodern is what causing the equal symbol to "disappear". Look at this question. If you try to load lmodern before fourier, then all your equations will be typesetted on Utopia-based fonts.


Using the code you gave in a MWE:

\documentclass{article}
\begin{document}
$\overline{X}$ = $\sum_{i = 1}^{n}$ $\frac{x_i}{n}$
\end{document}

yields the following output:

output1

As noted by tohecz, you shouldn't leave math-mode when writing a mathematical expression, specially if you're not adding text, which the equal sign isn't. So the code should be written as he stated. Here's a MWE:

\documentclass{article}
\begin{document}
$\overline{X} = \sum_{i = 1}^{n} \frac{x_i}{n}$
\end{document}

which yields the following output:

output2

Notice that the spacing between the sum and the fraction is decreased, as it should be in one whole mathematical expression.

By looking at the end result you provided, you must be some other package or document class, because the result is not inline math-mode, which is odd given the code (notice the limits of the sum). If what you want is an equation exactly like that then you should declare an equation using, \[ and \]. A MWE with its corresponding output:

\documentclass{article}
\begin{document}
The arithmetic mean of the sample is:
\[\displaystyle \overline{X} = \sum_{i = 1}^{n} \frac{x_i}{n}\]
\end{document}

enter image description here

Notice that this will result in a centered equation (display math). If you still want an equation with this display style but using it as inline math (which I don't recommend), then you should precede the inline equation with \displaystyle, as follows:

\documentclass{article}
\begin{document}
The equation $\displaystyle \overline{X} = \sum_{i = 1}^{n} \frac{x_i}{n}$ is now displayed alongside some text.
\end{document}

enter image description here

share|improve this answer

The problem with your code are the packages fourier and lmodern. You have lo load lmodern before fourier. And of course, type your equation like this $\overline{X} = \sum_{i = 1}^{n}\frac{x_i}{n}$

share|improve this answer
4  
Only one among lmodern and fourier should be loaded, not both. –  egreg Aug 12 at 16:52

This code gives what you want

\begin{equation}
\overline{X} = \sum_{i = 1}^{n} \frac{x_i}{n}
\end{equation}

enter image description here

If you have to use math mode, then this works, but it displays differently at least with my compiler

$\overline{X} = \sum_{i = 1}^{n} \frac{x_i}{n}$

enter image description here

share|improve this answer
    
The reason the last output is displayed differently from the first is because the first example is typeset in \displaystyle while the latter is typeset as \textstyle. See this answer for more information. –  nordev Aug 12 at 21:12
    
Also, your answer does not solve the problem; the = in the \sum limit is not displayed unless changes are made to the preamble (see other answers), which is not the case with your proposed solution. –  nordev Aug 12 at 21:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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