2

Is there a way to define custom named styles with easylist? I am aware of using

\ListProperties()

to define an easylist style in the document and you can globally define an easylist style for all easylist lists as described here.

I am wondering if there is a way in the preamble to define custom easylist styles and give them names so I can call multiple custom styles in my document without defining them everytime. I am aware that there are already predefined styles that can be called on by

\begin{easylist}[enumerate]

or

\begin{easylist}[checklist]

but what I would like to do is to be able to call

\begin{easylist}[mystyle1]

and then

\begin{easylist[mystyle2]

where mystyle1 and mystyle2 are globally accessible predefined styles.

Thanks in advance!

1
  • it is possible, but only if you redefine internal commands of easylist, the package itself has not code for such a style system. Commented Jun 19, 2017 at 20:28

1 Answer 1

1

You can build a wrapper around easylist.

\documentclass{article}
\usepackage[at]{easylist}
\usepackage{xcolor}

\def\definemyeasylist#1#2{\expandafter\def\csname myeasylist@style@#1\endcsname{\NewList(#2)}}
\def\myeasylist{\futurelet\next\domyeasylist}
\def\domyeasylist{\ifx[\next\expandafter\domyeasylistone\else\expandafter\domyeasylistnop\fi}
\def\domyeasylistone[#1]{\begin{easylist}\if\relax\detokenize{#1}\relax\else\csname myeasylist@style@#1\endcsname\fi}
\def\domyeasylistnop{\begin{easylist}\NewList}
\def\endmyeasylist{\end{easylist}}

\definemyeasylist{mystyle}{Progressive*=3ex, Start1=2,Style*=\color{green!60!black}}

\begin{document}

\begin{myeasylist}[mystyle]
  @ item1
  @ item2
  @ item3
\end{myeasylist}

\begin{myeasylist}
  @ item1
  @ item2
  @ item3
\end{myeasylist}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .