Ich schreibe im scrartcl
Unterricht ein Dokument auf Hebräisch (KOMA-Skript) und wenn ich auf Englisch schreibe, stehen die Teile und Abschnitte auf der linken Seite:
Wie kann ich es nach rechts verschieben? (also nach rechts scrbook
– da ist es perfekt!)
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}
Danke schön!
Antwort1
In scrbook würde das Gleiche passieren. Sie setzen eine englische Umgebung um Ihren \Abschnitt und dieser wird wie gewünscht mit dieser Sprache nach links verschoben.
Mit
\begin{document}
\part{abc}
\section{abc \texthebrew{גדה}}
%
\end{document}
Es funktioniert wie erwartet (ich musste die Schriftarten ändern):
Antwort2
Das Ergebnis von KOMA-Script ist absolut korrekt und wie erwartet. Ich habe einige Kommentare hinzugefügt, um zu erklären, wie es funktioniert:
% 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}
Es ist weder die Schuld von KOMA-Script noch von LaTeX, wenn ein Benutzer oder LyX seltsamen Code produziert.
BTW: Es stimmt nicht, dass scrbook
eine andere Ausrichtung der Überschriften erfolgt:
% 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}
(Hier habe ich nur scrartcl
in geändert scrbook
, die Option hinzugefügt oneside
und \part
in geändert \chapter
.)
Es macht also keinen Unterschied, ob Sie scrbook
oder verwenden scrartcl
.