8

I use both the index and babel packages. They both redefine \markboth and \markright. If I include babel before index, the index package warns me about the double redefinition. Code:

\documentclass{article} \usepackage[english]{babel} \usepackage{index} \begin{document} \end{document} 

Extract from the TeX output:

(/usr/share/texlive/texmf-dist/tex/latex/index/index.sty LaTeX Warning: Command \markboth has changed. Check if current package is valid. LaTeX Warning: Command \markright has changed. Check if current package is valid. ) (./a.aux) (./a.aux) ) 

If I swap the two \usepackage lines so that index is loaded before babel, there's no warning. But either way I'm getting the definition of these commands from whichever is loaded last.

My objective is twofold: I want to get rid of the warning (because nonactionable warnings drown out the actionable ones), and I want to understand what I'm losing either way (I haven't spotted any problem so far, but I could be missing something, or run into unexpected problems later as I write more of the document). Presumably, if both packages redefine these commands, they have a good reason.

Should I include babel before or after index? If before, how do I get rid of the warning?

Is there anything I can/should do to make sure that both babel and index are working correctly? What problems should I be looking for?

4
  • Do you need index at all? If you need multiple indexes, then use imakeidx Commented Feb 11, 2016 at 18:37
  • 2
    @ChristianHupfer I have macros that rely on index that I've been carrying around for years, not just for multiple indices but also \index* and possibly other features that I'm not recalling right now. I'd rather not sort them out at this time. I've never looked at imakeidx. (Could you add an answer mentioning it to this question?) Commented Feb 11, 2016 at 18:44
  • 2
    Done so ;-) I wonder, it has not been given as an answer (but as comment only, not showing how to use it) Commented Feb 11, 2016 at 18:54
  • if the language of your document is not english, then the substitutions of babel for common heading strings are what you'll probably want. i haven't looked, but i suspect that "Index" is the only option you'll get with the index package. Commented Feb 11, 2016 at 20:31

1 Answer 1

7

Edit 2023

In the meantime the LaTeX kernel has changed the \markboth and \markright command (to support extended mark options). That means that the check from index.sty fails regarding in any case, with and without babel and also regardless of the loading order.

The warning can not be avoid unless the package is adapted.

Old answer

Load index before babel you then will get both: the redefinition from index and the language additions from babel as babel will store the definition in \org@markboth and then use it.

8
  • With index loaded FIRST, I've switched from babel to polyglossia (along with my ongoing conversion from pdflatex to lualatex). However, I'm still seeing the warnings: "LaTeX Warning: Command \markboth has changed. Check if current package is valid." and "Command \markright has changed. Check if current package is valid." Do I need to just accept that these warnings will continue, despite the index > polyglossia order? Thanks in advance! Commented Feb 10, 2024 at 22:16
  • why switching to polyglossia? babel works fine with lualatex (and in various part actually better than polyglossia). Commented Feb 10, 2024 at 22:29
  • I've read somewhere that polyglossia works better with lualatex, but it really doesn't matter to me as long as I get the same functionality. The issue is that I get the identical warnings whether I use babel OR polyglossia immediately after loading index. Neither babel NOR polyglossia prevent the warnings from appearing. What am I missing?? Thank you!! Commented Feb 10, 2024 at 22:36
  • @RosesBouquet I added an edit. You could try to contact the author (the readme on ctan contains a mail address), but with such an old sty it could be difficult to get an update. Commented Feb 10, 2024 at 22:58
  • Thank you. I agree with your assessment. Your edit will help those unfortunates like me who continue to search for answers that otherwise don't exist. I sometimes keep poking at the issue hoping that something will have changed. I'll try to contact the index author just the same. Thanks again!! Commented Feb 10, 2024 at 23:31

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.