Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have made a numbered example with the package GB4E. I want to restate this example with the same number. I.e. istead of just refering to the example with \ref, i want the whole thing to show up again. How?

The output of the following is what i would like to restate:

\begin{exe} \ex \label{dog} Bonzo is a dog \end{exe}

share|improve this question
1  
You should probably add a minimal working example (MWE) for people to play with to increase your chances of getting an answer. –  cgnieder Jan 21 '13 at 11:56

1 Answer 1

up vote 3 down vote accepted

You can use the \exr macro to refer to a previously labeled example:

\documentclass{article}
\usepackage{gb4e}
\begin{document}

\begin{exe}
\ex\label{mylabel}
  \begin{xlist}
    \ex An example.
    \ex Another example.
  \end{xlist}
\end{exe}

Here is a repeated example

\begin{exe}
\exr{mylabel}
  \begin{xlist}
    \ex An example.
    \ex Another example.
  \end{xlist}
\end{exe}
\end{document}

output of code

share|improve this answer
    
Great to know, thanks! I did however misinform you. My minimal example should be like this: \begin{exe} \ex \label{dog} \gll Bonzo is a dog\\word word word word\\\glt A sentence \end{exe} Your method doesn't seem to work with this. –  Man Jan 21 '13 at 14:02
    
@Man Edit your question showing a complete example like mine that doesn't work. The method I show works independent of the use of \gll etc. (Although for single examples, (i.e. those not involving xlist, it's best to put the \label command after the example text instead of right after \ex.) –  Alan Munn Jan 21 '13 at 14:13
    
You are right. It does work. I must have been sloppy in my previous attempt. –  Man Jan 21 '13 at 14:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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