Министерство образования и науки Российской Федерации Федеральное государственное образовательное учреждение высшего про...
55 downloads
331 Views
2MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Министерство образования и науки Российской Федерации Федеральное государственное образовательное учреждение высшего профессионального образования «ЮЖНЫЙ ФЕДЕРАЛЬНЫЙ УНИВЕРСИТЕТ»
Е. В. ШИРЯЕВА, И. В. ШИРЯЕВА ВВЕДЕНИЕ В TEX-ПРОГРАММИРОВАНИЕ (учебное пособие — тестовый вариант)
Ростов–на–Дону 2010
Учебное пособие разработано старшим преподавателем кафедры вычислительной математики и математической физики Еленой Владимировной Ширяевой и сотрудником учебной компьютерной лаборатории кафедры вычислительной математики и математической физики Ириной Владимировной Ширяевой.
Ответственный редактор
доктор физ.-мат. наук М. Ю. Жуков
Компьютерный набор и верстка
И. В. Ширяевой
Данное учебное пособие содержит набор лабораторных работ по издательской системе LATEX 2ε . Каждая лабораторная работа сопровождается необходимым теоретическим материалом и тестовыми заданиями для самоконтроля. Пособие предназначено для студентов, магистров, аспирантов естественных факультетов университета и будет полезно при оформлении курсовых, выпускных, диссертационных работ, а также статей, презентаций и электронных учебников.
Содержание Введение
7
Условные обозначения
9
План занятий
10
1 Знакомство с LATEX 2ε 13 1.1 Начало работы . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.2 Учимся разбираться с ошибками . . . . . . . . . . . . . . .
15
1.3 Некоторые важные правила набора текстов . . . . . . . . .
16
1.4 Титульный лист . . . . . . . . . . . . . . . . . . . . . . . .
17
1.5 Тесты . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19
2 Макет полосы набора; проекты
22
2.1 Параметры страницы . . . . . . . . . . . . . . . . . . . . .
22
2.2 Проекты . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24
2.3 Тесты . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
27
2.4 Индивидуальные проекты . . . . . . . . . . . . . . . . . . .
28
3 Набор текста
30
3.1 Смена шрифтов . . . . . . . . . . . . . . . . . . . . . . . . .
30
3.2 Буквальное воспроизведение . . . . . . . . . . . . . . . . .
31
3.3 Тесты . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
34
4 Верстка текста, автоматическая генерация ссылок
37
4.1 Абзацы с нестандартным форматированием . . . . . . . . .
37
4.2 Окружение tabular . . . . . . . . . . . . . . . . . . . . . .
38
4.3 Автоматическая генерация ссылок . . . . . . . . . . . . . .
42
4.4 Список литературы . . . . . . . . . . . . . . . . . . . . . .
42
4.5 Тесты . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
44
4.6 Индивидуальные проекты . . . . . . . . . . . . . . . . . . .
49
Содержание
4
5 Набор простых формул
50
5.1 Разные значки . . . . . . . . . . . . . . . . . . . . . . . . .
50
5.2 Греческие буквы . . . . . . . . . . . . . . . . . . . . . . . .
50
5.3 Символы бинарных операций и отношений . . . . . . . . .
51
5.4 Стрелки . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
51
5.5 Степени и индексы . . . . . . . . . . . . . . . . . . . . . . .
52
5.6 Дроби . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
52
5.7 Корни . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53
5.8 Штрихи . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
54
5.9 Тесты . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
54
6 Набор формул — почти “высший пилотаж” 6.1 Надстрочные знаки
58
. . . . . . . . . . . . . . . . . . . . . .
58
6.2 Названия операций . . . . . . . . . . . . . . . . . . . . . . .
59
6.3 Нумеруемые формулы . . . . . . . . . . . . . . . . . . . . .
60
6.4 Скобки и ограничители . . . . . . . . . . . . . . . . . . . .
62
6.5 Пробелы в формулах . . . . . . . . . . . . . . . . . . . . . .
63
6.6 Текст в формулах . . . . . . . . . . . . . . . . . . . . . . .
64
6.7 Набор многострочных формул . . . . . . . . . . . . . . . .
65
6.8 Тесты . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
67
7 Вставка изображений 7.1 Команда \includegraphics и bmp-файлы . . . . . . . . .
72 72
7.2 Команда \includegraphics и файлы форматов EPS и PDF 73 7.3 Размер рисунка . . . . . . . . . . . . . . . . . . . . . . . . .
73
7.4 Поворот рисунка . . . . . . . . . . . . . . . . . . . . . . . .
75
7.5 Окружение figure . . . . . . . . . . . . . . . . . . . . . . .
75
7.6 Министраницы и рисунки . . . . . . . . . . . . . . . . . . .
76
7.7 Упражнения
78
. . . . . . . . . . . . . . . . . . . . . . . . . .
8 Программа TpX Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
80 4
Содержание
5
8.1 Создание и редактирование рисунка . . . . . . . . . . . . .
80
8.2 Добавление в рисунок текста . . . . . . . . . . . . . . . . .
82
8.3 TpX и сохранение файлов . . . . . . . . . . . . . . . . . . .
83
8.4 Упражнения
84
. . . . . . . . . . . . . . . . . . . . . . . . . .
9 Цвет и визуальные эффекты
89
9.1 Цвет в LATEX’е . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 Использование предопределённых цветов . . . . . . . . . .
89
9.3 Использование цветовых моделей . . . . . . . . . . . . . . .
91
9.4 Цвет фона страницы . . . . . . . . . . . . . . . . . . . . . .
91
9.5 Цветные боксы . . . . . . . . . . . . . . . . . . . . . . . . .
92
9.6 Рамки с тенью . . . . . . . . . . . . . . . . . . . . . . . . .
93
9.7 Списки в рамке . . . . . . . . . . . . . . . . . . . . . . . . .
94
9.8 Упражнения
. . . . . . . . . . . . . . . . . . . . . . . . . .
94
9.9 Тесты . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
95
10 Электронные документы в формате PDF 10.1 Пакет hyperref . . . . . . . . . . . . . . . . . . . . . . . . .
90
98 98
10.2 Вид гиперссылок . . . . . . . . . . . . . . . . . . . . . . . . 100 10.3 Простейшая навигация . . . . . . . . . . . . . . . . . . . . . 100 10.4 Текст гиперссылки . . . . . . . . . . . . . . . . . . . . . . . 101 10.5 Команда hypertarget . . . . . . . . . . . . . . . . . . . . . . 101 10.6 Гиперссылки на внешние документы или ресурсы в сети . 103 10.7 Запуск внешнего приложения . . . . . . . . . . . . . . . . . 103 10.8 Индивидуальные проекты . . . . . . . . . . . . . . . . . . . 105 11 Создание презентаций
106
11.1 Шаблон презентации . . . . . . . . . . . . . . . . . . . . . . 106 11.2 Модификация стиля презентации . . . . . . . . . . . . . . . 107 11.3 Титульная страница презентации . . . . . . . . . . . . . . . 107 11.4 Окружения, используемые в слайдах . . . . . . . . . . . . . 108 Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
5
Содержание
6
11.5 Вариант кода презентации . . . . . . . . . . . . . . . . . . . 109 11.6 Индивидуальные проекты . . . . . . . . . . . . . . . . . . . 112 Список литературы
113
Предметный указатель
114
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
6
Введение
7
Введение TEX (читается «тех») — это система для набора и вёрстки текстов с формулами. С её помощью можно подготовить к печати и небольшую статью, и солидную монографию (причем не только по физико-математическим наукам).
тау
хи
TEX эпсилон
Слово TEX — набор заглавных греческих букв: тау, эпсилон и хи, являющихся корнем слова «техника», изначальное значение которого «искусство».
Сам по себе TEX — это специализированный язык программирования для создания издательских систем. Создатель TEX’а Дональд Кнут начал его разработку в 1977 г. Издательская система LATEX, в основе которой лежит TEX, была создана Лесли Лэмпортом в 80-х гг. Современная версия — LATEX 2ε — появилась в 90-х гг. (авторы: Франк Миттельбах, Крис Роули и Райнер Шопф). В тексте, предназначенном для LATEX 2ε , можно использовать многие команды TEX’а и LATEX’а, поэтому слова TEX, LATEX, LATEX 2ε далее будут использоваться как синонимы. Недостаток TEX’а (с точки зрения начинающего TEXника): • нельзя мгновенно увидеть результатов свой работы (т. е. система не работает по принципу WYSIWYG — What You See Is What You Get — что видите, то и получите). От пользователя требуются дополнительные действия, чтобы получить набранный текст в том виде, в котором он может быть распечатан на принтере или прочитан с экрана дисплея. Достоинства TEX’а : • позволяет создавать тексты высокого полиграфического качества; • нетребователен к технике и программному обеспечению (исходные тексты можно готовить в любом текстовом редакторе); • не зависит ни от архитектуры компьютера, ни от операционной системы — текст будет одинаково обработан на любом компьютере; Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
7
Введение
8
• может применяться пользователями даже с низким уровнем квалификации; • позволяет пользователю сосредоточиться на самом тексте, возложив на TEX заботы об оформлении текстового документа в целом; • обеспечивает высокое качество вёрстки текста, математических и химических формул; • допускает набор формул любой степени сложности; • автоматически нумерует разделы текстового документа, уравнения и т. п.; • позволяет организовать автоматические ссылки; • имеет удобные средства генерации алфавитного указателя, списков литературы, рисунков и таблиц; • содержит развитые средства импортирования в документ графики; • позволяет преобразовывать исходные файлы в форматы PostScript, PDF, HTML; • распространяется бесплатно. Дистрибутив TEX’а для платформы Windows — MiKTeX — содержит полный набор макропакетов: LATEX 2ε , AMS-TEX и др., а также средство просмотра dvi-файлов Yap (Yet Another Previewer), дополнительные инструменты и утилиты. MiKTEX находится в свободном доступе в Интернете по адресу: http://miktex.org.
Текст документа готовится в любом текстовом редакторе, позволяющем создавать обычные ASCII-файлы. Специализированные редакторыоболочки для работы с документами TEX’а:
• коммерческий редактор WinEdt (http://www.winedt.com);
• бесплатный редактор TeXnicCenter (http://www.texniccenter.org). Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
8
Условные обозначения
9
Условные обозначения WinEdt — советы по работе в редакторе WinEdt, например, см. c. 13.
Команда меню WinEdt — указание команды меню редактора WinEdt для
выполнения некоторой операции, например, см. c. 14. Панель GUI WinEdt — указание на страничку панели GUI Page Control
редактора WinEdt, например, см. c. 18. 3. Набор текста — гипертекстовая ссылка на раздел учебника. [1] — гипертекстовая ссылка библиографический источник.
— обозначение начала примера. Например, см. пример на c. 13. — обозначение начала упражнения. Например, см. упражнение на c. 13.
Текст для набора и верстки в упражнениях. Например, см. c. 13.
Исходный код: (например, см. c. 13) TEX-код
\documentclass{article} \begin{document} \end{document}
— замечание (например, см. замечание на c. 24). Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
9
План занятий
10
План занятий 1. Знакомство с LATEX 2ε Лекции (2 ч.) + практика (1 ч.)
1. ПО для работы с TEX’ом: классификация, установка, настройка. 2. Типы файлов. Структура TEX-файла. Классы документа. Использование дополнительных пакетов. 3. Основные понятия TEX’а. 4. TEX’овские единицы длины. 5. Титульная страница: определение, основные составляющие, создания титула в TEX’е с помощью специальных команд. 2. Макет полосы набора; проекты Лекции (2 ч.) + практика (2 ч.) + индивидуальный проект (1 ч.)
1. Макет полосы набора: параметры страницы, стиль оформления страниц, интерлиньяж, абзацный отступ. 2. Создание TEX-проектов. 3. Набор текста Лекции (2 ч.) + практика (2 ч.)
1. Атрибуты шрифтов. Буквальное воспроизведение. 2. Кавычки, многоточие, тире и дефисы. 3. Вертикальные и горизонтальные пробелы: тонкая настройка. 4. Верстка текста, автоматическая генерация ссылок Лекции (2 ч.) + практика (2 ч.) + индивидуальный проект (2 ч.)
1. Разрывы страниц. Создание пустых страниц. 2. Структура текстового документа. 3. Титульная страница: создание оригинальной титульной страницы. Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
10
План занятий
11
4. Создание аннотаций. 5. Команды секционирования. Правила оформления заголовков. 6. Оглавление. Организация автоматических ссылок на разделы документа. 7. Создание списков литературы. Организация автоматических ссылок на литературные источники. 8. Абзацы с нестандартным форматированием. 9. Создание таблиц. 10. Создание и использование шаблонов текстовых документов. 5. Набор простых формул Лекции (2 ч.) + практика (2 ч.)
1. Правила набора формул (внутритекстовые и выключные формулы, знаки препинания в формулах). 2. Математические шрифты. 3. Размер символов в формулах. 4. Разные символы и знаки, греческие буквы. 5. Символы бинарных операций и отношений, стрелки, степени и индексы, дроби, корни, штрихи. 6. Набор формул — почти “высший пилотаж” Лекции (2 ч.) + практика (2 ч.)
1. Скобки и ограничители, команды \left и \right. 2. Названия операций, операции с пределами. 3. Создание собственных операций. 4. Пробелы в формулах. 5. Текст в формулах. 6. Надстрочные знаки. 7. Нумеруемые однострочные формулы. Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
11
План занятий
12
8. Многострочные формулы — окружение array. 7. Вставка изображений Лекции (1 ч.) + практика (2 ч.)
1. Универсальная команда \includegraphics. 2. Масштабирование и поворот рисунка. 3. Окружение figure. Создание списка иллюстраций. 8. Программа TpX Лекции (1 ч.) + практика (2 ч.)
1. Специализированное графическое ПО для создания рисунков для TEX’а. 2. Работа с векторным редактором TpX. 9. Цвет и визуальные эффекты Лекции (2 ч.) + практика (2 ч.)
1. Цветовые модели RGB, CMYK, grayscale. Первичные и вторичные цвета. Цветовой куб. 2. Цвет фона страницы и цвет текста. 3. Цветные боксы. 4. Рамки с тенью. 5. Списки в рамке. 10. Электронные документы в формате PDF Лекции (2 ч.) + практика (2 ч.) + индивидуальный проект (2 ч.)
1. Пакет hyperref. 2. Принципы создания электронных учебников, пособий и т. п. 11. Создание презентаций Лекции (2 ч.) + практика (2 ч.) + индивидуальный проект (2 ч.)
1. Класс beamer. 2. Основы создания электронных презентаций. Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
12
1
Знакомство с LATEX 2ε 1.1 1.2 1.3 1.4
Начало работы Учимся разбираться с ошибками Некоторые важные правила набора текстов Титульный лист
1.5 Тесты
1
Знакомство с LATEX 2ε
1.1
Начало работы
Трансляция tex-кода — кнопка LaTeX (Shift+Ctrl+L) на панели инструментов. WinEdt
Просмотр dvi-файла с помощью программы Yap — кнопка DVI Preview (Shift+Ctrl+V). Для того, чтобы из окна просмотрщика Yap вернуться в WinEdt не надо закрывать окно Yap, просто минимизируйте его. WinEdt
1.1. а) В текстовом редакторе создайте новый файл. Сохраните его под каким-либо именем (желательно не содержащим русских букв и пробелов), тип файла — TEX (по умолчанию в WinEdt). б) Наберите три строки: TEX-код
\documentclass{article} \begin{document} \end{document} Это минимальный tex-файл с заголовком \documentclass{article} и командными скобками \begin{document} и \end{document}, являющимися началом и концом окружения document. в) Между командами \begin{document} и \end{document} наберите текст: Rostov-on-Don 2009 Ростов-на-Дону
Знакомство с LATEX 2ε
14
в) Странслируйте созданный документ в TEX’е. При отсутствии ошибок TEX должен создать новый файл с расширением dvi. г) Просмотрите полученный dvi-файл с помощью программы Yap. В окне программы Yap должен отобразиться весь текст, кроме русских букв. 1.2 (поддержка русского языка). Между командами \documentclass{article} и \begin{document} находится преамбула документа, в которой могут быть размещены описания, расширяющие базовую версию используемого класса (article в нашем случае). а) Добавьте в преамбулу строки, реализующие поддержку русского языка: TEX-код
\usepackage[cp1251]{inputenc} \usepackage[russian]{babel} б) В тело текста добавьте строку: Изучаем систему LATEX 2ε для набора математических текстов. в) Транслируйте измененный документ и просмотрите полученный dvi-файл. Обратите внимание на вид логотипа LATEX 2ε и на наличие пробела после него. WinEdt
С помощью кнопки TeXify (Shift+Ctrl+X) происходит транс-
ляция исходного файла с последующим вызовом программы Yap.
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
14
Знакомство с LATEX 2ε
1.2
15
Учимся разбираться с ошибками
Сведения об обработке текста (протокол трансляции) TEX выдает на экран и записывает в log-файл. Команда меню WinEdt: Открыть log-файл — Search → Errors. . . Часть информации, содержащейся в протоколе, представляет собой предупреждения, при выдаче которых трансляция не прерывается (например, о невозможности автоматического переноса некоторого слова). В случае, однако, если TEX находит в исходном тексте синтаксическую ошибку обработка файла приостанавливается, а на экран выдается сообщение об ошибке. 1.3. а) Внесите в набранный текст ошибки: 1) слово «систему» начните со знака «\»; 2) команду для генерации логотипа LATEX 2ε замените на \LaTeX; 3) перед точкой поставьте пробел. б) Транслируйте измененный документ. Успешной трансляции не получится, так как первая ошибка является грубейшей в TEX’е — знак «\» является признаком команды, а ни одна команда не начинается с русской буквы. Сообщение об ошибке будет приблизительно иметь вид (русский текст может на экране не отображаться, для этого нужна некоторая настройка): ! Undefined control sequence l.7 Изучаем \с истему {\LaTeX} для набора математических ? В сообщении указывается тип ошибки «Undefined control sequence» (несуществующая команда \с) и номер строки с ошибкой (7 — в нашем texфайле). Чтобы аккуратно закрыть экран с сообщением об ошибке введите букву x — обработка файла прервется. Исправьте ошибку и заново транслируйте текст. Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
15
Знакомство с LATEX 2ε
16
Ошибок больше не будет, хотя текст оказался изрядно подпорчен: вместо логотипа LATEX 2ε появится другой — LATEX; ну а пробел перед точкой — это грубейшая ошибка набора, но компилятор ее не в силах исправить. 1.3
Некоторые важные правила набора текстов
Запомните следующие правила набора текстов, которые не имеют никакого отношения к TEX’у, но связаны с общей культурой набора. Правило 1. После любого знака препинания ставится пробел, сам знак препинания никогда не отрывается от предыдущего слова медведи,␣лисы.
Правило 2. При расстановке скобок (кавычек) открывающая скобка набирается с отбивкой (пробелом) от предыдущего слова и без отбивки от последующего; закрывающая — наоборот Зверь␣(заяц)␣страшный.
Правило 3. Пробелы обязательны: — между цифрой и сокращением (в том числе между цифрой и обозначением физической величины): 1␣кг, 2002␣г. — между номером (буквой, символом) и следующим словом в перечне: а)␣красный,␣б)␣синий,␣в)␣желтый. — между знаком параграфа (номера) и следующей за ним цифрой: §␣3, №␣115. — между инициалами и между инициалом и фамилией: Иванова␣И.␣И. — в cокращениях от чисел и слов, к ним относящихся: тыс.␣руб. — между частями составного сокращения: т.␣д., т.␣п.
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
16
Знакомство с LATEX 2ε
17
1.4. Добавьте новый абзац в свой tex-документ: Иванов И. И. (студент факультета математики, механики и компьютерных наук Южного федерального университета). Номер моего студенческого билета: № 305800. Хочу зарабатывать ежегодно 1 млн. руб. (а может и 1 млн. $). 1.4
Титульный лист
Титульный лист, как таковой, может быть создан только в определенных классах, например, book. В стиле article титульный лист по умолчанию не создается, обычно в этом стиле создается «шапка» статьи с выходными данными. Далее будем говорить о создании заголовка текстового документа, не делая различия между «шапкой» и титулом. Чтобы TEX «сам» смог создать заголовок необходимо сначала задать для него информацию, которая обычно состоит из сведений об авторе, названия работы и некоторой служебной информации (например, наименование учреждения, где выполнена работа). Автор и заглавие работы задаются, соответственно, командами \author{имя автора}
\title{заглавие}
Длинное заглавие будет автоматически разбито на строки, хотя это удобнее сделать вручную с помощью команды «\\» (разорвать строку). Команда \date{текст} позволяет задать любой текст, который будет размещен на титульном листе. Команда \date не является обязательной, однако, если ее не указать, то в выходном файле будет выводиться дата трансляции файла. Поэтому, в случае отсутствия информации, задаваемой командой \date, она должна быть дана с пустым аргументом: \date{}. Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
17
Знакомство с LATEX 2ε
18
Генерация заголовка происходит по команде \maketitle, которую указывают сразу после \begin{document}. Команды \author, \title, \date могут даваться в любом порядке, но стоять они должны обязательно до вызова \maketitle (обычно в преамбуле документа). К любой из команд для создания заголовка можно сделать сноску с помощью команды \thanks{текст сноски} Она используется внутри команд \author, \title, \date и генерирует текст сноски1 , который будет напечатан внизу первой страницы документа. Например, \title{Методические указания\thanks{Краткий вариант.}} 1.5. Создайте с помощью команды \maketitle заголовок к Вашему текстовому документу в виде
Лабораторная работа № 12 И. И. Иванов Южный федеральный университет
Страница Typeface содержит команды для изменения начертания шрифта. Панель GUI WinEdt
1 2
Текст сноски всегда оканчивается знаком препинания, как правило, точкой. Первый опыт.
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
18
Знакомство с LATEX 2ε
1.5
19
Тесты
Раздел А «Выбор правильного ответа» А1. Исходный файл для LATEX’а по традиции имеет расширение: а) dvi б) cls в) tex г) log А2. Файл LATEX’а для просмотра и вывода результата работы на печать имеет расширение: а) aux б) log в) dvi г) tex А3. Протокол трансляции содержится в файле с расширением: а) dvi б) aux в) sty г) log А4. Программа Yap предназначена для: а) просмотра протоколов трансляции б) набора и редактирования исходного текста для LATEX’а в) для просмотра и вывода на печать результата работы LATEX’а г) для трансляции исходных файлов LATEX’а А5. Выберите верно оформленный список: 1) а)Заяц (зверь); б)Кактус (растение); в)Студент (человек) 2) а) Заяц (зверь) ; б) Кактус (растение) ; в) Студент (человек) 3) а) Заяц (зверь); б) Кактус (растение); в) Студент (человек) 4) а) Заяц ( зверь ); б) Кактус ( растение ); в) Студент ( человек ) А6. Заголовок исходного файла для LATEX’а имеет вид (класс article): а) \documentclass[article] б) \documentclass{article} в) \documentclass[article]{} г) \documentclass{article,12pt} Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
19
Знакомство с LATEX 2ε
20
А7. Файл *.sty — это файл, содержащий: а) набор команд, не специфичных для данного класса или изменяющий настройки класса по умолчанию б) список литературы в) набор настроек системы LATEX г) основной текст документа А8. Дополнительные пакеты в файле LATEX’а подключаются с помощью команды: а) \newpackage б) \newcommand в) \pagestyle г) \usepackage А9. Спецсимволами в LATEX’е считаются символы: а) цифры + символы \ { } % ~ # $ & _ ^ c ∃, ∀ б) символы ∞, ∇, , в) все буквы латинского и русского алфавитов + цифры г) символы \ { } % ~ # $ & _ ^ А10. Группа — это фрагмент файла, ограниченный а) любыми скобками б) фигурными скобками в) командами \begin{} \end{} г) символами \ А11. Кегль выражается а) в пунктах метрах
б) в миллиметрах
в) в дюймах
г) в кило-
А12. Пункт в системе TEX равен: а) 0,35 см
б) 0,376 см
в) 0,35 мм
г) 0,376 мм
А13. Относительные единицы длины так называются, потому что величина, задаваемая с их помощью Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
20
Знакомство с LATEX 2ε
21
а) не зависит от размера используемого шрифта б) зависит от размера используемого шрифта в) определяется отношением 1/72 pt г) определяется отношением числа строк в странице к числу символов в строке Раздел B «Короткий ответ» B1. Создайте минимальный файл LATEX’а для вывода логотипа LATEX 2ε . B2. Укажите формат команды LATEX’а с параметрами. B3. Дайте определение кегля. B4. Перечислите относительные единицы длины в системе TEX. Раздел C «ПрактикаF » C1. Создайте минимальный файл LATEX’а для вывода текста: В 2009 г. исполнилось 25 лет со дня создания системы LATEX и 15 лет со дня создания LATEX 2ε . Для представления формул в Википедии (универсальной энциклопедии) используется TEX-нотация. C2. Создайте минимальный файл LATEX’а для вывода текста: Stein D. The website as a domain-specific genre // Language@internet. 2006. № 3. URL: http://www.languageatinternet.de/articles/2006/374/index_html.
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
21
2
Макет полосы набора; проекты 2.1 Параметры страницы 2.2 Проекты 2.3 Тесты 2.4 Индивидуальные проекты
2
Макет полосы набора; проекты
2.1
Параметры страницы 4
2 5 Верхний колонтитул
1 один дюйм + \hoffset 6
2 3 4 5
один дюйм + \voffset \oddsidemargin \topmargin \headheight
6 \headsep Тело текста
7
9 3
10 8 11
1
7 \textheight 8 \textwidth 9 \marginparsep 10 \marginparwidth 11 \footskip
Нижний колонтитул
Например, параметр \textwidth = 165mm (указывается в преамбуле документа) позволит установить ширину текста, равной 165 мм. 2.1. Стандартный лист формата A4 имеет размеры: 210 × 297 мм. Опция класса a4paper облегчает подгонку текста под лист формата A4.
Макет полосы набора; проекты
23
Размеры полей для курсовой (дипломной) работы: слева — 3 см, справа — не менее 1 см (лучше 1,5 см), сверху и снизу — 2,5 см. Установите соответствующие параметры для своего tex-документа. Указание. При выполнении задания используйте только параметры \oddsidemargin,
\topmargin,
\textheight,
\textwidth.
Проверьте созданный макет на соответствие заданию с помощью команды \layout из пакета layout. 2.2. а) Увеличьте в документе интервал между строками на 30%; б) Установите в документе величину абзацного отступа, равной ширине двух букв «М» текущего шрифта. 2.3. Для всех страниц установите стиль myheadings, а сразу после команды, начинающей тело Вашего текстового документа, наберите строки, позволяющие создать номера страниц вверху листа (этот стиль не предусмотрен стандартными пакетами, но предусмотрен требованиями, предъявляемыми к оформлению выпускных работ): TEX-код
\makeatletter \renewcommand{\@oddhead}{\hfil\thepage\hfil} \makeatother
2.4. Установите стиль для первой страницы, исключающий номер и колонтитул страницы. 2.5. Установите размер шрифта 12 пт (опция в заголовке tex-файла). Команда \large в начале тела документа позволит изменить размер шрифта документа на принятый для набора курсовых и дипломных работ (≈ 14 пт). Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
23
Макет полосы набора; проекты
2.2
24
Проекты
Тексты большого размера удобно разбивать на несколько частей, хранящихся в разных файлах. В LATEX’е предусмотрены команды \include и \input, при которых транслятор будет автоматически склеивать содержимое файлов, указанных в качестве аргумента. Обычно создается один «главный» файл, содержащий основные команды обработки текста в преамбуле и последовательность команд для подключения файлов-частей в качестве тела документа. Именно этот файл должен вызываться для трансляции. Главный файл, подключающий, например, файлы, отвечающие за компоновку отдельных глав, может иметь вид TEX-код главного файла
\documentclass[12pt]{article} \begin{document} \include{ch0} % подключить файл ch0.tex \include{ch1} % подключить файл ch1.tex \end{document} Файл ch0.tex, подключающий параграфы некоторой главы, может состоять только из нескольких строк, подключающих файлы с текстами параграфов. Например, TEX-код файла ch0.tex
\input par1.tex \input par2.tex В самих файлах par1, par2 будет располагаться непосредственно текст работы (ни заголовка, ни преамбулы в этих файлах быть не должно!). Такая компоновка удобна при очень объемных текстах. Если потребуется изменить порядок следования параграфов, то достаточно будет лишь поменять местами пару строк, а не огромные фрагменты текста. 1. Структуру проекта хорошо отражает «Project Tree» (дерево проекта) редактора WinEdt (см. рис. 1). Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
24
Макет полосы набора; проекты
25
Рис. 1. Project Tree (слева) в окне WinEdt
Команда меню WinEdt
Показать/убрать дерево проекта — Project →
Tree. . . Команда \include Формат команды \include: \include{имя_файла} При указании в качестве аргумента команды \include имени несуществующего файла LATEX, не прерывая трансляции, выдаст предупреждение «Файл ... не найден». Команда \input Команда \input имеет следующий вид \input{имя_файла} и позволяет подсоединить любой текстовый файл. При указании в качестве аргумента команды \input имени несуществующего файла TEX прервет трансляцию файла, выдаст сообщение об ошибке и запросит другое имя файла. Например, пусть ошибочно записали расширение файла \input par2.te: Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
25
Макет полосы набора; проекты
26
! I can’t find file ‘par2.te’. l.65 \input par2.te Please type another input file name: В ответ на это сообщение нужно ввести либо правильное имя файла, либо слово nul. 2.6. а) Создайте новый tex-файл с именем Part01 (с помощью команды File → New). Наберите в нем текст \section{Первая глава} Первая часть большого документа. В файле Part01.tex должен содержаться только этот текст и никаких команд типа \begin{document}. б) Создайте новый tex-файл с именем Part02. Наберите в нем текст \section{Вторая глава} Вторая часть большого документа. в) Перейдите в редакторе на закладку с файлом, который Вы создали первым. Этот tex-документ будет у нас главным файлом. В файле подключите первую и вторую части с помощью команды input. Транслируйте файл. Посмотрите результат в dvi-файле. Обратите внимание, что TEX перед заголовком первой части поставил номер 1. Использованная команда \section{} позволяет создавать автоматически нумеруемые разделы. в) В главном файле измените порядок вызовов частей и заново его транслируйте. Посмотрите результат в dvi-файле. TEX автоматически перенумерует разделы Вашего текстового документа. Панель GUI WinEdt
Назначение текущего файла главным — кнопка с зе-
леным плюсом (Set Main File) на панели инструментов. Обратное действие: кнопка с красным минусом (Remove Main File). См. также раздел меню Project. Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
26
Макет полосы набора; проекты
2.3
27
Тесты
Раздел А «Выбор правильного ответа» A1. Высота тела документа задается с помощью параметра: а) \headheight б) \textheight в) \paperheight г) \paperwidth A2. Для изменения расстояния от левого края бумаги используется параметр: а) \oddsidemargin б) \footskip в) \marginparwidth г) \paperwidth A3. Команда \renewcommand{\baselinestretch}{1.2} изменяет интервал между строками следующим образом: а) увеличивает на 2 %
б) увеличивает на 20 %
в) увеличивает на 1.2 % г) уменьшает на 20 % A4. Какое значение параметра команды \pagestyle{параметр} позволит убрать номера страниц: а) empty
б) plain в) headings г) null
A5. Выберите неверную фразу: а) абзацный отступ — пробел в начале первой строки абзаца б) величина абзацного отступа во всем документе может быть изменена в преамбуле документа г) величина абзацного отступа во всем документе не может быть изменена в преамбуле документа д) величина абзацного отступа во всем документе определяется в файле класса документа Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
27
Макет полосы набора; проекты
28
Раздел B «Короткий ответ» B1. Имеется лист бумаги формата A4. Ширина тела текста задается равной 165 мм. Укажите способ задания правого поля, равным 15 мм. 2.4
Индивидуальные проекты
1. Создайте файл DiplomMain.tex проекта «Дипломная работа», подключающий файлы с введением (Intro) и двумя главами (Chapter1, Chapter2). В файлах Chapter1.tex, Chapter2.tex содержатся команды подключения файлов parN.tex с текстами разделов. Содержание глав и разделов произвольное (один–два абзаца текста). Заголовки глав и разделов формировать с помощью команд \chapter{Заголовок главы} и \section{Заголовок раздела}.
Структура проекта «Дипломная работа»: DiplomMain.tex \documentclass{report} \begin{document} подключение файла с введением подключение файла с I главой подключение файла со II главой \end{document} Intro.tex Текст введения.
Chapter1.tex подключение файлов par1.tex, par2.tex с разделами 1 и 2
Chapter2.tex подключение файлов par3.tex – par5.tex с разделами 3–5
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
28
Макет полосы набора; проекты
29
2. Создайте файл LectureMain.tex проекта «Курс лекций», подключающий файлы с двумя лекциями (Lectures1.tex, Lectures2.tex). В файлах Lectures1.tex, Lectures2.tex содержатся команды подключения файлов TopicN.tex с текстами разделов лекций. Содержание лекций и разделов произвольное (один–два абзаца текста). Заголовки лекций и разделов формировать с помощью команд \chapter{Заголовок лекции} и \section{Заголовок раздела}. Курс лекций должен иметь титульный лист, генерируемый с помощью команды \maketitle. Структура проекта «Курс лекций»: LectureMain.tex \documentclass{report} \begin{document} формирование титульного листа подключение файла с I лекцией подключение файла со II лекцией \end{document} Lectures1.tex подключение файлов Topic1.tex–Topic3.tex с разделами 1–3
Lectures2.tex подключение файлов Topic4.tex, Topic5.tex с разделами 4–5
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
29
3
Набор текста 3.1 Смена шрифтов 3.2 Буквальное воспроизведение 3.3 Тесты
3 3.1
Набор текста Смена шрифтов
Typeface Шрифт, используемый в основном тексте документа, называется основным. При необходимости выделения какого-либо фрагмента текста Панель GUI WinEdt
применяются команды переключения шрифтов. Команды для смены атрибутов шрифта \rm \sf
\textrm{...} \textsf{...}
прямой светлый шрифт рубленый шрифт
\tt
\texttt{...}
имитация пишущей машинки
\bf
\textbf{...}
полужирный шрифт
\it \sl \sc
\textit{...} \textsl{...} \textsc{...}
курсив наклонный шрифт капитель
Команды для переключения размера шрифта \tiny \scriptsize \footnotesize
очень маленький
маленький
\large большой \Large очень большой \LARGE совсем большой
\small
мелкий
\huge
\normalsize
нормальный
\Huge
крошечный
громадный грандиозный
Реальный размер шрифтов, задаваемых этими командами, зависит от класса документа. Команды переключения размера шрифта лучше
Набор текста
31
применять в группе, тогда после закрытия группы восстановится основной размер шрифта документа. Например,
группа другого размера.
{\Large группа} другого размера.
Команды, меняющие размер шрифта, изменяют еще и междустрочное расстояние — увеличивают, если размер шрифта был увеличен, и уменьшают в противном случае. Поэтому для правильной расстановки междустрочного интервала группу, в которой было осуществлено переключение размера, следует заканчивать после пустой строки. TEX определяет расстояние между строками на заключительном этапе вёрстки абзаца, например, когда встречает пустую строку.
После окончания группы размер шрифта и межстрочное расстояние автоматически восстановятся. Исходный TEX-код
{\small {\TeX} определяет расстояние между строками на заключительном этапе вёрстки абзаца, например, когда встречает пустую строку. } После окончания группы размер шрифта и межстрочное расстояние автоматически восстановятся.
3.2
Буквальное воспроизведение
Окружение verbatim позволяет выдавать текст в том виде, как он набран в файле, при этом используется шрифт typewriter. Использование окружения verbatim удобно, если нужно, например, изобразить команду TEX’а, не выполняя ее; или изобразить спецсимвол TEX’а. Внутри окружения verbatim можно использовать любые символы, за исключением строки \end{verbatim}. Команда меню WinEdt
Insert → Environments
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
31
Набор текста
32
3.1. Использование окружения verbatim для оформления текста программы. var a_1, a_2: Integer; begin Read(a_1, a_2);
\begin{verbatim} var a_1, a_2: Integer; begin
WriteLn(a_1 + a_2); end.
... \end{verbatim}
При наборе коротких последовательностей в стиле буквального воспроизведения удобнее использовать команду \verb. Ее формат несколько специфичен: после слова \verb должен стоять любой символ, потом текст для воспроизведения, и в конце — вновь символ, стоящий непосредственно после \verb. В качестве символов, открывающих и закрывающих verb-текст удобно применять либо символ «дюйма» ", либо вертикальную чёрточку |. Панель GUI WinEdt
Typeface
Текст a_1+a_2 буквально воспроизведен. Исходный TEX-код
Текст \verb|a_1+a_2| буквально воспроизведен. 3.1. Скопируйте приведенный ниже текст из pdf-файла. Создайте из него tex-файл. Используя полученные знания, сделайте из него текст, максимально совпадающий с нижеследующим. Указания. 1) Заголовки набирайте с помощью команд \section{Заголовок} и \subsection{Подзаголовок}; 2) Для установки абзацного отступа для первого абзаца section подключите пакет \usepackage{indentfirst}. Внимательно. При копировании текста из pdf-файла отдельные символы заменяются символами псевдографики (например, длинные и короткие Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
32
Набор текста
33
тире, кавычки, символ параграфа и т. п.). Все такие символы должны быть заменены соответствующими TEX-командами и символами.
1
Разные знаки в тексте
1.1
Кавычки, многоточие, тире и дефисы
При типографском наборе используются различные знаки для открывающихся и закрывающихся кавычек. В русских текстах употребляются кавычки «ёлочки» и лапки“: ” «ёлочки» и лапки“ и \glqq лапки\grqq ” Следует помнить, что после команд типа \grqq TEX не ставит знака пробела и его нужно создавать дополнительно. Лапки“ используются в художественных изданиях и в детских книж” ках. В остальной литературе лучше выглядят «ёлочки». Замечание. Недопустимо для изображение кавычек использовать значок «дюйма» ("). Для получения в тексте многоточия используется команда \dots: . . . — многоточие \dots~--- многоточие Многоточие в начале фразы не отрывается от последующего слова, в конце фразы — от предыдущего. Длинное тире в тексте используется в качестве тире как такового. Окружается с обеих сторон пробелами, причем слева неразрывным (~): Тире — это . . . Тире~--- это \dots Короткое тире используется для обозначения периода, а также для разделения цифр в таких случаях, как телефонный номер 5–15, VII–XIX, 63–34–21 5--15, VII--XIX, 63--34--21 Вокруг короткого тире пробелы не ставятся. Дефис — короткая горизонтальная чёрточка. По правилам пунктуации дефис применяется только в некоторых случаях, таких как сложные слова (во-первых) и словосочетания (интернет-кафе); сокращения (физра); перенос слова на другую строку. Дефис ставится вплотную к буквам. Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
33
Набор текста
1.2
34
Подчеркивание, текст в рамке
Для подчеркивания текста служит команда \underline{текст}. Подчеркиваемый текст должен умещаться в одной строке. Команда \fbox{текст} берет однострочный текст в рамку. Пример. Для выделения текстового фрагмента лучше изменить начертание шрифта, чем использовать подчеркивание. Подчеркнутый текст Текст в рамке
3.3
\underline{Подчеркнутый текст} \fbox{Текст в рамке}
Тесты
Раздел А «Выбор правильного ответа» A1. Выберите верное окончание фразы: Команды, меняющие размер шрифта,. . . а) не изменяют междустрочное расстояние б) изменяют междустрочное расстояние г) действуют только на один символ д) задаются в преамбуле документа A2. Для буквального воспроизведения текста используется окружение: а) text
б) mbox в) quote г) verbatim
A3. Выберите верный пример использования команды \verb: а) \verb{?}
б) \verb(?) в) \verb[?] г) \verb$?$
A4. Какое тире должно быть с обеих сторон окружено пробелами: а) дефис б) короткое в) длинное г) никакое A5. Выберите верный набор горизонтальных пробелов фиксированной длины: Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
34
Набор текста
35
а) \, \quad \qquad г) \quad \qquad ~
б) \quad \qquad \␣ д) ␣ \quad \qquad
A6. Дан фрагмент текста: Команда Команда Команда . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Выберите верную последовательность команд для создания бесконечно растяжимых промежутков, использованных в данном фрагменте. а) \dotfill \hfill \hrulefill в) \fill{_} \fill{ } \fill{.}
б) \hrulefill \hfill \dotfill г) \dotfill{\textwith} \hfill{\textwith} \hrulefill{\textwith}
A7. Какое значение параметра команды \vspace{параметр} позволит увеличить интервал между абзацами в два раза: а) 2 б) 2mm в) \baselineskip
г) \medskip
A8. Выберите тип кавычек, который обычно используется в научной русскоязычной литературе: а) I тип“ ”
б) «II тип» в) "III тип" г) ‘IV тип’
Раздел B «Короткий ответ» B1. Упорядочьте команды в порядке уменьшения задаваемого ими размера символов (надпишите над командами порядковые номера): \large \scriptsize \footnotesize \small \huge \normalsize \Large Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
35
Набор текста
36
B2. Исправьте ошибку в приведенном ниже tex-коде: {\Huge {\TeX} определяет расстояние между строками на заключительном этапе вёрстки абзаца, например, когда встречает пустую строку.} B3. Заполните таблицу соответствующими командами для задания шрифтов: шрифт 1 шрифт 2 шрифт 3 шрифт 4 шрифт 5 шрифт 6 шрифт 7
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
36
4
Верстка текста 4.1 Абзацы с нестандартным форматированием 4.2 Окружение tabular 4.3 Автоматическая генерация ссылок 4.4 Список литературы 4.5 Тесты 4.6 Индивидуальные проекты
4 4.1
Верстка текста, автоматическая генерация ссылок Абзацы с нестандартным форматированием
Для TEX’а стандартным стилем форматирования абзацев является форматирование «по ширине». Однако часто возникает необходимость в нестандартных абзацах — например, с выравниванием текста по правому краю: Все строки этого абзаца будут выключены вправо. Команда меню WinEdt
\begin{flushright} Все строки этого абзаца будут выключены вправо. \end{flushright} Insert → Environments
Для оформления абзацев с нестандартным форматированием предусмотрены специальные окружения: Стиль абзаца
Название окружения
центрирование center по левому краю flushleft по правому краю flushright короткие цитаты quote длинные цитаты quotation
Верстка текста, автоматическая генерация ссылок
4.2
38
Окружение tabular
Окружение tabular позволяет создавать сложные таблицы с автоматическим определением ширины колонок, с рамками и без, с записями, охватывающими несколько колонок. Команда меню WinEdt
Insert → Tabular (n × m) Формат окружения tabular
\begin{tabular}{преамбула_таблицы} тело таблицы \end{tabular} преамбула_таблицы описывает структуру колонок таблицы. Структура, в простейшем случае, задается буквами (по букве на каждую колонку): l, r, c (см. табл. ниже), а также символами |, служащими для указания вертикальных линеек, простирающихся на всю высоту колонки. Тело текста представляет собой собственно текст таблицы, при этом команда \\ разделяет строки таблицы, а знак & — колонки таблицы внутри одной строки. Графа строки образует группу, так что изменение параметров шрифта в одной колонке не влияет на остальные. Ширина колонок выбирается автоматически по максимальной ширине их содержимого. Горизонтальные линейки, имеющие ширину таблицы, задаются командой \hline. Эта команда может стоять либо в начале таблицы, либо после команды \\. Для горизонтальных линеек, простирающихся от столбца N до столбца M, используется команда \cline{N-M}. Значения параметров в преамбуле окружения tabular Параметр Тип выравнивания колонки l r c
по левому краю, по правому краю, с центрированным текстом.
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
38
Верстка текста, автоматическая генерация ссылок
39
Исходный TEX-код
\begin{center} Значения параметров в преамбуле окружения \texttt{tabular}\\[3mm] \begin{tabular}{c|l} Параметр & Тип выравнивания колонки \\ \hline \texttt{l} & по левому краю,\\[-0.5mm] \texttt{r} & по правому краю, \\ [-0.5mm] \texttt{c} & с центрированным текстом. \end{tabular} \end{center}
Для создания надписи, охватывающей несколько колонок, используется команда: \multicolumn{N}{преамбула_графы}{текст}
Аргументы команды multicolumn N
количество колонок, входящих в графу
преамбула_графы буквы l, r, c, возможно с символом | текст текст графы Исходный текст данной таблицы: TEX-код
\begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{Аргументы команды \tt multicolumn} \\ \hline \tt N & количество колонок, входящих в графу \\ \tt преамбула_графы & буквы {\tt l}, {\tt r}, {\tt c}, возможно с символом \tt | \\ \tt текст & текст графы \\ \hline \end{tabular} Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
39
Верстка текста, автоматическая генерация ссылок
40
В случае, когда в строке таблицы необходимо разместить длинный текст, занимающий абзац, для описания структуры колонки используется следующая преамбула p{ширина колонки в TEX’овских единицах} 4.1. Пример вёрстки таблицы. hhline
пакет, позволяющий в LATEX 2ε облегчить работу с линованными таблицами. Исходный TEX-код
\begin{tabular}{p{1,5cm}|p{12cm}} \hline \textsf{hhline} & пакет, позволяющий в \LaTeXe{} облегчить работу с линованными таблицами.\\ \hline \end{tabular}
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
40
4.1. Вручную создайте титульную страницу курсовой работы (образец см. ниже). Указание. Для форматирования текста используйте разные типы выравнивания текста, вертикальные пробелы «бесконечной» длины. Для создания информации о студенте и научном руководителе используйте таблицу с тремя колонками. Министерство образования и науки Российской Федерации Федеральное государственное образовательное учреждение высшего профессионального образования «ЮЖНЫЙ ФЕДЕРАЛЬНЫЙ УНИВЕРСИТЕТ» Факультет математики, механики и компьютерных наук Кафедра вычислительной математики и математической физики
Курсовая работа на тему: «Использование пакета LATEX 2ε
для оформления дипломных работ»
Студент 4 курса:
Теховский Т. Т.
Научный руководитель:
кандидат физ.-мат. наук, доцент Математиков М. М.
Ростов-на-Дону 2010
Верстка текста, автоматическая генерация ссылок
4.3
42
Автоматическая генерация ссылок
Команды меню WinEdt
Insert → LaTeX → Label, Insert → LaTeX → Reference
4.2. Добавьте команду \label{aaa} к своей фамилии на титульном листе. Где-нибудь в тексте (не на титульной странице) сделайте с помощью команды \pageref{aaa} ссылку на свою фамилию, например, в виде Автор этого труда (см. с.\,\pageref{aaa})\dots Дважды странслируйте текст и посмотрите результат. 4.4
Список литературы
Для оформления списка литературных источников используется окружение thebibliography \begin{thebibliography}{text} \bibitem{метка источника1} Описание первого источника. \bibitem{метка источника2} Описание второго источника. ... \end{thebibliography} Здесь text — обязательный аргумент, указывающий максимально широкий текст метки. Каждый источник вводится командой \bibitem{метка источника} метка источника — условное обозначение, состоящее из букв (заглавные и прописные буквы различаются), цифр, знаков препинания и некоторых Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
42
Верстка текста, автоматическая генерация ссылок
43
других символов. Именно на эту метку можно оформить автоматические ссылки с помощью команды \cite. 4.3. В конце текстового документа (на новой странице) создайте список литературы в виде (обратите внимание, что заголовок списка литературы отличается от стандартного):
Литература [1] Гуссенс М., Миттельбах Ф., Самарин А. Путеводитель по пакету LATEX и его расширению LATEX 2ε . М.: Мир, 1999. [2] Жуков М. Ю., Ширяева Е. В. LATEX 2ε : искусство набора и вёрстки текстов с формулами. Ростов н/Д : Изд-во ЮФУ, 2009. [3] Львовский С. М. Набор и верcтка в пакете LATEX. М.: Космосинформ, 1995. [4] Кошкин M. М. Компьютерное моделирование супермышеловки // Математическое моделирование. 2009. Т. 125, № 13. С. 838–848.
Ссылки на литературные источники в тексте Команда меню WinEdt
Insert → LaTeX → Cite
4.4. Добавьте в свой документ текст с автоматическими ссылками на литературные источники: Хорошие книги по TEXу — [1, 3]. Интересная математическая модель рассмотрена в работе [4, §§ 2–4].
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
43
Верстка текста, автоматическая генерация ссылок
44
4.5. 1) Создайте аннотацию для своего текстового документа. 2) С помощью стандартной команды создайте в своем документе оглавление. В нем обязательно должна присутствовать информация о списке литературы. 3) Наберите текст Тема «Подчеркивание,. . . » рассматривается в п. 1.2 на с. 34. используя команды для создания автоматических ссылок на разделы и страницы документа. 4.5
Тесты
Раздел А «Выбор правильного ответа» A1. Основные составляющие дипломной работы: а) шапка, содержащая титульные данные; аннотация; основная часть; список литературы б) титульная страница; оглавление; основная часть; список литературы в) титульная страница; аннотация; основная часть г) титульная страница; страница, содержащая выходные данные и аннотацию; содержание/оглавление; основная часть; список литературы A2. Команды секционирования \part \chapter \section \subsection \subsubsection \paragraph \subparagraph а) определены во всех классах б) определены только в классе book Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
44
Верстка текста, автоматическая генерация ссылок
45
в) определены только в классе report г) определены только в классе article A3. Выберите верный вариант использования команды секционирования: а) \section[Полный заголовок]{Сокращенный вариант заголовка} б) \section[Сокращенный вариант заголовка]{Полный заголовок} в) \section[Полный заголовок] г) \section A4. Для того, чтобы сделать автоматическую ссылку на страницу документа с некоторым фрагментом текста, соответствующее место в тексте (содержащее данный фрагмент) должно быть отмечено с помощью команды: а) \ref б) \pageref в) \section г) \label A5. Оглавление — это а) перечень всех разделов, статей или отдельных произведений, помещенных в издании, с указанием номеров страниц начала каждой статьи б) перечень всех входящих в издание частей, разделов, глав и параграфов с указанием номеров страниц, на которых они начинаются в) перечень отдельных произведений, помещенных в издании, с указанием номеров страниц начала каждой статьи г) перечень всех входящих в издание частей, разделов, глав и параграфов A6. Для автоматического формирования оглавления предназначена команда: а) \setcounter{tocdepth}{toc} б) \tableofcontents Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
45
Верстка текста, автоматическая генерация ссылок
46
в) \contents г) \tocdepth{toc} A7. Выберите правильный вариант использования команды \addcontentsline: а) \addcontentsline{toc}{\section*}{Заключение} б) \addcontentsline{tex}{section}{Заключение} в) \addcontentsline{toc}{\section}{Заключение} г) \addcontentsline{toc}{section}{Заключение} A8. Обязательный параметр окружения thebibliography указывает: а) максимальное число элементов библиографического списка б) максимально широкий текст метки в) минимальное число элементов библиографического списка г) минимально широкий текст метки A9. Для создания автоматической ссылку на библиографический источник с именем Test необходимо использовать команду: а) \ref{Test} б) \bibitem{Test} в) \cite{Test} г) \cite{test} A10. Как будет выглядеть заголовок, задающий таблицу вида: №
Как будет выглядеть заголо- Тестирование вок, задающий таблицу представленного вида?
A11
1 балл
а) \begin{tabular}{rp{65mm}l} б) \begin{tabular}{lp{65}r} в) \begin{tabular}{lpr} г) \begin{tabular}{lp{65mm}r} Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
46
Верстка текста, автоматическая генерация ссылок
47
A11. Выберите верное оформление затекстовой ссылки на книгу: а) Название. Автор. Выходные данные. б) Автор. Название. Выходные данные. в) Название // Автор. Выходные данные. г) Выходные данные // Автор. Название. Раздел B «Короткий ответ» B1. Дан ошибочный tex-код для создания таблицы: \begin{tabular}{lr} Тип & параметров окружения для создания таблицы \hline Параметр \verb"|" & задает горизонтальную линейку\\ Параметр \verb"c" & задает центрирование текста в колонке \hline \end{tabular} Исправьте ошибки, чтобы получить таблицу в виде: Тип параметров окружения для создания таблицы Параметр | задает горизонтальную линейку Параметр c задает центрирование текста в колонке B2. Запишите tex-код для создания таблицы: 1 2 3 1 2 3 1 2 3 1 2 3 Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
47
Верстка текста, автоматическая генерация ссылок
48
Раздел C «ПрактикаF » C1. Создайте текстовый документ в виде: 1-ая страница: пустая 2-ая страница: содержание 3-я страница: сверху страницы — список литературы, состоящий из двух источников (книги и статьи) 4-ая страница: внизу страницы — текст со ссылкой на литературу (на страницу, где расположена литература) и на оба библиографических источника из списка литературы 5 страница: пустая C2. Запишите tex-код для создания таблицы: § ¶ % c U r
£ z X
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
48
Верстка текста, автоматическая генерация ссылок
4.6
49
Индивидуальные проекты
1. Разработайте и создайте шаблон статьи, удовлетворяющей некоторым требованиям: левое поле, высота текста, ширина текста — по усмотрению автора шаблона (но не стандартные). Предполагается, что статья должна содержать а) индекс УДК; б) название статьи; в) ФИО авторов; г) название организации; д) аннотацию; е) тело документа без использования команд секционирования; ж) список литературы. 2. Разработайте и создайте шаблон курса лекций, удовлетворяющей некоторым требованиям: левое поле, высота текста, ширина текста — по усмотрению автора шаблона (но не стандартные). Предполагается, что текстовый документ должен содержать а) титульную страницу с указанием названий учебного заведения и дисциплины, ФИО лектора и года чтения лекций; б) оглавление; в) аннотацию; г) тело документа с использованием команд секционирования; д) список литературы.
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
49
5
Набор простых формул 5.1 Разные значки 5.2 Греческие буквы 5.3 Символы бинарных операций и отношений 5.4 5.5 5.6 5.7
Стрелки Степени и индексы Дроби Корни
5.8 Штрихи 5.9 Тесты
5 5.1
Набор простых формул Разные значки
Панель GUI WinEdt
Symbols
5.1. Создайте таблицу в виде: ∂ \partial
4 \triangle
∠ \angle
∞ \infty
∀ \forall
∃
`
\ell
∅
\varnothing
k \parallel
⊥ \perp
2 \Box
∇
\nabla
\exists
Указание. Формулы набираются в знаках доллара. В представленной таблице 8 колонок. 5.2
Греческие буквы
Панель GUI WinEdt
Greek
5.2. Напечатайте текст: A, B, Γ, ∆, E — это прописные греческие буквы α, β, γ, δ и ε. Слово TEX состоит из заглавных букв греческого алфавита T (τ , тау), E (, эпсилон) и X (χ, хи). Указание. Прописные «греческие» буквы A, B, T, E и X набирайте в математической моде.
Набор простых формул
5.3
51
Символы бинарных операций и отношений
Простые знаки +, −, (\geqslant),. . . Панели GUI WinEdt
=. . . , +/-. . . , AMS=
5.3. Создайте одну из выключных формул: v × w,
π/2 > x > 0,
D = [a, b] × [c, d],
y ∈ [0, ∞).
−π 6 x < π,
y ∈ (−∞, +∞).
Указания. Для создания пробела между выражениями используйте команду \quad. Для изображения жирных наклонных символов используйте команду \boldsymbol. 5.4. Наберите одно из предложений: Обозначение конъюнкции: A ∧ B; A & B; A · B. Обозначение дизъюнкции: A | B; A ∨ B; A + B.
5.4
Стрелки
Самая простейшая стрелка создается при помощи команды \to: n→∞
$n\to \infty$.
Для начертания более «сложных» стрелок предусмотрены различные команды, при этом в их названиях различаются строчные и прописные буквы ← \leftarrow
⇐ \Leftarrow
Панели GUI WinEdt
l \updownarrow
m \Updownarrow
{ }..., +/-..., —>...
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
51
Набор простых формул
52
5.5. Наберите одно из предложений: Обозначение импликации: A → B; A ⇒ B. Обозначение эквивалентности: A ≡ B; A ⇔ B; A ∼ B.
5.6. Создайте одну из выключных формул: A ∨ B =⇒ C & D ⇐⇒ A. (A =⇒ B) & (B =⇒ A). Указание. A создается командой \overline{A}. 5.5
Степени и индексы
Для набора степеней и индексов используются знаки ^ и _, соответственно. Если индекс (показатель степени) состоит из более чем одного символа, то его нужно ограничить фигурными скобками. Если буква содержит как верхние, так и нижние индексы, то их можно указывать в произвольном порядке, при этом на печати они располагаются один 3 под другим. Например, x1 = 2x0 ($x_1=2^{x_0^3}$). Панель GUI WinEdt
Math
5.7. Создайте выключную формулу: x1,2 ∈ R± , 5.6
θ ∈ A1 × B2 .
Дроби 0 < p/2 < ∞, 0 < x < 3.14.
$0 0; 0 при x = 0.
(6.10)
2 x − x при x > 0; h(x) = 55 при x = 0; 2 x при x < 0.
(6.11)
0 при x 6 0; g(x) = x при 0 < x 6 1; 2 x в противном случае.
(6.12)
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
66
Набор формул — почти “высший пилотаж”
6.8
67
Тесты
Раздел А «Выбор правильного ответа» A1. Выберите верную последовательность команд для демонстрации акцентов в формулах: а) a1 , a2 , a21 , б) a ˆ, a, ˙ ~a, в) a · b, a/b, a!,
г) a, a, a.
A2. Выберите набор команд, задающих растяжимые знаки: а) \overline{} \sqrt{} \widetilde{} б) \bar{} \sqrt{} \widetilde{} в) \overline{} \bar{} \widetilde{} г) \hat{} \overline{} \widetilde{} A3. Названия операций на печати отличаются: а) начертанием шрифта б) размером шрифта в) начертанием шрифта и дополнительным интервалом между названием операции и аргументов г) размером шрифта и дополнительным интервалом между названием операции и аргументов A4. Операция с пределом — это а) операция lim б) любая операция с над- и/или подстрочными знаками в) любая операция, участвующая в выражении вида operationcb г) любая операция, задающая диапазон изменения границ. A5. Команда \limits служит для: а) закрепления пределов операций сверху и снизу от знака любой операции б) указания пределов для любого знака операции Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
67
Набор формул — почти “высший пилотаж”
68
в) указания пределов для любого знака операции с пределами г) закрепления пределов операций сверху и снизу от знака операции с пределами A6. Окружение equation, используемое в виде \begin{equation} ... \end{equation} а) задает внутритекстовую многострочную формулу б) задает выключную однострочную ненумеруемую формулу в) задает выключную однострочную нумеруемую формулу г) задает выключную многострочную нумеруемую формулу A7. Текст в выключных формулах, задается с помощью команды \text{} и может включать в себя: а) только текст б) текст и внутристрочные формулы, не обязательно окружаемые знаками $ в) текст и внутристрочные формулы, обязательно окружаемые знаками $ г) только текст, причем набранный латинскими буквами. A8. Выберите верное окончание фразы: Окружение array а) предназначено для создания выключных однострочных формул б) предназначено для создания выключных однострочных формул в) имеет обязательные аргументы в) может использоваться вне окружений для создания формул A9. Выберите верное окончание фразы: Круглые скобки вокруг формулы, создаваемой с помощью окружения array Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
68
Набор формул — почти “высший пилотаж”
69
а) ставятся автоматически и их нельзя убрать б) ставятся автоматически и их можно убрать, указывая специальный параметр. в) никогда не ставятся автоматически и их нельзя задать дополнительно г) никогда не ставятся автоматически, но их можно задать дополнительно Раздел B «Короткий ответ» B1. Что будет выведено на экран в результате выполнения последовательности команд: где $\|\psi\|_{\mathbb{L}_2(\Omega_n)}$\dots B2. Запишите tex-код для создания формулы: b 13 2 ξ , где a = 1, b = 2. 3π a B3. Напишите, что будет выведено на экран в результате выполнения последовательности: $\mathop{\rm sin}x$, $\textrm{cos\,}x$ и покажите бессмысленность использования данного кода, заменив его оптимальным. ∞
B4. Запишите tex-код для создания формулы: F ♥i . i=0
B5. Исправьте ошибки в приведенном tex-коде: \begin{equation}\label{B5} \int\limits_{1-\sqrt{x}}^{1+\sqrt{x}}\quad sin x\!\!dx, \sqrt{2\pi}\!\!y. \end{equation} Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
69
Набор формул — почти “высший пилотаж”
70
и напишите, что будет выведено на экран в результате выполнения верного tex-кода. Раздел C «ПрактикаF » C1. Наберите текст с внутритекстовыми и выключными формулами: Операция Sktex определяет число студентов кафедры, слушающих курс «TEX-программирование»: 25
Sktex stud(i) =
25 X
i=x2
x2
stud(i) − Oop stud(i),
i=1
i=x1 +1
x2
где Oop stud(i) — число студентов, параллельно слушающих друi=x1 +1
гой курс. Указание. Используйте команду для определения операций. C2. Наберите текст с внутритекстовыми и выключными формулами: Операция TeorBif определяет число студентов кафедры, слушающих курс «Теория бифуркаций»: x2
TeorBif stud(i) = i=x1 +1
25 X i=1
25
stud(i) − Sktex stud(i). i=x2
25
Здесь Sktex stud(i) — число студентов, параллельно слушающих i=x2
курс «TEX-программирование». Указание. Используйте команду для определения операций. C3. С помощью окружения array создайте выключную формулу:
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
70
Набор формул — почти “высший пилотаж”
x4 x4 −x3 − −x3
−
71
5x2 − 6 x + 1 x3 x3 − x2 + 6x − 6 5x2 − 6 x2 6x2 − 6 − 6x2 + 6x − 6x − 6 − − 6x − 6 0 + + + −
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
71
7
Вставка изображений 7.1 7.2 7.3 7.4
Команда \includegraphics и bmp-файлы Команда \includegraphics и файлы форматов EPS и PDF Размер рисунка Поворот рисунка
7.5 Окружение figure 7.6 Министраницы и рисунки 7.7 Упражнения
7
Вставка изображений Для включения графического файла(bmp или eps3 ) в исходный доку-
мент предназначена команда \includegraphics, определенная в пакете graphicx \includegraphics[параметры]{имя графического файла} Если графический и исходный файлы находятся в разных каталогах, то имя файла в \includegraphics должно содержать и имя каталога: имя графического файла = имя каталога/имя файла Команда \includegraphics может использоваться внутри текста для . вставки небольших изображений 7.1
Команда \includegraphics и bmp-файлы
При использовании bmp-файлов в преамбуле документа необходимо указать декларацию: \DeclareGraphicsRule{.bmp}{bmp}{}{} 3
pdfLATEX — вариант системы LATEX, напрямую создающий pdf-файлы, — поддерживает файлы форматов jpeg и pdf.
Вставка изображений
73
Шаблон команды для подключения bmp-файлов имеет вид \includegraphics[width=ширина, height=высота]{имя файла.bmp} Указание параметров ширина и высота, а также расширения файла при подключении bmp-файлов обязательно! Например, \includegraphics[width=254pt,height=100pt]{Func_010.bmp} 7.2
Команда \includegraphics и файлы форматов EPS и PDF
Простейшая команда для подключения eps-файлов (и pdf-файлов) имеет вид (расширение файла можно не указывать) \includegraphics{имя файла}
7.3
Размер рисунка
Параметр scale используется для масштабирования изображения scale = масштаб масштаб — любое вещественное число, например, значение scale=1.1 увеличит рисунок на 10%. 7.1. Параметр scale позволяет легко создать такую «матрешку» y Y
B1
X A1
2
0
M
x
1
y Y
B1
X A1
2
A2
0
M
x
1
y Y
B1
B2
A2
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
0
B2
X A1
2
M
x
1
A2 B2
73
Вставка изображений
74
Исходный TEX-код
\includegraphics[scale=1]{R1.eps}\quad \includegraphics[scale=0.5]{R1.eps}\quad \includegraphics[scale=0.25]{R1.eps}
2. Значение параметра scale необходимо выбирать таким образом, чтобы символы, входящие в рисунок, были соразмерны символам, используемым в основном тексте. Рисунок фиксированного размера получается заданием параметров width = ширина, height = высота
ширина и высота рисунка указываются в TEX’овских единицах длины, при этом можно указывать либо ширину, либо высоту. Значение неуказанного параметра вычислится автоматически. 7.2. На рис. A и B использованы два способа отображения рисунков: один раз явно указан полный размер рисунка (произвольно), а второй — указана только высота.
Рис. B
Рис. A
Рисунки включены с помощью двух команд \includegraphics: TEX-код
\includegraphics[width=254pt, height=100pt]{Fig_1.eps}\qquad \includegraphics[height=100pt]{Fig_1.eps}
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
74
Вставка изображений
7.4
75
Поворот рисунка
Параметр angle позволяет задать величину угла поворота рисунка angle = угол в градусах Направление вращения — против часовой стрелки. Ось вращения по умолчанию проходит через точку отсчёта бокса — левый нижний угол.
angle = 7.5
–
−30
−60 −90
–
30
60
90
Окружение figure
Окружение figure позволяет задавать подпись к рисунку и снабжать его меткой (см. рис. 2): \begin{figure}[H] \centering \includegraphics{имя файла} \caption{Подпись к рисунку}\label{метка} \end{figure} Команда меню WinEdt
Insert → Objects → Figure
Параметр H в строке \begin{figure}[H] (корректно работает при подключении пакета float) фиксирует положение рисунка в выходном файле. 7.3. Использование окружения figure: Исходный TEX-код
\begin{figure}[H] \centering \includegraphics{bear} \caption{Мишка} \label{bear} \end{figure} Рис. 2. Мишка Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
75
Вставка изображений
76
3. Параметр \captionlabeldelim (из пакета caption2) управляет видом знака, стоящего после номера рисунка (по умолчанию это двоеточие): \renewcommand{\captionlabeldelim}{.} Информация об иллюстрациях, полученных с помощью окружения figure, может собираться в файлы с расширением .lof и выдаваться в выходной файл (создаётся раздел «Список иллюстраций») командой \listoffigures
7.6
Министраницы и рисунки
При вёрстке текстовых документов c рисунками часто используется окружение для создания министраниц minipage. Команда меню WinEdt
Insert → Environments → Minipage
На рис. 7.3 схематично изображено k начальное распределение примеси и 32 величина ζ-потенциала на разных участках границы, а также направление электроосмотического течения вдоль изолированных границ (нижняя и верхняя границы области).
ζ = 10 (15,31)
(15,2)
0
ζ = 10 (17,31)
(17,2)
ζ = −10
ζ = −10
64
j
Рис. 3. Положение примеси
В предложенном примере использовано два окружения minipage: TEX-код (шаблон)
\noindent \begin{minipage}{75mm} \parindent=7mm На рис.\,\ref{Ris:MP} схематично изображено начальное распределение примеси и величина ... \end{minipage}\hfill Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
76
Вставка изображений
77
\begin{minipage}{75mm} \begin{figure}[H] \centering \includegraphics{RisZeta.eps} \\ \caption{Положение примеси}\label{Ris:MP} \end{figure} \end{minipage} В пакете boxedminipage определено одноимённое окружение для создания министраниц, окаймлённых рамкой. Расстояние между рамкой и текстом определяется параметром \fboxsep (= 3 pt по умолчанию); ширина линий рамки — \fboxrule (= 0.4 pt по умолчанию).
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
77
Вставка изображений
7.7
78
Упражнения
7.1. Возьмите любой bmp-файл и создайте последовательность рисунков, масштабируя изображение, так чтобы отношения ширины к высоте сохранялись (см. также пример 7.1). 7.2. Возьмите любой eps-файл и создайте последовательность рисунков по образцу:
7.3. Создайте трехколоночный текст в виде (рисунок любой, рамки нужны):
Термин и саму концепцию разработал Дональд Кнут
Литературное Программирование — концепция, методология программирования и документирования.
Рис. 4. Логотип
в 1981 году при создании системы компьютерной вёрстки TEX.
7.4. Разместите два рисунка из eps-файлов рядом:
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
78
Вставка изображений
79
Рис. 5. Букет-1
Рис. 6. Букет-2
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
79
8
Программа TpX 8.1 8.2 8.3 8.4
8
Создание и редактирование рисунка Добавление в рисунок текста TpX и сохранение файлов Упражнения
Программа TpX
Векторный редактор TpX позволяет создавать изображения, которые можно экспортировать во многие форматы: EPS, PDF, BMP, EMF,. . . , причем прямо из редактора можно посмотреть результат построения изображения в форматах DVI, EPS и PDF (используются «схемы»: LaTeX → DVI;
LaTeX → DVI → PS; 0.55
PdfLaTeX → PDF). rot z u 3
0,4
1
4
0.45
Eout
2
0
1 2
0.35
y
x
3
u>0 u { \usetheme{Warsaw} \setbeamercovered{transparent} } \usepackage[cp1251]{inputenc} \usepackage[russian]{babel} \title{Вариант презентации} \institute[ЮФУ]{Южный федеральный университет} \date[XIII МСС]{XIII практическая конференция по мышеловству} \author[М.\,К.~Кошкина]{М.\,К.~Кошкина} \logo{\includegraphics[height=1cm]{Homa.pdf}} \useoutertheme{infolines} \setbeamertemplate{background canvas}[vertical shading]% [bottom=yellow!10,top=green!10] %-------------------------------------------------------------\begin{document} \begin{frame} \titlepage \end{frame} % -----------------------------\section[Простой текст]{Простой текст} % -----------------------------\begin{frame}{Простой текст} Черный текст на белом фоне (не в блоке) \medskip Гипертекстовая ссылка на литературу \cite{bib:Cat} получается автоматически. \medskip В слайдах можно размещать любой текст, формулы и рисунки \begin{equation}\label{eq:2} \lim\limits_{x\to 0} \frac{\sin x}{x}=1. \end{equation} \end{frame} % -----------------------------\section[Использование блоков]{Использование блоков} % -----------------------------\begin{frame}{Использование блоков} \begin{block}{block~--- белые буквы на синем фоне} Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
109
Создание презентаций
110
Черный текст на сером фоне. \end{block} \begin{alertblock}{alertblock~--- белые буквы на красном фоне} Черный текст на бледно-розовом фоне. \end{alertblock} \begin{exampleblock}{exampleblock~--- белые буквы на зелёном фоне} Формула на бледно-зелёном фоне: $\int\limits_a^b v(x)dx$. \end{exampleblock} \end{frame} % -----------------------------\section[Литература]{Литература} % -----------------------------\begin{frame}{Литература} \setbeamertemplate{blocks}[default] \begin{thebibliography}{2} \bibitem{bib:Cat} \textbf{Кошкин~К.\,И.} \dots \end{thebibliography} \end{frame} % -----------------------------\end{document}
6. При создании презентаций можно использовать все возможности пакета hyperref (см. раздел 10.1 и [1]).
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
110
Создание презентаций
111
Простой текст
Простой текст Вариант презентации
Черный текст на белом фоне (не в блоке) Гипертекстовая ссылка на литературу [1] получается автоматически.
М. К. Кошкина
В слайдах можно размещать любой текст, формулы и рисунки sin x lim = 1. (1) x→0 x
Южный федеральный университет
XIII практическая конференция по мышеловству
М. К. Кошкина (ЮФУ)
Вариант презентации
XIII МСС
1/4
М. К. Кошкина (ЮФУ)
Использование блоков
Вариант презентации
XIII МСС
2/4
Литература
Использование блоков
Литература
block — белые буквы на синем фоне Черный текст на сером фоне. Кошкин К. И. Математическая модель молчаливой собаки // Доклады ЗверНаук. 2009. Т. 67. № 1. С. 334–338.
alertblock — белые буквы на красном фоне Черный текст на бледно-розовом фоне. exampleblock — белые буквы на зелёном фоне Rb Формула на бледно-зелёном фоне: v (x)dx. a
М. К. Кошкина (ЮФУ)
Вариант презентации
XIII МСС
3/4
М. К. Кошкина (ЮФУ)
Вариант презентации
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
XIII МСС
4/4
111
Создание презентаций
11.6
112
Индивидуальные проекты
Создайте презентацию на заданную тему: 1. Цвет в LATEX’е (см., например, 9.1, 9.3, 9.4 и [1, 8]). 2. Цветные боксы и министраницы (см., например, 9.5 и [1, 3]). 3. Текст в рамке (см., например, 9.6 и [1, 3]). 4. Команда \hypertarget (см., например, 10.5 и [1, 5]). 5. Запуск внешних приложений (см., например, 10.7 и [1]). 6. Пакет ifmslide для создания слайдов (см., например, документацию из установки пакета MiKTeX). Необходимые составляющие: титульный лист; рисунки; гиперссылки (в том числе и на страницы в интернете); список литературы.
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
112
Список литературы
113
Список литературы [1] Жуков М. Ю., Ширяева Е. В. LATEX 2ε : искусство набора и вёрстки текстов с формулами. — Ростов н/Д : Изд-во ЮФУ, 2009. [2] Жуков М. Ю., Ширяева Е. В. Оформление математических текстов при помощи пакета LATEX 2ε . — Ростов н/Д : Изд-во ООО «ЦВВР», 2003. [3] Гуссенс М., Миттельбах Ф., Самарин А. Путеводитель по пакету LATEX и его расширению LATEX 2ε . — М.: Мир, 1999. [4] Львовский С. М. Набор и верcтка в пакете LATEX. — М.: Космосинформ, 1995. [5] Rahtz S. Hyperref-Package [Электронный ресурс] // http://www.tug.org/texlive/Contents/live/texmfdist/doc/latex/hyperref/. Дополнительная литература [6] Котельников И. А., Чеботаев П. З. Издательская система LATEX 2ε . — Новосибирск: Сибирский хронограф, 1998. [7] Кнут Д. Е. Всё про TEX. — Протвино: РДTEX, 1993. [8] Гуссенс М., Ратц C., Миттельбах Ф. Путеводитель по пакету LATEX и его графическим расширениям. — М.: Мир, 2002. [9] Спивак М. Восхитительный TEX: руководство по комфортному изготовлению научных публикаций в пакете AMS-TEX. — М.: Мир, 1993.
Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
113
Предметный указатель Дефис, 33
\include, 25
Кавычки
\input, 25
лапки, 33
\label, 42, 99
ёлочки, 33
\layout, 23
Класс документа
\left, 62
beamer, 105
\listoffigures, 76
Команда
\maketitle, 18
\DeclareGraphicsRule, 72
\multicolumn, 39
\author, 17
\pagecolor, 90
\bibitem, 42
\pageref*, 100
\chapter, 28
\pageref, 42
\cite, 43
\ref*, 100
\cline, 38
\right, 62
\colorbox, 91
\section, 26, 28
\color, 89
\setlength, 92
\date, 17
\shabox, 92
\documentclass, 13
\sqrt, 53
\dots, 33
\textcolor, 89, 90
\fbox, 34
\text, 64
\fcolorbox, 91
\thanks, 18
\frac, 53
\title, 17
\glqq, \grqq, 33
\underline, 34
\hline, 38
\usepackage, 14, 97
\href, 101, 102
\verb, 32
\hyperlink, 101
Окружение
\hyperref, 100
Bdescription, 93
\hypertarget, 100
Benumerate, 93
\includegraphics, 72, 73
Beqnarray, Beqnarray*, 93 114
Предметный указатель
115
Bitemize, 93
\angle, 75
array, 65
\fboxrule, 77, 92 \fboxsep, 77, 92
boxedminipage, 77 center, 37 equation, 60 figure, 75, 76 flushleft, flushright, 37 frame, 105 minipage, 76 quote, quotation, 37 tabular, 38 thebibliography, 42 verbatim, 31 Опция a4paper, 22 cp1251, 14 russian, 14 Опция (класса или пакета) pdfpagemode, 98 unicode, 97 Пакет babel, 14 color, 88, 89, 99 fancybox, 93 float, 75 graphicx, 72 hyperref, 97, 99 layout, 23 shadow, 92
\height, 74 \oddsidemargin, 23 \sboxrule, \sboxsep, \sdim, 92 \scale, 73 \textheight, \textwidth, 23 \topmargin, 23 \width, 74 l, r, c, 39 p{}, 40 Шрифтовая команда \Huge, \huge, 30 \LARGE, \Large, \large, 30 \bf, \bfseries, 30 \footnotesize, 30 \it, \itshape, 30 \normalsize, 30 \rm, \rmfamily, 30 \scriptsize, 30 \sc, \scshape, 30 \sf, \sffamily, 30 \sl, \slshape, 30 \small, 30 \tiny, 30 \tt, \ttfamily, 30 Тире длинное, 33 короткое, 33
Параметр Е. В. Ширяева, И. В. Ширяева. Введение в TEX-программирование
115