About the expansion of seq_set_splitUnexpected hung latex compilation with property list retrievalDazzled and confused about xparse and LaTeX3 BooleansConfusion about Data Retrieval from a LaTeX3 StackAbout catcodes and Family in LaTeX3/expl3A Couple of Tidbits about the LaTeX3 tl_case:??? Functionexpl3, LaTeX3, LaTeX2e, and TeXMath functions and expansion issuesHow to define/iterate over nested property lists in LaTeX3How to use exp_not:N and exp_after:wN to prevent the expansion of input in a expl3 list?Latex3: Unicode (utf8) string, weird output with pdflatex

Is it possible to have 2 different but equal size real number sets that have the same mean and standard deviation?

Is it legal for a bar bouncer to confiscate a fake ID

What are neighboring ports?

How creative should the DM let an artificer be in terms of what they can build?

I have a problematic assistant manager, but I can't fire him

Why can my keyboard only digest 6 keypresses at a time?

Electricity free spaceship

If there's something that implicates the president why is there then a national security issue? (John Dowd)

How to publish items after pipeline is finished?

Is it possible to fly backward if you have REALLY STRONG headwind?

Bb13b9 confusion

What is exactly Avijja -- and how to uproot it?

Fermat's statement about the ancients: How serious was he?

What are some really overused phrases in French that are common nowadays?

Why can I traceroute to this IP address, but not ping?

Is it safe to change the harddrive power feature so that it never turns off?

Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?

Which is the better way to call a method that is only available to one class that implements an interface but not the other one?

Why was this person allowed to become Grand Maester?

Are there any normal animals in Pokemon universe?

Teaching a class likely meant to inflate the GPA of student athletes

Origin of "boor"

Can a human be transformed into a Mind Flayer?

How to learn Linux system internals



About the expansion of seq_set_split


Unexpected hung latex compilation with property list retrievalDazzled and confused about xparse and LaTeX3 BooleansConfusion about Data Retrieval from a LaTeX3 StackAbout catcodes and Family in LaTeX3/expl3A Couple of Tidbits about the LaTeX3 tl_case:??? Functionexpl3, LaTeX3, LaTeX2e, and TeXMath functions and expansion issuesHow to define/iterate over nested property lists in LaTeX3How to use exp_not:N and exp_after:wN to prevent the expansion of input in a expl3 list?Latex3: Unicode (utf8) string, weird output with pdflatex













3















As shown in fig, if I use the keyval, then my MWE does not work well.



enter image description here



What's wrong with my MWE?



documentclassarticle

usepackagekeyval
usepackageexpl3
usepackagexparse

makeatletter
defBUPTthesiscntitlepage#1setkeyscntitle#1
define@keycntitletitlelongdefBUPT@value@title#1
makeatother

makeatletterExplSyntaxOn
seq_new:N l_@@_title_seq
NewDocumentCommand settitle m
seq_set_split:Nnn l_@@_title_seq \ #1

dim_new:N l_@@_title_width_dim
NewDocumentCommand printtitle

group_begin:
@@_title_name_format:
tl_use:N c_@@_title_name_tl
group_end:
group_begin:
@@_title_format:
@@_get_max_width:NN l_@@_title_width_dim l_@@_title_seq
dim_add:Nn l_@@_title_width_dim 10p@
dim_log:N l_@@_title_width_dim
parbox [t] l_@@_title_width_dim

seq_map_inline:Nn l_@@_title_seq
@@_underline:Nn l_@@_title_width_dim ##1 \

group_end:


cs_new_protected:Npn @@_get_max_width:NN #1#2

group_begin:
dim_zero:N #1
bool_until_do:nn seq_if_empty_p:N #2

seq_pop:NN #2 l_tmpa_tl
exp_args:NNV @@_get_width:Nn l_tmpa_dim l_tmpa_tl
dim_gset:Nn #1 dim_max:nn dim_use:N #1 l_tmpa_dim

group_end:

cs_new_protected:Npn @@_get_width:Nn #1#2

hbox_set:Nn l_tmpa_box #2
dim_set:Nn #1 box_wd:N l_tmpa_box


