This sort of page layout is definitely possible in TeX. I'll first show a way to do it in plain TeX, because I understand it a bit better than I understand LaTeX.
Let's look at what we have in the image from the question:
Main content area

This is just running text, with appropriately chosen line breaks and page breaks. This is the bread-and-butter of TeX, what it was written for. It has no problem doing this.
The only unconventional things here are:
The dimensions of this region are different from the defaults:
% The dimensions of the "main content" area and its offset on the page.
\hsize=5in \vsize=1.5in
\hoffset=-0.7in \voffset=-0.7in % Added to the default of 1 inch.
% The dimensions of the page itself (optional)
\pdfpagewidth=6.5in \pdfpageheight=2.2in
The text is in Devanagari, so we can use XeTeX to load (define) and select a Devanagari font:
% TECKit mapping=devanagarinumerals converts "1" to "१", etc.
\font\devaserif="Noto Serif Devanagari:mapping=devanagarinumerals"
\devaserif
The left-side "header"

This region (containing the book title, chapter title, and the two vertical lines) can be made up as a set of boxes, skips (glue) and rules (lines):
\def\booktitle{वा॰रा॰}
\def\chaptertitle{बा॰का॰} % Set this up to change with chapter
\def\leftbar{%
\vbox to \vsize{\hbox{\booktitle} \vss \hbox{\chaptertitle}}%
\hskip 1pt%
\vrule height \vsize depth 5pt%
\hskip 1pt%
\vrule height \vsize depth 5pt%
}
The right-side "header"

This is similar. The only thing to know is that the page number is stored in a counter called \pageno, and that you can turn it into characters (in decimal) with \number. (Or you can directly use \folio instead of \number\pageno.)
\def\chapnumber{स॰ १}
\def\pagenumber{\number\pageno}
% The right-side "header" (or is it "footer"?)
\def\rightbar{%
\vrule height \vsize depth 5pt%
\hskip 1pt%
\vrule height \vsize depth 5pt%
\hskip 1pt%
\vbox to \vsize{\hbox{\chapnumber} \vss \hbox{\pagenumber}}%
}
Page makeup
Conventionally (in the conventions that TeX was designed for), a page has a header at the top and a footer at the bottom. In TeX, putting these together is handled by the output routine, which ships out all these boxes to a page. It also takes care of increasing the page number after each page is output. What we have here is slightly different (the "headers" are on the left and right: the page as a whole is made up of the left header, the main content area, and the right header), so we can redefine the output routine.
% The output routine: the page to \shipout, given main content in \box255.
\output={\shipout\hbox{%
\leftbar%
\hskip 10pt%
\box255%
\hskip 10pt%
\rightbar%
}\advancepageno}
All together
To get a working document just put all the above together with the text you want:
% The dimensions of the "main content" area and its offset on the page.
\hsize=5in \vsize=1.5in
\hoffset=-0.7in \voffset=-0.7in % Relative to the default of 1 inch.
\pdfpagewidth=6.5in \pdfpageheight=2.2in
% The material that should appear in the left and right bars.
% These should be redefined as the document progresses.
\def\booktitle{वा॰रा॰}
\def\chaptertitle{बा॰का॰}
\def\chapnumber{स॰ १}
\def\pagenumber{\number\pageno}
% The left-side "header"
\def\leftbar{%
\vbox to \vsize{\hbox{\booktitle} \vss \hbox{\chaptertitle}}%
\hskip 1pt%
\vrule height \vsize depth 5pt%
\hskip 1pt%
\vrule height \vsize depth 5pt%
}
% The right-side "header" (or is it "footer"?)
\def\rightbar{%
\vrule height \vsize depth 5pt%
\hskip 1pt%
\vrule height \vsize depth 5pt%
\hskip 1pt%
\vbox to \vsize{\hbox{\chapnumber} \vss \hbox{\pagenumber}}%
}
% The output routine: the page to \shipout, given main content in \box255.
\output={\shipout\hbox{%
\leftbar%
\hskip 10pt%
\box255%
\hskip 10pt%
\rightbar%
}\advancepageno}
% TECKit mapping=devanagarinumerals converts "1" to "१", etc.
\font\devaserif="Noto Serif Devanagari:mapping=devanagarinumerals"
\devaserif
तपःस्वाध्यायनिरतं तपस्वी वाग्विदां वरम् । नारदं परिपप्रच्छ वाल्मीकिर्मुनिपुंगवम् ॥ १ ॥
को न्वस्मिन् साम्प्रतं लोके गुणवान् कश्च वीर्यवान् । धर्मज्ञश्च कृतज्ञश्च सत्यवाक्यो दृढव्रतः ॥ २ ॥
चारित्रेण च को युक्तः सर्वभूतेषु को हितः । विद्वान् कः कः समर्थश्च कश्चैकप्रियदर्शनः ॥ ३ ॥
आत्मवान् को जितक्रोधो मतिमान् को ऽनसूयकः । कस्य बिभ्यति देवाश्च जातरोषस्य संयुगे ॥ 4 ॥
एतद् इच्छाम्यहं श्रोतुं परं कौतूहलं हि मे । महर्षे त्वं समर्थो ऽसि ज्ञातुम् एवंविधं नरम् ॥ 5 ॥
श्रुत्वा चैतत् त्रिलोकज्ञो वाल्मीकेर्नारदो वचः । श्रूयताम् इति चामन्त्र्य प्रहृष्टो वाक्यमब्रवीत् ॥ 6 ॥
बहवो दुर्लभाश्चैव ये त्वया कीर्तिता गुणाः । मुने वक्ष्याम्यहं बुद्ध्वा तैर्युक्तः श्रूयतां नरः ॥ 7 ॥
इक्ष्वाकुवंशप्रभवो रामो नाम जनैः श्रुतः । नियतात्मा महावीर्यो द्युतिमान् धृतिमान् वशी ॥ 8 ॥
बुद्धिमान् नीतिमान् वाग्मी श्रीमाञ् शत्रुनिबर्हणः । विपुलांसो महाबाहुः कम्बुग्रीवो महाहनुः ॥ 9 ॥
महोरस्को महेष्वासो गूढजत्रुररिंदमः । आजानुबाहुः सुशिराः सुललाटः सुविक्रमः ॥ 10 ॥
समः समविभक्ताङ्गः स्निग्धवर्णः प्रतापवान् । पीनवक्षा विशालाक्षो लक्ष्मीवाञ् शुभलक्षणः ॥ 11 ॥
धर्मज्ञः सत्यसंधश्च प्रजानां च हिते रतः । यशस्वी ज्ञानसंपन्नः शुचिर्वश्यः समाधिमान् ॥ 12 ॥
रक्षिता जीवलोकस्य धर्मस्य परिरक्षिता । वेदवेदाङ्गतत्त्वज्ञो धनुर्वेदे च निष्ठितः ॥ 13 ॥
सर्वशास्त्रार्थतत्त्वज्ञो स्मृतिमान् प्रतिभानवान् । सर्वलोकप्रियः साधुर् अदीनात्मा विचक्षणः ॥ 14 ॥
सर्वदाभिगतः सद्भिः समुद्र इव सिन्धुभिः । आर्यः सर्वसमश्चैव सदैकप्रियदर्शनः ॥ 15 ॥
स च सर्वगुणोपेतः कौसल्यानन्दवर्धनः । समुद्र इव गाम्भीर्ये धैर्येण हिमवान् इव ॥ 16 ॥
विष्णुना सदृशो वीर्ये सोमवत् प्रियदर्शनः । कालाग्निसदृशः क्रोधे क्षमया पृथिवीसमः ॥ 17 ॥
धनदेन समस् त्यागे सत्ये धर्म इवापरः । तम् एवंगुणसंपन्नं रामं सत्यपराक्रमम् ॥ 18 ॥
ज्येष्ठं श्रेष्ठगुणैर्युक्तं प्रियं दशरथः सुतम् । यौवराज्येन संयोक्तुम् ऐच्छत् प्रीत्या महीपतिः ॥ 19 ॥
तस्याभिषेकसंभारान् दृष्ट्वा भार्याथ कैकयी । पूर्वं दत्तवरा देवी वरम् एनम् अयाचत ॥ 20 ॥
विवासनं च रामस्य भरतस्याभिषेचनम् । स सत्यवचनाद् राजा धर्मपाशेन संयतः ॥ 21 ॥
विवासयाम् आस सुतं रामं दशरथः प्रियम् । स जगाम वनं वीरः प्रतिज्ञाम् अनुपालयन् ॥ 22 ॥
पितुर्वचननिर्देशात् कैकेय्याः प्रियकारणात् । तं व्रजन्तं प्रियो भ्राता लक्ष्मणो ऽनुजगाम ह ॥ 23 ॥
स्नेहाद् विनयसंपन्नः सुमित्रानन्दवर्धनः । सर्वलक्षणसंपन्ना नारीणाम् उत्तमा वधूः ॥ 24 ॥
सीताप्यनुगता रामं शशिनं रोहिणी यथा । पौरैरनुगतो दूरं पित्रा दशरथेन च ॥ 25 ॥
\medskip
तेन गत्वा पुरीं लङ्कां हत्वा रावणम् आहवे । अभ्यषिञ्चत् स लङ्कायां राक्षसेन्द्रं विभीषणम् ॥ 66 ॥
कर्मणा तेन महता त्रैलोक्यं सचराचरम् । सदेवर्षिगणं तुष्टं राघवस्य महात्मनः ॥ 67 ॥
तथा परमसंतुष्टैः पूजितः सर्वदैवतैः । कृतकृत्यस् तदा रामो विज्वरः प्रमुमोद ह ॥ 68 ॥
देवताभ्यो वरान् प्राप्य समुत्थाप्य च वानरान् । पुष्पकं तत् समारुह्य नन्दिग्रामं ययौ तदा ॥ 69 ॥
नन्दिग्रामे जटां हित्वा भ्रातृभिः सहितो ऽनघः । रामः सीताम् अनुप्राप्य राज्यं पुनरवाप्तवान् ॥ 70 ॥
\bye
If you put the above into a file called ramayana.tex and process it with xetex ramayana.tex, it produces:

Compiling in LaTeX
LaTeX provides certain features (automatic numbering, cross-references, bibliographies, indexes, …), and many packages are written only to work with LaTeX. If you need any of those, then you may prefer to use LaTeX instead of plain TeX.
The main challenge translating the above to even compile with LaTeX is that I could not find any useful documentation of LaTeX equivalents of TeX idioms. For instance, LaTeX has its own complicated output routine that does a huge deal (so it's unwise to redefine \output). I had to make the following changes:
- redefine
\@outputpage instead of \output
- use
\box\@outputbox (which is \box23) rather than \box255
- set
\textwidth and \texheight instead of \hsize and \vsize
- set some more length parameters that affect the offset (
\oddsidemargin, \evensidemargin, \topmargin \headheight, \headsep)
- use a LaTeX counter called "page" instead of
\pageno, and \arabic{page} instead of \number\pageno
- define a new font with
\usepackage{fontspec} then \newfontfamily, rather than with \font.
With those changes, a file that compiles with xelatex (but stylistically not a “real” LaTeX document, see below):
\documentclass{article}
\usepackage{fontspec}
% TECKit Mapping=devanagarinumerals converts "1" to "१", etc.
\newfontfamily\devaserif[Mapping=devanagarinumerals]{Noto Serif Devanagari}
% The dimensions of the "main content" area and its offset on the page.
\textwidth=5in \textheight=1.5in
\hoffset=-0.7in \voffset=-0.7in % Relative to the default of 1 inch.
\oddsidemargin=0pt \evensidemargin=0pt \topmargin=0pt \headheight=0pt \headsep=0pt
\pdfpagewidth=6.5in \pdfpageheight=2.2in
% The material that should appear in the left and right bars.
% These should be redefined as the document progresses.
\def\booktitle{वा॰रा॰}
\def\chaptertitle{बा॰का॰}
\def\chapnumber{स॰ १}
\def\pagenumber{\arabic{page}}
% The left-side "header"
\def\leftbar{%
\vbox to \vsize{\hbox{\booktitle} \vss \hbox{\chaptertitle}}%
\hskip 1pt%
\vrule height \vsize depth 5pt%
\hskip 1pt%
\vrule height \vsize depth 5pt%
}
% The right-side "header" (or is it "footer"?)
\def\rightbar{%
\vrule height \vsize depth 5pt%
\hskip 1pt%
\vrule height \vsize depth 5pt%
\hskip 1pt%
\vbox to \vsize{\hbox{\chapnumber} \vss \hbox{\pagenumber}}%
}
% The output routine: the page to \shipout, given main content in \box255.
\makeatletter
\def\@outputpage{\shipout\hbox{%
\leftbar%
\hskip 10pt%
\box\@outputbox%
\hskip 10pt%
\rightbar%
}\stepcounter{page}}
\makeatother
\begin{document}
\devaserif
\parindent=20pt % To match TeX. (Instead of 15pt.)
तपःस्वाध्यायनिरतं तपस्वी वाग्विदां वरम् । नारदं परिपप्रच्छ वाल्मीकिर्मुनिपुंगवम् ॥ १ ॥
को न्वस्मिन् साम्प्रतं लोके गुणवान् कश्च वीर्यवान् । धर्मज्ञश्च कृतज्ञश्च सत्यवाक्यो दृढव्रतः ॥ २ ॥
चारित्रेण च को युक्तः सर्वभूतेषु को हितः । विद्वान् कः कः समर्थश्च कश्चैकप्रियदर्शनः ॥ ३ ॥
आत्मवान् को जितक्रोधो मतिमान् को ऽनसूयकः । कस्य बिभ्यति देवाश्च जातरोषस्य संयुगे ॥ 4 ॥
एतद् इच्छाम्यहं श्रोतुं परं कौतूहलं हि मे । महर्षे त्वं समर्थो ऽसि ज्ञातुम् एवंविधं नरम् ॥ 5 ॥
श्रुत्वा चैतत् त्रिलोकज्ञो वाल्मीकेर्नारदो वचः । श्रूयताम् इति चामन्त्र्य प्रहृष्टो वाक्यमब्रवीत् ॥ 6 ॥
बहवो दुर्लभाश्चैव ये त्वया कीर्तिता गुणाः । मुने वक्ष्याम्यहं बुद्ध्वा तैर्युक्तः श्रूयतां नरः ॥ 7 ॥
इक्ष्वाकुवंशप्रभवो रामो नाम जनैः श्रुतः । नियतात्मा महावीर्यो द्युतिमान् धृतिमान् वशी ॥ 8 ॥
बुद्धिमान् नीतिमान् वाग्मी श्रीमाञ् शत्रुनिबर्हणः । विपुलांसो महाबाहुः कम्बुग्रीवो महाहनुः ॥ 9 ॥
महोरस्को महेष्वासो गूढजत्रुररिंदमः । आजानुबाहुः सुशिराः सुललाटः सुविक्रमः ॥ 10 ॥
समः समविभक्ताङ्गः स्निग्धवर्णः प्रतापवान् । पीनवक्षा विशालाक्षो लक्ष्मीवाञ् शुभलक्षणः ॥ 11 ॥
धर्मज्ञः सत्यसंधश्च प्रजानां च हिते रतः । यशस्वी ज्ञानसंपन्नः शुचिर्वश्यः समाधिमान् ॥ 12 ॥
रक्षिता जीवलोकस्य धर्मस्य परिरक्षिता । वेदवेदाङ्गतत्त्वज्ञो धनुर्वेदे च निष्ठितः ॥ 13 ॥
सर्वशास्त्रार्थतत्त्वज्ञो स्मृतिमान् प्रतिभानवान् । सर्वलोकप्रियः साधुर् अदीनात्मा विचक्षणः ॥ 14 ॥
सर्वदाभिगतः सद्भिः समुद्र इव सिन्धुभिः । आर्यः सर्वसमश्चैव सदैकप्रियदर्शनः ॥ 15 ॥
स च सर्वगुणोपेतः कौसल्यानन्दवर्धनः । समुद्र इव गाम्भीर्ये धैर्येण हिमवान् इव ॥ 16 ॥
विष्णुना सदृशो वीर्ये सोमवत् प्रियदर्शनः । कालाग्निसदृशः क्रोधे क्षमया पृथिवीसमः ॥ 17 ॥
धनदेन समस् त्यागे सत्ये धर्म इवापरः । तम् एवंगुणसंपन्नं रामं सत्यपराक्रमम् ॥ 18 ॥
ज्येष्ठं श्रेष्ठगुणैर्युक्तं प्रियं दशरथः सुतम् । यौवराज्येन संयोक्तुम् ऐच्छत् प्रीत्या महीपतिः ॥ 19 ॥
तस्याभिषेकसंभारान् दृष्ट्वा भार्याथ कैकयी । पूर्वं दत्तवरा देवी वरम् एनम् अयाचत ॥ 20 ॥
विवासनं च रामस्य भरतस्याभिषेचनम् । स सत्यवचनाद् राजा धर्मपाशेन संयतः ॥ 21 ॥
विवासयाम् आस सुतं रामं दशरथः प्रियम् । स जगाम वनं वीरः प्रतिज्ञाम् अनुपालयन् ॥ 22 ॥
पितुर्वचननिर्देशात् कैकेय्याः प्रियकारणात् । तं व्रजन्तं प्रियो भ्राता लक्ष्मणो ऽनुजगाम ह ॥ 23 ॥
स्नेहाद् विनयसंपन्नः सुमित्रानन्दवर्धनः । सर्वलक्षणसंपन्ना नारीणाम् उत्तमा वधूः ॥ 24 ॥
सीताप्यनुगता रामं शशिनं रोहिणी यथा । पौरैरनुगतो दूरं पित्रा दशरथेन च ॥ 25 ॥
\medskip
तेन गत्वा पुरीं लङ्कां हत्वा रावणम् आहवे । अभ्यषिञ्चत् स लङ्कायां राक्षसेन्द्रं विभीषणम् ॥ 66 ॥
कर्मणा तेन महता त्रैलोक्यं सचराचरम् । सदेवर्षिगणं तुष्टं राघवस्य महात्मनः ॥ 67 ॥
तथा परमसंतुष्टैः पूजितः सर्वदैवतैः । कृतकृत्यस् तदा रामो विज्वरः प्रमुमोद ह ॥ 68 ॥
देवताभ्यो वरान् प्राप्य समुत्थाप्य च वानरान् । पुष्पकं तत् समारुह्य नन्दिग्रामं ययौ तदा ॥ 69 ॥
नन्दिग्रामे जटां हित्वा भ्रातृभिः सहितो ऽनघः । रामः सीताम् अनुप्राप्य राज्यं पुनरवाप्तवान् ॥ 70 ॥
\end{document}
The output (when the above is compiled with xelatex) is identical to the output from plain XeTeX above. Of course I may not have done things the right LaTeX way (the same applies even for the plain TeX code).
Towards “real” LaTeX
Although the above compiles with xelatex, stylistically it would not qualify as a “real” LaTeX document. LaTeX comes with its own philosophy (alternate link), and conventions. For example (thanks to @cfr's comments below):
- It is recommended to use
\newcommand rather than \def: as far as I can tell, the main reason is to prevent accidentally redefining commands. It works to just replace each \def above with \newcommand. (But I don't know how much redefinition is a worry in this case, and I definitely do not fully understand the definition of \newcommand.)
- Set the page dimensions with the
geometry package. The idea is that such packages are likely to have anticipated common user needs and pitfalls, and possibly be “battle-tested” code. Of course, it also means there are more layers to understand, and more interactions where failures can occur… [This would look something like \usepackage[width=5in, height=1.5in, top=0.3in, left=0.3in, paperwidth=6.5in, paperheight=2.2in]{geometry} but I wasn't able to get this to work with the redefinition of the output routine.]
- Use
\setmainfont (documented in package fontspec) as most of the document is in the same font: so \setmainfont[Script=Devanagari,Mapping=devanagarinumerals]{Noto Serif Devanagari}.
- Use the
polyglossia package which provides support for common things typical users like to do when they switch languages: change hyphenation patterns, change fonts and typographical conventions, change date and number formats, etc. What the package currently provides for Sanskrit are some crude hyphenation patterns, awareness that । and ॥ are punctuation characters, along with a bunch of other (undocumented) settings like "frenchspacing": turning off the default longer space between sentences. If we think that this is overall an improvement, we could use this with \usepackage{polyglossia} followed by \setdefaultlanguage{sanskrit}, but it doesn't work in this case.
Nonetheless thanks; I shall peruse that code and see how best to adapt it to my needs.
– Arunagirinathar Oct 14 '14 at 12:02