How to center multiple figures in LaTex

Hi Guys,

Below you can find  a block of code to center your  figures in Latex.

In this example, two figures are used.

documentclass{article}
usepackage{subfigure}
usepackage{graphicx}

begin{document}

begin{figure}[ht]
begin{center}
subfigure[Caption for Figure 1]{
label{fig:first}
includegraphics[width=0.25textwidth]{./images/Figure1.eps}
}
subfigure[Caption for Figure 1]{
label{fig:second}
includegraphics[width=0.25textwidth]{./images/Figure2.eps}
}
end{center}
caption{(a) Figure 1, (b) Figure 2 }
label{fig:subfigures}
end{figure}

end{document}

Preview:Example_subfigures

Hope this is useful.

Reference

http://nixtricks.wordpress.com/2009/11/09/latex-multiple-figures-under-the-same-caption-using-subfigure/

 

LaTex issue: How to make the figure captions centered?

Couple days ago, I spent so many hours figuring out how to make my figure captions centered in LaTex. I use WindEdt 6 Editor and IEEE journal template for that. The problem was, the IEEE journal template will automatically make the figure captions  left justified. Several minutes later, I found a great page written by Michael Shell to solve this problem. Here’s the link : http://www.michaelshell.org/tex/ieeetran/

According to the above link, basically what I need to do is to add an additional code in my tex file as follows:

[contentblock id=1 img=adsense.png]

[syntax type=”css”]
makeatletter
longdef@makecaption#1#2{ifx@captype@IEEEtablestring%
footnotesizebegin{center}{normalfontfootnotesize #1}
{normalfontfootnotesizescshape #2}end{center}%
@IEEEtablecaptionsepspace
else
@IEEEfigurecaptionsepspace
setbox@tempboxahbox{normalfontfootnotesize {#1.}~~ #2}%
ifdim wd@tempboxa >hsize%
setbox@tempboxahbox{normalfontfootnotesize {#1.}~~ }%
parbox[t]{hsize}{normalfontfootnotesize noindentunhbox@tempboxa#2}%
else
hbox tohsize{normalfontfootnotesizehfilbox@tempboxahfil}fifi}
makeatother
[/syntax]

I have added the above code after my document class initialization in my tex file and it has worked perfectly for me. I really need to thank Michael Shell for his useful information regarding this matter :D. Hope this information will also help those who face the same problem.

Bibtex:GUI framework cannot be initialized

Hi guys! I guess you might face the same problem with me. I’m new to LaTex and I run my LaTex file this morning in my PC and simply got this error message : Bibtex:GUI framework cannot be initialized! Yesterday, I run a similar code using same installation procedure (I use MikTex 2.9 and WinEdt6) in my laptop and everything worked well. So, I spent my time searching in Google for a perfect solution and finally I came into this useful link : http://dawenliulatex.blogspot.com/2010/10/error-message-gui-framework-cannot-be.html

[contentblock id=1 img=adsense.png]

So, in summary, if you face the same problem, here’s a solution:

  1. Open a command prompt window and go into the directory where you put your latex file.
  2. Run your latex file (e.g latex mylatexfile)
  3. Run BibTex (e.g bibtex mylatexfile), and then it will automatically download the missing files that I guess caused the error, so make sure you are connected with the internet!
  4. Rerun your latex file twice (this is to make your references integrated and listed in your latex files), and done! 🙂

Now, you can find the executed file in dvi format in your latex directory and the problem is solved. This works for me,  hope it solves your problem as well. 😀