cs_new_protected:Npn @@_underline:Nn #1#2
underline hbox_to_wd:nn dim_use:N #1 hss #2 hss

tl_const:Nn c_@@_title_name_tl Title:
cs_new:Npn @@_title_name_format: Large bfseries
cs_new:Npn @@_title_format: Large bfseries

ExplSyntaxOffmakeatother

BUPTthesiscntitlepage%
title = AAAA \ BBBLaTeX B

begindocument
settitleAAAA \ BBBLaTeX BB
printtitle

makeatletter
longdefBUPTtitletempBUPT@value@title
makeatother

settitleBUPTtitletemp
printtitle
enddocument










share|improve this question







New contributor



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



















  • @@ is not to be used as a prefix.

    – egreg
    Jun 2 at 9:34















3















As shown in fig, if I use the keyval, then my MWE does not work well.



enter image description here



What's wrong with my MWE?



documentclassarticle

usepackagekeyval
usepackageexpl3
usepackagexparse

makeatletter
defBUPTthesiscntitlepage#1setkeyscntitle#1
define@keycntitletitlelongdefBUPT@value@title#1
makeatother

makeatletterExplSyntaxOn
seq_new:N l_@@_title_seq
NewDocumentCommand settitle m
seq_set_split:Nnn l_@@_title_seq \ #1

dim_new:N l_@@_title_width_dim
NewDocumentCommand printtitle

group_begin:
@@_title_name_format:
tl_use:N c_@@_title_name_tl
group_end:
group_begin:
@@_title_format:
@@_get_max_width:NN l_@@_title_width_dim l_@@_title_seq
dim_add:Nn l_@@_title_width_dim 10p@
dim_log:N l_@@_title_width_dim
parbox [t] l_@@_title_width_dim

seq_map_inline:Nn l_@@_title_seq
@@_underline:Nn l_@@_title_width_dim ##1 \

group_end:


cs_new_protected:Npn @@_get_max_width:NN #1#2

group_begin:
dim_zero:N #1
bool_until_do:nn seq_if_empty_p:N #2

seq_pop:NN #2 l_tmpa_tl
exp_args:NNV @@_get_width:Nn l_tmpa_dim l_tmpa_tl
dim_gset:Nn #1 dim_max:nn dim_use:N #1 l_tmpa_dim

group_end:

cs_new_protected:Npn @@_get_width:Nn #1#2

hbox_set:Nn l_tmpa_box #2
dim_set:Nn #1 box_wd:N l_tmpa_box


cs_new_protected:Npn @@_underline:Nn #1#2
underline hbox_to_wd:nn dim_use:N #1 hss #2 hss

tl_const:Nn c_@@_title_name_tl Title:
cs_new:Npn @@_title_name_format: Large bfseries
cs_new:Npn @@_title_format: Large bfseries

ExplSyntaxOffmakeatother

BUPTthesiscntitlepage%
title = AAAA \ BBBLaTeX B

begindocument
settitleAAAA \ BBBLaTeX BB
printtitle

makeatletter
longdefBUPTtitletempBUPT@value@title
makeatother

settitleBUPTtitletemp
printtitle
enddocument










share|improve this question







New contributor



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



















  • @@ is not to be used as a prefix.

    – egreg
    Jun 2 at 9:34













3












3








3








As shown in fig, if I use the keyval, then my MWE does not work well.



enter image description here



What's wrong with my MWE?



documentclassarticle

usepackagekeyval
usepackageexpl3
usepackagexparse

makeatletter
defBUPTthesiscntitlepage#1setkeyscntitle#1
define@keycntitletitlelongdefBUPT@value@title#1
makeatother

makeatletterExplSyntaxOn
seq_new:N l_@@_title_seq
NewDocumentCommand settitle m
seq_set_split:Nnn l_@@_title_seq \ #1

dim_new:N l_@@_title_width_dim
NewDocumentCommand printtitle

