1

Here is a MWE:

% Preview source code

%% LyX 2.3.2-2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{fontspec}
\setlength{\parindent}{0bp}
\usepackage{color}
\usepackage[unicode=true,pdfusetitle,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=true]
 {hyperref}
\hypersetup{
 linkcolor=blue}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Bellefair}
\newfontfamily{\am}{Open Sans Hebrew}
\AtBeginDocument{
\renewcommand\footnoterule{%
  \kern -3pt
  \hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
  \kern 2.6pt
}}
\renewcommand{\labelenumii}{\labelenumi\arabic{enumii}.}
\addtokomafont{disposition}{\rmfamily}
\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\bfseries\am\textcolor{blue}{#1:}}

\makeatother

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\begin{description}
\item [{כחגלדך}] דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו ביום
דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט
לו ביום דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו ביום דג
סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו
ביום דג סקרן שט לו ביום דג סקרן שט לו
\end{description}

\end{document}

This is the result:
enter image description here

As you can see there text is below the blue word. Can I separate them?
i.e.:
All of the text will be after the black line. Can I do something like this?
enter image description here

In other words - it is possible to make a space for the labels (blue words) and space for the text that they wont mix?

EDIT:
I use this solution to design my description - https://stackoverflow.com/a/7629070/2013542, so there is something that I can add for this that it will work?

Thank you!

heblyx
  • 2,571

1 Answers1

1

This answer slightly adjusts Gonzalo Medina's answer to a similar problem, so that you only need make changes in the preamble and can continue to use the description environment as normal in LyX.

MWE

\documentclass{article}
\usepackage{xcolor}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}

%% variable width label description set up
\usepackage{enumitem}
\usepackage{environ}
\newlength\widest
\renewcommand{\descriptionlabel}[1]{%
  \hspace{\labelsep}%
  \bfseries\textcolor{blue}{#1:}}
\newlist{heblyxdesc}{description}{1}
\makeatletter
\RenewEnviron{description}{%
  \vbox{%
    \global\setlength\widest{0pt}%
    \def\item[##1]{%
      \settowidth\@tempdima{\textbf{##1:}}%
      \ifdim\@tempdima>\widest\global\setlength\widest{\@tempdima}\fi%
    }%
    \setbox0=\hbox{\BODY}%
  }
  \begin{heblyxdesc}[
    leftmargin=\dimexpr\widest+0.5em\relax,
    labelindent=0pt,
    labelwidth=\widest,
    style=unboxed]
  \BODY
  \end{heblyxdesc}%
}
\makeatother

\begin{document}
\begin{description}
  \item[כחגלדך] דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו ביום דג
    סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו ביום
  \item[כחגלדך כחגלדך]
    דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו
    ביום דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט לו ביום דג סקרן שט
    לו ביום דג סקרן שט לו
\end{description}

\end{document}

MWE output

David Purton
  • 25,884
  • Thank you!! It's Works! But if put a very long word this is what happen: https://i.imgur.com/NqqZ39r.png (look at the third label). How can I fix this? – heblyx Jun 15 '19 at 19:39
  • @heblyx, I can not reproduce this with my MWE. Even long labels work properly. Check carefully that there are no differences from my code. And if still, then you could ask another question with a MWE. – David Purton Jun 16 '19 at 10:00