how to generate correct single and double quotes in texIsn't there any other way of doing double quotes in...

GPIO and Python - GPIO.output() not working

What are some symbols representing peasants/oppressed persons fighting back?

How do I define this subset using mathematical notation?

Doing research in academia and not liking competition

Why is the collector feedback bias popular in electret-mic preamp circuits?

What's the phrasal verb for carbonated drinks exploding out of the can after being shaken?

How would you write do the dialogues of two characters talking in a chat room?

Published paper containing well-known results

Is this a Lost Mine of Phandelver Plot Hole?

Why use null function instead of == []

Getting fresh water in the middle of hypersaline lake in the Bronze Age

I quit, and boss offered me 3 month "grace period" where I could still come back

Align by center of symbol

Can I capture stereo IQ signals from WebSDR?

Does optical correction give a more aesthetic look to the SBI logo?

Remove intersect line for one circle using venndiagram2sets

Possible isometry groups of open manifolds

Asking for higher salary after I increased my initial figure

Alternatives to using writing paper for writing practice

Project Euler, problem # 9, Pythagorean triplet

(algebraic topology) question about the cellular approximation theorem

Why do candidates not quit if they no longer have a realistic chance to win in the 2020 US presidents election

Is this more than a packing puzzle?

Won 50K! Now what should I do with it



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;
}







3















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 : enter image description here



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.










share|improve this question























  • 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


















3















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 : enter image description here



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.










share|improve this question























  • 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














3












3








3








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 : enter image description here



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.










share|improve this question














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 : enter image description here



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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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



















  • 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










2 Answers
2






active

oldest

votes


















3














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:



documentclass{article}
usepackage[french,ngerman,english]{babel}
usepackage[autostyle]{csquotes}

begin{document}

enquote{quote}
enquote*{quote}

enquote{quote enquote{quote in quote}}

foreignquote{ngerman}{quote}
foreignquote*{ngerman}{quote}

foreignquote{ngerman}{quote foreignquote{ngerman}{quote in quote}}

foreignquote{french}{quote}
foreignquote*{french}{quote}

foreignquote{french}{quote foreignquote{ngerman}{quote in quote}}

end{document}


enter image description here






share|improve this answer





















  • 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














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.



enter image description here



documentclass{book}
usepackage[english]{babel} % or some other suitable language choice
usepackage[autostyle]{csquotes}

usepackage{luacode}
begin{luacode}
-- msq: "make smart quotes"
function msq ( s )
s = s:gsub ( '"(.-)"' , "\enquote{%1}" )
s = s:gsub ( "'(.-)'" , "`%1'" )
return s
end
end{luacode}

newcommand{msqOn}{directlua{ luatexbase.add_to_callback(
"process_input_buffer", msq , "msq" )}}
newcommand{msqOff}{directlua{ luatexbase.remove_from_callback(
"process_input_buffer", "msq" )}}

begin{document}
msqOn
"test double quotes" and 'test single quotes'

msqOff
"test double quotes" and 'test single quotes'
end{document}





share|improve this answer
























  • What happens when you're quoting " 'Twas brillig and the slithy toves ..."?

    – barbara beeton
    1 hour ago














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
});


}
});














draft saved

draft discarded


















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









3














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:



documentclass{article}
usepackage[french,ngerman,english]{babel}
usepackage[autostyle]{csquotes}

begin{document}

enquote{quote}
enquote*{quote}

enquote{quote enquote{quote in quote}}

foreignquote{ngerman}{quote}
foreignquote*{ngerman}{quote}

foreignquote{ngerman}{quote foreignquote{ngerman}{quote in quote}}

foreignquote{french}{quote}
foreignquote*{french}{quote}

foreignquote{french}{quote foreignquote{ngerman}{quote in quote}}

end{document}


enter image description here






share|improve this answer





















  • 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
















3














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:



documentclass{article}
usepackage[french,ngerman,english]{babel}
usepackage[autostyle]{csquotes}

begin{document}

enquote{quote}
enquote*{quote}

enquote{quote enquote{quote in quote}}

foreignquote{ngerman}{quote}
foreignquote*{ngerman}{quote}

foreignquote{ngerman}{quote foreignquote{ngerman}{quote in quote}}

foreignquote{french}{quote}
foreignquote*{french}{quote}

foreignquote{french}{quote foreignquote{ngerman}{quote in quote}}

end{document}


enter image description here






share|improve this answer





















  • 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














3












3








3







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:



documentclass{article}
usepackage[french,ngerman,english]{babel}
usepackage[autostyle]{csquotes}

begin{document}

enquote{quote}
enquote*{quote}

