I just finished laying out my first floating figure with subfloats (in a 2x2 matrix). But to get it to work the way I want, I had to use ERT, and I'm wondering if this is really necessary. If it is necessary, then consider this a feature request for LyX to do this automatically.

First, some background. I'm using the Memoir class, which has its own methods for handling floats and captions (see Ch. 10 of the Memoir Manual <http://texdoc.net/texmf-dist/doc/latex/memoir/memman.pdf>). But they stopped working as soon as I started using subfloats in LyX. After about a day (!) of detective work, I learned that LyX automatically invokes the subfig <https://www.ctan.org/pkg/subfig?lang=en> package, which in turn automatically invokes the caption <https://www.ctan.org/pkg/caption> package. Since the latter conflicts with Memoir's methods, Memoir is smart enough to turn off its own methods if the caption package is loaded. But LyX doesn't warn you about this, much less do something about it, and I did not see documentation of this conflict anywhere. At the very least, I'd like to see this documented. Even better, if the Memoir class is being used, provide some option to allow the user to choose between Memoir's native captioning and that of the caption package.

Possibly a similar conflict exists between subfig and the newer (and to my mind easier-to-use) subcaption <https://www.ctan.org/pkg/subcaption> package. Again, I'd like to see better documentation and options for handling this explicitly, rather than letting users first fail to compile their documents as expected, due to conflicts between their method of choice and LyX's hidden side-effects, and then have to track down the problem and fix it (which in my case eventually meant having no choice but to use subfig and caption). (BTW, why doesn't LyX use the more recent subcaption package instead of subfig?)

In any case, here's how I want my figure to look. Each subfigure panel is labeled with a letter in parentheses, both boldface. (E.g., "*(a)*".) The main figure itself is labeled the usual way, except "Figure," the number, and the separator are bold-faced (e.g., "*Figure 1:* "). Then, immediately following this, there's a short cation to be used in the list of figures. The identical text then appears boldfaced at the start of the long caption, ending with a period. This is the visible figure title. Immediately after this comes the rest of a long, paragraph-like caption discussing the four panels in relation to each other. This long caption makes repeated reference to the subfigure captions, and each reference is set in the same font as the caption itself (in this case boldface).

I was able to do most of this by using the caption/subfig commands \DeclareSubrefFormat and \captionsetup in the preamble. But the repeated short caption (figure title) had to be copied, pasted, period added, and boldfaced. And the references in the long caption needed to be done with ERT, such as"\textbf{\protect\subref{subfig:MVpct}}" where subfig:MVpct is the label used for a panel's subfigure caption. Nothing I tried with LyX would make this work as desired, so I resorted to ERT.

So here are some questions:

1. Is there is a way to insert such cross-references in LyX without ERT?
2. If not, then is a feature like this in the works for enhancing LyX?
   (It should be.)
3. Also, since this particular format is common, is there a way to
   automate replication of the short caption as a figure title at the
   start of the long caption? (If not, this should also be a feature
   request. -- computers are good for automating mindless stuff like this).

Still, after the steep learning curve, the current solution is not horrible. In fact, it works quite well, which is testimony to how powerful LyX is. But there's always room for improvement (in both software and user).

Reply via email to