330 reputation
1216
bio website tex.stackexchange.com/users/…
location United Kingdom
age 25
visits member for 2 years, 9 months
seen Jul 22 '13 at 8:36

Don't panic.


Jul
2
awarded  Famous Question
Nov
23
awarded  Popular Question
Sep
15
awarded  Popular Question
Feb
18
awarded  Yearling
Feb
12
awarded  Notable Question
Sep
6
awarded  Popular Question
Aug
19
awarded  Nice Question
Mar
27
awarded  Nice Question
Mar
26
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
@StephanLehmke: Ah ok, I shall define an intermediary command as you suggest and I have now accepted egreg's answer - cheers for all your help :)
Mar
26
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
Accepted egreg's answer as per Stephan's suggestion.
Mar
26
accepted How to use nameref to refer to a section without including the output of any commands in the title of that section?
Mar
26
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
@egreg: In regards to the warning (Token not allowed in a PDF string), I tried adding \addnamedisablecommand{\todo} after \addnamedisablecommand{\todo[2][]} This did prevent the warning but a \nameref to the label in the following \section[{\todo[linecolor=blue]{A todonote about the bar section}}bar]{bar}\label{sec:bar} came out as [linecolor=blue]A todonote about the bar sectionbar I think I understand why this is happening, the second disable \addnamedisablecommand{\todo} appears to override the first, but can the warning be prevented without messing up the reference?
Mar
25
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
@egreg: Although I'm not sure if this might be slightly against the consensus on accepting solutions (somewhat relevant - meta.tex.stackexchange.com/q/535/11869) I strongly agree that Stephan deserves a lot of credit. If you're saying that this is cool then I shall leave it as it (now) is, otherwise I shall accept your answer so that it will be the first a new user/visitor sees.
Mar
25
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
Gotcha, cheers Stephan :)
Mar
25
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
Just saw egreg's comment on the question, so leaving Stephan's answer as the accepted one. (@StephanLehmke)
Mar
25
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
@egreg: Do you get that error when compiling Stephan's example code as it is (i.e. without modification)?
Mar
25
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
Sweet, that's brilliant! I owe you a beer(/beverage of choice) ^^
Mar
25
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
At the risk of more absurdity, is there any way to deal with optional arguments? Currently changing the \todo call to be \todo[linecolor=blue]{A todonote about the bar section} results in the reference text being produced as linecolor=blue]A todonote about the bar sectionbar
Mar
25
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
Crikey, all singing all dancing :P I was just about to ask how to deal with arguments and this is now very much in line with a generalised approach that I was asking about in the question :D Well done sir!
Mar
25
comment How to use nameref to refer to a section without including the output of any commands in the title of that section?
Ah, understood - cheers again!