2

I am using cross reference for a document prepared in latex. The document gets compiled and all the included figures, tables and equations gets proper cross reference. Unlikely, before I am using `label{a}for the label and for referencing I am using\ref{a}`.

The problem is there when I need cross reference for the sections and subsections. The file gets compiled with no errors, but the number used as a reference for a particular section is missing, like this:

\section{intro}\label{s1}
Referring to section~\ref{s1}.

After compiling it's showing a message somewhat, like this

Referring to section . 

It doesn't displayed the referenced numbers. Do I need to add any package or what? The template is prepared according to the guidelines of Rinton Press Publishers.

EDIT - complete code:

\documentclass[twoside]{article}
\usepackage{jwe}
\begin{document}
\section{Intro}\label{s1}
\noindent I am a boy.

\section{Two}
\noindent Related Works referring to Section~\ref{s1}.
\end{document}
  • 1
    What \documentclass are you using? In fact, we should be able to replicate your current problem in order to help you. For this, please construct a minimal working example (MWE). – Werner Aug 24 '15 at 17:08
  • This is the package i have been using ...... \documentclass[twoside]{article} \usepackage{jwe} – Siba Mishra Aug 25 '15 at 5:50
  • 1
    Edit your post and include the MWE that replicates the problem. – Werner Aug 25 '15 at 6:38
  • \documentclass[twoside]{article} \usepackage{jwe} \begin{document} \section{Intro} \label{s1} \noindent I am a boy. \section{Two} \noindent Related Works referring to Section~\ref{s1}. \end{document} – Siba Mishra Aug 25 '15 at 10:11
  • I have attached the MWE above.. Hope this is clear..@Werner Thanks... – Siba Mishra Aug 25 '15 at 10:13
1

The Journal of Web Engineering's LaTeX code completely redefines the sectional units in such a way that referencing them is not possible using the default \label-\ref system. Here's a view on what the sectioning commands look like:

%--------------------------------------------------------------------------
% section commands 
\newcounter{sectionc}\newcounter{subsectionc}\newcounter{subsubsectionc}
\renewcommand{\section}[1] {\vspace{12pt}\addtocounter{sectionc}{1} 
\setcounter{subsectionc}{0}\setcounter{subsubsectionc}{0}\noindent 
          {\bf\thesectionc. #1}\par\vspace{5pt}}
\renewcommand{\subsection}[1] {\vspace{12pt}\addtocounter{subsectionc}{1} 
\setcounter{subsubsectionc}{0}\noindent 
{\bf\thesectionc.\thesubsectionc. {\kern1pt \bfit #1}}\par\vspace{5pt}}
\renewcommand{\subsubsection}[1] {\vspace{12pt}\addtocounter{subsubsectionc}{1}
          \noindent{\rm\thesectionc.\thesubsectionc.\thesubsubsectionc.
          {\kern1pt \it #1}}\par\vspace{5pt}}
\newcommand{\nonumsection}[1] {\vspace{12pt}\noindent{\bf #1}
          \par\vspace{5pt}}

Not only do they use old font declarations, there's no proper \refstepcounter to capture \labels. Instead, the package uses \addtocounter{<cntr>}{1}. For starters, you'd have to redefine \section to use \refstepcounter instead of \addtocounter. However, since this is for a journal submission, you should really question whether this is intended.

Here's a proper redefinition of \section included in a minimal example:

enter image description here

\documentclass{article}
\usepackage{jwe}

\makeatletter
\@addtoreset{subsectionc}{sectionc}
\@addtoreset{subsubsectionc}{subsectionc}
\makeatother

\renewcommand{\section}[1]{%
  \par\vspace{12pt}%
  \refstepcounter{sectionc}% This allows you to use \label and \ref properly
  \noindent{\bfseries\thesectionc. #1}%
  \par\vspace{5pt}}

\begin{document}

\section{Intro}\label{s1}
\noindent I am a boy.

\section{Two}
\noindent Related Works referring to Section~\ref{s1}.

\end{document}

My thought on this is that the journal probably wants people to do these references manually, which seems awkward.

Contact the journal and tell them they need to change things. Or at least ask them why they do it this way.

  • Thanks@Werner, for your kind concern.. I will do it manually, but surely will inquire regarding this. Thanks a lot. – Mishra S Aug 25 '15 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.