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.
25 #include "Converter.h"
29 #include "FontEnums.h"
32 #include "graphics/GraphicsTypes.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/userinfo.h"
44 using namespace lyx::support;
48 namespace os = support::os;
52 // when adding something to this array keep it sorted!
53 keyword_item lyxrcTags[] = {
54 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
55 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
56 { "\\alternate_language", LyXRC::RC_ALT_LANG },
57 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
58 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
59 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
60 { "\\autosave", LyXRC::RC_AUTOSAVE },
61 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
62 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
63 { "\\bind_file", LyXRC::RC_BINDFILE },
64 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
65 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
66 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
67 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
68 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
69 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
70 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
71 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
72 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
73 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
74 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
75 { "\\converter", LyXRC::RC_CONVERTER },
76 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
77 { "\\copier", LyXRC::RC_COPIER },
78 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
79 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
80 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
81 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
82 { "\\def_file", LyXRC::RC_DEFFILE },
83 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
84 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
85 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
86 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
87 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
88 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
89 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
90 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
91 { "\\format", LyXRC::RC_FORMAT },
92 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
93 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
94 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
95 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
96 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
97 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
98 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
99 { "\\input", LyXRC::RC_INPUT },
100 { "\\kbmap", LyXRC::RC_KBMAP },
101 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
102 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
103 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
104 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
105 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
106 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
107 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
108 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
109 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
110 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
111 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
112 { "\\load_session", LyXRC::RC_LOADSESSION },
113 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
114 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
115 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
116 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
117 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
118 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
119 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
120 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
121 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
122 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
123 { "\\preview", LyXRC::RC_PREVIEW },
124 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
125 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
126 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
127 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
128 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
129 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
130 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
131 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
132 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
133 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
134 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
135 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
136 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
137 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
138 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
139 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
140 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
141 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
142 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
143 { "\\printer", LyXRC::RC_PRINTER },
144 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
145 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
146 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
147 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
148 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
149 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
150 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
151 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
152 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
153 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
154 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
155 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
156 { "\\set_color", LyXRC::RC_SET_COLOR },
157 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
158 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
159 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
160 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
161 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
162 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
163 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
164 { "\\ui_file", LyXRC::RC_UIFILE },
165 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
166 { "\\use_bundled_format", LyXRC::RC_USE_BUNDLED_FORMAT },
167 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
168 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
169 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
170 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
171 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
172 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
173 // compatibility with versions older than 1.4.0 only
174 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
175 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
176 // compatibility with versions older than 1.4.0 only
177 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
178 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
179 { "\\user_email", LyXRC::RC_USER_EMAIL },
180 { "\\user_name", LyXRC::RC_USER_NAME },
181 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
182 // compatibility with versions older than 1.4.0 only
183 { "\\viewer", LyXRC::RC_VIEWER},
184 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
187 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
198 void LyXRC::setDefaults() {
200 def_file = "default";
202 // Get printer from the environment. If fail, use default "",
203 // assuming that everything is set up correctly.
204 printer = getEnv("PRINTER");
205 print_adapt_output = false;
206 print_command = "dvips";
207 print_evenpage_flag = "-B";
208 print_oddpage_flag = "-A";
209 print_pagerange_flag = "-pp";
210 print_copies_flag = "-c";
211 print_collcopies_flag = "-C";
212 print_reverse_flag = "-r";
213 print_landscape_flag = "-t landscape";
214 print_to_printer = "-P";
215 print_to_file = "-o ";
216 print_file_extension = ".ps";
217 print_paper_flag = "-t";
218 print_paper_dimension_flag = "-T";
219 document_path.erase();
220 view_dvi_paper_option.erase();
221 default_papersize = PAPER_DEFAULT;
222 custom_export_format = "ps";
223 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
224 bibtex_command = "bibtex";
226 index_command = "makeindex -c -q";
228 // Because a screen typically is wider than a piece of paper:
230 allow_geometry_session = true;
231 // Default LaTeX font size:
232 font_sizes[FONT_SIZE_TINY] = "5.0";
233 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
234 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
235 font_sizes[FONT_SIZE_SMALL] = "9.0";
236 font_sizes[FONT_SIZE_NORMAL] = "10.0";
237 font_sizes[FONT_SIZE_LARGE] = "12.0";
238 font_sizes[FONT_SIZE_LARGER] = "14.4";
239 font_sizes[FONT_SIZE_LARGEST] = "17.26";
240 font_sizes[FONT_SIZE_HUGE] = "20.74";
241 font_sizes[FONT_SIZE_HUGER] = "24.88";
242 use_scalable_fonts = true;
243 roman_font_name = "";
245 typewriter_font_name = "";
247 auto_region_delete = true;
248 auto_reset_options = false;
249 plaintext_linelen = 65;
250 mouse_wheel_speed = 1.0;
251 num_lastfiles = maxlastfiles;
252 check_lastfiles = true;
253 use_lastfilepos = true;
254 load_session = false;
256 backupdir_path.erase();
257 display_graphics = graphics::ColorDisplay;
258 // Spellchecker settings:
259 use_spell_lib = true;
260 isp_command = "ispell";
261 isp_accept_compound = false;
262 isp_use_input_encoding = false;
263 isp_use_alt_lang = false;
264 isp_use_pers_dict = false;
265 isp_use_esc_chars = false;
268 visual_cursor = false;
270 mark_foreign_language = true;
271 language_auto_begin = true;
272 language_auto_end = true;
273 language_global_options = true;
274 language_use_babel = true;
275 language_package = "\\usepackage{babel}";
276 language_command_begin = "\\selectlanguage{$$lang}";
277 language_command_local = "\\foreignlanguage{$$lang}{";
278 sort_layouts = false;
279 group_layouts = true;
280 default_language = "english";
282 windows_style_tex_paths = false;
283 tex_allows_spaces = false;
284 date_insert_format = "%x";
285 cursor_follows_scrollbar = false;
286 macro_edit_style = MACRO_EDIT_INLINE_BOX;
287 dialogs_iconify_with_main = false;
288 label_init_length = 3;
289 preview = PREVIEW_OFF;
290 preview_hashed_labels = false;
291 preview_scale_factor = "0.9";
292 use_converter_cache = true;
294 use_pixmap_cache = false;
295 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
296 user_name = to_utf8(support::user_name());
297 user_email = to_utf8(support::user_email());
299 open_buffers_in_tabs = false;
301 open_buffers_in_tabs = true;
303 use_bundled_format = false;
305 // Fullscreen settings
306 full_screen_limit = false;
307 full_screen_toolbars = true;
308 full_screen_tabbar = true;
309 full_screen_scrollbar = true;
310 full_screen_width = 700;
312 completion_cursor_text = true;
313 completion_popup_math = true;
314 completion_popup_text = false;
315 completion_popup_delay = 2.0;
316 completion_popup_after_complete = true;
317 completion_inline_math = true;
318 completion_inline_text = false;
319 completion_inline_dots = -1;
320 completion_inline_delay = 0.2;
326 void oldFontFormat(string & family, string & foundry)
328 if (family.empty() || family[0] != '-')
330 foundry = token(family, '-', 1);
331 family = token(family, '-', 2);
339 int LyXRC::read(FileName const & filename)
341 Lexer lexrc(lyxrcTags, lyxrcCount);
342 if (lyxerr.debugging(Debug::PARSER))
343 lexrc.printTable(lyxerr);
345 lexrc.setFile(filename);
346 if (!lexrc.isOK()) return -2;
348 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
354 int LyXRC::read(istream & is)
356 Lexer lexrc(lyxrcTags, lyxrcCount);
357 if (lyxerr.debugging(Debug::PARSER))
358 lexrc.printTable(lyxerr);
361 if (!lexrc.isOK()) return -2;
363 LYXERR(Debug::LYXRC, "Reading istream...");
369 int LyXRC::read(Lexer & lexrc)
371 if (!lexrc.isOK()) return -2;
373 while (lexrc.isOK()) {
374 // By using two switches we take advantage of the compiler
375 // telling us if we have missed a LyXRCTags element in
376 // the second switch.
377 // Note that this also shows a problem with Lexer since it
378 // helps us avoid taking advantage of the strictness of the
381 int le = lexrc.lex();
383 case Lexer::LEX_UNDEF:
384 lexrc.printError("Unknown tag `$$Token'");
386 case Lexer::LEX_FEOF:
390 switch (static_cast<LyXRCTags>(le)) {
391 case RC_INPUT: // Include file
394 libFileSearch(string(),
397 lexrc.printError("Error reading "
398 "included file: " + tmp.absFilename());
404 bind_file = os::internal_path(lexrc.getString());
410 def_file = os::internal_path(lexrc.getString());
416 ui_file = os::internal_path(lexrc.getString());
420 case RC_AUTORESET_OPTIONS:
422 auto_reset_options = lexrc.getBool();
426 case RC_DISPLAY_GRAPHICS:
428 display_graphics = graphics::displayTranslator().find(lexrc.getString());
432 case RC_TEX_EXPECTS_WINDOWS_PATHS:
434 windows_style_tex_paths = lexrc.getBool();
438 case RC_TEX_ALLOWS_SPACES:
440 tex_allows_spaces = lexrc.getBool();
446 use_kbmap = lexrc.getBool();
450 case RC_KBMAP_PRIMARY:
452 string const kmap(os::internal_path(lexrc.getString()));
455 } else if (!libFileSearch("kbd", kmap,
457 primary_kbmap = kmap;
459 lexrc.printError("LyX: Keymap `$$Token' not found");
464 case RC_KBMAP_SECONDARY:
466 string const kmap(os::internal_path(lexrc.getString()));
469 } else if (!libFileSearch("kbd", kmap,
471 secondary_kbmap = kmap;
473 lexrc.printError("LyX: Keymap `$$Token' not found");
478 case RC_FONT_ENCODING:
480 fontenc = lexrc.getString();
486 printer = lexrc.getString();
490 case RC_PRINT_COMMAND:
492 print_command = lexrc.getString();
496 case RC_PRINTEVENPAGEFLAG:
498 print_evenpage_flag = lexrc.getString();
502 case RC_PRINTODDPAGEFLAG:
504 print_oddpage_flag = lexrc.getString();
508 case RC_PRINTPAGERANGEFLAG:
510 print_pagerange_flag = lexrc.getString();
514 case RC_PRINTCOPIESFLAG:
516 print_copies_flag = lexrc.getString();
520 case RC_PRINTCOLLCOPIESFLAG:
522 print_collcopies_flag = lexrc.getString();
526 case RC_PRINTREVERSEFLAG:
528 print_reverse_flag = lexrc.getString();
532 case RC_PRINTLANDSCAPEFLAG:
534 print_landscape_flag = lexrc.getString();
538 case RC_PRINTTOPRINTER:
540 print_to_printer = lexrc.getString();
544 case RC_PRINT_ADAPTOUTPUT:
546 print_adapt_output = lexrc.getBool();
552 print_to_file = os::internal_path(lexrc.getString());
556 case RC_PRINTFILEEXTENSION:
558 print_file_extension = lexrc.getString();
562 case RC_PRINTEXSTRAOPTIONS:
564 print_extra_options = lexrc.getString();
568 case RC_PRINTSPOOL_COMMAND:
570 print_spool_command = lexrc.getString();
574 case RC_PRINTSPOOL_PRINTERPREFIX:
576 print_spool_printerprefix = lexrc.getString();
580 case RC_PRINTPAPERDIMENSIONFLAG:
582 print_paper_dimension_flag = lexrc.getString();
586 case RC_PRINTPAPERFLAG:
588 print_paper_flag = lexrc.getString();
592 case RC_CUSTOM_EXPORT_COMMAND:
594 custom_export_command = lexrc.getString();
598 case RC_CUSTOM_EXPORT_FORMAT:
600 custom_export_format = lexrc.getString();
604 case RC_DEFAULT_PAPERSIZE:
607 ascii_lowercase(lexrc.getString());
608 if (size == "usletter")
611 else if (size == "legal")
614 else if (size == "executive")
617 else if (size == "a3")
620 else if (size == "a4")
623 else if (size == "a5")
626 else if (size == "b5")
629 else if (size == "default")
635 case RC_VIEWDVI_PAPEROPTION:
637 view_dvi_paper_option = lexrc.getString();
639 view_dvi_paper_option.erase();
643 case RC_CHKTEX_COMMAND:
645 chktex_command = lexrc.getString();
649 case RC_BIBTEX_COMMAND:
651 bibtex_command = lexrc.getString();
655 case RC_INDEX_COMMAND:
657 index_command = lexrc.getString();
663 dpi = lexrc.getInteger();
669 zoom = lexrc.getInteger();
673 case RC_GEOMETRY_SESSION:
675 allow_geometry_session = lexrc.getBool();
679 case RC_SCREEN_FONT_SIZES:
681 font_sizes[FONT_SIZE_TINY] =
685 font_sizes[FONT_SIZE_SCRIPT] =
689 font_sizes[FONT_SIZE_FOOTNOTE] =
693 font_sizes[FONT_SIZE_SMALL] =
697 font_sizes[FONT_SIZE_NORMAL] =
701 font_sizes[FONT_SIZE_LARGE] =
705 font_sizes[FONT_SIZE_LARGER] =
709 font_sizes[FONT_SIZE_LARGEST] =
713 font_sizes[FONT_SIZE_HUGE] =
717 font_sizes[FONT_SIZE_HUGER] =
722 case RC_SCREEN_FONT_SCALABLE:
724 use_scalable_fonts = lexrc.getBool();
730 autosave = lexrc.getInteger();
734 case RC_DOCUMENTPATH:
736 document_path = os::internal_path(lexrc.getString());
737 document_path = expandPath(document_path);
743 example_path = os::internal_path(lexrc.getString());
744 example_path = expandPath(example_path);
748 case RC_TEMPLATEPATH:
750 template_path = os::internal_path(lexrc.getString());
751 template_path = expandPath(template_path);
757 tempdir_path = os::internal_path(lexrc.getString());
758 tempdir_path = expandPath(tempdir_path);
764 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
768 case RC_USELASTFILEPOS:
770 use_lastfilepos = lexrc.getBool();
776 load_session = lexrc.getBool();
780 case RC_MOUSE_WHEEL_SPEED:
782 mouse_wheel_speed = lexrc.getFloat();
786 case RC_COMPLETION_INLINE_DELAY:
788 completion_inline_delay = lexrc.getFloat();
792 case RC_COMPLETION_INLINE_MATH:
794 completion_inline_math = lexrc.getBool();
798 case RC_COMPLETION_INLINE_TEXT:
800 completion_inline_text = lexrc.getBool();
804 case RC_COMPLETION_INLINE_DOTS:
806 completion_inline_dots = lexrc.getInteger();
810 case RC_COMPLETION_POPUP_DELAY:
812 completion_popup_delay = lexrc.getFloat();
816 case RC_COMPLETION_POPUP_MATH:
818 completion_popup_math = lexrc.getBool();
822 case RC_COMPLETION_POPUP_TEXT:
824 completion_popup_text = lexrc.getBool();
828 case RC_COMPLETION_CURSOR_TEXT:
830 completion_cursor_text = lexrc.getBool();
834 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
836 completion_popup_after_complete = lexrc.getBool();
840 case RC_NUMLASTFILES:
842 num_lastfiles = lexrc.getInteger();
846 case RC_CHECKLASTFILES:
848 check_lastfiles = lexrc.getBool();
852 case RC_SCREEN_FONT_ROMAN:
854 roman_font_name = lexrc.getString();
855 oldFontFormat(roman_font_name,
860 case RC_SCREEN_FONT_SANS:
862 sans_font_name = lexrc.getString();
863 oldFontFormat(sans_font_name, sans_font_foundry);
867 case RC_SCREEN_FONT_TYPEWRITER:
869 typewriter_font_name = lexrc.getString();
870 oldFontFormat(typewriter_font_name,
871 typewriter_font_foundry);
875 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
877 roman_font_foundry = lexrc.getString();
881 case RC_SCREEN_FONT_SANS_FOUNDRY:
883 sans_font_foundry = lexrc.getString();
887 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
889 typewriter_font_foundry = lexrc.getString();
895 string lyx_name, x11_name;
898 lyx_name = lexrc.getString();
900 lexrc.printError("Missing color tag.");
905 x11_name = lexrc.getString();
907 lexrc.printError("Missing color name for color: `$$Token'");
911 ColorCode const col =
912 lcolor.getFromLyXName(lyx_name);
913 if (col == Color_none ||
914 col == Color_inherit ||
918 if (!lcolor.setColor(col, x11_name)) {
919 lyxerr << "Bad lyxrc set_color for "
925 case RC_AUTOREGIONDELETE:
926 // Auto region delete defaults to true
928 auto_region_delete = lexrc.getBool();
934 lyxpipes = os::internal_path(lexrc.getString());
935 lyxpipes = expandPath(lyxpipes);
939 case RC_CURSOR_FOLLOWS_SCROLLBAR:
941 cursor_follows_scrollbar = lexrc.getBool();
945 case RC_MACRO_EDIT_STYLE:
947 switch (lexrc.getInteger()) {
948 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
949 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
950 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
955 case RC_DIALOGS_ICONIFY_WITH_MAIN:
957 dialogs_iconify_with_main = lexrc.getBool();
961 case RC_PLAINTEXT_ROFF_COMMAND:
963 plaintext_roff_command = lexrc.getString();
966 case RC_PLAINTEXT_LINELEN:
968 plaintext_linelen = lexrc.getInteger();
971 // Spellchecker settings:
972 case RC_USE_SPELL_LIB:
974 use_spell_lib = lexrc.getBool();
977 case RC_SPELL_COMMAND:
979 isp_command = lexrc.getString();
982 case RC_ACCEPT_COMPOUND:
984 isp_accept_compound = lexrc.getBool();
989 isp_use_input_encoding = lexrc.getBool();
992 case RC_USE_ALT_LANG:
994 isp_use_alt_lang = lexrc.getBool();
997 case RC_USE_PERS_DICT:
999 isp_use_pers_dict = lexrc.getBool();
1002 case RC_USE_TOOLTIP:
1004 use_tooltip = lexrc.getBool();
1007 case RC_USE_PIXMAP_CACHE:
1009 use_pixmap_cache = lexrc.getBool();
1012 case RC_USE_ESC_CHARS:
1014 isp_use_esc_chars = lexrc.getBool();
1019 isp_alt_lang = lexrc.getString();
1024 isp_pers_dict = os::internal_path(lexrc.getString());
1029 isp_esc_chars = lexrc.getString();
1032 case RC_MAKE_BACKUP:
1034 make_backup = lexrc.getBool();
1037 case RC_BACKUPDIR_PATH:
1039 backupdir_path = os::internal_path(lexrc.getString());
1040 backupdir_path = expandPath(backupdir_path);
1043 case RC_DATE_INSERT_FORMAT:
1045 date_insert_format = lexrc.getString();
1048 case RC_LANGUAGE_PACKAGE:
1050 language_package = lexrc.getString();
1053 case RC_LANGUAGE_AUTO_BEGIN:
1055 language_auto_begin = lexrc.getBool();
1058 case RC_LANGUAGE_AUTO_END:
1060 language_auto_end = lexrc.getBool();
1063 case RC_LANGUAGE_GLOBAL_OPTIONS:
1065 language_global_options = lexrc.getBool();
1068 case RC_LANGUAGE_USE_BABEL:
1070 language_use_babel = lexrc.getBool();
1073 case RC_LANGUAGE_COMMAND_BEGIN:
1075 language_command_begin = lexrc.getString();
1078 case RC_LANGUAGE_COMMAND_END:
1080 language_command_end = lexrc.getString();
1083 case RC_LANGUAGE_COMMAND_LOCAL:
1085 language_command_local = lexrc.getString();
1088 case RC_RTL_SUPPORT:
1090 rtl_support = lexrc.getBool();
1093 case RC_VISUAL_CURSOR:
1095 visual_cursor = lexrc.getBool();
1098 case RC_AUTO_NUMBER:
1100 auto_number = lexrc.getBool();
1103 case RC_MARK_FOREIGN_LANGUAGE:
1105 mark_foreign_language = lexrc.getBool();
1110 string fmt, command;
1112 fmt = lexrc.getString();
1115 command = lexrc.getString();
1117 setMover(fmt, command);
1121 case RC_CONVERTER: {
1122 string from, to, command, flags;
1124 from = lexrc.getString();
1127 to = lexrc.getString();
1130 command = lexrc.getString();
1133 flags = lexrc.getString();
1135 if (command.empty()) {
1136 theConverters().erase(from, to);
1138 theConverters().add(from, to, command, flags);
1142 // compatibility with versions older than 1.4.0 only
1144 string format, command;
1146 format = lexrc.getString();
1149 command = lexrc.getString();
1151 formats.setViewer(format, command);
1155 string format, extension, prettyname, shortcut;
1157 format = lexrc.getString();
1160 extension = lexrc.getString();
1163 prettyname = lexrc.getString();
1166 shortcut = lexrc.getString();
1168 string viewer, editor;
1170 viewer = lexrc.getString();
1172 editor = lexrc.getString();
1174 // Hack to ensure compatibility with versions older
1176 int le = lexrc.lex();
1177 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1178 flags = lexrc.getString();
1179 if (le != Lexer::LEX_DATA) {
1180 // We have got a known token.
1181 // Therefore this is an old style
1182 // format definition without
1184 lexrc.pushToken(flags);
1188 int flgs = Format::none;
1189 while (!flags.empty()) {
1191 flags = split(flags, flag, ',');
1192 if (flag == "document")
1193 flgs |= Format::document;
1194 else if (flag == "vector")
1195 flgs |= Format::vector;
1197 lyxerr << "Ignoring unknown flag `"
1198 << flag << "' for format `"
1199 << format << "'." << endl;
1201 if (prettyname.empty()) {
1202 if (theConverters().formatIsUsed(format)) {
1203 lyxerr << "Can't delete format "
1206 formats.erase(format);
1209 formats.add(format, extension, prettyname,
1210 shortcut, viewer, editor, flgs);
1214 case RC_DEFAULT_LANGUAGE:
1216 default_language = lexrc.getString();
1220 case RC_LABEL_INIT_LENGTH:
1222 label_init_length = lexrc.getInteger();
1226 case RC_SHOW_BANNER:
1228 show_banner = lexrc.getBool();
1234 string const tmp = lexrc.getString();
1235 if (tmp == "true" || tmp == "on")
1236 preview = PREVIEW_ON;
1237 else if (tmp == "no_math")
1238 preview = PREVIEW_NO_MATH;
1240 preview = PREVIEW_OFF;
1241 if (tmp != "false" && tmp != "off")
1242 lyxerr << "Unrecognized "
1244 << tmp << '\n' << endl;
1249 case RC_PREVIEW_HASHED_LABELS:
1251 preview_hashed_labels = lexrc.getBool();
1255 case RC_PREVIEW_SCALE_FACTOR:
1257 preview_scale_factor = lexrc.getString();
1263 user_name = lexrc.getString();
1268 user_email = lexrc.getString();
1271 case RC_PATH_PREFIX:
1273 path_prefix = lexrc.getString();
1276 case RC_USE_CONVERTER_CACHE:
1278 use_converter_cache = lexrc.getBool();
1281 case RC_CONVERTER_CACHE_MAXAGE:
1283 converter_cache_maxage =
1284 convert<unsigned int>(lexrc.getString());
1287 case RC_SORT_LAYOUTS:
1289 sort_layouts = lexrc.getBool();
1291 case RC_GROUP_LAYOUTS:
1293 group_layouts = lexrc.getBool();
1295 case RC_FULL_SCREEN_LIMIT:
1297 full_screen_limit = lexrc.getBool();
1299 case RC_FULL_SCREEN_TOOLBARS:
1301 full_screen_toolbars = lexrc.getBool();
1303 case RC_FULL_SCREEN_SCROLLBAR:
1305 full_screen_scrollbar = lexrc.getBool();
1307 case RC_FULL_SCREEN_TABBAR:
1309 full_screen_tabbar = lexrc.getBool();
1311 case RC_FULL_SCREEN_WIDTH:
1313 full_screen_width = lexrc.getInteger();
1315 case RC_OPEN_BUFFERS_IN_TABS:
1317 open_buffers_in_tabs = lexrc.getBool();
1319 case RC_USE_BUNDLED_FORMAT:
1321 use_bundled_format = lexrc.getBool();
1324 case RC_LAST: break; // this is just a dummy
1328 /// Update converters data-structures
1329 theConverters().update(formats);
1330 theConverters().buildGraph();
1336 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1338 ofstream ofs(filename.toFilesystemEncoding().c_str());
1340 write(ofs, ignore_system_lyxrc);
1344 void LyXRC::print() const
1346 if (lyxerr.debugging())
1347 write(lyxerr, false);
1355 typedef pair<string, SpecialisedMover> Data;
1357 SameMover(Data const & comparison)
1358 : comparison_(comparison) {}
1360 bool operator()(Data const & data) const
1362 return data.first == comparison_.first &&
1363 data.second.command() == comparison_.second.command();
1371 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1373 LyXRCTags tag = RC_LAST;
1375 if (!name.empty()) {
1376 for (int i = 0; i != lyxrcCount; ++i)
1377 if ("\\" + name == lyxrcTags[i].tag)
1378 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1382 os << "### This file is part of\n"
1383 << "### ========================================================\n"
1384 << "### LyX, The Document Processor\n"
1386 << "### Copyright 1995 Matthias Ettrich\n"
1387 << "### Copyright 1995-2007 The LyX Team.\n"
1389 << "### ========================================================\n"
1391 << "# This file is written by LyX, if you want to make your own\n"
1392 << "# modifications you should do them from inside LyX and save\n"
1395 // Why the switch you might ask. It is a trick to ensure that all
1396 // the elements in the LyXRCTags enum is handled. As you can see
1397 // there are no breaks at all. So it is just a huge fall-through.
1398 // The nice thing is that we will get a warning from the compiler
1399 // if we forget an element.
1403 // input/include files are not done here
1405 if (ignore_system_lyxrc ||
1406 bind_file != system_lyxrc.bind_file) {
1407 string const path = os::external_path(bind_file);
1408 os << "\\bind_file \"" << path << "\"\n";
1414 if (ignore_system_lyxrc ||
1415 def_file != system_lyxrc.def_file) {
1416 string const path = os::external_path(def_file);
1417 os << "\\def_file \"" << path << "\"\n";
1426 << "# MISC SECTION ######################################\n"
1428 // bind files are not done here.
1430 case RC_PATH_PREFIX:
1431 if (ignore_system_lyxrc ||
1432 path_prefix != system_lyxrc.path_prefix) {
1433 os << "\\path_prefix \"" << path_prefix << "\"\n";
1438 if (ignore_system_lyxrc ||
1439 ui_file != system_lyxrc.ui_file) {
1440 string const path = os::external_path(ui_file);
1441 os << "\\ui_file \"" << path << "\"\n";
1445 case RC_AUTOREGIONDELETE:
1446 if (ignore_system_lyxrc ||
1447 auto_region_delete != system_lyxrc.auto_region_delete) {
1448 os << "# Set to false to inhibit automatic replacement of\n"
1449 << "# the current selection.\n"
1450 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1455 case RC_AUTORESET_OPTIONS:
1456 if (ignore_system_lyxrc ||
1457 auto_reset_options != system_lyxrc.auto_reset_options) {
1458 os << "# Set to false to inhibit automatic reset of\n"
1459 << "# the class options to defaults on class change.\n"
1460 << "\\auto_reset_options "
1461 << convert<string>(auto_reset_options)
1467 if (ignore_system_lyxrc ||
1468 autosave != system_lyxrc.autosave) {
1469 os << "# The time interval between auto-saves in seconds.\n"
1470 << "\\autosave " << autosave << '\n';
1474 case RC_DISPLAY_GRAPHICS:
1475 if (ignore_system_lyxrc ||
1476 display_graphics != system_lyxrc.display_graphics) {
1477 os << "# Display graphics within LyX\n"
1478 << "# monochrome|grayscale|color|none\n"
1479 << "\\display_graphics "
1480 << graphics::displayTranslator().find(
1481 graphics::DisplayType(display_graphics))
1486 case RC_SORT_LAYOUTS:
1487 if (ignore_system_lyxrc ||
1488 sort_layouts != system_lyxrc.sort_layouts) {
1489 os << "# Sort layouts alphabetically.\n"
1490 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1494 case RC_GROUP_LAYOUTS:
1495 if (ignore_system_lyxrc ||
1496 group_layouts != system_lyxrc.group_layouts) {
1497 os << "# Group layouts by their category.\n"
1498 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1502 case RC_VIEWDVI_PAPEROPTION:
1503 if (ignore_system_lyxrc ||
1504 view_dvi_paper_option
1505 != system_lyxrc.view_dvi_paper_option) {
1506 os << "# Options used to specify paper size to the\n"
1507 << "# view_dvi_command (e.g. -paper)\n"
1508 << "\\view_dvi_paper_option \""
1509 << view_dvi_paper_option << "\"\n";
1513 case RC_DEFAULT_PAPERSIZE:
1514 if (ignore_system_lyxrc ||
1515 default_papersize != system_lyxrc.default_papersize) {
1516 os << "# The default papersize to use.\n"
1517 << "\\default_papersize \"";
1518 switch (default_papersize) {
1520 os << "default"; break;
1521 case PAPER_USLETTER:
1522 os << "usletter"; break;
1524 os << "legal"; break;
1525 case PAPER_USEXECUTIVE:
1526 os << "executive"; break;
1537 case PAPER_B4: break;
1543 case RC_CHKTEX_COMMAND:
1544 if (ignore_system_lyxrc ||
1545 chktex_command != system_lyxrc.chktex_command) {
1546 os << "\\chktex_command \"" << chktex_command << "\"\n";
1550 case RC_BIBTEX_COMMAND:
1551 if (ignore_system_lyxrc ||
1552 bibtex_command != system_lyxrc.bibtex_command) {
1553 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1557 case RC_INDEX_COMMAND:
1558 if (ignore_system_lyxrc ||
1559 index_command != system_lyxrc.index_command) {
1560 os << "\\index_command \"" << index_command << "\"\n";
1564 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1565 if (ignore_system_lyxrc ||
1566 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1567 os << "\\tex_expects_windows_paths "
1568 << convert<string>(windows_style_tex_paths) << '\n';
1572 case RC_TEX_ALLOWS_SPACES:
1573 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1574 os << "\\tex_allows_spaces "
1575 << convert<string>(tex_allows_spaces) << '\n';
1580 if (ignore_system_lyxrc ||
1581 use_kbmap != system_lyxrc.use_kbmap) {
1582 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1586 case RC_KBMAP_PRIMARY:
1587 if (ignore_system_lyxrc ||
1588 primary_kbmap != system_lyxrc.primary_kbmap) {
1589 string const path = os::external_path(primary_kbmap);
1590 os << "\\kbmap_primary \"" << path << "\"\n";
1594 case RC_KBMAP_SECONDARY:
1595 if (ignore_system_lyxrc ||
1596 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1597 string const path = os::external_path(secondary_kbmap);
1598 os << "\\kbmap_secondary \"" << path << "\"\n";
1603 if (ignore_system_lyxrc ||
1604 lyxpipes != system_lyxrc.lyxpipes) {
1605 string const path = os::external_path(lyxpipes);
1606 os << "\\serverpipe \"" << path << "\"\n";
1610 case RC_DATE_INSERT_FORMAT:
1611 if (ignore_system_lyxrc ||
1612 date_insert_format != system_lyxrc.date_insert_format) {
1613 os << "\\date_insert_format \"" << date_insert_format
1618 case RC_LABEL_INIT_LENGTH:
1619 if (ignore_system_lyxrc ||
1620 label_init_length != system_lyxrc.label_init_length) {
1621 os << "\\label_init_length " << label_init_length
1628 os << "\\user_name \"" << user_name << "\"\n";
1633 os << "\\user_email \"" << user_email << "\"\n";
1637 case RC_SHOW_BANNER:
1638 if (ignore_system_lyxrc ||
1639 show_banner != system_lyxrc.show_banner) {
1640 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1646 if (ignore_system_lyxrc ||
1647 preview != system_lyxrc.preview) {
1653 case PREVIEW_NO_MATH:
1660 os << "\\preview " << status << '\n';
1665 case RC_PREVIEW_HASHED_LABELS:
1666 if (ignore_system_lyxrc ||
1667 preview_hashed_labels !=
1668 system_lyxrc.preview_hashed_labels) {
1669 os << "\\preview_hashed_labels "
1670 << convert<string>(preview_hashed_labels) << '\n';
1675 case RC_PREVIEW_SCALE_FACTOR:
1676 if (ignore_system_lyxrc ||
1677 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1678 os << "\\preview_scale_factor "
1679 << preview_scale_factor << '\n';
1684 case RC_USE_CONVERTER_CACHE:
1685 if (ignore_system_lyxrc ||
1686 use_converter_cache != system_lyxrc.use_converter_cache) {
1687 os << "\\use_converter_cache "
1688 << convert<string>(use_converter_cache) << '\n';
1693 case RC_CONVERTER_CACHE_MAXAGE:
1694 if (ignore_system_lyxrc ||
1695 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1696 os << "\\converter_cache_maxage "
1697 << converter_cache_maxage << '\n';
1703 << "# SCREEN & FONTS SECTION ############################\n"
1707 if (ignore_system_lyxrc ||
1708 dpi != system_lyxrc.dpi) {
1709 os << "\\screen_dpi " << dpi << '\n';
1713 case RC_SCREEN_ZOOM:
1714 if (ignore_system_lyxrc ||
1715 zoom != system_lyxrc.zoom) {
1716 os << "\\screen_zoom " << zoom << '\n';
1720 case RC_GEOMETRY_SESSION:
1721 if (ignore_system_lyxrc ||
1722 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1723 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1728 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1729 if (ignore_system_lyxrc ||
1730 cursor_follows_scrollbar
1731 != system_lyxrc.cursor_follows_scrollbar) {
1732 os << "\\cursor_follows_scrollbar "
1733 << convert<string>(cursor_follows_scrollbar) << '\n';
1737 case RC_MACRO_EDIT_STYLE:
1738 if (ignore_system_lyxrc ||
1740 != system_lyxrc.macro_edit_style) {
1741 os << "\\macro_edit_style ";
1742 switch (macro_edit_style) {
1743 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1744 case MACRO_EDIT_INLINE: os << "1\n"; break;
1745 case MACRO_EDIT_LIST: os << "2\n"; break;
1750 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1751 if (ignore_system_lyxrc ||
1752 dialogs_iconify_with_main
1753 != system_lyxrc.dialogs_iconify_with_main) {
1754 os << "\\dialogs_iconify_with_main "
1755 << convert<string>(dialogs_iconify_with_main) << '\n';
1759 case RC_SCREEN_FONT_ROMAN:
1760 if (ignore_system_lyxrc ||
1761 roman_font_name != system_lyxrc.roman_font_name) {
1762 os << "\\screen_font_roman \"" << roman_font_name
1767 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1768 if (ignore_system_lyxrc ||
1769 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1770 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1775 case RC_SCREEN_FONT_SANS:
1776 if (ignore_system_lyxrc ||
1777 sans_font_name != system_lyxrc.sans_font_name) {
1778 os << "\\screen_font_sans \"" << sans_font_name
1783 case RC_SCREEN_FONT_SANS_FOUNDRY:
1784 if (ignore_system_lyxrc ||
1785 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1786 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1791 case RC_SCREEN_FONT_TYPEWRITER:
1792 if (ignore_system_lyxrc ||
1793 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1794 os << "\\screen_font_typewriter \""
1795 << typewriter_font_name << "\"\n";
1799 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1800 if (ignore_system_lyxrc ||
1801 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1802 os << "\\screen_font_typewriter_foundry \""
1803 << typewriter_font_foundry << "\"\n";
1808 case RC_SCREEN_FONT_SCALABLE:
1809 if (ignore_system_lyxrc ||
1810 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1811 os << "\\screen_font_scalable "
1812 << convert<string>(use_scalable_fonts)
1817 case RC_SCREEN_FONT_SIZES:
1818 if (ignore_system_lyxrc ||
1819 font_sizes[FONT_SIZE_TINY]
1820 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1821 font_sizes[FONT_SIZE_SCRIPT]
1822 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1823 font_sizes[FONT_SIZE_FOOTNOTE]
1824 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1825 font_sizes[FONT_SIZE_SMALL]
1826 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1827 font_sizes[FONT_SIZE_NORMAL]
1828 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1829 font_sizes[FONT_SIZE_LARGE]
1830 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1831 font_sizes[FONT_SIZE_LARGER]
1832 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1833 font_sizes[FONT_SIZE_LARGEST]
1834 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1835 font_sizes[FONT_SIZE_HUGE]
1836 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1837 font_sizes[FONT_SIZE_HUGER]
1838 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1839 os.setf(ios::fixed);
1841 os << "\\screen_font_sizes"
1842 << ' ' << font_sizes[FONT_SIZE_TINY]
1843 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1844 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1845 << ' ' << font_sizes[FONT_SIZE_SMALL]
1846 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1847 << ' ' << font_sizes[FONT_SIZE_LARGE]
1848 << ' ' << font_sizes[FONT_SIZE_LARGER]
1849 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1850 << ' ' << font_sizes[FONT_SIZE_HUGE]
1851 << ' ' << font_sizes[FONT_SIZE_HUGER]
1856 case RC_FULL_SCREEN_LIMIT:
1857 if (ignore_system_lyxrc ||
1858 full_screen_limit != system_lyxrc.full_screen_limit) {
1859 os << "\\fullscreen_limit "
1860 << convert<string>(full_screen_limit)
1865 case RC_FULL_SCREEN_TOOLBARS:
1866 if (ignore_system_lyxrc ||
1867 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1868 os << "\\fullscreen_toolbars "
1869 << convert<string>(full_screen_toolbars)
1874 case RC_FULL_SCREEN_SCROLLBAR:
1875 if (ignore_system_lyxrc ||
1876 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1877 os << "\\fullscreen_scrollbar "
1878 << convert<string>(full_screen_scrollbar)
1883 case RC_FULL_SCREEN_TABBAR:
1884 if (ignore_system_lyxrc ||
1885 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1886 os << "\\fullscreen_tabbar "
1887 << convert<string>(full_screen_tabbar)
1892 case RC_FULL_SCREEN_WIDTH:
1893 if (ignore_system_lyxrc ||
1894 full_screen_width != system_lyxrc.full_screen_width) {
1895 os << "\\fullscreen_width "
1896 << convert<string>(full_screen_width)
1901 case RC_OPEN_BUFFERS_IN_TABS:
1902 if (ignore_system_lyxrc ||
1903 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1904 os << "\\open_buffers_in_tabs "
1905 << convert<string>(open_buffers_in_tabs)
1910 case RC_USE_BUNDLED_FORMAT:
1911 if (ignore_system_lyxrc ||
1912 use_bundled_format != system_lyxrc.use_bundled_format) {
1913 os << "\\use_bundled_format "
1914 << convert<string>(use_bundled_format)
1921 << "# COLOR SECTION ###################################\n"
1925 for (int i = 0; i < Color_ignore; ++i) {
1926 ColorCode lc = static_cast<ColorCode>(i);
1928 string const col(lcolor.getX11Name(lc));
1929 if (ignore_system_lyxrc ||
1930 col != system_lcolor.getX11Name(lc)) {
1931 os << "\\set_color \""
1932 << lcolor.getLyXName(lc) << "\" \""
1940 << "# PRINTER SECTION ###################################\n"
1944 if (ignore_system_lyxrc ||
1945 printer != system_lyxrc.printer) {
1946 os << "\\printer \"" << printer << "\"\n";
1950 case RC_PRINT_ADAPTOUTPUT:
1951 if (ignore_system_lyxrc ||
1952 print_adapt_output != system_lyxrc.print_adapt_output) {
1953 os << "\\print_adapt_output "
1954 << convert<string>(print_adapt_output)
1959 case RC_PRINT_COMMAND:
1960 if (ignore_system_lyxrc ||
1961 print_command != system_lyxrc.print_command) {
1962 os << "\\print_command \"" << print_command << "\"\n";
1966 case RC_PRINTEXSTRAOPTIONS:
1967 if (ignore_system_lyxrc ||
1968 print_extra_options != system_lyxrc.print_extra_options) {
1969 os << "\\print_extra_options \"" << print_extra_options
1974 case RC_PRINTSPOOL_COMMAND:
1975 if (ignore_system_lyxrc ||
1976 print_spool_command != system_lyxrc.print_spool_command) {
1977 os << "\\print_spool_command \"" << print_spool_command
1982 case RC_PRINTSPOOL_PRINTERPREFIX:
1983 if (ignore_system_lyxrc ||
1984 print_spool_printerprefix
1985 != system_lyxrc.print_spool_printerprefix) {
1986 os << "\\print_spool_printerprefix \""
1987 << print_spool_printerprefix << "\"\n";
1991 case RC_PRINTEVENPAGEFLAG:
1992 if (ignore_system_lyxrc ||
1993 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1994 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1999 case RC_PRINTODDPAGEFLAG:
2000 if (ignore_system_lyxrc ||
2001 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2002 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2007 case RC_PRINTREVERSEFLAG:
2008 if (ignore_system_lyxrc ||
2009 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2010 os << "\\print_reverse_flag \"" << print_reverse_flag
2015 case RC_PRINTLANDSCAPEFLAG:
2016 if (ignore_system_lyxrc ||
2017 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2018 os << "\\print_landscape_flag \"" << print_landscape_flag
2023 case RC_PRINTPAGERANGEFLAG:
2024 if (ignore_system_lyxrc ||
2025 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2026 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2031 case RC_PRINTCOPIESFLAG:
2032 if (ignore_system_lyxrc ||
2033 print_copies_flag != system_lyxrc.print_copies_flag) {
2034 os << "\\print_copies_flag \"" << print_copies_flag
2039 case RC_PRINTCOLLCOPIESFLAG:
2040 if (ignore_system_lyxrc ||
2041 print_collcopies_flag
2042 != system_lyxrc.print_collcopies_flag) {
2043 os << "\\print_collcopies_flag \""
2044 << print_collcopies_flag
2049 case RC_PRINTPAPERFLAG:
2050 if (ignore_system_lyxrc ||
2051 print_paper_flag != system_lyxrc.print_paper_flag) {
2052 os << "\\print_paper_flag \"" << print_paper_flag
2057 case RC_PRINTPAPERDIMENSIONFLAG:
2058 if (ignore_system_lyxrc ||
2059 print_paper_dimension_flag
2060 != system_lyxrc.print_paper_dimension_flag) {
2061 os << "\\print_paper_dimension_flag \""
2062 << print_paper_dimension_flag << "\"\n";
2066 case RC_PRINTTOPRINTER:
2067 if (ignore_system_lyxrc ||
2068 print_to_printer != system_lyxrc.print_to_printer) {
2069 os << "\\print_to_printer \"" << print_to_printer
2074 case RC_PRINTTOFILE:
2075 if (ignore_system_lyxrc ||
2076 print_to_file != system_lyxrc.print_to_file) {
2077 string const path = os::external_path(print_to_file);
2078 os << "\\print_to_file \"" << path << "\"\n";
2082 case RC_PRINTFILEEXTENSION:
2083 if (ignore_system_lyxrc ||
2084 print_file_extension != system_lyxrc.print_file_extension) {
2085 os << "\\print_file_extension \""
2086 << print_file_extension
2093 << "# EXPORT SECTION ####################################\n"
2096 case RC_CUSTOM_EXPORT_COMMAND:
2097 if (ignore_system_lyxrc ||
2098 custom_export_command
2099 != system_lyxrc.custom_export_command) {
2100 os << "\\custom_export_command \""
2101 << custom_export_command
2106 case RC_CUSTOM_EXPORT_FORMAT:
2107 if (ignore_system_lyxrc ||
2108 custom_export_format
2109 != system_lyxrc.custom_export_format) {
2110 os << "\\custom_export_format \"" << custom_export_format
2117 << "# TEX SECTION #######################################\n"
2120 case RC_FONT_ENCODING:
2121 if (ignore_system_lyxrc ||
2122 fontenc != system_lyxrc.fontenc) {
2123 os << "\\font_encoding \"" << fontenc << "\"\n";
2129 << "# FILE SECTION ######################################\n"
2132 case RC_DOCUMENTPATH:
2133 if (ignore_system_lyxrc ||
2134 document_path != system_lyxrc.document_path) {
2135 string const path = os::external_path(document_path);
2136 os << "\\document_path \"" << path << "\"\n";
2140 case RC_USELASTFILEPOS:
2141 if (ignore_system_lyxrc ||
2142 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2143 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2148 case RC_LOADSESSION:
2149 if (ignore_system_lyxrc ||
2150 load_session != system_lyxrc.load_session) {
2151 os << "\\load_session " << convert<string>(load_session)
2156 case RC_MOUSE_WHEEL_SPEED:
2157 if (ignore_system_lyxrc ||
2158 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2159 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2163 case RC_COMPLETION_INLINE_DELAY:
2164 if (ignore_system_lyxrc ||
2165 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2166 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2170 case RC_COMPLETION_INLINE_MATH:
2171 if (ignore_system_lyxrc ||
2172 completion_inline_math != system_lyxrc.completion_inline_math) {
2173 os << "\\completion_inline_math "
2174 << convert<string>(completion_inline_math) << '\n';
2178 case RC_COMPLETION_INLINE_TEXT:
2179 if (ignore_system_lyxrc ||
2180 completion_inline_text != system_lyxrc.completion_inline_text) {
2181 os << "\\completion_inline_text "
2182 << convert<string>(completion_inline_text) << '\n';
2186 case RC_COMPLETION_INLINE_DOTS:
2187 if (ignore_system_lyxrc ||
2188 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2189 os << "\\completion_inline_dots "
2190 << convert<string>(completion_inline_dots) << '\n';
2194 case RC_COMPLETION_POPUP_DELAY:
2195 if (ignore_system_lyxrc ||
2196 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2197 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2201 case RC_COMPLETION_POPUP_MATH:
2202 if (ignore_system_lyxrc ||
2203 completion_popup_math != system_lyxrc.completion_popup_math) {
2204 os << "\\completion_popup_math "
2205 << convert<string>(completion_popup_math) << '\n';
2209 case RC_COMPLETION_POPUP_TEXT:
2210 if (ignore_system_lyxrc ||
2211 completion_popup_text != system_lyxrc.completion_popup_text) {
2212 os << "\\completion_popup_text "
2213 << convert<string>(completion_popup_text) << '\n';
2217 case RC_COMPLETION_CURSOR_TEXT:
2218 if (ignore_system_lyxrc ||
2219 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2220 os << "\\completion_cursor_text "
2221 << convert<string>(completion_cursor_text) << '\n';
2225 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2226 if (ignore_system_lyxrc ||
2227 completion_popup_after_complete
2228 != system_lyxrc.completion_popup_after_complete) {
2229 os << "\\completion_popup_after_complete "
2230 << convert<string>(completion_popup_after_complete) << '\n';
2234 case RC_NUMLASTFILES:
2235 if (ignore_system_lyxrc ||
2236 num_lastfiles != system_lyxrc.num_lastfiles) {
2237 os << "\\num_lastfiles " << num_lastfiles << '\n';
2241 case RC_CHECKLASTFILES:
2242 if (ignore_system_lyxrc ||
2243 check_lastfiles != system_lyxrc.check_lastfiles) {
2244 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2249 case RC_EXAMPLEPATH:
2250 if (ignore_system_lyxrc ||
2251 example_path != system_lyxrc.example_path) {
2252 string const path = os::external_path(example_path);
2253 os << "\\example_path \"" << path << "\"\n";
2257 case RC_TEMPLATEPATH:
2258 if (ignore_system_lyxrc ||
2259 template_path != system_lyxrc.template_path) {
2260 string const path = os::external_path(template_path);
2261 os << "\\template_path \"" << path << "\"\n";
2265 case RC_TEMPDIRPATH:
2266 if (ignore_system_lyxrc ||
2267 tempdir_path != system_lyxrc.tempdir_path) {
2268 string const path = os::external_path(tempdir_path);
2269 os << "\\tempdir_path \"" << path << "\"\n";
2277 case RC_PLAINTEXT_LINELEN:
2278 if (ignore_system_lyxrc ||
2279 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2280 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2284 case RC_MAKE_BACKUP:
2285 if (ignore_system_lyxrc ||
2286 make_backup != system_lyxrc.make_backup) {
2287 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2291 case RC_BACKUPDIR_PATH:
2292 if (ignore_system_lyxrc ||
2293 backupdir_path != system_lyxrc.backupdir_path) {
2294 string const path = os::external_path(backupdir_path);
2295 os << "\\backupdir_path \"" << path << "\"\n";
2301 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2304 case RC_PLAINTEXT_ROFF_COMMAND:
2305 if (ignore_system_lyxrc ||
2306 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2307 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2314 << "# SPELLCHECKER SECTION ##############################\n"
2316 case RC_USE_SPELL_LIB:
2317 if (ignore_system_lyxrc ||
2318 use_spell_lib != system_lyxrc.use_spell_lib) {
2319 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2323 case RC_SPELL_COMMAND:
2324 if (ignore_system_lyxrc ||
2325 isp_command != system_lyxrc.isp_command) {
2326 os << "\\spell_command \"" << isp_command << "\"\n";
2330 case RC_ACCEPT_COMPOUND:
2331 if (ignore_system_lyxrc ||
2332 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2333 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2338 case RC_USE_ALT_LANG:
2339 if (ignore_system_lyxrc ||
2340 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2341 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2347 if (ignore_system_lyxrc ||
2348 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2349 os << "\\alternate_language \"" << isp_alt_lang
2354 case RC_USE_ESC_CHARS:
2355 if (ignore_system_lyxrc ||
2356 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2357 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2363 if (ignore_system_lyxrc ||
2364 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2365 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2369 case RC_USE_PERS_DICT:
2370 if (ignore_system_lyxrc ||
2371 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2372 os << "\\use_personal_dictionary "
2373 << convert<string>(isp_use_pers_dict)
2378 case RC_USE_TOOLTIP:
2379 if (ignore_system_lyxrc ||
2380 use_tooltip != system_lyxrc.use_tooltip) {
2381 os << "\\use_tooltip "
2382 << convert<string>(use_tooltip)
2385 case RC_USE_PIXMAP_CACHE:
2386 if (ignore_system_lyxrc ||
2387 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2388 os << "\\use_pixmap_cache "
2389 << convert<string>(use_pixmap_cache)
2393 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2394 string const path = os::external_path(isp_pers_dict);
2395 os << "\\personal_dictionary \"" << path << "\"\n";
2399 case RC_USE_INP_ENC:
2400 if (ignore_system_lyxrc ||
2401 isp_use_input_encoding
2402 != system_lyxrc.isp_use_input_encoding) {
2403 os << "\\use_input_encoding "
2404 << convert<string>(isp_use_input_encoding)
2411 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2414 case RC_RTL_SUPPORT:
2415 if (ignore_system_lyxrc ||
2416 rtl_support != system_lyxrc.rtl_support) {
2417 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2421 case RC_VISUAL_CURSOR:
2422 if (ignore_system_lyxrc ||
2423 visual_cursor != system_lyxrc.visual_cursor) {
2424 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2428 case RC_LANGUAGE_PACKAGE:
2429 if (ignore_system_lyxrc ||
2430 language_package != system_lyxrc.language_package) {
2431 os << "\\language_package \"" << language_package
2436 case RC_LANGUAGE_GLOBAL_OPTIONS:
2437 if (ignore_system_lyxrc ||
2438 language_global_options
2439 != system_lyxrc.language_global_options) {
2440 os << "\\language_global_options \""
2441 << convert<string>(language_global_options)
2446 case RC_LANGUAGE_USE_BABEL:
2447 if (ignore_system_lyxrc ||
2448 language_use_babel != system_lyxrc.language_use_babel) {
2449 os << "\\language_use_babel \""
2450 << convert<string>(language_use_babel)
2455 case RC_LANGUAGE_COMMAND_BEGIN:
2456 if (ignore_system_lyxrc ||
2457 language_command_begin
2458 != system_lyxrc.language_command_begin) {
2459 os << "\\language_command_begin \""
2460 << language_command_begin
2465 case RC_LANGUAGE_COMMAND_END:
2466 if (ignore_system_lyxrc ||
2467 language_command_end
2468 != system_lyxrc.language_command_end) {
2469 os << "\\language_command_end \"" << language_command_end
2474 case RC_LANGUAGE_COMMAND_LOCAL:
2475 if (ignore_system_lyxrc ||
2476 language_command_local
2477 != system_lyxrc.language_command_local) {
2478 os << "\\language_command_local \""
2479 << language_command_local
2484 case RC_LANGUAGE_AUTO_BEGIN:
2485 if (ignore_system_lyxrc ||
2486 language_auto_begin != system_lyxrc.language_auto_begin) {
2487 os << "\\language_auto_begin "
2488 << convert<string>(language_auto_begin) << '\n';
2492 case RC_LANGUAGE_AUTO_END:
2493 if (ignore_system_lyxrc ||
2494 language_auto_end != system_lyxrc.language_auto_end) {
2495 os << "\\language_auto_end "
2496 << convert<string>(language_auto_end) << '\n';
2500 case RC_MARK_FOREIGN_LANGUAGE:
2501 if (ignore_system_lyxrc ||
2502 mark_foreign_language
2503 != system_lyxrc.mark_foreign_language) {
2504 os << "\\mark_foreign_language " <<
2505 convert<string>(mark_foreign_language) << '\n';
2511 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2514 case RC_AUTO_NUMBER:
2515 if (ignore_system_lyxrc ||
2516 auto_number != system_lyxrc.auto_number) {
2517 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2521 case RC_DEFAULT_LANGUAGE:
2522 if (ignore_system_lyxrc ||
2523 default_language != system_lyxrc.default_language) {
2524 os << "\\default_language " << default_language << '\n';
2530 << "# FORMATS SECTION ##########################\n"
2534 // New/modified formats
2535 for (Formats::const_iterator cit = formats.begin();
2536 cit != formats.end(); ++cit) {
2537 Format const * format =
2538 system_formats.getFormat(cit->name());
2540 format->extension() != cit->extension() ||
2541 format->prettyname() != cit->prettyname() ||
2542 format->shortcut() != cit->shortcut() ||
2543 format->viewer() != cit->viewer() ||
2544 format->editor() != cit->editor() ||
2545 format->documentFormat() != cit->documentFormat() ||
2546 format->vectorFormat() != cit->vectorFormat()) {
2547 os << "\\format \"" << cit->name() << "\" \""
2548 << cit->extension() << "\" \""
2549 << cit->prettyname() << "\" \""
2550 << cit->shortcut() << "\" \""
2551 << cit->viewer() << "\" \""
2552 << cit->editor() << "\" \"";
2553 vector<string> flags;
2554 if (cit->documentFormat())
2555 flags.push_back("document");
2556 if (cit->vectorFormat())
2557 flags.push_back("vector");
2558 os << getStringFromVector(flags);
2563 // Look for deleted formats
2564 for (Formats::const_iterator cit = system_formats.begin();
2565 cit != system_formats.end(); ++cit)
2566 if (!formats.getFormat(cit->name()))
2567 os << "\\format \"" << cit->name()
2568 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2577 << "# CONVERTERS SECTION ##########################\n"
2581 // Look for new converters
2582 for (Converters::const_iterator cit = theConverters().begin();
2583 cit != theConverters().end(); ++cit) {
2584 Converter const * converter =
2585 theSystemConverters().getConverter(cit->from,
2588 converter->command != cit->command ||
2589 converter->flags != cit->flags)
2590 os << "\\converter \"" << cit->from << "\" \""
2591 << cit->to << "\" \""
2592 << cit->command << "\" \""
2593 << cit->flags << "\"\n";
2596 // New/modifed converters
2597 for (Converters::const_iterator cit = theSystemConverters().begin();
2598 cit != theSystemConverters().end(); ++cit)
2599 if (!theConverters().getConverter(cit->from, cit->to))
2600 os << "\\converter \"" << cit->from
2601 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2608 << "# COPIERS SECTION ##########################\n"
2611 // Look for new movers
2612 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2613 Movers::const_iterator const sysend = theSystemMovers().end();
2614 Movers::const_iterator it = theMovers().begin();
2615 Movers::const_iterator end = theMovers().end();
2617 for (; it != end; ++it) {
2618 Movers::const_iterator const sysit =
2619 find_if(sysbegin, sysend, SameMover(*it));
2620 if (sysit == sysend) {
2621 string const & fmt = it->first;
2622 string const & command =
2623 it->second.command();
2625 os << "\\copier " << fmt
2626 << " \"" << command << "\"\n";
2632 // We don't actually delete SpecialisedMover(s) from the
2633 // map, just clear their 'command', so there's no need
2634 // to test for anything else.
2642 string const LyXRC::getDescription(LyXRCTags tag)
2647 case RC_ACCEPT_COMPOUND:
2648 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2652 case RC_USE_ALT_LANG:
2653 str = _("Specify an alternate language. The default is to use the language of the document.");
2656 case RC_PLAINTEXT_ROFF_COMMAND:
2657 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.");
2660 case RC_PLAINTEXT_LINELEN:
2661 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.");
2664 case RC_AUTOREGIONDELETE:
2665 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2668 case RC_AUTORESET_OPTIONS:
2669 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2673 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2676 case RC_AUTO_NUMBER:
2679 case RC_BACKUPDIR_PATH:
2680 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.");
2683 case RC_BIBTEX_COMMAND:
2684 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2688 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2691 case RC_CHECKLASTFILES:
2692 str = _("Select to check whether the lastfiles still exist.");
2695 case RC_CHKTEX_COMMAND:
2696 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2705 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2706 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.");
2709 case RC_SHOW_MACRO_LABEL:
2710 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2713 case RC_CUSTOM_EXPORT_COMMAND:
2716 case RC_CUSTOM_EXPORT_FORMAT:
2719 case RC_DATE_INSERT_FORMAT:
2720 //xgettext:no-c-format
2721 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2725 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2728 case RC_DEFAULT_LANGUAGE:
2729 str = _("New documents will be assigned this language.");
2732 case RC_DEFAULT_PAPERSIZE:
2733 str = _("Specify the default paper size.");
2736 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2737 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2740 case RC_DISPLAY_GRAPHICS:
2741 str = _("Select how LyX will display any graphics.");
2744 case RC_DOCUMENTPATH:
2745 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2749 case RC_USE_ESC_CHARS:
2750 str = _("Specify additional chars that can be part of a word.");
2753 case RC_EXAMPLEPATH:
2754 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2757 case RC_FONT_ENCODING:
2758 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2764 case RC_INDEX_COMMAND:
2765 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\".");
2772 case RC_KBMAP_PRIMARY:
2773 case RC_KBMAP_SECONDARY:
2774 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.");
2777 case RC_LABEL_INIT_LENGTH:
2778 str = _("Maximum number of words in the initialization string for a new label");
2781 case RC_LANGUAGE_AUTO_BEGIN:
2782 str = _("Select if a language switching command is needed at the beginning of the document.");
2785 case RC_LANGUAGE_AUTO_END:
2786 str = _("Select if a language switching command is needed at the end of the document.");
2789 case RC_LANGUAGE_COMMAND_BEGIN:
2790 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.");
2793 case RC_LANGUAGE_COMMAND_END:
2794 str = _("The LaTeX command for changing back to the language of the document.");
2797 case RC_LANGUAGE_COMMAND_LOCAL:
2798 str = _("The LaTeX command for local changing of the language.");
2801 case RC_LANGUAGE_GLOBAL_OPTIONS:
2802 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2805 case RC_LANGUAGE_PACKAGE:
2806 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2809 case RC_LANGUAGE_USE_BABEL:
2810 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2813 case RC_USELASTFILEPOS:
2814 str = _("De-select if you do not want LyX to scroll to saved position.");
2817 case RC_LOADSESSION:
2818 str = _("De-select to prevent loading files opened from the last LyX session.");
2821 case RC_MAKE_BACKUP:
2822 str = _("De-select if you don't want LyX to create backup files.");
2825 case RC_MARK_FOREIGN_LANGUAGE:
2826 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2829 case RC_MOUSE_WHEEL_SPEED:
2830 str = bformat(_("The scrolling speed of the mouse wheel."),
2834 case RC_COMPLETION_POPUP_DELAY:
2835 str = _("The completion popup delay.");
2838 case RC_COMPLETION_POPUP_MATH:
2839 str = _("Select to display the completion popup in math mode.");
2842 case RC_COMPLETION_POPUP_TEXT:
2843 str = _("Select to display the completion popup in text mode.");
2846 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2847 str = _("Show the completion popup without delay after non-unique completion attempt.");
2850 case RC_COMPLETION_POPUP_TEXT:
2851 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2854 case RC_COMPLETION_POPUP_DELAY:
2855 str = _("The inline completion delay.");
2858 case RC_COMPLETION_INLINE_MATH:
2859 str = _("Select to display the inline completion in math mode.");
2862 case RC_COMPLETION_INLINE_TEXT:
2863 str = _("Select to display the inline completion in text mode.");
2866 case RC_COMPLETION_INLINE_DOTS:
2867 str = _("Use \"...\" to shorten long completions.");
2870 case RC_NUMLASTFILES:
2871 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2875 case RC_PATH_PREFIX:
2876 str = _("Specify those directories which should be "
2877 "prepended to the PATH environment variable. "
2878 "Use the OS native format.");
2882 case RC_USE_PERS_DICT:
2883 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2887 str = _("Shows a typeset preview of things such as math");
2890 case RC_PREVIEW_HASHED_LABELS:
2891 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2894 case RC_PREVIEW_SCALE_FACTOR:
2895 str = _("Scale the preview size to suit.");
2898 case RC_PRINTCOLLCOPIESFLAG:
2899 str = _("The option for specifying whether the copies should be collated.");
2902 case RC_PRINTCOPIESFLAG:
2903 str = _("The option for specifying the number of copies to print.");
2907 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2910 case RC_PRINTEVENPAGEFLAG:
2911 str = _("The option to print only even pages.");
2914 case RC_PRINTEXSTRAOPTIONS:
2915 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2918 case RC_PRINTFILEEXTENSION:
2919 str = _("Extension of printer program output file. Usually \".ps\".");
2922 case RC_PRINTLANDSCAPEFLAG:
2923 str = _("The option to print out in landscape.");
2926 case RC_PRINTODDPAGEFLAG:
2927 str = _("The option to print only odd pages.");
2930 case RC_PRINTPAGERANGEFLAG:
2931 str = _("The option for specifying a comma-separated list of pages to print.");
2934 case RC_PRINTPAPERDIMENSIONFLAG:
2935 str = _("Option to specify the dimensions of the print paper.");
2938 case RC_PRINTPAPERFLAG:
2939 str = _("The option to specify paper type.");
2942 case RC_PRINTREVERSEFLAG:
2943 str = _("The option to reverse the order of the pages printed.");
2946 case RC_PRINTSPOOL_COMMAND:
2947 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.");
2950 case RC_PRINTSPOOL_PRINTERPREFIX:
2951 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.");
2954 case RC_PRINTTOFILE:
2955 str = _("Option to pass to the print program to print to a file.");
2958 case RC_PRINTTOPRINTER:
2959 str = _("Option to pass to the print program to print on a specific printer.");
2962 case RC_PRINT_ADAPTOUTPUT:
2963 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2966 case RC_PRINT_COMMAND:
2967 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2970 case RC_RTL_SUPPORT:
2971 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2974 case RC_VISUAL_CURSOR:
2975 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2979 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2982 case RC_SCREEN_FONT_ROMAN:
2983 case RC_SCREEN_FONT_SANS:
2984 case RC_SCREEN_FONT_TYPEWRITER:
2985 str = _("The screen fonts used to display the text while editing.");
2988 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2989 case RC_SCREEN_FONT_SANS_FOUNDRY:
2990 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2993 case RC_SCREEN_FONT_SCALABLE:
2994 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.");
2997 case RC_SCREEN_FONT_SIZES:
2998 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3001 case RC_SCREEN_ZOOM:
3002 //xgettext:no-c-format
3003 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3006 case RC_GEOMETRY_SESSION:
3007 str = _("Allow session manager to save and restore windows geometry.");
3011 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3017 case RC_SHOW_BANNER:
3018 str = _("De-select if you don't want the startup banner.");
3021 case RC_SPELL_COMMAND:
3022 str = _("What command runs the spellchecker?");
3025 case RC_TEMPDIRPATH:
3026 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3029 case RC_TEMPLATEPATH:
3030 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3033 case RC_TEX_ALLOWS_SPACES:
3036 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3040 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3052 case RC_USE_INP_ENC:
3053 str = _("Specify whether to pass the -T input encoding option to ispell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
3056 case RC_USE_TOOLTIP:
3057 str = _("Enable the automatic appearance of tool tips in the work area.");
3060 case RC_USE_PIXMAP_CACHE:
3061 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3064 case RC_USE_SPELL_LIB:
3067 case RC_VIEWDVI_PAPEROPTION:
3068 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3083 // The global instance
3086 // The global copy of the system lyxrc entries (everything except preferences)