\end{verbatim} block
- check that your changes/additions to any TEX documentation
- compiles before checking it in! Use the '-checkcurleybraces'
+ compiles before checking it in! Use the '-checkcurlybraces'
and '-checksyntax' commandline parameters (or the OPTIONS menu
if running in GUI mode) to check for some of the more common
mistakes. See TROUBLESHOOTING below for more details
caused the problem.
When making changes/additions to the documentation, always use
- the '-checkcurleybraces' and '-checksyntax' commandline parameters
+ the '-checkcurlybraces' and '-checksyntax' commandline parameters
(or turn these options on in the GUI version via the OPTIONS menu
choice), BEFORE checking in your changes. These two debugging
options will catch many of the more common mistakes that are made
wxChar title[255];
int s=0;
int d=0;
+ // assuming iso-8859-1 here even in Unicode build (FIXME?)
while ( (xitle[s]!=0)&&(d<255) )
{
wxChar ch=wxChar(xitle[s]&0xff);
wxChar ch2=wxChar(xitle[s+2]&0xff);
wxChar ch3=wxChar(xitle[s+3]&0xff);
s+=4; // next character
- if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]=_T('ö'); }
- if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]=_T('ä'); }
- if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]=_T('ü'); }
- if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]=_T('Ö'); }
- if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]=_T('Ä'); }
- if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]=_T('Ü'); }
+ if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]=wxChar('ö'); }
+ if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]=wxChar('ä'); }
+ if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]=wxChar('ü'); }
+ if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]=wxChar('Ö'); }
+ if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]=wxChar('Ä'); }
+ if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]=wxChar('Ü'); }
} else {
title[d++]=ch;
s++;
i += 1;
changed = true;
}
- else if (inVerbatim && (ch == '{' || ch == '}')) // Escape the curley bracket
+ else if (inVerbatim && (ch == '{' || ch == '}')) // Escape the curly bracket
{
BigBuffer[ptr] = '\\'; ptr ++;
BigBuffer[ptr] = ch; ptr ++;
bool isInteractive = false;
bool runTwice = false;
int convertMode = TEX_RTF;
-bool checkCurleyBraces = false;
+bool checkCurlyBraces = false;
bool checkSyntax = false;
bool headerRule = false;
bool footerRule = false;
// detection of \verb yet.
// #define CHECK_BRACES 1
-unsigned long leftCurley = 0;
-unsigned long rightCurley = 0;
+unsigned long leftCurly = 0;
+unsigned long rightCurly = 0;
static wxString currentFileName = _T("");
bool read_a_line(wxChar *buf)
lastChar = ch;
ch = getc(Inputs[CurrentInputIndex]);
- if (checkCurleyBraces)
+ if (checkCurlyBraces)
{
if (ch == '{' && !readInVerbatim && lastChar != _T('\\'))
- leftCurley++;
+ leftCurly++;
if (ch == '}' && !readInVerbatim && lastChar != _T('\\'))
{
- rightCurley++;
- if (rightCurley > leftCurley)
+ rightCurly++;
+ if (rightCurly > leftCurly)
{
wxString errBuf;
- errBuf.Printf(_T("An extra right Curley brace ('}') was detected at line %lu inside file %s"), LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str());
+ errBuf.Printf(_T("An extra right Curly brace ('}') was detected at line %lu inside file %s"), LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str());
OnError((wxChar *)errBuf.c_str());
- // Reduce the count of right Curley braces, so the mismatched count
+ // Reduce the count of right Curly braces, so the mismatched count
// isn't reported on every line that has a '}' after the first mismatch
- rightCurley--;
+ rightCurly--;
}
}
}
ch = ' '; // No real end of file
CurrentInputIndex --;
- if (checkCurleyBraces)
+ if (checkCurlyBraces)
{
- if (leftCurley != rightCurley)
+ if (leftCurly != rightCurly)
{
wxString errBuf;
- errBuf.Printf(_T("Curley braces do not match inside file %s\n%lu opens, %lu closes"),
- (const wxChar*) currentFileName.c_str(),leftCurley,rightCurley);
+ errBuf.Printf(_T("Curly braces do not match inside file %s\n%lu opens, %lu closes"),
+ (const wxChar*) currentFileName.c_str(),leftCurly,rightCurly);
OnError((wxChar *)errBuf.c_str());
}
- leftCurley = 0;
- rightCurley = 0;
+ leftCurly = 0;
+ rightCurly = 0;
}
if (readingVerbatim)
wxStrncmp(buf, _T("\\end{toocomplex}"), 16) == 0)
readInVerbatim = false;
- if (checkCurleyBraces)
+ if (checkCurlyBraces)
{
- if (ch == EOF && leftCurley != rightCurley)
+ if (ch == EOF && leftCurly != rightCurly)
{
wxString errBuf;
- errBuf.Printf(_T("Curley braces do not match inside file %s\n%lu opens, %lu closes"),
- (const wxChar*) currentFileName.c_str(),leftCurley,rightCurley);
+ errBuf.Printf(_T("Curly braces do not match inside file %s\n%lu opens, %lu closes"),
+ (const wxChar*) currentFileName.c_str(),leftCurly,rightCurly);
OnError((wxChar *)errBuf.c_str());
}
}
extern bool isInteractive;
extern bool runTwice;
extern int convertMode;
-extern bool checkCurleyBraces;
+extern bool checkCurlyBraces;
extern bool checkSyntax;
extern bool stopRunning;
extern int mirrorMargins;
}
}
}
+ else if (wxStrcmp(argv[i], _T("-checkcurlybraces")) == 0)
+ {
+ i ++;
+ checkCurlyBraces = true;
+ }
else if (wxStrcmp(argv[i], _T("-checkcurleybraces")) == 0)
{
+ // Support the old, incorrectly spelled version of -checkcurlybraces
+ // so that old scripts which run tex2rtf -checkcurleybraces still work.
i ++;
- checkCurleyBraces = true;
+ checkCurlyBraces = true;
}
else if (wxStrcmp(argv[i], _T("-checksyntax")) == 0)
{
wxMenu *options_menu = new wxMenu;
- options_menu->Append(TEX_OPTIONS_CURLEY_BRACE, _T("Curley brace matching"), _T("Checks for mismatched curley braces"),true);
+ options_menu->Append(TEX_OPTIONS_CURLY_BRACE, _T("Curly brace matching"), _T("Checks for mismatched curly braces"),true);
options_menu->Append(TEX_OPTIONS_SYNTAX_CHECKING, _T("Syntax checking"), _T("Syntax checking for common errors"),true);
- options_menu->Check(TEX_OPTIONS_CURLEY_BRACE, checkCurleyBraces);
+ options_menu->Check(TEX_OPTIONS_CURLY_BRACE, checkCurlyBraces);
options_menu->Check(TEX_OPTIONS_SYNTAX_CHECKING, checkSyntax);
wxMenu *help_menu = new wxMenu;
OnInform(_T(" -charset <pc | pca | ansi | mac> (default ansi)"));
OnInform(_T(" -twice"));
OnInform(_T(" -sync"));
- OnInform(_T(" -checkcurleybraces"));
+ OnInform(_T(" -checkcurlybraces"));
OnInform(_T(" -checksyntax"));
OnInform(_T(" -macros <filename>"));
OnInform(_T(" -winhelp"));
EVT_MENU(TEX_MODE_WINHELP, MyFrame::OnModeWinHelp)
EVT_MENU(TEX_MODE_HTML, MyFrame::OnModeHTML)
EVT_MENU(TEX_MODE_XLP, MyFrame::OnModeXLP)
- EVT_MENU(TEX_OPTIONS_CURLEY_BRACE, MyFrame::OnOptionsCurleyBrace)
+ EVT_MENU(TEX_OPTIONS_CURLY_BRACE, MyFrame::OnOptionsCurlyBrace)
EVT_MENU(TEX_OPTIONS_SYNTAX_CHECKING, MyFrame::OnOptionsSyntaxChecking)
EVT_MENU(TEX_HELP, MyFrame::OnHelp)
EVT_MENU(TEX_ABOUT, MyFrame::OnAbout)
#endif // wxUSE_STATUSBAR
}
-void MyFrame::OnOptionsCurleyBrace(wxCommandEvent& WXUNUSED(event))
+void MyFrame::OnOptionsCurlyBrace(wxCommandEvent& WXUNUSED(event))
{
- checkCurleyBraces = !checkCurleyBraces;
+ checkCurlyBraces = !checkCurlyBraces;
#if wxUSE_STATUSBAR
- if (checkCurleyBraces)
+ if (checkCurlyBraces)
{
- SetStatusText(_T("Checking curley braces: YES"), 1);
+ SetStatusText(_T("Checking curly braces: YES"), 1);
}
else
{
- SetStatusText(_T("Checking curley braces: NO"), 1);
+ SetStatusText(_T("Checking curly braces: NO"), 1);
}
#endif // wxUSE_STATUSBAR
}
void OnModeWinHelp(wxCommandEvent& event);
void OnModeHTML(wxCommandEvent& event);
void OnModeXLP(wxCommandEvent& event);
- void OnOptionsCurleyBrace(wxCommandEvent& event);
+ void OnOptionsCurlyBrace(wxCommandEvent& event);
void OnOptionsSyntaxChecking(wxCommandEvent& event);
void OnHelp(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
#define TEX_MODE_HTML 11
#define TEX_MODE_XLP 12
-#define TEX_OPTIONS_CURLEY_BRACE 13
+#define TEX_OPTIONS_CURLY_BRACE 13
#define TEX_OPTIONS_SYNTAX_CHECKING 14
#define TEX_HELP 15