LaTeX + diploma
Continuing the theme LaTeX + diploma.
I needed to write a diploma. Time is running out, the requirements are tough. There is material, the text is almost ready, it is necessary to draw up. He sat down, thought about it, and decided that I certainly did not want to do manual layout. From the experience of participating in various Olympiads it was recalled that it is better to lose an hour, but to make a decision, which will then be tested, than to immediately do something and therefore frantically redo it. Plus, I still wanted to do a thorough study of Latex and the company.
Initial conditions:
Acer Aspire One computer. A very successful machine for a student, it should be noted. Netbooks in Europe are called student computers.
The operating system is Linpus (read Fedora 8).
The Versky system - Latex in teTex implementation, now minimized.
It is required to receive the text of a diploma issued in accordance with all the rules of the educational institution within a week.
The design rules are as follows:
After a short analysis, the disser package was chosen as the basis for publication. The most important thing that bribed in it was a sense of integrity and the presence of a file for the assembly (i.e. Makefile).
At first, the author wanted to install TeXLive, but it did not work. For some reason, the installer did not start, and since the author is not strong in perl, there was no desire to understand. Of the packages, teTeX was installed using yum.
It should be noted that this process did not go fast, the benefit of GPRS Internet from Megafon is not quick pleasure (it’s not a stone in the Megafon garden, but a fact statement. GPRS Internet is slow!)
After that, from CTAN (www.ctan.org) there were disser packages and related packages are installed. How were the packages to be installed determined? Experimentally.
\ Usepackage {package_name} is written in the body of thesis.tex document, then a command is given
and the presence of an error of the form “package_stat.sty not found” is checked. If there is such an error, then this package was downloaded from the Internet, installed (with the obligatory execution of the command
About the environment should be said separately.
In my case (i.e., in the above configuration), teTeX installation occurred in the / usr / share / texmf directory (hereinafter $ TEXMF) with the rights rw-r - r--, i.e. a simple user can only read, but not write. And the installation of Latex packages takes place in the $ TEXMF / tex / latex / directory and beyond. Therefore, the entire contents of the packages are unavailable (we do not work as root!) The disser package was installed, respectively, in the $ TEXMF / tex / latex / disser directory, and the documentation for it was in $ TEXMF / doc / latex / disser.
The documentation for the disser package provides examples of different works - PhD, doctoral and master's theses, as well as the work of a bachelor. They are contained in the templates directory. If there were write permissions, then one could directly in the directory, for example, bachelor execute make and get the dvi-file on the output.
But since there is no write permission, the examples were copied to the ~ / Documents directory and work was done there.
Changes were made to the Makefile (an absolute path was specified in the include directive) so that make could already be done in the copy.
Next, the layout process itself began.
The text was originally planned to be set in utf-8 encoding, but later it turned out that BiBTeX is not able to process library files in this encoding, and it is not possible to combine two encodings in one project. Maybe this is possible, but it turned out to be cheaper to put the whole project into cp1251.
The text was typed in the geany editor, which required only syntax highlighting and the ability to work in cp1251 encoding. An important fact was the ability to work in full screen mode (all interface elements are disabled, except for the menu bar), because the computer screen is small.
The disser package involves breaking a document into small, logically connected portions. So, the introduction and conclusion are in separate files, intro.tex and concl.tex, respectively. Chapters are located in the files 1.tex, 2.tex, 3.tex, etc. Applications in the files app-1.tex, app-2.tex, etc.
The document is assembled by indicating in the thesis.tex file (main document) the following lines between \ begin {document} and \ end {document}: The table of contents, as required, is at the beginning of the document and starts on page 2. The title page for the thesis was issued (printed separately), so there was no need to impose it and include it in the document. To disable the title page, the title of the document indicated notitlepage, i.e. \ documentclass [notitlepage, ...] {disser}
where ellipsis replaced other options.
The sheet size is set by the geometry package:
It should be noted that in the disser package the elements of the text are configured very competently, i.e. titles of chapters, sections, subsections, etc.
For example, for designing the title of a chapter, the following commands are available: Commands determine the design of different parts of the header: \ thechapteralign - turn off the number, \ thechapterfont - font of the number, \ prethechapter - text before the number, \ postthechapter - text after the number, \ chapteralign - turn off the title text, \ chapterfont - the font of the title text, \ beforechapter - the indent to the title, \ afterchapter - the indent after the title. The same series of commands is also available for the title in the table of contents. A similar setting was made for each level of headings. Details are in the disser.pdf file.
Such a splitting allows you to make, for example, the following heading:
Chapter 1.
Analysis of the current state
and indicate a different design for the number and for the heading text.
As a result, the following commands appeared for the diploma in the preamble of the document (only the chapter settings are shown): We recompile and we get the correct headings for the chapter.
By default, all the headers in the disser package are typed in a larger font than the main text. According to the requirements, the headings should be typed in the same size as the main text (12), in bold
Therefore, we write in the preamble: Headings of the second and subsequent levels should have the same indentation as the main text, i.e. section number should not protrude to the left with respect to indentation. To do this, we include commands in the preamble (the main text is indented 1 cm) The indent from the title to the text should be at least 6 points:
Since there were many places in the diploma where several headings of different levels went in a row, the author made some violation for the sake of the visual component and reduced the indentation size for headings of the third level to three points:
The expression “plus .1pt” allows Latex to slightly move the headings in the vertical direction with page layout, which on several pages led to a more attractive result.
According to requirements, headings are typed in capital letters. It turned out to be quite simple to fix. We indicate in the preamble. For some reason, the “CONTENT” and “BIBLIOGRAPHIC LIST” had to be inserted into the body of the document, the latter immediately before the bibliography.
A qualification diploma begins on the cover page, followed by a table of contents. The table of contents is printed on page 2 onwards. This is done using the command
immediately before \ tableofcontents.
Applications are numbered with the number 1. By default, the disser package offers numbering of applications with the letter “A” (Cyrillic). To change the format of the number, the command is written in the preamble.
In addition, the text "APPENDIX 1" is turned off to the right. This is done by the team
in the preamble. The \ hfill command fills all the free space of the line, “crushing” what is before and after it in different directions of the line.
The table of contents should include headings of all levels. By default, the disser package includes only chapters and sections in the table of contents. Subsections - not included.
To fix, we add the command to the preamble.
In the case of the author’s diploma, this turned out to be enough, since the headings below the subsection were not used. If this is not so, then you need to specify 3 or even 4 in the command above.
Commands for splitting text (chapter, section, etc.) have an optional parameter that allows you to specify the text to be included in the table of contents. This is useful for wrapping strings in case of long headers. The command
allows you to make different headings in the text and in the table of contents.
The appendices in the table of contents begin with the word “APPLICATIONS”, which refers to the same page as the first appendix, i.e.
ANNEXES ....................... 51
ANNEX 1. Summary table .... 51
This is done simply. In the text of the first application (in the app-1.tex file), two commands are added to the beginning: \ clearpage is needed so that the \ addcontentsline and \ chapter commands are on the same page.
The disser package uses the bibtex8 command to compile the bibliography. TeTeX does not have this command, at least in those repositories that are connected by default.
Therefore, the author downloaded the source code of the utility and compiled it on his own, after which he placed it in the / usr / bin directory next to the bibtex utility, and placed the gost705.bst file used by disser in the diploma directory.
The controller did not miss the default font cm-super. Therefore, I had to connect the PsCyr package so that the text was made up of Times New Roman. I strongly dislike this font, but this is a formality, so I had to do it as indicated.
For some reason, when specifying the 12pt option in \ documentclass, Latex refused to change the font size. I had to consistently (with the rebuilding of the diploma) specify the font 8pt, 9pt, 11pt and then 12pt. After that, the font became the right size.
It should be noted that all experiments and tuning took about 3 days in total. This is taking into account the fact that the author’s knowledge of Latex was rather superficial before.
The author obtained basic information from the books of K. V. Vorontsov “Latex2e in examples”, S. M. Lvov's “Typing and layout in the Latex system” and, of course, the documentation for the disser package, no matter how scarce it is.
The advantages of Latex for works of this kind are enormous - the link apparatus allows you not to worry about the order in which applications, bibliographic list items, tables, figures, etc. work is carried out with simple text files, so the loss of formatting due to problems inside MS Word / OO Writer is impossible in principle; high printing quality; Perfectly transparent work with math.
Of course, there are problems too, but they are leveled out by advantages: difficulties with formatting long tables, difficult work with drawings, especially large-format ones; not always obvious ways to deal with problem areas in the text (dangling lines, words, overfull, underfull), etc. In general, for high-quality work in Latex, you need a little more knowledge in printing and programming than with a simple layout in Word / Writer. But it's worth it.
Fish text of the main diploma file using the disser package:
I needed to write a diploma. Time is running out, the requirements are tough. There is material, the text is almost ready, it is necessary to draw up. He sat down, thought about it, and decided that I certainly did not want to do manual layout. From the experience of participating in various Olympiads it was recalled that it is better to lose an hour, but to make a decision, which will then be tested, than to immediately do something and therefore frantically redo it. Plus, I still wanted to do a thorough study of Latex and the company.
We set the task
Initial conditions:
Acer Aspire One computer. A very successful machine for a student, it should be noted. Netbooks in Europe are called student computers.
The operating system is Linpus (read Fedora 8).
The Versky system - Latex in teTex implementation, now minimized.
It is required to receive the text of a diploma issued in accordance with all the rules of the educational institution within a week.
The design rules are as follows:
- Headset Times New Roman;
- Pin size 12pt;
- one and a half interval;
- indent from the header 6pt;
- headings of the first level (i.e. names of chapters) are turned off in the center;
- headings of subsequent levels are turned off to the left with mandatory indentation;
- coinciding with the indentation of the main text;
- applications are numbered with the number 1;
- the words “CONTENT”, “INTRODUCTION” are written in capital letters (that is, literally, as typed in this sentence);
- All headings are included in the content.
After a short analysis, the disser package was chosen as the basis for publication. The most important thing that bribed in it was a sense of integrity and the presence of a file for the assembly (i.e. Makefile).
Installation
At first, the author wanted to install TeXLive, but it did not work. For some reason, the installer did not start, and since the author is not strong in perl, there was no desire to understand. Of the packages, teTeX was installed using yum.
It should be noted that this process did not go fast, the benefit of GPRS Internet from Megafon is not quick pleasure (it’s not a stone in the Megafon garden, but a fact statement. GPRS Internet is slow!)
After that, from CTAN (www.ctan.org) there were disser packages and related packages are installed. How were the packages to be installed determined? Experimentally.
\ Usepackage {package_name} is written in the body of thesis.tex document, then a command is given
make; make pdfand the presence of an error of the form “package_stat.sty not found” is checked. If there is such an error, then this package was downloaded from the Internet, installed (with the obligatory execution of the command
sudo texhash) and the process was repeated. I must say that the author installed quite a few packages before understanding what he needs and what he can stop at, so I deliberately do not list the packages that were installed. About the environment should be said separately.
In my case (i.e., in the above configuration), teTeX installation occurred in the / usr / share / texmf directory (hereinafter $ TEXMF) with the rights rw-r - r--, i.e. a simple user can only read, but not write. And the installation of Latex packages takes place in the $ TEXMF / tex / latex / directory and beyond. Therefore, the entire contents of the packages are unavailable (we do not work as root!) The disser package was installed, respectively, in the $ TEXMF / tex / latex / disser directory, and the documentation for it was in $ TEXMF / doc / latex / disser.
The documentation for the disser package provides examples of different works - PhD, doctoral and master's theses, as well as the work of a bachelor. They are contained in the templates directory. If there were write permissions, then one could directly in the directory, for example, bachelor execute make and get the dvi-file on the output.
But since there is no write permission, the examples were copied to the ~ / Documents directory and work was done there.
Changes were made to the Makefile (an absolute path was specified in the include directive) so that make could already be done in the copy.
Next, the layout process itself began.
Diploma assembly
The text was originally planned to be set in utf-8 encoding, but later it turned out that BiBTeX is not able to process library files in this encoding, and it is not possible to combine two encodings in one project. Maybe this is possible, but it turned out to be cheaper to put the whole project into cp1251.
The text was typed in the geany editor, which required only syntax highlighting and the ability to work in cp1251 encoding. An important fact was the ability to work in full screen mode (all interface elements are disabled, except for the menu bar), because the computer screen is small.
The disser package involves breaking a document into small, logically connected portions. So, the introduction and conclusion are in separate files, intro.tex and concl.tex, respectively. Chapters are located in the files 1.tex, 2.tex, 3.tex, etc. Applications in the files app-1.tex, app-2.tex, etc.
The document is assembled by indicating in the thesis.tex file (main document) the following lines between \ begin {document} and \ end {document}: The table of contents, as required, is at the beginning of the document and starts on page 2. The title page for the thesis was issued (printed separately), so there was no need to impose it and include it in the document. To disable the title page, the title of the document indicated notitlepage, i.e. \ documentclass [notitlepage, ...] {disser}
\input{intro}
\input{1}
\input{2}
\input{3}
\input{concl}
\input{app-1}
\input{app-2}
...
where ellipsis replaced other options.
The sheet size is set by the geometry package:
\usepackage[
a4paper, includefoot,
left=3cm, right=1cm, top=2cm, bottom=1.5cm,
headsep=1cm, footskip=1cm
]{geometry}
Header customization
It should be noted that in the disser package the elements of the text are configured very competently, i.e. titles of chapters, sections, subsections, etc.
For example, for designing the title of a chapter, the following commands are available: Commands determine the design of different parts of the header: \ thechapteralign - turn off the number, \ thechapterfont - font of the number, \ prethechapter - text before the number, \ postthechapter - text after the number, \ chapteralign - turn off the title text, \ chapterfont - the font of the title text, \ beforechapter - the indent to the title, \ afterchapter - the indent after the title. The same series of commands is also available for the title in the table of contents. A similar setting was made for each level of headings. Details are in the disser.pdf file.
\thechapteralign
\thechapterfont
\prethechapter
\postthechapter
\chapteralign
\chapterfont
\beforechapter
\afterchapterSuch a splitting allows you to make, for example, the following heading:
Chapter 1.
Analysis of the current state
and indicate a different design for the number and for the heading text.
As a result, the following commands appeared for the diploma in the preamble of the document (only the chapter settings are shown): We recompile and we get the correct headings for the chapter.
\renewcommand{\thechapterfont}{\normalsize\bfseries} % Номер главы полужирным
\renewcommand{\prethechapter}{} % Убираем слово "Глава"
\renewcommand{\postthechapter}{.~} % ставим точку и пробел после номер
\renewcommand{\chapterfont}{\normalsize\bfseries} % шрифт текста заголовка
\renewcommand{\tocprethechapter}{} % в оглавлении убираем слово "Глава"
Other headers
By default, all the headers in the disser package are typed in a larger font than the main text. According to the requirements, the headings should be typed in the same size as the main text (12), in bold
Therefore, we write in the preamble: Headings of the second and subsequent levels should have the same indentation as the main text, i.e. section number should not protrude to the left with respect to indentation. To do this, we include commands in the preamble (the main text is indented 1 cm) The indent from the title to the text should be at least 6 points:
\renewcommand{\chapterfont}{\normalsize\bfseries}
\renewcommand{\sectionfont}{\normalsize\bfseries}
\renewcommand{\subsectionfont}{\normalsize\bfseries}
\renewcommand{\subsubsectionfont}{\normalsize\bfseries}
\renewcommand{\appendixfont}{\normalsize\bfseries}\renewcommand{\sectionindent}{1cm}
\renewcommand{\subsectionindent}{1cm}\renewcommand{\aftersection}{6pt plus .1pt}Since there were many places in the diploma where several headings of different levels went in a row, the author made some violation for the sake of the visual component and reduced the indentation size for headings of the third level to three points:
\renewcommand{\aftersubsection}{3pt plus .1pt}The expression “plus .1pt” allows Latex to slightly move the headings in the vertical direction with page layout, which on several pages led to a more attractive result.
Header Text
According to requirements, headings are typed in capital letters. It turned out to be quite simple to fix. We indicate in the preamble. For some reason, the “CONTENT” and “BIBLIOGRAPHIC LIST” had to be inserted into the body of the document, the latter immediately before the bibliography.
\renewcommand{\introname}{ВВЕДЕНИЕ}
\renewcommand{\pretheappendix}{\protect{ПРИЛОЖЕНИЕ}~} % в тексте
\renewcommand{\tocpretheappendix}{\protect{ПРИЛОЖЕНИЕ}~} % в оглавлении
\renewcommand{\conclusionname}{ЗАКЛЮЧЕНИЕ}Numbering
A qualification diploma begins on the cover page, followed by a table of contents. The table of contents is printed on page 2 onwards. This is done using the command
\setcounter{page}{2}immediately before \ tableofcontents.
Applications are numbered with the number 1. By default, the disser package offers numbering of applications with the letter “A” (Cyrillic). To change the format of the number, the command is written in the preamble.
\renewcommand{\theappendix}{\arabic{chapter}} % заменяем нумерацию приложений на цифрыIn addition, the text "APPENDIX 1" is turned off to the right. This is done by the team
\renewcommand{\theappendixalign}{\hfill}in the preamble. The \ hfill command fills all the free space of the line, “crushing” what is before and after it in different directions of the line.
Table of contents
The table of contents should include headings of all levels. By default, the disser package includes only chapters and sections in the table of contents. Subsections - not included.
To fix, we add the command to the preamble.
\setcounter{tocdepth}{2}In the case of the author’s diploma, this turned out to be enough, since the headings below the subsection were not used. If this is not so, then you need to specify 3 or even 4 in the command above.
Commands for splitting text (chapter, section, etc.) have an optional parameter that allows you to specify the text to be included in the table of contents. This is useful for wrapping strings in case of long headers. The command
\section[Очень длинный\\заголовок]{Очень\\длинный заголовок}allows you to make different headings in the text and in the table of contents.
The appendices in the table of contents begin with the word “APPLICATIONS”, which refers to the same page as the first appendix, i.e.
ANNEXES ....................... 51
ANNEX 1. Summary table .... 51
This is done simply. In the text of the first application (in the app-1.tex file), two commands are added to the beginning: \ clearpage is needed so that the \ addcontentsline and \ chapter commands are on the same page.
\clearpage
\addcontentsline{toc}{chapter}{ПРИЛОЖЕНИЯ}Bibliographic list
The disser package uses the bibtex8 command to compile the bibliography. TeTeX does not have this command, at least in those repositories that are connected by default.
Therefore, the author downloaded the source code of the utility and compiled it on his own, after which he placed it in the / usr / bin directory next to the bibtex utility, and placed the gost705.bst file used by disser in the diploma directory.
Font Times New Roman / 12 pt
The controller did not miss the default font cm-super. Therefore, I had to connect the PsCyr package so that the text was made up of Times New Roman. I strongly dislike this font, but this is a formality, so I had to do it as indicated.
For some reason, when specifying the 12pt option in \ documentclass, Latex refused to change the font size. I had to consistently (with the rebuilding of the diploma) specify the font 8pt, 9pt, 11pt and then 12pt. After that, the font became the right size.
Final provisions
It should be noted that all experiments and tuning took about 3 days in total. This is taking into account the fact that the author’s knowledge of Latex was rather superficial before.
The author obtained basic information from the books of K. V. Vorontsov “Latex2e in examples”, S. M. Lvov's “Typing and layout in the Latex system” and, of course, the documentation for the disser package, no matter how scarce it is.
The advantages of Latex for works of this kind are enormous - the link apparatus allows you not to worry about the order in which applications, bibliographic list items, tables, figures, etc. work is carried out with simple text files, so the loss of formatting due to problems inside MS Word / OO Writer is impossible in principle; high printing quality; Perfectly transparent work with math.
Of course, there are problems too, but they are leveled out by advantages: difficulties with formatting long tables, difficult work with drawings, especially large-format ones; not always obvious ways to deal with problem areas in the text (dangling lines, words, overfull, underfull), etc. In general, for high-quality work in Latex, you need a little more knowledge in printing and programming than with a simple layout in Word / Writer. But it's worth it.
Fish text of the main diploma file using the disser package:
\documentclass[bachelor,subf,12pt,notitlepage]{disser}
\usepackage{pscyr}
\usepackage[
a4paper, mag=1000, includefoot,
left=3cm, right=1cm, top=2cm, bottom=1.5cm, headsep=1cm, footskip=1cm
]{geometry}
\usepackage[T2A]{fontenc}
\usepackage[cp1251]{inputenc}
\usepackage[english,russian]{babel}
\usepackage{multirow}
\usepackage{longtable}
\ifpdf\usepackage[pdftex]{graphicx}\else\usepackage{graphicx}\fi
\usepackage{comment}
\ifpdf\usepackage{epstopdf}\usepackage{pdfpages}\fi
\graphicspath{{fig/}}
\renewcommand{\thechapterfont}{\normalsize\bfseries} % Номер главы полужирным
\renewcommand{\prethechapter}{} % Убираем слово "глава"
\renewcommand{\postthechapter}{.~} % ставим точку и пробел после номер
\renewcommand{\appendixfont}{\normalsize\bfseries}
\renewcommand{\chapterfont}{\normalsize\bfseries}
\renewcommand{\sectionfont}{\normalsize\bfseries}
\renewcommand{\subsectionfont}{\normalsize\bfseries}
\renewcommand{\subsubsectionfont}{\normalsize\bfseries}
\renewcommand{\tocprethechapter}{} % в оглавлении убираем слово "Глава"
\renewcommand{\theappendixalign}{\hfill} % выключка вправо для слова "приложение" в приложениии
\renewcommand{\theappendix}{\arabic{chapter}} % заменяем нумерацию приложений на цифры
\renewcommand{\pretheappendix}{\protect{ПРИЛОЖЕНИЕ}~} % Меняем регистр слова "Приложение"
\renewcommand{\tocpretheappendix}{\protect{ПРИЛОЖЕНИЕ}~} % Меняем регистр слова "Приложение"
\renewcommand{\introname}{ВВЕДЕНИЕ}
\renewcommand{\sectionindent}{1cm}
\renewcommand{\subsectionindent}{1cm}
\renewcommand{\aftersection}{6pt plus .1pt}
\renewcommand{\aftersubsection}{3pt plus .1pt}
\renewcommand{\conclusionname}{ЗАКЛЮЧЕНИЕ}
\renewcommand{\bibname}{БИБЛИОГРАФИЧЕСКИЙ СПИСОК}
\setcounter{tocdepth}{2}
\begin{document}
\setcounter{page}{2}
\renewcommand{\contentsname}{ОГЛАВЛЕНИЕ}
% ----------------------------------------------------------------
\tableofcontents
% ----------------------------------------------------------------
\input{intro}
\input{1}
\input{2}
\input{3}
\input{concl}
% ----------------------------------------------------------------
\appendix
\renewcommand{\sectionfont}{\normalsize\bfseries}
\renewcommand{\theappendixfont}{\normalsize\bfseries}
\input{app-1}
\input{app-2}
\input{app-3}
\input{app-4}
\renewcommand{\bibname}{БИБЛИОГРАФИЧЕСКИЙ СПИСОК}
\bibliography{thesis}
\bibliographystyle{gost705}
\end{document}