Biblatex BibliographyOption with braces? Announcing the arrival of Valued Associate #679:...
Why do C and C++ allow the expression (int) + 4?
Understanding piped command in Gnu/Linux
Noise in Eigenvalues plot
Can two people see the same photon?
How do Java 8 default methods hеlp with lambdas?
Why are current probes so expensive?
Flight departed from the gate 5 min before scheduled departure time. Refund options
New Order #6: Easter Egg
3D Masyu - A Die
Centre cell contents vertically
Who said what about *meanings*?
When does a function NOT have an antiderivative?
As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?
When to apply negative sign when number is squared
How does the body cool itself in a stillsuit?
Pointing to problems without suggesting solutions
Problem with display of presentation
What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?
My mentor says to set image to Fine instead of RAW — how is this different from JPG?
2018 MacBook Pro won't let me install macOS High Sierra 10.13 from USB installer
Is there a spell that can create a permanent fire?
Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?
newbie Q : How to read an output file in one command line
Determine whether an integer is a palindrome
Biblatex BibliographyOption with braces?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)biblatex: different bibstyles in the same document?Biblatex: Idiom for testing contents of list fieldBiblatex with custom labelsDatamodel distribution with biblatexdouble braces for author in biblatex not working?biblatex. supress bibstring if two curly braces are usedProblem compiling with Biblatex?Some problem with biblatexProblem with biblatexMultiple sorting with biblatexBiblatex - xpatch bibmacro with unbalanced braces
For a specific biblatex style, I have declared a bibliography option which takes a name, as in
DeclareBibliographyOption{myname}{edefsomename{#1}}
Now LaTeX yields an error if the value of this option consists of braces, such as myname=M{"u}ller:
! You can't use `macro parameter character #' in horizontal mode.
@removeelement #1#2#3->def reserved@a ##1,#1,##
2reserved@a {##1,##2rese...
l.59 ProcessOptionsrelax
Is there a way to work around this? If not, is there a way to expand a macro in such a way that braces disappear? My aim is to test for string equivalence via ifdefstring, and the test returns false if M{"u}ller is compared to M"uller, as in
edefx{M{"u}ller}
edefy{M"uller}
ifdefstrequal{x}{y}{TRUE}{FALSE}
which will return FALSE.
biblatex
|
show 4 more comments
For a specific biblatex style, I have declared a bibliography option which takes a name, as in
DeclareBibliographyOption{myname}{edefsomename{#1}}
Now LaTeX yields an error if the value of this option consists of braces, such as myname=M{"u}ller:
! You can't use `macro parameter character #' in horizontal mode.
@removeelement #1#2#3->def reserved@a ##1,#1,##
2reserved@a {##1,##2rese...
l.59 ProcessOptionsrelax
Is there a way to work around this? If not, is there a way to expand a macro in such a way that braces disappear? My aim is to test for string equivalence via ifdefstring, and the test returns false if M{"u}ller is compared to M"uller, as in
edefx{M{"u}ller}
edefy{M"uller}
ifdefstrequal{x}{y}{TRUE}{FALSE}
which will return FALSE.
biblatex
PassingM{"u}llerthroughedefis impossible and it wouldn't solve the problem anyway, becauseedefdoesn't touch braces that don't delimit arguments to commands.
– egreg
Oct 29 '12 at 15:08
I'm not sure I understand. If I passM{"u}llertoedef, it expands toM{ü}ller, which is one step closer to what I want. Why is it "impossible"?
– JSpitzm
Oct 29 '12 at 15:13
No,"uexpands to the set of instructions for printing "ü", which is very different from a simple tokenü. Andedefx{"u}will always raise errors: the command"cannot go insideedef.
– egreg
Oct 29 '12 at 15:28
Hm, seemed to work good enough for my purpose (I compare twoedefed macros via etoolbox'sifdefstrequal). Now the question is: is there a way to fully expand a string for testing, including macros and nested braces?
– JSpitzm
Oct 29 '12 at 15:32
Are the braces you need to strip off just like inM{"u}lleror is there something more complicated?
– egreg
Oct 29 '12 at 15:36
|
show 4 more comments
For a specific biblatex style, I have declared a bibliography option which takes a name, as in
DeclareBibliographyOption{myname}{edefsomename{#1}}
Now LaTeX yields an error if the value of this option consists of braces, such as myname=M{"u}ller:
! You can't use `macro parameter character #' in horizontal mode.
@removeelement #1#2#3->def reserved@a ##1,#1,##
2reserved@a {##1,##2rese...
l.59 ProcessOptionsrelax
Is there a way to work around this? If not, is there a way to expand a macro in such a way that braces disappear? My aim is to test for string equivalence via ifdefstring, and the test returns false if M{"u}ller is compared to M"uller, as in
edefx{M{"u}ller}
edefy{M"uller}
ifdefstrequal{x}{y}{TRUE}{FALSE}
which will return FALSE.
biblatex
For a specific biblatex style, I have declared a bibliography option which takes a name, as in
DeclareBibliographyOption{myname}{edefsomename{#1}}
Now LaTeX yields an error if the value of this option consists of braces, such as myname=M{"u}ller:
! You can't use `macro parameter character #' in horizontal mode.
@removeelement #1#2#3->def reserved@a ##1,#1,##
2reserved@a {##1,##2rese...
l.59 ProcessOptionsrelax
Is there a way to work around this? If not, is there a way to expand a macro in such a way that braces disappear? My aim is to test for string equivalence via ifdefstring, and the test returns false if M{"u}ller is compared to M"uller, as in
edefx{M{"u}ller}
edefy{M"uller}
ifdefstrequal{x}{y}{TRUE}{FALSE}
which will return FALSE.
biblatex
biblatex
edited Oct 29 '12 at 15:54
JSpitzm
asked Oct 29 '12 at 12:31
JSpitzmJSpitzm
47026
47026
PassingM{"u}llerthroughedefis impossible and it wouldn't solve the problem anyway, becauseedefdoesn't touch braces that don't delimit arguments to commands.
– egreg
Oct 29 '12 at 15:08
I'm not sure I understand. If I passM{"u}llertoedef, it expands toM{ü}ller, which is one step closer to what I want. Why is it "impossible"?
– JSpitzm
Oct 29 '12 at 15:13
No,"uexpands to the set of instructions for printing "ü", which is very different from a simple tokenü. Andedefx{"u}will always raise errors: the command"cannot go insideedef.
– egreg
Oct 29 '12 at 15:28
Hm, seemed to work good enough for my purpose (I compare twoedefed macros via etoolbox'sifdefstrequal). Now the question is: is there a way to fully expand a string for testing, including macros and nested braces?
– JSpitzm
Oct 29 '12 at 15:32
Are the braces you need to strip off just like inM{"u}lleror is there something more complicated?
– egreg
Oct 29 '12 at 15:36
|
show 4 more comments
PassingM{"u}llerthroughedefis impossible and it wouldn't solve the problem anyway, becauseedefdoesn't touch braces that don't delimit arguments to commands.
– egreg
Oct 29 '12 at 15:08
I'm not sure I understand. If I passM{"u}llertoedef, it expands toM{ü}ller, which is one step closer to what I want. Why is it "impossible"?
– JSpitzm
Oct 29 '12 at 15:13
No,"uexpands to the set of instructions for printing "ü", which is very different from a simple tokenü. Andedefx{"u}will always raise errors: the command"cannot go insideedef.
– egreg
Oct 29 '12 at 15:28
Hm, seemed to work good enough for my purpose (I compare twoedefed macros via etoolbox'sifdefstrequal). Now the question is: is there a way to fully expand a string for testing, including macros and nested braces?
– JSpitzm
Oct 29 '12 at 15:32
Are the braces you need to strip off just like inM{"u}lleror is there something more complicated?
– egreg
Oct 29 '12 at 15:36
Passing
M{"u}ller through edef is impossible and it wouldn't solve the problem anyway, because edef doesn't touch braces that don't delimit arguments to commands.– egreg
Oct 29 '12 at 15:08
Passing
M{"u}ller through edef is impossible and it wouldn't solve the problem anyway, because edef doesn't touch braces that don't delimit arguments to commands.– egreg
Oct 29 '12 at 15:08
I'm not sure I understand. If I pass
M{"u}ller to edef, it expands to M{ü}ller, which is one step closer to what I want. Why is it "impossible"?– JSpitzm
Oct 29 '12 at 15:13
I'm not sure I understand. If I pass
M{"u}ller to edef, it expands to M{ü}ller, which is one step closer to what I want. Why is it "impossible"?– JSpitzm
Oct 29 '12 at 15:13
No,
"u expands to the set of instructions for printing "ü", which is very different from a simple token ü. And edefx{"u} will always raise errors: the command " cannot go inside edef.– egreg
Oct 29 '12 at 15:28
No,
"u expands to the set of instructions for printing "ü", which is very different from a simple token ü. And edefx{"u} will always raise errors: the command " cannot go inside edef.– egreg
Oct 29 '12 at 15:28
Hm, seemed to work good enough for my purpose (I compare two
edefed macros via etoolbox's ifdefstrequal). Now the question is: is there a way to fully expand a string for testing, including macros and nested braces?– JSpitzm
Oct 29 '12 at 15:32
Hm, seemed to work good enough for my purpose (I compare two
edefed macros via etoolbox's ifdefstrequal). Now the question is: is there a way to fully expand a string for testing, including macros and nested braces?– JSpitzm
Oct 29 '12 at 15:32
Are the braces you need to strip off just like in
M{"u}ller or is there something more complicated?– egreg
Oct 29 '12 at 15:36
Are the braces you need to strip off just like in
M{"u}ller or is there something more complicated?– egreg
Oct 29 '12 at 15:36
|
show 4 more comments
2 Answers
2
active
oldest
votes
You can't use edef in this context: edefx{..."u...} will always fail.
If you are using UTF-8 for your files and your author can appear in the three forms
M{"u}ller
M"uller
Müller
then these macros can be what you want:
documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{etoolbox}
makeatletter
defstripbraces#1#2{%
begingroup
defIeC##1{##1}%
protected@edef@tempa{#1}%
gdef@gtempa{}%
expandafter@stripbraces@tempa@nil
endgroup
let#2@gtempa
}
def@stripbraces#1{%
ifx#1@nilelse
expandaftergdefexpandafter@gtempaexpandafter{@gtempa#1}%
expandafter@stripbraces
fi
}
makeatother
begin{document}
stripbraces{M"uller}{x}
stripbraces{M{"u}ller}{y}
stripbraces{Müller}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
stripbraces{Øre}{x}
stripbraces{{O}re}{y}
stripbraces{O re}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
stripbraces{Gauß}{x}
stripbraces{Gau{ss}}{y}
stripbraces{Gauss}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
end{document}
All the tests yield "TRUE".
However this would fail for Fran{c{c}}ais and Fran{c c}ais. So the final answer depends on your needs.
Thanks, @egreg, this seems to work for my cases. For some reason, however, it does not work for values passed throughDeclareBibliographyOption, which seems to do some expansion. I.e. withDeclareBibliographyOption{myname}{defmyname{#1}}andmyname=M"ullerthe"uis expanded.
– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Trystripbraces{#1}{myname}instead ofdefmyname{#1}
– egreg
Oct 29 '12 at 17:25
this fails as well. It seems the"uis already expanded when passed as#1withinDeclareBibliographyOption.
– JSpitzm
Oct 29 '12 at 17:33
@JSpitzm Sorry, but without a real example it's impossible to say more.
– egreg
Oct 29 '12 at 17:37
Nevermind, it'll do for now without the bibliography option approach (I'll provide an alternative way to set the respective name). The real example is my biblatex-publist package on CTAN.
– JSpitzm
Oct 29 '12 at 17:46
|
show 1 more comment
Trying out unicode bib options with
newcommandtestuni{}
DeclareBibliographyOption[boolean]{test-unicode}[false]{
ifstrequal{#1}{𐎑𓀀ຢഓæçøûüŧũǻΦ}{renewcommandtestuni{𐎑𓀀ຢഓæçøûüŧũǻΦ has matched}}{renewcommandtestuni{𐎑𓀀ຢഓæçøûüŧũǻΦ has not matched}}
}
and setting the biblatex option to
test-unicode=𐎑𓀀ຢഓæçøûüŧũǻΦ,
and compiling in xelatex with the file in utf-8 format, and suitable font (usepackage{fontspec} and newfontfacefunicode{Code2003})
Result of textbackslash testuni: {funicode testuni}.
gives

Changing the bib option to
test-unicode=𐎑𓀀ຢഓæçѾѬøûüŧũǻΦ,
produces

So looks OK now.
The old-style escapes are no longer really needed.
add a comment |
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%2f79555%2fbiblatex-bibliographyoption-with-braces%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
You can't use edef in this context: edefx{..."u...} will always fail.
If you are using UTF-8 for your files and your author can appear in the three forms
M{"u}ller
M"uller
Müller
then these macros can be what you want:
documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{etoolbox}
makeatletter
defstripbraces#1#2{%
begingroup
defIeC##1{##1}%
protected@edef@tempa{#1}%
gdef@gtempa{}%
expandafter@stripbraces@tempa@nil
endgroup
let#2@gtempa
}
def@stripbraces#1{%
ifx#1@nilelse
expandaftergdefexpandafter@gtempaexpandafter{@gtempa#1}%
expandafter@stripbraces
fi
}
makeatother
begin{document}
stripbraces{M"uller}{x}
stripbraces{M{"u}ller}{y}
stripbraces{Müller}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
stripbraces{Øre}{x}
stripbraces{{O}re}{y}
stripbraces{O re}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
stripbraces{Gauß}{x}
stripbraces{Gau{ss}}{y}
stripbraces{Gauss}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
end{document}
All the tests yield "TRUE".
However this would fail for Fran{c{c}}ais and Fran{c c}ais. So the final answer depends on your needs.
Thanks, @egreg, this seems to work for my cases. For some reason, however, it does not work for values passed throughDeclareBibliographyOption, which seems to do some expansion. I.e. withDeclareBibliographyOption{myname}{defmyname{#1}}andmyname=M"ullerthe"uis expanded.
– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Trystripbraces{#1}{myname}instead ofdefmyname{#1}
– egreg
Oct 29 '12 at 17:25
this fails as well. It seems the"uis already expanded when passed as#1withinDeclareBibliographyOption.
– JSpitzm
Oct 29 '12 at 17:33
@JSpitzm Sorry, but without a real example it's impossible to say more.
– egreg
Oct 29 '12 at 17:37
Nevermind, it'll do for now without the bibliography option approach (I'll provide an alternative way to set the respective name). The real example is my biblatex-publist package on CTAN.
– JSpitzm
Oct 29 '12 at 17:46
|
show 1 more comment
You can't use edef in this context: edefx{..."u...} will always fail.
If you are using UTF-8 for your files and your author can appear in the three forms
M{"u}ller
M"uller
Müller
then these macros can be what you want:
documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{etoolbox}
makeatletter
defstripbraces#1#2{%
begingroup
defIeC##1{##1}%
protected@edef@tempa{#1}%
gdef@gtempa{}%
expandafter@stripbraces@tempa@nil
endgroup
let#2@gtempa
}
def@stripbraces#1{%
ifx#1@nilelse
expandaftergdefexpandafter@gtempaexpandafter{@gtempa#1}%
expandafter@stripbraces
fi
}
makeatother
begin{document}
stripbraces{M"uller}{x}
stripbraces{M{"u}ller}{y}
stripbraces{Müller}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
stripbraces{Øre}{x}
stripbraces{{O}re}{y}
stripbraces{O re}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
stripbraces{Gauß}{x}
stripbraces{Gau{ss}}{y}
stripbraces{Gauss}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
end{document}
All the tests yield "TRUE".
However this would fail for Fran{c{c}}ais and Fran{c c}ais. So the final answer depends on your needs.
Thanks, @egreg, this seems to work for my cases. For some reason, however, it does not work for values passed throughDeclareBibliographyOption, which seems to do some expansion. I.e. withDeclareBibliographyOption{myname}{defmyname{#1}}andmyname=M"ullerthe"uis expanded.
– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Trystripbraces{#1}{myname}instead ofdefmyname{#1}
– egreg
Oct 29 '12 at 17:25
this fails as well. It seems the"uis already expanded when passed as#1withinDeclareBibliographyOption.
– JSpitzm
Oct 29 '12 at 17:33
@JSpitzm Sorry, but without a real example it's impossible to say more.
– egreg
Oct 29 '12 at 17:37
Nevermind, it'll do for now without the bibliography option approach (I'll provide an alternative way to set the respective name). The real example is my biblatex-publist package on CTAN.
– JSpitzm
Oct 29 '12 at 17:46
|
show 1 more comment
You can't use edef in this context: edefx{..."u...} will always fail.
If you are using UTF-8 for your files and your author can appear in the three forms
M{"u}ller
M"uller
Müller
then these macros can be what you want:
documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{etoolbox}
makeatletter
defstripbraces#1#2{%
begingroup
defIeC##1{##1}%
protected@edef@tempa{#1}%
gdef@gtempa{}%
expandafter@stripbraces@tempa@nil
endgroup
let#2@gtempa
}
def@stripbraces#1{%
ifx#1@nilelse
expandaftergdefexpandafter@gtempaexpandafter{@gtempa#1}%
expandafter@stripbraces
fi
}
makeatother
begin{document}
stripbraces{M"uller}{x}
stripbraces{M{"u}ller}{y}
stripbraces{Müller}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
stripbraces{Øre}{x}
stripbraces{{O}re}{y}
stripbraces{O re}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
stripbraces{Gauß}{x}
stripbraces{Gau{ss}}{y}
stripbraces{Gauss}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
end{document}
All the tests yield "TRUE".
However this would fail for Fran{c{c}}ais and Fran{c c}ais. So the final answer depends on your needs.
You can't use edef in this context: edefx{..."u...} will always fail.
If you are using UTF-8 for your files and your author can appear in the three forms
M{"u}ller
M"uller
Müller
then these macros can be what you want:
documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{etoolbox}
makeatletter
defstripbraces#1#2{%
begingroup
defIeC##1{##1}%
protected@edef@tempa{#1}%
gdef@gtempa{}%
expandafter@stripbraces@tempa@nil
endgroup
let#2@gtempa
}
def@stripbraces#1{%
ifx#1@nilelse
expandaftergdefexpandafter@gtempaexpandafter{@gtempa#1}%
expandafter@stripbraces
fi
}
makeatother
begin{document}
stripbraces{M"uller}{x}
stripbraces{M{"u}ller}{y}
stripbraces{Müller}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
stripbraces{Øre}{x}
stripbraces{{O}re}{y}
stripbraces{O re}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
stripbraces{Gauß}{x}
stripbraces{Gau{ss}}{y}
stripbraces{Gauss}{z}
ifdefstrequal{x}{y}{TRUE}{FALSE}
ifdefstrequal{x}{z}{TRUE}{FALSE}
ifdefstrequal{y}{z}{TRUE}{FALSE}
end{document}
All the tests yield "TRUE".
However this would fail for Fran{c{c}}ais and Fran{c c}ais. So the final answer depends on your needs.
answered Oct 29 '12 at 16:07
egregegreg
736k8919343261
736k8919343261
Thanks, @egreg, this seems to work for my cases. For some reason, however, it does not work for values passed throughDeclareBibliographyOption, which seems to do some expansion. I.e. withDeclareBibliographyOption{myname}{defmyname{#1}}andmyname=M"ullerthe"uis expanded.
– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Trystripbraces{#1}{myname}instead ofdefmyname{#1}
– egreg
Oct 29 '12 at 17:25
this fails as well. It seems the"uis already expanded when passed as#1withinDeclareBibliographyOption.
– JSpitzm
Oct 29 '12 at 17:33
@JSpitzm Sorry, but without a real example it's impossible to say more.
– egreg
Oct 29 '12 at 17:37
Nevermind, it'll do for now without the bibliography option approach (I'll provide an alternative way to set the respective name). The real example is my biblatex-publist package on CTAN.
– JSpitzm
Oct 29 '12 at 17:46
|
show 1 more comment
Thanks, @egreg, this seems to work for my cases. For some reason, however, it does not work for values passed throughDeclareBibliographyOption, which seems to do some expansion. I.e. withDeclareBibliographyOption{myname}{defmyname{#1}}andmyname=M"ullerthe"uis expanded.
– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Trystripbraces{#1}{myname}instead ofdefmyname{#1}
– egreg
Oct 29 '12 at 17:25
this fails as well. It seems the"uis already expanded when passed as#1withinDeclareBibliographyOption.
– JSpitzm
Oct 29 '12 at 17:33
@JSpitzm Sorry, but without a real example it's impossible to say more.
– egreg
Oct 29 '12 at 17:37
Nevermind, it'll do for now without the bibliography option approach (I'll provide an alternative way to set the respective name). The real example is my biblatex-publist package on CTAN.
– JSpitzm
Oct 29 '12 at 17:46
Thanks, @egreg, this seems to work for my cases. For some reason, however, it does not work for values passed through
DeclareBibliographyOption, which seems to do some expansion. I.e. with DeclareBibliographyOption{myname}{defmyname{#1}} and myname=M"uller the "u is expanded.– JSpitzm
Oct 29 '12 at 16:54
Thanks, @egreg, this seems to work for my cases. For some reason, however, it does not work for values passed through
DeclareBibliographyOption, which seems to do some expansion. I.e. with DeclareBibliographyOption{myname}{defmyname{#1}} and myname=M"uller the "u is expanded.– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Try
stripbraces{#1}{myname} instead of defmyname{#1}– egreg
Oct 29 '12 at 17:25
@JSpitzm Try
stripbraces{#1}{myname} instead of defmyname{#1}– egreg
Oct 29 '12 at 17:25
this fails as well. It seems the
"u is already expanded when passed as #1 within DeclareBibliographyOption.– JSpitzm
Oct 29 '12 at 17:33
this fails as well. It seems the
"u is already expanded when passed as #1 within DeclareBibliographyOption.– JSpitzm
Oct 29 '12 at 17:33
@JSpitzm Sorry, but without a real example it's impossible to say more.
– egreg
Oct 29 '12 at 17:37
@JSpitzm Sorry, but without a real example it's impossible to say more.
– egreg
Oct 29 '12 at 17:37
Nevermind, it'll do for now without the bibliography option approach (I'll provide an alternative way to set the respective name). The real example is my biblatex-publist package on CTAN.
– JSpitzm
Oct 29 '12 at 17:46
Nevermind, it'll do for now without the bibliography option approach (I'll provide an alternative way to set the respective name). The real example is my biblatex-publist package on CTAN.
– JSpitzm
Oct 29 '12 at 17:46
|
show 1 more comment
Trying out unicode bib options with
newcommandtestuni{}
DeclareBibliographyOption[boolean]{test-unicode}[false]{
ifstrequal{#1}{𐎑𓀀ຢഓæçøûüŧũǻΦ}{renewcommandtestuni{𐎑𓀀ຢഓæçøûüŧũǻΦ has matched}}{renewcommandtestuni{𐎑𓀀ຢഓæçøûüŧũǻΦ has not matched}}
}
and setting the biblatex option to
test-unicode=𐎑𓀀ຢഓæçøûüŧũǻΦ,
and compiling in xelatex with the file in utf-8 format, and suitable font (usepackage{fontspec} and newfontfacefunicode{Code2003})
Result of textbackslash testuni: {funicode testuni}.
gives

Changing the bib option to
test-unicode=𐎑𓀀ຢഓæçѾѬøûüŧũǻΦ,
produces

So looks OK now.
The old-style escapes are no longer really needed.
add a comment |
Trying out unicode bib options with
newcommandtestuni{}
DeclareBibliographyOption[boolean]{test-unicode}[false]{
ifstrequal{#1}{𐎑𓀀ຢഓæçøûüŧũǻΦ}{renewcommandtestuni{𐎑𓀀ຢഓæçøûüŧũǻΦ has matched}}{renewcommandtestuni{𐎑𓀀ຢഓæçøûüŧũǻΦ has not matched}}
}
and setting the biblatex option to
test-unicode=𐎑𓀀ຢഓæçøûüŧũǻΦ,
and compiling in xelatex with the file in utf-8 format, and suitable font (usepackage{fontspec} and newfontfacefunicode{Code2003})
Result of textbackslash testuni: {funicode testuni}.
gives

Changing the bib option to
test-unicode=𐎑𓀀ຢഓæçѾѬøûüŧũǻΦ,
produces

So looks OK now.
The old-style escapes are no longer really needed.
add a comment |
Trying out unicode bib options with
newcommandtestuni{}
DeclareBibliographyOption[boolean]{test-unicode}[false]{
ifstrequal{#1}{𐎑𓀀ຢഓæçøûüŧũǻΦ}{renewcommandtestuni{𐎑𓀀ຢഓæçøûüŧũǻΦ has matched}}{renewcommandtestuni{𐎑𓀀ຢഓæçøûüŧũǻΦ has not matched}}
}
and setting the biblatex option to
test-unicode=𐎑𓀀ຢഓæçøûüŧũǻΦ,
and compiling in xelatex with the file in utf-8 format, and suitable font (usepackage{fontspec} and newfontfacefunicode{Code2003})
Result of textbackslash testuni: {funicode testuni}.
gives

Changing the bib option to
test-unicode=𐎑𓀀ຢഓæçѾѬøûüŧũǻΦ,
produces

So looks OK now.
The old-style escapes are no longer really needed.
Trying out unicode bib options with
newcommandtestuni{}
DeclareBibliographyOption[boolean]{test-unicode}[false]{
ifstrequal{#1}{𐎑𓀀ຢഓæçøûüŧũǻΦ}{renewcommandtestuni{𐎑𓀀ຢഓæçøûüŧũǻΦ has matched}}{renewcommandtestuni{𐎑𓀀ຢഓæçøûüŧũǻΦ has not matched}}
}
and setting the biblatex option to
test-unicode=𐎑𓀀ຢഓæçøûüŧũǻΦ,
and compiling in xelatex with the file in utf-8 format, and suitable font (usepackage{fontspec} and newfontfacefunicode{Code2003})
Result of textbackslash testuni: {funicode testuni}.
gives

Changing the bib option to
test-unicode=𐎑𓀀ຢഓæçѾѬøûüŧũǻΦ,
produces

So looks OK now.
The old-style escapes are no longer really needed.
edited 10 mins ago
answered 17 mins ago
CicadaCicada
765
765
add a comment |
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%2f79555%2fbiblatex-bibliographyoption-with-braces%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
Passing
M{"u}llerthroughedefis impossible and it wouldn't solve the problem anyway, becauseedefdoesn't touch braces that don't delimit arguments to commands.– egreg
Oct 29 '12 at 15:08
I'm not sure I understand. If I pass
M{"u}llertoedef, it expands toM{ü}ller, which is one step closer to what I want. Why is it "impossible"?– JSpitzm
Oct 29 '12 at 15:13
No,
"uexpands to the set of instructions for printing "ü", which is very different from a simple tokenü. Andedefx{"u}will always raise errors: the command"cannot go insideedef.– egreg
Oct 29 '12 at 15:28
Hm, seemed to work good enough for my purpose (I compare two
edefed macros via etoolbox'sifdefstrequal). Now the question is: is there a way to fully expand a string for testing, including macros and nested braces?– JSpitzm
Oct 29 '12 at 15:32
Are the braces you need to strip off just like in
M{"u}lleror is there something more complicated?– egreg
Oct 29 '12 at 15:36