I am using the flagderiv package for proofs but it has no way of putting text before the line number so I have just used \kern to put the text where I want it, but this then misaligns the comments.

Here's an example of what I'm trying to do:



\noindent Formula: 
   \step{}{P\implies Q}{}
   \step{}{Q\implies R}{commment}
      \step{}{Q}{\kern-115pt 1\&3\kern115pt comment}
      \step{}{R}{\kern-115pt 2\&4}
   \conclude{}{P\implies R}{}


This is close to what I want it to look like but the comments are not aligned so I was hoping there is some way of kerning the second comment based on the length of the 1&3.

I was looking into using \widthof but couldn't figure out how to use it for my purpose. I am quite new to latex so I maybe missing something obvious.

Thanks in advance!

  • @DavidCarlisle thank you so much! That does exactly what I wanted! How would I provide a test file in the future?
    – Non808
    Nov 4, 2020 at 19:35
  • @DavidCarlisle that makes sense, I completely forgot that that might be useful! Is it correct now?
    – Non808
    Nov 4, 2020 at 20:28
  • yes thanks, actually in this case I see it really was trivial as you'd mentioned the package in text but you'd be surprised how often fragments posted end up using commands from several unmentioned packages and it's a pain to guess how to run them (so usually I don't even try:-) (+1) Nov 4, 2020 at 20:30
  • Good to know, thanks again!
    – Non808
    Nov 4, 2020 at 20:37

1 Answer 1


You can use


so the 1&3 takes no space so does not disturb the comment, but is offset to the left.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .