个性化阅读
专注于IT技术分析

如何使用Latex

一旦下载了软件MikTex和Texmaker, 你现在就可以启动Latex。这里使用Texmaker是因为它被认为是用作Latex编辑器的最佳软件。通过编辑器Texmaker使用Latex的步骤如下:

  • Latex中的所有命令都以反斜杠“ \”开头。
  • 第一步是打开用于Latex的Texmaker或任何相应的编辑器。
  • 在这里, 我们使用了Textmaker, 它看起来像下面的图片:
如何使用Latex

你可以单击文件菜单, 然后选择新建文件。现在, 你可以开始编程或在屏幕上编写代码。

  • 让我们通过一个例子来了解Latex编程或代码。我们将在屏幕上编写代码, 并在编译代码后打印相应的输出。如果有错误, 则在白色的底部窗口, 如上所示, 错误将与行号一起显示。
  • 该示例是打印“每日想法”。在Texmaker屏幕上写入了相同的代码。

代码如下:

\documentclass[a4paper]{article}
\begin{document}
\begin{center}
\begin{large}
\textbf{\LaTeX\ Thought of the day}\\
\end{large}

\end{center}

"Life is really liberal to those who pursue their personal legend."
\end{document}

说明:

{center}用于使文本与中心对齐。 \ textbf用于以粗体显示文本。 {large}是一种字体大小。

Texmaker屏幕上的相同代码如下图所示:

如何使用Latex

编写代码后, 保存文件, 然后单击顶部的“快速构建”选项以查看输出。

下图显示了此代码的输出:

如何使用Latex

同样, 你可以编写尽可能多的数据和命令来格式化文档。

这取决于用户, 他/她想在特定文档中使用哪种类型和样式。编写段落的另一个示例如下所示:

\documentclass[a4paper]{article}
\begin{document}
\begin{center}
\begin{huge}
\textit{\LaTeX\ Overview}\\
%'\\' is used to display the text in the new line
\end{huge}

\end{center}

\LaTeX\ uses more iteration and floating elements such as tables and the figures to make the document more refined and polished.%\ In between is used for the spacing
% here % command is used to write the comments which are ignored by the Latex and hence are not reflected in the output
It is a document typesetting system used for the publication of technical documents. Latex software not only saves time but also makes the text more attractive and refined. It is used by scientists, authors for the subjects such as mathematics, economics, psychology, engineering, etc. there are two types of editors available for the Latex, which are online and offline editors. It depends on the convenience and ease of the user to choose any particular editor for the Latex. The procedure to write the cost makes the user concentrate on the content instead of the format. It also has the feature of spell checking.
\end{document}.

Texmaker屏幕上的相同代码如下图所示:

如何使用Latex

下图显示了此代码的输出:

如何使用Latex

Latex如何工作?

使用Latex的第一步是使用编辑器创建文件, 并以.tex结尾。在此文件中, 你可以键入文档的文本以及用于设置其格式的命令。

有两种方法来打印.tex文件。方法如下:

1)传统方式是创建一个.dvi文件(与设备无关), 该文件具有二进制格式, 无法直接查看。出于查看目的, 你可以运行预览程序或PostScript程序, 并且可以通过GSView完成打印。

如何使用Latex

第二种方法是直接的, 但没有第一种方法快。

2)运行最新的相对pdflatex程序以创建PDF文件进行查看或打印的另一种替代方法。

如何使用Latex

赞(0)
未经允许不得转载:srcmini » 如何使用Latex

相关推荐

评论 抢沙发

评论前必须登录!