3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
22 #include "Converter.h"
23 #include "FontEnums.h"
31 #include "graphics/GraphicsTypes.h"
33 #include "support/convert.h"
34 #include "support/debug.h"
35 #include "support/environment.h"
36 #include "support/FileName.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/Package.h"
42 #include "support/userinfo.h"
49 using namespace lyx::support;
53 namespace os = support::os;
57 // when adding something to this array keep it sorted!
58 LexerKeyword lyxrcTags[] = {
59 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
60 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
61 { "\\alternate_language", LyXRC::RC_ALT_LANG },
62 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
63 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
64 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
65 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
66 { "\\autosave", LyXRC::RC_AUTOSAVE },
67 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
68 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
69 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
70 { "\\bind_file", LyXRC::RC_BINDFILE },
71 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
72 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
73 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
74 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
75 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
76 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
77 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
78 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
79 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
80 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
81 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
82 { "\\converter", LyXRC::RC_CONVERTER },
83 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
84 { "\\copier", LyXRC::RC_COPIER },
85 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
86 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
87 { "\\def_file", LyXRC::RC_DEFFILE },
88 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
89 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
90 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
91 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
92 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
93 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
94 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
95 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
96 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
97 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
98 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
99 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
100 { "\\format", LyXRC::RC_FORMAT },
101 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
102 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
103 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
104 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
105 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
106 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
107 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
108 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
109 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
110 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
111 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
112 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
113 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
114 { "\\input", LyXRC::RC_INPUT },
115 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
116 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
117 { "\\kbmap", LyXRC::RC_KBMAP },
118 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
119 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
120 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
121 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
122 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
123 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
124 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
125 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
126 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
127 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
128 { "\\load_session", LyXRC::RC_LOADSESSION },
129 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
130 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
131 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
132 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
133 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
134 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
135 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
136 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
137 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
138 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
139 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
140 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
141 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
142 { "\\preview", LyXRC::RC_PREVIEW },
143 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
144 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
145 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
146 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
147 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
148 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
149 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
150 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
151 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
152 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
153 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
154 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
155 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
156 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
157 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
158 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
159 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
160 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
161 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
162 { "\\printer", LyXRC::RC_PRINTER },
163 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
164 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
165 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
166 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
167 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
168 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
169 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
170 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
171 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
172 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
173 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
174 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
175 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
176 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
177 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
178 { "\\set_color", LyXRC::RC_SET_COLOR },
179 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
180 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
181 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
182 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
183 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
184 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
185 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
186 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
187 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
188 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
189 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
190 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
191 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
192 { "\\ui_file", LyXRC::RC_UIFILE },
193 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
194 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
195 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
196 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
197 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
198 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
199 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
200 // compatibility with versions older than 1.4.0 only
201 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
202 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
203 // compatibility with versions older than 1.4.0 only
204 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
205 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
206 { "\\user_email", LyXRC::RC_USER_EMAIL },
207 { "\\user_name", LyXRC::RC_USER_NAME },
208 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
209 // compatibility with versions older than 1.4.0 only
210 { "\\viewer", LyXRC::RC_VIEWER},
211 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
212 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
215 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
226 void LyXRC::setDefaults()
229 def_file = "default";
231 // Get printer from the environment. If fail, use default "",
232 // assuming that everything is set up correctly.
233 printer = getEnv("PRINTER");
234 print_adapt_output = false;
235 print_command = "dvips";
236 print_evenpage_flag = "-B";
237 print_oddpage_flag = "-A";
238 print_pagerange_flag = "-pp";
239 print_copies_flag = "-c";
240 print_collcopies_flag = "-C";
241 print_reverse_flag = "-r";
242 print_landscape_flag = "-t landscape";
243 print_to_printer = "-P";
244 print_to_file = "-o ";
245 print_file_extension = ".ps";
246 print_paper_flag = "-t";
247 print_paper_dimension_flag = "-T";
248 document_path.erase();
249 view_dvi_paper_option.erase();
250 default_papersize = PAPER_DEFAULT;
251 default_view_format = "pdf2";
252 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
253 bibtex_command = "bibtex";
255 index_command = "makeindex -c -q";
256 nomencl_command = "makeindex -s nomencl.ist";
258 // Because a screen is typically wider than a piece of paper:
260 allow_geometry_session = true;
261 // Default LaTeX font size:
262 font_sizes[FONT_SIZE_TINY] = "5.0";
263 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
264 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
265 font_sizes[FONT_SIZE_SMALL] = "9.0";
266 font_sizes[FONT_SIZE_NORMAL] = "10.0";
267 font_sizes[FONT_SIZE_LARGE] = "12.0";
268 font_sizes[FONT_SIZE_LARGER] = "14.4";
269 font_sizes[FONT_SIZE_LARGEST] = "17.26";
270 font_sizes[FONT_SIZE_HUGE] = "20.74";
271 font_sizes[FONT_SIZE_HUGER] = "24.88";
272 use_scalable_fonts = true;
273 roman_font_name = "";
275 typewriter_font_name = "";
277 auto_region_delete = true;
278 auto_reset_options = false;
279 plaintext_linelen = 65;
280 mouse_wheel_speed = 1.0;
281 num_lastfiles = maxlastfiles;
282 check_lastfiles = true;
283 use_lastfilepos = true;
284 load_session = false;
286 save_compressed = false;
287 backupdir_path.erase();
288 display_graphics = true;
289 // Spellchecker settings:
290 // FIXME: this check should test the target platform (darwin)
291 #if defined(USE_MACOSX_PACKAGING)
292 spellchecker = "native";
293 #elif defined(USE_ASPELL)
294 spellchecker = "aspell";
295 #elif defined(USE_HUNSPELL)
296 spellchecker = "hunspell";
298 spellchecker = "aspell";
300 spellchecker_accept_compound = false;
301 spellcheck_continuously = false;
302 spellcheck_notes = true;
305 visual_cursor = false;
307 mark_foreign_language = true;
308 language_auto_begin = true;
309 language_auto_end = true;
310 language_global_options = true;
311 language_use_babel = true;
312 language_package = "\\usepackage{babel}";
313 language_command_begin = "\\selectlanguage{$$lang}";
314 language_command_local = "\\foreignlanguage{$$lang}{";
315 sort_layouts = false;
316 group_layouts = true;
317 default_language = "english";
318 gui_language = "auto";
320 windows_style_tex_paths = false;
321 tex_allows_spaces = false;
322 date_insert_format = "%x";
323 cursor_follows_scrollbar = false;
324 scroll_below_document = false;
325 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
326 paragraph_markers = false;
327 mac_like_word_movement = false;
328 macro_edit_style = MACRO_EDIT_INLINE_BOX;
329 dialogs_iconify_with_main = false;
330 preview = PREVIEW_OFF;
331 preview_hashed_labels = false;
332 preview_scale_factor = 1.0;
333 use_converter_cache = true;
334 use_system_colors = false;
336 use_pixmap_cache = false;
337 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
338 user_name = to_utf8(support::user_name());
339 user_email = to_utf8(support::user_email());
340 open_buffers_in_tabs = true;
341 single_close_tab_button = false;
342 forward_search_dvi = string();
343 forward_search_pdf = string();
344 export_overwrite = NO_FILES;
346 // Fullscreen settings
347 full_screen_limit = false;
348 full_screen_toolbars = true;
349 full_screen_tabbar = true;
350 full_screen_menubar = true;
351 full_screen_scrollbar = true;
352 full_screen_width = 700;
354 completion_cursor_text = true;
355 completion_popup_math = true;
356 completion_popup_text = false;
357 completion_popup_delay = 2.0;
358 completion_popup_after_complete = true;
359 autocorrection_math = false;
360 completion_inline_math = true;
361 completion_inline_text = false;
362 completion_inline_dots = -1;
363 completion_inline_delay = 0.2;
364 default_decimal_point = ".";
370 void oldFontFormat(string & family, string & foundry)
372 if (family.empty() || family[0] != '-')
374 foundry = token(family, '-', 1);
375 family = token(family, '-', 2);
383 int LyXRC::read(FileName const & filename)
385 Lexer lexrc(lyxrcTags);
386 if (lyxerr.debugging(Debug::PARSER))
387 lexrc.printTable(lyxerr);
389 lexrc.setFile(filename);
393 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
399 int LyXRC::read(istream & is)
401 Lexer lexrc(lyxrcTags);
402 if (lyxerr.debugging(Debug::PARSER))
403 lexrc.printTable(lyxerr);
409 LYXERR(Debug::LYXRC, "Reading istream...");
415 int LyXRC::read(Lexer & lexrc)
420 while (lexrc.isOK()) {
421 // By using two switches we take advantage of the compiler
422 // telling us if we have missed a LyXRCTags element in
423 // the second switch.
424 // Note that this also shows a problem with Lexer since it
425 // helps us avoid taking advantage of the strictness of the
428 int le = lexrc.lex();
430 case Lexer::LEX_UNDEF:
431 lexrc.printError("Unknown tag `$$Token'");
433 case Lexer::LEX_FEOF:
438 switch (static_cast<LyXRCTags>(le)) {
439 case RC_INPUT: // Include file
442 libFileSearch(string(),
445 lexrc.printError("Error reading "
446 "included file: " + tmp.absFileName());
452 bind_file = os::internal_path(lexrc.getString());
457 def_file = os::internal_path(lexrc.getString());
462 ui_file = os::internal_path(lexrc.getString());
465 case RC_AUTORESET_OPTIONS:
466 lexrc >> auto_reset_options;
469 case RC_DISPLAY_GRAPHICS:
471 display_graphics = lexrc.getString() == "true";
474 case RC_TEX_EXPECTS_WINDOWS_PATHS:
475 lexrc >> windows_style_tex_paths;
478 case RC_TEX_ALLOWS_SPACES:
479 lexrc >> tex_allows_spaces;
486 case RC_KBMAP_PRIMARY:
488 string const kmap(os::internal_path(lexrc.getString()));
489 if (!libFileSearch("kbd", kmap, "kmap").empty()
491 primary_kbmap = kmap;
493 lexrc.printError("LyX: Keymap `$$Token' not found");
498 case RC_KBMAP_SECONDARY:
500 string const kmap(os::internal_path(lexrc.getString()));
501 if (!libFileSearch("kbd", kmap, "kmap").empty()
503 secondary_kbmap = kmap;
505 lexrc.printError("LyX: Keymap `$$Token' not found");
510 case RC_FONT_ENCODING:
518 case RC_PRINT_COMMAND:
519 if (lexrc.next(true)) {
520 print_command = lexrc.getString();
524 case RC_PRINTEVENPAGEFLAG:
525 lexrc >> print_evenpage_flag;
528 case RC_PRINTODDPAGEFLAG:
529 lexrc >> print_oddpage_flag;
532 case RC_PRINTPAGERANGEFLAG:
533 lexrc >> print_pagerange_flag;
536 case RC_PRINTCOPIESFLAG:
537 lexrc >> print_copies_flag;
540 case RC_PRINTCOLLCOPIESFLAG:
541 lexrc >> print_collcopies_flag;
544 case RC_PRINTREVERSEFLAG:
545 lexrc >> print_reverse_flag;
548 case RC_PRINTLANDSCAPEFLAG:
549 lexrc >> print_landscape_flag;
552 case RC_PRINTTOPRINTER:
553 lexrc >> print_to_printer;
556 case RC_PRINT_ADAPTOUTPUT:
557 lexrc >> print_adapt_output;
562 print_to_file = os::internal_path(lexrc.getString());
566 case RC_PRINTFILEEXTENSION:
567 lexrc >> print_file_extension;
570 case RC_PRINTEXSTRAOPTIONS:
571 lexrc >> print_extra_options;
574 case RC_PRINTSPOOL_COMMAND:
575 if (lexrc.next(true)) {
576 print_spool_command = lexrc.getString();
580 case RC_PRINTSPOOL_PRINTERPREFIX:
581 lexrc >> print_spool_printerprefix;
584 case RC_PRINTPAPERDIMENSIONFLAG:
585 lexrc >> print_paper_dimension_flag;
588 case RC_PRINTPAPERFLAG:
589 lexrc >> print_paper_flag;
592 case RC_DEFAULT_PAPERSIZE:
594 string const size = ascii_lowercase(lexrc.getString());
595 if (size == "usletter")
596 default_papersize = PAPER_USLETTER;
597 else if (size == "legal")
598 default_papersize = PAPER_USLEGAL;
599 else if (size == "executive")
600 default_papersize = PAPER_USEXECUTIVE;
601 else if (size == "a3")
602 default_papersize = PAPER_A3;
603 else if (size == "a4")
604 default_papersize = PAPER_A4;
605 else if (size == "a5")
606 default_papersize = PAPER_A5;
607 else if (size == "b5")
608 default_papersize = PAPER_B5;
609 else if (size == "default")
610 default_papersize = PAPER_DEFAULT;
614 case RC_VIEWDVI_PAPEROPTION:
616 view_dvi_paper_option = lexrc.getString();
618 view_dvi_paper_option.erase();
621 case RC_CHKTEX_COMMAND:
622 if (lexrc.next(true)) {
623 chktex_command = lexrc.getString();
627 case RC_BIBTEX_ALTERNATIVES:
628 if (lexrc.next(true)) {
629 bibtex_alternatives.insert(lexrc.getString());
633 case RC_BIBTEX_COMMAND:
634 if (lexrc.next(true)) {
635 bibtex_command = lexrc.getString();
639 case RC_JBIBTEX_COMMAND:
640 if (lexrc.next(true)) {
641 jbibtex_command = lexrc.getString();
645 case RC_INDEX_ALTERNATIVES:
646 if (lexrc.next(true)) {
647 index_alternatives.insert(lexrc.getString());
651 case RC_INDEX_COMMAND:
652 if (lexrc.next(true)) {
653 index_command = lexrc.getString();
657 case RC_JINDEX_COMMAND:
658 if (lexrc.next(true)) {
659 jindex_command = lexrc.getString();
663 case RC_SPLITINDEX_COMMAND:
664 if (lexrc.next(true)) {
665 splitindex_command = lexrc.getString();
669 case RC_NOMENCL_COMMAND:
670 if (lexrc.next(true)) {
671 nomencl_command = lexrc.getString();
683 case RC_GEOMETRY_SESSION:
684 lexrc >> allow_geometry_session;
687 case RC_SCREEN_FONT_SIZES:
688 lexrc >> font_sizes[FONT_SIZE_TINY];
689 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
690 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
691 lexrc >> font_sizes[FONT_SIZE_SMALL];
692 lexrc >> font_sizes[FONT_SIZE_NORMAL];
693 lexrc >> font_sizes[FONT_SIZE_LARGE];
694 lexrc >> font_sizes[FONT_SIZE_LARGER];
695 lexrc >> font_sizes[FONT_SIZE_LARGEST];
696 lexrc >> font_sizes[FONT_SIZE_HUGE];
697 lexrc >> font_sizes[FONT_SIZE_HUGER];
700 case RC_SCREEN_FONT_SCALABLE:
701 lexrc >> use_scalable_fonts;
708 case RC_DOCUMENTPATH:
710 document_path = os::internal_path(lexrc.getString());
711 document_path = expandPath(document_path);
717 example_path = os::internal_path(lexrc.getString());
718 example_path = expandPath(example_path);
722 case RC_TEMPLATEPATH:
724 template_path = os::internal_path(lexrc.getString());
725 template_path = expandPath(template_path);
731 tempdir_path = os::internal_path(lexrc.getString());
732 tempdir_path = expandPath(tempdir_path);
736 case RC_THESAURUSDIRPATH:
738 thesaurusdir_path = os::internal_path(lexrc.getString());
739 thesaurusdir_path = expandPath(thesaurusdir_path);
743 case RC_HUNSPELLDIR_PATH:
745 hunspelldir_path = os::internal_path(lexrc.getString());
746 hunspelldir_path = expandPath(hunspelldir_path);
750 case RC_USELASTFILEPOS:
751 lexrc >> use_lastfilepos;
755 lexrc >> load_session;
758 case RC_MOUSE_WHEEL_SPEED:
759 lexrc >> mouse_wheel_speed;
762 case RC_COMPLETION_INLINE_DELAY:
763 lexrc >> completion_inline_delay;
766 case RC_COMPLETION_INLINE_MATH:
767 lexrc >> completion_inline_math;
770 case RC_COMPLETION_INLINE_TEXT:
771 lexrc >> completion_inline_text;
774 case RC_COMPLETION_INLINE_DOTS:
775 lexrc >> completion_inline_dots;
778 case RC_AUTOCORRECTION_MATH:
779 lexrc >> autocorrection_math;
782 case RC_COMPLETION_POPUP_DELAY:
783 lexrc >> completion_popup_delay;
786 case RC_COMPLETION_POPUP_MATH:
787 lexrc >> completion_popup_math;
790 case RC_COMPLETION_POPUP_TEXT:
791 lexrc >> completion_popup_text;
794 case RC_COMPLETION_CURSOR_TEXT:
795 lexrc >> completion_cursor_text;
798 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
799 lexrc >> completion_popup_after_complete;
802 case RC_NUMLASTFILES:
803 lexrc >> num_lastfiles;
806 case RC_CHECKLASTFILES:
807 lexrc >> check_lastfiles;
810 case RC_SCREEN_FONT_ROMAN:
812 roman_font_name = lexrc.getString();
813 oldFontFormat(roman_font_name,
818 case RC_SCREEN_FONT_SANS:
820 sans_font_name = lexrc.getString();
821 oldFontFormat(sans_font_name, sans_font_foundry);
825 case RC_SCREEN_FONT_TYPEWRITER:
827 typewriter_font_name = lexrc.getString();
828 oldFontFormat(typewriter_font_name,
829 typewriter_font_foundry);
833 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
834 lexrc >> roman_font_foundry;
837 case RC_SCREEN_FONT_SANS_FOUNDRY:
838 lexrc >> sans_font_foundry;
841 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
842 lexrc >> typewriter_font_foundry;
847 lexrc.printError("Missing color tag.");
850 string lyx_name = lexrc.getString();
853 lexrc.printError("Missing color name for color: `$$Token'");
856 string x11_name = lexrc.getString();
858 ColorCode const col =
859 lcolor.getFromLyXName(lyx_name);
860 if (col == Color_none ||
861 col == Color_inherit ||
865 if (!lcolor.setColor(col, x11_name))
866 LYXERR0("Bad lyxrc set_color for " << lyx_name);
870 case RC_AUTOREGIONDELETE:
871 // Auto region delete defaults to true
872 lexrc >> auto_region_delete;
877 lyxpipes = os::internal_path(lexrc.getString());
878 lyxpipes = expandPath(lyxpipes);
882 case RC_CURSOR_FOLLOWS_SCROLLBAR:
883 lexrc >> cursor_follows_scrollbar;
886 case RC_SCROLL_BELOW_DOCUMENT:
887 lexrc >> scroll_below_document;
890 case RC_PARAGRAPH_MARKERS:
891 lexrc >> paragraph_markers;
894 case RC_MAC_LIKE_WORD_MOVEMENT:
895 lexrc >> mac_like_word_movement;
898 case RC_MACRO_EDIT_STYLE:
900 switch (lexrc.getInteger()) {
901 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
902 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
903 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
908 case RC_DIALOGS_ICONIFY_WITH_MAIN:
909 lexrc >> dialogs_iconify_with_main;
912 case RC_PLAINTEXT_LINELEN:
913 lexrc >> plaintext_linelen;
915 // Spellchecker settings:
916 case RC_ACCEPT_COMPOUND:
917 lexrc >> spellchecker_accept_compound;
919 case RC_USE_SYSTEM_COLORS:
920 lexrc >> use_system_colors;
923 lexrc >> use_tooltip;
925 case RC_USE_PIXMAP_CACHE:
926 lexrc >> use_pixmap_cache;
928 case RC_SPELLCHECKER:
929 lexrc >> spellchecker;
932 lexrc >> spellchecker_alt_lang;
935 lexrc >> spellchecker_esc_chars;
937 case RC_SPELLCHECK_CONTINUOUSLY:
938 lexrc >> spellcheck_continuously;
940 case RC_SPELLCHECK_NOTES:
941 lexrc >> spellcheck_notes;
944 lexrc >> make_backup;
946 case RC_SAVE_COMPRESSED:
947 lexrc >> save_compressed;
949 case RC_BACKUPDIR_PATH:
951 backupdir_path = os::internal_path(lexrc.getString());
952 backupdir_path = expandPath(backupdir_path);
955 case RC_DEFAULT_DECIMAL_POINT:
956 lexrc >> default_decimal_point;
958 case RC_DATE_INSERT_FORMAT:
959 lexrc >> date_insert_format;
961 case RC_LANGUAGE_PACKAGE:
962 lexrc >> language_package;
964 case RC_LANGUAGE_AUTO_BEGIN:
965 lexrc >> language_auto_begin;
967 case RC_LANGUAGE_AUTO_END:
968 lexrc >> language_auto_end;
970 case RC_LANGUAGE_GLOBAL_OPTIONS:
971 lexrc >> language_global_options;
973 case RC_LANGUAGE_USE_BABEL:
974 lexrc >> language_use_babel;
976 case RC_LANGUAGE_COMMAND_BEGIN:
977 lexrc >> language_command_begin;
979 case RC_LANGUAGE_COMMAND_END:
980 lexrc >> language_command_end;
982 case RC_LANGUAGE_COMMAND_LOCAL:
983 lexrc >> language_command_local;
986 lexrc >> rtl_support;
988 case RC_VISUAL_CURSOR:
989 lexrc >> visual_cursor;
992 lexrc >> auto_number;
994 case RC_MARK_FOREIGN_LANGUAGE:
995 lexrc >> mark_foreign_language;
1001 fmt = lexrc.getString();
1002 if (lexrc.next(true))
1003 command = lexrc.getString();
1004 setMover(fmt, command);
1008 case RC_CONVERTER: {
1009 string from, to, command, flags;
1011 from = lexrc.getString();
1013 to = lexrc.getString();
1014 if (lexrc.next(true))
1015 command = lexrc.getString();
1017 flags = lexrc.getString();
1018 if (command.empty())
1019 theConverters().erase(from, to);
1021 theConverters().add(from, to, command, flags);
1024 // compatibility with versions older than 1.4.0 only
1026 string format, command;
1027 lexrc >> format >> command;
1028 formats.setViewer(format, command);
1032 string format, extension, prettyname, shortcut;
1033 lexrc >> format >> extension >> prettyname >> shortcut;
1034 string viewer, editor;
1035 if (lexrc.next(true))
1036 viewer = lexrc.getString();
1037 if (lexrc.next(true))
1038 editor = lexrc.getString();
1040 // Hack to ensure compatibility with versions older
1042 int le = lexrc.lex();
1043 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1044 flags = lexrc.getString();
1045 if (le != Lexer::LEX_DATA) {
1046 // We have got a known token.
1047 // Therefore this is an old style
1048 // format definition without
1050 lexrc.pushToken(flags);
1054 int flgs = Format::none;
1055 while (!flags.empty()) {
1057 flags = split(flags, flag, ',');
1058 if (flag == "document")
1059 flgs |= Format::document;
1060 else if (flag == "vector")
1061 flgs |= Format::vector;
1063 LYXERR0("Ignoring unknown flag `"
1064 << flag << "' for format `"
1067 if (prettyname.empty()) {
1068 if (theConverters().formatIsUsed(format))
1069 LYXERR0("Can't delete format " << format);
1071 formats.erase(format);
1073 formats.add(format, extension, prettyname,
1074 shortcut, viewer, editor, flgs);
1078 case RC_VIEWER_ALTERNATIVES: {
1079 string format, command;
1081 format = lexrc.getString();
1082 if (lexrc.eatLine())
1083 command = lexrc.getString();
1084 viewer_alternatives[format].insert(command);
1087 case RC_EDITOR_ALTERNATIVES: {
1088 string format, command;
1089 lexrc >> format >> command;
1090 editor_alternatives[format].insert(command);
1094 case RC_DEFAULT_VIEW_FORMAT:
1095 lexrc >> default_view_format;
1098 case RC_DEFAULT_LANGUAGE:
1099 lexrc >> default_language;
1102 case RC_GUI_LANGUAGE:
1103 lexrc >> gui_language;
1106 case RC_SHOW_BANNER:
1107 lexrc >> show_banner;
1112 string const tmp = lexrc.getString();
1113 if (tmp == "true" || tmp == "on")
1114 preview = PREVIEW_ON;
1115 else if (tmp == "no_math")
1116 preview = PREVIEW_NO_MATH;
1118 preview = PREVIEW_OFF;
1119 if (tmp != "false" && tmp != "off")
1120 LYXERR0("Unrecognized preview status \""
1126 case RC_PREVIEW_HASHED_LABELS:
1127 lexrc >> preview_hashed_labels;
1130 case RC_PREVIEW_SCALE_FACTOR:
1131 lexrc >> preview_scale_factor;
1138 lexrc >> user_email;
1141 case RC_PATH_PREFIX:
1142 lexrc >> path_prefix;
1145 case RC_USE_CONVERTER_CACHE:
1146 lexrc >> use_converter_cache;
1148 case RC_CONVERTER_CACHE_MAXAGE:
1149 lexrc >> converter_cache_maxage;
1152 case RC_SORT_LAYOUTS:
1153 lexrc >> sort_layouts;
1155 case RC_GROUP_LAYOUTS:
1156 lexrc >> group_layouts;
1158 case RC_FULL_SCREEN_LIMIT:
1159 lexrc >> full_screen_limit;
1161 case RC_FULL_SCREEN_TOOLBARS:
1162 lexrc >> full_screen_toolbars;
1164 case RC_FULL_SCREEN_SCROLLBAR:
1165 lexrc >> full_screen_scrollbar;
1167 case RC_FULL_SCREEN_TABBAR:
1168 lexrc >> full_screen_tabbar;
1170 case RC_FULL_SCREEN_MENUBAR:
1171 lexrc >> full_screen_menubar;
1173 case RC_FULL_SCREEN_WIDTH:
1174 lexrc >> full_screen_width;
1176 case RC_OPEN_BUFFERS_IN_TABS:
1177 lexrc >> open_buffers_in_tabs;
1179 case RC_SINGLE_CLOSE_TAB_BUTTON:
1180 lexrc >> single_close_tab_button;
1182 case RC_FORWARD_SEARCH_DVI:
1183 if (lexrc.next(true))
1184 forward_search_dvi = lexrc.getString();
1186 case RC_FORWARD_SEARCH_PDF:
1187 if (lexrc.next(true))
1188 forward_search_pdf = lexrc.getString();
1190 case RC_EXPORT_OVERWRITE:
1192 string const tmp = lexrc.getString();
1193 if (tmp == "all" || tmp == "true")
1194 export_overwrite = ALL_FILES;
1195 else if (tmp == "main")
1196 export_overwrite = MAIN_FILE;
1198 export_overwrite = NO_FILES;
1199 if (tmp != "ask" && tmp != "false")
1200 LYXERR0("Unrecognized export_overwrite status \""
1205 case RC_SCROLL_WHEEL_ZOOM:
1207 string const tmp = lexrc.getString();
1209 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1210 else if (tmp == "shift")
1211 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1212 else if (tmp == "alt")
1213 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1215 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1216 if (tmp != "off" && tmp != "false")
1217 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1223 // Obsoteted in 1.4.0
1226 case RC_SPELL_COMMAND:
1228 case RC_PLAINTEXT_ROFF_COMMAND:
1229 case RC_USE_ALT_LANG:
1230 case RC_USE_ESC_CHARS:
1231 case RC_USE_INP_ENC:
1232 case RC_USE_PERS_DICT:
1233 case RC_USE_SPELL_LIB:
1234 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1235 << lexrc.getString() << "'.");
1240 break; // this is just a dummy
1244 /// Update converters data-structures
1245 theConverters().update(formats);
1246 theConverters().buildGraph();
1252 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1254 ofstream ofs(filename.toFilesystemEncoding().c_str());
1256 write(ofs, ignore_system_lyxrc);
1260 void LyXRC::print() const
1262 if (lyxerr.debugging())
1263 write(lyxerr, false);
1271 typedef pair<string, SpecialisedMover> Data;
1273 SameMover(Data const & comparison)
1274 : comparison_(comparison) {}
1276 bool operator()(Data const & data) const
1278 return data.first == comparison_.first &&
1279 data.second.command() == comparison_.second.command();
1289 // Escape \ and " so that LyXLex can read the string later
1290 string escapeCommand(string const & str) {
1291 return subst(subst(str , "\\", "\\\\"),
1298 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1300 LyXRCTags tag = RC_LAST;
1302 if (!name.empty()) {
1303 for (int i = 0; i != lyxrcCount; ++i)
1304 if ("\\" + name == lyxrcTags[i].tag)
1305 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1309 os << "# LyX " << lyx_version
1310 << " generated this file. If you want to make your own\n"
1311 << "# modifications you should do them from inside LyX and save.\n"
1314 // Why the switch you might ask. It is a trick to ensure that all
1315 // the elements in the LyXRCTags enum are handled. As you can see
1316 // there are no breaks at all. So it is just a huge fall-through.
1317 // The nice thing is that we will get a warning from the compiler
1318 // if we forget an element.
1322 // input/include files are not done here
1324 if (ignore_system_lyxrc ||
1325 bind_file != system_lyxrc.bind_file) {
1326 string const path = os::external_path(bind_file);
1327 os << "\\bind_file \"" << path << "\"\n";
1333 if (ignore_system_lyxrc ||
1334 def_file != system_lyxrc.def_file) {
1335 string const path = os::external_path(def_file);
1336 os << "\\def_file \"" << path << "\"\n";
1345 << "# MISC SECTION ######################################\n"
1347 // bind files are not done here.
1349 case RC_PATH_PREFIX:
1350 if (ignore_system_lyxrc ||
1351 path_prefix != system_lyxrc.path_prefix) {
1352 os << "\\path_prefix \"" << path_prefix << "\"\n";
1357 if (ignore_system_lyxrc ||
1358 ui_file != system_lyxrc.ui_file) {
1359 string const path = os::external_path(ui_file);
1360 os << "\\ui_file \"" << path << "\"\n";
1364 case RC_AUTOREGIONDELETE:
1365 if (ignore_system_lyxrc ||
1366 auto_region_delete != system_lyxrc.auto_region_delete) {
1367 os << "# Set to false to inhibit automatic replacement of\n"
1368 << "# the current selection.\n"
1369 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1374 case RC_AUTORESET_OPTIONS:
1375 if (ignore_system_lyxrc ||
1376 auto_reset_options != system_lyxrc.auto_reset_options) {
1377 os << "# Set to false to inhibit automatic reset of\n"
1378 << "# the class options to defaults on class change.\n"
1379 << "\\auto_reset_options "
1380 << convert<string>(auto_reset_options)
1386 if (ignore_system_lyxrc ||
1387 autosave != system_lyxrc.autosave) {
1388 os << "# The time interval between auto-saves in seconds.\n"
1389 << "\\autosave " << autosave << '\n';
1393 case RC_DISPLAY_GRAPHICS:
1394 if (ignore_system_lyxrc ||
1395 display_graphics != system_lyxrc.display_graphics) {
1396 os << "# Display graphics within LyX\n"
1398 << "\\display_graphics "
1399 << (display_graphics ? "true" : "false")
1404 case RC_SORT_LAYOUTS:
1405 if (ignore_system_lyxrc ||
1406 sort_layouts != system_lyxrc.sort_layouts) {
1407 os << "# Sort layouts alphabetically.\n"
1408 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1412 case RC_GROUP_LAYOUTS:
1413 if (ignore_system_lyxrc ||
1414 group_layouts != system_lyxrc.group_layouts) {
1415 os << "# Group layouts by their category.\n"
1416 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1420 case RC_VIEWDVI_PAPEROPTION:
1421 if (ignore_system_lyxrc ||
1422 view_dvi_paper_option
1423 != system_lyxrc.view_dvi_paper_option) {
1424 os << "# Options used to specify paper size to the\n"
1425 << "# view_dvi_command (e.g. -paper)\n"
1426 << "\\view_dvi_paper_option \""
1427 << view_dvi_paper_option << "\"\n";
1431 case RC_DEFAULT_PAPERSIZE:
1432 if (ignore_system_lyxrc ||
1433 default_papersize != system_lyxrc.default_papersize) {
1434 os << "# The default papersize to use.\n"
1435 << "\\default_papersize \"";
1436 switch (default_papersize) {
1438 os << "default"; break;
1439 case PAPER_USLETTER:
1440 os << "usletter"; break;
1442 os << "legal"; break;
1443 case PAPER_USEXECUTIVE:
1444 os << "executive"; break;
1477 case PAPER_JISB6: break;
1483 case RC_CHKTEX_COMMAND:
1484 if (ignore_system_lyxrc ||
1485 chktex_command != system_lyxrc.chktex_command) {
1486 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1490 case RC_BIBTEX_ALTERNATIVES: {
1491 CommandSet::const_iterator it = bibtex_alternatives.begin();
1492 CommandSet::const_iterator end = bibtex_alternatives.end();
1493 for ( ; it != end; ++it) {
1494 if (ignore_system_lyxrc
1495 || !system_lyxrc.bibtex_alternatives.count(*it))
1496 os << "\\bibtex_alternatives \""
1502 case RC_BIBTEX_COMMAND:
1503 if (ignore_system_lyxrc ||
1504 bibtex_command != system_lyxrc.bibtex_command) {
1505 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1509 case RC_JBIBTEX_COMMAND:
1510 if (ignore_system_lyxrc ||
1511 jbibtex_command != system_lyxrc.jbibtex_command) {
1512 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1516 case RC_INDEX_ALTERNATIVES: {
1517 CommandSet::const_iterator it = index_alternatives.begin();
1518 CommandSet::const_iterator end = index_alternatives.end();
1519 for ( ; it != end; ++it) {
1520 if (ignore_system_lyxrc
1521 || !system_lyxrc.index_alternatives.count(*it))
1522 os << "\\index_alternatives \""
1528 case RC_INDEX_COMMAND:
1529 if (ignore_system_lyxrc ||
1530 index_command != system_lyxrc.index_command) {
1531 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1535 case RC_JINDEX_COMMAND:
1536 if (ignore_system_lyxrc ||
1537 jindex_command != system_lyxrc.jindex_command) {
1538 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1542 case RC_SPLITINDEX_COMMAND:
1543 if (ignore_system_lyxrc ||
1544 splitindex_command != system_lyxrc.splitindex_command) {
1545 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1549 case RC_NOMENCL_COMMAND:
1550 if (ignore_system_lyxrc ||
1551 nomencl_command != system_lyxrc.nomencl_command) {
1552 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1556 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1557 if (ignore_system_lyxrc ||
1558 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1559 os << "\\tex_expects_windows_paths "
1560 << convert<string>(windows_style_tex_paths) << '\n';
1564 case RC_TEX_ALLOWS_SPACES:
1565 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1566 os << "\\tex_allows_spaces "
1567 << convert<string>(tex_allows_spaces) << '\n';
1572 if (ignore_system_lyxrc ||
1573 use_kbmap != system_lyxrc.use_kbmap) {
1574 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1578 case RC_KBMAP_PRIMARY:
1579 if (ignore_system_lyxrc ||
1580 primary_kbmap != system_lyxrc.primary_kbmap) {
1581 string const path = os::external_path(primary_kbmap);
1582 os << "\\kbmap_primary \"" << path << "\"\n";
1586 case RC_KBMAP_SECONDARY:
1587 if (ignore_system_lyxrc ||
1588 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1589 string const path = os::external_path(secondary_kbmap);
1590 os << "\\kbmap_secondary \"" << path << "\"\n";
1595 if (ignore_system_lyxrc ||
1596 lyxpipes != system_lyxrc.lyxpipes) {
1597 string const path = os::external_path(lyxpipes);
1598 os << "\\serverpipe \"" << path << "\"\n";
1602 case RC_DATE_INSERT_FORMAT:
1603 if (ignore_system_lyxrc ||
1604 date_insert_format != system_lyxrc.date_insert_format) {
1605 os << "\\date_insert_format \"" << date_insert_format
1612 os << "\\user_name \"" << user_name << "\"\n";
1617 os << "\\user_email \"" << user_email << "\"\n";
1621 case RC_SHOW_BANNER:
1622 if (ignore_system_lyxrc ||
1623 show_banner != system_lyxrc.show_banner) {
1624 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1630 if (ignore_system_lyxrc ||
1631 preview != system_lyxrc.preview) {
1637 case PREVIEW_NO_MATH:
1644 os << "\\preview " << status << '\n';
1649 case RC_PREVIEW_HASHED_LABELS:
1650 if (ignore_system_lyxrc ||
1651 preview_hashed_labels !=
1652 system_lyxrc.preview_hashed_labels) {
1653 os << "\\preview_hashed_labels "
1654 << convert<string>(preview_hashed_labels) << '\n';
1659 case RC_PREVIEW_SCALE_FACTOR:
1660 if (ignore_system_lyxrc ||
1661 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1662 os << "\\preview_scale_factor "
1663 << preview_scale_factor << '\n';
1668 case RC_USE_CONVERTER_CACHE:
1669 if (ignore_system_lyxrc ||
1670 use_converter_cache != system_lyxrc.use_converter_cache) {
1671 os << "\\use_converter_cache "
1672 << convert<string>(use_converter_cache) << '\n';
1677 case RC_CONVERTER_CACHE_MAXAGE:
1678 if (ignore_system_lyxrc ||
1679 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1680 os << "\\converter_cache_maxage "
1681 << converter_cache_maxage << '\n';
1687 << "# SCREEN & FONTS SECTION ############################\n"
1691 if (ignore_system_lyxrc ||
1692 dpi != system_lyxrc.dpi) {
1693 os << "\\screen_dpi " << dpi << '\n';
1697 case RC_SCREEN_ZOOM:
1698 if (ignore_system_lyxrc ||
1699 zoom != system_lyxrc.zoom) {
1700 os << "\\screen_zoom " << zoom << '\n';
1704 case RC_GEOMETRY_SESSION:
1705 if (ignore_system_lyxrc ||
1706 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1707 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1712 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1713 if (ignore_system_lyxrc ||
1714 cursor_follows_scrollbar
1715 != system_lyxrc.cursor_follows_scrollbar) {
1716 os << "\\cursor_follows_scrollbar "
1717 << convert<string>(cursor_follows_scrollbar) << '\n';
1721 case RC_SCROLL_BELOW_DOCUMENT:
1722 if (ignore_system_lyxrc ||
1723 scroll_below_document
1724 != system_lyxrc.scroll_below_document) {
1725 os << "\\scroll_below_document "
1726 << convert<string>(scroll_below_document) << '\n';
1730 case RC_PARAGRAPH_MARKERS:
1731 if (ignore_system_lyxrc ||
1733 != system_lyxrc.paragraph_markers) {
1734 os << "\\paragraph_markers "
1735 << convert<string>(paragraph_markers) << '\n';
1739 case RC_MAC_LIKE_WORD_MOVEMENT:
1740 if (ignore_system_lyxrc ||
1741 mac_like_word_movement
1742 != system_lyxrc.mac_like_word_movement) {
1743 os << "\\mac_like_word_movement "
1744 << convert<string>(mac_like_word_movement) << '\n';
1748 case RC_MACRO_EDIT_STYLE:
1749 if (ignore_system_lyxrc ||
1751 != system_lyxrc.macro_edit_style) {
1752 os << "\\macro_edit_style ";
1753 switch (macro_edit_style) {
1754 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1755 case MACRO_EDIT_INLINE: os << "1\n"; break;
1756 case MACRO_EDIT_LIST: os << "2\n"; break;
1761 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1762 if (ignore_system_lyxrc ||
1763 dialogs_iconify_with_main
1764 != system_lyxrc.dialogs_iconify_with_main) {
1765 os << "\\dialogs_iconify_with_main "
1766 << convert<string>(dialogs_iconify_with_main) << '\n';
1770 case RC_SCREEN_FONT_ROMAN:
1771 if (ignore_system_lyxrc ||
1772 roman_font_name != system_lyxrc.roman_font_name) {
1773 os << "\\screen_font_roman \"" << roman_font_name
1778 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1779 if (ignore_system_lyxrc ||
1780 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1781 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1786 case RC_SCREEN_FONT_SANS:
1787 if (ignore_system_lyxrc ||
1788 sans_font_name != system_lyxrc.sans_font_name) {
1789 os << "\\screen_font_sans \"" << sans_font_name
1794 case RC_SCREEN_FONT_SANS_FOUNDRY:
1795 if (ignore_system_lyxrc ||
1796 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1797 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1802 case RC_SCREEN_FONT_TYPEWRITER:
1803 if (ignore_system_lyxrc ||
1804 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1805 os << "\\screen_font_typewriter \""
1806 << typewriter_font_name << "\"\n";
1810 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1811 if (ignore_system_lyxrc ||
1812 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1813 os << "\\screen_font_typewriter_foundry \""
1814 << typewriter_font_foundry << "\"\n";
1819 case RC_SCREEN_FONT_SCALABLE:
1820 if (ignore_system_lyxrc ||
1821 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1822 os << "\\screen_font_scalable "
1823 << convert<string>(use_scalable_fonts)
1828 case RC_SCREEN_FONT_SIZES:
1829 if (ignore_system_lyxrc ||
1830 font_sizes[FONT_SIZE_TINY]
1831 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1832 font_sizes[FONT_SIZE_SCRIPT]
1833 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1834 font_sizes[FONT_SIZE_FOOTNOTE]
1835 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1836 font_sizes[FONT_SIZE_SMALL]
1837 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1838 font_sizes[FONT_SIZE_NORMAL]
1839 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1840 font_sizes[FONT_SIZE_LARGE]
1841 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1842 font_sizes[FONT_SIZE_LARGER]
1843 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1844 font_sizes[FONT_SIZE_LARGEST]
1845 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1846 font_sizes[FONT_SIZE_HUGE]
1847 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1848 font_sizes[FONT_SIZE_HUGER]
1849 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1850 os.setf(ios::fixed);
1852 os << "\\screen_font_sizes"
1853 << ' ' << font_sizes[FONT_SIZE_TINY]
1854 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1855 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1856 << ' ' << font_sizes[FONT_SIZE_SMALL]
1857 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1858 << ' ' << font_sizes[FONT_SIZE_LARGE]
1859 << ' ' << font_sizes[FONT_SIZE_LARGER]
1860 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1861 << ' ' << font_sizes[FONT_SIZE_HUGE]
1862 << ' ' << font_sizes[FONT_SIZE_HUGER]
1867 case RC_FULL_SCREEN_LIMIT:
1868 if (ignore_system_lyxrc ||
1869 full_screen_limit != system_lyxrc.full_screen_limit) {
1870 os << "\\fullscreen_limit "
1871 << convert<string>(full_screen_limit)
1876 case RC_FULL_SCREEN_TOOLBARS:
1877 if (ignore_system_lyxrc ||
1878 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1879 os << "\\fullscreen_toolbars "
1880 << convert<string>(full_screen_toolbars)
1885 case RC_FULL_SCREEN_SCROLLBAR:
1886 if (ignore_system_lyxrc ||
1887 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1888 os << "\\fullscreen_scrollbar "
1889 << convert<string>(full_screen_scrollbar)
1894 case RC_FULL_SCREEN_TABBAR:
1895 if (ignore_system_lyxrc ||
1896 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1897 os << "\\fullscreen_tabbar "
1898 << convert<string>(full_screen_tabbar)
1903 case RC_FULL_SCREEN_MENUBAR:
1904 if (ignore_system_lyxrc ||
1905 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1906 os << "\\fullscreen_menubar "
1907 << convert<string>(full_screen_menubar)
1912 case RC_FULL_SCREEN_WIDTH:
1913 if (ignore_system_lyxrc ||
1914 full_screen_width != system_lyxrc.full_screen_width) {
1915 os << "\\fullscreen_width "
1916 << convert<string>(full_screen_width)
1921 case RC_OPEN_BUFFERS_IN_TABS:
1922 if (ignore_system_lyxrc ||
1923 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1924 os << "\\open_buffers_in_tabs "
1925 << convert<string>(open_buffers_in_tabs)
1930 case RC_SINGLE_CLOSE_TAB_BUTTON:
1931 if (ignore_system_lyxrc ||
1932 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1933 os << "\\single_close_tab_button "
1934 << convert<string>(single_close_tab_button)
1939 case RC_FORWARD_SEARCH_DVI:
1940 if (ignore_system_lyxrc ||
1941 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1942 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1946 case RC_FORWARD_SEARCH_PDF:
1947 if (ignore_system_lyxrc ||
1948 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1949 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1955 << "# COLOR SECTION ###################################\n"
1959 for (int i = 0; i < Color_ignore; ++i) {
1960 ColorCode lc = static_cast<ColorCode>(i);
1961 string const col = lcolor.getX11Name(lc);
1962 if (ignore_system_lyxrc
1963 || col != system_lcolor.getX11Name(lc)) {
1964 os << "\\set_color \""
1965 << lcolor.getLyXName(lc) << "\" \""
1973 << "# PRINTER SECTION ###################################\n"
1977 if (ignore_system_lyxrc ||
1978 printer != system_lyxrc.printer) {
1979 os << "\\printer \"" << printer << "\"\n";
1983 case RC_PRINT_ADAPTOUTPUT:
1984 if (ignore_system_lyxrc ||
1985 print_adapt_output != system_lyxrc.print_adapt_output) {
1986 os << "\\print_adapt_output "
1987 << convert<string>(print_adapt_output)
1992 case RC_PRINT_COMMAND:
1993 if (ignore_system_lyxrc ||
1994 print_command != system_lyxrc.print_command) {
1995 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1999 case RC_PRINTEXSTRAOPTIONS:
2000 if (ignore_system_lyxrc ||
2001 print_extra_options != system_lyxrc.print_extra_options) {
2002 os << "\\print_extra_options \"" << print_extra_options
2007 case RC_PRINTSPOOL_COMMAND:
2008 if (ignore_system_lyxrc ||
2009 print_spool_command != system_lyxrc.print_spool_command) {
2010 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2015 case RC_PRINTSPOOL_PRINTERPREFIX:
2016 if (ignore_system_lyxrc ||
2017 print_spool_printerprefix
2018 != system_lyxrc.print_spool_printerprefix) {
2019 os << "\\print_spool_printerprefix \""
2020 << print_spool_printerprefix << "\"\n";
2024 case RC_PRINTEVENPAGEFLAG:
2025 if (ignore_system_lyxrc ||
2026 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2027 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2032 case RC_PRINTODDPAGEFLAG:
2033 if (ignore_system_lyxrc ||
2034 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2035 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2040 case RC_PRINTREVERSEFLAG:
2041 if (ignore_system_lyxrc ||
2042 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2043 os << "\\print_reverse_flag \"" << print_reverse_flag
2048 case RC_PRINTLANDSCAPEFLAG:
2049 if (ignore_system_lyxrc ||
2050 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2051 os << "\\print_landscape_flag \"" << print_landscape_flag
2056 case RC_PRINTPAGERANGEFLAG:
2057 if (ignore_system_lyxrc ||
2058 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2059 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2064 case RC_PRINTCOPIESFLAG:
2065 if (ignore_system_lyxrc ||
2066 print_copies_flag != system_lyxrc.print_copies_flag) {
2067 os << "\\print_copies_flag \"" << print_copies_flag
2072 case RC_PRINTCOLLCOPIESFLAG:
2073 if (ignore_system_lyxrc ||
2074 print_collcopies_flag
2075 != system_lyxrc.print_collcopies_flag) {
2076 os << "\\print_collcopies_flag \""
2077 << print_collcopies_flag
2082 case RC_PRINTPAPERFLAG:
2083 if (ignore_system_lyxrc ||
2084 print_paper_flag != system_lyxrc.print_paper_flag) {
2085 os << "\\print_paper_flag \"" << print_paper_flag
2090 case RC_PRINTPAPERDIMENSIONFLAG:
2091 if (ignore_system_lyxrc ||
2092 print_paper_dimension_flag
2093 != system_lyxrc.print_paper_dimension_flag) {
2094 os << "\\print_paper_dimension_flag \""
2095 << print_paper_dimension_flag << "\"\n";
2099 case RC_PRINTTOPRINTER:
2100 if (ignore_system_lyxrc ||
2101 print_to_printer != system_lyxrc.print_to_printer) {
2102 os << "\\print_to_printer \"" << print_to_printer
2107 case RC_PRINTTOFILE:
2108 if (ignore_system_lyxrc ||
2109 print_to_file != system_lyxrc.print_to_file) {
2110 string const path = os::external_path(print_to_file);
2111 os << "\\print_to_file \"" << path << "\"\n";
2115 case RC_PRINTFILEEXTENSION:
2116 if (ignore_system_lyxrc ||
2117 print_file_extension != system_lyxrc.print_file_extension) {
2118 os << "\\print_file_extension \""
2119 << print_file_extension
2126 << "# TEX SECTION #######################################\n"
2129 case RC_FONT_ENCODING:
2130 if (ignore_system_lyxrc ||
2131 fontenc != system_lyxrc.fontenc) {
2132 os << "\\font_encoding \"" << fontenc << "\"\n";
2138 << "# FILE SECTION ######################################\n"
2141 case RC_DOCUMENTPATH:
2142 if (ignore_system_lyxrc ||
2143 document_path != system_lyxrc.document_path) {
2144 string const path = os::external_path(document_path);
2145 os << "\\document_path \"" << path << "\"\n";
2149 case RC_USELASTFILEPOS:
2150 if (ignore_system_lyxrc ||
2151 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2152 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2157 case RC_LOADSESSION:
2158 if (ignore_system_lyxrc ||
2159 load_session != system_lyxrc.load_session) {
2160 os << "\\load_session " << convert<string>(load_session)
2165 case RC_MOUSE_WHEEL_SPEED:
2166 if (ignore_system_lyxrc ||
2167 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2168 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2172 case RC_COMPLETION_INLINE_DELAY:
2173 if (ignore_system_lyxrc ||
2174 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2175 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2179 case RC_COMPLETION_INLINE_MATH:
2180 if (ignore_system_lyxrc ||
2181 completion_inline_math != system_lyxrc.completion_inline_math) {
2182 os << "\\completion_inline_math "
2183 << convert<string>(completion_inline_math) << '\n';
2187 case RC_COMPLETION_INLINE_TEXT:
2188 if (ignore_system_lyxrc ||
2189 completion_inline_text != system_lyxrc.completion_inline_text) {
2190 os << "\\completion_inline_text "
2191 << convert<string>(completion_inline_text) << '\n';
2195 case RC_COMPLETION_INLINE_DOTS:
2196 if (ignore_system_lyxrc ||
2197 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2198 os << "\\completion_inline_dots "
2199 << convert<string>(completion_inline_dots) << '\n';
2203 case RC_AUTOCORRECTION_MATH:
2204 if (ignore_system_lyxrc ||
2205 autocorrection_math != system_lyxrc.autocorrection_math) {
2206 os << "\\autocorrection_math "
2207 << convert<string>(autocorrection_math) << '\n';
2211 case RC_COMPLETION_POPUP_DELAY:
2212 if (ignore_system_lyxrc ||
2213 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2214 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2218 case RC_COMPLETION_POPUP_MATH:
2219 if (ignore_system_lyxrc ||
2220 completion_popup_math != system_lyxrc.completion_popup_math) {
2221 os << "\\completion_popup_math "
2222 << convert<string>(completion_popup_math) << '\n';
2226 case RC_COMPLETION_POPUP_TEXT:
2227 if (ignore_system_lyxrc ||
2228 completion_popup_text != system_lyxrc.completion_popup_text) {
2229 os << "\\completion_popup_text "
2230 << convert<string>(completion_popup_text) << '\n';
2234 case RC_COMPLETION_CURSOR_TEXT:
2235 if (ignore_system_lyxrc ||
2236 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2237 os << "\\completion_cursor_text "
2238 << convert<string>(completion_cursor_text) << '\n';
2242 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2243 if (ignore_system_lyxrc ||
2244 completion_popup_after_complete
2245 != system_lyxrc.completion_popup_after_complete) {
2246 os << "\\completion_popup_after_complete "
2247 << convert<string>(completion_popup_after_complete) << '\n';
2251 case RC_NUMLASTFILES:
2252 if (ignore_system_lyxrc ||
2253 num_lastfiles != system_lyxrc.num_lastfiles) {
2254 os << "\\num_lastfiles " << num_lastfiles << '\n';
2258 case RC_CHECKLASTFILES:
2259 if (ignore_system_lyxrc ||
2260 check_lastfiles != system_lyxrc.check_lastfiles) {
2261 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2266 case RC_EXAMPLEPATH:
2267 if (ignore_system_lyxrc ||
2268 example_path != system_lyxrc.example_path) {
2269 string const path = os::external_path(example_path);
2270 os << "\\example_path \"" << path << "\"\n";
2274 case RC_TEMPLATEPATH:
2275 if (ignore_system_lyxrc ||
2276 template_path != system_lyxrc.template_path) {
2277 string const path = os::external_path(template_path);
2278 os << "\\template_path \"" << path << "\"\n";
2282 case RC_TEMPDIRPATH:
2283 if (ignore_system_lyxrc ||
2284 tempdir_path != system_lyxrc.tempdir_path) {
2285 string const path = os::external_path(tempdir_path);
2286 os << "\\tempdir_path \"" << path << "\"\n";
2290 case RC_THESAURUSDIRPATH:
2291 if (ignore_system_lyxrc ||
2292 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2293 string const path = os::external_path(thesaurusdir_path);
2294 os << "\\thesaurusdir_path \"" << path << "\"\n";
2298 case RC_HUNSPELLDIR_PATH:
2299 if (ignore_system_lyxrc ||
2300 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2301 string const path = os::external_path(hunspelldir_path);
2302 os << "\\hunspelldir_path \"" << path << "\"\n";
2310 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2313 case RC_PLAINTEXT_LINELEN:
2314 if (ignore_system_lyxrc ||
2315 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2316 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2320 case RC_MAKE_BACKUP:
2321 if (ignore_system_lyxrc ||
2322 make_backup != system_lyxrc.make_backup) {
2323 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2327 case RC_SAVE_COMPRESSED:
2328 if (ignore_system_lyxrc ||
2329 save_compressed != system_lyxrc.save_compressed) {
2330 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2334 case RC_BACKUPDIR_PATH:
2335 if (ignore_system_lyxrc ||
2336 backupdir_path != system_lyxrc.backupdir_path) {
2337 string const path = os::external_path(backupdir_path);
2338 os << "\\backupdir_path \"" << path << "\"\n";
2344 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2348 << "# SPELLCHECKER SECTION ##############################\n"
2351 case RC_SPELL_COMMAND:
2352 case RC_USE_SPELL_LIB:
2356 case RC_ACCEPT_COMPOUND:
2357 if (ignore_system_lyxrc ||
2358 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2359 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2364 case RC_USE_ALT_LANG:
2369 if (ignore_system_lyxrc ||
2370 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2371 os << "\\alternate_language \"" << spellchecker_alt_lang
2376 case RC_USE_ESC_CHARS:
2380 if (ignore_system_lyxrc ||
2381 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2382 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2386 case RC_USE_PERS_DICT:
2390 case RC_USE_SYSTEM_COLORS:
2391 if (ignore_system_lyxrc ||
2392 use_system_colors != system_lyxrc.use_system_colors) {
2393 os << "\\use_system_colors "
2394 << convert<string>(use_system_colors)
2399 case RC_USE_TOOLTIP:
2400 if (ignore_system_lyxrc ||
2401 use_tooltip != system_lyxrc.use_tooltip) {
2402 os << "\\use_tooltip "
2403 << convert<string>(use_tooltip)
2408 case RC_USE_PIXMAP_CACHE:
2409 if (ignore_system_lyxrc ||
2410 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2411 os << "\\use_pixmap_cache "
2412 << convert<string>(use_pixmap_cache)
2421 case RC_USE_INP_ENC:
2427 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2432 case RC_DEFAULT_DECIMAL_POINT:
2433 if (ignore_system_lyxrc ||
2434 default_decimal_point != system_lyxrc.default_decimal_point) {
2435 os << "\\default_decimal_point " << default_decimal_point << '\n';
2440 case RC_SPELLCHECKER:
2441 if (ignore_system_lyxrc ||
2442 spellchecker != system_lyxrc.spellchecker) {
2443 os << "\\spellchecker " << spellchecker << '\n';
2448 case RC_SPELLCHECK_CONTINUOUSLY:
2449 if (ignore_system_lyxrc ||
2450 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2451 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2457 case RC_SPELLCHECK_NOTES:
2458 if (ignore_system_lyxrc ||
2459 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2460 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2466 case RC_RTL_SUPPORT:
2467 if (ignore_system_lyxrc ||
2468 rtl_support != system_lyxrc.rtl_support) {
2469 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2473 case RC_VISUAL_CURSOR:
2474 if (ignore_system_lyxrc ||
2475 visual_cursor != system_lyxrc.visual_cursor) {
2476 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2480 case RC_LANGUAGE_PACKAGE:
2481 if (ignore_system_lyxrc ||
2482 language_package != system_lyxrc.language_package) {
2483 os << "\\language_package \"" << language_package
2488 case RC_LANGUAGE_GLOBAL_OPTIONS:
2489 if (ignore_system_lyxrc ||
2490 language_global_options
2491 != system_lyxrc.language_global_options) {
2492 os << "\\language_global_options \""
2493 << convert<string>(language_global_options)
2498 case RC_LANGUAGE_USE_BABEL:
2499 if (ignore_system_lyxrc ||
2500 language_use_babel != system_lyxrc.language_use_babel) {
2501 os << "\\language_use_babel \""
2502 << convert<string>(language_use_babel)
2507 case RC_LANGUAGE_COMMAND_BEGIN:
2508 if (ignore_system_lyxrc ||
2509 language_command_begin
2510 != system_lyxrc.language_command_begin) {
2511 os << "\\language_command_begin \""
2512 << language_command_begin
2517 case RC_LANGUAGE_COMMAND_END:
2518 if (ignore_system_lyxrc ||
2519 language_command_end
2520 != system_lyxrc.language_command_end) {
2521 os << "\\language_command_end \"" << language_command_end
2526 case RC_LANGUAGE_COMMAND_LOCAL:
2527 if (ignore_system_lyxrc ||
2528 language_command_local
2529 != system_lyxrc.language_command_local) {
2530 os << "\\language_command_local \""
2531 << language_command_local
2536 case RC_LANGUAGE_AUTO_BEGIN:
2537 if (ignore_system_lyxrc ||
2538 language_auto_begin != system_lyxrc.language_auto_begin) {
2539 os << "\\language_auto_begin "
2540 << convert<string>(language_auto_begin) << '\n';
2544 case RC_LANGUAGE_AUTO_END:
2545 if (ignore_system_lyxrc ||
2546 language_auto_end != system_lyxrc.language_auto_end) {
2547 os << "\\language_auto_end "
2548 << convert<string>(language_auto_end) << '\n';
2552 case RC_MARK_FOREIGN_LANGUAGE:
2553 if (ignore_system_lyxrc ||
2554 mark_foreign_language
2555 != system_lyxrc.mark_foreign_language) {
2556 os << "\\mark_foreign_language " <<
2557 convert<string>(mark_foreign_language) << '\n';
2563 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2566 case RC_AUTO_NUMBER:
2567 if (ignore_system_lyxrc ||
2568 auto_number != system_lyxrc.auto_number) {
2569 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2573 case RC_DEFAULT_LANGUAGE:
2574 if (ignore_system_lyxrc ||
2575 default_language != system_lyxrc.default_language) {
2576 os << "\\default_language " << default_language << '\n';
2580 case RC_GUI_LANGUAGE:
2581 if (ignore_system_lyxrc ||
2582 gui_language != system_lyxrc.gui_language) {
2583 os << "\\gui_language " << gui_language << '\n';
2587 case RC_EXPORT_OVERWRITE:
2588 if (ignore_system_lyxrc ||
2589 export_overwrite != system_lyxrc.export_overwrite) {
2591 switch (export_overwrite) {
2602 os << "\\export_overwrite " << status << '\n';
2607 case RC_SCROLL_WHEEL_ZOOM:
2608 if (ignore_system_lyxrc ||
2609 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2611 switch (scroll_wheel_zoom) {
2612 case SCROLL_WHEEL_ZOOM_OFF:
2615 case SCROLL_WHEEL_ZOOM_CTRL:
2618 case SCROLL_WHEEL_ZOOM_SHIFT:
2621 case SCROLL_WHEEL_ZOOM_ALT:
2625 os << "\\scroll_wheel_zoom " << status << '\n';
2631 << "# FORMATS SECTION ##########################\n"
2635 // New/modified formats
2636 for (Formats::const_iterator cit = formats.begin();
2637 cit != formats.end(); ++cit) {
2638 Format const * format =
2639 system_formats.getFormat(cit->name());
2641 format->extension() != cit->extension() ||
2642 format->prettyname() != cit->prettyname() ||
2643 format->shortcut() != cit->shortcut() ||
2644 format->viewer() != cit->viewer() ||
2645 format->editor() != cit->editor() ||
2646 format->documentFormat() != cit->documentFormat() ||
2647 format->vectorFormat() != cit->vectorFormat()) {
2648 os << "\\format \"" << cit->name() << "\" \""
2649 << cit->extension() << "\" \""
2650 << cit->prettyname() << "\" \""
2651 << cit->shortcut() << "\" \""
2652 << escapeCommand(cit->viewer()) << "\" \""
2653 << escapeCommand(cit->editor()) << "\" \"";
2654 vector<string> flags;
2655 if (cit->documentFormat())
2656 flags.push_back("document");
2657 if (cit->vectorFormat())
2658 flags.push_back("vector");
2659 os << getStringFromVector(flags);
2664 // Look for deleted formats
2665 for (Formats::const_iterator cit = system_formats.begin();
2666 cit != system_formats.end(); ++cit)
2667 if (!formats.getFormat(cit->name()))
2668 os << "\\format \"" << cit->name()
2669 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2672 case RC_VIEWER_ALTERNATIVES: {
2673 Alternatives::const_iterator it = viewer_alternatives.begin();
2674 Alternatives::const_iterator const en = viewer_alternatives.end();
2675 Alternatives::const_iterator const sysend =
2676 system_lyxrc.viewer_alternatives.end();
2677 for (; it != en; ++it) {
2678 string const & fmt = it->first;
2679 CommandSet const & cmd = it->second;
2680 CommandSet::const_iterator sit = cmd.begin();
2681 CommandSet::const_iterator const sen = cmd.end();
2682 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2683 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2684 system_lyxrc.viewer_alternatives.find(fmt);
2685 for (; sit != sen; ++sit) {
2686 string const & cmd = *sit;
2687 if (ignore_system_lyxrc
2688 || sysfmt == sysend // format not found
2689 || sysfmt->second.count(cmd) == 0 // this command not found
2691 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2697 case RC_EDITOR_ALTERNATIVES: {
2698 Alternatives::const_iterator it = editor_alternatives.begin();
2699 Alternatives::const_iterator const en = editor_alternatives.end();
2700 Alternatives::const_iterator const sysend =
2701 system_lyxrc.editor_alternatives.end();
2702 for (; it != en; ++it) {
2703 string const & fmt = it->first;
2704 CommandSet const & cmd = it->second;
2705 CommandSet::const_iterator sit = cmd.begin();
2706 CommandSet::const_iterator const sen = cmd.end();
2707 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2708 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2709 system_lyxrc.editor_alternatives.find(fmt);
2710 for (; sit != sen; ++sit) {
2711 string const & cmd = *sit;
2712 if (ignore_system_lyxrc
2713 || sysfmt == sysend // format not found
2714 || sysfmt->second.count(cmd) == 0 // this command not found
2716 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2722 case RC_DEFAULT_VIEW_FORMAT:
2723 if (ignore_system_lyxrc ||
2724 default_view_format != system_lyxrc.default_view_format) {
2725 os << "\\default_view_format " << default_view_format << '\n';
2735 << "# CONVERTERS SECTION ##########################\n"
2739 // Look for new converters
2740 for (Converters::const_iterator cit = theConverters().begin();
2741 cit != theConverters().end(); ++cit) {
2742 Converter const * converter =
2743 theSystemConverters().getConverter(cit->from,
2746 converter->command != cit->command ||
2747 converter->flags != cit->flags)
2748 os << "\\converter \"" << cit->from << "\" \""
2749 << cit->to << "\" \""
2750 << escapeCommand(cit->command) << "\" \""
2751 << cit->flags << "\"\n";
2754 // New/modifed converters
2755 for (Converters::const_iterator cit = theSystemConverters().begin();
2756 cit != theSystemConverters().end(); ++cit)
2757 if (!theConverters().getConverter(cit->from, cit->to))
2758 os << "\\converter \"" << cit->from
2759 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2766 << "# COPIERS SECTION ##########################\n"
2769 // Look for new movers
2770 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2771 Movers::const_iterator const sysend = theSystemMovers().end();
2772 Movers::const_iterator it = theMovers().begin();
2773 Movers::const_iterator end = theMovers().end();
2775 for (; it != end; ++it) {
2776 Movers::const_iterator const sysit =
2777 find_if(sysbegin, sysend, SameMover(*it));
2778 if (sysit == sysend) {
2779 string const & fmt = it->first;
2780 string const & command =
2781 it->second.command();
2783 os << "\\copier " << fmt
2784 << " \"" << escapeCommand(command) << "\"\n";
2790 // We don't actually delete SpecialisedMover(s) from the
2791 // map, just clear their 'command', so there's no need
2792 // to test for anything else.
2799 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2801 // Why the switch you might ask. It is a trick to ensure that all
2802 // the elements in the LyXRCTags enum is handled. As you can see
2803 // there are no breaks at all. So it is just a huge fall-through.
2804 // The nice thing is that we will get a warning from the compiler
2805 // if we forget an element.
2806 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2808 case LyXRC::RC_ACCEPT_COMPOUND:
2809 case LyXRC::RC_ALT_LANG:
2810 case LyXRC::RC_PLAINTEXT_LINELEN:
2811 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2812 case LyXRC::RC_AUTOCORRECTION_MATH:
2813 case LyXRC::RC_AUTOREGIONDELETE:
2814 case LyXRC::RC_AUTORESET_OPTIONS:
2815 case LyXRC::RC_AUTOSAVE:
2816 case LyXRC::RC_AUTO_NUMBER:
2817 case LyXRC::RC_BACKUPDIR_PATH:
2818 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2819 case LyXRC::RC_BIBTEX_COMMAND:
2820 case LyXRC::RC_BINDFILE:
2821 case LyXRC::RC_CHECKLASTFILES:
2822 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2823 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2824 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2825 case LyXRC::RC_COMPLETION_INLINE_MATH:
2826 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2827 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2828 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2829 case LyXRC::RC_COMPLETION_POPUP_MATH:
2830 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2831 case LyXRC::RC_USELASTFILEPOS:
2832 case LyXRC::RC_LOADSESSION:
2833 case LyXRC::RC_CHKTEX_COMMAND:
2834 case LyXRC::RC_CONVERTER:
2835 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2836 case LyXRC::RC_COPIER:
2837 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2838 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2839 case LyXRC::RC_DATE_INSERT_FORMAT:
2840 case LyXRC::RC_DEFAULT_LANGUAGE:
2841 case LyXRC::RC_GUI_LANGUAGE:
2842 case LyXRC::RC_DEFAULT_PAPERSIZE:
2843 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2844 case LyXRC::RC_DEFFILE:
2845 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2846 case LyXRC::RC_DISPLAY_GRAPHICS:
2847 case LyXRC::RC_DOCUMENTPATH:
2848 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2849 FileName path(lyxrc_new.document_path);
2850 if (path.exists() && path.isDirectory())
2851 package().document_dir() = FileName(lyxrc.document_path);
2853 case LyXRC::RC_EDITOR_ALTERNATIVES:
2854 case LyXRC::RC_ESC_CHARS:
2855 case LyXRC::RC_EXAMPLEPATH:
2856 case LyXRC::RC_FONT_ENCODING:
2857 case LyXRC::RC_FORMAT:
2858 case LyXRC::RC_GROUP_LAYOUTS:
2859 case LyXRC::RC_HUNSPELLDIR_PATH:
2860 case LyXRC::RC_INDEX_ALTERNATIVES:
2861 case LyXRC::RC_INDEX_COMMAND:
2862 case LyXRC::RC_JBIBTEX_COMMAND:
2863 case LyXRC::RC_JINDEX_COMMAND:
2864 case LyXRC::RC_NOMENCL_COMMAND:
2865 case LyXRC::RC_INPUT:
2866 case LyXRC::RC_KBMAP:
2867 case LyXRC::RC_KBMAP_PRIMARY:
2868 case LyXRC::RC_KBMAP_SECONDARY:
2869 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2870 case LyXRC::RC_LANGUAGE_AUTO_END:
2871 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2872 case LyXRC::RC_LANGUAGE_COMMAND_END:
2873 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2874 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2875 case LyXRC::RC_LANGUAGE_PACKAGE:
2876 case LyXRC::RC_LANGUAGE_USE_BABEL:
2877 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2878 case LyXRC::RC_MACRO_EDIT_STYLE:
2879 case LyXRC::RC_MAKE_BACKUP:
2880 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2881 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2882 case LyXRC::RC_NUMLASTFILES:
2883 case LyXRC::RC_PARAGRAPH_MARKERS:
2884 case LyXRC::RC_PATH_PREFIX:
2885 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2886 prependEnvPath("PATH", lyxrc.path_prefix);
2888 case LyXRC::RC_PERS_DICT:
2889 case LyXRC::RC_PREVIEW:
2890 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2891 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2892 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2893 case LyXRC::RC_PRINTCOPIESFLAG:
2894 case LyXRC::RC_PRINTER:
2895 case LyXRC::RC_PRINTEVENPAGEFLAG:
2896 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2897 case LyXRC::RC_PRINTFILEEXTENSION:
2898 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2899 case LyXRC::RC_PRINTODDPAGEFLAG:
2900 case LyXRC::RC_PRINTPAGERANGEFLAG:
2901 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2902 case LyXRC::RC_PRINTPAPERFLAG:
2903 case LyXRC::RC_PRINTREVERSEFLAG:
2904 case LyXRC::RC_PRINTSPOOL_COMMAND:
2905 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2906 case LyXRC::RC_PRINTTOFILE:
2907 case LyXRC::RC_PRINTTOPRINTER:
2908 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2909 case LyXRC::RC_PRINT_COMMAND:
2910 case LyXRC::RC_RTL_SUPPORT:
2911 case LyXRC::RC_SAVE_COMPRESSED:
2912 case LyXRC::RC_SCREEN_DPI:
2913 case LyXRC::RC_SCREEN_FONT_ROMAN:
2914 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2915 case LyXRC::RC_SCREEN_FONT_SANS:
2916 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2917 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2918 case LyXRC::RC_SCREEN_FONT_SIZES:
2919 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2920 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2921 case LyXRC::RC_GEOMETRY_SESSION:
2922 case LyXRC::RC_SCREEN_ZOOM:
2923 case LyXRC::RC_SERVERPIPE:
2924 case LyXRC::RC_SET_COLOR:
2925 case LyXRC::RC_SHOW_BANNER:
2926 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2927 case LyXRC::RC_SPELL_COMMAND:
2928 case LyXRC::RC_SPELLCHECKER:
2929 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2930 case LyXRC::RC_SPELLCHECK_NOTES:
2931 case LyXRC::RC_SPLITINDEX_COMMAND:
2932 case LyXRC::RC_TEMPDIRPATH:
2933 case LyXRC::RC_TEMPLATEPATH:
2934 case LyXRC::RC_TEX_ALLOWS_SPACES:
2935 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2936 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2937 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2939 case LyXRC::RC_THESAURUSDIRPATH:
2940 case LyXRC::RC_UIFILE:
2941 case LyXRC::RC_USER_EMAIL:
2942 case LyXRC::RC_USER_NAME:
2943 case LyXRC::RC_USETEMPDIR:
2944 case LyXRC::RC_USE_ALT_LANG:
2945 case LyXRC::RC_USE_CONVERTER_CACHE:
2946 case LyXRC::RC_USE_ESC_CHARS:
2947 case LyXRC::RC_USE_INP_ENC:
2948 case LyXRC::RC_USE_PERS_DICT:
2949 case LyXRC::RC_USE_SYSTEM_COLORS:
2950 case LyXRC::RC_USE_TOOLTIP:
2951 case LyXRC::RC_USE_PIXMAP_CACHE:
2952 case LyXRC::RC_USE_SPELL_LIB:
2953 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2954 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2955 case LyXRC::RC_SORT_LAYOUTS:
2956 case LyXRC::RC_FULL_SCREEN_LIMIT:
2957 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2958 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2959 case LyXRC::RC_FULL_SCREEN_TABBAR:
2960 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2961 case LyXRC::RC_FULL_SCREEN_WIDTH:
2962 case LyXRC::RC_VISUAL_CURSOR:
2963 case LyXRC::RC_VIEWER:
2964 case LyXRC::RC_VIEWER_ALTERNATIVES:
2965 case LyXRC::RC_FORWARD_SEARCH_DVI:
2966 case LyXRC::RC_FORWARD_SEARCH_PDF:
2967 case LyXRC::RC_EXPORT_OVERWRITE:
2968 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2969 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2970 case LyXRC::RC_LAST:
2977 string const LyXRC::getDescription(LyXRCTags tag)
2982 case RC_ACCEPT_COMPOUND:
2983 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2987 case RC_USE_ALT_LANG:
2988 str = _("Specify an alternate language. The default is to use the language of the document.");
2991 case RC_PLAINTEXT_ROFF_COMMAND:
2992 str = _("Use to define an external program to render tables in plain text output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"\" is specified, an internal routine is used.");
2995 case RC_PLAINTEXT_LINELEN:
2996 str = _("The maximum line length of exported plain text/LaTeX/SGML files. If set to 0, paragraphs are output in a single line; if the line length is > 0, paragraphs are separated by a blank line.");
2999 case RC_AUTOREGIONDELETE:
3000 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3003 case RC_AUTORESET_OPTIONS:
3004 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3008 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3011 case RC_AUTO_NUMBER:
3014 case RC_BACKUPDIR_PATH:
3015 str = _("The path for storing backup files. If it is an empty string, LyX will store the backup file in the same directory as the original file.");
3018 case RC_BIBTEX_COMMAND:
3019 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3022 case RC_JBIBTEX_COMMAND:
3023 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3027 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3030 case RC_CHECKLASTFILES:
3031 str = _("Select to check whether the lastfiles still exist.");
3034 case RC_CHKTEX_COMMAND:
3035 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3044 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3045 str = _("LyX normally doesn't update the cursor position if you move the scrollbar. Set to true if you'd prefer to always have the cursor on screen.");
3048 case RC_SCROLL_BELOW_DOCUMENT:
3049 str = _("LyX normally doesn't allow the user to scroll further than the bottom of the document. Set to true if you prefer to scroll the bottom of the document to the top of the screen");
3052 case RC_MAC_LIKE_WORD_MOVEMENT:
3053 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3056 case RC_SHOW_MACRO_LABEL:
3057 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3060 case RC_DATE_INSERT_FORMAT:
3061 //xgettext:no-c-format
3062 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3066 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3069 case RC_DEFAULT_VIEW_FORMAT:
3070 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3073 case RC_DEFAULT_LANGUAGE:
3074 str = _("New documents will be assigned this language.");
3077 case RC_DEFAULT_PAPERSIZE:
3078 str = _("Specify the default paper size.");
3081 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3082 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3085 case RC_DISPLAY_GRAPHICS:
3086 str = _("Select how LyX will display any graphics.");
3089 case RC_DOCUMENTPATH:
3090 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3094 case RC_USE_ESC_CHARS:
3095 str = _("Specify additional chars that can be part of a word.");
3098 case RC_EXAMPLEPATH:
3099 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3102 case RC_FONT_ENCODING:
3103 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3109 case RC_INDEX_COMMAND:
3110 str = _("Define the options of makeindex (cf. man makeindex) or select an alternative compiler. E.g., using xindy/make-rules, the command string would be \"makeindex.sh -m $$lang\".");
3113 case RC_JINDEX_COMMAND:
3114 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3117 case RC_NOMENCL_COMMAND:
3118 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3125 case RC_KBMAP_PRIMARY:
3126 case RC_KBMAP_SECONDARY:
3127 str = _("Use this to set the correct mapping file for your keyboard. You'll need this if you for instance want to type German documents on an American keyboard.");
3130 case RC_LANGUAGE_AUTO_BEGIN:
3131 str = _("Select if a language switching command is needed at the beginning of the document.");
3134 case RC_LANGUAGE_AUTO_END:
3135 str = _("Select if a language switching command is needed at the end of the document.");
3138 case RC_LANGUAGE_COMMAND_BEGIN:
3139 str = _("The LaTeX command for changing from the language of the document to another language. E.g. \\selectlanguage{$$lang} where $$lang is substituted by the name of the second language.");
3142 case RC_LANGUAGE_COMMAND_END:
3143 str = _("The LaTeX command for changing back to the language of the document.");
3146 case RC_LANGUAGE_COMMAND_LOCAL:
3147 str = _("The LaTeX command for local changing of the language.");
3150 case RC_LANGUAGE_GLOBAL_OPTIONS:
3151 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3154 case RC_LANGUAGE_PACKAGE:
3155 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3158 case RC_LANGUAGE_USE_BABEL:
3159 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3162 case RC_USELASTFILEPOS:
3163 str = _("De-select if you do not want LyX to scroll to saved position.");
3166 case RC_LOADSESSION:
3167 str = _("De-select to prevent loading files opened from the last LyX session.");
3170 case RC_MAKE_BACKUP:
3171 str = _("De-select if you don't want LyX to create backup files.");
3174 case RC_MARK_FOREIGN_LANGUAGE:
3175 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3178 case RC_MOUSE_WHEEL_SPEED:
3179 str = bformat(_("The scrolling speed of the mouse wheel."),
3183 case RC_COMPLETION_POPUP_DELAY:
3184 str = _("The completion popup delay.");
3187 case RC_COMPLETION_POPUP_MATH:
3188 str = _("Select to display the completion popup in math mode.");
3191 case RC_COMPLETION_POPUP_TEXT:
3192 str = _("Select to display the completion popup in text mode.");
3195 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3196 str = _("Show the completion popup without delay after non-unique completion attempt.");
3199 case RC_COMPLETION_POPUP_TEXT:
3200 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3203 case RC_COMPLETION_POPUP_DELAY:
3204 str = _("The inline completion delay.");
3207 case RC_COMPLETION_INLINE_MATH:
3208 str = _("Select to display the inline completion in math mode.");
3211 case RC_COMPLETION_INLINE_TEXT:
3212 str = _("Select to display the inline completion in text mode.");
3215 case RC_COMPLETION_INLINE_DOTS:
3216 str = _("Use \"...\" to shorten long completions.");
3219 case RC_AUTOCORRECTION_MATH:
3220 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3223 case RC_NUMLASTFILES:
3224 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3228 case RC_PATH_PREFIX:
3229 str = _("Specify those directories which should be "
3230 "prepended to the PATH environment variable. "
3231 "Use the OS native format.");
3235 str = _("Shows a typeset preview of things such as math");
3238 case RC_PREVIEW_HASHED_LABELS:
3239 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3242 case RC_PREVIEW_SCALE_FACTOR:
3243 str = _("Scale the preview size to suit.");
3246 case RC_PRINTCOLLCOPIESFLAG:
3247 str = _("The option for specifying whether the copies should be collated.");
3250 case RC_PRINTCOPIESFLAG:
3251 str = _("The option for specifying the number of copies to print.");
3255 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3258 case RC_PRINTEVENPAGEFLAG:
3259 str = _("The option to print only even pages.");
3262 case RC_PRINTEXSTRAOPTIONS:
3263 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3266 case RC_PRINTFILEEXTENSION:
3267 str = _("Extension of printer program output file. Usually \".ps\".");
3270 case RC_PRINTLANDSCAPEFLAG:
3271 str = _("The option to print out in landscape.");
3274 case RC_PRINTODDPAGEFLAG:
3275 str = _("The option to print only odd pages.");
3278 case RC_PRINTPAGERANGEFLAG:
3279 str = _("The option for specifying a comma-separated list of pages to print.");
3282 case RC_PRINTPAPERDIMENSIONFLAG:
3283 str = _("Option to specify the dimensions of the print paper.");
3286 case RC_PRINTPAPERFLAG:
3287 str = _("The option to specify paper type.");
3290 case RC_PRINTREVERSEFLAG:
3291 str = _("The option to reverse the order of the pages printed.");
3294 case RC_PRINTSPOOL_COMMAND:
3295 str = _("When set, this printer option automatically prints to a file and then calls a separate print spooling program on that file with the given name and arguments.");
3298 case RC_PRINTSPOOL_PRINTERPREFIX:
3299 str = _("If you specify a printer name in the print dialog, the following argument is prepended along with the printer name after the spool command.");
3302 case RC_PRINTTOFILE:
3303 str = _("Option to pass to the print program to print to a file.");
3306 case RC_PRINTTOPRINTER:
3307 str = _("Option to pass to the print program to print on a specific printer.");
3310 case RC_PRINT_ADAPTOUTPUT:
3311 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3314 case RC_PRINT_COMMAND:
3315 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3318 case RC_RTL_SUPPORT:
3319 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3322 case RC_VISUAL_CURSOR:
3323 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3327 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3330 case RC_SCREEN_FONT_ROMAN:
3331 case RC_SCREEN_FONT_SANS:
3332 case RC_SCREEN_FONT_TYPEWRITER:
3333 str = _("The screen fonts used to display the text while editing.");
3336 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3337 case RC_SCREEN_FONT_SANS_FOUNDRY:
3338 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3341 case RC_SCREEN_FONT_SCALABLE:
3342 str = _("Allow bitmap fonts to be resized. If you are using a bitmap font, selecting this option may make some fonts look blocky in LyX. Deselecting this option makes LyX use the nearest bitmap font size available, instead of scaling.");
3345 case RC_SCREEN_FONT_SIZES:
3346 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3349 case RC_SCREEN_ZOOM:
3350 //xgettext:no-c-format
3351 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3354 case RC_GEOMETRY_SESSION:
3355 str = _("Allow session manager to save and restore windows geometry.");
3359 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3365 case RC_SHOW_BANNER:
3366 str = _("De-select if you don't want the startup banner.");
3369 case RC_TEMPDIRPATH:
3370 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3373 case RC_THESAURUSDIRPATH:
3374 str = _("This is the place where the files of the thesaurus library reside.");
3377 case RC_TEMPLATEPATH:
3378 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3381 case RC_TEX_ALLOWS_SPACES:
3384 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3388 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3400 case RC_USE_USE_SYSTEM_COLORS:
3401 str = _("Enable use the system colors for some things like main window background and selection.");
3404 case RC_USE_TOOLTIP:
3405 str = _("Enable the automatic appearance of tool tips in the work area.");
3408 case RC_USE_PIXMAP_CACHE:
3409 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3412 case RC_USE_SPELL_LIB:
3415 case RC_VIEWDVI_PAPEROPTION:
3416 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3431 // The global instance
3434 // The global copy of the system lyxrc entries (everything except preferences)