1

I apologize if this has been asked before. I have searched and searched to no avail, it seems questions about getting rid of over/underfull boxes drown out any questions about how to produce the marks.

I have a custom command, and I should like to mark each line that contains this custom command with a marker similar to the over/underfull marker. Ideally it would

  • mark the lines in the output when in draft mode
  • either not produce warnings on the command line, or produce a custom message detailing the count

pointers, big or small, in the right direction are much appreciated :)

  • 1
    overfull rule is a primitive feature that can not be emulated by macros, but you could (depending on your use case) use \marginpar{\vline} or some other such marker. – David Carlisle Mar 28 '16 at 20:30
  • Yay, thanks, that's awesome \marginpar{\vrule width 5pt}. Only trouble is the marginpar is ignored unless I put something else in with the line. Any tip on an empty/invisible place holder I can use, to ensure the marginpar appears in the output? – Born2Smile Mar 28 '16 at 20:45
  • you mean like \marginpar{\vrule width 5pt\leavevmode}? Sadly the marginpar still does not appear :/ – Born2Smile Mar 28 '16 at 21:00
  • \leavevmode\marginpar{...} – David Carlisle Mar 28 '16 at 21:10
  • 1
    not tested. unless there's somethiing with height and depth for the \vrule to complement, it will have a height and dept of zero, which makes it invisible. so try following it by a \vphantom{()} -- that should give it the height of one line. – barbara beeton Mar 28 '16 at 21:17
2

unless there's something with height and depth for the \vrule to complement, it will have a height and dept of zero, which makes it invisible.

i'd probably follow it by a \vphantom{()} to give it the height and depth of one line. you've tried a more latex-y approach

\marginpar{\rule{0.6em}{0.7em}}

and found it works.

this association of the vertical extent of a rule with whatever is on the same line was discussed a long time ago in a tugboat warnings column (it's on the second page). what goes around, comes around.

  • Thanks for the extra tugboat link! I hadn't realised that you can in fact specify not only width to a \vrule but also height and depth, thus I decided to go with \marginpar{\vrule width .6em height .5em depth .3em} – Born2Smile Mar 30 '16 at 19:18

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.