How to highlight references numbers and citations in overleaf?
Asked Answered
B

2

7

I want to highlight my changes in the revised paper for submitting it to the journal. Specifically, I want to highlight specific reference numbers included in multi-reference citations.

I tried with "\hl{}" using "\usepackage{soul}" but it gives me errors unless I skip the citations (i.e., \cite{}) and refrering sentences for tables or figures (\ref{}).

I have two questions:

1- How I can highlight only a specific reference number (e.g., reference number 13) among the multi references that started from 11 to 15?

as here (I can not highlight reference number 13):

 \documentclass[10pt,journal,compsoc]{IEEEtran}
 \usepackage{soul}
 \usepackage{xcolor}
  \usepackage{cite}
  \sethlcolor{yellow} 

 \begin{document} 

  Second, sensor-based approaches~\cite{yamazoe1991new,korotcenkov2011instability,park2015material,rosi2011social,clark1992optimal} rely on



\bibliography{Refernces_file}
 \bibliographystyle{unsrt}

  \end{document}

Refernces_file:

@article{yamazoe1991new,
  title={New approaches for improving semiconductor gas sensors},
  author={Yamazoe, Noboru},
  journal={Sensors and Actuators B: Chemical},
  volume={5},
  number={1-4},
  pages={7--19},
  year={1991},
  publisher={Elsevier}
  }



  @article{korotcenkov2011instability,
  title={Instability of metal oxide-based conductometric gas sensors and 
   approaches to stability improvement (short survey)},
   author={Korotcenkov, G and Cho, BK},
   journal={Sensors and Actuators B: Chemical},
   volume={156},
   number={2},
   pages={527--538},
   year={2011},
   publisher={Elsevier}
   }

  @article{park2015material,
  title={Material approaches to stretchable strain sensors},
  author={Park, Jaeyoon and You, Insang and Shin, Sangbaie and Jeong, 
   Unyong},
   journal={ChemPhysChem},
   volume={16},
   number={6},
   pages={1155--1163},
   year={2015},
   publisher={Wiley Online Library}
    }



    @inproceedings{rosi2011social,
     title={Social sensors and pervasive services: Approaches and 
     perspectives},
     author={Rosi, Alberto and Mamei, Marco and Zambonelli, Franco and 
    Dobson, Simon and Stevenson, Graeme and Ye, Juan},
    booktitle={2011 IEEE international conference on pervasive computing and 
  communications workshops (PERCOM Workshops)},
   pages={525--530},
   year={2011},
   organization={IEEE}
     }


    @article{clark1992optimal,
    title={Optimal placement of piezoelectric actuators and polyvinylidene 
    fluoride error sensors in active structural acoustic control approaches},
     author={Clark, Robert L and Fuller, Chris R},
    journal={The Journal of the Acoustical Society of America},
   volume={92},
    number={3},
    pages={1521--1533},
     year={1992},
     publisher={ASA}
     }

enter image description here

2- How I can highlight a phrase with including citations and references of sections, tables or figures?

as here (I can not highlight numbers of the sections):

\documentclass[10pt,journal,compsoc]{IEEEtran}
 \usepackage{soul}
\hl{In Section}~\ref{section 5}, \hl{we add a supplemental case study.}\hl{ 
In Section}~\ref{section 6} \hl{a description of related work is given, and 
in Section}~\ref{section 7},\hl{ we conclude the paper.}

Output:

enter image description here

Balenciaga answered 15/10, 2019 at 9:42 Comment(2)
Can you please add a minimal reproducible example?Tuinenga
Okay, I added. Could you help me then?Balenciaga
T
9

To use \ref within a highlighted text, wrap it in an additional layer of {} and \cite commands can be hidden in an \mbox (for non-numerical reference styles this might lead to problems with linebreaks):

 \documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage{soul}
\usepackage{xcolor}
\usepackage{cite}
\sethlcolor{yellow} 

\begin{document} 

\section{section 5}
\label{section5}
\section{section 6}
\label{section6}
\section{section 7}
\label{section7}

\hl{In Section~{\ref{section5}}, we add a supplemental case study. In Section~{\ref{section6}} a description of related work is given, and 
in Section~{\ref{section7}}, we conclude the paper.}

\hl{test\mbox{\cite{yamazoe1991new}} test}

\bibliography{\jobname}
\bibliographystyle{unsrt}

\end{document}

Unrelated to the problem, but you should avoid spaces within labels

enter image description here

Tuinenga answered 15/10, 2019 at 11:22 Comment(11)
Thanks, This is works with me and solved question 2. But, what about question 1?Balenciaga
@MohsenAli Well, there are no \cites in the code fragment you posted... If you would show a compilable document that reproduces the problems you face, I could have a lookTuinenga
oh, I edited my post and added the code that shows the problem. See, when revised my paper, I added two more references (reference 13 and reference 14). My request is to only highlight the number of these added references (13 & 14) such that the editor can easily notice this modification?Balenciaga
@MohsenAli Unfortunately the code fragment does not compileTuinenga
Okay, I updated the code to be compilable. Could you help me?Balenciaga
@MohsenAli Sorry, but this is still just a code fragment. I could not even try to make it compilable, because it lacks relevant parts, like what bibliography style you use. Without being able to read your mind, there is not much I could try to help you.Tuinenga
@MohsenAli Thanks for posting a compilable document! However it does not produce the list of citation you show in your questions but compresses them into [1]–[5]. It does not make sense to highlight, say 3, if it is not shown.Tuinenga
It is strange since it appears with me like [1],[2],[3],[4],[5], using the same code I posted. However, you could try to highlight the shown numbers, for example [1] or [5], it just an example. In this case, I can change your could for my purpose.Balenciaga
Thank you, but I already solved highlighting issue of \cite. I found it here: tex.stackexchange.com/questions/139463/… However, question 1 not solved yet with me!!Balenciaga
Okay, I solved question1 as follows. Second, sensor-based approaches~\cite{yamazoe1991new,korotcenkov2011instability}\hl{\mbox{\cite{park2015material}}}\cite{rosi2011social,clark1992optimal} rely onBalenciaga
BTW, I appreciate your answer, and I will vote it. Thanks :)Balenciaga
T
0

Instead of soul, you could use lua-ul to highlight the text (requires lualatex for compiling):

% !TeX TS-program = lualatex
\documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage{lua-ul}
\usepackage{luacolor}
\usepackage{cite}

\begin{document} 

\section{section 5}
\label{section5}
\section{section 6}
\label{section6}
\section{section 7}
\label{section7}

\highLight{In Section~\ref{section5}, we add a supplemental case study. In Section~\ref{section6} a description of related work is given, and 
in Section~\ref{section7}, we conclude the paper.}

\highLight{test \cite{yamazoe1991new} test}

\bibliography{\jobname}
\bibliographystyle{unsrt}

\end{document}

enter image description here

Tuinenga answered 21/6, 2024 at 11:29 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.