Tag Archives: Latex

Vs code solves the problem that latex does not display references and [?] is displayed in the text

After compiling, display without reference:

solution:

    compile to make sure that there are. Aux files in the same directory folder as. Tex. click Terminal – & gt; new terminal on the top navigation bar of vscode to export the console. Enter the command: BibTex will automatically prompt the file name, and then recompile to display the references

    Note: if the reference is displayed, but the text is [?], note that the quotation of latex is: balabalabalab , there is a space between the text and , or compile twice !

Something‘s wrong–perhaps a missing \item. \begin{thebibliography}{1}

Using textstudio, we encountered a small error

Source code:

\begin{thebibliography}{}
\bibliographystyle{aaa} % template
\bibliography{references} % references
%
% and use \bibitem to create references. Consult the Instructions
% for authors for reference list style.
%
\item{a}
% Format for Journal Reference
Author, Article title, Journal, Volume, page numbers (year)
% Format for books
%\bibitem{b}
Author, Book title, page numbers. Publisher, place (year)
% etc
\end{thebibliography}

report errors:

Something’s wrong–perhaps a missing \item. \begin{thebibliography}{1}

After checking for a long time, I didn’t find the reason, and the online method was also wrong. Later, I found that I made a low-level mistake: the template file and the bib file were misplaced.

Solution: will

\bibliographystyle{spbasic} % template
\bibliography{references} % references

Put in

\begin{thebibliography}{}

\End {the bibliography}
just ahead of this interval.

How to use latex argmin argmax subscript

this series of articles was published by

@yhl_ leo

products, reprint please indicate the source.

Article link:

http://blog.csdn.net/yhl_ leo/article/details/50036001


In latex, when using argmin , argmax , the following methods can be used to set subscripts:

\begin{equation}
	\mathop{\arg\min}_{\theta} \ \ \| \mathrm{J} (\theta)\|.
\end{equation}

arg

min

θ

By the way,

Road8741;

J

(

θ

)

Road8741;

[gasps]

\mathop{\arg\min_{\theta}} \ \.mathrm{J} (\theta)\.

Argθmin Shenzhen 8741; J(θ)8741;.

One of the common mistakes of tex

1: “Latex” is reported in compile! paragraph complete ended before \align was complete”,

Compile code:

\begin{align}\label{LL:01}
q_ s(o_ s(t))=(1+\phi_ s(t))o_ s(t) \\
\end{align}

\begin{align*}\label{LL:01}
q_ s(o_ s(t))=(1+\phi_ s(t))o_ s(t)
\end{align*}

Solution:

\Usepackage {amsmath}
is used in formula environment.

This example can be changed to:
– begin {equation} label {LL: 01}
– begin {aligned}

q_ s(o_ s(t))=(1+\phi_ s(t))o_ s(t) \\
\end{aligned}
\end{equation}

Effect of operation

Appendix:

Latex Download Center: http://www.ctex.org/CTeXDownload/

[study notes] a quick search of latex mathematical symbols

Basic operation

    multiplication

    x

    ×

    y

    x \times y

    X × y
    x times y power

    two

    three

    x

    2^{3x}

    23x
    2 ^ {3x} square root

    x

    +

    y

    \sqrt {x + y}

    x+y

    \ sqrt {x + y} Division

    x

    ÷

    y

    x \div y

    X △ y
    x / div y score

    x

    y

    \frac{x}{y}

    YX
    \ frac {x} {y} XOR

    \oplus


    \ oplus is less than or equal to

    x

    y

    x \leq y

    X ≤ y
    x / Leq y is greater than or equal to

    x

    y

    x \geq y

    X ≥ y
    x / GEQ y is not equal to

    x

    y

    x \neq y

    X  = y
    x / NEQ y round down

    x

    \lfloor x \rfloor

    ⌊ x ⌋
    – round up

    x

    \lceil x \rceil

    ⌈ x ⌉
    \sum\limits_ {x = 1} ^ {n} 7x integral

    0

    π

    two

    sin

    (

    x

    )

    \int_ {0}^{\frac{\pi}{2}} \sin(x)

    ∫02π​​sin(x)
    \int_ {0}^{\frac{\pi}{2}} \sin(x)

