Re: [XeTeX] Problem with bidi + longtable + caption packages

2015-10-21 Thread maxwell

On 2015-10-21 08:28, David Carlisle wrote:

The following simply preserves the longtable/caption package version
of \caption when bidi is loaded


Thanks, I confirm that this works!


(so it doesn't get patched to right
to left usage, so you may need to add \beginR \endR explicitly in a
right to left caption, patching automatically might be tricky as you
have to cope with caption, ltcaption, longtable and bidi being loaded
or not, in different package loading orders.


Fortunately for us, we don't use R-to-L in full captions (there may be 
occasional R-to-L words embedded in the L-to-R text of the caption, but 
they seem to work ok).


   Mike Maxwell


--
Subscriptions, Archive, and List information, etc.:
 http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Problem with bidi + longtable + caption packages

2015-10-21 Thread Herbert Schulz
> On Oct 21, 2015, at 1:45 AM, David Carlisle  wrote:
> 
> On 21 October 2015 at 02:34, Herbert Schulz  wrote:
>>> On Oct 20, 2015, at 7:55 PM, maxwell  wrote:
>>> 
> 
>> The longtable environment is like a tabular environment, not the same as a 
>> floating environment like the teble environment. It's floats that take the 
>> caption. Try
>> 
> 
> No! longtable has a caption command and can not be inside a float box
> (otherwise it will not break over a page).
> 
> David

Howdy,

Ooops... sorry for the noise. I guess I've never used it with a caption.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)









--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Problem with bidi + longtable + caption packages

2015-10-21 Thread David Carlisle
The caption wasn't really centred (hard to tell as the text was short)
it is a justified paragraph (set in a centred box) the problem is that
bidi doesn't "patch" the caption code to add \beginR it redefines the
standard one, so over-writing the caption package changes.


