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
How to make an animal which can only breed for a certain number of generations?
Does the universe have a fixed centre of mass?
How do Java 8 default methods hеlp with lambdas?
Inverse square law not accurate for non-point masses?
Sally's older brother
Is this Half dragon Quaggoth Balanced
One-one communication
Can haste grant me and my beast master companion extra attacks?
3D Masyu - A Die
Why is a lens darker than other ones when applying the same settings?
How can I prevent/balance waiting and turtling as a response to cooldown mechanics
Why complex landing gears are used instead of simple, reliable and light weight muscle wire or shape memory alloys?
Did John Wesley plagiarize Matthew Henry...?
Statistical analysis applied to methods coming out of Machine Learning
What are some likely causes to domain member PC losing contact to domain controller?
Did any compiler fully use 80-bit floating point?
newbie Q : How to read an output file in one command line
As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?
Does the transliteration of 'Dravidian' exist in Hindu scripture? Does 'Dravida' refer to a Geographical area or an ethnic group?
NIntegrate on a solution of a matrix ODE
Weaponising the Grasp-at-a-Distance spell
Is this Kuo-toa homebrew race balanced?
Fit odd number of triplets in a measure?
Pointing to problems without suggesting solutions
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
DeclareBibliographyOptionmynameedefsomename#1
Now LaTeX yields an error if the value of this option consists of braces, such as myname=M"uller:
! 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"uller is compared to M"uller, as in
edefxM"uller
edefyM"uller
ifdefstrequalxyTRUEFALSE
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
DeclareBibliographyOptionmynameedefsomename#1
Now LaTeX yields an error if the value of this option consists of braces, such as myname=M"uller:
! 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"uller is compared to M"uller, as in
edefxM"uller
edefyM"uller
ifdefstrequalxyTRUEFALSE
which will return FALSE.
biblatex
PassingM"ullerthroughedefis 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"ullertoedef, 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"uwill 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"ulleror 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
DeclareBibliographyOptionmynameedefsomename#1
Now LaTeX yields an error if the value of this option consists of braces, such as myname=M"uller:
! 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"uller is compared to M"uller, as in
edefxM"uller
edefyM"uller
ifdefstrequalxyTRUEFALSE
which will return FALSE.
biblatex
For a specific biblatex style, I have declared a bibliography option which takes a name, as in
DeclareBibliographyOptionmynameedefsomename#1
Now LaTeX yields an error if the value of this option consists of braces, such as myname=M"uller:
! 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"uller is compared to M"uller, as in
edefxM"uller
edefyM"uller
ifdefstrequalxyTRUEFALSE
which will return FALSE.
biblatex
biblatex
edited Oct 29 '12 at 15:54
JSpitzm
asked Oct 29 '12 at 12:31
JSpitzmJSpitzm
46526
46526
PassingM"ullerthroughedefis 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"ullertoedef, 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"uwill 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"ulleror is there something more complicated?
– egreg
Oct 29 '12 at 15:36
|
show 4 more comments
PassingM"ullerthroughedefis 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"ullertoedef, 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"uwill 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"ulleror is there something more complicated?
– egreg
Oct 29 '12 at 15:36
Passing
M"uller 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"uller 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"uller 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"uller 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"uller 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"uller 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"uller
M"uller
Müller
then these macros can be what you want:
documentclassarticle
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackageetoolbox
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
begindocument
stripbracesM"ullerx
stripbracesM"ullery
stripbracesMüllerz
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
stripbracesØrex
stripbracesOrey
stripbracesO rez
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
stripbracesGaußx
stripbracesGaussy
stripbracesGaussz
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
enddocument
All the tests yield "TRUE".
However this would fail for Franccais and Franc cais. 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. withDeclareBibliographyOptionmynamedefmyname#1andmyname=M"ullerthe"uis expanded.
– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Trystripbraces#1mynameinstead 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 matchedrenewcommandtestuni𐎑𓀀ຢഓæçøûüŧũǻΦ 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 (usepackagefontspec and newfontfacefunicodeCode2003)
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"uller
M"uller
Müller
then these macros can be what you want:
documentclassarticle
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackageetoolbox
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
begindocument
stripbracesM"ullerx
stripbracesM"ullery
stripbracesMüllerz
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
stripbracesØrex
stripbracesOrey
stripbracesO rez
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
stripbracesGaußx
stripbracesGaussy
stripbracesGaussz
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
enddocument
All the tests yield "TRUE".
However this would fail for Franccais and Franc cais. 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. withDeclareBibliographyOptionmynamedefmyname#1andmyname=M"ullerthe"uis expanded.
– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Trystripbraces#1mynameinstead 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"uller
M"uller
Müller
then these macros can be what you want:
documentclassarticle
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackageetoolbox
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
begindocument
stripbracesM"ullerx
stripbracesM"ullery
stripbracesMüllerz
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
stripbracesØrex
stripbracesOrey
stripbracesO rez
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
stripbracesGaußx
stripbracesGaussy
stripbracesGaussz
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
enddocument
All the tests yield "TRUE".
However this would fail for Franccais and Franc cais. 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. withDeclareBibliographyOptionmynamedefmyname#1andmyname=M"ullerthe"uis expanded.
– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Trystripbraces#1mynameinstead 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"uller
M"uller
Müller
then these macros can be what you want:
documentclassarticle
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackageetoolbox
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
begindocument
stripbracesM"ullerx
stripbracesM"ullery
stripbracesMüllerz
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
stripbracesØrex
stripbracesOrey
stripbracesO rez
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
stripbracesGaußx
stripbracesGaussy
stripbracesGaussz
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
enddocument
All the tests yield "TRUE".
However this would fail for Franccais and Franc cais. 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"uller
M"uller
Müller
then these macros can be what you want:
documentclassarticle
usepackage[T1]fontenc
usepackage[utf8]inputenc
usepackageetoolbox
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
begindocument
stripbracesM"ullerx
stripbracesM"ullery
stripbracesMüllerz
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
stripbracesØrex
stripbracesOrey
stripbracesO rez
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
stripbracesGaußx
stripbracesGaussy
stripbracesGaussz
ifdefstrequalxyTRUEFALSE
ifdefstrequalxzTRUEFALSE
ifdefstrequalyzTRUEFALSE
enddocument
All the tests yield "TRUE".
However this would fail for Franccais and Franc cais. 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. withDeclareBibliographyOptionmynamedefmyname#1andmyname=M"ullerthe"uis expanded.
– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Trystripbraces#1mynameinstead 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. withDeclareBibliographyOptionmynamedefmyname#1andmyname=M"ullerthe"uis expanded.
– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Trystripbraces#1mynameinstead 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 DeclareBibliographyOptionmynamedefmyname#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 DeclareBibliographyOptionmynamedefmyname#1 and myname=M"uller the "u is expanded.– JSpitzm
Oct 29 '12 at 16:54
@JSpitzm Try
stripbraces#1myname instead of defmyname#1– egreg
Oct 29 '12 at 17:25
@JSpitzm Try
stripbraces#1myname 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 matchedrenewcommandtestuni𐎑𓀀ຢഓæçøûüŧũǻΦ 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 (usepackagefontspec and newfontfacefunicodeCode2003)
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 matchedrenewcommandtestuni𐎑𓀀ຢഓæçøûüŧũǻΦ 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 (usepackagefontspec and newfontfacefunicodeCode2003)
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 matchedrenewcommandtestuni𐎑𓀀ຢഓæçøûüŧũǻΦ 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 (usepackagefontspec and newfontfacefunicodeCode2003)
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 matchedrenewcommandtestuni𐎑𓀀ຢഓæçøûüŧũǻΦ 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 (usepackagefontspec and newfontfacefunicodeCode2003)
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 2 mins ago
answered 8 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"ullerthroughedefis 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"ullertoedef, 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"uwill 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"ulleror is there something more complicated?– egreg
Oct 29 '12 at 15:36