Set symbol

    belongs to

    A

    B

    A \in B

    A ∈ B
    A / in B does not belong to

    A

    B

    A \notin B

    A ∈ / b
    A / notin B subset

    A

    B

    A \subset B

    A⊂B
    A \subet B

Greek alphabet

    α

    \alpha

    α \alpha

    β

    \beta

    β \beta

    θ

    \theta

    θ \theta

    π

    \pi

    π \pi

Vector matrix

    vector $/ VEC {V} $
    / VEC {V} matrix

    $
    \begin{pmatrix}
    a_ n\
    1
    \end{pmatrix}

    \begin{pmatrix}
    A&B\
    0&1
    \end{pmatrix}
    \times
    \begin{pmatrix}
    a_ {n-1}\
    1
    \end{pmatrix}
    $

The use of BibTex

BibTex is used as the reference format management library of latex documents.

The operation steps are as follows:

Step 1: create a BibTex file;

Create a new TXT file and change the suffix to bib, that is, create a BibTex reference library. For example, the name of the created BibTex library is: ref.bib .

Step 2: add the content of the quoted article;
0

Copy the BibTex format content of the document to be quoted to ref.bib The BibTex content of a document to be cited is as follows:
the BibTex content of a document to be cited is as follows:

@Inbook{Wille1982,
author="Wille, Rudolf",
editor="Rival, Ivan",
title="Restructuring Lattice Theory: An Approach Based on Hierarchies of Concepts",
bookTitle="Ordered Sets: Proceedings of the NATO Advanced Study Institute held at Banff, Canada, August 28 to September 12, 1981",
year="1982",
publisher="Springer Netherlands",
address="Dordrecht",
pages="445--470",
isbn="978-94-009-7798-3",
doi="10.1007/978-94-009-7798-3_15",
url="http://dx.doi.org/10.1007/978-94-009-7798-3_15"
}

Step 3: add cite package to latex document;

Add package reference to latex document: usepackage {cite}.

Step 4: add reference configuration;
Step 4: add reference configuration

Add the BibTex library reference in latex document. Where you want to display the references, you can add the following contents:

\bibliographystyle{plain}
\bibliography{ref}

\The bibliography {ref} command specifies the previously generated. Bib library.

The common default styles are as follows:

1 Alpha, using the first letter of the author’s name + the last two digits of the year as the label, in alphabetical order;
4. Abbrv, similar to plain, change the full spelling of the month to abbreviation, which is more compact;
5. IEEE TR, journal style of International Association of electrical and electronic engineers;
6. ACM, journal style of American Society of computer science;
7. Siam, journal style of American Society of industrial and applied mathematics;
8 Apalike, the journal style of American Psychological Society;
a

Step 5: Add Reference;

The quotation format is as follows:

\cite{Wille1982}

The content in the curly brackets is the first line of the quotation format of the related literature.

Step 6: the process of generating PDF;

1. Compile latex document with latex;

2. Compile Bib document with BibTex;

3. Using latex to compile latex documents;

4. View PDF through dvipdf.

Three ways of latex supporting Chinese

Cjkutf8ctex’s utf8 option (I use) xelatex compilation

We know that latex generally uses CJK and CTeX macro package to support Chinese editing. The default encoding of CJK and CTeX is GBK, while the silent encoding under windows is GBK. Therefore, CJK and CTeX can directly support Chinese latex compilation without special configuration, just save the file with GBK encoding. But if the character encoding of the file is changed to UTF-8, which is more common now, how should it be operated? There are three ways to use it.

CJKutf8

CJK has two basic macro packages: CJK and cjkutf8. The latter is oriented to UTF-8 encoding, and its general usage is as follows:

\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{}

\end{CJK}
\end{document}

%test.tex
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{gbsn}
This is an example of CJKutf8, and the font used is gbsn.
\end{CJK}
\end{document}

The output result can be obtained by compiling tex file with pdflatex.

Utf8 option of CTeX (I use it)

Cjkutf8 above only provides two kinds of fonts, so the choice is too small. We can directly use utf8 option to make CTeX support UTF-8 encoding. CTeX’s rich fonts and Chinese settings can better edit latex Chinese text, and its syntax format is as follows:

\documentclass[UTF8]{article}
\usepackage{CTEX}
\begin{document}

\end{document}

Or, use ctexart directly

\documentclass[UTF8]{ctexart}
\begin{document}

\end{document}

% ctex_test.tex
\documentclass[UTF8]{ctexart}
\begin{document}
This is a CTEX utf-8 encoding example, {\kaishu is shown here in italic}, {\songti is shown here in Song}, {\heiti is shown here in bold}, {\fangsong is shown here in imitation Song}.
\end{document}

Xelatex compilation

Xetex is a tex typesetting engine that uses Unicode. It supports Unicode natively and its input file is UTF-8 by default. Xetex can directly use fonts installed in the operating system without additional configuration. Xelatex is a typesetting engine that uses latex. It also has the advantages of xetex. If you use xelatex * *. Tex directly under the command, the corresponding PDF file will be generated. Here is a simple example of how to compile CTeX with xelatex (also save the Tex file in UTF-8 format)

% xelatex_test.tex
\documentclass{article}
\usepackage{CTEX}
\begin{document}
This is a CTEX utf-8 encoding example, {\kaishu is shown here in italic}, {\songti is shown here in Song}, {\heiti is shown here in bold}, {\fangsong is shown here in imitation Song}.
\end{document}

Mingyan’s students found that compared with the CTeX code in Item 2 above, this product lacks a utf8 option! Well, on the surface, it looks like this, but if you just put xelatex_ test.tex Compile with pdflatex, the system will report an error. This is because without the utf8 option, pdflatex silently processes the Tex file according to the GBK encoding, and this file is encoded with UTF-8, which will cause decoding failure. If you directly compile with xelatex, it will be compiled successfully, because the default input file of xelatex is UTF-8 encoding. Switch to the directory where the Tex file is located, and directly compile the Tex file with xelatex: xelatex xelatex_ test.tex The following output results can be obtained,

Latex sets page margin, page size, page margin and geometry macro package

Many latex templates have set the margins of the page, so you don’t need to modify them. But sometimes you need to set the margins by yourself. Looking up the relevant information, we find that using the geometry macro package can easily adjust the margins.

\usepackage{geometry}

\geometry{a4paper,scale=0.8}

The above command sets the paper as A4, and the proportion of the page center to the page length is 80%; scale can also be changed to ratio, indicating the proportion of the page margin to the page length. The macro package can also set the top, bottom, left and right margins of the page, for example:

\geometry{a4paper,left=2cm,right=2cm,top=1cm,bottom=1cm}

Greek alphabet pronunciation table and its latex command

Latin alphabet is 26, Greek alphabet is 24, pronunciation is their respective latex form, capital letter is its lowercase latex initial capitalized form, such as(

Δ

When Western mathematicians deduce mathematical theorems, they still use Greek letters which are not easy to write and remember. This shows the great influence of the Renaissance and Greek mathematics on later generations. Pay attention to the distinction

Δ

(pronounced Delta for increment) and

(it’s pronounced nabla, which means differential. It doesn’t belong to the Greek alphabet. It’s just a sign for differential operator.)

lowercase uppercase latex

α

A

\alpha
β

B

\beta
γ

Γ

\gamma

δ

Δ

\delta

ϵ

E

\epsilon
ζ

Z

\zeta
ν

N

\nu
ξ

Ξ

\xi

ο

O

\omicron
π

Π

\pi

ρ

P

\rho
σ

Σ

\sigma

η

H

\eta
θ

Θ

\theta

ι

I

\iota
κ

K

\kappa
λ

Λ

\lambda

μ

M

\mu
τ

T

\tau
υ

Υ

\upsilon

ϕ

Φ

\phi,(

φ

\varphi

χ

X

\chi
ψ

Ψ

\psi

ω

Ω

\omega