How to highlight text containing citation and figure referencing?












0















I am trying to highlight a text with reference. Without references, the below works fine. Could anyone know how to handle the highlighting the text containing citation and figure references? MWE is given below. Any help is highly appreciated.



documentclass{article}

usepackage{xcolor}
usepackage{soul}

newcommand{hlc}[2][yellow]{{%
colorlet{foo}{#1}%
sethlcolor{foo}hl{#2}}%
}



begin{document}

hlc[pink]{hello given by mattsson et al cite{mattsson1998physical}}

hlc[cyan!50]{hello}

end{document}









share|improve this question























  • I think you might find an answer here tex.stackexchange.com/questions/139463/…

    – sheß
    Feb 26 at 14:13






  • 1





    Thank you buddy for the link.

    – KGV
    Feb 27 at 18:42











  • welcome. did it work? consider posting a solution

    – sheß
    Feb 28 at 10:26






  • 1





    @sheß: hlc[green!50]{The write-up is given and please see the figure mbox{ref{fig1}}}. In place of ref{fig1}, use cite{mattsson1998physical}. The key is using mbox to wrap the figures and cites. Thank you

    – KGV
    2 days ago
















0















I am trying to highlight a text with reference. Without references, the below works fine. Could anyone know how to handle the highlighting the text containing citation and figure references? MWE is given below. Any help is highly appreciated.



documentclass{article}

usepackage{xcolor}
usepackage{soul}

newcommand{hlc}[2][yellow]{{%
colorlet{foo}{#1}%
sethlcolor{foo}hl{#2}}%
}



begin{document}

hlc[pink]{hello given by mattsson et al cite{mattsson1998physical}}

hlc[cyan!50]{hello}

end{document}









share|improve this question























  • I think you might find an answer here tex.stackexchange.com/questions/139463/…

    – sheß
    Feb 26 at 14:13






  • 1





    Thank you buddy for the link.

    – KGV
    Feb 27 at 18:42











  • welcome. did it work? consider posting a solution

    – sheß
    Feb 28 at 10:26






  • 1





    @sheß: hlc[green!50]{The write-up is given and please see the figure mbox{ref{fig1}}}. In place of ref{fig1}, use cite{mattsson1998physical}. The key is using mbox to wrap the figures and cites. Thank you

    – KGV
    2 days ago














0












0








0








I am trying to highlight a text with reference. Without references, the below works fine. Could anyone know how to handle the highlighting the text containing citation and figure references? MWE is given below. Any help is highly appreciated.



documentclass{article}

usepackage{xcolor}
usepackage{soul}

newcommand{hlc}[2][yellow]{{%
colorlet{foo}{#1}%
sethlcolor{foo}hl{#2}}%
}



begin{document}

hlc[pink]{hello given by mattsson et al cite{mattsson1998physical}}

hlc[cyan!50]{hello}

end{document}









share|improve this question














I am trying to highlight a text with reference. Without references, the below works fine. Could anyone know how to handle the highlighting the text containing citation and figure references? MWE is given below. Any help is highly appreciated.



documentclass{article}

usepackage{xcolor}
usepackage{soul}

newcommand{hlc}[2][yellow]{{%
colorlet{foo}{#1}%
sethlcolor{foo}hl{#2}}%
}



begin{document}

hlc[pink]{hello given by mattsson et al cite{mattsson1998physical}}

hlc[cyan!50]{hello}

end{document}






color highlighting soul






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 26 at 8:39









KGVKGV

111




111













  • I think you might find an answer here tex.stackexchange.com/questions/139463/…

    – sheß
    Feb 26 at 14:13






  • 1





    Thank you buddy for the link.

    – KGV
    Feb 27 at 18:42











  • welcome. did it work? consider posting a solution

    – sheß
    Feb 28 at 10:26






  • 1





    @sheß: hlc[green!50]{The write-up is given and please see the figure mbox{ref{fig1}}}. In place of ref{fig1}, use cite{mattsson1998physical}. The key is using mbox to wrap the figures and cites. Thank you

    – KGV
    2 days ago



















  • I think you might find an answer here tex.stackexchange.com/questions/139463/…

    – sheß
    Feb 26 at 14:13






  • 1





    Thank you buddy for the link.

    – KGV
    Feb 27 at 18:42











  • welcome. did it work? consider posting a solution

    – sheß
    Feb 28 at 10:26






  • 1





    @sheß: hlc[green!50]{The write-up is given and please see the figure mbox{ref{fig1}}}. In place of ref{fig1}, use cite{mattsson1998physical}. The key is using mbox to wrap the figures and cites. Thank you

    – KGV
    2 days ago

















I think you might find an answer here tex.stackexchange.com/questions/139463/…

– sheß
Feb 26 at 14:13





I think you might find an answer here tex.stackexchange.com/questions/139463/…

– sheß
Feb 26 at 14:13




1




1





Thank you buddy for the link.

– KGV
Feb 27 at 18:42





Thank you buddy for the link.

– KGV
Feb 27 at 18:42













welcome. did it work? consider posting a solution

– sheß
Feb 28 at 10:26





welcome. did it work? consider posting a solution

– sheß
Feb 28 at 10:26




1




1





@sheß: hlc[green!50]{The write-up is given and please see the figure mbox{ref{fig1}}}. In place of ref{fig1}, use cite{mattsson1998physical}. The key is using mbox to wrap the figures and cites. Thank you

– KGV
2 days ago





@sheß: hlc[green!50]{The write-up is given and please see the figure mbox{ref{fig1}}}. In place of ref{fig1}, use cite{mattsson1998physical}. The key is using mbox to wrap the figures and cites. Thank you

– KGV
2 days ago










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476718%2fhow-to-highlight-text-containing-citation-and-figure-referencing%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476718%2fhow-to-highlight-text-containing-citation-and-figure-referencing%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?