0

I am using following code to print list of acronyms. It shows the correct acronyms in the text but no list is produced (when I use it on my desktop computer). Refer to first image below. However same code works in Overleaf (except that it gives an extra '1' after each acronym in the list. Refer to second image below. Here is the code:

\documentclass{article}
\usepackage[acronym]{glossaries} % use glossaries since glossary package is out dated
\makeglossaries  % tell latex to make the glossary

\newacronym{gps}{GPS}{Global Positioning System} \newacronym{ins}{INS}{Inertial Navigation System} \newacronym{kf}{KF}{Kalman Filter}

\begin{document} This is my test doc. This is my first acronym \acrfull{ins}. My second acronym is \acrfull{gps}.

\printglossary[type=\acronymtype]

\end{document}

As an example this is what I get when I run the code on my desktop: Output of desktop

And this is what I get when I run on in Overleaf: Output from Overleaf

The first line of TexStudio log file has "This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.8.28), whereas first line of Overleaf log file has"This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022)" in it.

Any help would be appreciated. Thanks.

Tash
  • 433
  • 1
    I obtain on my desktop the same output as your screenshoot from Overleaf. The number (1 in your case) is the number page where the acronym appears in your text. – quark67 Mar 21 '23 at 13:52
  • For printing the the acronym list, you uses a wrong syntax, replaces \printglossary[type=\acronymtype] by \printglossary[type=acronym]. – quark67 Mar 21 '23 at 13:58
  • What commands are you using? Overleaf makes sure to run the correct commands to produce the glossary. (And I'm pretty sure the "1"s are the page numbers where you glossary entry appears.) – Teepeemm Mar 21 '23 at 14:00
  • @quark67: The command \printglossary[type=acronym] does not make any difference. – Tash Mar 21 '23 at 14:40
  • @Teepeemm: I am using exactly the same commands I showed you in the code. – Tash Mar 21 '23 at 14:40
  • What commands are you using to compile your document? See https://www.overleaf.com/learn/latex/Glossaries#Compiling_the_glossary – Teepeemm Mar 21 '23 at 14:54
  • @Tash this sounds like you are not executing makeglossaries (see this answer for a bit more about the compilation steps), can you try opening command prompt, navigating to your file and running makeglossaries file (file being the tex filename without .tex). This answer offers some advice for using makeglossaries within texstudio, but it's better tested directly through a terminal. – Dai Bowen Apr 12 '23 at 23:10

2 Answers2

0

To suppress the page number, add nonumberlist to the option package (\usepackage[acronym,nonumberlist]{glossaries}).

And you obtain your first image on the desktop because you don't use the same code on desktop and Overleaf.

You need also use the correct syntax, here \printglossary[type=acronym] instead of \printglossary[type=\acronymtype].

With:

\documentclass{article}
\usepackage[acronym,nonumberlist]{glossaries} % use glossaries since glossary package is out dated
\makeglossaries  % tell latex to make the glossary

\newacronym{gps}{GPS}{Global Positioning System} \newacronym{ins}{INS}{Inertial Navigation System} \newacronym{kf}{KF}{Kalman Filter}

\begin{document} This is my test doc. This is my first acronym \acrfull{ins}. My second acronym is \acrfull{gps}.

\printglossary[type=acronym]

\end{document}

enter image description here

But if instead of \printglossary[type=acronym], you write \printglossary or for example \printglossary%[type=\acronymtype] (remark the percent sign), you will obtain:

enter image description here

So check you code in your desktop, have you really \printglossary[type=\acronymtype] (which is wrong but this doesn't matter here) in it, as you show on your code?

quark67
  • 4,166
  • I am writing the exact same code except "\printglossary[type=acronym]" which I corrected. Actually I copied and pasted your exact code in my editor (I am using TeXStudio) and I get the same result as before ... No list of acronyms at the end. – Tash Mar 21 '23 at 14:44
  • @Tash If on your desktop computer there is absolutly no warning nor error in the .log file, then can you add \listfiles at the very begining of your code (before \documentclass), and then editing your question with what the .log files contain, particularly the beginning (e.g. This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022)) and the liste file (e.g. *File List* article.cls 2022/07/02 etc.). You can also compare this list with what appears on Overleaf. – quark67 Mar 21 '23 at 14:55
  • There is no error or warning at all. I have have a log file but it is very big (370 lines). I don't know how many lines you want me to replicate when I edit my question. Also, I don't know how to see the log fine in Overleaf. – Tash Mar 21 '23 at 16:48
  • @Tash Take a look at https://tex.stackexchange.com/questions/32213/understanding-the-log-file. All you need is say what is your engine for the compilation (E.g. This is pdfTeX, Version ...), search is there is errors or warnings, and also search a list beginning with *File list* article.cls ... and ending with ***********. For Overleaf, at right of the green button "Compile", you will see a sheet icon with probably a colored number, click on it and at bottom you will see a "Raw logs" and a "Expand" button. So you can compare the two logs. – quark67 Mar 21 '23 at 17:22
  • I have checked both the log files and here are no error and no warnings. I can see File List section on both but I have no clue at all what to look for. The first line of TexStudio log has "This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.8.28), whereas first line of Overleaf log has"This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022)" in it. – Tash Mar 26 '23 at 04:21
  • @Tash you need to compare the files and versions in the log file, between *File list* article.cls and ***********. I regularly see problems with MiKTeX on tex.stackexchange. Perhaps can you try install TeX Live on your Windows instead (you need also adapt your TeXStudio configurations so it uses files installed by TeX Live instead files from MiKTeX. Anyway, adding the miktex tag (not miktex2.9, which has less viewers) on your question can help, so Miktex users (which I'm not) can take a look at your question. – quark67 Mar 26 '23 at 14:34
  • Thanks @quark67. I have added few more tags including miktex. I can compare the files but I don't know what I am looking for. Do you think TeX Live is better than Miktex? – Tash Mar 28 '23 at 05:04
  • @Tash I have not the qualification to recommand anything but I hope that TeX Live can resolve your problem (unless a MikTek user can help you). if you are curious about MiKTeX versus TeX Live: https://tex.stackexchange.com/questions/20036/what-are-the-advantages-of-tex-live-over-miktex. – quark67 Mar 28 '23 at 23:19
0

I get what you get on Overleaf. On my desktop, I get what you get what I compile with pdflatex myfile.

If I then run the command makeglossaries myfile and then another pdflatex myfile, then I get the same output as Overleaf.

Teepeemm
  • 6,708