Перейти к содержимому

Какой шрифт использует latex

  • автор:

Научный форум dxdy

Здравствуйте! =)
Есть ли возможность использовать шрифт, который применяется в TeX’e, в таких программах как Word, PowerPoint?
Просто нужно сделать презентацию с мат. текстом, а этот шрифт формул, который там используется, прямо раздражает.. Вот и задумался, есть ли возможность использовать шрифт, который использует в ТеХ, в пакете офиса?

Также вроде бы краем глаза видел, что ТеХ позволяет создавать презентации. Пока не совсем изучил этот вопрос. Там ведь наверное нет такой демонстрации как в ПоверПоинте? Или также?

LaTeX/Fonts

There are hundreds—if not thousands—of typefaces, or font families. Common examples include Times, Courier, and Helvetica. These families can generally be grouped into three main categories: serif, sans serif, and monospaced. LaTeX commands generally refer to these with the shorthand rm, sf, and tt respectively.

By default, LaTeX uses Computer Modern, a family of typefaces designed by Donald Knuth for use with TeX. It contains serif, sans serif, and monospaced fonts, each available in several weights and optical sizes.

The bodies of LaTeX documents are set in Roman (serif) type by default, but this can be changed by setting the family default:

where <family> is any of the following:

  • \rmdefault
  • \sfdefault
  • \ttdefault

Emphasizing text [ edit | edit source ]

Tex recognizes two types of markup commands:

  • Semantic — \emph < text >— by default italise font. Can be overrriten by \renewcommand\emph < \textbf >. Replace textbf per requirements/preferences.
  • Visual — which actually applies required formatting:
    • Family — \textrm <> \textsf <> \texttt
    • Weight — \textbf <> — bold, \textmd <> — medium
    • Shape — \textup <> , \textit <> , \textsl <>

    There are variation of the visual markup for a specific font. The above are commonly used elements. For reference on the items see section Font styles

    To add some emphasis to a word or a phrase, use the \emph < text >command, which usually italicizes the text.

    I want to emphasize a word.

    The command is dynamic: if you emphasize a word which is already in an emphasized sentence, it will be reverted to the upright font.

    In this emphasized sentence, there is an emphasized word which looks upright.

    Text may be emphasized more heavily through the use of boldface, particularly for keywords the reader may be trying to find when reading the text. As bold text is generally read before any other text in a paragraph or even on a page, it should be used sparingly. It may also be used in place of italics when using sans-serif typefaces to provide a greater contrast with unemphasized text. Bold text can be generated with the \textbf < text >command.

    Bold text may be used to heavily emphasize very important words or phrases.

    Font styles [ edit | edit source ]

    Typefaces usually come in various styles and weights, such as italic and bold. The following table lists the commands you will need to access typical font shapes.

    Note: Paragraph breaks are not allowed inside the command forms.

    LaTeX command Equivalent switch Output style Remarks
    \textnormal

    document font family This is the default or normal font.
    \emph

    emphasis Typically italics. Using emph<> inside of italic text removes the italics on the emphasized text.
    \textrm

    roman font family
    \textsf

    sans serif font family
    \texttt

    teletypefont family This is a fixed-width or monospace font. Depending on the font zero have a dash in it to differenciate from letter O
    \textup

    upright shape The same as the normal typeface.
    \textit

    italic shape
    \textsl

    slanted shape A skewed version of the normal typeface (similar to, but slightly different from, italics).
    \textsc

    Small Capitals
    \uppercase

    uppercase (all caps) Also \lowercase . There are some caveats, though; see here.
    \textbf

    bold
    \textmd

    medium weight The normal font weight.
    \textlf

    light A font weight lighter than normal. Not supported by all typefaces.

    Generally, one should prefer the commands over their equivalent switches because the former automatically corrects spacing immediately following the end of the selected style.

    You may have noticed the absence of underline—this is because underlining is a byproduct of the typewriter era, and is not recommended when bold and italic type is available instead. [2] However, underlining can be useful in some cases, such as to draw attention to changes during editing. Although underlining is available via the \underline < . >command, text underlined in this way will not break properly. Instead, use the \ul < . >command from the soul package or \uline < . >command from the ulem (underline emphasis) package. By default, the latter package also overrides \emph to underline instead of italicize the text. In the likely case that this is not your intent, use the normalem option, i.e. \usepackage [normalem] < ulem >. Both packages also provide strikethrough text with \st < . >or \sout < . >, respectively.

    Sizing text [ edit | edit source ]

    Built-in sizes [ edit | edit source ]

    To scale text relative to the default body text size, use the following commands:

    Command Output
    \tiny sample text
    \scriptsize sample text
    \footnotesize sample text
    \small sample text
    \normalsize sample text
    \large sample text
    \Large sample text
    \LARGE sample text
    \huge sample text
    \Huge sample text

    These commands change the size within a given scope. For instance < \Large some words >will change the size of only some words , and does not affect the font in the rest of the document. It will work for most parts of the text.

    These commands cannot be used in math mode. However, part of a formula may be set in a different size by using an \mbox command containing the size command. The new size takes effect immediately after the size command; if an entire paragraph or unit is set in a certain size, the size command should include the blank line or the \end < . >which delimits the unit.

    By default, \normalsize is 10 points, but this can be changed in the \documentclass declaration, e.g. \documentclass [12pt] < article >. Note that not every document class has unique sizes for all of the above size commands.

    Absolute Point Sizes

    size standard classes (except slides), beamer AMS classes, memoir slides
    [10pt] [11pt] [12pt] [10pt] [11pt] [12pt]
    \tiny 5 6 6 6 7 8 13.82
    \scriptsize 7 8 8 7 8 9 16.59
    \footnotesize 8 9 10 8 9 10 16.59
    \small 9 10 10.95 9 10 10.95 16.59
    \normalsize 10 10.95 12 10 10.95 12 19.907
    \large 12 12 14.4 10.95 12 14.4 23.89
    \Large 14.4 14.4 17.28 12 14.4 17.28 28.66
    \LARGE 17.28 17.28 20.74 14.4 17.28 20.74 34.4
    \huge 20.74 20.74 24.88 17.28 20.74 24.88 41.28
    \Huge 24.88 24.88 24.88 20.74 24.88 24.88 41.28

    Points in TeX follow the standard American point system in which 1 pt is approximately 0.3513 6 mm. The standard point size used in most modern computer programs (known as the desktop publishing point or PostScript point) has 1 pt equal to approximately 0.352 7 mm while the standard European point size (known as the Didot point) had 1 pt equal to approximately 0.37597151 mm (see: point (typography)).

    Arbitrary sizes [ edit | edit source ]

    The \tiny . \Huge commands are often enough for your needs, but you may occasionally want an arbitrary font size. This is done with \fontsize < <size> > < <line space> >\selectfont . For example:

    sets the current font size to 5cm with 5.5 centimeter leading.

    If you are using the latex or pdflatex engines, you may get a warning similar to the following:

    This is because these older engines only support a fixed set of sizes—between 5 and 17 point. When he designed Computer Modern, Knuth created individual font files for these sizes, each with stroke widths and spacing optimized for that particular size. To avoid distorting them, scaling these fonts is disabled by default.

    This issue is avoided when using lualatex or xelatex, which use Latin Modern — a vectorized version of Computer Modern — as the default font family. This still provides individual files at each of the original optical sizes, but will automatically scale the closest one when asked for an arbitrary size.

    Using alternative fonts [ edit | edit source ]

    When TeX was originally designed in the late 1970s, vector-based fonts didn’t exist in any common format — PostScript wouldn’t be released until 1982. Consequently, TeX was designed to use its own font system, METAFONT. Over time, TeX (and LaTeX) were extended to support PostScript fonts, and modern LaTeX engines also support the TrueType (TTF) and OpenType (OTF) fonts found on modern systems.

    Using TTF and OTF fonts [ edit | edit source ]

    If you are using lualatex or xelatex, you can use TTF and OTF fonts with the fontspec package:

    The [Ligatures=TeX] option allows you to use the standard TeX ligatures mentioned in the Text Formatting chapter instead of Unicode characters that are unlikely to be on your keyboard. For example, --- can be used to create em dashes (—), quotes can be typed «like this'' instead of “like this” , and so on.

    The fontspec package is extremely configurable. See the manual [3] for details, but some basics are covered below.

    Selecting font files [ edit | edit source ]

    Different weights and styles of a given typeface are usually stored as separate font files. A typical typeface might offer four files to represent its normal weight, italics, bold, and bold italics. Given a typefaces’s name, fontspec can generally deduce the names of the individual files. However, many typefaces come in more than two weights—some versions of Futura, for example, comes in light, book, medium, demi, bold, and extra bold weights. Sometimes small caps are stored as separate files as well.

    We might want to hand-pick weights to achieve a certain look or better match the weights of other fonts in our document. Continuing to use Futura as an example, say we want to use the «book» weight for our default weight, «demi» for bold, and the font files are named:

    • Futura-Boo for upright book weight
    • Futura-BooObl for oblique book weight
    • FuturaSC-Boo for small caps, book weight
    • Futura-Dem for upright demi(bold)
    • Futura-DemObl for oblique demibold

    Our font setup might resemble:

    Note that instead of typing out Futura-Boo, Futura-BooObl, and so on, we can use * to insert the base name.

    Controlling font features [ edit | edit source ]

    The OpenType (OTF) format allows type designers to embed font features that can be turned on and off, such as:

    • Alternate versions of glyphs
    • Lining and «oldstyle» figures, each with tabular and proportional spacing [4]
    • Up to three sets of ligatures: standard, contextual, and historical
    • Superscript and subscript glyphs
    • Small caps (in the same file as the standard upper and lowercase characters)

    All of these features can be turned on and off using different fontspec options. If we wanted to set our body text in Linux Libertine with oldstyle, proportionally-spaced figures, for example, we might set up our fonts as follows:

    Features can be turned on and off using \addfontfeatures < . >. Say you wanted to set a table in lining, tabular figures:

    Changing fonts in latex and pdflatex [ edit | edit source ]

    If you are not using one of the Unicode-aware engines, font selection is more complicated. (See the discussion of encoding below.) Useful resources for latex and pdflatex font configuration include:

    Font encoding [ edit | edit source ]

    Digitising human language is a complicated topic that has evolved significantly since TeX’s inception.

    Unicode [ edit | edit source ]

    Today, text is usually represented in computer systems using Unicode. Briefly,

    • A Unicode text file is made of a series of code points, each of which can represent a character to be drawn, an accent or other diacritical mark to combine with an adjacent character, or some non-printing character, such as instruction to print subsequent text right-to-left.
    • One or more of these code points combines to represent a grapheme cluster or glyph, the shapes within a font that we informally call «characters».
    • Modern font formats such as TrueType and OpenType contain encoding tables which map code points to the glyphs the font file contains.

    LuaLaTeX and XeLaTeX use these tools to render Unicode-encoded input files (LuaLaTeX accepts UTF-8 files, while XeLaTeX is a bit more flexible and also accepts UTF-16 and UTF-32) into PDF documents.

    TeX encodings [ edit | edit source ]

    The original TeX and LaTeX, designed long before the advent of Unicode, use a very different scheme. When using latex or pdflatex, you must choose an input encoding, which the engine uses to interpret your file, and an output encoding, which the engine uses to map your inputs to glyphs. The default font encoding is OT1, the encoding of the original Computer Modern fonts. It contains only 128 characters, many from ASCII, but leaving out some others and including a number that are not in ASCII. When accented characters are required, TeX creates them by combining a normal character with an accent. While the resulting output looks correct, this approach has some caveats compared to Unicode-based approaches:

    • It prevents automatic hyphenation from working inside words containing accented characters.
    • Searches for words with accents in PDFs will fail.
    • Extracting (e.g., via copy-paste) the umlaut ‘Ä’ via a PDF viewer actually extracts the two characters ‘ "A ‘.
    • Some Latin letters cannot be created with this approach, to say nothing about letters of non-Latin alphabets such as Greek or Cyrillic.

    To overcome these shortcomings, several other 8-bit output encodings were created. Extended Cork (EC) fonts in T1 encoding contains letters and punctuation characters for most European languages that use Latin alphabets. The LH font set contains letters necessary to typeset documents in languages using Cyrillic script. Because of the large number of Cyrillic glyphs, they are arranged into four font encodings—T2A, T2B, T2C, and X2. The CB bundle contains fonts in LGR encoding for the composition of Greek text. By using these fonts you can improve/enable hyphenation in non-English documents. Another advantage of using new CM-like fonts is that they provide fonts of CM families in all weights, shapes, and optically scaled font sizes.

    All this is not possible with OT1; that’s why you may want to change the font encoding of your document.

    Note that different fonts support different output encodings. The default Computer Modern font does not support T1, for example. You will need Computer Modern Super ( cm-super ) or Latin Modern ( lmodern ), which are Computer Modern-like fonts with T1 support. If you have none of these, it is quite frequent (depends on your TeX installation) that tex chooses a Type3 font such as the Type3 EC, which is a bitmap font. Bitmap fonts look rather ugly when zoomed or printed.

    The fontenc package tells LaTeX what font encoding to use. Font encoding is set with:

    where encoding is the font encoding. It is possible to load several encodings simultaneously.

    There is nothing to change in your document to use CM Super fonts (assuming they are installed), they will get loaded automatically if you use T1 encoding. For lmodern, you will need to load the package after the T1 encoding has been set:

    The package ae (almost European) is obsolete. It provided some workarounds for hyphenation of words with special characters. These are not necessary any more with fonts like lmodern. Using the ae package leads to text encoding problems in PDF files generated via pdflatex (e.g. text extraction and searching), besides typographic issues.

    PDF fonts and properties [ edit | edit source ]

    PDF documents have the capability to embed font files. It makes them portable, hence the name Portable Document Format.

    Many PDF viewers have a Properties feature to list embedded fonts and document metadata.

    Many Unix systems make use of the poppler tool set which features pdfinfo to list PDF metadata, and pdffonts to list embedded fonts.

    LaTeX + диплом

    Понадобилось мне написать диплом. Времени в обрез, требования жесткие. Материал есть, текст почти готов, надо оформлять. Сел, подумал, и решил, что ручной версткой уж точно заниматься не хочется. Из опыта участия во всевозможных олимпиадах вспомнилось, что лучше час потерять, но сделать решение, которое потом пройдет тесты, чем сразу сделать что-то и потому судорожно переделывать. Плюс к тому хотелось таки заняться плотным изучением Latex и компании.

    Ставим задачу

    Исходные условия:
    Компьютер Acer Aspire One. Очень удачная машинка для студента, надо заметить. Нетбуки в Европе так и называют — студенческие компьютеры.
    Операционная система — Linpus (читай Fedora 8).
    Система верски — Latex в реализации teTex, ныне свернутая.

    Требуется в течение недели получить текст диплома, оформленного по всем правилам учебного заведения.

    • Гарнитура Times New Roman;
    • Кегль 12pt;
    • полуторный интервал;
    • отступ от заголовка 6pt;
    • заголовки первого уровня (т.е. названия глав) выключаются по центру;
    • заголовки последующих уровней выключаются влево с обязательным абзацным отступом;
    • совпадающим с абзацным отступом основного текста;
    • приложения нумеруются с цифры 1;
    • слова «ОГЛАВЛЕНИЕ», «ВВЕДЕНИЕ» пишутся заглавными буквами (т.е. буквально так, как это набрано в этом предложении);
    • все заголовки включаются в содержание.

    В качестве основы для публикации после непродолжительного анализа был выбран пакет disser. Самое главное, что в нем подкупило — это ощущение целостности и наличие файла для сборки (т.е. Makefile).

    Установка

    Сначала автор хотел установить TeXLive, но это не получилось. Почему-то не запустился инсталлятор, а поскольку в perl’е автор не силен, желания разбираться не было никакого. Из пакетов с помощью yum был установлен teTeX.

    Надо отметить, что процесс этот проходил не быстро, благо GPRS-интернет от Мегафон — удовольствие не быстрое (это не камень в огород Мегафона, а констотация факта. GPRS-интернет медленный!)

    После этого из CTAN (www.ctan.org) были установлены пакеты disser и связанные с ним. Как определялись пакеты, которые надо установить? Экспериментальным путем.
    В теле документа thesis.tex пишется \usepackage<какой_то_пакет>, затем дается команда

    и проверяется наличие ошибки вида «не найден какой_то_пакет.sty». Если такая ошибка есть, то этот пакет скачивался из интернета, инсталлировался (с обязательным выполнением команды sudo texhash ) и процесс повторялся. Надо сказать, что автор установил довольно много пакетов, прежде чем понять, что же ему надо и на чем можно остановиться, поэтому намеренно не привожу перечень пакетов, которые были установлены.

    Про среду следует сказать отдельно.

    В моем случае (т.е. в приведенной выше конфигурации) установка teTeX произошла в каталог /usr/share/texmf (далее $TEXMF) с правами rw-r—r—, т.е. простой пользователь может только читать, но не писать. А инсталляция пакетов Latex происходит в каталог $TEXMF/tex/latex/ и далее. Поэтому все содержимое пакетов недоступно (мы же не работаем под root’ом!) Пакет disser установился, соответственно, в каталог $TEXMF/tex/latex/disser, а документация к нему в $TEXMF/doc/latex/disser.

    В документации к пакету disser приводятся примеры разных работ — кандидатской, докторской и магистерской диссертаций, а также работа бакалавра. Содержатся они в каталоге templates. Если бы было право на запись, то можно было бы прямо в каталоге, например, bachelor выполнить make и получить на выходе dvi-файл.

    Но поскольку права на запись нет, примеры были скопированы в каталог

    /Documents и работа велась там.

    В Makefile были внесены изменения (был прописан абсолютный путь в директиве include), чтобы уже в копии можно было выполнять make.

    Далее начался собственно процесс верстки.

    Сборка диплома

    Текст изначально планировался к набору в кодировке utf-8, но позже выяснилось, что BiBTeX не умеет обрабатывать библиотечные файлы в этой кодировке, а совместить две кодировки в одном проекте не получается. Может это и возможно, но дешевле оказалось весь проект верстать в cp1251.

    Набор текста производился в редакторе geany, от которого требовалась только подсветка синтаксиса и умение работать в кодировке cp1251. Немаловажным фактом оказалась и возможность работать в режиме полного экрана (отключены все элементы интерфейса, кроме строки меню), поскольку экран компьютера маленький.

    Пакет disser предполагает разбиение документа на небольшие, логически связанные порции. Так, введение и заключение находятся в отдельных файлах, intro.tex и concl.tex соответственно. Главы находятся в файлах 1.tex, 2.tex, 3.tex и т.д. Приложения в файлах app-1.tex, app-2.tex и т.д.

    Сборка документа производится путем указания в файле thesis.tex (основной документ) следующих строк между \begin и \end:

    Оглавление, по требованиям, находится в начале документа и начинается со страницы 2. Титульный лист для дипломной работы выдавался (печатался отдельно), поэтому никакой необходимости его верстать и включать в документ не было. Для отключения титульного листа в заголовке документа было указывается notitlepage, т.е.

    где многоточием заменены другие опции.

    Размер листа устанавливается пакетом geometry:

    \usepackage[
    a4paper, includefoot,
    left=3cm, right=1cm, top=2cm, bottom=1.5cm,
    headsep=1cm, footskip=1cm
    ]

    Настройка заголовков

    Надо отметить, что в пакете disser очень грамотно произведена настройка элементов текста, т.е. названий глав, секций, подсекций и т.д.

    Например, для оформления названия главы имеются следующие команды:

    \thechapteralign
    \thechapterfont
    \prethechapter
    \postthechapter
    \chapteralign
    \chapterfont
    \beforechapter
    \afterchapter

    Команды определяют оформление разных частей заголовка: \thechapteralign — выключку номера, \thechapterfont — шрифт номера, \prethechapter — текст до номера, \postthechapter — текст после номера, \chapteralign — выключку текста заголовка, \chapterfont — шрифт текста заголовка, \beforechapter — отступ до заголовка, \afterchapter — отступ после заголовка.

    Такая же серия команд есть и для оформления заголовка в оглавлении.

    Подобная настройка произведена для каждого уровня заголовков. Подробности — в файле disser.pdf.

    Такое разбиение позволяет сделать, например, такой заголовок:

    Глава 1.
    Анализ текущего состояния

    и указать разное оформление для номера и для текста заголовка.

    В итоге, для диплома в преамбуле документа появились такие команды (показана только настройка главы):

    > % ставим точку и пробел после номер
    \renewcommand<\chapterfont> <\normalsize\bfseries>% шрифт текста заголовка
    \renewcommand<\tocprethechapter><> % в оглавлении убираем слово «Глава»

    Перекомпилируем и получаем правильно оформленные заголовки главы.

    Другие заголовки

    По умолчанию все заголовки в пакете disser набираются более крупным шрифтом, нежели основной текст. По требованиям же заголовки должны набираться тем же кеглем, что и основной текст (12), полужирного начертания.

    Поэтому в преамбулу вписываем:

    Заголовки второго и последующего уровня должны иметь такой же абзацный отступ, что и основной текст, т.е. номер секции не должен выступать влево по отношению к абзацному отступу.

    Для этого в преамбулу включаем команды (основной текст имеет отступ 1 см)

    Отступ от заголовка до текста должен быть не менее 6 пунктов:

    Поскольку в дипломе было много мест, где подряд шли несколько заголовков разного уровня, автор пошел на некоторое нарушение в угоду визуальной составляющей и уменьшил размер отступа для заголовков третьего уровня до трех пунктов:

    Выражение «plus .1pt» позволяет Latex немного двигать заголовки в вертикальном направлении при верстке страницы, что на нескольких страницах привело к более привлекательному результату.

    Текст заголовков

    По требованиям заголовки набираются заглавными буквами. Исправить это оказалось довольно просто. В преамбуле указываем

    По каким-то причинам «ОГЛАВЛЕНИЕ» и «БИБЛИОГРАФИЧЕСКИЙ СПИСОК» пришлось вставлять в тело документа, причем последнее — непосредственно перед библиографией.

    Нумерация

    Диплом по требованиям начинается с титульной страницы, после которой идет оглавление. Оглавление печатается на странице 2 и далее. Делается это с помощью команды

    непосредственно перед \tableofcontents.

    Приложения нумеруются с цифры 1. По умолчанию пакет disser предлагает нумерацию приложений с буквы «А» (кириллица). Для изменения формата номера в преамбуле пишется команда

    \renewcommand<\theappendix><\arabic> % заменяем нумерацию приложений на цифры

    Кроме того, текст «ПРИЛОЖЕНИЕ 1» выключается вправо. Делается это командой

    в преамбуле. Команда \hfill заполняет все свободное пространство строки, «раздавливая» то, что стоит до и после нее в разные стороны строки.

    Оглавление

    В оглавление должны включаться заголовки всех уровней. По умолчанию пакет disser включает в оглавление только главы и секции. Подсекции — не включаются.

    Чтобы исправить, в преамбулу добавляем команду

    В случае с дипломом автора этого оказалось достаточно, поскольку заголовки ниже subsection не использовались. Если это будет не так, то нужно указать 3 или даже 4 в команде выше.

    Команды разбиения текста (chapter, section и пр.) имеют необязательный параметр, позволяющий указать текст, который будет включен в оглавление. Это удобно использовать для переноса строк в случае длинных заголовков. Команда

    позволяет по-разному оформить заголовок в тексте и в оглавлении.

    Приложения в оглавления начинаются со слова «ПРИЛОЖЕНИЯ», которое ссылается на ту же страницу, что и первое приложение, т.е.

    ПРИЛОЖЕНИЯ. 51
    ПРИЛОЖЕНИЕ 1. Сводная таблица. 51

    Делается это просто. В тексте первого приложения (в файле app-1.tex) в начало добавляются две команды:

    \clearpage нужно для того, чтобы команды \addcontentsline и \chapter попали на одну страницу.

    Библиографический список

    Пакет disser для формирования библиографии использует команду bibtex8. В поставке teTeX этой команды нет, во всяком случае в тех репозиториях, которые подключены по умолчанию.

    Поэтому автор скачал исходный код утилиты и собрал ее самостоятельно, после чего поместил ее в каталог /usr/bin рядом с утилитой bibtex, а в каталог с дипломом поместил файл gost705.bst, используемый пакетом disser.

    Шрифт Times New Roman/12 pt

    Нормоконтроллер не пропустил шрифт cm-super, используемый по умолчанию. Поэтому пришлось подключить пакет PsCyr для того, чтобы текст верстался именно Times New Roman. Мне этот шрифт категорически не нравится, но это формальность, так что пришлось сделать как указано.

    По каким-то причинам при указании опции 12pt в \documentclass Latex отказался менять размер шрифта. Пришлось последовательно (с пересборкой диплома) указать шрифт 8pt, 9pt, 11pt и затем 12pt. После этого шрифт стал нужного размера.

    Заключительные положения

    Следует отметить, что на все эксперименты и настройку суммарно ушло около 3 дней. Это с учетом того, что знание Latex у автора до этого было довольно поверхностное.

    Основную информацию автор почерпнул из книг К. В. Воронцова «Latex2e в примерах», С.М. Львовского «Набор и вёрстка в системе Latex» и, конечно, документации пакета disser, какой бы скудной она ни была.

    Преимущества Latex для работ подобного плана огромны — ссылочный аппарат позволяет не заботиться о том, в каком порядке идут приложения, элементы библиографического списка, таблицы, рисунки и проч.; работа ведется с простыми текстовыми файлами, поэтому потеря форматирования из-за проблем внутри MS Word/OO Writer невозможна в принципе; высокое полиграфическое качество; совершено прозрачная работа с математикой.

    Проблемы, конечно, тоже есть, но они нивелируются достоинствами: сложности с форматированием длинных таблиц, сложная работа с рисунками, особенно крупноформатными; не всегда очевидные способы борьбы с проблемными местами в тексте (висячие строки, слова, overfull, underfull) и т.д. В целом, для качественной работы в Latex нужно несколько больше знаний в полиграфии и программировании, чем при простой верстке в Word/Writer. Но оно того стоит.

    Рыба текста главного файла диплома с использованием пакета disser:
    \documentclass[bachelor,subf,12pt,notitlepage]
    \usepackage\usepackage[
    a4paper, mag=1000, includefoot,
    left=3cm, right=1cm, top=2cm, bottom=1.5cm, headsep=1cm, footskip=1cm
    ]

    \usepackage[T2A]
    \usepackage[cp1251]
    \usepackage[english,russian]
    \usepackage
    \usepackage

    > % Меняем регистр слова «Приложение»
    \renewcommand <\tocpretheappendix>

    Font sizes, families, and styles

    LaTeX normally chooses the appropriate font and font size based on the logical structure of the document (e.g. sections). In some cases, you may want to set fonts and sizes by hand.

    The following example shows how to use the smallest available font size in LaTeX ( \tiny ) and the small caps ( \textsc <. >) font style:

    FontStyles.png

    The following image shows the output produced by the example above:

    Font sizes

    Font sizes are identified by special names, the actual size is not absolute but relative to the font size declared in the \documentclass statement (see Creating a document in LaTeX).

    In the following example, <\huge huge font size>declares that the text inside the braces must be formatted in a huge font size. For a complete list of available font sizes see the reference guide.

    FontSizesOLV2.png

    The following image shows the output produced by the example above:

    Font families

    By default, in standard LaTeX classes the default style for text is usually a Roman (upright) serif font. To use other styles (families) such as sans serif, typewriter (monospace) etc. you need to use some specific LaTeX commands, as shown in the example below:

    The following image shows the output produced by the example above:

    UsingFontStyles2.png

    You can set up the use of sans font as a default in a LaTeX document by using the command:

    Similarly, for using roman font as a default:

    Font styles

    The most common font styles in LaTeX are bold, italics and underlined, but there are a few more.

    In the following example the \textsl command sets the text in a slanted style which makes the text look a bit like italics, but not quite. See the reference guide for a complete list of font styles.

    The following image shows the output produced by the example above:

    UsingSlantedText.png

    If you want to go back to «normal» font style (default for the LaTeX class you are using), this can be done by using the \textnormal <. >command or the \normalfont switch command.

    Putting it all together

    The following example combines together the various LaTeX code fragments used in this article.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *