TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two questions regarding centering:

  1. I am trying to center a case-defined function, say defined as follows:

    $f_i(z)=$  \begin{cases}\frac{1}{t}dist (z,\gamma_i ) &\text {if} z\in  A_i(t)\\ 
                                     1 &\text{if} z \in A_i \backslash A_i(t)\\  
                                     0 & \text{if} z \in  \tilde{M} \backslash A_i\\

    How do I center it?

  2. Say the name of the figure I am inserting is 'egnpic', and I am using the following command to insert it in my LaTeX document:

        \hspace{11 mm} \includegraphics[height=100mm]{egnpic}\\

    Apparently I am not seeing any effect of using \hspace{11 mm}, the relative position of the figure {egnpic} remains the same when I use \hspace{5 mm} and when I use \hspace{11 mm}.

share|improve this question

For the first question: You should enclose your equation inside a equation* or align* environment (assuming that you don't want to number them). If you need numbers, remove *.

Second question: You can use the center environment. Please remember that at the beginning of the line \hspace{<len>} is not effective. You should use \hspace*{<len>}.

However, if you are using a figure environment, it is better to use \centering than center environment as shown in the following code.

\usepackage{showframe} %% Remove this, just for showing the centering effect

f_i(z)=  \begin{cases}\frac{1}{t}\ \mathrm{dist}(z,\gamma_i ) &\text {if } z\in  A_i(t)\\
                                 1 &\text{if } z \in A_i \backslash A_i(t)\\
                                 0 & \text{if } z \in  \tilde{M} \backslash A_i\\


\caption[short caption]{Long cation}

enter image description here

Please note that, I have used width (instead of height) in \includegraphics command.

share|improve this answer

Your Answer


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.