I have the following:


    \write0{    Test}

    \expandafter\def\csname abrv@#1\endcsname{#2}%
    {#2 (\textbf{#1})}%

The intention is that the first time its called it opens the aux file for writing. My problem is, that the open part (ifabrvused\else) is getting called twice. I was able to find out that its getting called for the first use within my begin{abstract} and the rest of the document? What am I missing. If its intended to do so, how can i code around it?


Inside the environment abstract you are inside a group. \abrvusedtrue is a local assignment (\let\ifabrvused\iftrue). The switch is reset to false after the environment. Use \global\abrvusedtrue instead.

  • Thanks it works. Just noticed how the line '{#2 (\textbf{#1})}%' always starts a newline before writing the text. Happen to know why? – Poul K. Sørensen Jan 13 '13 at 18:57
  • 1
    @s093294 You have an empty line in your definition that causes the end of the previous paragraph. – Heiko Oberdiek Jan 13 '13 at 20:12
  • \@ifundefined{abrv@#1}{% do not seem to work. Its written to aux file for both abstract and and document. I assume its the same problem, just dont know where to tell it to use global for that – Poul K. Sørensen Jan 26 '13 at 0:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.