enquote{quote enquote{quote in quote}}

foreignquote{ngerman}{quote}
foreignquote*{ngerman}{quote}

foreignquote{ngerman}{quote foreignquote{ngerman}{quote in quote}}

foreignquote{french}{quote}
foreignquote*{french}{quote}

foreignquote{french}{quote foreignquote{ngerman}{quote in quote}}

end{document}


enter image description here






share|improve this answer















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:



documentclass{article}
usepackage[french,ngerman,english]{babel}
usepackage[autostyle]{csquotes}

begin{document}

enquote{quote}
enquote*{quote}

enquote{quote enquote{quote in quote}}

foreignquote{ngerman}{quote}
foreignquote*{ngerman}{quote}

foreignquote{ngerman}{quote foreignquote{ngerman}{quote in quote}}

foreignquote{french}{quote}
foreignquote*{french}{quote}

foreignquote{french}{quote foreignquote{ngerman}{quote in quote}}

end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








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














  • 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













2














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.



enter image description here



documentclass{book}
usepackage[english]{babel} % or some other suitable language choice
usepackage[autostyle]{csquotes}

usepackage{luacode}
begin{luacode}
-- msq: "make smart quotes"
function msq ( s )
s = s:gsub ( '"(.-)"' , "\enquote{%1}" )
s = s:gsub ( "'(.-)'" , "`%1'" )
return s
end
end{luacode}

newcommand{msqOn}{directlua{ luatexbase.add_to_callback(
"process_input_buffer", msq , "msq" )}}
newcommand{msqOff}{directlua{ luatexbase.remove_from_callback(
"process_input_buffer", "msq" )}}

begin{document}
msqOn
"test double quotes" and 'test single quotes'

msqOff
"test double quotes" and 'test single quotes'
end{document}





share|improve this answer
























  • What happens when you're quoting " 'Twas brillig and the slithy toves ..."?

    – barbara beeton
    1 hour ago
















2














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.



enter image description here



documentclass{book}
usepackage[english]{babel} % or some other suitable language choice
usepackage[autostyle]{csquotes}

usepackage{luacode}
begin{luacode}
-- msq: "make smart quotes"
function msq ( s )
s = s:gsub ( '"(.-)"' , "\enquote{%1}" )
s = s:gsub ( "'(.-)'" , "`%1'" )
return s
end
end{luacode}

newcommand{msqOn}{directlua{ luatexbase.add_to_callback(
"process_input_buffer", msq , "msq" )}}
newcommand{msqOff}{directlua{ luatexbase.remove_from_callback(
"process_input_buffer", "msq" )}}

begin{document}
msqOn
"test double quotes" and 'test single quotes'

msqOff
"test double quotes" and 'test single quotes'
end{document}





share|improve this answer
























  • What happens when you're quoting " 'Twas brillig and the slithy toves ..."?

    – barbara beeton
    1 hour ago














2












2








2







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.



enter image description here



documentclass{book}
usepackage[english]{babel} % or some other suitable language choice
usepackage[autostyle]{csquotes}

usepackage{luacode}
begin{luacode}
-- msq: "make smart quotes"
function msq ( s )
s = s:gsub ( '"(.-)"' , "\enquote{%1}" )
s = s:gsub ( "'(.-)'" , "`%1'" )
return s
end
end{luacode}

newcommand{msqOn}{directlua{ luatexbase.add_to_callback(
"process_input_buffer", msq , "msq" )}}
newcommand{msqOff}{directlua{ luatexbase.remove_from_callback(
"process_input_buffer", "msq" )}}

begin{document}
msqOn
"test double quotes" and 'test single quotes'

msqOff
"test double quotes" and 'test single quotes'
end{document}





share|improve this answer













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.



enter image description here



documentclass{book}
usepackage[english]{babel} % or some other suitable language choice
usepackage[autostyle]{csquotes}

usepackage{luacode}
begin{luacode}
-- msq: "make smart quotes"
function msq ( s )
s = s:gsub ( '"(.-)"' , "\enquote{%1}" )
s = s:gsub ( "'(.-)'" , "`%1'" )
return s
end
end{luacode}

newcommand{msqOn}{directlua{ luatexbase.add_to_callback(
"process_input_buffer", msq , "msq" )}}
newcommand{msqOff}{directlua{ luatexbase.remove_from_callback(
"process_input_buffer", "msq" )}}

begin{document}
msqOn
"test double quotes" and 'test single quotes'

msqOff
"test double quotes" and 'test single quotes'
end{document}






share|improve this answer












share|improve this answer



share|improve this answer










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



















  • 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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m