References in LaTeX BibLaTeX

Posted by jsinker on Fri, 11 Feb 2022 21:29:44 +0100

References in LaTeX BibLaTeX


This lecture mainly explains the method of using BibLaTeX tool to typeset references in LaTeX. Its basic idea is still "one-time management, multiple use".

1, Introduction

These files are compiled by the reference files of TEX and libibex macro. These files are a kind of reference files written by the reference files of TEX and libibex macro.

Writing and maintenance are relatively simple.

The biber tool also supports typesetting based on localized sorting.

For example, you can specify sorting by Pinyin by parameter or by stroke by parameter.

2, Disposition

In order to use the biber sorting engine in TexStudio, you need to set TexStudio accordingly.

(1) Open Settings

(2) Set the "default document tool" in the "build" operation to * * * Biber***

3, Reference database file

Prepare reference database files and bib files.

The reference database file contains the basic information of the references.

Reference code:

@book{mittelbach2004,
title = {The {{\LaTeX}} Companion},
publisher = {Addison-Wesley},
year = {2004},
author = {Frank Mittelbach and Michel Goossens},
series = {Tools and Techniques for Computer Typesetting},
address = {Boston},
edition={Second}
}

@article{patashnik1984bibtex,
	title={BIBTEX 101},
	author={Patashnik, Oren},
	year={1984}
}


