polyglossia icon indicating copy to clipboard operation
polyglossia copied to clipboard

Sanskrit text not justifying through ragged2e's justify environment

Open kae-vm opened this issue 1 year ago • 1 comments

i've input some sanskrit text, and it's my default language, but when i justify it using ragged2e's justify environment, it stays left-aligned. what do i do?

\documentclass[10pt, a4paper]{article}
\usepackage{polyglossia}
\setdefaultlanguage{sanskrit}

\begin{justify}
श्रीभगवानुवाच।\\
ऊर्ध्वमूलमधःशाखम्अश्वत्थंप्राहुरव्ययम्।\\
छन्दांसियस्यपर्णानियस्तंवेदसवेदवित्॥१॥
\end{justify}

image

kae-vm avatar Oct 31 '24 13:10 kae-vm

Please always give fully working examples, yours is incomplete:

\documentclass[10pt, a4paper]{article}
\usepackage{polyglossia}
\setdefaultlanguage{sanskrit}
\setmainfont[Script=Devanagari]{Noto Sans Devanagari}
\usepackage{ragged2e}

\begin{document}
	
\begin{justify}
श्रीभगवानुवाच।\\
ऊर्ध्वमूलमधःशाखम्अश्वत्थंप्राहुरव्ययम्।\\
छन्दांसियस्यपर्णानियस्तंवेदसवेदवित्॥१॥
\end{justify}

\end{document}

Anyway, compiling that I am not sure what you are expecting. I get (except for the missing indentation) the same output as when being in normal (justified) context: grafik

And this output is also what I would expect here. Note particularly that lines ended with \\ and the last lines in paragraphs are not stretched in justified context.

jspitz avatar Nov 01 '24 14:11 jspitz

apologies for missing the usepackage line.

i was hoping for a justified centered text, like in poem format, and i wasn't sure why only the first line was being repositioned. i did not know about \, thank you! i will check it out

kae-vm avatar Nov 04 '24 15:11 kae-vm