The standard way of writing quotes and double quotes in LaTeX is with `` and '', but I find them quite ugly. Isn't there something similar to \emph{}, but for quotes? I mean something like \quotes{quoted text goes here}.

I've been looking but couldn't find any, maybe you guys can.

migrated from stackoverflow.com Dec 1 '11 at 14:47

This question came from our site for professional and enthusiast programmers.

  • Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – Werner Dec 1 '11 at 15:23
  • 1
    meh, emacs automatically replaces " with `` and '' as appropriate when I type, it also highlights text like a boss. – crasic Dec 1 '11 at 21:33
  • @crasic tex.stackexchange.com/questions/39285/… – matth Apr 21 '12 at 10:30

10 Answers 10

up vote 67 down vote accepted

You can just define your own macro:

\newcommand{\quotes}[1]{``#1''}
...
\quotes{Hello World!}
  • 2
    I found this as the most natural solution, and I defined the \q instead of \quotes, for brevity. – Sophivorus Aug 22 '13 at 12:29
  • 1
    Out of curiosity, what does the 1 and #1 stand for? – warship Aug 30 '15 at 5:51
  • 8
    1 denotes that \quotes takes one argument. #1 denotes that argument. – chandresh Feb 14 '16 at 5:01

If you load csquotes by \usepackage{csquotes} you can use \enquote{quoted text}. The package's macros are context sensitive such that the quotation marks are adapted appropriately when nested and to the language used by babel. It also has other great features such as facilities for block quotations and integration with biblatex. Here's a simple example:

\documentclass{article}

\usepackage{csquotes}

\begin{document}

\enquote{quote}

\enquote*{quote}

\enquote{quote \enquote{quote in quote}}

\end{document}

Output of example

  • 1
    Some other packages provide similar functionality. For example \usepackage[slovak]{babel} allows the usage of the command \uv{}. OP, you can also define your own command on a similar basis. – Harold Cavendish Dec 1 '11 at 15:14
  • 2
    @HarroldCavendish I believe however that csquotes is far more advanced and flexible. – N.N. Dec 1 '11 at 16:32
  • @HarroldCavendish It might be an idea to write answers for the packages you're thinking of. Completeness! – N.N. Dec 1 '11 at 19:10

I use the following in all my latex documents:

\usepackage[autostyle=false, style=english]{csquotes}
\MakeOuterQuote{"}

With this, you can simply quote your text like "this", and csquotes will change it to

``this''

The drawback is that if you forget a " it messes up the parity everywhere with no warnning. Also, If you need nested quotes, you will have to use \enquote{this}.

FWIW, ConTeXt MkIV disables these "smart quotes" by default. So

\starttext
 ``a''
\stoptext

gives you exactly what you type! The recommended way of getting quotes is to type and (most editors give a keyboard short cut for this) or use \quotation{...}. The \quotation macro is language specific, so it gives you the correct quotes in English (“—”), French (« — »), etc.

I think \lq and \rq might just work for single quotes. Use them twice for double-quotes. if you have something like "this is a quote' " do this on the end \rq\,\rq\rq.

I use this bit of code at the top of my tex file. Just use the regular double quote on your keyboard

"

at the beginning and end of each quote. It will select the open and closing double quotes for you,

\newif\ifquoteopen
    \catcode`\"=\active 
    \DeclareRobustCommand*{"}{%
       \ifquoteopen
         \quoteopenfalse ''%
       \else
         \quoteopentrue ``%
       \fi
    }
  • Welcome to tex.se! – Andrew Swann Oct 28 '16 at 12:50
  • Can some explain how this works? – clay May 24 '17 at 13:58
  • Looks promising, but this seems to make all my non-breaking spaces become quote characters. – beldaz May 28 at 2:11

The well established textcmds package provides equivalents of macro suggestions in several of the answers, in particular there is \qq for double quoted text and \q for single quoted:

Sample output

\documentclass{article}

\usepackage{textcmds}

\begin{document}

Some \qq{quoted} material.  Another quote \q{style}.

\end{document}

Either with Win XP or Linux your keyboard should have those: »«. The technical term in German for Win XP is »Eingabegebietsschemaleiste«, which I cannot translate; it simply is the layout of your keyboard depending of the country.

EDIT: Following Seamus' comment, find out how to type Guillemets with your keyboard.

  • I think the English term is simply Language Bar (cf. German vs. English). I don't quite gather the point of your post though, perhaps you could make it a bit more explicit. Afaik, the Language Bar allows you to switch your keyboard layout quickly, but neither the standard German nor the Standard English layout features »«? – doncherry Dec 1 '11 at 16:03
  • 6
    They're sometimes called "guillemets". Apparently, this is "in honour of French typcutter Guillaume le Bé, who may have invented them". (Bringhurst p.310) – Seamus Dec 1 '11 at 16:18
  • 3
    @Seamus They are also used in Greek, whoever invented them should have been <<guillotined>>. Interestingly both the Greeks as well as the Norwegians almost got rid of them now (mainly due to the web influence). – Yiannis Lazarides Dec 1 '11 at 16:59
  • 1
    On Mac, guillemets are available in the basic qwerty layout at alt-\ («) and alt-| (»). Note that in LaTeX you can type them using << and >> (possibly requires babel and a specific language). But as Yannis suggests, they are used differently depending on the language (e.g. in «french» or in »german«, so this is really if you want to nitpick on typographic details. The curly quotes that everyone understands are similarly available with alt/alt-shift on the [{ key (“double”) or the ]} key (‘simple’). – Damien Pollet Dec 1 '11 at 17:20
  • 2
    On Ubuntu guillemets can be obtained using the awesome Compose key as follows: ComposeKey+ << or >> – Seamus Dec 1 '11 at 18:07

If you're on Emacs there's typopunct.el, which has a number of useful functions. In buffers with typopunct-mode on, ' and " are always input as their curly versions. http://www.emacswiki.org/emacs/typopunct.el

\textquotedblleft and \textquotedblright use is best

  • 2
    How is that "best"? – Phelype Oleinik Jul 13 at 11:36
  • 2
    Of course it depends on your definition of "best", but I would argue that the semantic markup of csquotes or even the poor man's version of it (\newcommand{\quotes}[1]{``#1''}) is far superior to \textquotedblleft/\textquotedblright. For one it is more semantic and can be made even more semantic and secondly it is much shorter to type and one does not have to worry about spaces being eaten by the commands. – moewe Jul 13 at 11:39

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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