Re: [AUCTeX-devel] Extending `LaTeX-array-count-columns'

2016-12-15 Thread Mosè Giordano
Hi Arash,

2016-12-14 15:52 GMT+01:00 Arash Esbati :
> Hi Mosè,
>
> Mosè Giordano  writes:
> Thanks for testing!  I can take the file I posted with some other
> environments and add it as `tabular-ampersand-count.tex' under
> auctex.git/tests/latex.  Is this what you have in mind?

Yes.  But if you prefer, you may want to create a new file for testing
these tabular-related features,

> I can't see how
> to insert the test into `latex-test.el'.  Any hints?

For example in the file you sent at the beginning of the thread

(LaTeX-array-count-columns 1920 1928)

returns currently 0, but 4 after evaluating your new definition of the
function.  In the test file you can add a test like this one.

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] Extending `LaTeX-array-count-columns'

2016-12-15 Thread Ikumi Keita
Hi Arash,

> Thanks for your response.  This syntax is actually standard LaTeX, e.g.:

> \documentclass{article}

> \begin{document}
> \_
> \begin{tabular}[t]{@{}*{2}{l}r}
>   1 & 2 & some longish text \\
>   1 & 2 & some text \\ \hline
> \end{tabular}
> \_
> \end{document}

Oh, sorry.  You are right.  I should have tested more carefully.

> The lack of support for this was the main motivation for me to extend
> `LaTeX-array-count-columns'.

That seems to me an enough reason to do so.

> I think we are not closing that door.  If someone wants to write a style
> for tabu.sty, he/she can (and probably should) go the route you're
> suggesting.

> In general, I also think that `latex.el' should support vanilla LaTeX,
> but since the overhead for `\begin{tabular}{X[foo = bar]}' support is
> quite low, I think we can leave it in `LaTeX-array-count-columns'.

I see.  That's fine with me.

> I should also mention that one could write

> \documentclass{article}

> \begin{document}
> \_
> \begin{tabular}[t]{@{}*2lr}
>   1 & 2 & some longish text \\
>   1 & 2 & some text \\ \hline
> \end{tabular}
> \_
> \end{document}

> Note the missing braces around 2 and l.  While LaTeX compiles this
> happily, my code chokes due to missing braces.  But I consider this a
> feature :-)

> WDYT?

Hmm, this style is confusing.  I think good LaTeX users should avoid
omitting braces like this example, so I agree that this should be
regarded as feature.

Bye,
Ikumi Keita

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel