Removing label from a stringAutomatic theorem listUsing variables in constructing new labelssticky labels with image and textHow should I read the current TikZ “label distance”?x tick label style issue, anchor=east and text width command not working togetherCan I use cleveref and endnotes together?Retrieve link caption of hidden labelincludepdf addtolist label not workingUnresolved references label within caption for STATA tablesHow do I insert text in the main body conditional on whether or not a label is definedIs there any way to define the enumerate label in general?

C++ lambda syntax

How do I lift the insulation blower into the attic?

categorizing a variable turns it from insignificant to significant

Recursively move files within sub directories

Reasons for having MCU pin-states default to pull-up/down out of reset

I keep switching characters, how do I stop?

How would a solely written language work mechanically

Mac Mini (2018) 10Gb Port Compatibility

What should be the ideal length of sentences in a blog post for ease of reading?

Make a Bowl of Alphabet Soup

Would a primitive species be able to learn English from reading books alone?

Do I have to take mana from my deck or hand when tapping this card?

Error in master's thesis, I do not know what to do

PTIJ: Which Dr. Seuss books should one obtain?

Highest stage count that are used one right after the other?

Is this saw blade faulty?

Showing mass murder in a kid's book

How to get directions in deep space?

Why does the frost depth increase when the surface temperature warms up?

Checking @@ROWCOUNT failing

Trouble reading roman numeral notation with flats

How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?

Mortal danger in mid-grade literature

How to preserve electronics (computers, ipads, phones) for hundreds of years?



Removing label from a string


Automatic theorem listUsing variables in constructing new labelssticky labels with image and textHow should I read the current TikZ “label distance”?x tick label style issue, anchor=east and text width command not working togetherCan I use cleveref and endnotes together?Retrieve link caption of hidden labelincludepdf addtolist label not workingUnresolved references label within caption for STATA tablesHow do I insert text in the main body conditional on whether or not a label is definedIs there any way to define the enumerate label in general?













2















Is there a way to create a command that removes, if present, a label from some text. It should work like this:



documentclassarticle
newcommandremovelabel[1] % some code
begindocument
removelabellabelsome_label This label should be removed % output: 'This label should be removed'
removelabelThis string is already label-less % output: 'This string is already label-less
enddocument









share|improve this question














bumped to the homepage by Community 10 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • May I ask why you need such a command? What should a leading label do?

    – Kurt
    Feb 17 at 2:06











  • see this for the full story. I'm trying to fix the bug shown in the code posted after 'EDIT: MWE showing the problem'. I'd call such a function on line 52, with BODY as its argument.

    – noibe
    Feb 17 at 2:45












  • is a lualatex solution acceptable?

    – JPi
    Feb 17 at 3:27











  • @JPi not really

    – noibe
    Feb 17 at 11:00











  • Then I can't tell you. 😣

    – JPi
    Feb 17 at 12:24















2















Is there a way to create a command that removes, if present, a label from some text. It should work like this:



documentclassarticle
newcommandremovelabel[1] % some code
begindocument
removelabellabelsome_label This label should be removed % output: 'This label should be removed'
removelabelThis string is already label-less % output: 'This string is already label-less
enddocument









share|improve this question














bumped to the homepage by Community 10 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • May I ask why you need such a command? What should a leading label do?

    – Kurt
    Feb 17 at 2:06











  • see this for the full story. I'm trying to fix the bug shown in the code posted after 'EDIT: MWE showing the problem'. I'd call such a function on line 52, with BODY as its argument.

    – noibe
    Feb 17 at 2:45












  • is a lualatex solution acceptable?

    – JPi
    Feb 17 at 3:27











  • @JPi not really

    – noibe
    Feb 17 at 11:00











  • Then I can't tell you. 😣

    – JPi
    Feb 17 at 12:24













2












2








2


0






Is there a way to create a command that removes, if present, a label from some text. It should work like this:



