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
Is a world with one country feeding everyone possible?
(For training purposes) Are there any openings with rook pawns that are more effective than others (and if so, what are they)?
How to eliminate gap at the start and at the end of a line when it's drawn along a side of a node's bounding box?
Coloring lines in a graph the same color if they are the same length
Download app bundles from App Store to run on iOS Emulator on Mac
Are there historical examples of audiences drawn to a work that was "so bad it's good"?
Unary Enumeration
Proto-Indo-European (PIE) words with IPA
Real Analysis: Proof of the equivalent definitions of the derivative.
What defines a person who is circumcised "of the heart"?
Goldfish unresponsive, what should I do?
Would this be a dangerous impeller to use for a drone?
Salesforce bug enabled "Modify All"
Can a UK national work as a paid shop assistant in the USA?
Can the Conjure Barrage spell stack with the Disarming Attack or Trip Attack Battle Master maneuvers?
Why is 'additive' EQ more difficult to use than 'subtractive'?
Meaning of "half-crown enclosure"
Is it normal to "extract a paper" from a master thesis?
How to become an Editorial board member?
Why do testers need root cause analysis?
VHDL: Why is it hard to design a floating point unit in hardware?
One word for 'the thing that attracts me'?
What is this dime sized black bug with white on the segments near Loveland Colorodao?
Adobe Illustrator: How can I change the profile of a dashed stroke?
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
2 hours 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 3 hours ago
DraconisDraconis
2096
2096
Are you aware of this question?
– marmot
2 hours 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
2 hours ago
@marmot I was not, but it seems to offer good solutions!
– Draconis
1 hour ago
Are you aware of this question?
– marmot
2 hours ago
Are you aware of this question?
– marmot
2 hours 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
1 hour ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
1 hour 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
1 hour ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
1 hour 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
1 hour ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
1 hour 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 2 hours ago
answered 2 hours 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
1 hour ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
1 hour 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
1 hour ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
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
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
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
1 hour ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
1 hour ago
@DraconisAccording to its manual, you should always load hyperref last :)
– Andrew
1 hour 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 2 hours 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
2 hours ago
@marmot I was not, but it seems to offer good solutions!
– Draconis
1 hour ago