Extra brackets when showing reference with natbib in beamer - latex

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.

Related

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

Unable to show the glossary with \printglossary in 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.

How to include a LaTeX paper into another LaTeX paper in OverLeaf?

I have LaTeX paper that I need to include in my dissertation. I am working in OverLeaf. That paper was written under one document class while the university has its own class. I need to include the paper in the dissertation so that it has the university style, its images need to be listed in the list of figures of the dissertation, and the authors listed in the paper's bibliography needs to be listed in the university's class bibliography. Is there any way I can do that in OverLeaf?
There are several dedicated packages for this. For example have a look at the combine, subdocs or docmute packages (A list with even more suggestions can be fond at https://www.ctan.org/recommendations/docmute).
Here a short example with the docmute package
\documentclass{book}
\usepackage{lipsum}
\usepackage{docmute}
\begin{document}
\tableofcontents
text
\chapter{imported paper}
\input{test}% assuming your paper is called test.tex
\end{document}
A Latex document cannot have multiple \documentclass. One solution would be to split the header/content of your latex document in overleaf:
Create a master.tex with the documentclass and put all your content (text between \begin{document} and \end{document} in a second content.tex. In the master, just \input{content}.
In your dissertation, just copy content.tex, its figure and add \input{} in the master file of your University which has the specific documentclass and bibliography settings.

How to include both Agda and Isabelle code in the same latex file?

I am creating presentation slides using beamer, and on the slides I want to include pieces of code from Agda and Isabelle standard libraries. All I can find online is generating latex from Agda (lagda) or from Isabelle (document preparation). I want to go the other way, as my slides will have code from different systems.
I can still use lstlisting or verbatim, but I would rather not copy-paste and reformat code.
I would prefer to have something like including line numbers from files, or maybe code between tags
Your best bet is to use the catchfilebetweentags package: given two files IsabelleCode.tex and AgdaCode.tex generated by the respective LaTeX backends of each language, you can capture the code between an opening tag %<*TAGNAME> and a closing tag %</TAGNAME> in either file by using the appropriate directive e.g.:
\ExecuteMetaData[IsabelleCode.tex]{TAGNAME}
\ExecuteMetaData[AgdaCode.tex]{TAGNAME}
With \lstinputlisting from the listings package, you can directly include code from the source file. Optionally you can specify the start and end line numbers
\documentclass{beamer}
\usepackage{listings}
\lstset{basicstyle=\ttfamily}
\begin{document}
\begin{frame}[fragile]
\lstinputlisting[firstline=1,lastline=7,language=C]{duck.C}
\end{frame}
\begin{frame}[fragile]
\lstinputlisting[firstline=1,lastline=7]{test.agada}
\end{frame}
\begin{frame}[fragile]
\lstinputlisting[firstline=1,lastline=7]{test.isabelle}
\end{frame}
\end{document}
At least for Agda, you can render individual .lagda modules into LaTeX. If you can do the same with Isabelle's pretty-printer, you should be then able to write toplevel LaTeX by hand, and then import (parts of) the Agda and Isabelle-generated LaTeX where appropriate.

Resources