documentclassarticle
newcommandremovelabel[1] % some code
begindocument
removelabellabelsome_label This label should be removed % output: 'This label should be removed'
removelabelThis string is already label-less % output: 'This string is already label-less
enddocument









share|improve this question














Is there a way to create a command that removes, if present, a label from some text. It should work like this:



documentclassarticle
newcommandremovelabel[1] % some code
begindocument
removelabellabelsome_label This label should be removed % output: 'This label should be removed'
removelabelThis string is already label-less % output: 'This string is already label-less
enddocument






labels






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 17 at 0:46









noibenoibe

512113




512113





bumped to the homepage by Community 10 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 10 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • May I ask why you need such a command? What should a leading label do?

    – Kurt
    Feb 17 at 2:06











  • see this for the full story. I'm trying to fix the bug shown in the code posted after 'EDIT: MWE showing the problem'. I'd call such a function on line 52, with BODY as its argument.

    – noibe
    Feb 17 at 2:45












  • is a lualatex solution acceptable?

    – JPi
    Feb 17 at 3:27











  • @JPi not really

    – noibe
    Feb 17 at 11:00











  • Then I can't tell you. 😣

    – JPi
    Feb 17 at 12:24

















  • May I ask why you need such a command? What should a leading label do?

    – Kurt
    Feb 17 at 2:06











  • see this for the full story. I'm trying to fix the bug shown in the code posted after 'EDIT: MWE showing the problem'. I'd call such a function on line 52, with BODY as its argument.

    – noibe
    Feb 17 at 2:45












  • is a lualatex solution acceptable?

    – JPi
    Feb 17 at 3:27











  • @JPi not really

    – noibe
    Feb 17 at 11:00











  • Then I can't tell you. 😣

    – JPi
    Feb 17 at 12:24
















May I ask why you need such a command? What should a leading label do?

– Kurt
Feb 17 at 2:06





May I ask why you need such a command? What should a leading label do?

– Kurt
Feb 17 at 2:06













see this for the full story. I'm trying to fix the bug shown in the code posted after 'EDIT: MWE showing the problem'. I'd call such a function on line 52, with BODY as its argument.

– noibe
Feb 17 at 2:45






see this for the full story. I'm trying to fix the bug shown in the code posted after 'EDIT: MWE showing the problem'. I'd call such a function on line 52, with BODY as its argument.

– noibe
Feb 17 at 2:45














is a lualatex solution acceptable?

– JPi
Feb 17 at 3:27





is a lualatex solution acceptable?

– JPi
Feb 17 at 3:27













@JPi not really

– noibe
Feb 17 at 11:00





@JPi not really

– noibe
Feb 17 at 11:00













Then I can't tell you. 😣

– JPi
Feb 17 at 12:24





Then I can't tell you. 😣

– JPi
Feb 17 at 12:24










1 Answer
1






active

oldest

votes


















0














This is something I suppose could work for you:



documentclassarticle
usepackagecaption
usepackagehyperref
defmyEmptyLabel#1
newcommandremovelabel[1]letoldlabellabelletlabelmyEmptyLabel#1letlabeloldlabel % some code
begindocument
beginminipagetextwidth
removelabelcaptionoffigurelabelsome_label This label should be removed % output: 'This label should be removed'
endminipage
removelabelThis string is already label-less % output: 'This string is already label-less

Figure~refsome_label
enddocument


In the output the label is not defined and returns questionmarks



Edit:



documentclassarticle
usepackagecaption
usepackagehyperref
defmyEmptyLabel#1
newcommandremovelabel[1]letoldlabellabelletlabelmyEmptyLabelxdefremovedlabel#1letlabeloldlabel % some code
begindocument

removelabellabelsome_label This label should be removed
removedlabel

removelabelThis string is already label-less % output: 'This string is already label-less

removedlabel


%Figure~refsome_label
enddocument


Now removedlabel gives the string without the label... But I am not sure what you want to do... May be you should be more clear on what you expect from the command.






share|improve this answer

























  • This code isn't actually removing the label, it just briefly changes the behaviour of the label command to null. If I were to print the argument of removelabel as if it was a string, I'd still see labelsome_label.

    – noibe
    Feb 17 at 22:53











  • if you expand the argument of removelabel... it will not be there... If you want an argument of a command to be something and without even expanding it to disappear ane part of it... I am afraid it can't be done...

    – koleygr
    Feb 18 at 0:37






  • 1





    I suggest defmyEmptyLabel#1@bsphack@esphack .

    – Ulrich Diez
    Feb 18 at 21:55











  • @UlrichDiez.... you may write an answer because I don't really know what is these commands...

    – koleygr
    Feb 19 at 10:56






  • 1





    @koleygr label shall not deliver visible things into the output-file/pdf-file. @bsphack/@esphack ensures that a space-token behind the argument of a label-command does not produce undesired visible whitespace in case there already was a space before the label-command... Many of these commands are explained in source2e.pdf

    – Ulrich Diez
    Feb 19 at 13:44











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%2f475268%2fremoving-label-from-a-string%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









0














This is something I suppose could work for you:



documentclassarticle
usepackagecaption
usepackagehyperref
defmyEmptyLabel#1
newcommandremovelabel[1]letoldlabellabelletlabelmyEmptyLabel#1letlabeloldlabel % some code
begindocument
beginminipagetextwidth
removelabelcaptionoffigurelabelsome_label This label should be removed % output: 'This label should be removed'
endminipage
removelabelThis string is already label-less % output: 'This string is already label-less

Figure~refsome_label
enddocument


In the output the label is not defined and returns questionmarks



Edit:



documentclassarticle
usepackagecaption
usepackagehyperref
defmyEmptyLabel#1
newcommandremovelabel[1]letoldlabellabelletlabelmyEmptyLabelxdefremovedlabel#1letlabeloldlabel % some code
begindocument

removelabellabelsome_label This label should be removed
removedlabel

removelabelThis string is already label-less % output: 'This string is already label-less

removedlabel


%Figure~refsome_label
enddocument


Now removedlabel gives the string without the label... But I am not sure what you want to do... May be you should be more clear on what you expect from the command.






share|improve this answer

























  • This code isn't actually removing the label, it just briefly changes the behaviour of the label command to null. If I were to print the argument of removelabel as if it was a string, I'd still see labelsome_label.

    – noibe
    Feb 17 at 22:53











  • if you expand the argument of removelabel... it will not be there... If you want an argument of a command to be something and without even expanding it to disappear ane part of it... I am afraid it can't be done...

    – koleygr
    Feb 18 at 0:37






  • 1





    I suggest defmyEmptyLabel#1@bsphack@esphack .

    – Ulrich Diez
    Feb 18 at 21:55











  • @UlrichDiez.... you may write an answer because I don't really know what is these commands...

    – koleygr
    Feb 19 at 10:56






  • 1





    @koleygr label shall not deliver visible things into the output-file/pdf-file. @bsphack/@esphack ensures that a space-token behind the argument of a label-command does not produce undesired visible whitespace in case there already was a space before the label-command... Many of these commands are explained in source2e.pdf

    – Ulrich Diez
    Feb 19 at 13:44
















0














This is something I suppose could work for you:



documentclassarticle
usepackagecaption
usepackagehyperref
defmyEmptyLabel#1
newcommandremovelabel[1]letoldlabellabelletlabelmyEmptyLabel#1letlabeloldlabel % some code
begindocument
beginminipagetextwidth
removelabelcaptionoffigurelabelsome_label This label should be removed % output: 'This label should be removed'
endminipage
removelabelThis string is already label-less % output: 'This string is already label-less

Figure~refsome_label
enddocument


In the output the label is not defined and returns questionmarks



Edit:



documentclassarticle
usepackagecaption
usepackagehyperref
defmyEmptyLabel#1
newcommandremovelabel[1]letoldlabellabelletlabelmyEmptyLabelxdefremovedlabel#1letlabeloldlabel % some code
begindocument

removelabellabelsome_label This label should be removed
removedlabel

removelabelThis string is already label-less % output: 'This string is already label-less

removedlabel


%Figure~refsome_label
enddocument


Now removedlabel gives the string without the label... But I am not sure what you want to do... May be you should be more clear on what you expect from the command.






share|improve this answer

























  • This code isn't actually removing the label, it just briefly changes the behaviour of the label command to null. If I were to print the argument of removelabel as if it was a string, I'd still see labelsome_label.

    – noibe
    Feb 17 at 22:53











  • if you expand the argument of removelabel... it will not be there... If you want an argument of a command to be something and without even expanding it to disappear ane part of it... I am afraid it can't be done...

    – koleygr
    Feb 18 at 0:37






  • 1





    I suggest defmyEmptyLabel#1@bsphack@esphack .

    – Ulrich Diez
    Feb 18 at 21:55











  • @UlrichDiez.... you may write an answer because I don't really know what is these commands...

    – koleygr
    Feb 19 at 10:56






  • 1





    @koleygr label shall not deliver visible things into the output-file/pdf-file. @bsphack/@esphack ensures that a space-token behind the argument of a label-command does not produce undesired visible whitespace in case there already was a space before the label-command... Many of these commands are explained in source2e.pdf

    – Ulrich Diez
    Feb 19 at 13:44














0












0








0







This is something I suppose could work for you:



documentclassarticle
usepackagecaption
usepackagehyperref
defmyEmptyLabel#1
newcommandremovelabel[1]letoldlabellabelletlabelmyEmptyLabel#1letlabeloldlabel % some code
begindocument
beginminipagetextwidth
removelabelcaptionoffigurelabelsome_label This label should be removed % output: 'This label should be removed'
endminipage
removelabelThis string is already label-less % output: 'This string is already label-less

Figure~refsome_label
enddocument


In the output the label is not defined and returns questionmarks



Edit:



documentclassarticle
usepackagecaption
usepackagehyperref
defmyEmptyLabel#1
newcommandremovelabel[1]letoldlabellabelletlabelmyEmptyLabelxdefremovedlabel#1letlabeloldlabel % some code
begindocument

removelabellabelsome_label This label should be removed
removedlabel

removelabelThis string is already label-less % output: 'This string is already label-less

removedlabel


%Figure~refsome_label
enddocument


Now removedlabel gives the string without the label... But I am not sure what you want to do... May be you should be more clear on what you expect from the command.






share|improve this answer















This is something I suppose could work for you:



documentclassarticle
usepackagecaption
usepackagehyperref
defmyEmptyLabel#1
newcommandremovelabel[1]letoldlabellabelletlabelmyEmptyLabel#1letlabeloldlabel % some code
begindocument
beginminipagetextwidth
removelabelcaptionoffigurelabelsome_label This label should be removed % output: 'This label should be removed'
endminipage
removelabelThis string is already label-less % output: 'This string is already label-less

Figure~refsome_label
enddocument


In the output the label is not defined and returns questionmarks



Edit:



documentclassarticle
usepackagecaption
usepackagehyperref
defmyEmptyLabel#1
newcommandremovelabel[1]letoldlabellabelletlabelmyEmptyLabelxdefremovedlabel#1letlabeloldlabel % some code
begindocument

removelabellabelsome_label This label should be removed
removedlabel

removelabelThis string is already label-less % output: 'This string is already label-less

removedlabel


%Figure~refsome_label
enddocument


Now removedlabel gives the string without the label... But I am not sure what you want to do... May be you should be more clear on what you expect from the command.







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 18 at 0:46

























answered Feb 17 at 15:34









koleygrkoleygr

13k11038




