Matrices
Содержание:
- Display math mode
- Another example
- Reference guide
- Changing the appearance of a table
- Inputting and including files
- Общее оформление документа
- Recent
- Vertical blank spaces
- Captions, labels and references
- Captions, labels and references
- Adding a Table of Contents
- Downloading your finished document
- В-третьих, выберите и настройте редактор
- Preamble in a separate file
- Using the import package
- Дистрибутивы[править]
- Редакторы[править]
- Introduction
- Inline math mode
- Комментировать код LaTeX
- Скачать TeXlive
- Combining rows and columns
- Positioning tables
- Simple commands
Display math mode
Use one of these constructions to typeset maths in display mode:
Display math mode has two versions which produce numbered or unnumbered equations. Let’s look at a basic example:
\documentclass{article}
\begin{document}
The mass-energy equivalence is described by the famous equation
\
discovered in 1905 by Albert Einstein.
In natural units ($c$ = 1), the formula expresses the identity
\begin{equation}
E=m
\end{equation}
\end{document}

Another example
The following example uses the environment which is provided by the package—see the article for more information.
\documentclass{article}
\usepackage{amsmath} % for the equation* environment
\begin{document}
This is a simple math expression \(\sqrt{x^2+1}\) inside text.
And this is also the same:
\begin{math}
\sqrt{x^2+1}
\end{math}
but by using another command.
This is a simple math expression without numbering
\
separated from text.
This is also the same:
\begin{displaymath}
\sqrt{x^2+1}
\end{displaymath}
\ldots and this:
\begin{equation*}
\sqrt{x^2+1}
\end{equation*}
\end{document}

Reference guide
Below is a table with some common maths symbols. For a more complete list see the List of Greek letters and math symbols:
| description | code | examples |
|---|---|---|
| Greek letters | $$ \alpha \ \beta \ \gamma \ \rho \ \sigma \ \delta \ \epsilon $$ | |
| Binary operators | ||
| Relation operators | ||
| Others |
Different classes of mathematical symbols are characterized by different formatting (for example, variables are italicized, but operators are not) and different spacing.
Changing the appearance of a table
Several table elements can be modified to suit the needs of your document. Below you will learn how to modify the line thickness, the line colour and the background colour of the cells in your table.
Line width and cell padding
The legibility of a table can sometimes be improved by incrementing the column spacing and row stretch.
\documentclass{article}
\setlength{\arrayrulewidth}{0.5mm}
\setlength{\tabcolsep}{18pt}
\renewcommand{\arraystretch}{1.5}
\begin{document}
\begin{tabular}{ |p{3cm}|p{3cm}|p{3cm}| }
\hline
\multicolumn{3}{|c|}{Country List} \\
\hline
Country Name or Area Name& ISO ALPHA 2 Code &ISO ALPHA 3 \\
\hline
Afghanistan & AF &AFG \\
Aland Islands & AX & ALA \\
Albania &AL & ALB \\
Algeria &DZ & DZA \\
American Samoa & AS & ASM \\
Andorra & AD & AND \\
Angola & AO & AGO \\
\hline
\end{tabular}
\end{document}

A description of the commands is provided below:
- This sets the thickness of the borders of the table. In the example is 0.5mm but you can use other units—see the article Lengths in LaTeX for a complete list.
- The space between the text and the left/right border of its containing cell is set to 18pt with this command. Again, you may use other units if needed.
- The height of each row is set to 1.5 relative to its default height.
Colour alternating rows
You can apply alternating colours to the rows of your table by using the package with the option, as demonstrated in the following example:
\documentclass{article}
\usepackage{xcolor}
\setlength{\arrayrulewidth}{0.5mm}
\setlength{\tabcolsep}{18pt}
\renewcommand{\arraystretch}{2.5}
\begin{document}
{\rowcolors{3}{green!80!yellow!50}{green!70!yellow!40}
\begin{tabular}{ |p{3cm}|p{3cm}|p{3cm}| }
\hline
\multicolumn{3}{|c|}{Country List} \\
\hline
Country Name or Area Name& ISO ALPHA 2 Code &ISO ALPHA 3 \\
\hline
Afghanistan & AF &AFG \\
Aland Islands & AX & ALA \\
Albania &AL & ALB \\
Algeria &DZ & DZA \\
American Samoa & AS & ASM \\
Andorra & AD & AND \\
Angola & AO & AGO \\
\hline
\end{tabular}
\end{document}

Notice the braces right before the command
\rowcolors{3}{green!80!yellow!50}{green!70!yellow!40}
and after the environment. The command takes three parameters each passed inside braces:
- the row to start,
- the colour for odd rows and
- the colour for even rows.
See the package documentation (at the section) for a list of available colours and how to create your own. In the example the colours green and yellow are mixed in different proportions.
For the command to work make sure to add
\usepackage{xcolor}
to the preamble of your LaTeX file.
Colouring a table (cells, rows, columns and lines)
All elements in a table can be customized to use a specific colour. Again, this functionality is provided by xcolor so you must add
\usepackage{xcolor}
to the preamble. Below you can see an example.
\documentclass{article}
\usepackage{xcolor}
\setlength{\arrayrulewidth}{1mm}
\setlength{\tabcolsep}{18pt}
\renewcommand{\arraystretch}{2.5}
\newcolumntype{s}{>{\columncolor{AAACED}} p{3cm}}
\arrayrulecolor{DB5800}
\begin{document}
\begin{tabular}{ |s|p{3cm}|p{3cm}| }
\hline
\rowcolor{lightgray} \multicolumn{3}{|c|}{Country List} \\
\hline
Country Name or Area Name& ISO ALPHA 2 Code &ISO ALPHA 3 \\
\hline
Afghanistan & AF &AFG \\
\rowcolor{gray}
Aland Islands & AX & ALA \\
Albania &AL & ALB \\
Algeria &DZ & DZA \\
American Samoa & AS & ASM \\
Andorra & AD & \cellcolor{AA0044} AND \\
Angola & AO & AGO \\
\hline
\end{tabular}
\end{document}

Below is a description about how to change the colour of each element in the table:
Colour of the lines. The command \arrayrulecolor is used for this. In the example an HTML format is used, but other formats are available too, see the xcolor documentation for a complete list (link provided at the further reading section).
Background colour of a cell. Use the command \cellcolor. You can either enter the name directly inside the braces (red, gray, green and so on) or pass a format parameter inside brackets (HTML in the example) and then set the desired colour inside the braces using the established format.
Background colour of a row. In this case \rowcolor will accomplish that. The same observations about colour selection mentioned in the two previous commands are valid for this one.
Background colour of a column. This one is a bit tricky, but the easiest way is to define a new column type. The command \newcolumntype{s}{>{\columncolor{AAACED}} p{3cm}}
define a column type called s whose alignment is p, the column width is 3cm and the colour is set with HTML format to AAACED. This new column type is used in the tabular environment.
Inputting and including files
The standard tools to insert a LaTeX file into another are and .
- command
Use this command in the document body to insert the contents of another file named ; this file should not contain any LaTeX preamble code (i.e. no , or ). LaTeX won’t start a new page before processing the material in . allows you to nest commands, in files that are already being inputted by the root file.
- command
Use this command in the document body to insert the contents of another file named ; again this file should not contain any LaTeX preamble.
LaTeX will start a new page before processing the material input from .
Make sure not to include the extension in the filename, as this will stop the file from being input (the extension can optionally be included with and ). It is not possible to nest commands. Each file that gets d has its own .aux file storing information of created labels and contents for the table of contents, list of figures, etc. You can use with a comma separated list of file names (make sure that there are no leading or trailing spaces). If you do this LaTeX will only process the files contained in that list. This can be used to enhance compilation speed if you’re only working on a small part of a bigger document. Page numbers and cross references will however still work, as the .aux files of left out files will still be processed.
Общее оформление документа
Начинается каждый документ с объявления типа документа (например article),
размера шрифта и других атрибутов.
Далее нужно подключать различные пакеты, без них мало что можно будет сделать.
Если Вы читаете эту статью со смартфона, имейте в виду, что никаких переносов делать не надо. Пишите
все команды слитно.
| \usepackage{inputenc} | Задаёт кодировку utf-8 |
| \usepackage{inputenc} | Задаёт кодировку cp1251 (если utf-8 вам не подходит) |
| \usepackage{babel} | Подключает языки |
| \usepackage{amsmath} | Подключает математический пакет |
| \usepackage{amsfonts} | Математические шрифты |
| \usepackage{graphicx} | Для графики |
| \usepackage{color} | Для цветного текста |
| \usepackage{alltt} | Позволяет писать текст, который интерпретируется буквально (включая несколько пробелов подряд. |
| \def\be{\begin{equation}} |
Определяет новую функцию — вместо того, чтобы писать всегда \begin{equation} достаточно написать \be |
| \def\ee{\end{equation}} | Aналогично для закрывания тега \be |
|
\inputencoding{cp1251} |
Кодировка |
| \begin{document} | Начинаем документ. |
| \input titlepage |
Вставляем титульный лист. Советую написать его отдельно чтобы не сбивать нумерацию страниц. Хранить нужно в той же папке (файл titlepage.tex). Во вставляемых листах не нужно отдельно писать documentclass и прочее, по логике это просто |
| \tableofcontents |
Вставляет автоматически сгенерированное оглавление. (каждый раз, когда тегом \section или \subsection или \subsubsection вводится новая глава LaTeX запоминает это и потом сам создает оглавление) |
| \section{Введение} | Первая глава будет называться «Введение» |
| \subsection{Состояние ядерной энергетики в мире} | Подпункт первой главы |
| \end{document} | Заканчиваем документ |
Таблицы и изображения имеют свойства появляться не там куда вы их хотите поместить, а там, куда их размещает LaTeX.
Теоретически с этим можно бороться с помощью одного из параметров:
Параметры , , всё более настойчиво будут
рекомендовать LaTeXу разместить объект именно там, где он и стоит.
Но у меня воспринимается за ошибку
а остальные почти никакого эффекта не дают.
Поэтому после некоторых рисунков приходится вставлять тег
— который воспринимается LaTeXом как конец той области куда можно вставлять объекты, введенные в код выше.
Тег
такого действия не имеет.
Recent
A very simple poster
A very simple 3-column poster, with a nice references and logos foot.
Sofia JIJON
Template for Preparing Networks journal submission
Template files for submission to Networks: An International Journal
Douglas Shier
Frontespizio Informatica UniPi
Frontespizio per tesi di laurea del CdL triennale in Informatica dell’Università di Pisa
Marco Antonio Corallo
Modelo Relatório de Estágio — FAENG
Esse modelo é para o Relatório de Estágio tanto para Obrigatório, quanto para Não Obrigatório. Esse modelo foi baseado no arquivo: Modelo TCC FAENG do Professor Rodolfo Verraschim
Jéssica Garcia
Unofficial Template for ANR proposals
Unofficial LaTeX template based on the official MS Word file produced by the ANR for the 2018-19 funding campaign.
Vincent Labatut
University of British Columbia Thesis Template
This latex template is acceptable by the University of British Columbia for MSc or PhD theses. It has been transferred to OverLeaf by Naba Mukhtar, and slightly updated in 2021 by Leah Edelstein-Keshet
Michael Forbes (2000)
Letter UniUD – Università degli Studi di Udine
This is the corporate style of University of Udine letter, according to the manual of style.
Luca Di Gaspero
CSE-3500 Algorithms & Complexity Homework Template
A homework template for UConn’s CSE-3500 Algorithms & Complexity course.
Derek Aguiar
ebookbook
LaTex e-book editable template that also typesets to the book about writing the book
Dominic Widdows
Vertical blank spaces
Vertical blank spaces have the same syntax as horizontal ones.
Text at the top of the page. Text at the top of the page.
Text at the top of the page. Text at the top of the page.
Text at the top of the page. Text at the top of the page.
Text at the top of the page.
\vspace{5mm} %5mm vertical space
This text still at the top, 5mm below the first paragraph.
\vfill
Text at the bottom of the page.

Let’s see the two commands that insert vertical blank spaces.
- Inserts a vertical spaces whose length is 5mm. Other LaTeX units can be used with this command.
- Inserts a blank space that will stretch accordingly to fill the vertical space available. That’s why the line «Text at the bottom of the page.» is moved to the bottom, and the rest of the space is filled in.
There are other three commands commonly used to insert vertical blank spaces
- Adds a 3pt space plus or minus 1pt depending on other factors (document type, available space, etc)
- Adds a 6pt space plus or minus 2pt depending on other factors (document type, available space, etc)
- Adds a 12pt space plus or minus 4pt depending on other factors (document type, available space, etc)
Captions, labels and references
Tables can be captioned, labelled and referenced by means of the environment.
\documentclass{article}
\begin{document}
Table \ref{table:1} is an example of a referenced \LaTeX{} element.
\begin{table}
\centering
\begin{tabular}{||c c c c||}
\hline
Col1 & Col2 & Col2 & Col3 \\
\hline\hline
1 & 6 & 87837 & 787 \\
2 & 7 & 78 & 5415 \\
3 & 545 & 778 & 7507 \\
4 & 545 & 18744 & 7560 \\
5 & 88 & 788 & 6344 \\
\hline
\end{tabular}
\caption{Table to test captions and labels.}
\label{table:1}
\end{table}
\end{document}

There are three important commands in the example:
- As you may expect this command sets the caption for the table. If you create a list of tables this caption will be used there. You can place it above or below the table.
- If you need to reference the table within your document, set a label with this command. The label will number the table and, when combined with the command, will allow you to reference it.
- This code will be substituted by the number corresponding to the referenced table.
Captions, labels and references
You can caption and reference tables in much the same way as images. The only difference is that instead of the environment, you use the environment.
Table \ref{table:data} is an example of referenced \LaTeX{} elements.
\begin{table}
\centering
\begin{tabular}{||c c c c||}
\hline
Col1 & Col2 & Col2 & Col3 \\
\hline\hline
1 & 6 & 87837 & 787 \\
2 & 7 & 78 & 5415 \\
3 & 545 & 778 & 7507 \\
4 & 545 & 18744 & 7560 \\
5 & 88 & 788 & 6344 \\
\hline
\end{tabular}
\caption{Table to test captions and labels}
\label{table:data}
\end{table}
Note: If you are using captions and references on your own computer, you will have to compile the document twice for the references to work. Overleaf will do this for you automatically.’
Adding a Table of Contents
To create the table of contents is straightforward, the command does all the work for you:
\documentclass{article}
\usepackage{inputenc}
\title{Sections and Chapters}
\author{Gubert Farnsworth}
\date{ }
\begin{document}
\maketitle
\tableofcontents
\section{Introduction}
This is the first section.
Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Etiam lobortisfacilisis sem. Nullam nec mi et
neque pharetra sollicitudin. Praesent imperdietmi nec ante.
Donec ullamcorper, felis non sodales...
\section*{Unnumbered Section}
\addcontentsline{toc}{section}{Unnumbered Section}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Etiam lobortis facilisissem. Nullam nec mi et neque pharetra
sollicitudin. Praesent imperdiet mi necante...
\section{Second Section}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Etiam lobortis facilisissem. Nullam nec mi et neque pharetra
sollicitudin. Praesent imperdiet mi necante...
\end{document}

Sections, subsections and chapters are automatically included in the table of contents. To manually add entries, for example when you want an unnumbered section, use the command as shown in the example.
Downloading your finished document
You can download your finished PDF from the left hand menu as above by clicking PDF. There is also the quicker option of clicking the Download PDF button on your PDF viewer as shown below.
В-третьих, выберите и настройте редактор
Прочитав некоторое время, я наконец решил выбрать TeXstudio.
Теперь начните настраивать TeXstudio :
1) Скачать TeXstudio
Адрес для скачивания:http://texstudio.sourceforge.net/

Рисунок 1 Домашняя страница загрузки TeXstudio
2) Найти руководство пользователя TeXstudio
3) Установите MikTeX
TeXstudio — это просто редактор, который не включает среду LaTeX, поэтому вам необходимоСкачать MikTeXИ установить (руководство по установке находится по этой ссылке) .
4) Установите TeXstudio
Откройте ранее загруженный установочный пакет TeXstudio «texstudio-2.12.10-win-qt5.exe» и установите его по умолчанию.

