I want to split my bibliography into two parts, and found the multibib package which seems to be perfect for this.
But: somehow it doesn't work, not even the simple example works:
\documentclass{article}
\usepackage{multibib}
\newcites{ltex}{\TeX\ and \LaTeX\ References}
\begin{document}
References to the \TeX book \citeltex{Knuth:1991} and to Lamport’s \LaTeX\ book, which appears only in the references\nociteltex{Lamport:1994}. Finally a cite to a Postscript tutorial \cite{Adobe:1985}.
\bibliographystyleltex{alpha}
\bibliographyltex{lit}
\renewcommand{\refname}{Postscript References}
\bibliographystyle{plain}
\bibliography{lit}
\end{document}
With the bib file looking like that
#book{Knuth:1991, author = {Knuth, Donald E.}, title = {The TEC book}, publisher = {Addison-Wesley, Reading, Massachusetts}, year = {1991}}
#book{Lamport:1994, author = {Lamport, Leslie}, title = {LATEX: A Document Preparation System}, publisher = {Addison-Wesley, Reading, Massachusetts, 2 edition}, year = {1994} }
#book{Adobe:1985, author = {Adobe System Incorporated}, title = {Postscript Language Tutorial and Cookbook}, publisher = {Addison-Wesley, Reading, Massachusetts}, year = {1985}}
As expected, two aux files are created (one for each part), but the created pdf file only contains the references for the "normal", not for the created bib.
Any ideas? Thanks!
Ok, I found it out by myself:
I'm using Texniccenter and tought all the compiling is done automatically, but an additional bibtex call is needed for the ltex.aux file, so you need to run
bibtex ltex.aux
manually on the command line, then it works.
Perhaps someone knows a way to do that call from Texniccenter?
Open the ltex.aux file in Texnic Center (through File then Open...).
Once it is open and it is the selected tab in Texnic Center, go to Build, Current File... and click Bibtex. The key here is to choose the Bibtex command in the Current File option.
This performs the same as bibtex ltex.aux in Texnic Center
Related
I am wanting to do in text citations for my dissertation. I will upload a simplified version of what i am seeing. The issue is that i keep getting "undefined citations" where i only get the citation key out in my pdf irrespective of which compiler i use.
I also keep getting an error saying that the bibliography is empty. But when my friend uses the exact code i have and copies the references and everything into his overleaf environment it works. I could not get it working with miktex and texmaker. Please help
I have checked a lot of articles of what is available and i swear im following what they are doing but i cant get any further
Initially, my idea is to pull the citations from another file because ill be using these citations in multiple documents. I have successfully setup the .bib file which will update as i add more references to Zotero (my reference manager). I tried to pull citations from the .bib file by coding in the file directory, but no luck there.
I then tried to not use the "file directory approach" and just have a references file in the same folder as the .tex file. But that didnt work either.
my code is as follows:
\documentclass[11pt]{article}
\usepackage{geometry}
\usepackage{latexsym}
\usepackage{graphicx}
\usepackage[style=ieee]{biblatex}
\addbibresource{refs.bib} %%updated from References.bib
%document headings
\title{Practice}
\author{Justin Smith}
\begin{document}
%Cover Page
\maketitle
\textbf{This page represents the cover page}\newline
\textit{Report will begin here}
\thispagestyle{empty}
\pagebreak
%Introduction
\section{Introduction}
The introduction for the report will be inserted here
\pagebreak
%end Introduction
%Literature Survey
\section{Literature Survey}
\subsection{Referencing Examples}
This section serves to use a reference and understand how to implement references as well as generate a reference list at the end of this report.\\
The citation test \cite{schmidtPreprocessingMethodologyEnhance2019}\\
\pagebreak
%Reference List
\section*{Reference List}
%%\bibliographystyle{IEEE}
%%\bibliography{C:/Users66smi/OneDrive/University of Pretoria/Zotero/MyZoteroLibrary.bib}
%%\printbibliography[title = Reference List]
%%\bibliography{MyZoteroLibrary.bib}
\end{document}
EDIT:
Upon trying to do what #celdor initially said said i still run into the same issue. The following screenshots add to the initial question.
Screenshot showing code and issue directly
Screenshot showing Latex "Configure" settings
From the Log file, the following logs detail relevant warnings
LaTeX Warning: Citation 'schmidtPreprocessingMethodologyEnhance2019' on page 3
undefined on input line 36.
Underfull \hbox (badness 10000) in paragraph at lines 36--37
[]
[3]
LaTeX Warning: Empty bibliography on input line 39.
(Latex test.aux)
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) "Latex test"
(biblatex) and rerun LaTeX afterwards.
Package logreq Info: Writing requests to '"Latex test".run.xml'.
\openout1 = `"Latex test.run.xml"'.
)
Extra information:
The following screenshots are of the Project folder
First, latexsym is an old package superseded by amssymb. I looked at the file and its last update was in 1998!
As to your issues, assuming your text file is main.tex, try the following:
Clean your project folder from all auxiliary *.aux; the best way to do that is to issue latexmk -C in your project folder.
Additionally, remove main.bbl
make sure your *.bib file is in the root project folder
add backend=biber to list of options of biblatex.
Then, run:
pdflatex main.tex # or xelatex main.tex or lualatex main.tex etc.
biber main
pdflatex main.tex # see above
Without *.bbl file, the first run of pdflatex does not produce any reference list and latex may issue a warning. With an old *.bbl file, you will get wrong citations. After the whole sequence is executed, main.pdf should have the correct citation and a reference list.
Remember \bibliography is incompatible with biblatex. The correct macro to create bibliography list is \printbibliography. It will issue \section* in article or \chapter* in report/book for a title and format it according to settings in a document class.
Here, I created References.bib with a dummy article:
#ARTICLE{schmidtPreprocessingMethodologyEnhance2019,
author = {Other, Anthony Norman},
title = {Some things I did},
year = {2014},
journal = {J.~Irrep. Res.},
volume = {1},
number = {1},
pages = {1-10}
}
and run the code as suggested, and frankly I get expected results without any errors!
The full code:
\documentclass[11pt]{article}
\usepackage{geometry}
\usepackage{amssymb} %superseds latexsym
\usepackage{graphicx}
\usepackage[backend=biber,style=ieee]{biblatex}
\addbibresource{References.bib}
%document headings
\title{Practice}
\author{Justin Smith}
\begin{document}
%Cover Page
\maketitle
\textbf{This page represents the cover page}\newline
\textit{Report will begin here}
\thispagestyle{empty}
\pagebreak
%Introduction
\section{Introduction}
The introduction for the report will be inserted here
\pagebreak
%end Introduction
%Literature Survey
\section{Literature Survey}
\subsection{Referencing Examples}
This section serves to use a reference and understand how to implement references as well as generate a reference list at the end of this report.\\
The citation test \cite{schmidtPreprocessingMethodologyEnhance2019}\\
\clearpage
\printbibliography[title = Reference List]
\end{document}
and here's the screenshot:
The answer as suggested by #samcarter_is_at_topanswers.xyz
is that I was not using biber.
To do this on textmaker proceed to Options/Configure Textmaker. A configuration window will appear. Under the Commands Window locate "Bib(la)tex" and set the designation to "biber %". This will solve the issue.
Setting Update
A similar procedure can be followed on texstudios
See the below link on how to make sure textmaker uses this setting for reference.
https://tex.stackexchange.com/questions/44040/biblatex-biber-texmaker-miktex
thank you for everyones efforts in solving this problem.
I am working on a Latex template and I keep getting the following error:
BibTeX: I didn't find a database entry for ""
At first I though something in my bib had an unexpected empty citation, but there is none. I've also tried to rename the bib file, no luck... any ideas?
I've look everywhere and I can't find a solution yet. Any help is appreciated.
It could be possible there's a non-display character (like a zero width space, for example) that got into one of your citations.
Try doing a find command for "cite{" and compare it with the number of results for "cite". If there's a difference then you've found the citation with a stray character in it, and you can just copy a properly formatted string and paste in place.
There could also be such a character within after the bracket which will cause the same problem, but that will be a bit harder to find.
I thought of this thanks to this question where the author also had a problem with a non-displaying character getting into his citation. https://tex.stackexchange.com/questions/33416/bibtex-i-didnt-find-a-database-entry-for
Try searching any .tex files in your project for an empty citation, in my case I found a \cite{} causing the issue
This may be caused by duplication of database files in the command \bibliography{}.
The bibtex command will produce the following output
This database file appears more than once: foo.bib
---line 4 of file Untitled2.aux
: \bibdata{foo,foo
: }
I'm skipping whatever remains of this command
Database file #1: foo.bib
(There was 1 error message)
if you write in your tex file as
\bibliography{foo2022, foo2022}
Such an error won't cause any trouble if the duplication appears as the last database file. Unfortunately, if you append another database file after that duplicated one, as suggested by the error message, the new file is ignored so bibtex can't find that database entry.
So review the error message from bibtex and exclude the duplicated database files.
I have prepared some tex and bib files for you to reproduce such an error.
tex file
\documentclass[a4paper,12pt,oneside]{report}
\usepackage[round]{natbib}
\bibliographystyle{plainnat}
\usepackage[textheight=23.7cm,
hmargin=26mm,
top=26mm,
headheight=0.5cm,
headsep=0.5cm,
]{geometry}
\renewcommand{\bibname}{References}
\begin{document}
\citep{foo2022}, \citep{foo2:foo2022}
\bibliography{foo,foo,foo2}
\end{document}
foo.bib
#article{foo2022,
author = {Hello, World},
journal = {Journal},
month = {01},
number = {1},
pages = {1-10},
title = {Title},
volume = {100},
year = {2022}}
foo2.bib
#article{foo2:foo2022,
author = {Hello, World},
journal = {Journal},
month = {01},
number = {1},
pages = {1-10},
title = {Title},
volume = {100},
year = {2022}}
To compile, use the following commands
pdflatex <your file>
bibtex <your file>
pdflatex <your file>
pdflatex <your file>
To correct the above-mentioned error, change
\bibliography{foo,foo,foo2}
to
\bibliography{foo,foo2}
I'm trying to write my thesis using overleaf, but having trouble with the referencing. I've been told to use BibLaTEX but it doesn't seem to be formatting correctly see 1. From what I gather it's because I don't have the external software downloaded, but I'm confused as to what specifically I need and where to find it. I thought I downloaded this from CTAN, but all I found was a folder of .bib files and I'm not sure how that helps? 2 is the error message I recieve :/
Any advice would be much appreciated!
Here is my code, I try changing the style and the brackets in my doc change (but not the citation).
This is my new ref.bib
#book{williams_transmission_2008,
location = {New York},
edition = {2nd ed},
title = {Transmission electron microscopy: a textbook for materials science},
isbn = {978-0-387-76500-6},
shorttitle = {Transmission electron microscopy},
pagetotal = {4},
publisher = {Springer},
author = {Williams, David B. and Carter, C. Barry},
date = {2008},
keywords = {Materials, Microscopy, Transmission electron microscopy}
}
And this is my new test document, and the same image issue 3
\documentclass{report}
\usepackage[style=science, citestyle=numeric, sorting=ynt]{biblatex}
\addbibresource{ref} % the ref.bib file
\begin{document}
Hi there, Stackoverflowers \cite{williams_transmission_2008}
\printbibliography
\end{document}
In my document i'm using the package glossaries to create a glossary. Everything works fine except that the is no link between the words in the text and the corresponding entry in my glossary (so you can click the word to be explained and get to the glossary entry).
The most important parts of my document:
%----Header----
...
\usepackage[nonumberlist,acronym,toc,style=altlist]{glossaries}
\usepackage[
colorlinks=true,
pdfborder=0 0 0,
pdfpagelabels,
plainpages=false,
linktocpage=false,
pdfcreator={LaTeX}]{hyperref}
...
%Glossary entries
\newglossaryentry{glos:twitter}{name=Twitter,
description={Mikroblogging-Service.}}
%----Main document----
\begin{document}
\chapter{Introduction}
This text is a normal glossary item: \gls{glos:twitter}.
This text should also link to the glossary item: \glslink{glos:twitter}{Link to Twitter}
but there is no link
...
\printglossary
\end{document}
As you see i'm also using the package hyperref, but there seems to be no mechanism that automatically links words in the main text to the glossary.
I also tried to use \ref and \label, but this doesnt' work when the element that is referred is outside the main document (like my glossary is).
I'm using the makeglossaries-script coming from miktex (calling makeglossaries main on build), but this also doesn't give me a link.
Anyone knows a way to do that? Or maybe i should use another package than glossaries which supports a functionality like that?
I would also appreciate any working examples where this functionality works.
EDIT:
I just got a working minimal example where gls/glslink actually works. Seems like the linking of glossary items interfers with one of the packages im using in my document. Will have to try by adding my packages one by one to the example to see which package is the reason. The example:
\listfiles
\documentclass{article}
\usepackage[
colorlinks=true,
pdfborder=0 0 0,
pdfpagelabels,
plainpages=false,
linktocpage=false,
pdfcreator={LaTeX}]{hyperref}
\usepackage[nonumberlist,acronym,toc,style=altlist,]{glossaries}
\makeglossaries
%Glossary entries
\newglossaryentry{glos:twitter}{name=Twitter,
description={Mikroblogging-Service.}}
%----Main document----
\begin{document}
\chapter{Introduction}
Ein normales Wort aus dem Glossar: \gls{glos:twitter}.
Dieses Wort soll zum Glossar verlinkt werden: \glslink{glos:twitter}{Link to Twitter}
funktioniert aber nicht...
\clearpage
\printglossary
\end{document}
As not mentioned in the extract of my latex-code, in my documentclass, the draft property was set to true. When removing this property or setting it to false, the gls/glslink work fine.
I am trying to implement this new environment in LaTeX:
\newenvironment{javacode}[2]
{\begin{lstlisting}[language=java, label=#1, caption=#2]}
{\end{lstlisting}}
And then use it like such:
\begin{javacode}{c}{some code}
int x = 5;
\end{javacode}
But I am getting the following error:
Overfull \hbox (6.0pt too wide) in paragraph at lines 6--6
[][][][][][][]
[1] [2]) [3])
*
Can anyone help as regards fixing this problem?
[Update]
I tried it doing it like Red-nosed unicorn instructed, and it worked correctly.
But now I tried adding a \begin{singlespace} like such:
\lstnewenvironment{javacode}[2]
{
\begin{singlespace}
\lstset{language=java, label=#1, caption=#2}}
{
\end{singlespace}
}
And I got the same error:
Overfull \hbox (6.0pt too wide) in paragraph at lines 6--6
[][][][][][][]
[1]) [2] [3])
*
This is a special case because the listings environment needs to parse ahead itself to find the end of itself. The reason is that macros inside the listings environment must not get expanded – that of course includes the end tag of the environment.
So basically it looks in each line if the line contains \end{lstlisting} – but in your case, no such line exists since the \end{javacode} macro has not yet been expanded. So listings continues to search until the end of the file.
Listings defines an own command to work around this. From the documentation:
\lstnewenvironment
{⟨name⟩}[⟨number⟩][⟨opt. default arg.⟩]
{⟨starting code⟩}
{⟨ending code⟩}
For example:
\lstnewenvironment{javacode}[2]
{\lstset{language=java, label=#1, caption=#2}}
{}
EDIT In response to your edited question: I tried to compile the following minimal “working” example. Actually, it’s not so much working – the latex processor just stops right in the middle and waits for a user input.
Since the listings documentation makes no mention of a special treatment of singlespace, I think you may have uncovered a bug. The best course of action is probably to get feedback from the maintainer of the listings package.
% mini.dvi
\documentclass{article}
\usepackage{listings}
\usepackage{setspace}
\doublespacing
\lstnewenvironment{javacode}
{\begin{singlespace}
\lstset{language=java}}
{\end{singlespace}}
\begin{document}
\begin{javacode}
int a = 1;
int b = 2;
\end{javacode}
\end{document}
Upon further research, I found this http://www.tug.org/pipermail/texhax/2009-June/012699.html
To workaround my solution, I need to use \singlespacing instead of the singlespace environment.
The following is now my working code:
\lstnewenvironment{javacode}[2]
{\singlespacing\lstset{language=java, label=#1, caption=#2}}
{}