\documentclass[10ptj]{ltjsarticle}
\usepackage[width=40\zw, lines=40,centering]{geometry}
\usepackage{amsmath,luacode,xcolor,luatexja-adjust}
\begin{document}
\def\R#1#2{\ltjenableadjust[profile=#1,linestep=#2]%
\noindent\fbox{\parbox{25\zw}{%
\baselineskip14pt\noindent
\setbox2=\vtop{\noindent\hsize20\zw\textcolor{cyan!30!white}{%
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■□□□□■
 □□□□■□□□□■□□□□■□□□□■
}}\dp2=0pt\rlap{\copy2}\par\vspace*{-\baselineskip}
\textbf{profile: #1, linestep: #2}\par
\vrule height 2pt depth 0pt width 10\zw\\
\vrule height 2pt depth 0pt width 10\zw\\
\the\baselineskip あああああああああああああああ\\
あああああああああ$X_{X_{X_X}}$ああああああ\\
ああああああああああああああああああ\\
……であるから$b=\dfrac1{X_2}$となる．\\
一方$\dfrac{A^A}{B_B}=21$なので……\\
……であるから$b=\dfrac1{X_2}$となる．\\%\vadjust{あああああ$\dfrac34$}\\
一方$\dfrac{A^A}{B_B}=21$なので……

あいであるから$b=\dfrac1{X_2}$となる．新段落！\\
一方$\dfrac{A^A}{B_B}=21$なので……

\hbox{感じ感じ$\displaystyle\int$}
ほげであるから$b=\dfrac1{X_2}$となる．新段落！\\
一方$\dfrac{A^A}{B_B}=21$なので……

\hrule
かきであるから$b=\dfrac1{X_2}$となる．hrule無効\\
一方$\dfrac{A^A}{B_B}=21$なので……

\prevdepth0pt
うえであるから$b=\dfrac1{X_2}$prevdepth設定のため無効\\
一方$\dfrac{A^A}{B_B}=21$なので……
}}\newpage}


\R{false}{false}
\R{true}{false}
\R{false}{true}
\R{true}{true}

\ltjgetparameter{linestep_factor}

\ltjdisableadjust
\def\R#1#2{\ltjenableadjust[profile=#1,priority=#2]%
\noindent\fbox{\parbox[t]{20\zw}{%
\baselineskip14pt\noindent
\textbf{profile: #1, priority: #2}\par
  \ltjsetparameter{xkanjiskip=.25\zw plus 20pt minus 20pt}
  ああxあaaaあxあx\vrule height 30pt depth 30pt width 9.7\zw「\break
  \vrule height 30pt depth 30pt width9.6\zw xあxあxあaaaああ「\break
}}}

\R{false}{false}%
\R{true}{false}\\
\R{false}{true}%
\R{true}{true}%

\ltjdisableadjust
\ltjenableadjust[profile]

\def\R#1{%
  \fbox{\parbox[t]{130pt}{\lineskip1pt\textbf{#1pt (\texttt{lineskip}: \the\lineskip)}\\%
    \noindent\vrule height 5pt depth 50pt width 45pt\kern30pt%
    \vrule height 5pt depth 50pt width 30pt\\
    \textcolor{red}{\kern\dimexpr45pt+#1pt\vrule height 50pt depth 5pt width20pt}%
    \textcolor{blue}{\kern-40pt\vrule height 5pt depth 5pt width 60pt}%
  }}\hskip0pt\ignorespaces
}

\newpage
\texttt{profile\_hgap\_factor=\ltjgetparameter{profile_hgap_factor}}\par
\noindent
\R{0}\R{0.5}\R{1}\R{2}\R{8}\R{9}\R{10}


\newpage
\ltjsetparameter{profile_hgap_factor=2}
\texttt{profile\_hgap\_factor=\ltjgetparameter{profile_hgap_factor}}\par
\noindent
\R{0}\R{0.5}\R{1}\R{2}\R{8}\R{9}\R{10}

\end{document}
