Note that there are some explanatory texts on larger screens.

plurals
  1. POemacs + latex + yasnippet: Why are newlines inserted after a snippet?
    primarykey
    data
    text
    <p>Everytime I insert a snippet (with yasnippet) in a .tex document, I obtain a newline after the snippet. This is quite annoying for small snippets that are typically used in text style. How can I avoid that? </p> <p>I read a bit about the problem (http://code.google.com/p/yasnippet/issues/detail?id=115 or <a href="http://yasnippet.googlecode.com/svn/trunk/doc/faq.html" rel="nofollow">http://yasnippet.googlecode.com/svn/trunk/doc/faq.html</a>) but couldn't find a solution. Reproduce it as follows (I work with Aquamacs 2.3a on Mac OS X 10.6.8 with yasnippet version 0.6.1c):</p> <ol> <li><p>Define ~/Library/Preferences/Aquamacs Emacs/Preferences.el to be: (require 'yasnippet) (yas/initialize) (yas/load-directory "~/Library/Preferences/Aquamacs Emacs/plugins/yasnippet-0.6.1c/snippets")</p></li> <li><p>define the following snippet (call it "bm.yasnippet" [bm = boldmath]; the star * symbolizes where the cursor ends -- note that there is no newline after the snippet)</p> <pre><code># name: \bm{}{} # key: bm # -- \bm{$1}* </code></pre></li> <li><p>restart Aquamacs and open a .tex file and type in bm + <kbd>Tab</kbd> [this should insert the snippet]</p></li> <li><p>A newline is added after the snippet. This is quite inconvenient since <code>\bm{foo}</code> is typically used in text style, so for example in "The vector <code>\bm{x}</code> is not the null vector". A typical cause of this is that the snippet ends with a newline which is then inserted, too. However, I specifically obtain this behavior even the snippet does <em>not</em> end with a newline.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload