# In TexWorks, why does using a real apostrophe (’) break brace matching?

To get an apostrophe in LaTeX, one can type ' (straight quote mark) or ’ (apostrophe).

While both are compiled into an apostrophe, using ’ breaks the syntax highlighting of curly braces in TexWorks.

\documentclass{article}
\begin{document}
Apostrophe {’} and straight quote {'}
\end{document}


Why does it happen and how can I prevent it?

• Braces are already something like an environment in latex. So, I suppose if you open and "close" the quote inside your braces it will probably be highlighted. But if you finish the environment by closing the braces ... the next quote in next environment is not a quote really matching the previous but a new quote. It also would be really ugly if it was working like you would like. If a quote really starts a highlight environment with 1 "point of importance" a brace starts another with 30 "points of importance"... – koleygr Sep 8 '17 at 18:59
• Almost certainly, that is an issue with TeXWorks, not related to LaTeX compiling. My guess is that the algorithm used by TeXWorks for matching braces dates back to the era when nobody would type a curly apostrophe directly. So, I suggest you raise the issue with TUG, the developers of TeXWorks. – user139954 Sep 8 '17 at 19:22
• Following up on @RobtAll's comment, TeXworks development takes place via GitHub, so you can report issues at github.com/TeXworks/texworks – Torbjørn T. Sep 8 '17 at 20:16
• @TorbjørnT. Thanks, I finally filed a bug there (github.com/TeXworks/texworks/issues/830). – Philipp Nov 29 '17 at 8:23