2

I would like to automatically inserting closing environments In MiKTeX-TeXWorks. And i have found Shortcut for inserting matching \end{something} in VIM. Any other same options are available in Windows?

Balaji
  • 2,282

1 Answers1

6

In Texworks, type \beg and TAB, you will get \begin{. Then type doc as in \begin{doc and again press TAB you will get

\begin{document}



\end{document}

with cursor in between.

Then type, say, \beg and TAB to get \begin{ and type ite (\begin{ite) press TAB to get

\begin{document}

\begin{itemize}
\item

\end{itemize}•

\end{document}

There are many other short cuts that are defined in files like tw-latex.txt. To find these, go to HelpSettings and Resources. You will get this window:

enter image description here

Click on the link and the folder C:\Users\HK\AppData\Local\MiKTeX\2.9\TeXworks\0.4 opens (HK may be different for you). Get inside the completion folder where you will find four files → tw-basix.txt, tw-beamer.txt, tw-context.txt and tw-latex.txt. You need tw-latex.txt where these shortcults can be found.

enter image description here

Foe example, type bsubeq and press TAB and see yourself.


In winedt, type

\begin{document}}   %%<--- extra brace

to get

\begin{document}

\end{document}

or to close the environment that is open, type

\end{{

In winedt, to find short cuts, do something like this:

Go to OptionsOptions Interface, then press Main Menu once. Press the arrow head as shown and you will find shortcuts, click on shortcuts. Now all shortcuts are copied to clip board. Open a new file and paste.

enter image description here

  • Also in TeXworks: bd and then tab twice for document, bi for itemize, bt for tabular, table etc., bf for frame, figure etc., beq for equation. There are a lot more as well. – Torbjørn T. Feb 17 '15 at 08:42
  • The complete list can be found in the completion files, so you can also define your own there. In TeXworks, go to Help --> Settings and Resources to find out where the resources folder is. Within that folder there is a completion subfolder which contains the text files with the completion patterns. See also https://code.google.com/p/texworks/wiki/CodeCompletion – Torbjørn T. Feb 17 '15 at 08:47