我在LaTeX中练习,遇到了这样的问题:
! Missing $ inserted.
<inserted text>
$
l.28 \begin{flushleft}
代码
\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage{textcomp}
\usepackage[english,russian]{babel}
\usepackage{amsmath, amssymb}
\usepackage{geometry} % Меняем поля страницы
\geometry{left=2cm}% левое поле
\geometry{right=1.5cm}% правое поле
\geometry{top=1cm}% верхнее поле
\geometry{bottom=2cm}% нижнее поле
\begin{document}
30.4 в \\
$\sqrt{\frac{5x-1}{x+3}} = 2$ \\
$\frac{5x-1}{x+3} = 4, x\neq -3$ \\
$5x-1 = 4x+12$ \\
$x = 11$ \\
Ответ: 11.\\ \\
30.6 в \\
$\sqrt{3x+4} = \sqrt{5x+2} $
\begin{equation*}
\begin{flushleft}
\begin{cases}
3x+4 \ge 0 \\
5x+2 \ge 0
\end{cases}
\begin{cases}
x\ge -1.25 \\
x \ge -0.4
\end{cases}
\rightarrow D(x) \in [-0.4; +\infty) \\
\end{flushleft}
\end{equation*}
$3x+4=5x+2$ \\
$2 = 2x$ \\
$x = 1$ \\
$x \in D(x)$ \\
Ответ: 1. \\ \\
30.11 в \\
$\sqrt{15+3x} = 1-x, x\le 1 \Rightarrow D(x) \in (-\infty; 1] $\\
$15+3x = x^2-2x+1$ \\
$x^2 - 5x - 14 = 0$ \\
$D = 25+4 \cdot 14 = 25 + 56 = 81$ \\
$x_1 = \frac{5+9}{2} = 7$ \\
$x_2 = \frac{5-9}{2} = -2$ \\
$x_1 \not\in D(x)$ \\
Ответ: -2. \\ \\
30.18 в \\
$\sqrt{x^2+x+1} = x+2, x\ge -2 \rightarrow D(x) \in [-2; +\infty) $ \\
$x^2+x+1 = x^2 + 4x + 4$ \\
$3x = -3$ \\
$x = -1$ \\
Ответ: -1. \\ \\
30.21 в \\
$\sqrt{3x+1} + \sqrt{x-4} = 2\sqrt{x} $
\begin{equation*}
\begin{flushleft}
\begin{cases}
3x+1 \ge 0 \\
x-4 \ge 0 \\
x \ge 0 \\
\end{cases}
\begin{cases}
x \ge -\frac{1}{3} \\
x \ge 4 \\
x \ge 0\\
\end{cases}
\Rightarrow D(x) \in [4; +\infty) \\
\end{flushleft}
\end{equation*}
$3x+1+x-4 +2\sqrt{(3x+1)(x-4)} = 4x$ \\
$4x-3+2\sqrt{3x^2-11x -4 } = 4x $ \\
$2\sqrt{3x^2-11x-4}=3 $
$12x^2-44x-16=9$ \\
$12x^2-44x-25 = 0$ \\
$D_1 = 22^2 + 12 \cdot 25 = 484 +300 = 784$ \\
$x_1 = \frac{22+28}{12} = \frac{25}{6} = 4\frac{1}{6}$ \\
$x_2 = \frac{22-28}{12} = -\frac{1}{2}$ \\
$x_2 \not\in D(x)$ \\
Ответ: $4\frac{1}{6}$\\
\end{document}
我尝试在方程组中放入 $$,但没有用。这个错误的原因是什么?如何缩进解决方案,以便在视觉上将其与作业编号区分开来?
答案1
- 我还添加了
T1 fontenc
俄语语言或字符的重音(或特殊字符)的可能问题; 我已经添加了
\usepackage[english,main=russian]{babel}
https://ctan.math.illinois.edu/macros/latex/contrib/babel-contrib/russian/russianb.pdf声明你的俄语为主要文本(见第 4 页)。我已将主要问题删除
\begin{flushleft} ...\end{flushleft}
到环境中,\begin{equation}....\end{equation}
因为该flushleft
环境用于将文本左对齐而不是对齐到等式中(介于两者之间的所有文本\begin{flushleft}
都是\end{flushleft}
左对齐的)。
\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T2A,T1]{fontenc}
\usepackage{textcomp}
\usepackage[english,main=russian]{babel}
\usepackage{amsmath, amssymb}
\usepackage{geometry} % Меняем поля страницы
\geometry{left=2cm}% левое поле
\geometry{right=1.5cm}% правое поле
\geometry{top=1cm}% верхнее поле
\geometry{bottom=2cm}% нижнее поле
\begin{document}
30.4 в \\
$\sqrt{\frac{5x-1}{x+3}} = 2$ \\
$\frac{5x-1}{x+3} = 4, x\neq -3$ \\
$5x-1 = 4x+12$ \\
$x = 11$ \\
Ответ: 11.\\ \\
30.6 в \\
$\sqrt{3x+4} = \sqrt{5x+2} $
\begin{equation*}
\begin{cases}
3x+4 \ge 0 \\
5x+2 \ge 0
\end{cases}
\begin{cases}
x\ge -1.25 \\
x \ge -0.4
\end{cases}
\rightarrow D(x) \in [-0.4; +\infty) \\
\end{equation*}
$3x+4=5x+2$ \\
$2 = 2x$ \\
$x = 1$ \\
$x \in D(x)$ \\
Ответ: 1. \\ \\
30.11 в \\
$\sqrt{15+3x} = 1-x, x\le 1 \Rightarrow D(x) \in (-\infty; 1] $\\
$15+3x = x^2-2x+1$ \\
$x^2 - 5x - 14 = 0$ \\
$D = 25+4 \cdot 14 = 25 + 56 = 81$ \\
$x_1 = \frac{5+9}{2} = 7$ \\
$x_2 = \frac{5-9}{2} = -2$ \\
$x_1 \not\in D(x)$ \\
Ответ: -2. \\ \\
30.18 в \\
$\sqrt{x^2+x+1} = x+2, x\ge -2 \rightarrow D(x) \in [-2; +\infty) $ \\
$x^2+x+1 = x^2 + 4x + 4$ \\
$3x = -3$ \\
$x = -1$ \\
Ответ: -1. \\ \\
30.21 в \\
$\sqrt{3x+1} + \sqrt{x-4} = 2\sqrt{x} $
\begin{equation*}
\begin{cases}
3x+1 \ge 0 \\
x-4 \ge 0 \\
x \ge 0 \\
\end{cases}
\begin{cases}
x \ge -\frac{1}{3} \\
x \ge 4 \\
x \ge 0\\
\end{cases}
\Rightarrow D(x) \in [4; +\infty) \\
\end{equation*}
$3x+1+x-4 +2\sqrt{(3x+1)(x-4)} = 4x$ \\
$4x-3+2\sqrt{3x^2-11x -4 } = 4x $ \\
$2\sqrt{3x^2-11x-4}=3 $
$12x^2-44x-16=9$ \\
$12x^2-44x-25 = 0$ \\
$D_1 = 22^2 + 12 \cdot 25 = 484 +300 = 784$ \\
$x_1 = \frac{22+28}{12} = \frac{25}{6} = 4\frac{1}{6}$ \\
$x_2 = \frac{22-28}{12} = -\frac{1}{2}$ \\
$x_2 \not\in D(x)$ \\
Ответ: $4\frac{1}{6}$\\
\end{document}