I'm trying to make macro to work in biblatex edition field.
Logic is following:
- if edition =1 there is suffix -li (1-li)
- if edition>1 and if edition<21 there is prefix me- (me-15,me-20 ..etc)
- if edition = 40,60,80,100,200,...1000 there is also prefix me-
- in other cases suffix -e (31-e, 21-e, 129-e, 1010-e)
here is a code which works:
\protected\def\mkbibmascord#1{%
\ifnum #1=1 #1-li \else %
\ifnum #1<21 %
\ifnum #1>1 me-#1 \fi \else %
\ifnum #1 = 40 me-#1 \else%
\ifnum #1 = 60 me-#1 \else%
\ifnum #1 = 80 me-#1 \else%
\ifnum #1 = 100 me-#1 \else %
\ifnum #1 = 200 me-#1 \else %
#1-e
\fi\fi\fi\fi\fi\fi\fi%
}%
\protected\def\mkbibordinal{\mkbibmascord}%
\protected\def\mkbibfemord{\mkbibmascord}%
\protected\def\mkbibneutord{\mkbibmascord}%
but how can i write general code/improve above code? (not only for 200), becouse let say for calendar there will be alot if/fi-s


\ifnumbranching is probably the best you can do. – Steven B. Segletes Aug 18 '15 at 15:10break,and,==' (equality) commands orcase`(like \case{n}) switch :) .. Isearch 'math in tex' but search gives just how to write mathequations, not TeX aritmetic :)...I need to learn more :) – Levan Shoshiashvili Aug 18 '15 at 15:39\ifnum #1<21 % me-#1 \else %– Levan Shoshiashvili Aug 18 '15 at 16:05