문서 오른쪽 부분과 섹션을 만드는 방법은 무엇입니까?

문서 오른쪽 부분과 섹션을 만드는 방법은 무엇입니까?

저는 수업 시간에 히브리어로 문서를 작성하고 있는데 scrartcl(KOMA 스크립트) 영어로 작성할 때 해당 부분과 섹션이 왼쪽에 있습니다.
여기에 이미지 설명을 입력하세요

어떻게 오른쪽으로 옮길 수 있나요? (예를 들어 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-Script의 결과는 절대적으로 정확하며 예상됩니다. 작동 방식을 설명하기 위해 몇 가지 설명을 추가했습니다.

% 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.

스크북 포함

관련 정보