[NTG-context] Can I simplify this to some sort of logic so it scales better?

Gerben Wierda gerben.wierda at rna.nl
Mon Jun 6 13:34:22 CEST 2022


I have this:

\definemode[EN,FR,RU,PT][keep]
\doifmodeelse{EN}
  {
    \disablemode[FR]
    \disablemode[RU]
    \disablemode[PT]
  }
  {
    \doifmodeelse{FR}
    {
      \disablemode[EN]
      \disablemode[RU]
      \disablemode[PT]
    }
    {
      \doifmodeelse{RU}
      {
        \disablemode[EN]
        \disablemode[FR]
        \disablemode[PT]
      }
      {
        \doifmodeelse{PT}
        {
          \disablemode[EN]
          \disablemode[FR]
          \disablemode[RU]
        }
        {
          \enablemode[EN]
        }
      }
    }
  }

But for every language added this becomes more and more complex. I was wondering what would be a good approach to simplify it. 

I want to make sure that one and only one of these modes is active and that if no mode is entered on the command line the mode is EN.

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>)
R&A IT Strategy <https://ea.rna.nl/> (main site)
Book: Chess and the Art of EnterpriseĀ Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220606/6fece77d/attachment.htm>


More information about the ntg-context mailing list