TeX - LaTeX Asked by Nils Schmidt on July 4, 2021
There are several types of quotation marks in the English language (and in other languages there are even more). There are also several ways in LaTeX to represent these. I have seen editors, that are capable of directly entering “ and ”. And I have also seen things like this `”.
So, what is the best way to do English quotation marks in LaTeX?
A quick summary of the available solutions:
Type ``text''
in your source code to produce “text”, and type `text'
to produce ‘text’.
Using an Unicode editor—and either usepackage[utf8]{inputenc}
or XeTeX/LuaTeX—you can simply type “text”
or ‘text’
in your code.
With the csquotes
package, you type enquote{text}
, but you also get loads of other options such as context sensitivity and foreign quotes.
Correct answer by Juan A. Navarro on July 4, 2021
I have always simply used two backticks, ``
, to create an opening quotation mark, and two apostrophes, ''
, to create a closing one. In fact, many editors will automatically keep track of which one you need next and enter it if you type the 'regular' quotation mark, "
.
Answered by Michael Underwood on July 4, 2021
TeX/LaTeX display the real quotation marks by default: `
and ``
are converted to opening quotation marks; '
and ''
are closing quotation marks. You'll generally always see the curved quotes in the output, in the default font. You should always quote like
``this''
and not like ''this''
or "this"
, because that appears like ”this” (closing quotation marks on both sides), and is very annoying to readers. (If you type the double quote character in Emacs, it automatically guesses whether you meant to insert ``
or ''
; other editors probably do too.)
You can also directly enter the curved quote characters if you like, if you're using an environment that supports Unicode input: either usepackage[utf8]{inputenc}
, or XeTeX/LuaTeX. See the question on glyph insertion.
Answered by ShreevatsaR on July 4, 2021
You can make a command to typset quotation marks correctly without installing any packages. Add the following to your preamble:
newcommand{q}[1]{``#1''}
and then simply type your in-text quote in place of <text>
in the following
q{<text>}
Therefore, your document code should look like
documentclass{article}
renewcommand{q}[1]{``#1''}
begin{document}
Piglet sidled up to Pooh from behind. q{Pooh?} he whispered.
q{Yes, Piglet?}
q{Nothing,} said Piglet, taking Pooh's hand. q{I just wanted to be sure of you.}
end{document}
(Quote credit to A.A. Milne from Winnie the Pooh)
Answered by Harry Smith on July 4, 2021
As other answers have pointed out, csquotes
is fantastic. Here are three reasons I like csquotes
so much.
csquotes
will figure out the right thing to do.Here is a demonstration which employs British and American conventions at different points in the document. British conventions are default as that is the default language of the document. However, because autostyle
is specified, American conventions are used when this language is active.
documentclass[american,british]{article}
usepackage[utf8]{inputenc}
usepackage{babel}
usepackage[T1]{fontenc}
usepackage[autostyle]{csquotes}
MakeAutoQuote{‘}{’}
begin{document}
This is an excerpt from Lewis Carroll, emph{Alice's Adventures in Wonderland in The Complete Works of Lewis Carroll}, The Modern Library: Random House. Pp.~75--76. (Note: no copyright year is included as none is given.):
begin{quotation}
‘Come, we shall have some fun now!’ thought Alice. ‘I'm glad they've begun asking riddles --- I believe I can guess that,’ she added aloud.
‘Do you mean that you think you can find out the answer to it?’ said the March Hare.
‘Exactly so,’ said Alice.
‘Then you should say what you mean,’ the March Hare went on.
‘I do,’ Alice hastily replied; ‘at least --- at least I mean what I say --- that's the same thing, you know.’
‘Not the same thing a bit!’ said the Hatter. ‘Why, you might just as well say that ‘I see what I eat’ is the same thing as ‘I eat what I see’!’
‘You might just as well say,’ added the March Hare, ‘that ‘I like what I get’ is the same thing as ‘I get what I like’!’
‘You might just as well say,’ added the Dormouse, which seemed to be talking in its sleep, ‘that ‘I breathe when I sleep’ is the same thing as ‘I sleep when I breathe’!’
end{quotation}
selectlanguage{american}
Here is the same passage with American conventions:
begin{quotation}
‘Come, we shall have some fun now!’ thought Alice. ‘I'm glad they've begun asking riddles --- I believe I can guess that,’ she added aloud.
‘Do you mean that you think you can find out the answer to it?’ said the March Hare.
‘Exactly so,’ said Alice.
‘Then you should say what you mean,’ the March Hare went on.
‘I do,’ Alice hastily replied; ‘at least --- at least I mean what I say --- that's the same thing, you know.’
‘Not the same thing a bit!’ said the Hatter. ‘Why, you might just as well say that ‘I see what I eat’ is the same thing as ‘I eat what I see’!’
‘You might just as well say,’ added the March Hare, ‘that ‘I like what I get’ is the same thing as ‘I get what I like’!’
‘You might just as well say,’ added the Dormouse, which seemed to be talking in its sleep, ‘that ‘I breathe when I sleep’ is the same thing as ‘I sleep when I breathe’!’
end{quotation}
end{document}
Answered by cfr on July 4, 2021
If your needs are simple, you could still use the csquotes
package, but configure it to recognize the "
character:
MakeOuterQuote{"}
This way, when you enclose some text in double quotes, it will render with the appropriate quotes for your language.
Though this approach won't work well if you have nested quotes. You could specify another character (like `
) for inner quotes using MakeInnerQuote
, but you would need to maintain nesting manually and you can't use '
, because that would conflict with apostrophe's other uses.
Answered by svick on July 4, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP