When including quotes in a text, there are some styles that need to be adhered to. One style is to always place the last quote where the actual quote ends, no matter the next character (e.g. ... and then he said, "This is a disgrace", which is uncommon even for him.. Another style is to include punctuation marks inside the quote if such characters follow the quote (e.g. ... and then he said, "This is a disgrace," which is uncommon even for him.).

Once selected, a style should be consistent throughout the document. Thus, I figured it would be nice to use a macro which took care of this, like so:

... and then he said, \quote{This is a disgrace}, which is uncommon even for him.

The macro should then be able to wrap the argument in quotation marks scan the next character and place the last quotation mark where appropriate, depending on the desired style. (I know that \ifnextchar can be used to scan the following character, but not how to move it inside the quote if necessary.)

  • 1
    I believe that the csquotes package does it.
    – egreg
    Mar 2, 2012 at 10:16
  • @egreg: Indeed it does. But for sake of interest, how would one go about doing it if csquotes wasn't available? =)
    – gablin
    Mar 4, 2012 at 9:50

1 Answer 1


The package csquotes does this job and there's no much point in reinventing the wheel. :)

Just to play with \futurelet here's a way to put commas, periods, colons and semicolons before the closing quotes:


and then he said, \squote{This is a disgrace}, which is uncommon even for him.

and then he said, \squote{This is a disgrace,} which is uncommon even for him.
  • 1
    It might be worth noting that (despite the original request), colons and semi-colons are always put outside of the closing quotation mark.
    – jon
    Mar 4, 2012 at 20:55
  • @jon Just remove the relevant lines from the code (and the corresponding \fi).
    – egreg
    Mar 4, 2012 at 21:10
  • Yes. My comment was less about correcting your answer and more as a caveat for people who adopt the solution blindly.
    – jon
    Mar 4, 2012 at 21:31

You must log in to answer this question.

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