0

I use LaTeX and TexStudio.

I work with transripts and have so far found \longtable to be my best friend, e.g.:

\begin{longtable}[H]{p{1.7cm}p{11.5cm}}
    Ignoramus  &  Richard, what are your favourite animals? \\
    Richard    &  Gnus, penguins and deers, of course! \\
    \caption*{(Animal talk)} 
\end{longtable}

I have to make (yet another) dozens of such dialogues. Soe of them are quite long - that's one reason to use longtable.

I have tried to figure out how I can make a macro or something to let me insert a template like:

\begin{longtable}[H]{p{1.7cm}p{11.5cm}}
       &   \\
    \caption*{()} 
\end{longtable}

but to no avail.

It seems that in

It seems that kileuser have this option: Kile: How can I insert repeated code snippet and make keyboard shortcut in kile for LaTeX?

What is the simple solution for a TexStudio user?

Chris H
  • 8,705
jbahn
  • 443
  • 2
    There is quite likely to be a better environment for this, or you can define your own. There are also packages for typesetting dialogue (for example dialogue). – Chris H Aug 25 '17 at 15:51
  • 2
    Unrelated: note that [H] doesn't do anything at all. A longtable doesn't float, the optional argument can be l, c or r for determining horizontal alignment. – Torbjørn T. Aug 25 '17 at 15:55
  • 1
    Regarding TeXstudio, have you seen Macros --> Edit Macros? – Torbjørn T. Aug 25 '17 at 15:59
  • Thanks. I will check out the dialogue package. Still it doesn't solve my problem about repeatedly used snippets. – jbahn Aug 25 '17 at 19:43
  • If I understand this correctly: https://en.wikibooks.org/wiki/LaTeX/Macros, macros might help me to repeat text in the output file, but not in the code. – jbahn Aug 25 '17 at 19:44
  • I just realised I was so wrong: The macro function can do exactly what I wanted. Thanks – jbahn Aug 25 '17 at 19:48
  • You could put your snippet in a separate file, copy and paste. – John Kormylo Aug 25 '17 at 23:13
  • @JohnKormylo, do you mean in the sense that I should open two .tex files and then copy paste every time? – jbahn Aug 26 '17 at 07:32
  • It depends on your editor, I have about 7 files open on mine right now. – John Kormylo Aug 26 '17 at 12:15

0 Answers0