Reset a renewcommand

1,153

Not a real fix but rather a workaround where you avoid using \item in the environment:

Example

main.tex:

\documentclass{eventListTest}
\usepackage[ampersand]{easylist}

\begin{document}

\begin{eventlist}
\item{Data range}
     {Company}
     {Role}

  Description of what achieved during this application.\\
   \begin{easylist}[enumerate]
      & Foo~:
      && Sub item.
      && Another sub item.
      & Bar~:
    \end{easylist}
\end{eventlist}
\end{document}

Class: eventListTest.cls

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{eventListTest}

\LoadClass[10pt]{scrartcl}

\RequirePackage[hmargin=1.25cm,vmargin=1.25cm,twocolumn,columnsep=1.25cm]{geometry}
\RequirePackage{bookman,etoolbox,hyperref,marvosym,needspace,tabularx,xcolor}

\newenvironment{eventlist}{%
    \newcommand*\inskip{}
    \renewcommand\item[3]{%
    \inskip%
    {\raggedleft\sc ##1\\[1pt]}
    {##2}\\[2pt]
    {\Large\it ##3}
    \medskip
    \renewcommand\inskip{\bigskip}}}
    {\bigskip}

More information about easylist

enter image description here

EDITED: Added an example.

Share:
1,153

Related videos on Youtube

Noob
Author by

Noob

Updated on February 03, 2020

Comments

  • Noob
    Noob almost 4 years

    I have found a Resumé template in Latex. I would like to change the following part of the template but my knowledge of Latex is not that extended.

    % Every \item can be followed by one or more paragraphs
    % of description:
    %
    % |[
    % \item{date range}{company}{role}
    %
    % Description of what achieved during this application.
    % ]|
    \newenvironment{eventlist}{%
        \newcommand*\inskip{}
        \renewcommand\item[3]{%
        \inskip%
        {\raggedleft\sc ##1\\[1pt]}
        {##2}\\[2pt]
        {\Large\it ##3}
        \medskip
        \renewcommand\inskip{\bigskip}}}
        {\bigskip}
    

    I would like to add (optional) an enumerate in the description. Like this:

    % |[
    % \item{date range}{company}{role}
    %
    % Description of what achieved during this application.
    %    \begin{enumerate}
    %      \item Foo
    %      \item Bar
    %    \end{enumerate}
    % More description of what achieved during this application.
    % ]|
    

    How would you do this? Is this even possible because the \item is redefined if I'm correct?

    • Admin
      Admin almost 9 years
      I don't not advise to use those latextemplate stuff. They contain a lot of errors, actually.
    • cfr
      cfr almost 9 years
      Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    • cfr
      cfr almost 9 years
      @ChristianHupfer Did you mean 'I don't recommend using that latextemplate stuff. ...'? Or 'I recommend not using...'?
    • cfr
      cfr almost 9 years
      Based only on that snippet, I would recommend avoiding this template! It is using commands which were deprecated 20+ years ago, and needlessly redefining a key LaTeX command.
    • Admin
      Admin almost 9 years
      @cfr: Damned typo of mine... I meant "I don't advise to use .." ... Thanks!
    • egreg
      egreg almost 9 years
      Just change \renewcommand\item into \newcommand\event in the definition of eventlist and use \event in those cases; then you'll be able to use \item in the enumerate.
  • Admin
    Admin almost 9 years
    Welcome to TeX.SX! Can you elaborate on your answer, i.e. providing a full example and a screen shot?
  • cfr
    cfr almost 9 years
    Can you update the code to use LaTeX2e font commands? \it and \sc are long deprecated, for example, and ought not be used.