1

How do I set automatic folding of packages outside of document and new commands inside of documents?

If I use {{{ }}} marker around newcommand it ignores the command and says undefined control sequence.

Similar thing happens if I use it around \usepackage.

I am using vim, basicTex, mac, rubber.

Example:

{{{
\newcommand{\ime}[3]{
    \newpage
    {\Large \textbf{#1}}
    \addcontentsline{toc}{section}{#1} \hfill 
    \lhead{Čas priprave: #2}
    \rhead{Količina: #3}
    }
}}}

This ignores my new command.

  • 3
    I don't know about automatic folding, but you should comment your fold markers : %{{{ and %}}}, otherwise they will be read by TeX. – marsupilam Apr 25 '17 at 6:59
  • 1
    Also, you can put your opening fold marker at the end of the \newcommand line, so as to have a title to your fold. (that is \newcommand{\ime}[3]{%{{{) – marsupilam Apr 25 '17 at 7:02
  • Commenting the fold marker works and it solved the problem. How do I mark thread as solved? – user3366345 Apr 25 '17 at 7:10
  • I'll answer if that's enough for you. – marsupilam Apr 25 '17 at 7:12
  • vi.sx exists. – Martin Schröder Apr 25 '17 at 19:18
6

I don't know about automatic folding, but you should comment your fold markers : %{{{ and %}}}, otherwise they will be read by TeX.

Also, you can put your opening fold marker at the end of the \newcommand line, so as to have a title to your fold.

enter image description here

Your code would then look like :

\newcommand{\ime}[3]{%{{{
    \newpage
    {\Large \textbf{#1}}
    \addcontentsline{toc}{section}{#1} \hfill 
    \lhead{Čas priprave: #2}
    \rhead{Količina: #3}
    }
%}}}

Cheers,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.