wengan-li / ncku-thesis-template-latex

NCKU Thesis/Dissertation Template in Latex | 台灣國立成功大學碩博士用畢業論文LaTex模板
Other
94 stars 41 forks source link

How to add a reference in Caption of Figure? #33

Closed yusie1978 closed 5 years ago

yusie1978 commented 5 years ago

Hi,

I have a problem how to add a reference in my Figure's Caption.

Let say I have three figures: a, b, and c. Each one has a reference (I took this figure from one source---so I have three sources). Then, I want to show that Figure a, b, and c with their reference, that looks like this, e.g:

               [ Figure a, Figure b, and Figure c]

a. unicycle robot1 [31], b. unicycle robot2 [50], and c. unicycle robot3 [60]

Here's the codes that cause error:

\InsertFigure [scale=0.70, caption={Development of Unicycle Robots: (a) Unicycle without turn-table \RefBib{ho2014balance}, (b) Unicyle with turn-table \RefBib{ke2013path}, (c) Light-weight unicycle robot\RefBib{chin2016balance}}, opacity=0.4] {./context/unicycle-robot/state_of_art.jpg}

Can you suggest me how should i solve this?

Thank you.

wengan-li commented 5 years ago

Sorry for late response.

Try this one

\captionsetup[figure]{labelformat=empty}

\InsertFigure[...]{...}

\captionsetup[figure]{labelformat=default}
yusie1978 commented 5 years ago

Hi,

I have tried the following codes:

\captionsetup[figure]{labelformat=empty} \InsertFigure [scale=0.70, caption={Development of Unicycle Robots: (a) Unicycle without turn-table \RefBib{ho2014balance}, (b) Unicyle with turn-table \RefBib{ke2013path}, (c) Light-weight unicycle robot\RefBib{chin2016balance}}, label={fig_development}, opacity=0.4] {./context/unicycle-robot/state_of_art.jpg} \captionsetup[figure]{labelformat=default}


but it didn't work. aaa

wengan-li commented 5 years ago

Sorry, my fault.

I was tested \InsertFigure[...]{ ... } but not \InsertFigure[...]{ caption={ \RefBib{...} } }. I just tested and found out \RefBib{} is not available to use inside caption{} right now, and the error is not caused by \captionsetup{}.

I need some time to do more test to found another way to do so.

wengan-li commented 5 years ago

I found out it was the define of \InsertFigure{...}. I haven't found out how to fix it yet.

Try this one,

\begin{figure}[H]%
\begin{minipage}[c]{\textwidth}%
    \begin{mdframed}[skipabove=0pt, skipbelow=0pt, leftmargin=0pt, rightmargin=0pt,
    innerleftmargin=0pt, innerrightmargin=0pt, innertopmargin=0pt,
    innerbottommargin=0pt, linewidth=0pt, apptotikzsetting={%
    \tikzset{mdfbackground/.append style={opacity=0.4}}}]%
    \makebox[\textwidth]{\includegraphics[scale=0.7]{./example/introduction/pic/by-nc-sa.png}}%
    \end{mdframed}%
\end{minipage}%
\caption*{Development of Unicycle Robots: (a) Unicycle without turn-table \RefBib{ho2014balance}, (b) Unicyle with turn-table \RefBib{ke2013path}, (c) Light-weight unicycle robot\RefBib{chin2016balance}}
\end{figure}%

This should be work for your case.

yusie1978 commented 5 years ago

Hi,

I have tried it and it works!!

Thank you!!