![不使用大量数学运算时格式化文本的正确方法](https://linux22.com/image/266847/%E4%B8%8D%E4%BD%BF%E7%94%A8%E5%A4%A7%E9%87%8F%E6%95%B0%E5%AD%A6%E8%BF%90%E7%AE%97%E6%97%B6%E6%A0%BC%E5%BC%8F%E5%8C%96%E6%96%87%E6%9C%AC%E7%9A%84%E6%AD%A3%E7%A1%AE%E6%96%B9%E6%B3%95.png)
我对文本格式感到困惑,我几乎到处都能看到这个\text
命令,我相信它是amsmath
包的一部分?
如果我主要进行写作,并且只进行一点数学运算,那么是否\text
最好使用命令,或者是否有另一种更适合 Latex 的方法,而无需使用amsmath
用于格式化文本的包?
答案1
要编写一份不需要太多数学运算的简单文档,您不需要做任何特殊的事情;当然您也不需要宏\text
。
\documentclass[a4paper,10pt]{article}
%% Uncomment the following line to use an AMSmath equation
%\usepackage{amsmath}
\title{A simple document consisting mostly of text}
\author{Niel de Beaudrap}
\begin{document}
\maketitle
\section{A section title}
The following is a simple displayed un-numbered equation.
\[
E = mc^2
\]
%% Uncomment the following as desired.
% In many cases, it's useful to use an equation environment
% from the AMSmath package. The following is a simple example
% which gives the displayed equation a number:
%\begin{equation}
% \mathbf{F} := \frac{\mathrm{d}}{\mathrm{d}t} \mathbf{p}
%\end{equation}
You can write as much prose as you want outside of the math environments
you use (indeed, you don't have to use \emph{any} math environments if
you don't want to).
\end{document}
试试看。你可能想调查一下一些简单的 LaTeX 入门参考,如果您从头开始。