I want to typeset verbatim end notes (using minted). Unfortunately pagenote converts all spaces in my page notes into newlines, as the following minimal example shows:

main text
\pagenote[1]{page note text}

Looking at the generated *.ent file we see that every space in the pagenote has been converted to a newline:


How can I prevent this conversion, so that I can use verbatim typesetting in pagenotes?

Are there alternative ways of typesetting verbatim end notes?

  • Verbatim cannot be used in macros. The page notes converts spaces to new lines because of the build in limit of how many characters there can be on a line. Some users hit that limit – daleif Apr 22 '19 at 18:21
  • Thanks @daleif. Do you know how to switch this behavior off? I will not reach that limit. – Roman Apr 23 '19 at 20:46
  • Not at pc, will have a look tomorrow if I have the time – daleif Apr 23 '19 at 20:47
  • I'm now sure there is a way around this. The issue with very long lines, was the fact that when the input becomes available to be written to disk again, the newlines have already been absorbed and thus you just get a long string of data separated by spaces (and having \par instead of blank lines). I'm guessing this comes from the fact that we are using a macro here, aka the input is the argument to a macro. Environments can do this mainly because they can process the data in a different manner than macros. – daleif Apr 24 '19 at 7:35
  • You can see the issue if you copy the definition of \m@m@wrpnote (remember \renewcommand and \makeatletter/-other, then then out comment the \newlinechar line. Then verbatim input the notes file via \verbatiminput{\jobname.ent} (you probably need a dummy minted env`) – daleif Apr 24 '19 at 7:38

Too long for a comment.

Here is an example file showing what is actually going on. The patch removed the \newlinechar='40 and then it defaults to -1. As one can see by running this, at this point when we are given the data, the original newlines have already been converted into spaces, and thus it is too late to do anything. If you absolutely need to have minted in page notes (I'd probably reconsider and use an appendix or similar), then you probably need an environment based interface for writing these pesky chunks to the ent file.




main text
  test LaTeX test

  asdfsd asdfsadf


% just so we never run the minted env

The actual ent file:



enter image description here

| improve this answer | |
  • Amazing solution, @daleif! I will accept it after a few more checks. Thanks! – Roman Apr 24 '19 at 8:50
  • @Roman it is not a solution, it just explains why one cannot do what you want to. – daleif Apr 24 '19 at 9:13
  • 1
    Yes I see now what you mean. After some experimentation with your input I think I'll follow your advice and do a proper appendix. Thanks anyway! – Roman Apr 24 '19 at 14:40

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.