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}`.

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.

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.