Perfect solution--latex runs normally, but there is a problem with the formula display. The latex formula does not display the equal sign = and the plus sign +

Insert image description here



1. Problem presentation

Latex runs normally, but there is a problem with the formula display. The latex formula does not display the equal sign = and plus sign.+

2. Analyze the reasons

  1. Editor issue: The editor we are using may not render the equals and plus signs correctly. We can try to open the PDF file to see if the formula is displayed correctly.
  2. Font issues: The one we are using 字体may not support these mathematical symbols. We can try changing the font or adding appropriate macro packages.
  3. Conflicts with other macro packages: There may be others in our code 宏包引起的冲突that may interfere with the display of symbols. We can try 删除部分宏包and add them one by one to determine the source of the problem.

3. My solution

Delete the conflicting macro package \usepackage{txfonts}and add another macro package \usepackage{amsmath}, perfect solution! !

% \usepackage{
    
    txfonts}
\usepackage{
    
    amsmath}

4. What is the \usepackage{txfonts} macro package?

\usepackage{txfonts}is a macro package that provides some simple but practical mathematical fonts and symbols. When you want to use this macro package, just add it to your LaTeX code \usepackage{txfonts}.

This macro package provides the following main functions:

  1. Mathematical fonts: This macro package provides some fashionable mathematical fonts, including Times, Helvetica, Courier, Helvetica Maths, Math Times, etc.

  2. Mathematical symbols: This macro package also provides some additional mathematical symbols, such as curly font (\mathscr{}), black font (\mathbb{}), bold font (\mathbf{}), etc.

At the same time, it is noted that the txfonts macro package has been replaced by more modern new fonts, such as newtxmath, newpxmath, stix2, etc. Therefore, it is recommended to choose and use an appropriate font macro package according to specific needs.

5. What is the \usepackage{amsmath} macro package?

\usepackage{amsmath}It is one of the most commonly used macro packages in LaTeX. It provides some powerful mathematical typesetting commands and environments, which can greatly simplify the typesetting of mathematical formulas.

The following are amsmathsome common functions provided by macro packages:

  1. Provides a variety of mathematical formula environments, such as align, gather, alignedetc., which can easily align formulas in multiple rows or columns.

  2. Provides some extended mathematical symbols and operators, such as \implies, \iff, \therefore, \because, \nabla, \partialetc.

  3. Provide some commands and environments for special needs such as equation systems and matrices, such as \begin{cases}, \begin{pmatrix}, \begin{matrix}etc.

  4. Provides mathematical commands and marking commands, such as \DeclareMathOperator, \newcommand, \tagetc.

In general, amsmaththe macro package provides LaTeX users with more convenient mathematical typesetting functions, allowing users to typeset high-quality mathematical formulas more easily.


Summarize

Therefore, we can conclude that \usepackage{txfonts}macro packages sometimes cause problems that conflict with the default settings of LaTeX, causing some formula symbols to not be displayed properly. The macro \usepackage{amsmath}package provides better formula typesetting functions, which can resolve some potential conflicts and provide more mathematical symbols and typesetting environments, making formulas easier to typeset. Therefore, we deleted the txfonts macro package and used the amsmath macro package, which may have solved the problem of formulas not being displayed properly. Note that in many cases it is recommended to use the amsmath package instead of the txfonts package to ensure that formulas are displayed correctly.

Guess you like

Origin blog.csdn.net/qlkaicx/article/details/131310349