group_begin:
@@_title_name_format:
tl_use:N c_@@_title_name_tl
group_end:
group_begin:
@@_title_format:
@@_get_max_width:NN l_@@_title_width_dim l_@@_title_seq
dim_add:Nn l_@@_title_width_dim 10p@
dim_log:N l_@@_title_width_dim
parbox [t] l_@@_title_width_dim

seq_map_inline:Nn l_@@_title_seq
@@_underline:Nn l_@@_title_width_dim ##1 \

group_end:


cs_new_protected:Npn @@_get_max_width:NN #1#2

group_begin:
dim_zero:N #1
bool_until_do:nn seq_if_empty_p:N #2

seq_pop:NN #2 l_tmpa_tl
exp_args:NNV @@_get_width:Nn l_tmpa_dim l_tmpa_tl
dim_gset:Nn #1 dim_max:nn dim_use:N #1 l_tmpa_dim

group_end:

cs_new_protected:Npn @@_get_width:Nn #1#2

hbox_set:Nn l_tmpa_box #2
dim_set:Nn #1 box_wd:N l_tmpa_box


cs_new_protected:Npn @@_underline:Nn #1#2
underline hbox_to_wd:nn dim_use:N #1 hss #2 hss

tl_const:Nn c_@@_title_name_tl Title:
cs_new:Npn @@_title_name_format: Large bfseries
cs_new:Npn @@_title_format: Large bfseries

ExplSyntaxOffmakeatother

BUPTthesiscntitlepage%
title = AAAA \ BBBLaTeX B

begindocument
settitleAAAA \ BBBLaTeX BB
printtitle

makeatletter
longdefBUPTtitletempBUPT@value@title
makeatother

settitleBUPTtitletemp
printtitle
enddocument










share|improve this question







New contributor



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











As shown in fig, if I use the keyval, then my MWE does not work well.



enter image description here



What's wrong with my MWE?



documentclassarticle

usepackagekeyval
usepackageexpl3
usepackagexparse

makeatletter
defBUPTthesiscntitlepage#1setkeyscntitle#1
define@keycntitletitlelongdefBUPT@value@title#1
makeatother

makeatletterExplSyntaxOn
seq_new:N l_@@_title_seq
NewDocumentCommand settitle m
seq_set_split:Nnn l_@@_title_seq \ #1

dim_new:N l_@@_title_width_dim
NewDocumentCommand printtitle

group_begin:
@@_title_name_format:
tl_use:N c_@@_title_name_tl
group_end:
group_begin:
@@_title_format:
@@_get_max_width:NN l_@@_title_width_dim l_@@_title_seq
dim_add:Nn l_@@_title_width_dim 10p@
dim_log:N l_@@_title_width_dim
parbox [t] l_@@_title_width_dim

seq_map_inline:Nn l_@@_title_seq
@@_underline:Nn l_@@_title_width_dim ##1 \

group_end:


cs_new_protected:Npn @@_get_max_width:NN #1#2

group_begin:
dim_zero:N #1
bool_until_do:nn seq_if_empty_p:N #2

seq_pop:NN #2 l_tmpa_tl
exp_args:NNV @@_get_width:Nn l_tmpa_dim l_tmpa_tl
dim_gset:Nn #1 dim_max:nn dim_use:N #1 l_tmpa_dim

group_end:

cs_new_protected:Npn @@_get_width:Nn #1#2

hbox_set:Nn l_tmpa_box #2
dim_set:Nn #1 box_wd:N l_tmpa_box


cs_new_protected:Npn @@_underline:Nn #1#2
underline hbox_to_wd:nn dim_use:N #1 hss #2 hss

tl_const:Nn c_@@_title_name_tl Title:
cs_new:Npn @@_title_name_format: Large bfseries
cs_new:Npn @@_title_format: Large bfseries

ExplSyntaxOffmakeatother

BUPTthesiscntitlepage%
title = AAAA \ BBBLaTeX B

begindocument
settitleAAAA \ BBBLaTeX BB
printtitle

makeatletter
longdefBUPTtitletempBUPT@value@title
makeatother

settitleBUPTtitletemp
printtitle
enddocument







latex3






share|improve this question







New contributor



DangeRS2 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