Рисунок 2 После завершения установки соответствующий значок будет отображаться в строке меню в левом нижнем углу win10
5) Пример демонстрации
После установки MikTeX и TeXstudio создайте новый файл test.tex.
Входные данные:
Нажмите «F5» или двойную стрелку в верхней строке меню, чтобы отобразить документ, соответствующий коду.

Рисунок 3 Скомпилируйте и выполните код
6) Поддержка китайского
Внимательные люди видят, что китайцы в 5) не могут отображаться. Есть два способа отображения китайского (я предпочитаю первый)
1. Во-первых, в верхней строке меню опции-настройки TeXstudio-build. Измените компилятор по умолчанию на XeLaTeX. Затем вставьте в код текстового файла Наконец, нажмите F5, чтобы увидеть успешное отображение китайского языка.
(Примечание: я получил ошибку во время первой компиляции и выполнения F5, сообщение было «expl3.sty is not found». Я проверил и не нашел результатов, и, наконец, я перекомпилировал и выполнил его снова, без проблем .)

Рисунок 4 Способ 1
2. Во-первых, в верхней строке меню опции-настройки TeXstudio-build. Измените компилятор по умолчанию на XeLaTeX. Затем вставьте в код текстового файла Наконец, нажмите F5, чтобы увидеть успешное отображение китайского языка.

