ドキュメントの右側にパーツやセクションを作成するにはどうすればよいでしょうか?

ドキュメントの右側にパーツやセクションを作成するにはどうすればよいでしょうか?

私は授業でヘブライ語(KOMA 文字)で文書を書いていますscrartclが、英語で書いているときは部分とセクションが左側にあります。
ここに画像の説明を入力してください

どうすれば右に移動できますか? (例えばscrbook- そこなら完璧です!)

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{fontspec}
    \setlength{\parindent}{0bp}

    \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]{Simple CLM}
    \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}

    \makeatother

    \usepackage{polyglossia}
    \setdefaultlanguage{hebrew}
    \setotherlanguage{english}
    \begin{document}
    \begin{english}[variant=american]%

    \part{abc}

    \section{abc \texthebrew{גדה}}
    \end{english}%

    \end{

document}

ありがとう!

答え1

scrbook でも同じことが起こります。\section の周囲に英語環境を配置すると、この言語で必要なように左に移動します。

  \begin{document}


    \part{abc}

    \section{abc \texthebrew{גדה}}
    %

    \end{document}

期待通りに動作します (フォントを変更する必要がありました):

ここに画像の説明を入力してください

答え2

KOMA スクリプトの結果は完全に正確で期待どおりです。動作の仕組みを説明するコメントをいくつか追加しました。

% Most of the code has been produces using LyX 2.3.2-2 which produces
% very ugly code, that often is not recommended by the KOMA-Script author,
% typographers or LaTeX experts.
\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}
\usepackage{fontspec}
\setlength{\parindent}{0bp}% Nonsense: see https://komascript.de/faq_parindent

\makeatletter% Not needed!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight % Nonsense: Does fail with LuaTeX!
\pdfpagewidth\paperwidth   % Nonsense: Does fail with LuaTeX!


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Simple CLM}
\AtBeginDocument{
\renewcommand\footnoterule{% Nonsense: Does break KOMA-Script!
  \kern -3pt
  \hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
  \kern 2.6pt
}}
\renewcommand{\labelenumii}{\labelenumi\arabic{enumii}.}
\addtokomafont{disposition}{\rmfamily}

\makeatother

\usepackage{polyglossia}% Polyglossia has known bugs!
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\begin{english}[variant=american]% Here you switch to English, so not
                                 % longer RTL but LTR. Default for parts
                                 % and sections in LTR is \raggedright =
                                 % left aligned. But you can change is
                                 % using:
  \renewcommand*{\raggedpart}{\raggedleft}%
  \renewcommand*{\raggedsection}{\raggedleft}%
  \part{abc}

  \section{abc \texthebrew{גדה}}
\end{english}%

% Now, we are Hebrew again, so we are in RTL. Default for parts and
% sections is \raggedright that is right aligned in RTL:

\part{\textenglish{abc}}
\section{\textenglish{abc} גדה}

\end{document}

結果

ユーザーまたは LyX が奇妙なコードを生成した場合、それは KOMA-Script または LaTeX のせいではありません。

ところで、それは正しくありません。scrbook見出しの配置が異なります。

% Most of the code has been produces using LyX 2.3.2-2 which produces
% very ugly code, that often is not recommended by the KOMA-Script author,
% typographers or LaTeX experts.
\documentclass[a4paper,english,hebrew,numbers=noenddot,oneside]{scrbook}
\usepackage{fontspec}
\setlength{\parindent}{0bp}% Nonsense: see https://komascript.de/faq_parindent

\makeatletter% Not needed!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight % Nonsense: Does fail with LuaTeX!
\pdfpagewidth\paperwidth   % Nonsense: Does fail with LuaTeX!


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Simple CLM}
\AtBeginDocument{
\renewcommand\footnoterule{% Nonsense: Does break KOMA-Script!
  \kern -3pt
  \hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
  \kern 2.6pt
}}
\renewcommand{\labelenumii}{\labelenumi\arabic{enumii}.}
\addtokomafont{disposition}{\rmfamily}

\makeatother

\usepackage{polyglossia}% Polyglossia has known bugs!
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\begin{english}[variant=american]% Here you switch to English, so not
                                 % longer RTL but LTR. Default for chapters
                                 % and sections in LTR is \raggedright =
                                 % left aligned. But you can change is
                                 % using:
  \chapter{abc}

  \section{abc \texthebrew{גדה}}
\end{english}%

\end{document}

(ここでscrartclは を に変更しscrbook、オプションを追加して にoneside変更しただけです。)\part\chapter

scrbookしたがって、と のどちらを使用しても違いはありませんscrartcl

スクラップブック付き

関連情報