DangeRS2 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



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








asked Jun 2 at 2:51









DangeRS2DangeRS2

183




183




New contributor



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




New contributor




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














  • @@ is not to be used as a prefix.

    – egreg
    Jun 2 at 9:34

















  • @@ is not to be used as a prefix.

    – egreg
    Jun 2 at 9:34
















@@ is not to be used as a prefix.

– egreg
Jun 2 at 9:34





@@ is not to be used as a prefix.

– egreg
Jun 2 at 9:34










3 Answers
3






active

oldest

votes


















4














When you set the title like settitleBUPTtitletemp, the BUPTtitletemp macro is not expanded. So the splitting at \ fails. Expansion only happens when you actually typeset the lines in an hbox (where you can't have a linebreak).



An easy fix in this case is to make sure the content that is passed to settitle is at least expanded that far that an unexpandable token occurs at its start:



exp_args_generate:n Nnf 
NewDocumentCommand settitle m
exp_args:NNnf seq_set_split:Nnn l_@@_title_seq \ #1


The result is as expected



enter image description here






share|improve this answer























  • Thanks for your answer!

    – DangeRS2
    Jun 2 at 4:36


















6














First and foremost: @@ is an internal convention used in .dtx files to denote a common prefix in functions and variables and should not be used in production code.



The simplest ways to cope with your problem is to avoid keyval and use the more powerful features in expl3.



You can so store the title as a sequence, splitting it at \, instead of having to do it later.



Also a tabular is easier than parbox, as it doesn't require to measure the items.



documentclassarticle

usepackageexpl3
usepackagexparse

ExplSyntaxOn

keys_define:nn danger/BUPT

title .code:n = seq_set_split:Nnn l_danger_title_seq \ #1 ,

seq_new:N l_danger_title_seq

NewDocumentCommandBUPTthesiscntitlepagem

keys_set:nn danger/BUPT #1



NewDocumentCommand printtitle

group_begin:
danger_title_name_format:
tl_use:N c_danger_title_name_tl
c_space_tl
group_end:
group_begin:
danger_title_format:
begintabular[t]@ l @
seq_map_function:NN l_danger_title_seq __danger_underline_endline:n
endtabular
group_end:


cs_new_protected:Npn __danger_underline_endline:n #1

underline #1 \


tl_const:Nn c_danger_title_name_tl Title:
cs_new_protected:Npn danger_title_name_format: Large bfseries
cs_new_protected:Npn danger_title_format: Large bfseries

ExplSyntaxOff

BUPTthesiscntitlepage
title = AAAA \ BBBLaTeX B,


begindocument

printtitle

enddocument


enter image description here






share|improve this answer























  • Thanks for your answer!

    – DangeRS2
    Jun 3 at 3:33


















4














Note that settitle is defined as



seq_set_split:Nnn l_@@_title_seq \ #1


which meanse its argument should be a set of tokens given in braces. So



settitleAAAA \ BBBLaTeX BB


will take AAAA \ BBBLaTeX BB as the argument, then split it at \ and push AAAA, BBBLaTeX BB into l_@@_title_seq.



However, when using



settitleBUPTtitletemp


the argument is just BUPTtitletemp (NOT its value), which has no \ explicitly. Therefore, the whole title AAAA \ BBBLaTeX B will be pushed into l_@@_title_seq as a single item. This will lead to errors since the following function such as @@_get_max_width:NN does not allow \ in its argument.






share|improve this answer























  • Thanks for your help!

    – DangeRS2
    Jun 2 at 4:07











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
);



);






DangeRS2 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%2f493747%2fabout-the-expansion-of-seq-set-split%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














