How I can remove formatting from text and convert it to URL?












2














I need to remove any type of formatting from a text to get an URL multi-formatting.

By keeping the following model, I have tried various solutions but without having the desired result.

Would anyone know how to find a solution?



newcommand{link}[1]{
%
% ?
%
href{#1_WITHOUT_FORMATTING_AND_COMMANDS}{#1_WITH_FORMATTING}
}

begin{document}
link{http://www.site.com/page.php?key1=textcolor{red}{value1}&textit{key2=value2}/textbf{page2}/page3}
end{document}


Thanks.










share|improve this question







New contributor




BnG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • You should define a fixed set of formatting commands for showing a URL, in order to get better consistency across your document. Then you can apply David's suggestion with the set of formatting commands.
    – egreg
    41 mins ago
















2














I need to remove any type of formatting from a text to get an URL multi-formatting.

By keeping the following model, I have tried various solutions but without having the desired result.

Would anyone know how to find a solution?



newcommand{link}[1]{
%
% ?
%
href{#1_WITHOUT_FORMATTING_AND_COMMANDS}{#1_WITH_FORMATTING}
}

begin{document}
link{http://www.site.com/page.php?key1=textcolor{red}{value1}&textit{key2=value2}/textbf{page2}/page3}
end{document}


Thanks.










share|improve this question







New contributor




BnG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • You should define a fixed set of formatting commands for showing a URL, in order to get better consistency across your document. Then you can apply David's suggestion with the set of formatting commands.
    – egreg
    41 mins ago














2












2








2







I need to remove any type of formatting from a text to get an URL multi-formatting.

By keeping the following model, I have tried various solutions but without having the desired result.

Would anyone know how to find a solution?



newcommand{link}[1]{
%
% ?
%
href{#1_WITHOUT_FORMATTING_AND_COMMANDS}{#1_WITH_FORMATTING}
}

begin{document}
link{http://www.site.com/page.php?key1=textcolor{red}{value1}&textit{key2=value2}/textbf{page2}/page3}
end{document}


Thanks.










share|improve this question







New contributor




BnG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I need to remove any type of formatting from a text to get an URL multi-formatting.

By keeping the following model, I have tried various solutions but without having the desired result.

Would anyone know how to find a solution?



newcommand{link}[1]{
%
% ?
%
href{#1_WITHOUT_FORMATTING_AND_COMMANDS}{#1_WITH_FORMATTING}
}

begin{document}
link{http://www.site.com/page.php?key1=textcolor{red}{value1}&textit{key2=value2}/textbf{page2}/page3}
end{document}


Thanks.







formatting url






share|improve this question







New contributor




BnG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




BnG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




BnG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









BnG

111




111




New contributor




BnG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





BnG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






BnG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • You should define a fixed set of formatting commands for showing a URL, in order to get better consistency across your document. Then you can apply David's suggestion with the set of formatting commands.
    – egreg
    41 mins ago


















  • You should define a fixed set of formatting commands for showing a URL, in order to get better consistency across your document. Then you can apply David's suggestion with the set of formatting commands.
    – egreg
    41 mins ago
















You should define a fixed set of formatting commands for showing a URL, in order to get better consistency across your document. Then you can apply David's suggestion with the set of formatting commands.
– egreg
41 mins ago




You should define a fixed set of formatting commands for showing a URL, in order to get better consistency across your document. Then you can apply David's suggestion with the set of formatting commands.
– egreg
41 mins ago










1 Answer
1






active

oldest

votes


















2














enter image description here



documentclass{article}

usepackage{hyperref,color}


newcommand{link}[1]{%
{%
deftextcolor##1##2{##2}%
deftextbf##1{##1}%
deftextit##1{##1}%
edef&{string&}%
xdeftmp{noexpandhref{#1}}}%
tmp{#1}%
}
begin{document}
link{http://www.site.com/page.php?key1=textcolor{red}{value1}&textit{key2=value2}/textbf{page2}/page3}
end{document}





share|improve this answer























  • replacing link by url in your code (hence link definition can also be removed) gives very strange error with module undefined in file supp-pdf.mkii
    – jfbu
    56 mins ago












  • any idea about how undefined module pops out from using url (I did not trace it)
    – jfbu
    53 mins ago










  • @jfbu the supp-pdf file gets read with % not being a comment
    – David Carlisle
    48 mins ago










  • indeed, thanks.
    – jfbu
    46 mins ago






  • 1




    I'd prefer the first brace being begingroup and finishing with edeftmp{endgroupnoexpandhref{#1}}tmp{#1}
    – egreg
    39 mins 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
});


}
});






BnG is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468033%2fhow-i-can-remove-formatting-from-text-and-convert-it-to-url%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














enter image description here



documentclass{article}

usepackage{hyperref,color}


newcommand{link}[1]{%
{%
deftextcolor##1##2{##2}%
deftextbf##1{##1}%
deftextit##1{##1}%
edef&{string&}%
xdeftmp{noexpandhref{#1}}}%
tmp{#1}%
}
begin{document}
link{http://www.site.com/page.php?key1=textcolor{red}{value1}&textit{key2=value2}/textbf{page2}/page3}
end{document}





share|improve this answer























  • replacing link by url in your code (hence link definition can also be removed) gives very strange error with module undefined in file supp-pdf.mkii
    – jfbu
    56 mins ago












  • any idea about how undefined module pops out from using url (I did not trace it)
    – jfbu
    53 mins ago










  • @jfbu the supp-pdf file gets read with % not being a comment
    – David Carlisle
    48 mins ago










  • indeed, thanks.
    – jfbu
    46 mins ago






  • 1




    I'd prefer the first brace being begingroup and finishing with edeftmp{endgroupnoexpandhref{#1}}tmp{#1}
    – egreg
    39 mins ago


















2














enter image description here



documentclass{article}

usepackage{hyperref,color}


newcommand{link}[1]{%
{%
deftextcolor##1##2{##2}%
deftextbf##1{##1}%
deftextit##1{##1}%
edef&{string&}%
xdeftmp{noexpandhref{#1}}}%
tmp{#1}%
}
begin{document}
link{http://www.site.com/page.php?key1=textcolor{red}{value1}&textit{key2=value2}/textbf{page2}/page3}
end{document}





share|improve this answer























  • replacing link by url in your code (hence link definition can also be removed) gives very strange error with module undefined in file supp-pdf.mkii
    – jfbu
    56 mins ago












  • any idea about how undefined module pops out from using url (I did not trace it)
    – jfbu
    53 mins ago










  • @jfbu the supp-pdf file gets read with % not being a comment
    – David Carlisle
    48 mins ago










  • indeed, thanks.
    – jfbu
    46 mins ago






  • 1




    I'd prefer the first brace being begingroup and finishing with edeftmp{endgroupnoexpandhref{#1}}tmp{#1}
    – egreg
    39 mins ago
















2












2








2






enter image description here



documentclass{article}

usepackage{hyperref,color}


newcommand{link}[1]{%
{%
deftextcolor##1##2{##2}%
deftextbf##1{##1}%
deftextit##1{##1}%
edef&{string&}%
xdeftmp{noexpandhref{#1}}}%
tmp{#1}%
}
begin{document}
link{http://www.site.com/page.php?key1=textcolor{red}{value1}&textit{key2=value2}/textbf{page2}/page3}
end{document}





share|improve this answer














enter image description here



documentclass{article}

usepackage{hyperref,color}


newcommand{link}[1]{%
{%
deftextcolor##1##2{##2}%
deftextbf##1{##1}%
deftextit##1{##1}%
edef&{string&}%
xdeftmp{noexpandhref{#1}}}%
tmp{#1}%
}
begin{document}
link{http://www.site.com/page.php?key1=textcolor{red}{value1}&textit{key2=value2}/textbf{page2}/page3}
end{document}






share|improve this answer














share|improve this answer



share|improve this answer








edited 54 mins ago

























answered 1 hour ago









David Carlisle

482k3811141852




482k3811141852












  • replacing link by url in your code (hence link definition can also be removed) gives very strange error with module undefined in file supp-pdf.mkii
    – jfbu
    56 mins ago












  • any idea about how undefined module pops out from using url (I did not trace it)
    – jfbu
    53 mins ago










  • @jfbu the supp-pdf file gets read with % not being a comment
    – David Carlisle
    48 mins ago










  • indeed, thanks.
    – jfbu
    46 mins ago






  • 1




    I'd prefer the first brace being begingroup and finishing with edeftmp{endgroupnoexpandhref{#1}}tmp{#1}
    – egreg
    39 mins ago




















  • replacing link by url in your code (hence link definition can also be removed) gives very strange error with module undefined in file supp-pdf.mkii
    – jfbu
    56 mins ago












  • any idea about how undefined module pops out from using url (I did not trace it)
    – jfbu
    53 mins ago










  • @jfbu the supp-pdf file gets read with % not being a comment
    – David Carlisle
    48 mins ago










  • indeed, thanks.
    – jfbu
    46 mins ago






  • 1




    I'd prefer the first brace being begingroup and finishing with edeftmp{endgroupnoexpandhref{#1}}tmp{#1}
    – egreg
    39 mins ago


















replacing link by url in your code (hence link definition can also be removed) gives very strange error with module undefined in file supp-pdf.mkii
– jfbu
56 mins ago






replacing link by url in your code (hence link definition can also be removed) gives very strange error with module undefined in file supp-pdf.mkii
– jfbu
56 mins ago














any idea about how undefined module pops out from using url (I did not trace it)
– jfbu
53 mins ago




any idea about how undefined module pops out from using url (I did not trace it)
– jfbu
53 mins ago












@jfbu the supp-pdf file gets read with % not being a comment
– David Carlisle
48 mins ago




@jfbu the supp-pdf file gets read with % not being a comment
– David Carlisle
48 mins ago












indeed, thanks.
– jfbu
46 mins ago




indeed, thanks.
– jfbu
46 mins ago




1




1




I'd prefer the first brace being begingroup and finishing with edeftmp{endgroupnoexpandhref{#1}}tmp{#1}
– egreg
39 mins ago






I'd prefer the first brace being begingroup and finishing with edeftmp{endgroupnoexpandhref{#1}}tmp{#1}
– egreg
39 mins ago












BnG is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















BnG is a new contributor. Be nice, and check out our Code of Conduct.













BnG is a new contributor. Be nice, and check out our Code of Conduct.












BnG is a new contributor. Be nice, and check out our Code of Conduct.
















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f468033%2fhow-i-can-remove-formatting-from-text-and-convert-it-to-url%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

Morgemoulin

Scott Moir

Souastre