Intermittent reference (bibliography) in Latex - latex

I have TexStudio and MikTex to edit Latex files on my PC versions 4.0.3 and 4.4, respectively. However, my bibfiles references work in an randomly way: sometimes they're recognized, in others, they are not.
Minimal Reproducible Example
\documentclass[msc]{ppgccufmg}
\begin{document}
Testing the reference \cite{COAF}
\ppgccbibliography{bibfile}
\end{document}
Bibfile.bib
#misc{COAF,
title = {O que é lavagem de dinheiro e financiamento do terrorismo},
howpublished = {\url{https://www.gov.br/coaf/pt-br/pastas-antigas-disponiveis-para-pesquisa/o-sistema-de-prevencao-a-lavagem-de-dinheiro/o-que-e-o-crime-de-lavagem-de-dinheiro-ld}},
note = {Accessed: 2010-09-30}
}
Class ppgccufmg: https://github.com/verlab/ppgccufmg
(Delete \RequirePackage{etextools} in line 40)
Error:

Two problems:
latex ignores everything after \end{document}, if you want a bibliography, you must place it before it
you are using \url{...} in your .bib file. You need to load a package like hyperref or url which defines this macro
\documentclass[msc]{ppgccufmg}
\usepackage{hyperref}
\begin{document}
Testing the reference \cite{COAF}
\ppgccbibliography{\jobname}
\end{document}

Related

Missing = inserted for \ifnum

I am using iopart template, and I do not know why get this error :
Missing = inserted for \ifnum. \begin
Missing number, treated as zero. \begin
I really appreciate any help
\documentclass[10pt]{iopart}
%\newcommand{\gguide}{{\it Preparing graphics for IOP Publishing journals}}
%Uncomment next line if AMS fonts required
%\usepackage{iopams}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{nicefrac}
\expandafter\let\csname equation*\endcsname\relax
\expandafter\let\csname endequation*\endcsname\relax
\usepackage{amsmath,mathtools}
\DeclareMathOperator{\cotinv}{cot\,inverse}
\usepackage{amssymb}
\let\amscases\cases
\makeatletter
\def\cases{\#ifnextchar\bgroup\plaincases\amscases}
\def\plaincases#1{\begin{cases*}#1\end{cases*}}
\makeatother
\usepackage{multirow}
\usepackage{subfloat}
\usepackage{subfig}
\usepackage{gensymb}
%\newcommand{\acot}{\cot^{-1}}
\begin{document}
\title[]{}
\author{}
\author{}
\address{Department of}
\vspace{10pt}
\begin{indented}
\item[]November 2022
\end{indented}
\begin{abstract}
lll
\end{abstract}
%
% Uncomment for keywords
\vspace{2pc}
\noindent{\it Keywords}: electronics
%
% Uncomment for Submitted to journal title message
%\submitto{\JPA}
%
% Uncomment if a separate title page is required
\maketitle
%
% For two-column output uncomment the next line and choose [10pt] rather than [12pt] in the \documentclass declaration
\ioptwocol
%
\section{Introduction}\label{sec:introduction}
\end{document}```
I tried to recreate this instance. It first asked for the missing iopart.cls documentclass. I could get that from a GitHub repository belonging to Tianjin University named "etgroup". You can simply find it by searching "iop latex template" in Github. After the second compilation, it asked for a class dependency named iopart10.clo(it's available in the same repository).
Finally, after the third compilation, I could get a PDF output(Please see the figure attached).
Solution: If you are using a local LaTeX IDE/Studio, I recommend updating the packages you are using. Sometimes there are conflicts between some packages but they usually resolve quickly by releasing an update and you might see that there was nothing wrong with your commands.
Alternatively, you may try using an online LaTeX editor. They always have the last version of the most common packages and are equipped with multiple LaTeX render engine types.

Augment latex citation with specific table (or figure) reference

How do I include a specific table within a latex citation, i.e., what's the syntax? In other words, I'd like to cite table 11.1 in the "Handbook of Hydrology" by David Maidment. In my BibTex text file, the reference is:
#book{maidment1993,
Author = {Maidment, David R},
Isbn = {0-07-039732-5},
Publisher = {McGraw-Hill},
Address = {New York, USA},
Title = {Handbook of Hydrology},
Year = {1993}}
and so in the tex file that invokes this reference, it's easy enough to add ...\citep{maidment1993}..., but if I want the output to also include table 11.1, as in "...(Table 1.1; Maidment, 1993)." and not merely "(Maidment, 1993)", how do I do that in the .tex file? I tried \citep{Table 11.1 maidment1993}, but not surprisingly, that doesn't work.
You can add the table as optional argument. For example with biblatex:
\documentclass{article}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\cite[Table 11.1]{knuth:ct}
\printbibliography
\end{document}

Citation undefined on input even though they exist

Hi I'm using Overleaf for my dissertation and this warning started popping up recently:
Citation 'objprogen' on page 1 undefined on input line 8.
This citation is already created as seen below in the 'sources.bib' file:
#article{objprogen,
author={Guo, Wenzhong and Lin, Renjie and Wang, Shiping and Xiong, Neal},
booktitle={2018 9th International Symposium on Parallel Architectures, Algorithms and
Programming (PAAP)},
title={Object Proposal Generation for Unsupervised Object Localization},
year={2018},
volume={},
number={},
pages={235-242},
doi={10.1109/PAAP.2018.00046}}
This is my main.tex file:
\documentclass[a4paper]{article}
\usepackage{blindtext, graphicx}
\usepackage{csquotes}
\usepackage[hidelinks]{hyperref}
\usepackage{url}
\usepackage[style=authoryear-ibid,backend=biber]{biblatex}
\hyphenation{op-tical net-works semi-conduc-tor}
\bibliography{sources.bib}
\begin{document}
\title{Can image recognition systems be successfully integrated with existing VIN databases
irrespective of the vehicle manufacturer}
\author{myname}
\maketitle{}
\input{includes/01-Abstract}
\input{includes/02-Introduction}
\input{includes/03-Literature}
\input{includes/04-Methodology}
\input{includes/05-Findings}
\input{includes/06-Conclusion}
\input{includes/07-Appendix}
\end{document}
I had the same problem and solved it by adding \bibliographystyle{plain} (of course you could in principle use other styles). For me the structure of the tex file is the following
\documentclass[oneside, a4paper, onecolumn, 11pt]{article}
%%some packages%%
\begin{document}
%%% some stuff
\bibliographystyle{plain}
\bibliography{bibfile} %bibfile name without the .bib extension
\end{document}
So contrary to you the \bibliography is also inside the document environment.

Left justification of nomenclature description in LaTeX

I'm using a LaTeX template (provided by ASME) to write a conference paper.
The asme2e.cls class defines a "nomenclature" environment as follows:
% Nomenclature environment
\newbox\tempbox
\newenvironment{nomenclature}{%
\newcommand\entry[2]{%
\setbox\tempbox\hbox{##1.\quad}
\hangindent\wd\tempbox\noindent{##1}\quad\ignorespaces##2\par}
\section*{NOMENCLATURE}}{\par\addvspace{12pt}}
which is used, in the .tex source file, as follows:
\begin{nomenclature}
% [...]
\entry{$C_{visc}$}{Viscous friction coefficient.}
\entry{$M$}{Spool mass.}
% [...]
\end{nomenclature}
resulting in the description texts not being left justified (since a fixed horizontal space is inserted between the symbol (e.g.: M) and the description (e.g.: Spool mass.), but the symbols have different lengths (e.g.: Cvisc is longer than M).
Is there a way to fix the class to have left-justified descriptions?
(I did a few experiments with \dimexpr and the calc package, but just got a bunch of errors).
(I also asked ASME if they could provide an updated template, but I'm still waiting for their feedback...)
I couldn't solve the problem, but I found a "quick and dirty" workaround, using the Tabbing and setspace packages.
Here is the new .tex source:
%[...]
\usepackage{Tabbing}
\usepackage{setspace}
%[...]
\begin{nomenclature}
{\setstretch{1.1}
\begin{tabbing}
\noindent
% [...]
\entry{$C_{visc}$}\quad\quad\={Viscous friction coefficient.}\\
\entry{$M$}\>{Spool mass.}\\
\entry{$v$}\>{Spool velocity.}\\
% [...]
\end{tabbing}
} % end \setstretch
\end{nomenclature}
%[...]
(Clearly, I'm completely bypassing the \entry command defined by the asme2e.cls class for the nomenclature environment).
I also tried to edit the asme2ej.cls file but nothing working for me. Then I ended up using the tabbing and set space packages. However, I did not use the \setstretch, and my document compiled just fine.
%[...]
\usepackage{Tabbing}
\usepackage{setspace}
%[...]
\begin{nomenclature}
\begin{tabbing}
\noindent
\entry{XYZ}\quad\quad\={This is an example}\\
\entry{PQR}\>{This is an example}\\
\entry{ZXC}\>{This is an example}\\
\entry{CVN}\>{This is an example}\\
\end{tabbing}
\end{nomenclature}
%[...]
I ran into a similar issue when submitting a paper to an ASME journal. My solution was to edit the asme2e.cls file:
\newenvironment{nomenclature}{%
\newcommand\entry[2]{\noindent\hbox to 0.05\textwidth{##1}\ignorespaces##2\par}
\section*{Nomenclature}}{\par\addvspace{12pt}}
You can change the amount of indentation by changing "0.05\textwidth".
I'm not sure if this is what you're asking, but see the following MWE:
\documentclass[12pt]{article}
\newlength{\nomenlabelindent}
\setlength{\nomenlabelindent}{4em}
\newenvironment{nomenclature}{%
\newcommand\entry[2]{%
\hangindent\nomenlabelindent\noindent\makebox[\nomenlabelindent][l]{##1\quad}\ignorespaces##2\par}%
\section*{NOMENCLATURE}}{\par\addvspace{12pt}}
\begin{document}
\begin{nomenclature}
\entry{$A$} {Parameter}
\entry{$B$} {Parameter}
\entry{$C$}{Parameter}
\entry{$D$}{Parameter}
\entry{$E$}{Parameter}
\end{nomenclature}
\end{document}
Output:
Nomenclature

pdfLaTeX + memoir class compile error

I'm in the middle of writing my thesis, and was using KOMA-Script. The document compiles just fine. I stumbled upon the memoir class yesterday, and was thinking of giving it a try, so here I am trying to compile with this class instead of KOMA-Script.
First compilation is OK. On second compilation, the document would not build
(./fourier/fourier.tex [98]
! Undefined control sequence.
<argument> ... C\protect \noexpand \protect \bond
\protect \noexpand \protec...
l.1 \chapter
{Homogénéisation numérique par transformée de Fourier rapide}
?
It has apparently not connected to hyperlink (btw, I'm using memhfixc), since I've commented this one out. Here is the preamble of my document, any thoughts?
%\documentclass[draft, 11pt, a4paper, chapterprefix]{scrreprt}
\documentclass[draft, 11pt, a4paper]{memoir}
\usepackage[authoryear, round]{natbib}
\usepackage[french]{babel}
\usepackage[latin1]{inputenc}
\usepackage{pdfsync}
\usepackage[version=3]{mhchem}
\usepackage{pgf}
\usepackage{microtype}
\usepackage{txfonts} % Polices times
\usepackage[notref, notcite]{showkeys}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[bvec]{sbmacros}
\usepackage{micromechanics}
\usepackage{pgfcad}
%\usepackage[breaklinks=true]{hyperref}
%\usepackage{memhfixc} % Pour assurer la compatibilité entre memoir et hyperref
%\newcommand{\url}[1]{\texttt{#1}}
% Options KOMA-Script
% \addtokomafont{caption}{\small}
% \pagestyle{headings}
I found the answer, for those who might be interested. I started to have serious doubts when I realized that the exact same problem occured when I used the KOMA-Script scrbook class instead of the KOMA-Script scrreprt class...
And I finally found that the mhchem package somehow conflicts with those packages. Since I didn't use this package much anyway, I got completely rid of it, and am now using memoir, no problem.

Resources