« first day (1454 days earlier)   

7:40 AM
 
8:11 AM
@PauloCereda You've been serial.
 
Hi egreg!
Hello David
 
@nagylzs Hi!
 
I'm trying to get some help on longtable internals. Can you please help?
I have read longtable.dtx and still looking for an answer.
I'm not an expert...
There are values stored in the aux file for tables, with names \LT@i \LT@ii etc.
Is there a way to get the name of the current longtable from inside a longtable?
I went through the documented internals, but I cannot find this.
 
@nagylzs AS @DavidCarlisle :-)
@nagylzs The 'name'?
 
Well not the name of the table, but the entry that stores column widths in the aux file
 
8:16 AM
@nagylzs Add that you need this for typesetting cricket scoresheets, so @DavidCarlisle will run for an answer.
 
:-)
I need this because I want to make it easier to create flexible multi columns.
 
@nagylzs you should ignore people in this chat room, they are all very rude
 
No problem.
 
@nagylzs I answered your question in a comment on the answer (I hope)
 
\csname LT@\romannumeral\c@LT@tables\endcsname
I see
Great!
I hope I'll be able to use that to generalize that macro :-)
Thank you! I'll be playing with it and get back if you don't mind.
I'm really interested in this, but feel I don't know enough.
 
8:20 AM
note that if you are doing this before starting the table you will need 1 more than \c@LT@tables as incrementing the counter is first thing it does
@nagylzs heiko had an answer on site not so long ago for the simpler case of adding up all the widths (to set the caption) but he wrapped it in a more usable macro I'll see if I can find it
 
Thank you
 
@egreg: I was spotted?
 
@nagylzs wasn't here but google \LT@entry found it:-) ^^^^
 
En route to SP. :)
Apparently I have an smartphony. :)
 
8:27 AM
@DavidCarlisle \LTgetwidth, I see.
@DavidCarlisle So it will be \csname LT@\romannumeral\numexpr\value{LT@tables}+1\relax \endcsname
 
@David: It is your turn to be serial upvoted. :)
 
@PauloCereda that should always be the case
 
@ChristianHupfer Don't forget to add yourself to the list :-)
 
Seem to be empty

\begin{longtabu} to \linewidth {X}
ENTRY= \csname LT@\romannumeral\numexpr\value{LT@tables}+1\relax \endcsname \\
\end{longtabu}

What am I doing wrong
 
@DavidCarlisle Seems it's my fault that @egreg stole this tick from you.
 
8:35 AM
@MickG Clearly you accepted the wrong one!! — David Carlisle 19 secs ago
 
@DavidCarlisle I wonder what he will think of that :-)
 
@DavidCarlisle Oh I see. By adding csname I get the value, without csname its value is the name. Sorry.
 
@nagylzs you need to check for it being undefined and do something else the first time (see my answer)
 
@DavidCarlisle Great! I'm making progress. I have figured out that I need to use \ifcsname to test if the corresponding \LT@ is defined. :-)
 
8:55 AM
@DavidCarlisle If the name is not defined then mspec is defined as \def\mcspec#1{}, but shouldn't it be \def\mcspec#1{\multicolumn{3}{l}{}} ? Or that does not matter, because I'll have to run latex again anyway.
 
9:27 AM
@nagylzs oops I was changing it at times multicolumn would be better as otherwise the other cells in that row will get set in the wrong columns (so mess up teh column width measuring) I should probably fix that answer:-)
@nagylzs \ifcsname is the "modern" (1990's:-) e-tex way I used the classic TeX \expandafter\ifx\csname test but it comes to the same thing
 

« first day (1454 days earlier)