The complication of life in LaTeX
In the layout of the thesis in LaTeX it's steps to bring its appearance in line at least some of the adopted standards. Accordingly, the and seek solutions to emerging issues, including standard means, that is by gugleniya.
The first thought that occurred after looking at the solutions found on the motley forums — "I'm not going to sleep." A little reflection and immediate flip of the infamous guides Baldina, Syutkin and Lviv, confirming the results of reflection, allowed to deal with issues in a much more compact, convenient, and perceived ways.
And examples of how better not to do, I will give two. Honestly, they are very pleased, as testify the ingenuity and energy of their creators.
Task: to titles without hyphenations, a fully left-aligned.
Source: mix_mix with dxdy.ru
the
The decision of the local:
the
Task: get headers without division of words, with uppercase in the text and without it — the content.
Source: alex__, gentoo.ru
the
The decision of the local:
the
Both solutions, of course, if you wish, you can convert and global macros that will be enough once to include in the preamble of the document, but it will also be unnecessary fuss and time. Besides not the fact that your macro will not be able to correctly process your titles with any tricky moments in the form of, say, Greek letters or not to be night to remember, mathematical expressions.
Still almost do not understand the macros of TeX (and the above clutter the code — and at the dark forest), and always successfully cost more than standard commands and classes. The only third party in my configurations of miktex and texlive — fonts of PsCyr, and then not need them.
As an analogue of a problem comes to mind the eternal balancing act between writing your own implementations of any algorithms and the use of libraries. Even the argument that the researcher knows better what nuances can occur in the task, and therefore the code will take them into account — is not always correct. In many libraries, almost everything is taken into account. The standard algorithms are well tested so that the restrictions on their use go math, not implementation bug.
So, the question. Rhetorical. Why reinvent the wheel if there is truly basic to use and efficient means? To spend that much evident potential for the decision of everyday questions, losing the opportunity to leave more of it where it really needed?
Article based on information from habrahabr.ru
The first thought that occurred after looking at the solutions found on the motley forums — "I'm not going to sleep." A little reflection and immediate flip of the infamous guides Baldina, Syutkin and Lviv, confirming the results of reflection, allowed to deal with issues in a much more compact, convenient, and perceived ways.
And examples of how better not to do, I will give two. Honestly, they are very pleased, as testify the ingenuity and energy of their creators.
Task: to titles without hyphenations, a fully left-aligned.
Source: mix_mix with dxdy.ru
the
% left-aligned without hyphenation.
\newcommand{\MTKPsectAlignLeft}{%
\let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip%
\leftskip\z@skip}
% Centered
\newcommand{\MTKPsectAlignCenter}{%
\let\\\@centercr
\rightskip\@flushglue\leftskip\@flushglue
\parindent\z@\parfillskip\z@skip}
% Buns for convenience
\newcommand{\MTKPsectionAlign}{\MTKPsectAlignLeft}
\newcommand{\MTKPsubsectionAlign}{\MTKPsectAlignLeft}
\newcommand{\MTKPsubsubsectionAlign}{\MTKPsectAlignLeft}
% For installation alignment of sections at the time of Assembly
\newcommand{\MTKPsectAlign}[2]{%
\expandafter\renewcommand\csname\string MTKP#1Align\endcsname{%
\@nameuse{MTKPsectAlign#2}}}
% Title style
\newcommand{\MTKPsectionStyle}{\normalfont\MTKPfontXXVIsize\it\MakeUppercase}
% Thank you, luitzen
\renewcommand\section{\clearpage\@startsection {section}{1}{.em}%
{-15mm \@plus-3mm \@minus -2mm}%
{15mm \@plus 1mm \@minus 2mm}%
{\let\@hangfrom\@empty
\MTKPsectionAlign\MTKPsectionStyle}}
% Other titles as well.
% Now \chapter{Tra-La-La} will be without a number at the center
\newcommand\chapter{
\begingroup\clearpage\MTKPsectAlign{subsection}{Center}%
\subsection*{#1}%
\addcontentsline{toc}{section}{#1}\endgroup}
The decision of the local:
the
\section[Text content]{\raggedright Text\\ main document}
Task: get headers without division of words, with uppercase in the text and without it — the content.
Source: alex__, gentoo.ru
the
\makeatletter
\renewcommand{\l@section}{\@dottedtocline{1}{0.4 cm}{0.4 cm}}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\section}{\@startsection{section}{1}{1.25 cm}{-3.5 ex plus -1ex minus -.2ex}{2.3 ex plus.2ex}{\raggedright\normalfont\bfseries}}
\makeatother
%Design of sections
\makeatletter
\renewcommand{\l@subsection}{\@dottedtocline{2}{0.8 cm}{0.8 cm}}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
\renewcommand{\subsection}{\@startsection{subsection}{2}{1.25 cm}{-3.5 ex plus -1ex minus -.2ex}{2.3 ex plus.2ex}{\raggedright\normalfont\bfseries}}
\makeatother
%Making sub-subsections
\makeatletter
\renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}
\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{1.25 cm}{-3.5 ex plus -1ex minus -.2ex}{2.3 ex plus.2ex}{\raggedright\normalfont}}
\makeatother
\makeatletter
\newcommand{\Section}[1]{
\refstepcounter{section}
\section*{\MakeTextUppercase{\arabic{section} #1}}
\addcontentsline{toc}{section}{\arabic{section} #1}
}
\makeatother
The decision of the local:
the
\section[Text content]{TEXT \\ MAIN DOCUMENT}
Both solutions, of course, if you wish, you can convert and global macros that will be enough once to include in the preamble of the document, but it will also be unnecessary fuss and time. Besides not the fact that your macro will not be able to correctly process your titles with any tricky moments in the form of, say, Greek letters or not to be night to remember, mathematical expressions.
Still almost do not understand the macros of TeX (and the above clutter the code — and at the dark forest), and always successfully cost more than standard commands and classes. The only third party in my configurations of miktex and texlive — fonts of PsCyr, and then not need them.
As an analogue of a problem comes to mind the eternal balancing act between writing your own implementations of any algorithms and the use of libraries. Even the argument that the researcher knows better what nuances can occur in the task, and therefore the code will take them into account — is not always correct. In many libraries, almost everything is taken into account. The standard algorithms are well tested so that the restrictions on their use go math, not implementation bug.
So, the question. Rhetorical. Why reinvent the wheel if there is truly basic to use and efficient means? To spend that much evident potential for the decision of everyday questions, losing the opportunity to leave more of it where it really needed?
Комментарии
Отправить комментарий