When you set the title like settitleBUPTtitletemp, the BUPTtitletemp macro is not expanded. So the splitting at \ fails. Expansion only happens when you actually typeset the lines in an hbox (where you can't have a linebreak).



An easy fix in this case is to make sure the content that is passed to settitle is at least expanded that far that an unexpandable token occurs at its start:



exp_args_generate:n Nnf 
NewDocumentCommand settitle m
exp_args:NNnf seq_set_split:Nnn l_@@_title_seq \ #1


The result is as expected



enter image description here






share|improve this answer























  • Thanks for your answer!

    – DangeRS2
    Jun 2 at 4:36















4














When you set the title like settitleBUPTtitletemp, the BUPTtitletemp macro is not expanded. So the splitting at \ fails. Expansion only happens when you actually typeset the lines in an hbox (where you can't have a linebreak).



An easy fix in this case is to make sure the content that is passed to settitle is at least expanded that far that an unexpandable token occurs at its start:



exp_args_generate:n Nnf 
NewDocumentCommand settitle m
exp_args:NNnf seq_set_split:Nnn l_@@_title_seq \ #1


The result is as expected



enter image description here






share|improve this answer























  • Thanks for your answer!

    – DangeRS2
    Jun 2 at 4:36













4












4








4







When you set the title like settitleBUPTtitletemp, the BUPTtitletemp macro is not expanded. So the splitting at \ fails. Expansion only happens when you actually typeset the lines in an hbox (where you can't have a linebreak).



An easy fix in this case is to make sure the content that is passed to settitle is at least expanded that far that an unexpandable token occurs at its start:



exp_args_generate:n Nnf 
NewDocumentCommand settitle m
exp_args:NNnf seq_set_split:Nnn l_@@_title_seq \ #1


The result is as expected



enter image description here






share|improve this answer













When you set the title like settitleBUPTtitletemp, the BUPTtitletemp macro is not expanded. So the splitting at \ fails. Expansion only happens when you actually typeset the lines in an hbox (where you can't have a linebreak).



An easy fix in this case is to make sure the content that is passed to settitle is at least expanded that far that an unexpandable token occurs at its start:



exp_args_generate:n Nnf 
NewDocumentCommand settitle m
exp_args:NNnf seq_set_split:Nnn l_@@_title_seq \ #1


The result is as expected



enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 2 at 3:46









siracusasiracusa

6,07711733




6,07711733












  • Thanks for your answer!

    – DangeRS2
    Jun 2 at 4:36

















  • Thanks for your answer!

    – DangeRS2
    Jun 2 at 4:36
















Thanks for your answer!

– DangeRS2
Jun 2 at 4:36





Thanks for your answer!

– DangeRS2
Jun 2 at 4:36











6














First and foremost: @@ is an internal convention used in .dtx files to denote a common prefix in functions and variables and should not be used in production code.



The simplest ways to cope with your problem is to avoid keyval and use the more powerful features in expl3.



You can so store the title as a sequence, splitting it at \, instead of having to do it later.



Also a tabular is easier than parbox, as it doesn't require to measure the items.



documentclassarticle

usepackageexpl3
usepackagexparse

ExplSyntaxOn

keys_define:nn danger/BUPT

title .code:n = seq_set_split:Nnn l_danger_title_seq \ #1 ,

seq_new:N l_danger_title_seq

NewDocumentCommandBUPTthesiscntitlepagem

keys_set:nn danger/BUPT #1



NewDocumentCommand printtitle

group_begin:
danger_title_name_format:
tl_use:N c_danger_title_name_tl
c_space_tl
group_end:
group_begin:
danger_title_format:
begintabular[t]@ l @
seq_map_function:NN l_danger_title_seq __danger_underline_endline:n
endtabular
group_end:


cs_new_protected:Npn __danger_underline_endline:n #1

underline #1 \


tl_const:Nn c_danger_title_name_tl Title:
cs_new_protected:Npn danger_title_name_format: Large bfseries
cs_new_protected:Npn danger_title_format: Large bfseries

ExplSyntaxOff

BUPTthesiscntitlepage
title = AAAA \ BBBLaTeX B,


begindocument

printtitle

enddocument


enter image description here






share|improve this answer























  • Thanks for your answer!

    – DangeRS2
    Jun 3 at 3:33















6














First and foremost: @@ is an internal convention used in .dtx files to denote a common prefix in functions and variables and should not be used in production code.



The simplest ways to cope with your problem is to avoid keyval and use the more powerful features in expl3.



You can so store the title as a sequence, splitting it at \, instead of having to do it later.



Also a tabular is easier than parbox, as it doesn't require to measure the items.



documentclassarticle

usepackageexpl3
usepackagexparse

ExplSyntaxOn

keys_define:nn danger/BUPT

title .code:n = seq_set_split:Nnn l_danger_title_seq \ #1 ,

seq_new:N l_danger_title_seq

NewDocumentCommandBUPTthesiscntitlepagem

keys_set:nn danger/BUPT #1



NewDocumentCommand printtitle

group_begin:
danger_title_name_format:
tl_use:N c_danger_title_name_tl
c_space_tl
group_end:
group_begin:
danger_title_format:
begintabular[t]@ l @
seq_map_function:NN l_danger_title_seq __danger_underline_endline:n
endtabular
group_end:


cs_new_protected:Npn __danger_underline_endline:n #1

underline #1 \


tl_const:Nn c_danger_title_name_tl Title:
cs_new_protected:Npn danger_title_name_format: Large bfseries
cs_new_protected:Npn danger_title_format: Large bfseries

ExplSyntaxOff

BUPTthesiscntitlepage
title = AAAA \ BBBLaTeX B,


begindocument

printtitle

enddocument


enter image description here






share|improve this answer























  • Thanks for your answer!

    – DangeRS2
    Jun 3 at 3:33













6












6








6







First and foremost: @@ is an internal convention used in .dtx files to denote a common prefix in functions and variables and should not be used in production code.



The simplest ways to cope with your problem is to avoid keyval and use the more powerful features in expl3.



You can so store the title as a sequence, splitting it at \, instead of having to do it later.



Also a tabular is easier than parbox, as it doesn't require to measure the items.



documentclassarticle

usepackageexpl3
usepackagexparse

ExplSyntaxOn

keys_define:nn danger/BUPT

title .code:n = seq_set_split:Nnn l_danger_title_seq \ #1 ,

seq_new:N l_danger_title_seq

NewDocumentCommandBUPTthesiscntitlepagem

keys_set:nn danger/BUPT #1



NewDocumentCommand printtitle

group_begin:
danger_title_name_format:
tl_use:N c_danger_title_name_tl
c_space_tl
group_end:
group_begin:
danger_title_format:
begintabular[t]@ l @
seq_map_function:NN l_danger_title_seq __danger_underline_endline:n
endtabular
group_end:


cs_new_protected:Npn __danger_underline_endline:n #1

underline #1 \


tl_const:Nn c_danger_title_name_tl Title:
cs_new_protected:Npn danger_title_name_format: Large bfseries
cs_new_protected:Npn danger_title_format: Large bfseries

ExplSyntaxOff

BUPTthesiscntitlepage
title = AAAA \ BBBLaTeX B,


begindocument

printtitle

enddocument


enter image description here






share|improve this answer













First and foremost: @@ is an internal convention used in .dtx files to denote a common prefix in functions and variables and should not be used in production code.



The simplest ways to cope with your problem is to avoid keyval and use the more powerful features in expl3.



You can so store the title as a sequence, splitting it at \, instead of having to do it later.



Also a tabular is easier than parbox, as it doesn't require to measure the items.



documentclassarticle

usepackageexpl3
usepackagexparse

ExplSyntaxOn

keys_define:nn danger/BUPT

title .code:n = seq_set_split:Nnn l_danger_title_seq \ #1 ,

seq_new:N l_danger_title_seq

NewDocumentCommandBUPTthesiscntitlepagem

keys_set:nn danger/BUPT #1



NewDocumentCommand printtitle

group_begin:
danger_title_name_format:
tl_use:N c_danger_title_name_tl
c_space_tl
group_end:
group_begin:
danger_title_format:
begintabular[t]@ l @
seq_map_function:NN l_danger_title_seq __danger_underline_endline:n
endtabular
group_end:


cs_new_protected:Npn __danger_underline_endline:n #1

underline #1 \


tl_const:Nn c_danger_title_name_tl Title:
cs_new_protected:Npn danger_title_name_format: Large bfseries
cs_new_protected:Npn danger_title_format: Large bfseries

ExplSyntaxOff

BUPTthesiscntitlepage
title = AAAA \ BBBLaTeX B,


begindocument

printtitle

enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 2 at 9:54









egregegreg

747k8919543295




747k8919543295












  • Thanks for your answer!

    – DangeRS2
    Jun 3 at 3:33

















  • Thanks for your answer!

    – DangeRS2
    Jun 3 at 3:33
















Thanks for your answer!

– DangeRS2
Jun 3 at 3:33





Thanks for your answer!

– DangeRS2
Jun 3 at 3:33











4














Note that settitle is defined as



seq_set_split:Nnn l_@@_title_seq \ #1


which meanse its argument should be a set of tokens given in braces. So



settitleAAAA \ BBBLaTeX BB


will take AAAA \ BBBLaTeX BB as the argument, then split it at \ and push AAAA, BBBLaTeX BB into l_@@_title_seq.



However, when using



settitleBUPTtitletemp


the argument is just BUPTtitletemp (NOT its value), which has no \ explicitly. Therefore, the whole title AAAA \ BBBLaTeX B will be pushed into l_@@_title_seq as a single item. This will lead to errors since the following function such as @@_get_max_width:NN does not allow \ in its argument.






share|improve this answer























  • Thanks for your help!

    – DangeRS2
    Jun 2 at 4:07















4














Note that settitle is defined as



seq_set_split:Nnn l_@@_title_seq \ #1


which meanse its argument should be a set of tokens given in braces. So



settitleAAAA \ BBBLaTeX BB


will take AAAA \ BBBLaTeX BB as the argument, then split it at \ and push AAAA, BBBLaTeX BB into l_@@_title_seq.



However, when using



settitleBUPTtitletemp


the argument is just BUPTtitletemp (NOT its value), which has no \ explicitly. Therefore, the whole title AAAA \ BBBLaTeX B will be pushed into l_@@_title_seq as a single item. This will lead to errors since the following function such as @@_get_max_width:NN does not allow \ in its argument.






share|improve this answer























  • Thanks for your help!

    – DangeRS2
    Jun 2 at 4:07













4












4








4







Note that settitle is defined as



seq_set_split:Nnn l_@@_title_seq \ #1


which meanse its argument should be a set of tokens given in braces. So



settitleAAAA \ BBBLaTeX BB


will take AAAA \ BBBLaTeX BB as the argument, then split it at \ and push AAAA, BBBLaTeX BB into l_@@_title_seq.



However, when using



settitleBUPTtitletemp


the argument is just BUPTtitletemp (NOT its value), which has no \ explicitly. Therefore, the whole title AAAA \ BBBLaTeX B will be pushed into l_@@_title_seq as a single item. This will lead to errors since the following function such as @@_get_max_width:NN does not allow \ in its argument.






share|improve this answer













Note that settitle is defined as



seq_set_split:Nnn l_@@_title_seq \ #1


which meanse its argument should be a set of tokens given in braces. So



settitleAAAA \ BBBLaTeX BB


will take AAAA \ BBBLaTeX BB as the argument, then split it at \ and push AAAA, BBBLaTeX BB into l_@@_title_seq.



However, when using



settitleBUPTtitletemp


the argument is just BUPTtitletemp (NOT its value), which has no \ explicitly. Therefore, the whole title AAAA \ BBBLaTeX B will be pushed into l_@@_title_seq as a single item. This will lead to errors since the following function such as @@_get_max_width:NN does not allow \ in its argument.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 2 at 3:43









stone-zengstone-zeng

1,370517




1,370517












  • Thanks for your help!

    – DangeRS2
    Jun 2 at 4:07

















  • Thanks for your help!

    – DangeRS2
    Jun 2 at 4:07
















Thanks for your help!

– DangeRS2
Jun 2 at 4:07





Thanks for your help!

– DangeRS2
Jun 2 at 4:07










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









draft saved

draft discarded


















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












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











DangeRS2 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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f493747%2fabout-the-expansion-of-seq-set-split%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

Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림