13k11038












  • This code isn't actually removing the label, it just briefly changes the behaviour of the label command to null. If I were to print the argument of removelabel as if it was a string, I'd still see labelsome_label.

    – noibe
    Feb 17 at 22:53











  • if you expand the argument of removelabel... it will not be there... If you want an argument of a command to be something and without even expanding it to disappear ane part of it... I am afraid it can't be done...

    – koleygr
    Feb 18 at 0:37






  • 1





    I suggest defmyEmptyLabel#1@bsphack@esphack .

    – Ulrich Diez
    Feb 18 at 21:55











  • @UlrichDiez.... you may write an answer because I don't really know what is these commands...

    – koleygr
    Feb 19 at 10:56






  • 1





    @koleygr label shall not deliver visible things into the output-file/pdf-file. @bsphack/@esphack ensures that a space-token behind the argument of a label-command does not produce undesired visible whitespace in case there already was a space before the label-command... Many of these commands are explained in source2e.pdf

    – Ulrich Diez
    Feb 19 at 13:44


















  • This code isn't actually removing the label, it just briefly changes the behaviour of the label command to null. If I were to print the argument of removelabel as if it was a string, I'd still see labelsome_label.

    – noibe
    Feb 17 at 22:53











  • if you expand the argument of removelabel... it will not be there... If you want an argument of a command to be something and without even expanding it to disappear ane part of it... I am afraid it can't be done...

    – koleygr
    Feb 18 at 0:37






  • 1





    I suggest defmyEmptyLabel#1@bsphack@esphack .

    – Ulrich Diez
    Feb 18 at 21:55











  • @UlrichDiez.... you may write an answer because I don't really know what is these commands...

    – koleygr
    Feb 19 at 10:56






  • 1





    @koleygr label shall not deliver visible things into the output-file/pdf-file. @bsphack/@esphack ensures that a space-token behind the argument of a label-command does not produce undesired visible whitespace in case there already was a space before the label-command... Many of these commands are explained in source2e.pdf

    – Ulrich Diez
    Feb 19 at 13:44

















This code isn't actually removing the label, it just briefly changes the behaviour of the label command to null. If I were to print the argument of removelabel as if it was a string, I'd still see labelsome_label.

– noibe
Feb 17 at 22:53





This code isn't actually removing the label, it just briefly changes the behaviour of the label command to null. If I were to print the argument of removelabel as if it was a string, I'd still see labelsome_label.

– noibe
Feb 17 at 22:53













if you expand the argument of removelabel... it will not be there... If you want an argument of a command to be something and without even expanding it to disappear ane part of it... I am afraid it can't be done...

– koleygr
Feb 18 at 0:37





if you expand the argument of removelabel... it will not be there... If you want an argument of a command to be something and without even expanding it to disappear ane part of it... I am afraid it can't be done...

– koleygr
Feb 18 at 0:37




1




1





I suggest defmyEmptyLabel#1@bsphack@esphack .

– Ulrich Diez
Feb 18 at 21:55





I suggest defmyEmptyLabel#1@bsphack@esphack .

– Ulrich Diez
Feb 18 at 21:55













@UlrichDiez.... you may write an answer because I don't really know what is these commands...

– koleygr
Feb 19 at 10:56





@UlrichDiez.... you may write an answer because I don't really know what is these commands...

– koleygr
Feb 19 at 10:56




1




1





@koleygr label shall not deliver visible things into the output-file/pdf-file. @bsphack/@esphack ensures that a space-token behind the argument of a label-command does not produce undesired visible whitespace in case there already was a space before the label-command... Many of these commands are explained in source2e.pdf

– Ulrich Diez
Feb 19 at 13:44






@koleygr label shall not deliver visible things into the output-file/pdf-file. @bsphack/@esphack ensures that a space-token behind the argument of a label-command does not produce undesired visible whitespace in case there already was a space before the label-command... Many of these commands are explained in source2e.pdf

– Ulrich Diez
Feb 19 at 13:44


















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%2f475268%2fremoving-label-from-a-string%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

Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm