Printing LaTeX

## Description

Here, we will have Sage print one of the solutions to the following quartic function as LaTeX output:

(1)
$$x^4 + x^3 + x^2 + x - 4 = 0$$

This is done using the latex() command.

## Sage Cell

When we run the output through LaTeX, we get:

(2)
\begin{align} x = \frac{1}{3} \cdot 5^{\frac{1}{3}} {\left(3 \, \sqrt{3} \sqrt{2} - 7\right)}^{\frac{1}{3}} - \frac{5^{\frac{2}{3}}}{3 \, {\left(3 \, \sqrt{3} \sqrt{2} - 7\right)}^{\frac{1}{3}}} - \frac{2}{3} \end{align}

This is not perfectly simplified, of course, but it is far more readable than Sage's normal output, and easier to simplify by hand.

#### Code

f(x) = x^4 + x^3 + x^2 + x - 4
answers = solve(f(x) == 0, x)

None

## Tags

Primary Tags—Sage: Formatting output

Secondary Tags—