the latex source is as follows:
\begin{figure}[h]
\begin{centering}
\protect\caption{Accuracies comparision of different methods \label{fig:comparision}}
\par\end{centering}
\begin{minipage}[t]{0.96\columnwidth}%
\noindent \begin{center}
\begin{minipage}[t]{0.45\columnwidth}%
\subfloat[\label{fig:comparison1}comparison1]{
\protect\centering{}\protect\includegraphics[scale=0.25]{Comparision_0}\protect}%
\end{minipage}\quad{}%
\begin{minipage}[t]{0.45\columnwidth}%
\subfloat[\label{fig:comparison2}comparison2]{
\protect\centering{}\protect\includegraphics[scale=0.25]{Comparision_1}\protect}%
\end{minipage}
\par\end{center}%
\end{minipage}
\end{figure}
And, when I reference Fig. \ref{fig:comparison}
, it shows Fig. 7
, which is right. But, when I reference Fig. \ref{fig:comparison1}
and Fig. \ref{fig:comparison2}
, it shows Fig. 8(a)
and Fig. 8(b)
which I expect Fig. 7(a)
and Fig. 7(b)
.
Could you help give some advice, please? Thanks!
UPDATED:
The source of lyx
file is as follows:
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass IEEEtran
\begin_preamble
% for subfigures/subtables
\usepackage[caption=false,font=footnotesize]{subfig}
\usepackage{algorithm,algpseudocode}
\usepackage{hyperref}
\hypersetup{backref,colorlinks,linktocpage=true}
\usepackage{array}
\usepackage{booktabs}
\def\hlinew#1{%
\noalign{\ifnum0=`}\fi\hrule \@height #1 \futurelet
\reserved@a\@xhline}
%\usepackage{subfig}
%\captionsetup[subfloat]{position=top,farskip=10pt,topadjust=0pt,captionskip=10pt,nearskip=10pt,margin=10pt}
\end_preamble
\options journal
\use_default_options false
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding default
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command bibtex
\index_command default
\float_placement tbh
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_title "Your Title"
\pdf_author "Your Name"
\pdf_bookmarks true
\pdf_bookmarksnumbered true
\pdf_bookmarksopen true
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder true
\pdf_colorlinks false
\pdf_backref false
\pdf_pdfusetitle false
\pdf_quoted_options "pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 0
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 0
\use_package mhchem 1
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine basic
\cite_engine_type default
\biblio_style IEEEtran
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 2
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Standard
Fig.
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:comparision"
\end_inset
.
As shown in Fig.
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:comparision1"
\end_inset
, From the Fig.
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:comparision2"
\end_inset
,
\end_layout
\begin_layout Standard
\begin_inset Float figure
placement h
wide false
sideways false
status open
\begin_layout Plain Layout
\align center
\begin_inset Caption Standard
\begin_layout Plain Layout
Classification accuracies comparision of different methods.
\begin_inset CommandInset label
LatexCommand label
name "fig:comparision"
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Box Frameless
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 0
use_makebox 0
width "96col%"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\noindent
\align center
\begin_inset Box Frameless
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 0
use_makebox 0
width "45col%"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:comparision1"
\end_inset
comparison1
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename /home/ubuntu/Desktop/img1.eps
lyxscale 50
scale 50
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
\begin_inset space \quad{}
\end_inset
\begin_inset Box Frameless
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 0
use_makebox 0
width "45col%"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:comparision2"
\end_inset
comparison2
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename /home/ubuntu/Desktop/img2.eps
lyxscale 20
scale 10
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\end_body
\end_document
And the visualization in lyx
editor is as follows:
And the generated pdf is as follows:
And I export the lyx
into the plain Latex
as follows:
%% LyX 2.1.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[twocolumn,english,journal]{IEEEtran}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{graphicx}
\usepackage[unicode=true,
bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1,
breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
{hyperref}
\hypersetup{pdftitle={Your Title},
pdfauthor={Your Name},
pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false}
\usepackage{breakurl}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
% for subfigures/subtables
\usepackage[caption=false,font=footnotesize]{subfig}
\usepackage{algorithm,algpseudocode}
\usepackage{hyperref}
\hypersetup{backref,colorlinks,linktocpage=true}
\usepackage{array}
\usepackage{booktabs}
\def\hlinew#1{%
\noalign{\ifnum0=`}\fi\hrule \@height #1 \futurelet
\reserved@a\@xhline}
%\usepackage{subfig}
%\captionsetup[subfloat]{position=top,farskip=10pt,topadjust=0pt,captionskip=10pt,nearskip=10pt,margin=10pt}
\@ifundefined{showcaptionsetup}{}{%
\PassOptionsToPackage{caption=false}{subfig}}
\usepackage{subfig}
\makeatother
\begin{document}
Fig. \ref{fig:comparision}. As shown in Fig. \ref{fig:comparision1},
From the Fig. \ref{fig:comparision2},
\begin{figure}[h]
\begin{centering}
\protect\caption{Classification accuracies comparision of different methods. \label{fig:comparision}}
\par\end{centering}
\begin{minipage}[t]{0.96\columnwidth}%
\noindent \begin{center}
\begin{minipage}[t]{0.45\columnwidth}%
\subfloat[\label{fig:comparision1}comparison1]{
\protect\centering{}\protect\includegraphics[scale=0.5]{/home/ubuntu/Desktop/img1}\protect}%
\end{minipage}\quad{}%
\begin{minipage}[t]{0.45\columnwidth}%
\subfloat[\label{fig:comparision2}comparison2]{
\protect\centering{}\protect\includegraphics[scale=0.1]{/home/ubuntu/Desktop/img2}\protect}%
\end{minipage}
\par\end{center}%
\end{minipage}
\end{figure}
\end{document}
\begin{centering}
should be\centering
,\protect\caption
should be\caption
,\noindent \begin{center}
should be\centering
,\protect\centering{}
should be\centering
, no\protect
in front of\includegraphics
and never\protect
in front of}
Lyx 2.1
editor to edit thelyx
document. Thus, I couldn't modify manually these commands as you suggested.\protect
s and\par
s are automatically generated by theLyx
editor, thus I couldn't delete them manually.lyx
file. If convenient, please help check it. Thanks!