Text Formattingacronym | Possessive Cases

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
cbkschroeder
Posts: 55
Joined: Sun Nov 09, 2008 7:48 pm

acronym | Possessive Cases

Post by cbkschroeder »

Hi,

I am using the acronym package - which works very well for me - except I think I might not be completely clear on something: possessive cases.

Acronym has the ability to do plurals well, but possessives *I think* are not so good. Probably this needs me to pick people's brains more than anything: how do people handle possessive cases?

Example, single possessive, first use:
... so we discover the Analog-to-Digital Converter's (ADC's) least significant bit...
Example, single possessive, subsequent use:
... so we discover the ADC's least significant bit...
Example, plural possessive, first use:
... thus it is generally found that the Analog-to-Digital Converters' (ADCs') power supply is...
Example, plural possessive, subsequent use:
... thus it is generally found that the ADCs' power supply is...
Does acronym natively handle this and I'm missing it? I don't think that's the case, but I'm listening! Anyhow, what could be done?

Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

hcbrown
Posts: 1
Joined: Wed Feb 29, 2012 4:53 pm

acronym | Possessive Cases

Post by hcbrown »

I realize this is an old post, but maybe this will help someone else.

Edit your acronym.sty file (in my ubuntu installation it's under /usr/share/texmf-texlive/tex/latex/acronym/) to include the following lines...

Around line 130 you should see a bunch of /def lines. After /def/acp#1... add this:

Code: Select all

      \def\acpos#1{\AChy@call{#1}\@acpos}%
Then add the next section after the

Code: Select all

\newcommand{\@acp}[1]{
block of code.

Code: Select all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Posessive code
\newcommand*{\acpos}{\AC@starredfalse\protect\@acpos}%
\WithSuffix\newcommand\acpos*{\AC@starredtrue\protect\@acpos}%
\newcommand{\@acpos}[1]{%
  \ifAC@dua
     \ifAC@starred\aclpos*{#1}\else\aclpos{#1}\fi%
  \else
   \expandafter\ifx\csname ac@#1\endcsname\AC@used
      \ifAC@starred\acspos*{#1}\else\acspos{#1}\fi%
   \else
      \ifAC@starred\acfpos*{#1}\else\acfpos{#1}\fi%
   \fi
  \fi}


\newcommand*{\acspos}{\AC@starredfalse\protect\acspaos}%
\WithSuffix\newcommand\acspos*{\AC@starredtrue\protect\acspaos}%
\newcommand*{\acspaos}[1]{%
   \texorpdfstring{\protect\@acspos{#1}}{#1's}}
\newcommand*{\@acspos}[1]{%
   \acsfont{\AC@acs{#1}'s}%
   \ifAC@starred\else\AC@logged{#1}\fi}

\newcommand*{\aclpos}{\AC@starredfalse\protect\@aclpos}%
\WithSuffix\newcommand\aclpos*{\AC@starredtrue\protect\@aclpos}%
\newcommand*{\@aclpos}[1]{%
   \AC@aclos{#1}'s%
   \ifAC@starred\else\AC@logged{#1}\fi}


\newcommand*{\acfpos}{\AC@starredfalse\protect\acfpaos}%
\WithSuffix\newcommand\acfpos*{\AC@starredtrue\protect\acfpaos}%
\newcommand*{\acfpaos}[1]{%
   \texorpdfstring{\protect\@acfpos{#1}}{\AC@acl{#1}'s (#1's)}}
\newcommand*{\@acfpos}[1]{%
   \ifAC@footnote
      \acsfont{\AC@acs{#1}'s}%
      \footnote{\AC@placelabel{#1}\AC@acl{#1}'s{}}%
   \else
      \acffont{%
         \AC@placelabel{#1}\AC@acl{#1}'s%
         \nolinebreak[3] %
         \acfsfont{(\acsfont{\AC@acs{#1}'s})}%
         }%
   \fi
   \ifAC@starred\else\AC@logged{#1}\fi}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


If necessary, rebuild your package list (something like

Code: Select all

sudo mktexlsr
).

Now, in your TEX file, just use \acpos{acronym} to insert the posessive form.

Example:
My acronym is NDBC (National Data Buoy Center). If I want to write the sentence: "The NDBC's buoy is great." I would add the TeX line:

Code: Select all

The \acpos{NDBC} buoy is great.
Sure, this code could probably be cleaned up and optimized, but it works and wasn't a lot of effort. Good luck!
cmelog
Posts: 1
Joined: Fri Jan 20, 2017 4:43 pm

acronym | Possessive Cases

Post by cmelog »

Thanks hcbrown I already used your code to implement the acronym possessives. I wonder if you can provide support to create a command to make the first letter of the long description of the acronyms upper case. I need this for the list of the acronyms that I am using for my thesis proposal. Thanks in advance.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

acronym | Possessive Cases

Post by Stefan Kottwitz »

Hi cmelog,

welcome to the forum!

Perhaps post your question as a new topic, with all meaningful information. You can add a link to here.

It would be more visible to all.

Stefan
LaTeX.org admin
Post Reply