Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.

Bug Tracker RSS feed

I’m currently working on a major new version of the datatool package. This may take a while. Please be patient. (Experimental version available for testing.)

ID 75🔗
Date: 2014-11-25 08:33:44
Status Closed (Fixed)
Category datatool
Version v2.22
Summary Package person.sty contains bugs

Sign in to subscribe to notifications about this report.

Description

The package person.sty contains several bugs. I found it necessary to redefine the following macros: \persongender, \getpersongender, \ifmale, \iffemale See MWE attached.

MWE

Download (3.23K)

\listfiles
\documentclass{article}

\usepackage{person}

\renewcommand*{\persongender}[1]{%
   \ifmale{#1}{\malename}{\femalename}%
}
\renewcommand*{\getpersongender}[2]{%
   \ifmale{#2}{\let#1\malename}{\let#1\femalename}%
}
\makeatletter
\renewcommand{\ifmale}[3]{%
   \ifpersonexists{#1}%
   {%
      \edef\@gender{\csname person@#1@gender\endcsname}%
      \ifx\@gender\@male@label
        #2%
      \else
        #3%
      \fi
   }%
   {%
      \PackageError{person}{Person `#1' doesn't exist.}{}%
   }%
}
\renewcommand{\iffemale}[3]{%
   \ifpersonexists{#1}%
   {%
      \edef\@gender{\csname person@#1@gender\endcsname}%
      \ifx\@gender\@female@label
        #2%
      \else
        #3%
      \fi
   }%
   {%
      \PackageError{person}{Person `#1' doesn't exist.}{}%
   }%
}
\makeatother

\newcommand*{\myLabel}{firstMan}%
\newperson[\myLabel]{Adam I.}{Adam}{male}

\begin{document}

  \section{Test}

  Test \verb+\foreachperson+:\par
  \bfseries{}%
  PersName,PersFullName,PersGender,PersLabel\par%
  \normalfont{}%
  \foreachperson(\myPersName,\myPersFullName,\myPersGender,\myPersLabel) \do {%
    \myPersName,\myPersFullName,\myPersGender,\myPersLabel\par%
  }

  \noindent%
  Test \verb+\getpersongender+:\par
  \getpersonname{\myPersNameNew}{\myLabel}
  \getpersonfullname{\myPersFullNameNew}{\myLabel}
  \getpersongender{\myPersGenderNew}{\myLabel}\par
  Name of \myLabel: \myPersNameNew\par
  Full name of \myLabel: \myPersFullNameNew\par
  Gender of \myLabel: \myPersGenderNew\par

  \noindent%
  Test \verb+\ifmale+:\par
  Gender of \personname[\myLabel]: \ifmale{\myLabel}{\malename}{\femalename}\par

  \noindent%
  Test \verb+\iffemale+:\par
  Gender of \personname[\myLabel]: \iffemale{\myLabel}{\femalename}{\malename}\par

  \section{File list}

  \small%
  \begin{verbatim}
     *File List*
     article.cls    2014/09/29 v1.4h Standard LaTeX document class
      size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
      person.sty    2013/06/28 v2.14 (NLCT)
      ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
    datatool.sty    2014/06/10 v2.22 (NLCT)
     xkeyval.sty    2014/05/25 v2.7 package option processing (HA)
     xkeyval.tex    2014/05/25 v2.7 key=value parser (HA)
        xfor.sty    2009/02/05 v1.05 (NLCT)
      substr.sty    2009/10/20 v1.2 Handle substrings
    etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX
        etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
    datatool-base.sty    2014/06/10 v2.22 (NLCT)
     amsmath.sty    2013/01/14 v2.14 AMS math features
     amstext.sty    2000/06/29 v2.01
      amsgen.sty    1999/11/30 v2.0
      amsbsy.sty    1999/11/29 v1.2d
      amsopn.sty    1999/12/14 v2.01 operator names
    datatool-fp.sty    2013/08/29 v2.17 (NLCT)
          fp.sty    1995/04/02
    defpattern.sty    1994/10/12
    fp-basic.sty    1996/05/13
    fp-addons.sty    1995/03/15
     fp-snap.sty    1995/04/05
      fp-exp.sty    1995/04/03
    fp-trigo.sty    1995/04/14
      fp-pas.sty    1994/08/29
    fp-random.sty    1995/02/23
      fp-eqn.sty    1995/04/03
      fp-upn.sty    1996/10/21
     fp-eval.sty    1995/04/03
  \end{verbatim}

\end{document}

Evaluation

Fixed in v2.23.

Comments

0 comments.


Add Comment

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account.

Comment:


You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

Ordered list:
[ol]
[li]first item[/li]
[li]second item[/li]
[/ol]

Unordered list:
[ul]
[li]first item[/li]
[li]second item[/li]
[/ul]

You can use the Preview button to review your message formatting before submitting.

Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=75