Please help me to figure out how to produce with that:
I have the following code:
\begin{flushright}
\begin{minipage}{0.5\textwidth}
{\bfseries Допущен к защите: }\hrulefill \\
{\bfseries Заведующий кафедрой: }\\
Должность, что-то еще.\\
Дата.\\
{\bfseries Выполнил: }Студент группы 85-07\\
Калашников М. А.\\
Подпись.\\
{\bfseries Научный руководитель: }\\
Кандидат физико-математических наук, Чирков А. Ю.\\
Подпись.\\
\end{minipage}
\end{flushright}
This is what I need:
I just want to add some spaces in certain strokes.
I have tried to use \hfill
, \indent
and some other approaches but it seems they don't work inside minipage
. There should be some easy way to do it (I've spent more 3 hours without results).
Update: step2.
Please take a look also at this one. How do I align some text blocks to the right?
I believe there also should be introduced a \newcommand
, but I'm still in the process of figuring out…
Best Answer
Since your data follow a well defined scheme, here's a possibility:
Don't add
\\
at the end of a "special paragraph"; the blank line between two of them is optional.Each "special paragraph" is typeset with hanging indentation of 3em (
\hangindent=3em
) starting after the first line (\hangafter=1
).The argument to
\specialpar
is the part that should go in bold face.What does go wrong in a
minipage
? To begin with, the\parindent
parameter is set to zero, so using\indent
is useless.Here we use a low level feature that's not really supported by LaTeX, but in some cases can come handy, because it's more easily realized than going with a customized list environment.
Our
\specialpar
command just absorbs as argument what should go in boldface and followed by the colon; then it starts a new paragraph, just to be safe, and sets the two "paragraph shape" parameters. With\hangindent
one specifies the amount of left indentation, with\hangafter
how many lines should be typeset before the indentation takes place. Finally, the boldface text (with added colon and space) is typeset and\ignorespaces
is issued, so spaces after the closing brace of the argument will be ignored.Are there other methods? Yes. For instance one could do with setting
\leftskip
:and then
would give the same result. The width reserved for the
minipage
can be given as optional argument to the new environment (default.6\textwidth
):would make a narrower
minipage
What's the difference with the above, apart making a new environment which might be advisable also for the original solution? The difference is that a setting to
\leftskip
goes on forever (respecting groups, so it will end with theminipage
), while\hangindent
and\hangafter
are reset at each end of paragraph.Another different solution is with the
enumitem
package.The syntax for the environment would be
Notice the need of
\mbox{}
when\item[...]
has to be directly followed by a line break.See the documentation of
enumitem
for details about the last suggestion.