Patches item #3189887, was opened at 2011-02-23 03:12 Message generated for change (Comment added) made by tpavlic You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=466458&aid=3189887&group_id=52322
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: More customizations of envmacros Initial Comment: With this patch, envmacros.vim allows more customizations. 1. let g:Tex_EnvLabelprefix_equation = "eq:" => labels in equations have the prefix eq: this works for: figure,table,theorem,definition,lemma,proposition,corollary,assumption,remark,equation,eqnarray,align,multline 2. let g:Tex_EnvEndWithCR = 0 => completed environments end with: \end{env-type} <++> instead of \end{env-type}<++> This saves one CR ;) 3. let g:Tex_LabelAfterContent = 0 => Put the label before the content of an environment, e.g. \begin{equation} \label{eq:<++>} <++> \end{equation} <++> ---------------------------------------------------------------------- Comment By: Ted Pavlic (tpavlic) Date: 2011-10-03 16:03 Message: \autoref is only going to fail if you put the \label for the theorem after the equation. I'm not sure why you'd ever do that. Again, the argument was that \labels tend to follow where where the tag conventionally shows up in the rendered document. Thus, a theorem label shows up at the top of the environment, and an equation label shows up at the end of the equation environment. That rule works even if you're not cognizant about how refstepcounter works. Things get more complicated for floats, like figure, where the juxtaposition of labels and captions can have a different impact on where things are anchored. The main point is that there is no general "environment layout" that holds for absolutely all environments -- especially when you expand beyond simple equation environments (IMO). Regardless, something like: \begin{equation} <++>\label{<++>}<++> \end{equation}<++> covers all use cases. I didn't notice until now that you're forcing "eq:" on inserted equation environments. I don't think that's a good idea. Although it may be conventional for people to prefix equation labels with "eq:", it is certainly not necessary. Again, going back to refstepcounter, \autoref doesn't use the prefix to determine label type (although cleveref might -- I think early versions of cleveref did). So it is a matter of style. ---------------------------------------------------------------------- Comment By: Gerd Wachsmuth (gerw) Date: 2011-10-03 15:35 Message: I can't add a file here. Here is a minimal (non)-working example: \documentclass{amsart} \usepackage{hyperref} \newtheorem{theorem}{Theorem} % Just some offset to distinguish the numbers of the theorems and of the equations: \setcounter{theorem}{10} \begin{document} \section{This works} \begin{theorem} \label{thm:bla} \begin{equation} \label{eq:blub} 1+2 \end{equation} Some theorem. \end{theorem} \autoref{thm:bla} contains \autoref{eq:blub}. \section{This does not work} \begin{theorem} \begin{equation} 1+2 \label{eq:blub2} \end{equation} Some theorem. \label{thm:bla2} \end{theorem} \autoref{thm:bla2} contains \autoref{eq:blub2}. \end{document} ---------------------------------------------------------------------- Comment By: Gerd Wachsmuth (gerw) Date: 2011-10-03 15:30 Message: ad #2: That's purely a matter of taste. Even in mathematical environments I like to have a "cases" or "pmatrix" spanned over several lines. In my PhD thesis, I have 1120 "\end{something}", but only 7 are not followed by a CR. ad #3: If you put the label at the end of an environment, there are two possible pitfalls: - the autoref feature of hyperref won't work properly (see attached file) - the spacing around a subequation environment is not correct. Concerning your approach: Is there any reason for the placeholder after the label? ---------------------------------------------------------------------- Comment By: Ted Pavlic (tpavlic) Date: 2011-10-03 10:44 Message: I can see how some people might like #1. However, I think #2 and #3 are bad ideas. In the case of #2, I see little reason why you'd expect every \end{environment} to be followed by a carriage return. Especially in mathematical environments (e.g., cases or matrices), there may be some stylistic conventions that continue content on the same line as the \end. In the case of #3, more complex equation environments (like eqnarray or align or multiline or gather or...), \label will often follow the content and show up in the same place as the resulting label (similar with \notag). I see no reason why to introduce an asymmetry for equation. Perhaps a better approach would be: \begin{equation} <++> \label{eq:<++>}<++> \end{equation}<++> to allow for all use cases. ---------------------------------------------------------------------- Comment By: Gerd Wachsmuth (gerw) Date: 2011-10-02 13:00 Message: This patch is by me. I forgot to log in. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=466458&aid=3189887&group_id=52322 ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ Vim-latex-devel mailing list Vim-latex-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vim-latex-devel