Editing style properties to make (alignment) be ‘Right to Left’ instead of ‘Use Main Object Settings’ would produce RTL paragraph, when exporting a .odt into .html.
It seems that Writer uses “LTR” for “Main Object” in RTL documents.
These are two simple one-paragraph files having a difference only in the alignment property in their styles (Both files have body dir=“rtl”): one with ‘Use Main Object Settings’ and the other with ‘Right to Left’.
When exporting into (x)html, the first will be rendered ‘Left to Right’:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<!--This file was converted to xhtml by LibreOffice - see https://cgit.freedesktop.org/libreoffice/core/tree/filter/source/xslt for the code.-->
<head profile="http://dublincore.org/documents/dcmi-terms/">
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
<title xml:lang="en-US">- no title specified</title>
<meta name="DCTERMS.title" content="" xml:lang="en-US"/>
<meta name="DCTERMS.language" content="en-US" scheme="DCTERMS.RFC4646"/>
<meta name="DCTERMS.source" content="http://xml.openoffice.org/odf2xhtml"/>
<meta name="DCTERMS.creator" content="Am J"/>
<meta name="DCTERMS.issued" content="2024-04-13T22:16:22.507000000" scheme="DCTERMS.W3CDTF"/>
<meta name="DCTERMS.contributor" content="Am J"/>
<meta name="DCTERMS.modified" content="2024-04-13T23:29:58.062000000" scheme="DCTERMS.W3CDTF"/>
<meta name="xsl:vendor" content="libxslt"/>
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" hreflang="en"/>
<link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" hreflang="en"/>
<link rel="schema.DCTYPE" href="http://purl.org/dc/dcmitype/" hreflang="en"/>
<link rel="schema.DCAM" href="http://purl.org/dc/dcam/" hreflang="en"/>
<style>
table { border-collapse:collapse; border-spacing:0; empty-cells:show }
td, th { vertical-align:top; font-size:12pt;}
h1, h2, h3, h4, h5, h6 { clear:both;}
ol, ul { margin:0; padding:0;}
li { list-style: none; margin:0; padding:0;}
span.footnodeNumber { padding-right:1em; }
span.annotation_style_by_filter { font-size:95%; font-family:Arial; background-color:#fff000; margin:0; border:0; padding:0; }
span.heading_numbering { margin-right: 0.8rem; }* { margin:0;}
.paragraph-P1{ font-size:12pt; text-align:left ! important; font-family:Calibri; writing-mode:horizontal-tb; direction:ltr;}
.paragraph-Title{ font-size:28pt; margin-bottom:0.212cm; margin-top:0.423cm; text-align:center ! important; font-family:'Liberation Sans'; writing-mode:horizontal-tb; direction:ltr;font-weight:bold; }
/* ODF styles with no properties representable as CSS:
.dp1 { } */
</style>
</head>
<body dir="rtl" style="max-width:21.001cm;margin-top:2cm; margin-bottom:2cm; margin-left:2cm; margin-right:2cm; ">
<p class="paragraph-Title">معايير</p>
<p class="paragraph-P1">نحاول هنا إدراج عدّة معايير تتحكّم في نوعية الإنتاج المطلوب تحقيقه في الخطة الخمسية. لتبسيط النتائج المتوقعة، سنقلل المعطيات إلى الحدّ الأدنى.</p>
</body>
</html>
While the second will have correct ‘Right to Left’ rendering:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<!--This file was converted to xhtml by LibreOffice - see https://cgit.freedesktop.org/libreoffice/core/tree/filter/source/xslt for the code.-->
<head profile="http://dublincore.org/documents/dcmi-terms/">
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
<title xml:lang="en-US">- no title specified</title>
<meta name="DCTERMS.title" content="" xml:lang="en-US"/>
<meta name="DCTERMS.language" content="en-US" scheme="DCTERMS.RFC4646"/>
<meta name="DCTERMS.source" content="http://xml.openoffice.org/odf2xhtml"/>
<meta name="DCTERMS.creator" content="Am J"/>
<meta name="DCTERMS.issued" content="2024-04-13T22:16:22.507000000" scheme="DCTERMS.W3CDTF"/>
<meta name="DCTERMS.contributor" content="Am J"/>
<meta name="DCTERMS.modified" content="2024-04-13T23:30:28.660000000" scheme="DCTERMS.W3CDTF"/>
<meta name="xsl:vendor" content="libxslt"/>
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" hreflang="en"/>
<link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" hreflang="en"/>
<link rel="schema.DCTYPE" href="http://purl.org/dc/dcmitype/" hreflang="en"/>
<link rel="schema.DCAM" href="http://purl.org/dc/dcam/" hreflang="en"/>
<style>
table { border-collapse:collapse; border-spacing:0; empty-cells:show }
td, th { vertical-align:top; font-size:12pt;}
h1, h2, h3, h4, h5, h6 { clear:both;}
ol, ul { margin:0; padding:0;}
li { list-style: none; margin:0; padding:0;}
span.footnodeNumber { padding-right:1em; }
span.annotation_style_by_filter { font-size:95%; font-family:Arial; background-color:#fff000; margin:0; border:0; padding:0; }
span.heading_numbering { margin-right: 0.8rem; }* { margin:0;}
.paragraph-P1{ font-size:12pt; text-align:right ! important;font-family:Calibri; writing-mode:horizontal-tb; direction:rtl; }
.paragraph-Title{ font-size:28pt; margin-bottom:0.212cm; margin-top:0.423cm; text-align:center ! important; font-family:'Liberation Sans'; writing-mode:horizontal-tb; direction:rtl; font-weight:bold; }
/* ODF styles with no properties representable as CSS:
.dp1 { } */
</style>
</head>
<body dir="rtl" style="max-width:21.001cm;margin-top:2cm; margin-bottom:2cm; margin-left:2cm; margin-right:2cm; ">
<p class="paragraph-Title">معايير</p>
<p class="paragraph-P1">نحاول هنا إدراج عدّة معايير تتحكّم في نوعية الإنتاج المطلوب تحقيقه في الخطة الخمسية. لتبسيط النتائج المتوقعة، سنقلل المعطيات إلى الحدّ الأدنى.</p>
</body>
</html>
paragraph_alignmentRTL.odt (12.5 KB)
paragraph_alignmentMainObject.odt (12.5 KB)