Text FormattingSimple Removal of Period from Enumerated List

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
surrix
Posts: 9
Joined: Sun Nov 08, 2009 7:07 pm

Simple Removal of Period from Enumerated List

Post by surrix »

Hey all,

I'm using the following code to add brackets in an enumerated list:

Code: Select all

\renewcommand{\theenumi}{[\arabic{enumi}]}
The result is this:
[1]. Stuff
[2]. Stuff
Is there a simple way to remove the periods ideally (but not necessarily) without resorting to additional packages? I want this:
[1] Stuff
[2] Stuff
Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Simple Removal of Period from Enumerated List

Post by frabjous »

Why don't you want to load additional packages?

With enumitem loaded, it's this:

Code: Select all

\begin{enumerate}[label={[\arabic*]}]
\item One
\item Two
\end{enumerate}
If you don't want to load enumitem, probably you'd need to say what document class you were using -- and it wouldn't be "simple".
surrix
Posts: 9
Joined: Sun Nov 08, 2009 7:07 pm

Simple Removal of Period from Enumerated List

Post by surrix »

frabjous wrote:Why don't you want to load additional packages?

With enumitem loaded, it's this:

Code: Select all

\begin{enumerate}[label={[\arabic*]}]
\item One
\item Two
\end{enumerate}
If you don't want to load enumitem, probably you'd need to say what document class you were using -- and it wouldn't be "simple".
That actually works great. Better than I was expecting. Thanks.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Simple Removal of Period from Enumerated List

Post by localghost »

The approach without any package is very similar to yours.

Code: Select all

\renewcommand{\labelenumi}{[\arabic{enumi}]}

Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Simple Removal of Period from Enumerated List

Post by phi »

localghost wrote:The approach without any package is very similar to yours.

Code: Select all

\renewcommand{\labelenumi}{[\arabic{enumi}]}
That works, but usually you define \labelenumi in terms of \theenumi:

Code: Select all

\renewcommand*{\labelenumi}{\theenumi}
Post Reply