how to generate correct single and double quotes in texIsn't there any other way of doing double quotes in LaTeX besides `` + ''?How to avoid overlapping when using single quotes (German)Per-word info needed in DVI to create touch rectangles on LaTeX documents in iTeX for the iPadHow to implement (low-level) arrays in TeXXeLaTeX output prints fine, pdfLaTeX print failsUsing glossaries package with Texmaker (running PDFLaTex)Double accent on single characterLuaTex bug ignoring (If so, how to report?)full final line + pagenote = spurious blank lineHow to insert quotes from another source into texHow to get pdftex to have same PDF output for each run on the same input
Adding a vertical line at the right end of the horizontal line in frac
Can I capture stereo IQ signals from WebSDR?
Remove intersect line for one circle using venndiagram2sets
Are L-functions uniquely determined by their values at negative integers?
Too many spies!
Concatenation using + and += operator in Python
What is the German equivalent of 干物女 (dried fish woman)?
Mistakenly modified `/bin/sh'
Published paper containing well-known results
Commutator subgroup of Heisenberg group.
HackerRank: Electronics Shop
Is killing off one of my queer characters homophobic?
Why do they not say "The Baby"
Possible isometry groups of open manifolds
How are "soeben" and "eben" different from one another?
Nested-Loop-Join: How many comparisons and how many pages-accesses?
Crab Nebula short story from 1960s or '70s
What are some symbols representing peasants/oppressed persons fighting back?
Do native speakers use ZVE or CPU?
How to draw a gif with expanding circles that reveal lines connecting a non-centered point to the expanding circle using Tikz
Getting fresh water in the middle of hypersaline lake in the Bronze Age
How can I legally visit the United States Minor Outlying Islands in the Pacific?
Should you avoid redundant information after dialogue?
Why do candidates not quit if they no longer have a realistic chance to win in the 2020 US presidents election
how to generate correct single and double quotes in tex
Isn't there any other way of doing double quotes in LaTeX besides `` + ''?How to avoid overlapping when using single quotes (German)Per-word info needed in DVI to create touch rectangles on LaTeX documents in iTeX for the iPadHow to implement (low-level) arrays in TeXXeLaTeX output prints fine, pdfLaTeX print failsUsing glossaries package with Texmaker (running PDFLaTex)Double accent on single characterLuaTex bug ignoring (If so, how to report?)full final line + pagenote = spurious blank lineHow to insert quotes from another source into texHow to get pdftex to have same PDF output for each run on the same input
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am writing a tex document using book document class. I have already typed close to 100 pages, but i did a mistake with typing single and double quotes.
I have done it as follows :"test double quotes"
and 'test double quotes'
which generated the output of the form :
Is there a way i can generate the correct output without changing the quotes in all the places ? I saw some similar answers @ Isn't there any other way of doing double quotes in LaTeX besides `` + ''? but none seemed to work.
xetex pdftex tex-core texstudio
add a comment |
I am writing a tex document using book document class. I have already typed close to 100 pages, but i did a mistake with typing single and double quotes.
I have done it as follows :"test double quotes"
and 'test double quotes'
which generated the output of the form :
Is there a way i can generate the correct output without changing the quotes in all the places ? I saw some similar answers @ Isn't there any other way of doing double quotes in LaTeX besides `` + ''? but none seemed to work.
xetex pdftex tex-core texstudio
Are you willing and able to use LuaLaTeX to compile your document?
– Mico
7 hours ago
1
I wouldn't try to have macros or Lua fixing this on the fly: simply change the " in your editor.
– David Carlisle
7 hours ago
add a comment |
I am writing a tex document using book document class. I have already typed close to 100 pages, but i did a mistake with typing single and double quotes.
I have done it as follows :"test double quotes"
and 'test double quotes'
which generated the output of the form :
Is there a way i can generate the correct output without changing the quotes in all the places ? I saw some similar answers @ Isn't there any other way of doing double quotes in LaTeX besides `` + ''? but none seemed to work.
xetex pdftex tex-core texstudio
I am writing a tex document using book document class. I have already typed close to 100 pages, but i did a mistake with typing single and double quotes.
I have done it as follows :"test double quotes"
and 'test double quotes'
which generated the output of the form :
Is there a way i can generate the correct output without changing the quotes in all the places ? I saw some similar answers @ Isn't there any other way of doing double quotes in LaTeX besides `` + ''? but none seemed to work.
xetex pdftex tex-core texstudio
xetex pdftex tex-core texstudio
asked 8 hours ago
mezdamezda
1464 bronze badges
1464 bronze badges
Are you willing and able to use LuaLaTeX to compile your document?
– Mico
7 hours ago
1
I wouldn't try to have macros or Lua fixing this on the fly: simply change the " in your editor.
– David Carlisle
7 hours ago
add a comment |
Are you willing and able to use LuaLaTeX to compile your document?
– Mico
7 hours ago
1
I wouldn't try to have macros or Lua fixing this on the fly: simply change the " in your editor.
– David Carlisle
7 hours ago
Are you willing and able to use LuaLaTeX to compile your document?
– Mico
7 hours ago
Are you willing and able to use LuaLaTeX to compile your document?
– Mico
7 hours ago
1
1
I wouldn't try to have macros or Lua fixing this on the fly: simply change the " in your editor.
– David Carlisle
7 hours ago
I wouldn't try to have macros or Lua fixing this on the fly: simply change the " in your editor.
– David Carlisle
7 hours ago
add a comment |
2 Answers
2
active
oldest
votes
Replace at first the last quote with the editor and "Search and Replace"
"<space> -> }
Then repcae the first quote with
" -> enquote
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f499953%2fhow-to-generate-correct-single-and-double-quotes-in-tex%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Replace at first the last quote with the editor and "Search and Replace"
"<space> ->
Then repcae the first quote with
" -> enquote
and then use always:
documentclassarticle
usepackage[french,ngerman,english]babel
usepackage[autostyle]csquotes
begindocument
enquotequote
enquote*quote
enquotequote enquotequote in quote
foreignquotengermanquote
foreignquote*ngermanquote
foreignquotengermanquote foreignquotengermanquote in quote
foreignquotefrenchquote
foreignquote*frenchquote
foreignquotefrenchquote foreignquotengermanquote in quote
enddocument
edited 7 hours ago
answered 8 hours ago
Red-CloudRed-Cloud
4,7042 silver badges17 bronze badges
4,7042 silver badges17 bronze badges
2
The OP asked whether "there [is] a way i can generate the correct output without changing the quotes in all the places?"
– Mico
7 hours ago
add a comment |
2
The OP asked whether "there [is] a way i can generate the correct output without changing the quotes in all the places?"
– Mico
7 hours ago
2
2
The OP asked whether "there [is] a way i can generate the correct output without changing the quotes in all the places?"
– Mico
7 hours ago
The OP asked whether "there [is] a way i can generate the correct output without changing the quotes in all the places?"
– Mico
7 hours ago
add a comment |
Here's a LuaLaTeX-based solution, which doesn't require you to modify the existing "..."
and '...'
pairs of quotes. It consists of a Lua function called msq
(short for 'make smart quotes') and two utility LaTeX macros which switch the Lua function on and off.
documentclassbook
usepackage[english]babel % or some other suitable language choice
usepackage[autostyle]csquotes
usepackageluacode
beginluacode
-- msq: "make smart quotes"
function msq ( s )
s = s:gsub ( '"(.-)"' , "\enquote%1" )
s = s:gsub ( "'(.-)'" , "`%1'" )
return s
end
endluacode
newcommandmsqOndirectlua luatexbase.add_to_callback(
"process_input_buffer", msq , "msq" )
newcommandmsqOffdirectlua luatexbase.remove_from_callback(
"process_input_buffer", "msq" )
begindocument
msqOn
"test double quotes" and 'test single quotes'
msqOff
"test double quotes" and 'test single quotes'
enddocument
What happens when you're quoting " 'Twas brillig and the slithy toves ..."?
– barbara beeton
1 hour ago
add a comment |
Here's a LuaLaTeX-based solution, which doesn't require you to modify the existing "..."
and '...'
pairs of quotes. It consists of a Lua function called msq
(short for 'make smart quotes') and two utility LaTeX macros which switch the Lua function on and off.
documentclassbook
usepackage[english]babel % or some other suitable language choice
usepackage[autostyle]csquotes
usepackageluacode
beginluacode
-- msq: "make smart quotes"
function msq ( s )
s = s:gsub ( '"(.-)"' , "\enquote%1" )
s = s:gsub ( "'(.-)'" , "`%1'" )
return s
end
endluacode
newcommandmsqOndirectlua luatexbase.add_to_callback(
"process_input_buffer", msq , "msq" )
newcommandmsqOffdirectlua luatexbase.remove_from_callback(
"process_input_buffer", "msq" )
begindocument
msqOn
"test double quotes" and 'test single quotes'
msqOff
"test double quotes" and 'test single quotes'
enddocument
What happens when you're quoting " 'Twas brillig and the slithy toves ..."?
– barbara beeton
1 hour ago
add a comment |
Here's a LuaLaTeX-based solution, which doesn't require you to modify the existing "..."
and '...'
pairs of quotes. It consists of a Lua function called msq
(short for 'make smart quotes') and two utility LaTeX macros which switch the Lua function on and off.
documentclassbook
usepackage[english]babel % or some other suitable language choice
usepackage[autostyle]csquotes
usepackageluacode
beginluacode
-- msq: "make smart quotes"
function msq ( s )
s = s:gsub ( '"(.-)"' , "\enquote%1" )
s = s:gsub ( "'(.-)'" , "`%1'" )
return s
end
endluacode
newcommandmsqOndirectlua luatexbase.add_to_callback(
"process_input_buffer", msq , "msq" )
newcommandmsqOffdirectlua luatexbase.remove_from_callback(
"process_input_buffer", "msq" )
begindocument
msqOn
"test double quotes" and 'test single quotes'
msqOff
"test double quotes" and 'test single quotes'
enddocument
Here's a LuaLaTeX-based solution, which doesn't require you to modify the existing "..."
and '...'
pairs of quotes. It consists of a Lua function called msq
(short for 'make smart quotes') and two utility LaTeX macros which switch the Lua function on and off.
documentclassbook
usepackage[english]babel % or some other suitable language choice
usepackage[autostyle]csquotes
usepackageluacode
beginluacode
-- msq: "make smart quotes"
function msq ( s )
s = s:gsub ( '"(.-)"' , "\enquote%1" )
s = s:gsub ( "'(.-)'" , "`%1'" )
return s
end
endluacode
newcommandmsqOndirectlua luatexbase.add_to_callback(
"process_input_buffer", msq , "msq" )
newcommandmsqOffdirectlua luatexbase.remove_from_callback(
"process_input_buffer", "msq" )
begindocument
msqOn
"test double quotes" and 'test single quotes'
msqOff
"test double quotes" and 'test single quotes'
enddocument
answered 7 hours ago
MicoMico
297k32 gold badges410 silver badges809 bronze badges
297k32 gold badges410 silver badges809 bronze badges
What happens when you're quoting " 'Twas brillig and the slithy toves ..."?
– barbara beeton
1 hour ago
add a comment |
What happens when you're quoting " 'Twas brillig and the slithy toves ..."?
– barbara beeton
1 hour ago
What happens when you're quoting " 'Twas brillig and the slithy toves ..."?
– barbara beeton
1 hour ago
What happens when you're quoting " 'Twas brillig and the slithy toves ..."?
– barbara beeton
1 hour ago
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f499953%2fhow-to-generate-correct-single-and-double-quotes-in-tex%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you willing and able to use LuaLaTeX to compile your document?
– Mico
7 hours ago
1
I wouldn't try to have macros or Lua fixing this on the fly: simply change the " in your editor.
– David Carlisle
7 hours ago