LaTeX forum ⇒ OthersAcro package: Handling possessive case (apostrophe s)

Information and discussion about other TeX distributions not listed above; installation, administration; field reports
JustA_LaTeXusr
Posts: 41
Joined: Tue Jul 23, 2013 6:48 pm

Acro package: Handling possessive case (apostrophe s)

Postby JustA_LaTeXusr » Wed Jul 23, 2014 10:10 pm

The current v1.5 acro package (http://bitbucket.org/cgnieder/acro/wiki/Home, not the same as the also-popular acronym package) does not have an acronym invocation that automatically takes care of the possessive case, i.e., when the noun for which the acronym is followed immediately by an apostrophe "s". Some web search reveals some material that might be adaptable to handle the case, e.g., http://hstuart.dk/2007/08/03/programming-latex-—-writing-commands, but adapting it to the acro package will require much more knowledge of tex programming under-the-hood than I currently have. I realize that the knowledge can be acquired, but unfortunately, I have to make choices based on my timelines as well. This means rewording an otherwise efficiently constructed sentence to avoid apostrophe "s".

Would this be trivial for someone to adapt for the acro package?

This has been posted to:
viewtopic.php?f=15&t=24989
http://tex.stackexchange.com/questions/ ... ostrophe-s

Tags:

User avatar
cgnieder
Site Moderator
Posts: 1974
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Fri Sep 18, 2015 3:00 pm

Here's my answer on TeX.se:

Since v2.0 acro has a concept of endings. It handles the plural forms this way and allows the definition of additional endings:

  1. \ProvideAcroEnding{possessive}{'s}{'s}


This defines a lower level command \acro_possessive: which can be used to define new acro commands and defines a number of options to set the endings individually for certain acronyms.

Here is a complete example that also shows how to define suitable commands for acro.

  1. \documentclass{article}
  2. \usepackage{acro}
  3.  
  4. \ProvideAcroEnding {possessive} {'s} {'s}
  5.  
  6. \ExplSyntaxOn
  7. \NewAcroCommand \acg
  8. {
  9. \acro_possessive:
  10. \acro_use:n {#1}
  11. }
  12. \NewAcroCommand \acsg
  13. {
  14. \acro_possessive:
  15. \acro_short:n {#1}
  16. }
  17. \NewAcroCommand \aclg
  18. {
  19. \acro_possessive:
  20. \acro_long:n {#1}
  21. }
  22. \ExplSyntaxOff
  23.  
  24. \DeclareAcronym{MP}{
  25. short = MP ,
  26. long = Member of Parliament ,
  27. long-plural-form = Members of Parliament ,
  28. long-possessive-form = Member's of Parliament
  29. }
  30.  
  31. \DeclareAcronym{cd}{
  32. short = CD ,
  33. long = compact disc
  34. }
  35.  
  36. \begin{document}
  37.  
  38. first: \acg{cd}; \acg{MP}
  39.  
  40. short: \acsg{cd}; \acsg{MP}
  41.  
  42. long: \aclg{cd}; \aclg{MP}
  43.  
  44. \end{document}


Note that several endings can't really be applied to an acronym. If we were to define

  1. \NewAcroCommand \acpg
  2. {
  3. \acro_possessive:
  4. \acro_plural:
  5. \acro_use:n {#1}
  6. }


we'd get CDs's
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim


Return to “Others”

Who is online

Users browsing this forum: No registered users and 1 guest