Package biblatex Error - latex

I have a latex document and wanted to add references using bibtex. I created a file and saved it with the extension .bib. In the latex file I use \usepackage{biblatex} and then
\bibliographystyle{style}
\bibliography{PHcite}
When I compile I get this error:
./Physics IA.tex:153: Package biblatex Error: '\bibliographystyle' invalid.
See the biblatex package documentation for explanation.
Type H for immediate help.
...
l.153 \bibliographystyle{style}
?
./Physics IA.tex:154: LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
...
l.154 \bibliography
{PHcite}

You just have to look at one of the biblatex examples in order to see what the problem is:
Don't use
\documentclass[<options>]{<class>}
% ...
\begin{document}
% ...
\bibliographystyle{<style>}
\bibliography{<bib>}
% ...
\end{document}
Instead use
\documentclass[<options>]{<class>}
% ...
\usepackage[
style = <style>,
<other options>
]{biblatex}
% ...
\addbibresource[<options>]{<bib>.bib}
% ...
\begin{document}
% ...
\printbibliography[<options>]
% ...
\end{document}
Reference:
What to do to switch to biblatex?
What is the difference between BibTeX and biblatex?

Related

How to import a package in Latex3? The package is a ".sty" file

The first.sty file is below:
%\iffalse
%
%<*driver|package>
\RequirePackage{expl3}
%</driver|package>
%
%<*package>
\NeedsTeXFormat{LaTeX2e}[2022/5/13 v2.02 First latex project]
%</package>
%
%<*driver>
\documentclass[full]{l3doc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{jobname.dtx}
\end{document}
%</driver>
%\fi
%
%
% \begin{macro}{\second}
% this is an example of using l3 cs command
% \begin{macrocode}
\cs_new:Npn \second:n #1 { THIS IS SECONDCOMMAND #1 }
% \end{macrocode}
% \end{macro}
%
% \Finale
% \printindex
%\endinput
The first.tex file is below:
\documentclass[full]{l3doc}
\usepackage{first}
\title{First Project Document}
\author{Carlos}
\begin{document}
\maketitle
\section{Introduction}
There's not much more to say right here.
This is where the user documentation for the simple tree example goes. \first
\end{document}
The first.tex run in the TexShop on Mac. There are some issues below:
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./test.6.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-04-20>
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo))
(/Users/focus/Library/texmf/tex/latex/latex3-packaging/first/first.sty
(/Users/focus/Library/texmf/tex/latex/l3kernel/expl3.sty
(/Users/focus/Library/texmf/tex/latex/l3backend/l3backend-pdftex.def))
/Users/focus/Library/texmf/tex/latex/latex3-packaging/first/first.sty:20: **Undef
ined control sequence.**
l.20 \cs
_new:Npn \second:n #1 { THIS IS SECONDCOMMAND #1 }
In the first.tex, import a package "first.sty". I separate the macro package "first.sty" from first.tex base on latex3's l3build file structure. So I focus on coding the macro in "first.sty".
The issue is that the "\second" do not recognize. Maybe need more syntax here. I am not sure which syntax it is. Please help me fix that.

LaTeX Error: Option clash for package hyperref

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\usepackage{graphicx}
\usepackage{float}
\usepackage{import}
% links Symbol
\usepackage{bbding,pifont}
\usepackage[hidelinks]{hyperref}
% Redefinition:
\let\orighref\href
\newcommand{\hrefa}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{...code}{#1}}
\newcommand{\hrefb}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{xxx/}{#1}}
\newcommand{\hrefc}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{ccc}{#1}}
\newcommand{\hrefd}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{vvv/}{#1}}
\newcommand{\hrefe}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{vvv}{#1}}
\newcommand{\hreff}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{vvv}{#1}}
% end links symbol
% personal data
\name{...}
\title{}
\address{..}{}{}
\phone[mobile]{+...4}
\email{xxx#a.com}
\extrainfo{\hrefd{xc.com}}
%\photo[64pt][0.4pt]{photo.jpg}
%----------------------------------------------------------------------------------
% content
%----------------------------------------------------------------------------------
\begin{document}
Error:
LaTeX Error: Option clash for package hyperref.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.40 \begin{document}
The package hyperref has already been loaded with options:
[hidelinks]
There has now been an attempt to load it with options
[unicode]
Adding the global options:
hidelinks,unicode
to your \documentclass declaration may fix this.
Try typing <return> to proceed.
when i try to convert to pdf, i get an empty html file.
The moderncv class automatically loads the hyperref package. You can use \PassOptionsToPackage{hidelinks}{hyperref} to make sure it is loaded with the options you want.
(although your hidelinks option won't make a big difference because moderncv sets the line width of the link boxes to zero, so they are already invisible)
\PassOptionsToPackage{hidelinks}{hyperref}
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\usepackage{graphicx}
\usepackage{float}
\usepackage{import}
% links Symbol
\usepackage{bbding,pifont}
% personal data
\name{...}
\title{}
\address{..}{}{}
\phone[mobile]{+...4}
\email{xxx#a.com}
%\extrainfo{\hrefd{xc.com}}
%\photo[64pt][0.4pt]{photo.jpg}
%----------------------------------------------------------------------------------
% content
%----------------------------------------------------------------------------------
\begin{document}
test
\url{stackoverflow.com}
\end{document}

Can't compile latex document

Can't compile an old document of my CV that requires additional latex libraries. Can someone recommend a tex variant that should handle it.
tried
latex
! Fatal Package fontspec Error: The fontspec package requires either XeTeX or
(fontspec) LuaTeX.
luatex
! Undefined control sequence.
l.1 \documentclass
[a4paper,10pt]{article}
xetex
I can't find the format file `xetex.fmt'!
Latex code
\documentclass[a4paper,10pt]{article}
%A Few Useful Packages
\usepackage{marvosym}
\usepackage{fontspec} %for loading fonts
\usepackage{xunicode,xltxtra,url,parskip} %other packages for formatting
\RequirePackage{color,graphicx}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[big]{layaureo} %better formatting of the A4 page
% an alternative to Layaureo can be ** \usepackage{fullpage} **
\usepackage{supertabular} %for Grades
\usepackage{titlesec} %custom \section
\usepackage{supertabular}
%Styling Itemizations
\usepackage{enumitem}
\setlist{nolistsep}
\setitemize[1]{labelindent=\parindent, label=$\triangleright$}
%Setup hyperref package, and colours for links
\usepackage{hyperref}
\definecolor{linkcolour}{rgb}{0,0.2,0.6}
\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour, linkcolor=linkcolour}
%FONTS
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule]
\titlespacing{\section}{0pt}{3pt}{3pt}
%Tweak a bit the top margin
\addtolength{\voffset}{-1.3cm}
worked fine compiling with
xelatex

Latex: PDF does not print the bibliography from the .bib file

I am trying to put the bibliography in my .tex file, but it does not work. I think I have still some problems with biber/biblatex. I already updated all biblatex files through miktex update manager. But I still become the error:
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) myfile
(biblatex) and rerun LaTeX afterwards.
and
empty bibliography
and so on.
I've tryed all possible things, nothing helped me.
And I do run correctly PDFLaTeX + Biblatex + 2PDFLaTeX.
I use TexMaker.
My preamble looks like this:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
%bibliography
\usepackage[backend=biber]{biblatex}
\addbibresource{references.bib}
\usepackage{csquotes}
\usepackage{tocbibind}

! LaTeX Error: Unknown float option `H'

I've encountered a problem trying to compile a LaTeX file:
\documentclass{article}
\usepackage{float}
...
\begin{document}
...
\begin{table}[H]
\caption{mycaption}
\end{table}
...
\end{document}
When I try to compile it, this error message is displayed:
! LaTeX Error: Unknown float option `H'.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
Any thoughts?

Resources