0

Problem: When I include a reference in a caption which then goes into the list of figures, tables etc it creates an index entry, how can I remove roman numeral entries from a xindy index automatically?

Updated MWE:

\documentclass[oneside]{memoir}

\usepackage[backend=biber]{biblatex}     
\usepackage{imakeidx}
\usepackage[hidelinks]{hyperref}

\begin{filecontents}{example.bib}
@article{Pra21,
author = {Pragana, J.P.M. and Sampaio, R.F.V. and Bragan{\c{c}}a, I.M.F. and Silva, C.M.A. and Martins, P.A.F.},
}
\end{filecontents}

\begin{filecontents*}{style.xdy}
(markup-index :open  "\begin{theindex} ~n
 \providecommand*\lettergroupDefault[1]{}
 \providecommand*\lettergroup[1]{%
 \par\textbf{\large#1}\par\medskip
   \nopagebreak
  }"
          :close "~n~n\end{theindex}~n"
          :tree)

(markup-locclass-list :open "\dotfill " :sep ", ")
;; End
\end{filecontents*}

\addbibresource{example.bib}
\makeindex[program=truexindy, options=-M texindy -C utf8 -L english -M style]

\begin{document}

\frontmatter
\listoffigures

\mainmatter
\chapter{Test}
Section. \cite{Pra21}
\begin{figure}
\caption{\cite{Pra21}}
\end{figure}

\appendix
\printindex

\end{document}

To compile I am using:

% arara: clean: {extensions: [idx, ilg, ind, out, ent, glo, bbl, bcf, ist, blg, run.xml, aux,lof,log]}
% arara: clean: {files: [example.bib,style.xdy]}
% arara: pdflatex: {options: [-halt-on-error]}
% arara: biber
% arara: pdflatex: {options: [-halt-on-error]}
% arara: xindy: {modules: [basic], codepage: utf8, language: english}
% arara: pdflatex: {shell: yes, options: [-halt-on-error]}}
% arara: pdflatex: {options: [-halt-on-error]}
% arara: clean: {extensions: [idx, ilg, ind, out, ent, glo, bbl, bcf, ist, blg, run.xml, aux,lof,log]}
% arara: clean: {files: [example.bib,style.xdy]}

This is what it is returning right now:

enter image description here

This is my only question that I haven't ticked an answer for so wouldn't mind finding an answer from others or myself when I need this for my thesis, hence the edit so I do not have to fix the question again in a year or so. As the comments indicate, the optional caption argument could be used to just remove the reference and keep the same text and this is a viable alternative.

3
  • Do you want to keep citations, e.g. [Pra21], shown in list of tables/figures? Jul 8, 2021 at 19:23
  • Preferably if that is possible, it is only the "i" and similar in my main file I would like removed please.
    – user245306
    Jul 8, 2021 at 19:30
  • To be fair I think I might just use the optional argument and put the same title in it without the reference, would be nice if there was a way to switch it off but it's not an issue if it is difficult to do
    – user245306
    Jul 8, 2021 at 20:40

1 Answer 1

1

Indexing in biblatex is controlled by a toggle. You can switch to false before the list of figures and back again later:

\documentclass[oneside]{memoir}

\usepackage[indexing=cite]{biblatex}
\usepackage{imakeidx}
\makeindex

\addbibresource{biblatex-examples.bib}


\begin{document}

\frontmatter
\togglefalse{blx@citeindex}%don't index cite here
\listoffigures
\toggletrue{blx@citeindex}%

\mainmatter
\chapter{Test}
Section. \cite{doody}
\begin{figure}
\caption{\cite{doody}}
\end{figure}

\appendix
\printindex

\end{document}

You must log in to answer this question.