2

I have some trouble with inserting a picture in latex the way I want. I want it to look like this.

enter image description here

However I've tried implement this using the code below

\begin{figure}[H]
\begin{center}
\begin{tabular}{l}\includegraphics[width=0.1\textwidth]{Basic}\end{tabular}%
\hspace{1em}%
\textrm{Basic event type}
\caption{Circle}
\end{center}
\end{figure}

This however result in

enter image description here

I want to remove the caption number "Figure 1:" and also center it beneath the picture. And I can't seem to get it to work. Can anyone help me with this?

Kind Regards Carl

Carl
  • 23
  • 1
    Welcome to TeX.SE. Please don't use \begin{center}....\end{center} in a figure environment –  Feb 21 '17 at 09:04
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Martin Schröder Feb 21 '17 at 09:05
  • Do you really want a caption or only a writing under the circle? – CarLaTeX Feb 21 '17 at 09:20
  • Hi there, thanks! I guess that I want more or less only the writing, it doesn't have to be caption. – Carl Feb 21 '17 at 09:37
  • @ChristianHupfer Why not? This is like one of the most frequent constructs I use ... – Bananguin Feb 21 '17 at 09:58
  • @user1129682: Use \centering instead. –  Feb 21 '17 at 10:06
  • @user1129682 Look at this: http://tex.stackexchange.com/q/2651/101651! – CarLaTeX Feb 21 '17 at 10:16
  • @CarLaTeX I actually found this – Bananguin Feb 21 '17 at 11:04
  • @user1129682 David's answer to the post you linked says exactly the reason why not to use center environment with a figure one: if you just want to center something that is already vertically positioned (as is often the case inside a figure environment) then \centering is what you need, but if you want to implement a displayed construct that happens to need centred content, then center is what you should use. – CarLaTeX Feb 21 '17 at 11:08
  • @CarLaTeX I did read it. However, that is not a reason why you should chose one over the other (unless we generally accept a statement by David as reason). It appears more sensible to use centering in floats, but there is nothing wrong in using center; it doesn't break anything. – Bananguin Feb 21 '17 at 11:14
  • 1
    @user1129682 As you can read in lockstep's answer of the link I added \begin{center} ... \end{center} inside a figure environment will result in (generally unwanted) additional vertical space. BTW, please choose a more creative nickname, rather than the automatic user1129682 :):):) – CarLaTeX Feb 21 '17 at 11:18
  • @CarLaTeX Better? David's answer also has the part about the vertical space. While often unwanted, the vertical space doesn't break anything. Telling people to use one over the other is like Markus Kohm telling you things about type setting. Valid and sensible, but not mandatory. – Bananguin Feb 21 '17 at 13:02
  • @Bananguin Yes, much better! Of course it's an advice, everyone it's free to do whatever he/she wants in his/her code! – CarLaTeX Feb 21 '17 at 13:08

2 Answers2

1

I think you don't really want a caption but a simple image with a writing after it, so I suggest to you the following solution.

Of course you don't have to use \usepackage{mwe} (I've added it only to have the blind text and an example figure) and you have to substitute example-image-1x1 for the name of your actual picture Basic).

\documentclass{article}
\usepackage{graphicx}
\usepackage{array}
\usepackage{mwe} % only to create blind text and example-image
\begin{document}
\blindtext
\begin{center}
    \begin{tabular}{m{.1\textwidth}l}
        \includegraphics[width=0.1\textwidth]{example-image-1x1} & \textrm{Basic event type}\\
        \multicolumn{1}{c}{\textrm{Circle}} & \\
    \end{tabular}
\end{center}
\blindtext
\end{document}

enter image description here

CarLaTeX
  • 62,716
  • This is exactly what I wanted, thank you so much! :) And thanks to everyone else to, so many good inputs (Y) – Carl Feb 22 '17 at 09:17
  • @Carl You're welcome! We are almost namesake, too (almost because I'm a female and my name is Carla)! – CarLaTeX Feb 22 '17 at 09:22
  • @Carl On a side note: As long as you are not doing a brochure or something like that, it is good style to always label and name your figures. – Bananguin Apr 11 '17 at 06:22
0

The caption is centered just like everything else. Once you put the \caption macro outside the center-environment it will be left aligned. You also could put it inside a \parbox

\parbox{\linewidth}{\caption{Circle}}

The parbox would be centered, but is 100% wide, so it won't actually be moved. Its content is left aligned.

I have not played too much with \caption, maybe you can't nest it in arbitrary constucts. Should you run into problems you can look into \captionof from the capt-of package.

Bananguin
  • 2,574