LaTeX forum ⇒ Graphics, Figures & TablesNumbered Examples in Linguistics Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Kotoschow
Posts: 28
Joined: Mon Apr 09, 2012 3:13 pm

Numbered Examples in Linguistics

Postby Kotoschow » Wed Feb 13, 2013 4:36 pm

Hi,

I'm having trouble with referring to numbered examples in the gb4e package. When I refer to a labeled example, instead of example number I get '??'. It happened even when I copy-pasted the example from LaTeX/Linguistics:

  1. \begin{exe}
  2. \ex\label{ex1} Godzilla destroyed the city.
  3. \ex\label{ex2} Godzilla roared.
  4. \end{exe}
  5. Sentence (\ref{ex1}) contains two arguments, but (\ref{ex2}) contains only one.
Last edited by localghost on Wed Feb 13, 2013 5:46 pm, edited 1 time in total.
Reason: Longer passages of source code are tagged as code block, not as in-line code.

Tags:

User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Postby svend_tveskaeg » Wed Feb 13, 2013 5:04 pm

First: A MWE is necessary for us to help.

I don't know the package but have you compiled it two times? First the label needs to be written to the AUX file and secondly the \ref needs to `catch' the label.
Last edited by svend_tveskaeg on Thu Feb 14, 2013 12:44 am, edited 1 time in total.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)

Kotoschow
Posts: 28
Joined: Mon Apr 09, 2012 3:13 pm

Postby Kotoschow » Wed Feb 13, 2013 11:28 pm

How do you do that? I don't see in reference to my numbered examples in the AUX. And I don't really know what i means to have \ref catch the label, other than what I showed in my example. Currently my AUX looks like this, if it helps:

  1. \relax
  2. \citation{fos}
  3. \citation{ot}
  4. \@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}}
  5. \@writefile{toc}{\contentsline {subsection}{\numberline {1.1}The language}{2}}
  6. \@writefile{toc}{\contentsline {subsubsection}{\numberline {1.1.1}Consonants}{2}}
  7. \@writefile{toc}{\contentsline {subsubsection}{\numberline {1.1.2}Vowels}{2}}
  8. \@writefile{toc}{\contentsline {subsubsection}{\numberline {1.1.3}Syllable inventory}{2}}
  9. \citation{fos}
  10. \citation{fos}
  11. \@writefile{toc}{\contentsline {subsubsection}{\numberline {1.1.4}Generalizations}{3}}
  12. \@writefile{toc}{\contentsline {subsection}{\numberline {1.2}The phenomenon}{4}}
  13. \citation{kager}
  14. \citation{kager}
  15. \@writefile{toc}{\contentsline {subsection}{\numberline {1.3}Theoretical background}{5}}
  16. \@writefile{toc}{\contentsline {section}{\numberline {2}Analysis}{6}}
  17. \@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Distribution of vowel clusters}{6}}
  18. \@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Derivation of vowel clusters}{7}}
  19. \@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Word juncture}{11}}
  20. \@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Word medial vowel clusters}{13}}
  21. \bibstyle{agsm}
  22. \bibdata{refs}
Last edited by localghost on Wed Feb 13, 2013 11:30 pm, edited 1 time in total.
Reason: Longer passages of source code are tagged as code block, not as in-line code.

User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Postby svend_tveskaeg » Wed Feb 13, 2013 11:37 pm

All you have to try first is to compile two times in a row. Have you done that?

As I said, a MWE is necessary for us to help.
Last edited by svend_tveskaeg on Thu Feb 14, 2013 12:41 am, edited 1 time in total.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)

User avatar
cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Wed Feb 13, 2013 11:49 pm

Svend is right. For example this Infominimal working example:

  1. \documentclass{article}
  2.  
  3. \usepackage{gb4e}
  4.  
  5. \begin{document}
  6.  
  7. \begin{exe}
  8. \ex\label{ex1} Godzilla destroyed the city.
  9. \ex\label{ex2} Godzilla roared.
  10. \end{exe}
  11. Sentence (\ref{ex1}) contains two arguments, but (\ref{ex2}) contains only one.
  12.  
  13. \end{document}


gives the following aux file:

  1. \relax
  2. \newlabel{ex1}{{1}{1}}
  3. \newlabel{ex2}{{2}{1}}


and gives after two compilations this output:

label.png
label.png (7.59 KiB) Viewed 5789 times


Regards
site moderator & package author

Kotoschow
Posts: 28
Joined: Mon Apr 09, 2012 3:13 pm

Postby Kotoschow » Thu Feb 14, 2013 1:51 am

Yeah, it worked. I encountered this double-compilation thingie also in bibtex, should have thought about it. Isn't there any solution to this?

I think we can mark this as solved. Thanks!

User avatar
cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Thu Feb 14, 2013 9:56 am

Kotoschow wrote:I encountered this double-compilation thingie also in bibtex, should have thought about it. Isn't there any solution to this?


Well, there are some tools that can take care of double compilation and similar stuff, e.g. latexmk or arara.

In my opinion double compilation is the solution. When I creat a document I usually have compiled it so often before it is ready that the double-compilation for references doesn't really matter.

Regards
site moderator & package author


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 8 guests