图题。左对齐,图号加粗

图题。左对齐,图号加粗

我四处寻找是否有办法既可以将标题左对齐到图片宽度,又可以将图号加粗,当然还可以引用图片。我只遇到过部分解决方案。

任何帮助都将非常感激。

以下是我所做的:

   \documentclass{article}
    \usepackage[utf8]{inputenc}
    \usepackage{grffile} %My path contains spaces
    \usepackage{graphicx}
    \graphicspath{ {/Mypath/} }
    \usepackage[labelfont=bf]{caption}
    \captionsetup{justification   = raggedright,
                  singlelinecheck = false}
    \usepackage{threeparttable, floatrow}
    \usepackage{boxhandler}
    \newsavebox
    \mysavebox



    \begin{document}

First example is how the caption should look. Bold Fig name, normal text font, left align and with width of picture. However, the \ref{fig:Latex} does not work...

\begin{center}
\begin{measuredfigure} \centering
\includegraphics[width=0.5\columnwidth]{Figures/LaTex}
%\decoRule
\caption[Stock Prices]{Looks beautiful. If only I could link to it???}
\label{fig:Latex}
\end{measuredfigure}
\end{center}


Next example I can refer to: \ref{fig:1stone} however, the caption is not what I'm looking for. It is left align and the width of the picture but not with bold Fig name and also a bit shifted. 

\begin{center}
\bxfigure[h]{\label{fig:1stone}I can link to this, however the font in the caption is not right.}{
  \includegraphics[width=0.5\columnwidth]{Figures/Einstein}
}
\end{center}


\end{document}][1]][1]

答案1

我只想使用标准figure环境并用 设置标题的宽度\captionsetup

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\captionsetup{
  labelfont=bf ,
  justification = raggedright,
  singlelinecheck = false
}

\begin{document}

First example is how the caption should look. Bold Fig name, normal text
font, left align and with width of picture. However, the \ref{fig:Latex}
does not work...

\begin{figure}[h]
  \centering
  \captionsetup{width=0.5\columnwidth}
  \includegraphics[width=0.5\columnwidth]{Figures/LaTex}
  \caption[Stock Prices]{Looks beautiful. If only I could link to it?}
  \label{fig:Latex}
\end{figure}

\end{document}

在此处输入图片描述

相关内容