I'm working on my literature review for my thesis.

I'm using a double column journal-type template. I am running in to a small problem, namely, that the caption of my figure appears under Fig 2. and not next to as, i.e. Fig 2. Caption. See picture below for clarification enter image description here, pay attention only to the way the caption is presented, not the caption themselves I want my caption like the right figure, first Fig ... CAPTION.

I've tried fixing this in the .cls file of the template I can't figure it out. Could someone help me? This is the captions part of the template:

\long\def\@caption#1[#2]#3{\par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
   \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}
   \begingroup \@parboxrestore \normalsize
     \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}{#1}\par
   \endgroup}

\def\tablestring{table}
\def\figurestring{figure}

\newlength{\captionindent}
\long\def\@makecaption#1#2#3{
\ifx\figurestring#3
    \setbox\@tempboxa\hbox{{\small\bfseries\itshape #1.~ }#2}
    \ifdim \wd\@tempboxa >\hsize
       \setbox\@tempboxa\hbox{{\small\bfseries\itshape #1.~ }}
       \setlength\captionindent{\wd\@tempboxa} \divide\captionindent by 2
       \parbox[t]{\hsize}{\small \hangindent 0pt \hangafter=1%
       \unhbox\@tempboxa#2}
    \else \hbox to\hsize{\small\hfil\box\@tempboxa\hfil}
    \fi
\else
    \begin{center}{#1}\\{#2}\end{center}
\fi}

\def\fnum@figure{Fig.~\thefigure}
\def\fnum@table{Table~\thetable}
  • Welcome to TeX.SX! Do you want to submit your document to the journal? Then don't change anything. Otherwise have a look at the \begin{center}{#1}\\{#2} part, which seems to be responsible for the line break. – TeXnician Aug 10 at 9:28
  • Alas, this doesn't tell us where #1 for \@caption comes from. Is it figure or figure*? – John Kormylo Aug 10 at 11:53
  • I am not an experienced LaTeX coder in the sense that I don't not change much in the .cls file! In creating the content i am quite experienced! Could you elaborate more why \begin{center}{#1}\\{#2} could be it? I have no clue .. I do not see anything familiar for me ... something like \newline ? – Bhupinder Sanghera Aug 10 at 14:49
  • Oh! I seem to have fixed it! I removed the \\ which ofc .. i forgot .. corresponds to a newline! Seems to work! – Bhupinder Sanghera Aug 10 at 14:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.