Рисунок 5 Метод 2
Preamble in a separate file
If the preamble of your document has many user-defined commands or term definitions for the glossary, you can put it in a separate file. The right way is to create a custom package, which is a file with the .sty extension. Let’s see an example:
\ProvidesPackage{example}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{inputenc}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{blindtext}
\usepackage{textcomp}
\usepackage{pgfplots}
\pgfplotsset{width=10cm,compat=1.9}
%Header styles
\usepackage{fancyhdr}
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\renewcommand{\chaptermark}{\markboth{#1}{}}
\renewcommand{\sectionmark}{\markright{#1}{}}
\fancyhf{}
\fancyhead{\thepage}
\fancyhead{\textbf{\textit{\nouppercase{\leftmark}}}}
\fancyhead{\textbf{\textit{\nouppercase{\rightmark}}}}
\fancypagestyle{plain}{ %
\fancyhf{} % remove everything
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0pt}}
%makes available the commands \proof, \qedsymbol and \theoremstyle
\usepackage{amsthm}
%Ruler
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
%Lemma definition and lemma counter
\newtheorem{lemma}{Lemma}
%Definition counter
\theoremstyle{definition}
\newtheorem{definition}{Definition}
%Corolary counter
\newtheorem{corolary}{Corolary}
%Commands for naturals, integers, topology, hull, Ball, Disc, Dimension, boundary and a few more
\newcommand{\E}{{\mathcal{E}}}
\newcommand{\F}{{\mathcal{F}}}
...
%Example environment
\theoremstyle{remark}
\newtheorem{examle}{Example}
%Example counter
\newcommand{\reiniciar}{\setcounter{example}{0}}
All the commands in this file could have been put in the preamble, but the main file would have become confusing because of this large amount of code, and to locate the actual body of the document in such large file would be a cumbersome task.
This file could also be put in a normal .tex file and imported with the command (see the ), but a .sty file prevents possible errors if the file is accidentally imported more than once.
Notice that the first line of the example is
\ProvidesPackage{example}
this means that we have to import this package as example in the main file, i.e. with the command
\usepackage{example}
as shown in the .
Note: A .sty file is far more flexible, it can be used to define your own macros and optional parameters can be passed, see Writing your own package.
Using the import package
As mentioned above The standard tools to insert a LaTeX file into another are and , but these are prone to errors if nested file importing is needed. For this reason you may want to consider the package import.
Below is an example of a book whose sections and user-defined commands are stored in separate files, and where the image files for each chapter are stored in separate folders along with the .tex file for each chapter.
\documentclass{book}
\usepackage{import}
\usepackage{example}
\usepackage{makeidx}
\makeindex
\begin{document}
\frontmatter
\import{./}{title.tex}
\clearpage
\thispagestyle{empty}
\tableofcontents
\mainmatter
\chapter{First chapter}
\import{sections/}{section1-1.tex}
\import{sections/}{section1-2.tex}
\chapter{Additional chapter}
\import{sections/}{section2-1.tex}
\chapter{Last chapter}
\import{sections/}{section3-1.tex}
\backmatter
\import{./}{bibliography.tex}
\end{document}
As you see, the example is a book with three chapters and several sections in a neat main file that pulls external files to generate the final document. The command in the book document class is used for the first pages of the document, the page numbering style is set to Roman numerals by this command; the command resets the page numbering and changes the style to Arabic, disables the chapter numbering (suitable for the bibliography and appendices).
\chapter{First chapter}
\import{sections/}{section1-1.tex}
\import{sections/}{section1-2.tex}
First, add this line to the preamble of your document:
\usepackage{import}
Then use . The first parameter inside braces is the directory where the file is located, it can be relative to the current working directory or absolute. The second parameter is the name of the file to be imported
There is also available the command that has the same syntax, but if used in one of the files that are imported in the main file, the path will be relative to that sub-file. For instance, below is the contents of the file «section1-1.tex» that was imported in the previous example:
\section{First section}
Below is a simple 3d plot
\begin{figure}
\centering
\subimport{img/}{plot1.tex}
\caption{Caption}
\label{fig:my_label}
\end{figure}
As you see, this file imports a pgf plot file called «plot1.tex» that creates a 3d plot. This file is imported by
\subimport{img/}{plot1.tex}
from the «img» folder, contained in the folder «sections».
If were used instead, the path img/ would be relative to the main file, instead of the folder «sections» where «section1-1.tex» is saved.
Дистрибутивы[править]
TeX и LaTeX доступны практически для всех платформ. Наиболее распространённым способом установки LaTeX является использование одного из дистрибутивов. Включённые в состав дистрибутива наборы программ и пакетов (компиляторы, макропакеты, шрифты и т. д.), как правило, не требуют дополнительной настройки. В состав дистрибутива входит утилита для управления установкой и обновлением пакетов.
В состав перечисленных дистрибутивов включён простой редактор (например, TeXworks в случае TeX Live), но вы можете использовать любой редактор, добавив в него подсветку синтаксиса LaTeX, или использовать специализированный .
Наиболее популярными дистрибутивами LaTeX являются:
TeX Liveправить
TeX Live включён в состав некоторых дистрибутивов Linux, например, Debian и Ubuntu, и может быть установлен с использованием штатных средств управления пакетами в ОС. Недостатком подобной интеграции является фиксированная версия TeX Live в дистрибутиве ОС. Например, в состав Ubuntu 18.04 входит TeX Live 2017, и в течение жизненного цикла данного релиза Ubuntu переход на TeX Live 2018 будет невозможен. Альтернативный способ — установка последней версии с сайта TeX Live.
Редакторы[править]
Для редактирования исходных текстов TeX/LaTeX можно использовать любой текстовый редактор, но для удобства вам будет желательно иметь ряд дополнительных возможностей: подсветку синтаксиса, поддержку навигации по заголовкам, автодополнение и т. д. Таблица со сравнением характеристик различных редакторов LaTeX есть в Википедии.
Atomправить
Специализированныеправить
![]()
Скриншот TeXworks в ОС Ubuntu 12.10.
В состав TeX Live входит простой редактор TeXworks, обеспечивающий подстветку синтаксиса, компиляцию и предварительный просмотр PDF.
TeXmaker и TeXstudioправить
![]()
Скриншот TeXstudio.
- Подсветка синтаксиса.
- Автодополнение команд.
- Умная компиляция: если требуется повторная компиляция для обновления ссылок или оглавления, то редактор сделает это автоматически.
- Свёртка элементов: разделов, формул и других окружений.
- Проверка орфографии. Словарь русского языка не входит в комплект, предлагается установить словарь с сайта расширений для LibreOffice.
- Навигация. Редактор распознаёт команды секций в документе и выводит панель навигации.
- Управление ссылками и метками. При создании ссылки на метку или элемент библиографии редактор выводит список меток в документе.
- Мастер создания и редактирования таблиц.
LyXправить
![]()
Скриншот LyX 2.1.x в ОС Windows.
Проверим функцию на чётность и нечётность с помощью соотношений f = f(-x) и f = -f(-x).
Итак, проверяем:
$$\frac{x^{2} — 1}{x — 1} = \frac{x^{2} — 1}{- x — 1}$$
— Нет
$$\frac{x^{2} — 1}{x — 1} = — \frac{x^{2} — 1}{- x — 1}$$
Introduction
The simplest manner to use colours in your LaTeX document is by importing the package color or xcolor. Both packages provide a common set of commands for colour manipulation, but the latter is more flexible and supports a larger number of colour models so is the recommended approach. Below an example:
\documentclass{article}
\usepackage{inputenc}
\usepackage{babel}
\usepackage{xcolor}
\begin{document}
This example shows different examples on how to use the \texttt{xcolor} package
to change the colour of elements in \LaTeX.
\begin{itemize}
\color{blue}
\item First item
\item Second item
\end{itemize}
\noindent
{\color{red} \rule{\linewidth}{0.5mm} }
\end{document}

In this example, the package xcolor is imported with
\usepackage{xcolor}
then the command sets the colour for the current block of text. In this case for the itemize environment.
The colour of a second block of text, delimited by { and }, is set to with the command , then a 0.5mm-thick horizontal ruler is inserted by .
The amount of available colour names depends on the driver, usually the next colours can be used with any driver: white, black, yellow, green, blue, purple cyan and magenta.
See the for more colours supported by other drivers.
Inline math mode
You can use any of these «delimiters» to typeset your math in inline mode:
- .
They all work and the choice is a matter of taste, so let’s see some examples.
\documentclass{article}
\begin{document}
\noindent Standard \LaTeX{} practice is to write inline math by enclosing it between \verb|\(...\)|:
\begin{quote}
In physics, the mass-energy equivalence is stated
by the equation \(E=mc^2\), discovered in 1905 by Albert Einstein.
\end{quote}
\noindent Instead if writing (enclosing) inline math between \verb|\(...\)| you can use \texttt{\$...\$} to achieve the same result:
\begin{quote}
In physics, the mass-energy equivalence is stated
by the equation $E=mc^2$, discovered in 1905 by Albert Einstein.
\end{quote}
\noindent Or, you can use \verb|\begin{math}...\end{math}|:
\begin{quote}
In physics, the mass-energy equivalence is stated
by the equation \begin{math}E=mc^2\end{math}, discovered in 1905 by Albert Einstein.
\end{quote}
\end{document}

Комментировать код LaTeX
Метод, которым можно воспользоваться для комментирования кода в LaTeX
зависит как от Ваших предпочтений, так и от установленных пакетов.
| % |
Строка после символа процента не будет компили- роваться компилироваться |
|
\begin{comment} Этот текст не отобразится \end{comment} |
Если у Вас установлен пакет verbatim или comment |
| \iffalseЭтот текст не отобразится\fi | Если очень хочется, то можно воспользоваться условиями, но нужно внимательно следить за тем как это согласуется с другими условиями. Я сам так никогда не делал. |
| Ctrl + T |
Заком- ментировать Закомментировать в программе Texmaker |
| Ctrl + U |
Раском- ментировать Раскомментировать в программе Texmaker |
Скачать TeXlive
Две ссылки, показанные ниже, перейдут на ту же страницу доступности TeX Live. Я скачал установщик последней версии TeXlive2018.


Многие блогеры говорят, что этот метод очень медленный, но из моего опыта работы с различными установками программного обеспечения, сжатие и распаковка этого метода установки программного обеспечения подвержены ошибкам. Новички часто тратят много времени на настройку и отладку, или Будет задействован более профессиональный контент конфигурации. Разные учебники иногда имеют разную конфигурацию контента, что приводит людей в замешательство. Неофициальный пакет сжатия веб-сайтов не может даже гарантировать его подлинность и безопасность. Поэтому при установке TeXlive рекомендуется использовать установщик, ведь рекомендуемые должны иметь причины его преимуществ.
Combining rows and columns
Rows and columns can be merged to create larger table cells. The following example uses the command to merge several columns:
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{tabular}{ |p{3cm}||p{3cm}|p{3cm}|p{3cm}| }
\hline
\multicolumn{4}{|c|}{Country List} \\
\hline
Country Name or Area Name& ISO ALPHA 2 Code &ISO ALPHA 3 Code&ISO numeric Code\\
\hline
Afghanistan & AF &AFG& 004\\
Aland Islands& AX & ALA &248\\
Albania &AL & ALB& 008\\
Algeria &DZ & DZA& 012\\
American Samoa& AS & ASM&016\\
Andorra& AD & AND &020\\
Angola& AO & AGO&024\\
\hline
\end{tabular}
\end{document}

Let’s review each component of the command :
- The number of columns to be combined: 4 in this case.
- Delimiters and alignment of the resulting cell: in this case the text will be centred and a vertical line will be drawn at each side of the cell.
- Text to be displayed inside the cell.
To combine rows you need to add the package to your document preamble:
\usepackage{multirow}
You can then use the command in your document:
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{center}
\begin{tabular}{ |c|c|c|c| }
\hline
col1 & col2 & col3 \\
\hline
\multirow{3}{4em}{Multiple row} & cell2 & cell3 \\
& cell5 & cell6 \\
& cell8 & cell9 \\
\hline
\end{tabular}
\end{center}
\end{document}

The command takes three parameters; our example uses the following settings:
- the number of rows to be combined:
- the width of the column:
- the content of the cell:
Positioning tables
Positioning a table is easy if they’re inside a float environment.
\documentclass{article}
\begin{document}
Below is a table positioned exactly here:
\begin{table}
\centering
\begin{tabular}{||c c c c||}
\hline
Col1 & Col2 & Col2 & Col3 \\
\hline\hline
1 & 6 & 87837 & 787 \\
2 & 7 & 78 & 5415 \\
3 & 545 & 778 & 7507 \\
4 & 545 & 18744 & 7560 \\
5 & 88 & 788 & 6344 \\
\hline
\end{tabular}
\end{table}
\end{document}

The parameter passed to the table environment declaration establishes that this table must be placed here, and override LaTeX defaults. The positioning parameters that can be passed-in include:
- Will place the table here approximately.
- Position the table at the top of the page.
- Position the table at the bottom of the page.
- Put the table in a special page, for tables only.
- Override internal LaTeX parameters.
- Place the table at this precise location, pretty much like h!.
For further examples on table positioning see the Positioning images and tables article.
In this example there are a few more commands:
- Centres the table relative to the float container element.
- This adds extra space to the cell.
Simple commands
New commands are defined by statement, let’s see an example of the simplest usage.
\newcommand{\R}{\mathbb{R}}
The set of real numbers are usually represented
by a blackboard bold capital r: \(\R\).
The statement has two parameters that define a new command
- This is the name of the new command.
- This is what the new command does. In this case the letter R will be written in blackboard boldface style. (to use the package amssymb is needed)
After the command definition you can see how the command is used in the text. Even tough in this example the new command is defined right before the paragraph where it’s used, good practice is to put all your user-defined commands in the preamble of your document.