%!TeX program = XeLaTex
%!TEX encoding = UTF-8 Unicode
\documentclass[twoside, openright]{book}
\XeTeXlinebreaklocale "my_MM" %Myanmar line and character breaks
\XeTeXinterwordspaceshaping = 2
\usepackage[nospace]{varioref}
\usepackage{graphicx}
\usepackage{varioref}
\usepackage{fontspec}
\usepackage{fancyhdr}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[dvipsnames]{xcolor}
\usepackage{hyperref}
\setmainfont[
% https://tex.stackexchange.com/questions/193412/what-is-happening-to-the-quotes
Ligatures = TeX,
WordSpace = 1,
UprightFont = {Padauk Book},
BoldFont = {Padauk Book Bold},
ItalicFont = {Padauk Book},
BoldItalicFont = {Padauk Book Bold},
SmallCapsFont = {Padauk Book},
SlantedFont = {Padauk Book},
% https://tex.stackexchange.com/questions/498689/how-to-use-locale-numbering-custom-numbering-for-burmese
% Mapping=mmdigit_mapping
]
{Padauk Book}
[Renderer = Graphite, RawFeature = {Tear drop style washwe=True}]
\newcommand{\myPgNoFnt}
{\fontspec[
% the mapping
Mapping = mmdigit_mapping,
Script = Myanmar,
Scale = MatchLowercase,
BoldFont = {Padauk Book Bold}
]
{Padauk Book}
\selectfont}
\newcommand{\myRefCntFnt}
{\fontspec[
Mapping = mmdigit_mapping,
Script = Myanmar,
Scale = MatchLowercase,
BoldFont = {Padauk Book Bold}
]
{Padauk Book}
\selectfont}
\newcommand{\myCptFnt}
{\fontspec[
Mapping = mmdigit_mapping,
Script = Myanmar,
Scale = MatchLowercase,
BoldFont = {Pyidaungsu Bold}
]
{Pyidaungsu}
%[Renderer=Graphite, RawFeature={Tear drop style washwe=True}]
\selectfont}
%\def\reftextfaceafter {on the \reftextvario{facing}{next} page}%
%\def\reftextfacebefore{on the \reftextvario{facing}{preceding} page}%
%\def\reftextafter {on the \reftextvario{following}{next} page}%
%\def\reftextbefore {on the \reftextvario{preceding}{previous} page}%
%\def\reftextcurrent {on \reftextvario{this}{the current} page}%
%\def\reftextfaraway#1{on page~\pageref{#1}}%
\def\reftextfaceafter {\reftextvario{တစ်ဖက်}{နောက်}စာမျက်နှာ~}%
\def\reftextfacebefore{\reftextvario{တစ်ဖက်}{ရှေ့}စာမျက်နှာ~}% အရင် ပြီးခဲ့တဲ့
\def\reftextafter {\reftextvario{လာမဲ့}{နောက်}စာမျက်နှာ~}%
\def\reftextbefore {\reftextvario{ပြီးခဲ့တဲ့}{ရှေ့}စာမျက်နှာ~}%
\def\reftextcurrent {\reftextvario{}{}}%
\def\reftextfaraway#1{စာမျက်နှာ~{\myRefCntFnt\pageref{#1}}~}%
\newcommand{\myvref}[1] {
{\myRefCntFnt{\vpageref[]{#1}}}{\myRefCntFnt{\Ref*{#1}}}
}
\renewcommand{\figurename}{ပုံ}
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\bfseries\myPgNoFnt\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{headings}{%
\fancyhf{} % clear all header and footer fields
\fancyhead[LO,RE]{\bfseries\myPgNoFnt\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\pagestyle{headings}
\renewcommand{\figurename}{ပုံ}
\DeclareCaptionFont{captionfont}{\myCptFnt}
\captionsetup[figure]{
singlelinecheck=false,
justification=raggedright,
font={captionfont, bf, small, onehalfspacing}}
\DeclareCaptionLabelFormat{custom}
{~#1 \textbf{#2}~} %to get "Figure (1)", "Figure [1]", etc
% Separator style
\DeclareCaptionLabelSeparator{custom}{- } % to get "Figure (1):", "Figure(1) - Some caption" etc
% Caption format
\DeclareCaptionFormat{custom}
{#1#2\small #3}
\captionsetup{
format=custom,
labelformat=custom,
labelsep=custom}
\labelformat{figure}{ပုံ~{\myRefCntFnt #1}}
\addtolength{\topmargin}{-3.0pt}
\setlength{\headheight}{15pt}
\begin{document}
\chapter{Chapter 1}
\begin{figure}
\includegraphics{example-image}
\caption{အစမ်းပုံ ၁}
\label{fig:fig1}
\end{figure}
----------------------- \myvref{fig:fig1} -----------------------
\noindent----------------------- \myvref{fig:fig2} -----------------------
\noindent----------------------- \myvref{fig:fig3} -----------------------
\noindent----------------------- \myvref{fig:fig4} -----------------------
\noindent----------------------- \myvref{fig:fig5} -----------------------
\noindent----------------------- \myvref{fig:fig6} -----------------------
\newpage
\begin{figure}
\includegraphics{example-image}
\caption{အစမ်းပုံ ၂}
\label{fig:fig2}
\end{figure}
----------------------- \myvref{fig:fig1} -----------------------
\noindent----------------------- \myvref{fig:fig2} -----------------------
\noindent----------------------- \myvref{fig:fig3} -----------------------
\noindent----------------------- \myvref{fig:fig4} -----------------------
\noindent----------------------- \myvref{fig:fig5} -----------------------
\noindent----------------------- \myvref{fig:fig6} -----------------------
\newpage
\begin{figure}
\includegraphics{example-image}
\caption{အစမ်းပုံ ၃}
\label{fig:fig3}
\end{figure}
----------------------- \myvref{fig:fig1} -----------------------
\noindent----------------------- \myvref{fig:fig2} -----------------------
\noindent----------------------- \myvref{fig:fig3} -----------------------
\noindent----------------------- \myvref{fig:fig4} -----------------------
\noindent----------------------- \myvref{fig:fig5} -----------------------
\noindent----------------------- \myvref{fig:fig6} -----------------------
\newpage
\begin{figure}
\includegraphics{example-image}
\caption{အစမ်းပုံ ၄}
\label{fig:fig4}
\end{figure}
----------------------- \myvref{fig:fig1} -----------------------
\noindent----------------------- \myvref{fig:fig2} -----------------------
\noindent----------------------- \myvref{fig:fig3} -----------------------
\noindent----------------------- \myvref{fig:fig4} -----------------------
\noindent----------------------- \myvref{fig:fig5} -----------------------
\noindent----------------------- \myvref{fig:fig6} -----------------------
\newpage
\begin{figure}
\includegraphics{example-image}
\caption{အစမ်းပုံ ၅}
\label{fig:fig5}
\end{figure}
----------------------- \myvref{fig:fig1} -----------------------
\noindent----------------------- \myvref{fig:fig2} -----------------------
\noindent----------------------- \myvref{fig:fig3} -----------------------
\noindent----------------------- \myvref{fig:fig4} -----------------------
\noindent----------------------- \myvref{fig:fig5} -----------------------
\noindent----------------------- \myvref{fig:fig6} -----------------------
\newpage
\begin{figure}
\includegraphics{example-image}
\caption{အစမ်းပုံ ၆}
\label{fig:fig6}
\end{figure}
----------------------- \myvref{fig:fig1} -----------------------
\noindent----------------------- \myvref{fig:fig2} -----------------------
\noindent----------------------- \myvref{fig:fig3} -----------------------
\noindent----------------------- \myvref{fig:fig4} -----------------------
\noindent----------------------- \myvref{fig:fig5} -----------------------
\noindent----------------------- \myvref{fig:fig6} -----------------------
\end{document}
See the above figure and the LLLLL ၁for the first references andfig. ၂ LLLLL ၂ sdfsdfdf fig. ၁ LLLLL ၁for the second references. When I remove the\reftextredefinitions I getSee the above figure and the on page ၁for the first references. Do you get the same output? If yes, how should it be changed, i.e., what is the exact desired output in these four cases? – Marijn Jun 05 '22 at 08:46texlive-lang-other(and thereforetexlive-full) so anyone that installed TeX Live through the Ubuntu repositories has the font. It is also a dependency of various Ubuntu desktop packages (presumably to provide Myanmar support), so probably also available if you installed TeX Live throughtlmgr. – Marijn Jun 05 '22 at 13:11