TeXworks / texworks

Main codebase for TeXworks, a simple interface for working with TeX documents
https://tug.org/texworks/
GNU General Public License v2.0
698 stars 127 forks source link

errors occur when I use bibtex to make citations and bibliography #919

Closed creater-yzl closed 3 years ago

creater-yzl commented 3 years ago

I used the example code of overleaf in my local Tex Live, Version 3.14159265(TeX Live 2020/W32TeX), and my biblatex version is 57272(3.16)https://www.overleaf.com/project/600442e30000fa446f002578.It worked well online, but when I ran the exact same code locally with that online, I didn't get the same result . This is the code of .tex `\documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel}

\usepackage[ backend=biber, style=alphabetic, sorting=ynt ]{biblatex}

\addbibresource{sample.bib} %Imports bibliography file

\title{Bibliography management: \texttt{biblatex} package} \author{Share\LaTeX} \date{ }

\begin{document}

\maketitle

\tableofcontents

\section{First section}

Using \texttt{biblatex} you can display bibliography divided into sections, depending of citation type. Let's cite! Einstein's journal paper \cite{einstein} and the Dirac's book \cite{dirac} are physics related items. Next, \textit{The \LaTeX\ Companion} book \cite{latexcompanion}, the Donald Knuth's website \cite{knuthwebsite}, \textit{The Comprehensive Tex Archive Network} (CTAN) \cite{ctan} are \LaTeX\ related items; but the others Donald Knuth's items \cite{knuth-fa,knuth-acp} are dedicated to programming.

\medskip

\printbibliography[ heading=bibintoc, title={Whole bibliography} ] %Prints the entire bibliography with the titel "Whole bibliography"

\clearpage

%Filters bibliography \printbibliography[heading=subbibintoc,type=article,title={Articles only}] \printbibliography[type=book,title={Books only}]

\printbibliography[keyword={physics},title={Physics-related only}] \printbibliography[keyword={latex},title={\LaTeX-related only}]

\end{document} This is the code in sample.bib @article{einstein, author = "Albert Einstein", title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) [{On} the electrodynamics of moving bodies]", journal = "Annalen der Physik", volume = "322", number = "10", pages = "891--921", year = "1905", DOI = "http://dx.doi.org/10.1002/andp.19053221004", keywords = "physics" }

@book{dirac, title = {The Principles of Quantum Mechanics}, author = {Paul Adrien Maurice Dirac}, isbn = {9780198520115}, series = {International series of monographs on physics}, year = {1981}, publisher = {Clarendon Press}, keywords = {physics} }

@online{knuthwebsite, author = "Donald Knuth", title = "Knuth: Computers and Typesetting", url = "http://www-cs-faculty.stanford.edu/~uno/abcde.html", addendum = "(accessed: 01.09.2016)", keywords = "latex,knuth" }

@inbook{knuth-fa, author = "Donald E. Knuth", title = "Fundamental Algorithms", publisher = "Addison-Wesley", year = "1973", chapter = "1.2", keywords = "knuth,programming" }` imagelocal result However, the style of the citation words were not changed, and the bibliography was't created. Please find out why for me, thank you!

creater-yzl commented 3 years ago

image and the online result

stloeffler commented 3 years ago

It would seem that you did not run biber, see https://tex.stackexchange.com/a/13513. There are ways to automate this, see e.g. https://github.com/TeXworks/texworks/wiki/AdvancedTypesettingTools, but that is beyond the scope of this discussion. In addition, your sample.bib does not specify some entries, such as latexcompanion, which in the overleaf example seems to be replaced by Gre93 for reasons unknown to me.

Also, you named this issue "errors occur...", yet you did not include any error messages, logs, etc.

BTW, this is not right forum for requests of the form "Please find out why [this is not doing what I expect] for me". Please post such requests on the appropriate mailing lists such as the one for TeXworks, TeXLive, or a general one such as texhax.