0

This question already has an answer here:

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?

marked as duplicate by Torbjørn T., Troy, CarLaTeX, user36296, Mico Aug 28 '17 at 11:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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: 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

Browse other questions tagged or ask your own question.