2

I am using this

\footnote{ \url{https://www.mikepoweredbydhi.com/products/mike-11}}

to render a footnote, but the problem is that the footnote at the bottom of the page, when rendered has the index 2 instead of 1 (the same in the text). I do not understand why this happens in Chapter 4 because in all the other chapters before it worked fine. Looks like it starts to increment from 2 in Chapter 4 instead starting to increment from 1. Any idea what is wrong?

Thank you

jjdb
  • 2,238
Sorin
  • 45
  • You should offer us a MWE, otherwise this would be pure guessing (if at all). With a certain probability you will find the cause of your problem while reducing your code to get the MWE. – Jürgen May 03 '17 at 09:19
  • @Jürgen unfortunately is very difficult to provide an example of code because I am using a complex template. But I am sure that even a pure guessing to tell me where to look in the big forest for more details is highly appreciated. – Sorin May 03 '17 at 09:29
  • First of all I would try to exchange the \footnote{\URL{foo}} with a simple \footnote{test}. I do not believe, that this depends on the \url, so you could delete the url-tag. – Jürgen May 03 '17 at 09:36
  • @Jürgen I removed the \url, the problem is still there. Strange thing is that the problem is only on the first page of Chapter 4, if I go the second page and add footnotes they are rendered fine starting with second page – Sorin May 03 '17 at 09:41
  • What happens if you comment out the chapters one to three, so that chapter four becomes chapter one? – Jürgen May 03 '17 at 09:47
  • 'They are rendered fine starting with the second page' means the footnote on the second page has also the value 2? – jjdb May 03 '17 at 10:18
  • @jjdb The footnote on the second page starts with 1. I am not sure, but it is correct that footnotes to start from one on each page, right? – Sorin May 03 '17 at 10:45
  • @Sorin No, that depends on the options and packages used. Usually, you should have some of the answers here implemented in order to have a correct reset of the footnote counter after each page. Maybe you should also check if you have not implemented the last answer, as this seems to be also a cause for errors. – jjdb May 03 '17 at 15:35

1 Answers1

3

Apparently there is a problem with the corresponding counter. You can systematically try to solve the problem by checking the following points:

  • As always, first delete all .aux files, then recompile. Is the error still there?

  • Are there other \footnote commands used before and after this footnote in this chapter? Do they give a correct output or do they carry the error with them?

  • Insert one \footnote some paragraphs before and one some paragraphs after the current one. What happens?
  • See if you have a \footnote command in the caption of a float environment (figure,table). Try moving the float some paragraphs in front or further into the back of your chapter. Also check the following related question.

  • Do you manually manipulate the footnote counter? Look for \setcounter, \stepcounter, \refstepcounter or \addtocounter commands.

  • Check your preamble if you redefine commands or environments like \chapter or \section, and if you use there commands that are changing the counter.

  • Insert a \arabic{footnote} at various parts of the current chapter, like the right after the \chapter{…} command, just before and after each \footnote command, and a paragraph before and after the footnote command. (Maybe put some text around like FOOTNOTE-COUNTER::\arabic{footnote}:: to find it easier in your text) This let's you identify how the counter changes directly. Right after the start of the chapter it should have the value 0. By moving these statements around in your code, you should be able to identify which command causes the error.

  • If the command causing the error is identified (e.g. \chapter command that alters the counter), you can try to find out more about it by putting a \show command in front of it, as suggested here. The command line output and the logfile show then the definition of this command. Check again if this command has been modified in your preamble including all loaded packages.

jjdb
  • 2,238
  • Thank you very much for the debugging sugestions. In order of your suggestions: 1) no 2) the same problem 3) no 4) with \setcounter I was able to set the counter to 0 so it is displayed well like 1 at the bottom of the page, so it is a great workaround 5) yes, I have \chapter and \section on every chapter/section. So \setcounter helped me to solve the problem – Sorin May 03 '17 at 10:58
  • I would not recommend using \setcounter as a workaround. I suggested to see if these commands are in your code, maybe from copy&paste from somewhere else. To your 5) I meant if there is a redefinition like \renewcommand{\chapter}{…, or via \def or \let etc. I REALLY recommend to try to find the source of this error, as your workaround only cures the symptoms, but might stab you in the back later. – jjdb May 03 '17 at 11:04
  • For 6) I have counter displayed 1, just right after the \chapter. – Sorin May 03 '17 at 11:08
  • I have a renew but just \renewcommand{\chaptername}{Capitolul} not for the \chapter itself. However, this applies to all chapters, not only to Chapter 4. – Sorin May 03 '17 at 11:09
  • for 6), can you try this right before \chapter? – jjdb May 03 '17 at 11:31
  • If I put the logging statement just before \chapter I get also displayed 1. – Sorin May 03 '17 at 15:55
  • Can you also try the last option I've added later to my answer with putting \show in front \chapter? The document then would not compile; can you then paste the message here? – jjdb May 03 '17 at 17:18
  • I tried what you suggested in your last comment. The document compiled, the title of the chapter was not formatted with the special font, but was written with ordinary font and the index of the footnote was correctly rendered as 1. – Sorin May 03 '17 at 18:36
  • No, I mean if you can show the output of the \show command. If you have difficulties handling the .log file, include \usepackage[T1]{fontenc} in the preamble and use \meaning instead, and paste the output here. I, for instance, get the following output on the .log file > \chapter=macro:-> \caption@addsubcontentslines {chapter}\caption@chapter@ORI . It would really be easier if you try to put a MWE together: just copy all of your project to another folder and delete unnecessary code while still reproducing the error. – jjdb May 04 '17 at 06:56
  • I got the macro:->\caption@addsubcontentslines {chapter}\caption@chapter@ORI which looks like yours? – Sorin May 04 '17 at 10:03
  • I think you really should provide a MWE, otherwise it's too difficult to help you. It should not be too difficult, it took me ~10 Minutes or so to strip down my thesis to a MWE including only the packages relevant to the error, and believe me, I have complicated templates, too. – jjdb May 04 '17 at 11:07