From: Stefan R. <lis...@st...> - 2007-04-21 06:36:08
|
on 21.04.2007 03:23 David Goodger said the following: > On 4/20/07, Stefan Rank <lis...@st...> wrote: >> The use case is NOT to remove the space in the output, as you can do >> this:: >> >> [like]_\ [this]_ > > But you already *can* do that, and it produces exactly the same > result in the document tree. No, see below. >> It allows for writers that recognise the group and produce grouped >> output. >> The latex2e writer in the branch produces \cite{these,two} instead >> of \cite{these}\cite{two}. > > That is an independent issue for the LaTeX writer, and needs no change > to reST syntax. Your changes to docutils/writers/latex2e/__init__.py > look fine to me (but I'm not a LaTeX user, nor a maintainer of that > writer, so I don't decide). > > What does TeX do differently in \cite{these,two} and > \cite{these}\cite{two} anyhow? Output is [x,y] rather than [x][y] and citation packages can do sophisticated things like [1-4,7,10-14] or sorting by name, by order in the text... >> You can force directly adjacent citations that are not grouped by >> using the escaped space as shown above. > > No, there is no difference in the document tree, and no way for the > writer to differentiate. Try it on your branch. I did try exactly that when I started on this. And yes, there is a difference, and the writer has to differentiate: The escaped space stays in the document tree as an empty Text node, so the writer, instead of checking that the next sibling is also a citation it would have to check for (potentially a series) of Text nodes with (rawsource=='\\ '). cheers, stefan |