Thread: [Vim-latex-devel] Problems with templates
Brought to you by:
srinathava,
tmaas
From: David W. <da...@da...> - 2012-12-26 01:05:56
|
I'm having a problem that when I choose a template it ends up with several lines at the top snipped off and the spacing/indentation is messed up too. Any help be great, thanks |
From: Ruthard B. <rut...@we...> - 2012-12-28 13:15:53
|
>== Auszüge aus der Nachricht von David Woodfall vom 2012-12-26 01:59: > I'm having a problem that when I choose a template it ends up with > several lines at the top snipped off and the spacing/indentation is > messed up too. I've had the same observation with my templates. If you analyze the generic templates - they all start with some lines producing a file header, and the first line -- only the first one -- is stripped. I think this line is for a comment on the template file that is not part of the file. Thus, my custom templates start with % as first line. The latter is a problem of vim when you do pasting with automatic indentation turned on (as is default with most filetype plugins) -- the indentations of the pasted text and the autoindent induced indentations sum up, messing the format. see :help paste for detail, use :set paste before pasting text and :set nopaste to return to normal behaviour. regards Ruthard |
From: Alessandro P. <ale...@la...> - 2012-12-28 14:08:43
|
2012/12/28 Ruthard Baudach <rut...@we...>: > use > :set paste > before pasting text > and > :set nopaste > to return to normal behaviour. You could also paste text from the system 'clipboard' using the '*' buffer (in command mode): "*p For more information see the vim help pages on *registers* [1] and *x11-selection* [2]. Alessandro [1] http://vimdoc.sourceforge.net/htmldoc/change.html#registers [2] http://vimdoc.sourceforge.net/htmldoc/gui_x11.html#x11-selection |
From: David W. <da...@da...> - 2012-12-28 19:55:49
|
On (13:35 28/12/12), Ruthard Baudach <rut...@we...> put forth the proposition: >>== Auszüge aus der Nachricht von David Woodfall vom 2012-12-26 01:59: >> I'm having a problem that when I choose a template it ends up with >> several lines at the top snipped off and the spacing/indentation is >> messed up too. >I've had the same observation with my templates. If you analyze the generic templates - >they all start with some lines producing a file header, and the first >line -- only the first one -- is stripped. I think this line is for a >comment on the template file that is not part of the file. Thus, my >custom templates start with > >% > >as first line. > >The latter is a problem of vim when you do pasting with automatic >indentation turned on (as is default with most filetype plugins) -- the >indentations of the pasted text and the autoindent induced indentations >sum up, messing the format. > >see > :help paste >for detail, >use > :set paste >before pasting text >and > :set nopaste >to return to normal behaviour. Strangely, the problem has gone. I had tried :set paste and turning off autoindent, but it didn't seem to make any difference. Obviously something I did fixed it, but I don't know what... |
From: David W. <da...@da...> - 2012-12-29 00:01:41
|
On (19:36 28/12/12), David Woodfall <da...@da...> put forth the proposition: >On (13:35 28/12/12), Ruthard Baudach <rut...@we...> put forth the proposition: >>>== Auszüge aus der Nachricht von David Woodfall vom 2012-12-26 01:59: >>> I'm having a problem that when I choose a template it ends up with >>> several lines at the top snipped off and the spacing/indentation is >>> messed up too. >>I've had the same observation with my templates. If you analyze the generic templates - >>they all start with some lines producing a file header, and the first >>line -- only the first one -- is stripped. I think this line is for a >>comment on the template file that is not part of the file. Thus, my >>custom templates start with >> >>% >> >>as first line. >> >>The latter is a problem of vim when you do pasting with automatic >>indentation turned on (as is default with most filetype plugins) -- the >>indentations of the pasted text and the autoindent induced indentations >>sum up, messing the format. >> >>see >> :help paste >>for detail, >>use >> :set paste >>before pasting text >>and >> :set nopaste >>to return to normal behaviour. > >Strangely, the problem has gone. I had tried :set paste and turning >off autoindent, but it didn't seem to make any difference. Obviously >something I did fixed it, but I don't know what... I spoke too soon I think. Something strange is going on here. Compare my koma-letter template original to what gets pasted into vim: Original: 7 \usepackage[strict=true, style=british]{csquotes} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands. 10 \newif\ifletterclosed 11 \AtEndDocument{\ifletterclosed\else\end{letter}\fi} 12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. 13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 %% Here you can modify the layout of your letter 15 %% Have a look at the KOMA script documentation 16 %% for details. Most commands are commented out 17 %% here (i.e. we use default settings) 18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 19 %% Load an *.lco style file (see KOMA documentation) 20 \LoadLetterOption{DIN}% The result: 7 \usepackage[strict=true, style=british]{csquotes} 8 0 9 %% Here you can modify the layout of your letter 10 %% Have a look at the KOMA script documentation 11 %% for details. Most commands are commented out 12 %% here (i.e. we use default settings) 13 0 14 %% Load an *.lco style file (see KOMA documentation) 15 \LoadLetterOption{DIN}% It seems to have deleted some lines and replaced some with '0'. |
From: Alessandro P. <ale...@la...> - 2012-12-29 09:23:50
|
2012/12/29 David Woodfall <da...@da...>: > Original: > > 7 \usepackage[strict=true, style=british]{csquotes} > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands. > 10 \newif\ifletterclosed > 11 \AtEndDocument{\ifletterclosed\else\end{letter}\fi} > 12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. > 13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% > 14 %% Here you can modify the layout of your letter > 15 %% Have a look at the KOMA script documentation > 16 %% for details. Most commands are commented out > 17 %% here (i.e. we use default settings) > 18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% > 19 %% Load an *.lco style file (see KOMA documentation) > 20 \LoadLetterOption{DIN}% > > The result: > > 7 \usepackage[strict=true, style=british]{csquotes} > 8 0 > 9 %% Here you can modify the layout of your letter > 10 %% Have a look at the KOMA script documentation > 11 %% for details. Most commands are commented out > 12 %% here (i.e. we use default settings) > 13 0 > 14 %% Load an *.lco style file (see KOMA documentation) > 15 \LoadLetterOption{DIN}% > > It seems to have deleted some lines and replaced some with '0'. Please, try deleting some comment signs, e.g. using something like: \usepackage[strict=true, style=british]{csquotes} %% Textclass specific LaTeX commands. \newif\ifletterclosed \AtEndDocument{\ifletterclosed\else\end{letter}\fi} %% User specified LaTeX commands. %%% % Here you can modify the layout of your letter % Have a look at the KOMA script documentation % for details. Most commands are commented out % here (i.e. we use default settings) %%% % Load an *.lco style file (see KOMA documentation) \LoadLetterOption{DIN}% This since the missing lines are mostly those with most '%' in them. This is not really a solution, but it can help pinpoint the issue. Alessandro |