The following simply preserves the longtable/caption package version
of \caption when bidi is loaded  (so it doesn't get patched to right
to left usage, so you may need to add \beginR \endR explicitly in a
right to left caption, patching automatically might be tricky as you
have to cope with caption, ltcaption, longtable and bidi being loaded
or not, in different package loading orders.

\documentclass{report}

\usepackage{longtable}
%Tell the caption pkg to do ragged right at load time:
\usepackage[singlelinecheck=off
   ,justification=raggedright
   ]{caption}
\usepackage{ltcaption}
\LTcapwidth=\linewidth
\makeatletter
\let\temp\LT@makecaption
\usepackage{bidi}
\let\LT@makecaption\temp
%Tell the caption pkg again:
\captionsetup{singlelinecheck=off
 ,justification=raggedright
 }

\begin{document}

\begin{table}
\caption{A normal table
     
     
     
     
}
\end{table}

\begin{longtable}{}
\caption{A long table
     
     
     
     
}%Should be ragged right, but is centered instead
\tabularnewline
 {} & {} & {} & {}
\tabularnewline
\end{longtable}

\end{document}


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Problem with bidi + longtable + caption packages

2015-10-20 Thread David Carlisle
On 21 October 2015 at 01:55, maxwell  wrote:
> (Apologies if this isn't the right mailing list--the documentation I have
> says I should send this to persian-...@tug.org, but I don't see that mailing
> list on the list of TUG mailing lists, nor am I subscribed to it... and if
> it does exist, I don't know how to subscribe to it.)

I believe that's a personal mailbox of the bidi maintainer not a list.

bidi and longtable is tricky in xetex as the tex-xet bidi model it uses
doesn't really support right to left \halign as \beginR has to be in
horizontal mode.
Vafa patches longtable as well as he can but the underlying support
isn't really there,
this is one place where the directional model in luatex (from omega)
is clearly superior.

I'll try to look later but it's a delicate area...

David

>
> I've encountered a problem in the interaction between the longtable, bidi,
> and caption packages.  I'll attach the minimal example at the bottom of this
> msg, but I have a question.  We're running the 2014 TeXLive distro; I never
> got around to downloading the 2015 distro.  We'll probably do that, but
> we're having some connectivity issues (serves me right for not having
> downloaded it months ago), and there are some hoops to jump through, so it
> won't be instant gratification.
>
> The issue we've found is that we want table captions to be ragged right,
> rather than centered.  Ordinarily, the caption package handles this fine.
> But when I have a longtable, and I use the bidi package as well, I can only
> get centered captions for long tables (ordinary floating table captions work
> fine).
>
> I've tried numerous variants of the code below, e.g. telling the caption pkg
> to do ragged right only in one or the other of the places, loading the bidi
> bpackage before or after the \captionsetup command (it cannot be loaded
> before the caption pkg is loaded), etc.
>
> Did anyone else notice this last year, and if so, has it been fixed in the
> 2015 distro?
>
> Mike Maxwell
> University of Maryland
>
> ---Minimal example follows-
> \documentclass{report}
>
> \usepackage{longtable}
> %Tell the caption pkg to do ragged right at load time:
> \usepackage[singlelinecheck=off
>,justification=raggedright
>]{caption}
> \usepackage{bidi}
> %Tell the caption pkg again:
> \captionsetup{singlelinecheck=off
>  ,justification=raggedright
>  }
>
> \begin{document}
>
> \begin{longtable}{}
> \caption{A long table}%Should be ragged right, but is centered instead
> \tabularnewline
>  {} & {} & {} & {}
> \tabularnewline
> \end{longtable}
>
> \end{document}
>
>
> --
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex



-- 
http://dpcarlisle.blogspot.com/


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Problem with bidi + longtable + caption packages

2015-10-20 Thread David Carlisle
On 21 October 2015 at 02:34, Herbert Schulz  wrote:
>> On Oct 20, 2015, at 7:55 PM, maxwell  wrote:
>>

> The longtable environment is like a tabular environment, not the same as a 
> floating environment like the teble environment. It's floats that take the 
> caption. Try
>

No! longtable has a caption command and can not be inside a float box
(otherwise it will not break over a page).

David


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Problem with bidi + longtable + caption packages

2015-10-20 Thread maxwell

On 10/20/2015 9:34 PM, Herbert Schulz wrote:

On Oct 20, 2015, at 7:55 PM, maxwell 
wrote:
I've encountered a problem in the interaction between the
longtable, bidi, and caption packages.

>> ...

The longtable environment is like a tabular environment, not the same
as a floating environment like the table environment. It's floats
that take the caption.


Actually, the longtable package supports captions too, and the caption 
package (which allows further customization, 
http://www.ctan.org/pkg/caption) explicitly supports longtable:

-
Package support
The caption package was adapted to the following packages which deals 
with captions, too:
float, floatflt, fltpage, hyperref, hypcap, listings, longtable, 
picinpar, picins, rotating, setspace, sidecap, subfigure, supertabular, 
threeparttable, wrapfig, and xtab

-
99% of our tables use ordinary tables, but 1% of our tables won't fit on 
a single page and require longtable.  These need captions the same way 
regular tables do (there's also a continuation caption on the second and 
following pages of longtables).  I didn't show a bunch of rows in my 
example to keep it minimal; the actual table where we first noticed the 
problem was just over a page in length.


   Mike Maxwell


--
Subscriptions, Archive, and List information, etc.:
 http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] Problem with bidi + longtable + caption packages

2015-10-20 Thread Herbert Schulz
> On Oct 20, 2015, at 7:55 PM, maxwell  wrote:
> 
> (Apologies if this isn't the right mailing list--the documentation I have 
> says I should send this to persian-...@tug.org, but I don't see that mailing 
> list on the list of TUG mailing lists, nor am I subscribed to it... and if it 
> does exist, I don't know how to subscribe to it.)
> 
> I've encountered a problem in the interaction between the longtable, bidi, 
> and caption packages.  I'll attach the minimal example at the bottom of this 
> msg, but I have a question.  We're running the 2014 TeXLive distro; I never 
> got around to downloading the 2015 distro.  We'll probably do that, but we're 
> having some connectivity issues (serves me right for not having downloaded it 
> months ago), and there are some hoops to jump through, so it won't be instant 
> gratification.
> 
> The issue we've found is that we want table captions to be ragged right, 
> rather than centered.  Ordinarily, the caption package handles this fine.  
> But when I have a longtable, and I use the bidi package as well, I can only 
> get centered captions for long tables (ordinary floating table captions work 
> fine).
> 
> I've tried numerous variants of the code below, e.g. telling the caption pkg 
> to do ragged right only in one or the other of the places, loading the bidi 
> bpackage before or after the \captionsetup command (it cannot be loaded 
> before the caption pkg is loaded), etc.
> 
> Did anyone else notice this last year, and if so, has it been fixed in the 
> 2015 distro?
> 
>Mike Maxwell
>University of Maryland

Howdy,

The longtable environment is like a tabular environment, not the same as a 
floating environment like the teble environment. It's floats that take the 
caption. Try

\documentclass{report}

\usepackage{longtable}
%Tell the caption pkg to do ragged right at load time:
\usepackage[singlelinecheck=off
  ,justification=raggedright
  ]{caption}
\usepackage{bidi}
%Tell the caption pkg again:
%\captionsetup{singlelinecheck=off
%,justification=raggedright
%}

\begin{document}

Some test!

\begin{table}
\caption{A long table}%Should be ragged right, but is centered instead
\begin{longtable}{}
\tabularnewline
{} & {} & {} & {}
\tabularnewline
\end{longtable}
\end{table}

\end{document}

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)









--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex