3

In my research I have large pieces of text of which I like to quote some parts of it, without having to copy/paste and have duplicate pieces. I know I can do that with \include, but the need to have all the excerpts in the many different files does not seem very attractive.

Some more background: I'll provide a large piece of text in the full versions of the reports (appendices), but in the main document I'd like to provide the analysis of these larger pieces of information and refer to excerpts like this:

In the interview as provided in section 3.1, [Engineer A] stated:

Donec scelerisque felis et pellentesque tempor. Mauris blandit, nisi vitae mollis dictum, quam arcu pulvinar ipsum, consequat placerat augue mauris non est.

Which is very similar to what [Engineer B] described, as seen in section 3.2, this issue from his position:

Sed lacinia dictum nunc quis molestie. Maecenas neque erat, egestas id commodo at, pulvinar in odio.

And then these are just two quotes from the large sections 3.1 and 3.2.

What would be the best way to accomplish this?

Preferably something similar to this hypothetical approach:

% appendix text
Proin dignissim vitae est at suscipit.
\begin[quote1]{savetext}Donec scelerisque felis et pellentesque tempor.
  Mauris blandit, nisi vitae mollis dictum, quam arcu pulvinar ipsum,
  consequat placerat augue mauris non est.
\end{savetext}
Nulla sollicitudin lorem a urna tempus, nec convallis purus blandit.

% main report
In the interview as provided in section \ref{sec:seclabel}, [Engineer A] stated:
\printsavetext{quote1}

Perhaps I could define my own environment, abuse the glossaries package or something like that. For what's it worth, I'm using the memoir package for my documents.

Ethan Bolker
  • 9,333
  • 3
  • 42
  • 69
gertvdijk
  • 280
  • 2
  • 8

1 Answers1

1

Using a command is a simple solution. Somewhere in your document declare the new command:

\newcommand\quoteOne{Donec scelerisque felis et pellentesque tempor.
  Mauris blandit, nisi vitae mollis dictum, quam arcu pulvinar ipsum,
  consequat placerat augue mauris non est.}

Then call the command at the locations you want to insert the text:

In the interview as provided in section \ref{sec:seclabel}, [Engineer A] stated:
\quoteOne
Nigel
  • 1,221
  • an alternative to this would be to use a named token list. whether a command or a token list is more appropriate depends on the exact content of the repeated material. – barbara beeton Sep 17 '14 at 02:39