8

I would like to put my \footnotes{} on a separate line in code, to make code easier to maintain and read. But I don't want any whitespace in between the foot note, and the preceeding word in the output. Is this possible?

14

Make it this way:

word%
\footnote{footnote text}
more text

In other words set a percent sign directly after the word, where the footnote belongs to. See also What is the use of percent signs (%) at the end of lines?.

  • I do exactly the same, but the end of my footnote looks like this: } %. This way I can use wrap the lines in emacs (e.g., M-q) and it won't put the 'more text' on the same line as the end of the footnote. – jon Apr 26 '12 at 16:17
  • This works great... – ATOzTOA Feb 28 '13 at 8:20
0

I have the same problem I just solve that by:

\renewcommand\footnote{\nolinebreak \kern-1mm \LTRfootnote}

here:

  • \nolinebreak allows me to prevent footnote break at the end of lines

  • \kern-1mm removes the white space which is produced by the new-line.

here I just used \LTRfootnote for my own purpose. you can use your own command

  • Welcome to tex.sx. -1mm isn't necessarily the width of the space that is to be ignored. That could be more or less, depending on the actual text content of the line. In most cases, it probably won't make much difference, but if the spaces in the line are particularly shrunk, the footnote number could conceivably overprint the previous character. Using \unskip and omitting the \nolinebreak should work more dependably. – barbara beeton Nov 16 at 2:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.