2

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\\
              \end{cases}
    

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

1 Answer 1

3

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.

\documentclass{article}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{showframe} %% Remove this, just for showing the centering effect

\begin{document}
\begin{align*}
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\\
          \end{cases}
\end{align*}

\begin{center}
\includegraphics[width=100mm]{example-image-a} 
\end{center}

\begin{figure}[htb]
\centering
\includegraphics[width=100mm]{example-image-a}
\caption[short caption]{Long cation}
\end{figure}
\end{document}

enter image description here

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

You must log in to answer this question.

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