如何调整图片标题

如何调整图片标题

我正在使用这个包,但它给了我错误的输出。我需要像(图 2.1:啊啊啊啊)

\documentclass{UnimasThesis}
\usepackage{graphicx}
\usepackage[labelfont=bf]{caption}
\captionsetup{labelfont=bf}
\usepackage{pdflscape}
\usepackage{adjustbox}
\usepackage{dcolumn}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{cases}
\usepackage[os=win]{menukeys}
\usepackage[paper=a4paper]{geometry}
\usepackage{multirow}
\usepackage[]{algorithm2e}
%\usepackage{enumerate}


\usepackage{titlesec}

\titleformat{\section}
{\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}



\usepackage{listings}
\lstset{language=[LaTeX]TeX,columns=fullflexible,
basicstyle=\ttfamily,texcsstyle=*\bfseries\color{NavyBlue},
commentstyle=\itshape\color{PaleVioletRed4},
frame=single,framesep=6pt,
framexleftmargin=6pt,framexrightmargin=6pt,
xleftmargin=12pt,xrightmargin=12pt,
breaklines=true,breakatwhitespace=true}


\title{Automatic Segmentation of Cardiac Magnetic Resonance Images for Oedema Assessment}
\author{\textbf{Amajd Khan}}
\faculty{Faculty of Computer Science and Information Technology}
\facultyColour{6c7a8c} %% 6-digit RGB hexadecimal code 
\submissionyear{\textbf{2017}}
\degreetype{\textbf{Doctor of Philosophy}}

% If using APA bibliography style

\usepackage[natbibapa]{apacite} 
\bibliographystyle{apacite}



%\usepackage{natbib}

%\bibliographystyle{apalike}



\newgeometry{top=3cm, bottom=3.00cm, right=2.5cm, left=2.5cm}

%\usepackage{etoolbox} % "lipsum" for filler text
%\makeatletter

\makeatletter



\def\@makechapterhead#1{%
    %%%%\vspace*{50\p@}% %%% removed!
    {\parindent \z@ \Large
        \ifnum \c@secnumdepth >\m@ne
        \centering \Large\bfseries \MakeUppercase{\@chapapp}\space \thechapter
        \par\nobreak
        \vskip 3\p@
        \fi
        \interlinepenalty\@M
        \centering
        \Large \bfseries #1\par\nobreak
        \vskip 20\p@
}}
%\def\@makeschapterhead#1{%
%  %%%%%\vspace*{50\p@}% %%% removed!
%  {\parindent \z@ \raggedright
%    \normalfont
%    \interlinepenalty\@M
%    \Huge \bfseries  #1\par\nobreak
%    \vskip 40\p@
%  }}
\makeatother



\begin{document}
\maketitle

\frontmatter

\newpage~
\thispagestyle{empty}
{\centering {Automatic Segmentation of Cardiac Magnetic Resonance Images for Oedema Assessment} \par}
\vspace{4.7cm}
{\centering Amjad Khan\par}
\vspace{4.7cm}
{\centering A thesis submitted \\
    in fulfillment of the requirements for the degree of \\
    Doctor of Philosophy\par}

\vspace{5.5cm}
{\centering Faculty of Computer Sciences and Information Technology\\
    UNIVERSITI MALAYSIA SARAWAK\\ 
    2017\par}


% List of conformation may be prepared as in confirmation.tex
%\input{confirmation}
% List of declaration may be prepared as in confirmation.tex
\input{declaration}

% Acknowledgements from ack.tex
\input{ack}



% English abstract from abstract-en.tex
\input{abstract-en}

% Malay Abstract from abstrak-ms.tex
%\input{ABSTRAK}




%\input{abstract-mal}
% Malay Abstract from abstrak-ms.tex
\input{abstrak-ms}



% LIST OF TABLE 
\tableofcontents
\listoffigures
\listoftables

% List of Symbols may be prepared as in symbols.tex
\input{symbols}

\mainmatter
% Each chapter from a separate file
\input{chap1-Introduction}
\input{chap2-literature}
\input{chap3-NEW}
\input{chap4-contoursegmentation}
\input{chap5-assessment}
\input{chap6-oedema}
\input{chap7-conclusion}
%\appendix
%\input{app-Guidelines}
%\input{app-code}
%\input{app-results}


% references are listed in refs.bib
\bibliography{refs}


\end{document}

在此处输入图片描述

这是图形代码

\begin{figure}[h!]
\centering
\includegraphics[width=.9\textwidth]{text}
\caption{Pictorial representation of review goals}
\label{Fig:text}
\end{figure}

答案1

将此添加到你的序言中

 \usepackage{caption}
 \captionsetup{%
  font={footnotesize}, % small font size
  labelfont={bf,sf},      % label in bold, sans-serif
  singlelinecheck=true, % centered single-lined captions
  format=plain,             % indention=1cm,
  labelsep={colon},         % default separator: none, colon, period, space, quad, newline, endash
}

在这个最小工作示例中,您可以看到它是如何工作的:

\documentclass[
  demo   % for demonstration only!
  ]{article}
\usepackage{graphicx}
\usepackage{caption}
\captionsetup{%
  font={footnotesize}, % small font size
  labelfont={bf,sf},      % label in bold, sans-serif
  singlelinecheck=true, % centered single-lined captions
  format=plain,             % indention=1cm,
  labelsep={colon},         % default separator: none, colon, period, space, quad, newline, endash
}
\begin{document}
\begin{figure}
\centering
\includegraphics[width=.9\textwidth]{text}
\caption{Pictorial representation of review goals}
\label{Fig:text}
\end{figure}
\end{document}

在此处输入图片描述

答案2

亲爱的,我解决了这个问题......答案是为了帮助其他用户......谢谢

\usepackage{caption}
\captionsetup{%
    font={normalsize}, % small font size
    labelfont={bf,sf},      % label in bold, sans-serif
    singlelinecheck=true, % centered single-lined captions
    format=plain,             % indention=1cm,
    labelsep={colon},         % default separator: none, colon, period, space, quad, newline, endash
}

使用该图形....

\begin{figure}
\centering
\includegraphics[width=.9\textwidth]{text}
\caption{Pictorial representation of review goals}
\label{Fig:text}
\end{figure}

相关内容