3

Observe how after the interlinear gloss I have to insert [''] -- otherwise, the quote continues (and in textmate4 the rest of the text is colored accordingly). Is there some way to resolve this without putting the [''] at the end?

\documentclass[11pt,a4paper]{book}
\setcounter{secnumdepth}{4}
\usepackage{graphicx}
\usepackage{gb4e}
\usepackage{tipa}
\usepackage{setspace}
\usepackage[T1]{fontenc}
\usepackage{multirow}
\setcounter{part}{-1}
\setcounter{subsection}{0}
\begin{document}

\begin{exe}
\ex {\glll ``Um ch'aqitumpiw     \\
\{u-m(a)    ch'aq(u)-itu-mpi-w(a)    \\
that-\textsc{cp}    brain-\textsc{dm.masc-com-decl} \\}

\sn{\glll zanq't'ast''  qow ``[sumitr]_{pp}''. \\
  zanq'(a)-t'a-s(i)-t       q(e)-o-w(a)     \emph{sumit}-r(i)\}\\
  eat-\textsc{m-refl-1sim}  say-\textsc{3sim-decl}  summit-\textsc{all}\\
\glt `{}``Thus with a bit of brains, I ate'', he said, ``[on the summit]_{pp}.''' [FBV5.52A]}
\end{exe}

''
\end{document}
ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149
Teusz
  • 725
  • I'm not sure I understand your problem. This compiles fine without the final '' so I don't understand by your saying that the quote continues. Is there a problem with the output or just with the syntax colouring in Textmate? – Alan Munn Jul 01 '13 at 05:23
  • Compiling is indeed fine -- but TextMate believes that without those end quotes, the entirety of what remains of my text is a giant quote. This is not just aesthetic -- in the following text, it makes it impossible to see what is an authentic quote and what is not. – Teusz Jul 01 '13 at 05:44
  • 3
    So this is a problem with the editor. Quote matching isn't trivial, so it's not too surprising that it can get confused. You could avoid the problem by using the csquotes package and use \enquote{<text>} instead of actual quotation marks. See for example Automatically convert quotations in the form of "abc" to become ``abc". – Alan Munn Jul 01 '13 at 06:04
  • Also, how is this problem related to linguistics or gb4e? Presumably the problem will arise in any environment that splits across lines no? – Alan Munn Jul 01 '13 at 06:04
  • 1
    The best way to cope with the problem would be to disable the highlighting of quoted material, which I find disturbing in general. Unfortunately, TextMate's interface to syntax highlighting is not “friendly”; “daunting” might be a better description. – egreg Jul 01 '13 at 09:02
  • @JosephWright This is an editor specific issue. As I wrote in my comment, the thought of tackling TextMate's syntax highlighting scripts is daunting. – egreg Aug 04 '14 at 09:04

1 Answers1

4

This is problem with your editor (TextMate), and the way it does (or doesn't do) quote matching for syntax highlighting. Your problem is with quotes, and quote matching is hard, especially given the fact that TextMate's syntax highlighting is based on regular expression matching. Changing the rules for the highlighting in TextMate doesn't seem trivial, so perhaps the simplest way to do this is to give your quoted material in glosses at least proper LaTeX markup. You can do this using the csquotes package, See for example:

If you are interested in trying to fix this in TextMate, Stackoverflow has a number of TextMate questions on syntax highlighting, and so asking a question there might also get you some help.

Alan Munn
  • 218,180