Unary EnumerationHow do I change the `enumerate` list format to use letters instead of the default Arabic numerals?How can you make custom counter display types?Custom numbering style using the number of Symbols instead of NumbersHow to continue an enumeration?Custom EnumerationNested enumeration numberingHow to change the numbering style for enumeration and sub-enumerationHow to let enumeration start at (0) automatically?New enumerationExercise enumerationEnumeration on one lineRelated enumeration inside another enumerate environmentFancy enumeration
Way of refund if scammed?
What does it mean when みたいな is at the end of a sentence?
Illustrating that universal optimality is stronger than sphere packing
Existence of a model of ZFC in which the natural numbers are really the natural numbers
Writing "hahaha" versus describing the laugh
Surface of the 3x3x3 cube as a graph
nginx conf: http2 module not working in Chrome in ubuntu 18.04
Can someone get a spouse off a deed that never lived together and was incarcerated?
What is the required burn to keep a satellite at a Lagrangian point?
How do I write real-world stories separate from my country of origin?
Nunc est bibendum: gerund or gerundive?
Why do testers need root cause analysis?
DeleteCases using two lists but with partial match?
Why is this python script running in background consuming 100 % CPU?
Department head said that group project may be rejected. How to mitigate?
Why is Ni[(PPh₃)₂Cl₂] tetrahedral?
How does the Earth's center produce heat?
Is it OK to look at the list of played moves during the game to determine the status of the 50 move rule?
What does it mean for something to be strictly less than epsilon for an arbitrary epsilon?
Team member is vehemently against code formatting
How would a physicist explain this starship engine?
Why is the reciprocal used in fraction division?
Has the wall been repaired?
How to safely discharge oneself
Unary Enumeration
How do I change the `enumerate` list format to use letters instead of the default Arabic numerals?How can you make custom counter display types?Custom numbering style using the number of Symbols instead of NumbersHow to continue an enumeration?Custom EnumerationNested enumeration numberingHow to change the numbering style for enumeration and sub-enumerationHow to let enumeration start at (0) automatically?New enumerationExercise enumerationEnumeration on one lineRelated enumeration inside another enumerate environmentFancy enumeration
I would like to have an enumerate
list, with the numbers expressed in unary. That is, "1" would be represented as •
, "3" as •••
, and "8" as •••••|•••
.
I'm able to print the dots already, and that's working fine:
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
However, I have no idea how to make enumerate
use this. Based on this answer, I tried redefining theenumi
:
renewcommandtheenumixdotsarabicenumi
But this went badly wrong:
! Illegal parameter number in definition of @currentlabel.
<to be read again>
1
l.376 ^^Iitem My text here ...
You meant to type ## instead of #, right?
Or maybe a } was forgotten somewhere earlier, and things
are all screwed up? I'm going to assume that you meant ##.
How can I apply my unary-printing code to the enumerate
label?
EDIT: Based on this answer, I tried this:
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
And it seems to work! As in, this produces the correct output:
newcountertest
setcountertest8
unarytest
However, the MWE still throws a bunch of errors.
MWE follows:
documentclassarticle
usepackageforloop
usepackagetipa
usepackage[T1]fontenc
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
makeatletter
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
makeatother
%renewcommandtheenumiunaryenumi % This crashes and burns
begindocument
Unary works normally: xdots1, xdots3, xdots8.
It even works with a counter.
newcountertest
setcountertest8
unarytest
But in a list:
beginenumerate
item My text here my text here
item More text more text
item Even more text
endenumerate
enddocument
numbering lists enumerate
add a comment |
I would like to have an enumerate
list, with the numbers expressed in unary. That is, "1" would be represented as •
, "3" as •••
, and "8" as •••••|•••
.
I'm able to print the dots already, and that's working fine:
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
However, I have no idea how to make enumerate
use this. Based on this answer, I tried redefining theenumi
:
renewcommandtheenumixdotsarabicenumi
But this went badly wrong:
! Illegal parameter number in definition of @currentlabel.
<to be read again>
1
l.376 ^^Iitem My text here ...
You meant to type ## instead of #, right?
Or maybe a } was forgotten somewhere earlier, and things
are all screwed up? I'm going to assume that you meant ##.
How can I apply my unary-printing code to the enumerate
label?
EDIT: Based on this answer, I tried this:
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
And it seems to work! As in, this produces the correct output:
newcountertest
setcountertest8
unarytest
However, the MWE still throws a bunch of errors.
MWE follows:
documentclassarticle
usepackageforloop
usepackagetipa
usepackage[T1]fontenc
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
makeatletter
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
makeatother
%renewcommandtheenumiunaryenumi % This crashes and burns
begindocument
Unary works normally: xdots1, xdots3, xdots8.
It even works with a counter.
newcountertest
setcountertest8
unarytest
But in a list:
beginenumerate
item My text here my text here
item More text more text
item Even more text
endenumerate
enddocument
numbering lists enumerate
Are you aware of this question?
– marmot
1 hour ago
@marmot I was not, but it seems to offer good solutions!
– Draconis
1 hour ago
add a comment |
I would like to have an enumerate
list, with the numbers expressed in unary. That is, "1" would be represented as •
, "3" as •••
, and "8" as •••••|•••
.
I'm able to print the dots already, and that's working fine:
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
However, I have no idea how to make enumerate
use this. Based on this answer, I tried redefining theenumi
:
renewcommandtheenumixdotsarabicenumi
But this went badly wrong:
! Illegal parameter number in definition of @currentlabel.
<to be read again>
1
l.376 ^^Iitem My text here ...
You meant to type ## instead of #, right?
Or maybe a } was forgotten somewhere earlier, and things
are all screwed up? I'm going to assume that you meant ##.
How can I apply my unary-printing code to the enumerate
label?
EDIT: Based on this answer, I tried this:
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
And it seems to work! As in, this produces the correct output:
newcountertest
setcountertest8
unarytest
However, the MWE still throws a bunch of errors.
MWE follows:
documentclassarticle
usepackageforloop
usepackagetipa
usepackage[T1]fontenc
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
makeatletter
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
makeatother
%renewcommandtheenumiunaryenumi % This crashes and burns
begindocument
Unary works normally: xdots1, xdots3, xdots8.
It even works with a counter.
newcountertest
setcountertest8
unarytest
But in a list:
beginenumerate
item My text here my text here
item More text more text
item Even more text
endenumerate
enddocument
numbering lists enumerate
I would like to have an enumerate
list, with the numbers expressed in unary. That is, "1" would be represented as •
, "3" as •••
, and "8" as •••••|•••
.
I'm able to print the dots already, and that's working fine:
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
However, I have no idea how to make enumerate
use this. Based on this answer, I tried redefining theenumi
:
renewcommandtheenumixdotsarabicenumi
But this went badly wrong:
! Illegal parameter number in definition of @currentlabel.
<to be read again>
1
l.376 ^^Iitem My text here ...
You meant to type ## instead of #, right?
Or maybe a } was forgotten somewhere earlier, and things
are all screwed up? I'm going to assume that you meant ##.
How can I apply my unary-printing code to the enumerate
label?
EDIT: Based on this answer, I tried this:
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
And it seems to work! As in, this produces the correct output:
newcountertest
setcountertest8
unarytest
However, the MWE still throws a bunch of errors.
MWE follows:
documentclassarticle
usepackageforloop
usepackagetipa
usepackage[T1]fontenc
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
makeatletter
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
makeatother
%renewcommandtheenumiunaryenumi % This crashes and burns
begindocument
Unary works normally: xdots1, xdots3, xdots8.
It even works with a counter.
newcountertest
setcountertest8
unarytest
But in a list:
beginenumerate
item My text here my text here
item More text more text
item Even more text
endenumerate
enddocument
numbering lists enumerate
numbering lists enumerate
edited 2 hours ago
Draconis
asked 2 hours ago
DraconisDraconis
2046
2046
Are you aware of this question?
– marmot
1 hour ago
@marmot I was not, but it seems to offer good solutions!
– Draconis
1 hour ago
add a comment |
Are you aware of this question?
– marmot
1 hour ago
@marmot I was not, but it seems to offer good solutions!
– Draconis
1 hour ago
Are you aware of this question?
– marmot
1 hour ago
Are you aware of this question?
– marmot
1 hour ago
@marmot I was not, but it seems to offer good solutions!
– Draconis
1 hour ago
@marmot I was not, but it seems to offer good solutions!
– Draconis
1 hour ago
add a comment |
2 Answers
2
active
oldest
votes
The enumitem
package is your friend. You can define a new list style, which I have called unerate
, and then make this list style use your unary
code. To achieve this it is enough to add the following lines to your code:
letrealItemitem
newcommandunerateItemrefstepcounterunerateirealItem[unaryuneratei]
usepackageenumitem
newlistunerateenumerate1
setlist[unerate]label=alph*, before=letitemunerateItem
So this redefines item
to be unerateItem
and this, in turn, uses the "real" item
with unary
applied to the list environment counter, which is called uneratei
. With this in place, the code
beginunerate
item My text here my text here
item More text more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
endunerate
produces:
Here is the full code:
documentclassarticle
usepackageforloop
usepackagetipa
usepackage[T1]fontenc
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
makeatletter
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
makeatother
letrealItemitem
newcommandunerateItemrefstepcounterunerateirealItem[unaryuneratei]
usepackageenumitem
newlistunerateenumerate1
setlist[unerate]label=alph*, before=letitemunerateItem
begindocument
beginunerate
item My text here my text here
item More text more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
endunerate
enddocument
You can now use enumitem
to style these environments to your heart's content.
The code above will not let you nest unerate
environments. If this is required let me know and I will update it - it's not difficult, but requires a little extra work.
Perfect! I'll wait a bit longer before accepting, but this seems to fulfill my needs perfectly. (As you surmised, I won't need to nest these environments.)
– Draconis
1 hour ago
Actually, one thing to note: this does not work if thehyperref
package is included first. It works fine ifhyperref
is included later, though.
– Draconis
47 mins ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
25 mins ago
add a comment |
I recycled this code and slightly extended it to get
documentclassarticle
usepackagepgffor
newcommandnbullets[2][textbullet]%
foreach X [evaluate=X as Y using int(mod(X,5))]in 1,...,#2
ifnumX>1%
ifnumY=1%
$vert$fi%
fi%
#1
begindocument
renewcommandlabelenuminbulletsvalueenumi
beginenumerate
item first
item second
item third
item fourth
item fifth
item sixth
item seventh
item last
endenumerate
Nestable:
renewcommandlabelenumiinbullets[*]valueenumii
beginenumerate
item first
item second
beginenumerate
item a
item b
item c
item d
item e
item f
endenumerate
item third
item fourth
item fifth
item sixth
item seventh
item last
endenumerate
enddocument
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%2f491681%2funary-enumeration%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
The enumitem
package is your friend. You can define a new list style, which I have called unerate
, and then make this list style use your unary
code. To achieve this it is enough to add the following lines to your code:
letrealItemitem
newcommandunerateItemrefstepcounterunerateirealItem[unaryuneratei]
usepackageenumitem
newlistunerateenumerate1
setlist[unerate]label=alph*, before=letitemunerateItem
So this redefines item
to be unerateItem
and this, in turn, uses the "real" item
with unary
applied to the list environment counter, which is called uneratei
. With this in place, the code
beginunerate
item My text here my text here
item More text more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
endunerate
produces:
Here is the full code:
documentclassarticle
usepackageforloop
usepackagetipa
usepackage[T1]fontenc
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
makeatletter
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
makeatother
letrealItemitem
newcommandunerateItemrefstepcounterunerateirealItem[unaryuneratei]
usepackageenumitem
newlistunerateenumerate1
setlist[unerate]label=alph*, before=letitemunerateItem
begindocument
beginunerate
item My text here my text here
item More text more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
endunerate
enddocument
You can now use enumitem
to style these environments to your heart's content.
The code above will not let you nest unerate
environments. If this is required let me know and I will update it - it's not difficult, but requires a little extra work.
Perfect! I'll wait a bit longer before accepting, but this seems to fulfill my needs perfectly. (As you surmised, I won't need to nest these environments.)
– Draconis
1 hour ago
Actually, one thing to note: this does not work if thehyperref
package is included first. It works fine ifhyperref
is included later, though.
– Draconis
47 mins ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
25 mins ago
add a comment |
The enumitem
package is your friend. You can define a new list style, which I have called unerate
, and then make this list style use your unary
code. To achieve this it is enough to add the following lines to your code:
letrealItemitem
newcommandunerateItemrefstepcounterunerateirealItem[unaryuneratei]
usepackageenumitem
newlistunerateenumerate1
setlist[unerate]label=alph*, before=letitemunerateItem
So this redefines item
to be unerateItem
and this, in turn, uses the "real" item
with unary
applied to the list environment counter, which is called uneratei
. With this in place, the code
beginunerate
item My text here my text here
item More text more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
endunerate
produces:
Here is the full code:
documentclassarticle
usepackageforloop
usepackagetipa
usepackage[T1]fontenc
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
makeatletter
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
makeatother
letrealItemitem
newcommandunerateItemrefstepcounterunerateirealItem[unaryuneratei]
usepackageenumitem
newlistunerateenumerate1
setlist[unerate]label=alph*, before=letitemunerateItem
begindocument
beginunerate
item My text here my text here
item More text more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
endunerate
enddocument
You can now use enumitem
to style these environments to your heart's content.
The code above will not let you nest unerate
environments. If this is required let me know and I will update it - it's not difficult, but requires a little extra work.
Perfect! I'll wait a bit longer before accepting, but this seems to fulfill my needs perfectly. (As you surmised, I won't need to nest these environments.)
– Draconis
1 hour ago
Actually, one thing to note: this does not work if thehyperref
package is included first. It works fine ifhyperref
is included later, though.
– Draconis
47 mins ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
25 mins ago
add a comment |
The enumitem
package is your friend. You can define a new list style, which I have called unerate
, and then make this list style use your unary
code. To achieve this it is enough to add the following lines to your code:
letrealItemitem
newcommandunerateItemrefstepcounterunerateirealItem[unaryuneratei]
usepackageenumitem
newlistunerateenumerate1
setlist[unerate]label=alph*, before=letitemunerateItem
So this redefines item
to be unerateItem
and this, in turn, uses the "real" item
with unary
applied to the list environment counter, which is called uneratei
. With this in place, the code
beginunerate
item My text here my text here
item More text more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
endunerate
produces:
Here is the full code:
documentclassarticle
usepackageforloop
usepackagetipa
usepackage[T1]fontenc
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
makeatletter
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
makeatother
letrealItemitem
newcommandunerateItemrefstepcounterunerateirealItem[unaryuneratei]
usepackageenumitem
newlistunerateenumerate1
setlist[unerate]label=alph*, before=letitemunerateItem
begindocument
beginunerate
item My text here my text here
item More text more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
endunerate
enddocument
You can now use enumitem
to style these environments to your heart's content.
The code above will not let you nest unerate
environments. If this is required let me know and I will update it - it's not difficult, but requires a little extra work.
The enumitem
package is your friend. You can define a new list style, which I have called unerate
, and then make this list style use your unary
code. To achieve this it is enough to add the following lines to your code:
letrealItemitem
newcommandunerateItemrefstepcounterunerateirealItem[unaryuneratei]
usepackageenumitem
newlistunerateenumerate1
setlist[unerate]label=alph*, before=letitemunerateItem
So this redefines item
to be unerateItem
and this, in turn, uses the "real" item
with unary
applied to the list environment counter, which is called uneratei
. With this in place, the code
beginunerate
item My text here my text here
item More text more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
endunerate
produces:
Here is the full code:
documentclassarticle
usepackageforloop
usepackagetipa
usepackage[T1]fontenc
newcommandxxdottextbullet % The dot character to use
newcounterloopcntr % A one-off counter for forloop
newcommandxxdots[1]% Print #1 dots in a row
ifthenelse#1>5% If there are more than five, break them into groups
xxdots5textpipexxdotsnumbernumexpr#1-5relax% By printing five, then a pipe, then the rest
% Otherwise, just print that many dots
forlooploopcntr0valueloopcntr<#1xxdot%
%
newcommandxdots[1]textnormalxxdots#1 % Wrap it in textnormal style
makeatletter
newcommand*unary[1]expandafter@unarycsname c@#1endcsname
newcommand*@unary[1]xdotsthenumexpr#1relax
makeatother
letrealItemitem
newcommandunerateItemrefstepcounterunerateirealItem[unaryuneratei]
usepackageenumitem
newlistunerateenumerate1
setlist[unerate]label=alph*, before=letitemunerateItem
begindocument
beginunerate
item My text here my text here
item More text more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
item Even more text
endunerate
enddocument
You can now use enumitem
to style these environments to your heart's content.
The code above will not let you nest unerate
environments. If this is required let me know and I will update it - it's not difficult, but requires a little extra work.
edited 1 hour ago
answered 1 hour ago
AndrewAndrew
33.1k34685
33.1k34685
Perfect! I'll wait a bit longer before accepting, but this seems to fulfill my needs perfectly. (As you surmised, I won't need to nest these environments.)
– Draconis
1 hour ago
Actually, one thing to note: this does not work if thehyperref
package is included first. It works fine ifhyperref
is included later, though.
– Draconis
47 mins ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
25 mins ago
add a comment |
Perfect! I'll wait a bit longer before accepting, but this seems to fulfill my needs perfectly. (As you surmised, I won't need to nest these environments.)
– Draconis
1 hour ago
Actually, one thing to note: this does not work if thehyperref
package is included first. It works fine ifhyperref
is included later, though.
– Draconis
47 mins ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
25 mins ago
Perfect! I'll wait a bit longer before accepting, but this seems to fulfill my needs perfectly. (As you surmised, I won't need to nest these environments.)
– Draconis
1 hour ago
Perfect! I'll wait a bit longer before accepting, but this seems to fulfill my needs perfectly. (As you surmised, I won't need to nest these environments.)
– Draconis
1 hour ago
Actually, one thing to note: this does not work if the
hyperref
package is included first. It works fine if hyperref
is included later, though.– Draconis
47 mins ago
Actually, one thing to note: this does not work if the
hyperref
package is included first. It works fine if hyperref
is included later, though.– Draconis
47 mins ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
25 mins ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
25 mins ago
add a comment |
I recycled this code and slightly extended it to get
documentclassarticle
usepackagepgffor
newcommandnbullets[2][textbullet]%
foreach X [evaluate=X as Y using int(mod(X,5))]in 1,...,#2
ifnumX>1%
ifnumY=1%
$vert$fi%
fi%
#1
begindocument
renewcommandlabelenuminbulletsvalueenumi
beginenumerate
item first
item second
item third
item fourth
item fifth
item sixth
item seventh
item last
endenumerate
Nestable:
renewcommandlabelenumiinbullets[*]valueenumii
beginenumerate
item first
item second
beginenumerate
item a
item b
item c
item d
item e
item f
endenumerate
item third
item fourth
item fifth
item sixth
item seventh
item last
endenumerate
enddocument
add a comment |
I recycled this code and slightly extended it to get
documentclassarticle
usepackagepgffor
newcommandnbullets[2][textbullet]%
foreach X [evaluate=X as Y using int(mod(X,5))]in 1,...,#2
ifnumX>1%
ifnumY=1%
$vert$fi%
fi%
#1
begindocument
renewcommandlabelenuminbulletsvalueenumi
beginenumerate
item first
item second
item third
item fourth
item fifth
item sixth
item seventh
item last
endenumerate
Nestable:
renewcommandlabelenumiinbullets[*]valueenumii
beginenumerate
item first
item second
beginenumerate
item a
item b
item c
item d
item e
item f
endenumerate
item third
item fourth
item fifth
item sixth
item seventh
item last
endenumerate
enddocument
add a comment |
I recycled this code and slightly extended it to get
documentclassarticle
usepackagepgffor
newcommandnbullets[2][textbullet]%
foreach X [evaluate=X as Y using int(mod(X,5))]in 1,...,#2
ifnumX>1%
ifnumY=1%
$vert$fi%
fi%
#1
begindocument
renewcommandlabelenuminbulletsvalueenumi
beginenumerate
item first
item second
item third
item fourth
item fifth
item sixth
item seventh
item last
endenumerate
Nestable:
renewcommandlabelenumiinbullets[*]valueenumii
beginenumerate
item first
item second
beginenumerate
item a
item b
item c
item d
item e
item f
endenumerate
item third
item fourth
item fifth
item sixth
item seventh
item last
endenumerate
enddocument
I recycled this code and slightly extended it to get
documentclassarticle
usepackagepgffor
newcommandnbullets[2][textbullet]%
foreach X [evaluate=X as Y using int(mod(X,5))]in 1,...,#2
ifnumX>1%
ifnumY=1%
$vert$fi%
fi%
#1
begindocument
renewcommandlabelenuminbulletsvalueenumi
beginenumerate
item first
item second
item third
item fourth
item fifth
item sixth
item seventh
item last
endenumerate
Nestable:
renewcommandlabelenumiinbullets[*]valueenumii
beginenumerate
item first
item second
beginenumerate
item a
item b
item c
item d
item e
item f
endenumerate
item third
item fourth
item fifth
item sixth
item seventh
item last
endenumerate
enddocument
edited 1 hour ago
answered 1 hour ago
marmotmarmot
128k6162308
128k6162308
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%2f491681%2funary-enumeration%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
Are you aware of this question?
– marmot
1 hour ago
@marmot I was not, but it seems to offer good solutions!
– Draconis
1 hour ago