@article{__nodate,
	title = {Research progress of battery thermal management system based on phase change heat storage technology},
	issn = {1000-6613},
	url = {https://kns.cnki.net/kns8/Detail?sfield=fn&QueryID=1&CurRec=5&recid=&FileName=HGJZ20220105002&DbName=CAPJLAST&DbCode=CAPJ&yx=Y&pr=&URLID=11.1954.TQ.20220106.1135.001},
	abstract = {The optimum operating temperature range of power battery is 20 ℃~50℃,Therefore, thermal management system is an integral part of its operation. Phase change heat storage materials can absorb or release a lot of heat when phase change occurs, and the temperature remains basically unchanged. They are widely used in battery thermal management. This paper summarizes the research progress of battery thermal management system based on phase change heat storage technology at home and abroad, and mainly introduces the passive thermal management system based on phase change materials, active thermal management system and the coupling thermal management system combining active and passive. Overall, the composite phase change material has good shape stability and high thermal conductivity, which can effectively reduce the temperature of the battery pack and improve the temperature uniformity of the battery pack. The electrothermal conversion characteristics of conductive composite phase change materials can also be used to quickly heat the battery at low temperature to realize heating-Cooling integration. However, in the passive thermal management system of phase change materials, the heat absorbed by phase change materials can not be released in time...},
	language = {chinese},
	urldate = {2022-02-09},
	journal = {Progress in chemical industry},
	author = {Luo, Ming Yun and Ling, Midnight and square, Xiaoming and Zhang, Zhengguo},
	pages = {1--21},
}

@article{__2022,
	title = {New energy vehicle power battery and its application analysis},
	issn = {1672-9668},
	url = {https://kns.cnki.net/kns8/Detail?sfield=fn&QueryID=1&CurRec=6&recid=&FileName=SDQE202202050&DbName=CJFDLAST2022&DbCode=CJFD&yx=&pr=&URLID=},
	abstract = {With the rapid development of economy,The problem of environmental pollution has become increasingly prominent,The exhaust emission of fuel vehicles is also one of the important causes of environmental pollution. Extensive use of new energy vehicles,Reducing emissions is an important way to solve emission pollution. Power battery is one of the technical cores of new energy vehicles,Development of new energy vehicles,Played a very good role in promoting. Artificial intelligence, big data and new energy vehicles have become the main direction and trend of current development. therefore,Firstly, this paper puts forward the main content and background to be explored,Then combine different new energy vehicle power batteries,Targeted exploration and reasonable application path.},
	language = {chinese;},
	number = {02},
	urldate = {2022-02-09},
	journal = {Era car},
	author = {week, Bin},
	year = {2022},
	pages = {114--115},
}

@article{__2022-1,
	title = {Development characteristics and trend analysis of new energy vehicle power battery industry},
	issn = {1671-6329},
	url = {https://kns.cnki.net/kns8/Detail?sfield=fn&QueryID=1&CurRec=7&recid=&FileName=QCWZ202201001&DbName=CJFDLAST2022&DbCode=CJFD&yx=&pr=&URLID=},
	abstract = {With the continuous development of new energy vehicle industry,Accordingly, it drives the continuous progress of the power battery industry. After the impact of the epidemic in 2020,2021 In, the power battery industry showed four characteristics:(1)The state's macro support policies continue to work;(2)The increase of sales volume of new energy vehicles drives the continuous growth of power battery demand,The market share of lithium iron phosphate battery continues to increase;(3)The resources represented by upstream lithium, cobalt and nickel will become scarce resources,Enterprises to implement vertical integration has become a trend;(4)The competition among power battery enterprises has become white hot,The enterprise continues to make efforts in capacity layout and joint venture cooperation.},
	language = {chinese;},
	number = {01},
	urldate = {2022-02-09},
	journal = {Automotive Digest },
	author = {Left, Peiwen and Zhu, Peipei and Shao, Liqing},
	year = {2022},
	pages = {1--7},
}

@online{6-1,
	title = {PACS-L: the public-access computer systems forum},
	type = {EB/OL},
	location = {Houston,Tex},
	publisher = {University of Houston Libraries},
	year = {1989},
	url = {https://info.lib.uh.edu/pacsl.html},
	urldate = {1995-05-17},
	language = {english},
}

Save the references needed in the same directory as the tex file, with the suffix of bib.

4, References

1. Import macro package

In the tex file, we can use the usepackage command to introduce the biblatex macro package.

And specify the necessary parameters.

For example, specify the style as numeric and the backend as biber.

2. Add reference database

In the introduction area, use the addbibresource command to add the reference database.

Note that the file suffix bib cannot be omitted!

3. References cited in different ways

In the body area, you can use the corresponding cite command to reference references in different ways, such as unformatted references, bracketed references, superscript references, etc.

Note that in the curly brackets are the citation marks that need to quote references.

For example:

Then quote as follows:

Similarly, we can cite references in different ways:

4. Output reference list

Use the printbibliography command to output a list of references where needed.

5. Compilation execution

After we write the above operations, compile and execute.

Pay attention to the compilation process.

(1) The first is the compilation of xelatex to generate aux auxiliary files.

aux auxiliary file:

(2) Then use the biber back-end program to compile the auxiliary file and generate the bbl file.

Generate bbl file:

There will also be in the folder:

(3) Finally, compile with xelatex again.

(4) Final result

View the final result of compilation execution:

6. Modify title

Note that the title of the References in the compilation result is English "References".

This can be modified by using the title Parameter in the parameters of the printbibliography command.

For example, change to Chinese "references".

Note that when compiling again, you need to clean up the auxiliary files first.

Click "OK".

In the folder, you only need these two files.

Then we compile again and check the results:

As you can see, the title has been changed to the "references" we set.

7. List references that are not cited

Use the nocite command to list references that are not cited.

The parameter * indicates all references that are not cited.

You can also use the reference flag to list the specified unreferenced documents. Because the reference database needs to be recompiled, you need to clean up the auxiliary files generated by the last compilation first.

Compile and view results:

8. More styles

If you need more styles, you need to write corresponding style files. Let's introduce a style file prepared by CasperVector that conforms to the national standard 7714.

Note: for versions above TexLive2016, you can directly quote biblatex seasonal style=gb7714-2015. There is no need to download CasperVector.

Open its homepage.

Download a compressed package of style files.

Save to the corresponding path (you can set it yourself), then unzip and open the tex folder.

Locate reference style file * * * bbx file * * * and reference style file * * * cbx file * * *.

Copy these files to the current working directory (i.e. under the tex file directory).

You can open these bbx and cbx style files in TexStudio.

View, edit and modify.

Then, in the introduction area, change the style parameter of the biblatex macro package to caspervector, and specify the encoding format as utf8 format.

View results:

It is found that the Chinese and English documents in the results are mixed. In order to solve this problem, it is necessary to specify the sorting parameters for the biber tool.

We need to make relevant settings for TexStudio.

In the original command settings, find the Biber command and add corresponding parameters to the Biber command.

For example, add this.

We copied it- l zh__pinyin

Then click OK.

Compile and run again and find that the result has not changed.

In order to correctly sort the references, you need to specify the sorting parameter for the biblitex macro package.

Here, specify the sorting parameter as percent. (c stands for Chinese, e stands for English, n stands for the author's name, t stands for the title of the document, and y stands for the year of publication)

That is, the language field is first Chinese, then English, and sorted according to the name, title and year of publication field.

Check the result of compilation execution and report an error:

See a j seemingly solution on the Internet:

If we set it to none, nothing will change.

Change it to nty and try:

I don't know why centy doesn't support it. Let's write it like this (nty) for the time being.

For a detailed description of the caspervector style, please use the texdoc command to consult its user manual.

5, bat batch processing

In addition to using biblatex and biber engines in TexStudio, you can also use bat batch files to perform corresponding compilation operations.

Open the current working path and ensure that there are LaTeX source files (tex is the suffix), reference database files (bib is the suffix), and reference file style files (bbx and cbx are the suffix).

Other files can be deleted.

In the current folder, right-click to create a new "text document".

Change the suffix to bat (indicating that it is a batch file) and give it a name, such as bulid bat.

Generate batch file:

Right click Edit to edit the file.

Then enter the following:

xelatex Test0210
biber -l zh__pinyin Test0210
xelatex Test0210
xelatex Test0210
del *.aux *.bbl *.bcf *.blg *.log *.xml

Explanation:

(1) First, compile with xelatex (write the name of the tex file – I started it myself. This is Test0210) to generate aux auxiliary files.

(2) Then use the biber engine to compile the aux auxiliary file and generate the bbl auxiliary file with the Pinyin sorting parameter (- L zh_pinyin).

(3) (4) compile with xelatex twice. Generate final results.

(5) Finally, use del command to delete unnecessary files.

Then save.

Double click to execute the batch file.

In process:

When finished, view the generated pdf file.

View the final layout results.

When the compilation process is complex, you can consider using a similar bat file for compilation.

6, tex file code

tex file code:

%Introduction area
\documentclass{ctexart}
 
%\usepackage{ctex}

%biblatex / biber
%new TEX Reference typesetting engine
%Style files (references)--bbx Files, referencing style files--cbx)use LATEX to write
%Support local typesetting, such as:
%	biber -l zh__pinyin texfile,Used to specify sorting by pinyin
%	biber -l zh__stroke texfile,Used to sort by stroke

\usepackage[style=caspervector,backend=biber,utf8,sorting=nty]{biblatex}
\addbibresource{test.bib}

%Text area (manuscript area)
\begin{document}
	%One management, multiple applications
	No formatted reference \cite{mittelbach2004}
	
	Bracketed references \parencite{__nodate}
	
	Superscript reference \supercite{6-1}
	
	\nocite{*}
	\printbibliography[title={reference}]
	
\end{document}

Topics: Latex