Glossaries: introduce short name only if used more than once within section/chapter/partUsing the glossaries...

How to push a box with physics engine by another object?

Predict mars robot position

What can I substitute for soda pop in a sweet pork recipe?

What is better: yes / no radio, or simple checkbox?

Wanted: 5.25 floppy to usb adapter

What's a good word to describe a public place that looks like it wouldn't be rough?

Why is this code uniquely decodable?

Why do neural networks need so many training examples to perform?

Naming things the POV character doesn't know

Finding the number of integers that are a square and a cube at the same time

Proof by Induction - New to proofs

Is my plan for fixing my water heater leak bad?

Why zero tolerance on nudity in space?

Why is working on the same position for more than 15 years not a red flag?

Criticizing long fiction. How is it different from short?

4 Spheres all touching each other??

Eww, those bytes are gross

Should I choose Itemized or Standard deduction?

Meaning of すきっとした

Could quantum mechanics be necessary to analyze some biology scenarios?

How to acknowledge an embarrassing job interview, now that I work directly with the interviewer?

What is Crew Dragon approaching in this picture?

How do we edit a novel that's written by several people?

Is Draco canonically good-looking?



Glossaries: introduce short name only if used more than once within section/chapter/part


Using the glossaries package for English acronyms in German documentsErrors when using glossaries packageGlossaries: display only long part of acronym in section headline?Ignoring once used glossaries items with full glossaries at each chapterGlossaries header has more above space than other section headingsGlossary per chapter (not by section)glossaries: hyperlink only at the first occurrence in every chapterGlossaries - expand acronyms for first-time use within each chapterAcronyms will only display short version in main text, even the first time they're usedglossaries: acronyms: How to display only the first appearance of an acronym among the Abbreviations if only its short form is used in the text?













0















I would like to obtain the following behavior: If an acronym is only used once within a section/chapter/part, at this occurrence only the long name should be used. If however the acronym is used more than one, I want the long-short behavior.



I have the following non working MWE:



documentclass{book}
usepackage{xparse}
ExplSyntaxOn
NewExpandableDocumentCommand{fpcompare}{ m m m }
{
% #1 = test to perform
% #2 = text for the true case
% #3 = text for the false case
fp_compare:nTF { #1 } { #2 } { #3 }
}
ExplSyntaxOff

usepackage[acronym,symbols,nomain,toc,sanitizesort,nogroupskip,xindy,numberedsection=autolabel]{glossaries-extra}
setglossarystyle{super}
setabbreviationstyle[acronym]{long-short}

GlsXtrEnableEntryUnitCounting{acronym}{1}{section}
%renewcommand*{gls}{cgls}%
%renewcommand*{Gls}{cGls}%
%renewcommand*{glspl}{cglspl}%
%renewcommand*{Glspl}{cGlspl}%
%renewcommand*{GLS}{cGLS}%
%renewcommand*{GLSpl}{cGLSpl}%


makenoidxglossaries
newacronym{wn}{WN}{wireless network}

glsxtrnewsymbol[description={pi},type=symbols]{symb:pi}{ensuremath{pi}}%


usepackage{xstring}
renewcommand*{gls}[1]{%
IfEq{glscategory{#1}}{acronym}{%to apply this to acronym only (and not symbols as well)
fpcompare{glsentrycurrcount{#1} > 1}{glsentrydesc{#1}}{cgls{#1}}% fpcompare to detect how often used
}{%
cgls{#1}%
}%
}%
renewcommand*{Gls}[1]{%
IfEq{glscategory{#1}}{acronym}{%
fpcompare{glsentrycurrcount{#1} > 1}{Glsentrydesc{#1}}{cgls{#1}}%
}{%
cgls{#1}%
}%
}%
renewcommand*{glspl}[1]{%
IfEq{glscategory{#1}}{acronym}{%
fpcompare{glsentrycurrcount{#1} > 1}{glsentryplural{#1}}{cglspl{#1}}%
}{%
cglspl{#1}%
}%
}%
renewcommand*{Glspl}[1]{%
IfEq{glscategory{#1}}{acronym}{%
fpcompare{glsentrycurrcount{#1} > 1}{Glsentryplural{#1}}{cglspl{#1}}%
}{%
cglspl{#1}%
}%
}%
renewcommand*{GLS}[1]{%
IfEq{glscategory{#1}}{acronym}{%
fpcompare{glsentrycurrcount{#1} > 1}{GLSentrydesc{#1}}{cgls{#1}}%
}{%
cgls{#1}%
}%
}%
renewcommand*{GLSpl}[1]{%
IfEq{glscategory{#1}}{acronym}{%
fpcompare{glsentrycurrcount{#1} > 1}{GLSentryplural{#1}}{cglspl{#1}}%
}{%
cglspl{#1}%
}%
}%

begin{document}
section{A}
gls{wn}\
glspl{wn}\
glspl{wn}\
glspl{wn}\
count: glsentrycurrcount{wn}\
gls{symb:pi}
section{B}

glspl{wn}\
count: glsentrycurrcount{wn}

section{C}
Glspl{wn}\
gls{wn}\
count: glsentrycurrcount{wn}
end{document}


which produces:



enter image description here



I however, would have expected/wanted a count of 4 in section A, and in section C, that at first the full description is printed instead of WNs



How to make this work reliably?










share|improve this question





























    0















    I would like to obtain the following behavior: If an acronym is only used once within a section/chapter/part, at this occurrence only the long name should be used. If however the acronym is used more than one, I want the long-short behavior.



    I have the following non working MWE:



    documentclass{book}
    usepackage{xparse}
    ExplSyntaxOn
    NewExpandableDocumentCommand{fpcompare}{ m m m }
    {
    % #1 = test to perform
    % #2 = text for the true case
    % #3 = text for the false case
    fp_compare:nTF { #1 } { #2 } { #3 }
    }
    ExplSyntaxOff

    usepackage[acronym,symbols,nomain,toc,sanitizesort,nogroupskip,xindy,numberedsection=autolabel]{glossaries-extra}
    setglossarystyle{super}
    setabbreviationstyle[acronym]{long-short}

    GlsXtrEnableEntryUnitCounting{acronym}{1}{section}
    %renewcommand*{gls}{cgls}%
    %renewcommand*{Gls}{cGls}%
    %renewcommand*{glspl}{cglspl}%
    %renewcommand*{Glspl}{cGlspl}%
    %renewcommand*{GLS}{cGLS}%
    %renewcommand*{GLSpl}{cGLSpl}%


    makenoidxglossaries
    newacronym{wn}{WN}{wireless network}

    glsxtrnewsymbol[description={pi},type=symbols]{symb:pi}{ensuremath{pi}}%


    usepackage{xstring}
    renewcommand*{gls}[1]{%
    IfEq{glscategory{#1}}{acronym}{%to apply this to acronym only (and not symbols as well)
    fpcompare{glsentrycurrcount{#1} > 1}{glsentrydesc{#1}}{cgls{#1}}% fpcompare to detect how often used
    }{%
    cgls{#1}%
    }%
    }%
    renewcommand*{Gls}[1]{%
    IfEq{glscategory{#1}}{acronym}{%
    fpcompare{glsentrycurrcount{#1} > 1}{Glsentrydesc{#1}}{cgls{#1}}%
    }{%
    cgls{#1}%
    }%
    }%
    renewcommand*{glspl}[1]{%
    IfEq{glscategory{#1}}{acronym}{%
    fpcompare{glsentrycurrcount{#1} > 1}{glsentryplural{#1}}{cglspl{#1}}%
    }{%
    cglspl{#1}%
    }%
    }%
    renewcommand*{Glspl}[1]{%
    IfEq{glscategory{#1}}{acronym}{%
    fpcompare{glsentrycurrcount{#1} > 1}{Glsentryplural{#1}}{cglspl{#1}}%
    }{%
    cglspl{#1}%
    }%
    }%
    renewcommand*{GLS}[1]{%
    IfEq{glscategory{#1}}{acronym}{%
    fpcompare{glsentrycurrcount{#1} > 1}{GLSentrydesc{#1}}{cgls{#1}}%
    }{%
    cgls{#1}%
    }%
    }%
    renewcommand*{GLSpl}[1]{%
    IfEq{glscategory{#1}}{acronym}{%
    fpcompare{glsentrycurrcount{#1} > 1}{GLSentryplural{#1}}{cglspl{#1}}%
    }{%
    cglspl{#1}%
    }%
    }%

    begin{document}
    section{A}
    gls{wn}\
    glspl{wn}\
    glspl{wn}\
    glspl{wn}\
    count: glsentrycurrcount{wn}\
    gls{symb:pi}
    section{B}

    glspl{wn}\
    count: glsentrycurrcount{wn}

    section{C}
    Glspl{wn}\
    gls{wn}\
    count: glsentrycurrcount{wn}
    end{document}


    which produces:



    enter image description here



    I however, would have expected/wanted a count of 4 in section A, and in section C, that at first the full description is printed instead of WNs



    How to make this work reliably?










    share|improve this question



























      0












      0








      0








      I would like to obtain the following behavior: If an acronym is only used once within a section/chapter/part, at this occurrence only the long name should be used. If however the acronym is used more than one, I want the long-short behavior.



      I have the following non working MWE:



      documentclass{book}
      usepackage{xparse}
      ExplSyntaxOn
      NewExpandableDocumentCommand{fpcompare}{ m m m }
      {
      % #1 = test to perform
      % #2 = text for the true case
      % #3 = text for the false case
      fp_compare:nTF { #1 } { #2 } { #3 }
      }
      ExplSyntaxOff

      usepackage[acronym,symbols,nomain,toc,sanitizesort,nogroupskip,xindy,numberedsection=autolabel]{glossaries-extra}
      setglossarystyle{super}
      setabbreviationstyle[acronym]{long-short}

      GlsXtrEnableEntryUnitCounting{acronym}{1}{section}
      %renewcommand*{gls}{cgls}%
      %renewcommand*{Gls}{cGls}%
      %renewcommand*{glspl}{cglspl}%
      %renewcommand*{Glspl}{cGlspl}%
      %renewcommand*{GLS}{cGLS}%
      %renewcommand*{GLSpl}{cGLSpl}%


      makenoidxglossaries
      newacronym{wn}{WN}{wireless network}

      glsxtrnewsymbol[description={pi},type=symbols]{symb:pi}{ensuremath{pi}}%


      usepackage{xstring}
      renewcommand*{gls}[1]{%
      IfEq{glscategory{#1}}{acronym}{%to apply this to acronym only (and not symbols as well)
      fpcompare{glsentrycurrcount{#1} > 1}{glsentrydesc{#1}}{cgls{#1}}% fpcompare to detect how often used
      }{%
      cgls{#1}%
      }%
      }%
      renewcommand*{Gls}[1]{%
      IfEq{glscategory{#1}}{acronym}{%
      fpcompare{glsentrycurrcount{#1} > 1}{Glsentrydesc{#1}}{cgls{#1}}%
      }{%
      cgls{#1}%
      }%
      }%
      renewcommand*{glspl}[1]{%
      IfEq{glscategory{#1}}{acronym}{%
      fpcompare{glsentrycurrcount{#1} > 1}{glsentryplural{#1}}{cglspl{#1}}%
      }{%
      cglspl{#1}%
      }%
      }%
      renewcommand*{Glspl}[1]{%
      IfEq{glscategory{#1}}{acronym}{%
      fpcompare{glsentrycurrcount{#1} > 1}{Glsentryplural{#1}}{cglspl{#1}}%
      }{%
      cglspl{#1}%
      }%
      }%
      renewcommand*{GLS}[1]{%
      IfEq{glscategory{#1}}{acronym}{%
      fpcompare{glsentrycurrcount{#1} > 1}{GLSentrydesc{#1}}{cgls{#1}}%
      }{%
      cgls{#1}%
      }%
      }%
      renewcommand*{GLSpl}[1]{%
      IfEq{glscategory{#1}}{acronym}{%
      fpcompare{glsentrycurrcount{#1} > 1}{GLSentryplural{#1}}{cglspl{#1}}%
      }{%
      cglspl{#1}%
      }%
      }%

      begin{document}
      section{A}
      gls{wn}\
      glspl{wn}\
      glspl{wn}\
      glspl{wn}\
      count: glsentrycurrcount{wn}\
      gls{symb:pi}
      section{B}

      glspl{wn}\
      count: glsentrycurrcount{wn}

      section{C}
      Glspl{wn}\
      gls{wn}\
      count: glsentrycurrcount{wn}
      end{document}


      which produces:



      enter image description here



      I however, would have expected/wanted a count of 4 in section A, and in section C, that at first the full description is printed instead of WNs



      How to make this work reliably?










      share|improve this question
















      I would like to obtain the following behavior: If an acronym is only used once within a section/chapter/part, at this occurrence only the long name should be used. If however the acronym is used more than one, I want the long-short behavior.



      I have the following non working MWE:



      documentclass{book}
      usepackage{xparse}
      ExplSyntaxOn
      NewExpandableDocumentCommand{fpcompare}{ m m m }
      {
      % #1 = test to perform
      % #2 = text for the true case
      % #3 = text for the false case
      fp_compare:nTF { #1 } { #2 } { #3 }
      }
      ExplSyntaxOff

      usepackage[acronym,symbols,nomain,toc,sanitizesort,nogroupskip,xindy,numberedsection=autolabel]{glossaries-extra}
      setglossarystyle{super}
      setabbreviationstyle[acronym]{long-short}

      GlsXtrEnableEntryUnitCounting{acronym}{1}{section}
      %renewcommand*{gls}{cgls}%
      %renewcommand*{Gls}{cGls}%
      %renewcommand*{glspl}{cglspl}%
      %renewcommand*{Glspl}{cGlspl}%
      %renewcommand*{GLS}{cGLS}%
      %renewcommand*{GLSpl}{cGLSpl}%


      makenoidxglossaries
      newacronym{wn}{WN}{wireless network}

      glsxtrnewsymbol[description={pi},type=symbols]{symb:pi}{ensuremath{pi}}%


      usepackage{xstring}
      renewcommand*{gls}[1]{%
      IfEq{glscategory{#1}}{acronym}{%to apply this to acronym only (and not symbols as well)
      fpcompare{glsentrycurrcount{#1} > 1}{glsentrydesc{#1}}{cgls{#1}}% fpcompare to detect how often used
      }{%
      cgls{#1}%
      }%
      }%
      renewcommand*{Gls}[1]{%
      IfEq{glscategory{#1}}{acronym}{%
      fpcompare{glsentrycurrcount{#1} > 1}{Glsentrydesc{#1}}{cgls{#1}}%
      }{%
      cgls{#1}%
      }%
      }%
      renewcommand*{glspl}[1]{%
      IfEq{glscategory{#1}}{acronym}{%
      fpcompare{glsentrycurrcount{#1} > 1}{glsentryplural{#1}}{cglspl{#1}}%
      }{%
      cglspl{#1}%
      }%
      }%
      renewcommand*{Glspl}[1]{%
      IfEq{glscategory{#1}}{acronym}{%
      fpcompare{glsentrycurrcount{#1} > 1}{Glsentryplural{#1}}{cglspl{#1}}%
      }{%
      cglspl{#1}%
      }%
      }%
      renewcommand*{GLS}[1]{%
      IfEq{glscategory{#1}}{acronym}{%
      fpcompare{glsentrycurrcount{#1} > 1}{GLSentrydesc{#1}}{cgls{#1}}%
      }{%
      cgls{#1}%
      }%
      }%
      renewcommand*{GLSpl}[1]{%
      IfEq{glscategory{#1}}{acronym}{%
      fpcompare{glsentrycurrcount{#1} > 1}{GLSentryplural{#1}}{cglspl{#1}}%
      }{%
      cglspl{#1}%
      }%
      }%

      begin{document}
      section{A}
      gls{wn}\
      glspl{wn}\
      glspl{wn}\
      glspl{wn}\
      count: glsentrycurrcount{wn}\
      gls{symb:pi}
      section{B}

      glspl{wn}\
      count: glsentrycurrcount{wn}

      section{C}
      Glspl{wn}\
      gls{wn}\
      count: glsentrycurrcount{wn}
      end{document}


      which produces:



      enter image description here



      I however, would have expected/wanted a count of 4 in section A, and in section C, that at first the full description is printed instead of WNs



      How to make this work reliably?







      glossaries glossaries-extra






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 12 hours ago







      bonanza

















      asked 12 hours ago









      bonanzabonanza

      7621625




      7621625






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477581%2fglossaries-introduce-short-name-only-if-used-more-than-once-within-section-chap%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477581%2fglossaries-introduce-short-name-only-if-used-more-than-once-within-section-chap%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

          Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...

          Castillo d'Acher Características Menú de navegación