Unable to show the glossary with \printglossary in latex - latex

I was given a Latex project as template and I decided to add a glossary on it, however, \printglossary is not working. I can add and use different entries so I guess that the glossary creation is not the problem.
I am using Overleaf and if I try a completely new project with only the glossary (code bellow) \printglossary works fine.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[acronym, toc]{glossaries}
\makeglossaries
\input{Bibliocosas/glossary.tex}
\begin{document}
\tableofcontents
\section{First Section}
The \Gls{latex} typesetting markup language is specially suitable for documents that include \gls{maths}. \Glspl{formula} are rendered properly an easily once one gets used to the commands.
\clearpage
\section{Second Section}
\vspace{5mm}
Given a set of numbers, there are elementary methods to compute its \acrlong{gcd}, which is abbreviated \acrshort{gcd}. This process is similar to that used for the \acrfull{lcm}.
\clearpage
\printglossary
\clearpage
\printglossary[type=\acronymtype]
\end{document}
I am using chapters intead of sections in the given project, is that the the cause of the problem?

Using \makenoidxglossaries and \printnoidxglossaries seems to apparently solve the problem.
I thought that I had already tried them but I guess I was wrong. However, I still don't know why the previous code does not work in the given project.

As for me, I had the same issue but I fixed it by using glossaries-extra package after glossaries package using.
\usepackage[automake]{glossaries-extra}
Then clearing the cache.

I had this issue with Overleaf. The problem was that I uploaded the project as a zip and Overleaf created an additional nested directory in the root with the name of my project. Everything worked but not glossaries.
To solve this I just moved all files to the root directory by dragging each of it.

Related

Extra brackets when showing reference with natbib in beamer

I am using natbib for bibliography in beamer using TeXstudio editor. Everything is fine except the extra unwanted brackets showing at the beginning of the reference by \bibliography{file name} placed in a separate frame. How I can get rid of such extra brackets? Thanks a lot. Here is a piece of my latex file:
\usepackage[sort&compress]{natbib}
\begin{document}
\begin{frame}{References}
\bibliographystyle{plain}
\bibliography{references}
\end{frame}
\end{document}
I used \cite when calling the reference in a frame. Here is the result in PDF file:
1. [ 1.]Maasoud Kaviany. Principles of heat transfer in porous media. Springer Science & Business Media, 2012.

LaTeX change name of \bibliography{} heading (or remove entirely)

