1

Here is my code:

\documentclass[12pt,a4paper]{book} 
\usepackage[T1]{fontenc}
\usepackage[chapter]{algorithm}
\renewcommand{\baselinestretch}{1.5} 
\begin{document}
\begin{spacing}{1.2}
\tableofcontents
\backmatter 
{\listoffigures  \listoftables \listofalgorithms} \end{spacing}
\include{Chapter1}
\include{Chapter2}
\end{document}

In chapter 1, I have:

\textbf{
\center{
\[
 %\frac{ax^2+bx+c}{\sin^2y+\cos^2z} \qquad 
\text{F-mesure}=\frac{\text{2 * (Précision * Rappel)}}{\text{(Précision + Rappel)}}
\]
}}

The result is here: https://i.stack.imgur.com/glHsN.jpg How can I center this formula? (i'd like it exactly in the middle)

2
  • First of all please provide a working example. spacing is not known to basic latex. Second, you do not need an extra file, please put the sample code into the main example. Third, center is an environment. Forth don't attempt to boldify large pieces of text using a macro, use the bfseries environment. Fifth, \text needs amsmath or at least amstext. Sixth, it is already centered, even without the center env, so what exactly are you asking for?
    – daleif
    May 6, 2014 at 14:48
  • Thanks a lot for answer :) No, with or without the center env, it is not centered (i'd like it in the middle of the page)
    – researcher
    May 6, 2014 at 15:07

1 Answer 1

1

This works just fine, so what exactly is it you are asking for

\documentclass[12pt,a4paper]{book} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}

\begin{bfseries}
  \[
  % \frac{ax^2+bx+c}{\sin^2y+\cos^2z} \qquad
  \text{F-mesure}=\frac{\text{2 * (Précision *
      Rappel)}}{\text{(Précision + Rappel)}}
  \]
\end{bfseries}

\end{document}

Here is a full example with text

\documentclass[12pt,a4paper]{book} 
%\usepackage[showframe=true]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}

\lipsum*[1]
\begin{bfseries}
  \[
  \text{F-mesure}=\frac{\text{2 * (Précision *
      Rappel)}}{\text{(Précision + Rappel)}}
  \]
\end{bfseries}%
\lipsum[1]

\end{document}

And an image

enter image description here

12
  • Thanks for answer :) With Your Code the formula is not centered ... (i'd like it in the middle of the page)
    – researcher
    May 6, 2014 at 15:00
  • 1
    Well, it is centered, so please explain what you mean by centered, are you talking about centered vertically?
    – daleif
    May 6, 2014 at 15:06
  • imgur.com/AK2A0C5 (i'd like it exactly in the middle)
    – researcher
    May 6, 2014 at 15:12
  • In that case would you please update your original MWE, there is stuff you are not telling us.
    – daleif
    May 6, 2014 at 15:16
  • 1
    No you have not, that example does not compile!
    – daleif
    May 6, 2014 at 15:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .