Strange behaviour of \oldstylenums - latex

I've just copied a latex document which was a presentation, presentation I've made last year (beamer class) where I've written the date on the title slide like this :
\date{\oldstylenums{\today}}
I run the ancient document and it is still ok -->
But when I run the copy it gives me that, where the month has been replaced by a musical note (?!) :
More generally there seems to be a problem about displaying months, example if I write :
\date{\oldstylenums{1 Juillet 2021}}
it gives me :
Is anyone aware about this funny behaviour and how to rectify it ?
Thank you in advance

oldstylenums uses another font encoding. You can avoid the problem by only using it for numbers:
\documentclass{beamer}
\date{\oldstylenums{30} juin \oldstylenums{2021}}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}
Or you could use another font which uses them by default:
\documentclass{beamer}
\usepackage{cfr-lm}
\date{30 juin 2021}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}
As to why you are having this problem in the new project? Overleaf normally does not change the texlive version of existing projects, so your old project uses texlive 2019 (or older). If you start a new project it will be with the texlive version currently used by overleaf (at the moment this is the already outdated texlive 2020). However you can select the version in the menu in the left hand sidebar. If you switch back to <= 2019 in your new project, you should not see the problem (but "juin" is still not written in the correct font, see the wrong usage of italic in your screenshot)

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.

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.

Change Zotero Bibliography language in Overleaf

I am using Zotero with Overleaf as follows:
\usepackage[backend=bibtex, style = authoryear]{biblatex}
\addbibresource{references.bib}
\selectlanguage{german}
\printbibliography
The result looks fine, since I get a German title for my bibliography and the cites work as expected. The only drawback is that text in my bibliography and the cites in my text are in english (e.g. last visited, author 1 and author 2, ...) but I need them to be in German. I tried to use \usepackage[german]{babel} but then I get the following error:
TeX capacity exceeded, sorry [input stack size=5000].
\#ifundefined #1->\expandafter \ifx \csname #1
\endcsname \relax \expandafter...
l.52 ...Init\CurrentOption{captions\CurrentOption}
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
Is there any other way to change the cite and bibliography language?
After diving into several custom style files, I found \RequirePackage{german}. It seems that this causes trouble when including the german babel package. Removing this line solves the error.

Add a version number to the title of a LaTeX document

The title section of my LaTeX documents usually look like
\title{Title}
\author{Me}
%\date{} %// Today's date will appear when this is commented out.
\begin{document}
\maketitle
I'd really like to add another line in the title section for a version number:
\title{Title}
\author{Me}
\version{v1.2}
%\date{} %// Today's date will appear when this is commented out.
\begin{document}
\maketitle
It doesn't necessarily have to be a command named version, but how can I get a version number to appear after the date (which is after the author)? I can manually set the version number.
So:
Title
Me
4/13/2010
v1.2
The easiest way to do exactly what I wanted to do was to simply use:
\title{Title}
\author{Me}
\date{\today\\v1.2}
\begin{document}
\maketitle
My answer is probably too late for the original thread, but Latex has a very interesting package called vrsion (there is no 'e'), which is part of the standard distribution. Essentially, it numbers the .dvi file, i.e the number is increased every time Latex is run.
Personally, I use this as a simple work around for the lack of a human-friendly document version number from Git. Not ideal, but sometimes I have multiple copies of my documents and it helps avoid some confusion.
For many version control systems, the checkin and checkout programs will expand certain strings in the documents into metadata the version control system has about the system, including the version number.
If you include these strings in the body of Tex definitions, then you can use them in your documents.
It's hard to say more without knowing which version control system you are using, but CTAN has the vc bundle, and rcs.sty is nice to use, for folks still using not only non-distributed, but not even concurrent VC...
Once you've got the strings (oh, I see you said manual entry is OK), you can then typeset this using
\title{Title\\\normalsize Version \versionnumber}
If you really want the author in between, then you can't use \title and \author together in the usual way - you should put your name on another line in the \title command.
If you have your document controlled inside a git repository, then this can be achieved using the gitinfo package. If correctly configured (which involves adding post-hooks to your git system), you can simply use \gitVtag to call the version number (as embodied in a git tag) or e.g. \gitAbbrevHash to get the abbreviated hash of the current commit of the repo.
Simple manual method:
Create a file called (say) version.tex:
\providecommand{\versionnumber}{3.0.1}
Where you need to use it:
\input{version}
\title{Title\\\normalsize Version \versionnumber}
This will give you a single common place in your project or projects to update the version manually.
If you need to display the version number only in the titlepage, you just need to modify it using
\begin{titlepage}
...
Version 1.x
...
\end{titlepage}
after issuing the command \maketitle.
Otherwise, if you need to recall it in several times throughout the document, it's better to define a variable:
\def\Version#1{\def\version{#1}}
so that you define the version number with \Version{} and recall it with \version.
Take a look at the packages rcsinfo and rcs. They include keys for extracting data from RCS tags within your document, so that will work if you are using CVS. I found this in The LaTeX Companion, pg 837. Something that works with your VCS of choice may have been written in the meantime.
To provide a \version command like \author, you'd do:
\let\theversion=\relax
\providecommand{\version}[1]{\renewcommand{\theversion}{#1}}
If you're not using a titlepage environment, you can redefine \maketitle itself. Look in article.cls (or whatever class file you're using), copy-and-paste, and insert \theversion whereever and however you want. If you want to check for a version number before putting in the title, do something like:
\def\maketitle{%
% ... stuff copied from original class file...
\ifx\theversion\relax
% do nothing if there is no version defined
\else\bfseries\theversion% set the version
\fi
If you don't need it in the title per se you could add it as a footnote to the date (both of those properties related to the freshness of the resource so it makes some sense to put them together.
\title{My article}
\version{v1.2}
\date{\today\thanks{\theversion}}
I use the package vhistory for a changelog table at the beginning of my documents.
\subject{Institute for nice formatted docs}
\title{My important document}
\subtitle{\vhCurrentVersion, \vhCurrentDate}
\author{Me}
\date{} % Activate to display a given date or no date (if empty)
\begin{document}
\maketitle
\clearpage
\begin{versionhistory}
\vhEntry{v0.1}{17.05.2019}{Me}{First release}
\vhEntry{v0.2}{12.08.2019}{Someone}{Rewrite of chapter 2 ...}
\vhEntry{v0.3}{04.03.2021}{Another editor}{Change after feedback of ...}
\end{versionhistory}
\tableofcontents
[...]
\end{document}
With the following commands you get at any position the current version and the current date, which can be used in the title section.

Resources