I have seen this question asked a few times on here but none of the answers have gotten me exactly what I want. I am using Overleaf to write a LaTeX document and when I make a bibliography (using the natbib library) it automatically makes a heading named "References". Can I remove this heading somehow? I've tried a couple other options but they haven't worked. I've attached a minimal working example below:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage{hyperref}
\begin{document}
Here is a citation \citep{Source}.
\bibliographystyle{apalike}
\bibliography{refs}
\end{document}
Not sure what didn't work with the existing responses - perhaps you could point to them and indicate what you didn't like about the results? Does replacing the \bibliography{refs} with the following help? (BTW, as this is not an Overleaf question, it's just LaTeX, perhaps remove the overleaf tag and reference.)
\begingroup
\renewcommand
\refname{}
\bibliography{refs}
\endgroup

overleaf standalone package (for multi-file projects) - subpreamble is not considered

I am building a multi-file latex project with overleaf, following this guide.
In short, I like moderncv title, and i want to use that together with a simple article to have my cover letter be consistent with my cv.
I tried setting up a main file
\documentclass[class=moderncv, crop=false]{standalone}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[subpreambles=true]{standalone}
\usepackage{import}
\usepackage[scale=0.75]{geometry}
\renewcommand*{\namefont}{\fontsize{30}{29}\mdseries\upshape}
\name{Name}{Surname}
\title{Presentation Letter}
\address{Street n 1}{City}{Country}
\phone[mobile]{+42~(123)~456~6789}
\email{my#email.com}
\photo[64pt][0pt]{picture}
\begin{document}
\makecvtitle
\import{sections/}{presentation}
\end{document}
and in presentation.tex there is just
\documentclass[class=article, crop=false]{standalone}
\usepackage[utf8]{inputenc}
\setlength{\parindent}{0.5em}
\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.2}
\begin{document}
...presentation..
\end{document}
Unfortunately, while the moderncv title looks good, the imported presentation does not have the expected formatting (article + custom parindent, parskip, baselinestretch).
I would also like to point out that in order to compile, I had to revert the TexLive Version to 2016 (Overleaf V1 legacy), otherwise it wouldn't work at all.
I hope somebody can help me, or at least point me towards another direction, maybe supported by latest overleaf engine, to combine two different files with two different preambles. Thanks

Why does LaTeX start a new line when making a reference

I just created a LaTeX document and compile it to a PDF using pdftex. Every time I make a reference using the \ref command, the reference is put on a new line. Why does this happen and how do I prevent this?
Are you by any chance using \\ in URLs instead of //? \\ is used as a linebreak in TeX.
Try to localize the problem: create a new file which initializes hyperref the same way, uses no other packages, and has some text and a reference. Check if references still start on new lines. If they do, you can show it here (and on LaTeX forums); if not, add more of your report's preamble until you get a file which exhibits the problem.
Can you prepare a minimum example demonstrating your problem?
I've tried with:
\documentclass{report}
\usepackage[pdftex,breaklinks=true,bookmarks=true,bookmarksopen= true,pdfpagemode=UseNone,plainpages=false,pdfpagelabels,pdfstartview=FitH,olorlinks=true,citecolor=blue]{hyperref}
\begin{document}
Test \url{http://test.com} \ref{http://someother.com}.
\end{document}
And the whole output is a single line in PDF.
BTW \ref is used to produce internal document links (like in "As described in chapter \ref{chapter:second}...").
It was my own fault, I used \par for the paragraph sign instead of \P. This is one of my first LaTeX documents, so I overlooked it. Thanks for the quick responses/answers though.

glossaries package and footnote in LaTeX

I am currently stuck, having two separate glossaries: main & acronyms. Acronyms glossary prints footnotes on first use in the text, but main glossary does not. Is there any way to make any other glossary than acronyms to print footnote on first use of the term? I don't get how to do it.
Here is the code example compiled with TeXnic Center and MiKTeX 2.7:
\documentclass{article}
\usepackage{index}
\usepackage[toc,style=long3colheaderborder,footnote,acronym]{glossaries}
\makeindex
\makeglossaries
\newglossaryentry{appdomain}{name={application domain}, description={app Domain Description...}}
\newglossaryentry{sample}{name={[has been inserted aaa]},description={testing testing 123}}
\newacronym{aca}{aca}{a contrived acronym}
\begin{document}
\section{this is a test section}
This is the test line... a \gls{sample} \gls{appdomain}
\index{entry} and \gls{aca}
\thispagestyle{empty}\cleardoublepage
\printglossary[type=main,title={Glossary},toctitle={Glossary}]
\thispagestyle{empty}\cleardoublepage
\printglossary[type=\acronymtype,title={List of Abbreviations},toctitle={List of Abbreviations}]
\printindex
\thispagestyle{empty}\cleardoublepage
\end{document}
I want sample and appdomain either contain a footnote with description or a footnote stating: please refer to Glossary
Many thanks,
Ovanes
In short, with the glossaries package, you can't get footnotes on the first use for non-acronym glossaries.
However, you can redefine some commands in the preamble (after you \usepackage{glossaries}) to get what you want:
\makeatletter
\renewcommand{\gls#main#displayfirst}[4]{
#1#4\protect\footnote{#2}
}
\makeatother
But that will be really fragile.
I think there is an easier way of doing this. Maybe it's new, but
\defglsdisplayfirst[main]{#1#4\protect\footnote{#2}}
appears to achieve the exact same thing (correct me if I'm wrong). See the glossaries manual, version 2.03, subsection 2.4.1 changing the format of the text.
Unfortunately, it appears commands like \gls or \autoref does not work in those footnotes.
Following is a good technique, to put a footnote stating where the definitions are:
\label{nom} %put this on the page your term appears, so that it can collect page number
\newcommand{\g}{\footnote{For all abbreviations see the glossary on page \pageref{nom}.}}
I've found this from here.

Resources