Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

csquotes automatically includes or excludes the punctuation marks in or from the quotation depending on the language specified in the preamble. This can be adjusted individually by commands like \DeclareAutoPunct{.,;!?} etc.

british example: "This is a quote".

american example: "This is a quote."

I now designed a newcommand that wrapps a quotation into different quotation symbols. Let just for the sake of the question this example be the case:

custom example: °This is a quote°.

I did this simply be by the following newcommand: \newcommand{\strangequote}[1]{°#1°}

This of course does not move punctuation inside or outside the quotation marks. Could I change the command so that it does? How can I design a command that

  1. also pays attention to the definitions of \DeclareAutoPunct{.,;!?} (so that I globally chooses for all my quotations whether to include or exclude the punctuation) or

  2. allows me to choose for strangequote individually whether or not to include the punctuation.

Can csquotes' command \MakeForeignQuote be of any help?

Clarification: I do want to use this command in addition to the normal command (enquote or textquote) that sets british or american quotation marks.

(Small question aside: I never got the difference between quote commands and the quote commands with a "c", e.g., between \textquote and \textcquote)

share|improve this question
    
Temporary stop-gap solution: \newcommand\strangequote[2][]{°#2°#1} --> British emulation; \newcommand\strangequote[2][]{°#2#1°} --> American emulation. Wrap up in a conditional for easy switching. (Not a real solution, but sometimes it's best to just get on with the document writing....) –  jon May 24 '13 at 14:02
1  
is ' "This is a quote". ' really proper british? referring to my venerable copy of fowler, it says (paraphrase) "use logic" -- if the statement ends within the quote, that's where the punctuation belongs; otherwise, punctuation should go outside the quote marks. following this practice has never gotten me in trouble except with over-zealously over-pedantic copyeditors. (and granted, it's pretty hard to make the distinction automatic, so i don't even try.) –  barbara beeton May 24 '13 at 14:07
    
@barbarabeeton -- I believe you're correct basically correct. The difference is (I think) when the discrete quotation is part of a larger sentence. So: British: 'According to ClintEastwood, "this is pretty complicated".' Or: American: "According to ClintEastwood, 'this is pretty complicated."' (The other difference is the nesting order of quotation marks is different.) –  jon May 24 '13 at 14:21
    
@jon -- as you've phrased it, i would accept either (depending on the style of the rest of the material, to maintain consistency), but for a quotation standing alone, as in the original question, the punctuation goes inside. and yes, the nesting order of quotation marks is indeed different. (i got burned by an overzealous copyeditor insisting that, in a user manual quoting computer commands, the quoted command ended the sentence, so a period must go inside. no, no, no! an uninformed user will type in the period, since it's inside the quotes. fowler saved me.) –  barbara beeton May 24 '13 at 14:31
    
@barbarabeeton -- Haha. A great example of the principle that all grammatical 'rules' must be broken once in a while! –  jon May 24 '13 at 15:30
add comment

1 Answer 1

I've never really made csquotes do my bidding with trailing punctuation, so I hope someone else answers. However, with \@ifnextchar, you can do a poor man's implementation. Where it probably fails is in respecting \spacefactor, but maybe someone else can also point out where my hacks can be improved. Anyway...

\documentclass[12pt, oneside]{article}
\usepackage[british,american]{babel}
\usepackage[autostyle=true,autopunct=true]{csquotes}
\parindent 0pt

%  default spacefactors (nonfrenchspacing):
%  1000 = normal space token
%  1250 = after comma    -\
%  1500 = after semicolon  > all 3 treated as if 1500
%  2000 = after colon    -/
%  3000 = after period, question mark, exclamation mark

\makeatletter

\def\preservesf#1#2{#1}% preserves spacefactor and gobbles punctuation ..?

\newcommand\sqa[1]{%
  ``#1%
  \@ifnextchar.{.''\preservesf{\spacefactor=3000\relax}}{%
    \@ifnextchar,{,''\preservesf{\spacefactor=1500\relax}}{''}}%
}

\newcommand\sqb[1]{% <--   strictly speaking, unnecessary.
  `#1%                     instead of defining this command, do
  \@ifnextchar.{'}{%       \sqb{<quoted text>}. as normal!!
    \@ifnextchar,{'}{'}}%  provided for illustrative purposes
}

\makeatother

\newif\ifamstyle %  basic switch so your \strangequote emulates
\amstyletrue     %  british or american style

\ifamstyle
  \let\strangequote\sqa
\else
  \let\strangequote\sqb
\fi


\begin{document}
% American emulation:
\selectlanguage{american}%
The language is: \languagename.

``''{This is a quote}. \the\spacefactor\ Really?

\sqa{This is a quote}. \the\spacefactor\ Really?

\sqa{This is a quote}, \the\spacefactor\ really!

\sqa{This is a quote}: \the\spacefactor\ really!

\sqa{This is a quote}; \the\spacefactor\ really!

\sqa{This is a quote}! \the\spacefactor\ really!

\sqa{This is a quote}? \the\spacefactor\ really!

% British emulation:
\selectlanguage{british}%
the language is: \languagename.

\enquote{This is a quote}. \the\spacefactor\ Really.

\sqb{This is a quote}. \the\spacefactor\ Really?

\sqb{This is a quote}, \the\spacefactor\ really!

\sqb{This is a quote}: \the\spacefactor\ really!

\sqb{This is a quote}; \the\spacefactor\ really!

\sqb{This is a quote}! \the\spacefactor\ really!

\sqb{This is a quote}? \the\spacefactor\ really!


\verb|\strangequote|:

\strangequote{This is a quote}. \the\spacefactor\ Really?

\strangequote{This is a quote}, \the\spacefactor\ really!

\strangequote{This is a quote}: \the\spacefactor\ really!

\strangequote{This is a quote}; \the\spacefactor\ really!

\strangequote{This is a quote}! \the\spacefactor\ really!

\strangequote{This is a quote}? \the\spacefactor\ really!

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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