3

Suppose, I have a Russian text: quotes from law and my comments. And I want to put the comments in a such way, that:

  1. the reader can easily distinguish comments from the text of the law
  2. it won't distract the attention too much from the main text

Something like this:

enter image description here

What I achieved so far is this:

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\usepackage[T2A]{fontenc}
\setlength{\parindent}{0cm}
\newcommand{\note}[1]{\\\hfill\begin{minipage}{\dimexpr\textwidth-0.5cm}
\begin{itemize}
\item  \textbf{\textit{#1}}
\end{itemize}
\xdef\tpd{\the\prevdepth}
\end{minipage}\\
}
\begin{document}

Текст текст текст
\note{Мое важное замечание}
Текст текст текст
\end{document}

Generating this:

enter image description here

I think, that bold italic it's too distracting.

So, I tried OpenSans font, suggested by egreg here: Why does \usepackage[T2A]{fontenc} take over?:

\newcommand{\note}[1]{\\\hfill\begin{minipage}{\dimexpr\textwidth-0.5cm}
\begin{itemize}
\item {\fontfamily{fos}\selectfont \footnotesize #1}
\end{itemize}
\xdef\tpd{\the\prevdepth}
\end{minipage}\\
}

enter image description here

This is better, but when I tried to make it italic, it reverted to computer modern:

\item {\fontfamily{fos}\selectfont \it #1}

enter image description here

How can I generate something, looking like the model text?

4

The command \it is obsolete and should not be used in newer document precisely because its behavior is confusing: indeed it reverts the font attributes to normal and then applies \itshape. Use instead

\item {\fontfamily{fos}\itshape #1}

(\itshape does a \selectfont internally, so this command is not needed).

Do you really need a minipage? I guess that

\documentclass[12pt]{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}

\usepackage[a4paper]{geometry}

\newcommand{\note}[1]{%
  \begin{itemize}
    \item  \fontfamily{fos}\itshape #1
  \end{itemize}
}
\begin{document}

Текст текст текст
\note{Мое важное замечание}
Текст текст текст
\end{document}

is simpler.

  • minipage just removed extra vertical margins for itemize – user4035 Aug 18 '13 at 10:04
  • @user4035 You can use facilities of enumitem to suppress the vertical space. – egreg Aug 18 '13 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.