New answers tagged

2

I think this is what you want: \documentclass{article} \usepackage{xparse} \usepackage{hyperref} \DeclareExpandableDocumentCommand{\foo}{smm}{% \texorpdfstring {\IfBooleanTF{#1}{\textsf}{\textit}{#2}--#3} {#2-#3}% } \begin{document} \section{This is \foo{A}{B}} \section{This is \foo*{A}{B}} \end{document}


0

All you needed was \string. \documentclass{article} \usepackage[english]{babel} \usepackage{xr-hyper} \usepackage[destlabel=true]{hyperref} \makeatletter \newcommand{\foo@star}[2]{\textsf{#1}-{#2}} \newcommand{\foo@plain}[2]{\textit{#1}-{#2}} \DeclareRobustCommand{\foo}{\@ifstar\foo@star\foo@plain} \makeatother \newcommand{\mysection}[1]{\section[\string ...


0

As abstract is neither a chapter nor a section so for abstract you should use \begin{abstract}....\end{abstract} as shown below: \begin{abstract} \addcontentsline{toc}{chapter}{abstract} abstract content here \end{abstract} Line below is used to show abstract in list of contents: \addcontentsline{toc}{chapter}{abstract}



Top 50 recent answers are included