GNU bug report logs -
#71436
preview in LuaTeX with RTL as main language does not work
Previous Next
Full log
View this message in rfc822 format
Udicoudco <udifoglle <at> gmail.com> writes:
> Oh, there was another typo. I did not test that the documentation
> is typesetting properly, and there was a "\begn{macro}" instead
> of `\begin{macro}`. I also updated the checksum of preview.dtx.
> Tested now with the various engines and things seems to be working
> (but please test thoroughly :)
Thanks for the patch. I have some minor comments (and I'm not good at
writing TeX-code):
> From 0fe4d61af2d9494539e79ffd354623df9efde3e1 Mon Sep 17 00:00:00 2001
> From: Udi Fogiel <udifoglle <at> gmail.com>
> Date: Tue, 11 Jun 2024 11:33:35 +0300
> Subject: [PATCH] consider pagerightoffset in luatex with rtl languages
^ Consider
> This patch will calculate \pagerightoffset when LuaTeX is used
> and the page direction is right to left. It is important as in
^ 2 spaces please
> this case LuaTeX will use this register, and not \hoffset to
> position the page.
> ---
> latex/preview.dtx | 19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/latex/preview.dtx b/latex/preview.dtx
> index 23f5b2da..483e6f82 100644
> --- a/latex/preview.dtx
> +++ b/latex/preview.dtx
> @@ -20,7 +20,7 @@
> % Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
> % Boston, MA 02110-1301 USA
> % \fi
> -% \CheckSum{1758}
> +% \CheckSum{1779}
> % \GetFileInfo{preview.sty}
> % \date{\filedate}
> % \author{David Kastrup\thanks{\texttt{bug-auctex <at> gnu.org}}}
> @@ -752,6 +752,7 @@
> \ifx\pr <at> offset <at> override\@undefined
> \voffset=-\ht\pr <at> box
> \hoffset=\z@
> + \pr <at> set <at> pagerightoffset
> \fi
> \c <at> page=\pr <at> snippet
> \pr <at> shipout
> @@ -769,6 +770,22 @@
> % \end{macrocode}
> % \end{macro}
> % \end{macro}
> +% \begin{macro}{\pr <at> set <at> pagerightoffset}
> +% In |luatex| when page direction is right to left, |\pagerightoffset|
> +% is used instead of |\hoffset|, so we need to calculate that as well.
> +% \begin{macrocode}
> +\let\pr <at> set <at> pagerightoffset\@empty
Why not defining the macro properly instead of \let-ing?
\newcommand*\pr <at> set <at> pagerightoffset{}
> +\ifx\pagerightoffset\@undefined\else
> + \def\pr <at> set <at> pagerightoffset{%
> + \ifnum\pagedirection=1
I don't think this relevant here, but
\ifnum\pagedirection=1 %
is the safe version?
> + \pagerightoffset=-1in
> + \advance\pagerightoffset-\pr <at> bb <at> i
> + \advance\pagerightoffset\pr <at> bb <at> iii
> + \fi
> + }
> +\fi
> +% \end{macrocode}
> +% \end{macro}
Best, Arash
This bug report was last modified 120 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.