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 LexerKeyword 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 { "\\env_gui_language", LyXRC::RC_ENV_GUI_LANGUAGE },
89 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
90 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
91 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
92 { "\\format", LyXRC::RC_FORMAT },
93 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
94 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
95 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
96 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
97 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
98 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
99 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
100 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
101 { "\\input", LyXRC::RC_INPUT },
102 { "\\kbmap", LyXRC::RC_KBMAP },
103 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
104 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
105 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
106 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
107 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
108 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
109 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
110 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
111 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
112 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
113 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
114 { "\\load_session", LyXRC::RC_LOADSESSION },
115 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
116 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
117 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
118 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
119 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
120 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
121 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
122 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
123 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
124 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
125 { "\\preview", LyXRC::RC_PREVIEW },
126 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
127 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
128 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
129 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
130 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
131 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
132 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
133 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
134 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
135 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
136 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
137 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
138 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
139 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
140 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
141 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
142 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
143 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
144 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
145 { "\\printer", LyXRC::RC_PRINTER },
146 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
147 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
148 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
149 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
150 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
151 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
152 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
153 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
154 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
155 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
156 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
157 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
158 { "\\set_color", LyXRC::RC_SET_COLOR },
159 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
160 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
161 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
162 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
163 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
164 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
165 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
166 { "\\ui_file", LyXRC::RC_UIFILE },
167 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
168 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
169 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
170 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
171 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
172 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
173 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
174 // compatibility with versions older than 1.4.0 only
175 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
176 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
177 // compatibility with versions older than 1.4.0 only
178 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
179 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
180 { "\\user_email", LyXRC::RC_USER_EMAIL },
181 { "\\user_name", LyXRC::RC_USER_NAME },
182 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
183 // compatibility with versions older than 1.4.0 only
184 { "\\viewer", LyXRC::RC_VIEWER},
185 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
188 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
199 void LyXRC::setDefaults()
202 def_file = "default";
204 // Get printer from the environment. If fail, use default "",
205 // assuming that everything is set up correctly.
206 printer = getEnv("PRINTER");
207 print_adapt_output = false;
208 print_command = "dvips";
209 print_evenpage_flag = "-B";
210 print_oddpage_flag = "-A";
211 print_pagerange_flag = "-pp";
212 print_copies_flag = "-c";
213 print_collcopies_flag = "-C";
214 print_reverse_flag = "-r";
215 print_landscape_flag = "-t landscape";
216 print_to_printer = "-P";
217 print_to_file = "-o ";
218 print_file_extension = ".ps";
219 print_paper_flag = "-t";
220 print_paper_dimension_flag = "-T";
221 document_path.erase();
222 view_dvi_paper_option.erase();
223 default_papersize = PAPER_DEFAULT;
224 custom_export_format = "ps";
225 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
226 bibtex_command = "bibtex";
228 index_command = "makeindex -c -q";
230 // Because a screen typically is wider than a piece of paper:
232 allow_geometry_session = true;
233 // Default LaTeX font size:
234 font_sizes[FONT_SIZE_TINY] = "5.0";
235 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
236 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
237 font_sizes[FONT_SIZE_SMALL] = "9.0";
238 font_sizes[FONT_SIZE_NORMAL] = "10.0";
239 font_sizes[FONT_SIZE_LARGE] = "12.0";
240 font_sizes[FONT_SIZE_LARGER] = "14.4";
241 font_sizes[FONT_SIZE_LARGEST] = "17.26";
242 font_sizes[FONT_SIZE_HUGE] = "20.74";
243 font_sizes[FONT_SIZE_HUGER] = "24.88";
244 use_scalable_fonts = true;
245 roman_font_name = "";
247 typewriter_font_name = "";
249 auto_region_delete = true;
250 auto_reset_options = false;
251 plaintext_linelen = 65;
252 mouse_wheel_speed = 1.0;
253 num_lastfiles = maxlastfiles;
254 check_lastfiles = true;
255 use_lastfilepos = true;
256 load_session = false;
258 backupdir_path.erase();
259 display_graphics = true;
260 // Spellchecker settings:
261 use_spell_lib = true;
262 isp_command = "ispell";
263 isp_accept_compound = false;
264 isp_use_input_encoding = false;
265 isp_use_alt_lang = false;
266 isp_use_pers_dict = false;
267 isp_use_esc_chars = false;
270 visual_cursor = false;
272 mark_foreign_language = true;
273 language_auto_begin = true;
274 language_auto_end = true;
275 language_global_options = true;
276 language_use_babel = true;
277 language_package = "\\usepackage{babel}";
278 language_command_begin = "\\selectlanguage{$$lang}";
279 language_command_local = "\\foreignlanguage{$$lang}{";
280 sort_layouts = false;
281 group_layouts = true;
282 default_language = "english";
283 env_gui_language = true;
284 gui_language = string();
286 windows_style_tex_paths = false;
287 tex_allows_spaces = false;
288 date_insert_format = "%x";
289 cursor_follows_scrollbar = false;
290 macro_edit_style = MACRO_EDIT_INLINE_BOX;
291 dialogs_iconify_with_main = false;
292 label_init_length = 3;
293 preview = PREVIEW_OFF;
294 preview_hashed_labels = false;
295 preview_scale_factor = "0.9";
296 use_converter_cache = true;
298 use_pixmap_cache = false;
299 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
300 user_name = to_utf8(support::user_name());
301 user_email = to_utf8(support::user_email());
302 open_buffers_in_tabs = true;
304 // Fullscreen settings
305 full_screen_limit = false;
306 full_screen_toolbars = true;
307 full_screen_tabbar = true;
308 full_screen_scrollbar = true;
309 full_screen_width = 700;
311 completion_cursor_text = true;
312 completion_popup_math = true;
313 completion_popup_text = false;
314 completion_popup_delay = 2.0;
315 completion_popup_after_complete = true;
316 completion_inline_math = true;
317 completion_inline_text = false;
318 completion_inline_dots = -1;
319 completion_inline_delay = 0.2;
325 void oldFontFormat(string & family, string & foundry)
327 if (family.empty() || family[0] != '-')
329 foundry = token(family, '-', 1);
330 family = token(family, '-', 2);
338 int LyXRC::read(FileName const & filename)
340 Lexer lexrc(lyxrcTags);
341 if (lyxerr.debugging(Debug::PARSER))
342 lexrc.printTable(lyxerr);
344 lexrc.setFile(filename);
348 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
354 int LyXRC::read(istream & is)
356 Lexer lexrc(lyxrcTags);
357 if (lyxerr.debugging(Debug::PARSER))
358 lexrc.printTable(lyxerr);
364 LYXERR(Debug::LYXRC, "Reading istream...");
370 int LyXRC::read(Lexer & lexrc)
372 if (!lexrc.isOK()) return -2;
374 while (lexrc.isOK()) {
375 // By using two switches we take advantage of the compiler
376 // telling us if we have missed a LyXRCTags element in
377 // the second switch.
378 // Note that this also shows a problem with Lexer since it
379 // helps us avoid taking advantage of the strictness of the
382 int le = lexrc.lex();
384 case Lexer::LEX_UNDEF:
385 lexrc.printError("Unknown tag `$$Token'");
387 case Lexer::LEX_FEOF:
391 switch (static_cast<LyXRCTags>(le)) {
392 case RC_INPUT: // Include file
395 libFileSearch(string(),
398 lexrc.printError("Error reading "
399 "included file: " + tmp.absFilename());
405 bind_file = os::internal_path(lexrc.getString());
411 def_file = os::internal_path(lexrc.getString());
417 ui_file = os::internal_path(lexrc.getString());
421 case RC_AUTORESET_OPTIONS:
422 lexrc >> auto_reset_options;
425 case RC_DISPLAY_GRAPHICS:
427 display_graphics = lexrc.getString() == "true";
430 case RC_TEX_EXPECTS_WINDOWS_PATHS:
431 lexrc >> windows_style_tex_paths;
434 case RC_TEX_ALLOWS_SPACES:
435 lexrc >> tex_allows_spaces;
442 case RC_KBMAP_PRIMARY:
444 string const kmap(os::internal_path(lexrc.getString()));
447 } else if (!libFileSearch("kbd", kmap,
449 primary_kbmap = kmap;
451 lexrc.printError("LyX: Keymap `$$Token' not found");
456 case RC_KBMAP_SECONDARY:
458 string const kmap(os::internal_path(lexrc.getString()));
461 } else if (!libFileSearch("kbd", kmap,
463 secondary_kbmap = kmap;
465 lexrc.printError("LyX: Keymap `$$Token' not found");
470 case RC_FONT_ENCODING:
478 case RC_PRINT_COMMAND:
479 if (lexrc.next(true)) {
480 print_command = lexrc.getString();
484 case RC_PRINTEVENPAGEFLAG:
485 lexrc >> print_evenpage_flag;
488 case RC_PRINTODDPAGEFLAG:
489 lexrc >> print_oddpage_flag;
492 case RC_PRINTPAGERANGEFLAG:
493 lexrc >> print_pagerange_flag;
496 case RC_PRINTCOPIESFLAG:
497 lexrc >> print_copies_flag;
500 case RC_PRINTCOLLCOPIESFLAG:
501 lexrc >> print_collcopies_flag;
504 case RC_PRINTREVERSEFLAG:
505 lexrc >> print_reverse_flag;
508 case RC_PRINTLANDSCAPEFLAG:
509 lexrc >> print_landscape_flag;
512 case RC_PRINTTOPRINTER:
513 lexrc >> print_to_printer;
516 case RC_PRINT_ADAPTOUTPUT:
517 lexrc >> print_adapt_output;
522 print_to_file = os::internal_path(lexrc.getString());
526 case RC_PRINTFILEEXTENSION:
527 lexrc >> print_file_extension;
530 case RC_PRINTEXSTRAOPTIONS:
531 lexrc >> print_extra_options;
534 case RC_PRINTSPOOL_COMMAND:
535 if (lexrc.next(true)) {
536 print_spool_command = lexrc.getString();
540 case RC_PRINTSPOOL_PRINTERPREFIX:
541 lexrc >> print_spool_printerprefix;
544 case RC_PRINTPAPERDIMENSIONFLAG:
545 lexrc >> print_paper_dimension_flag;
548 case RC_PRINTPAPERFLAG:
549 lexrc >> print_paper_flag;
552 case RC_CUSTOM_EXPORT_COMMAND:
553 lexrc >> custom_export_command;
556 case RC_CUSTOM_EXPORT_FORMAT:
557 lexrc >> custom_export_format;
560 case RC_DEFAULT_PAPERSIZE:
562 string const size = ascii_lowercase(lexrc.getString());
563 if (size == "usletter")
564 default_papersize = PAPER_USLETTER;
565 else if (size == "legal")
566 default_papersize = PAPER_USLEGAL;
567 else if (size == "executive")
568 default_papersize = PAPER_USEXECUTIVE;
569 else if (size == "a3")
570 default_papersize = PAPER_A3;
571 else if (size == "a4")
572 default_papersize = PAPER_A4;
573 else if (size == "a5")
574 default_papersize = PAPER_A5;
575 else if (size == "b5")
576 default_papersize = PAPER_B5;
577 else if (size == "default")
578 default_papersize = PAPER_DEFAULT;
582 case RC_VIEWDVI_PAPEROPTION:
584 view_dvi_paper_option = lexrc.getString();
586 view_dvi_paper_option.erase();
589 case RC_CHKTEX_COMMAND:
590 if (lexrc.next(true)) {
591 chktex_command = lexrc.getString();
595 case RC_BIBTEX_COMMAND:
596 if (lexrc.next(true)) {
597 bibtex_command = lexrc.getString();
601 case RC_INDEX_COMMAND:
602 if (lexrc.next(true)) {
603 index_command = lexrc.getString();
615 case RC_GEOMETRY_SESSION:
616 lexrc >> allow_geometry_session;
619 case RC_SCREEN_FONT_SIZES:
620 lexrc >> font_sizes[FONT_SIZE_TINY];
621 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
622 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
623 lexrc >> font_sizes[FONT_SIZE_SMALL];
624 lexrc >> font_sizes[FONT_SIZE_NORMAL];
625 lexrc >> font_sizes[FONT_SIZE_LARGE];
626 lexrc >> font_sizes[FONT_SIZE_LARGER];
627 lexrc >> font_sizes[FONT_SIZE_LARGEST];
628 lexrc >> font_sizes[FONT_SIZE_HUGE];
629 lexrc >> font_sizes[FONT_SIZE_HUGER];
632 case RC_SCREEN_FONT_SCALABLE:
633 lexrc >> use_scalable_fonts;
640 case RC_DOCUMENTPATH:
642 document_path = os::internal_path(lexrc.getString());
643 document_path = expandPath(document_path);
649 example_path = os::internal_path(lexrc.getString());
650 example_path = expandPath(example_path);
654 case RC_TEMPLATEPATH:
656 template_path = os::internal_path(lexrc.getString());
657 template_path = expandPath(template_path);
663 tempdir_path = os::internal_path(lexrc.getString());
664 tempdir_path = expandPath(tempdir_path);
670 LYXERR0("Ignoring obsolete use_tempdir flag.");
673 case RC_USELASTFILEPOS:
674 lexrc >> use_lastfilepos;
678 lexrc >> load_session;
681 case RC_MOUSE_WHEEL_SPEED:
682 lexrc >> mouse_wheel_speed;
685 case RC_COMPLETION_INLINE_DELAY:
686 lexrc >> completion_inline_delay;
689 case RC_COMPLETION_INLINE_MATH:
690 lexrc >> completion_inline_math;
693 case RC_COMPLETION_INLINE_TEXT:
694 lexrc >> completion_inline_text;
697 case RC_COMPLETION_INLINE_DOTS:
698 lexrc >> completion_inline_dots;
701 case RC_COMPLETION_POPUP_DELAY:
702 lexrc >> completion_popup_delay;
705 case RC_COMPLETION_POPUP_MATH:
706 lexrc >> completion_popup_math;
709 case RC_COMPLETION_POPUP_TEXT:
710 lexrc >> completion_popup_text;
713 case RC_COMPLETION_CURSOR_TEXT:
714 lexrc >> completion_cursor_text;
717 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
718 lexrc >> completion_popup_after_complete;
721 case RC_NUMLASTFILES:
722 lexrc >> num_lastfiles;
725 case RC_CHECKLASTFILES:
726 lexrc >> check_lastfiles;
729 case RC_SCREEN_FONT_ROMAN:
731 roman_font_name = lexrc.getString();
732 oldFontFormat(roman_font_name,
737 case RC_SCREEN_FONT_SANS:
739 sans_font_name = lexrc.getString();
740 oldFontFormat(sans_font_name, sans_font_foundry);
744 case RC_SCREEN_FONT_TYPEWRITER:
746 typewriter_font_name = lexrc.getString();
747 oldFontFormat(typewriter_font_name,
748 typewriter_font_foundry);
752 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
753 lexrc >> roman_font_foundry;
756 case RC_SCREEN_FONT_SANS_FOUNDRY:
757 lexrc >> sans_font_foundry;
760 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
761 lexrc >> typewriter_font_foundry;
766 lexrc.printError("Missing color tag.");
769 string lyx_name = lexrc.getString();
772 lexrc.printError("Missing color name for color: `$$Token'");
775 string x11_name = lexrc.getString();
777 ColorCode const col =
778 lcolor.getFromLyXName(lyx_name);
779 if (col == Color_none ||
780 col == Color_inherit ||
784 if (!lcolor.setColor(col, x11_name))
785 LYXERR0("Bad lyxrc set_color for " << lyx_name);
789 case RC_AUTOREGIONDELETE:
790 // Auto region delete defaults to true
791 lexrc >> auto_region_delete;
796 lyxpipes = os::internal_path(lexrc.getString());
797 lyxpipes = expandPath(lyxpipes);
801 case RC_CURSOR_FOLLOWS_SCROLLBAR:
802 lexrc >> cursor_follows_scrollbar;
805 case RC_MACRO_EDIT_STYLE:
807 switch (lexrc.getInteger()) {
808 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
809 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
810 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
815 case RC_DIALOGS_ICONIFY_WITH_MAIN:
816 lexrc >> dialogs_iconify_with_main;
819 case RC_PLAINTEXT_ROFF_COMMAND:
820 if (lexrc.next(true)) {
821 plaintext_roff_command = lexrc.getString();
824 case RC_PLAINTEXT_LINELEN:
825 lexrc >> plaintext_linelen;
827 // Spellchecker settings:
828 case RC_USE_SPELL_LIB:
829 lexrc >> use_spell_lib;
831 case RC_SPELL_COMMAND:
832 if (lexrc.next(true))
833 isp_command = lexrc.getString();
835 case RC_ACCEPT_COMPOUND:
836 lexrc >> isp_accept_compound;
839 lexrc >> isp_use_input_encoding;
841 case RC_USE_ALT_LANG:
842 lexrc >> isp_use_alt_lang;
844 case RC_USE_PERS_DICT:
845 lexrc >> isp_use_pers_dict;
848 lexrc >> use_tooltip;
850 case RC_USE_PIXMAP_CACHE:
851 lexrc >> use_pixmap_cache;
853 case RC_USE_ESC_CHARS:
854 lexrc >> isp_use_esc_chars;
857 lexrc >> isp_alt_lang;
861 isp_pers_dict = os::internal_path(lexrc.getString());
864 lexrc >> isp_esc_chars;
867 lexrc >> make_backup;
869 case RC_BACKUPDIR_PATH:
871 backupdir_path = os::internal_path(lexrc.getString());
872 backupdir_path = expandPath(backupdir_path);
875 case RC_DATE_INSERT_FORMAT:
876 lexrc >> date_insert_format;
878 case RC_LANGUAGE_PACKAGE:
879 lexrc >> language_package;
881 case RC_LANGUAGE_AUTO_BEGIN:
882 lexrc >> language_auto_begin;
884 case RC_LANGUAGE_AUTO_END:
885 lexrc >> language_auto_end;
887 case RC_LANGUAGE_GLOBAL_OPTIONS:
888 lexrc >> language_global_options;
890 case RC_LANGUAGE_USE_BABEL:
891 lexrc >> language_use_babel;
893 case RC_LANGUAGE_COMMAND_BEGIN:
894 lexrc >> language_command_begin;
896 case RC_LANGUAGE_COMMAND_END:
897 lexrc >> language_command_end;
899 case RC_LANGUAGE_COMMAND_LOCAL:
900 lexrc >> language_command_local;
903 lexrc >> rtl_support;
905 case RC_VISUAL_CURSOR:
906 lexrc >> visual_cursor;
909 lexrc >> auto_number;
911 case RC_MARK_FOREIGN_LANGUAGE:
912 lexrc >> mark_foreign_language;
918 fmt = lexrc.getString();
919 if (lexrc.next(true))
920 command = lexrc.getString();
921 setMover(fmt, command);
926 string from, to, command, flags;
928 from = lexrc.getString();
930 to = lexrc.getString();
931 if (lexrc.next(true))
932 command = lexrc.getString();
934 flags = lexrc.getString();
936 theConverters().erase(from, to);
938 theConverters().add(from, to, command, flags);
941 // compatibility with versions older than 1.4.0 only
943 string format, command;
944 lexrc >> format >> command;
945 formats.setViewer(format, command);
949 string format, extension, prettyname, shortcut;
950 lexrc >> format >> extension >> prettyname >> shortcut;
951 string viewer, editor;
952 if (lexrc.next(true))
953 viewer = lexrc.getString();
954 if (lexrc.next(true))
955 editor = lexrc.getString();
957 // Hack to ensure compatibility with versions older
959 int le = lexrc.lex();
960 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
961 flags = lexrc.getString();
962 if (le != Lexer::LEX_DATA) {
963 // We have got a known token.
964 // Therefore this is an old style
965 // format definition without
967 lexrc.pushToken(flags);
971 int flgs = Format::none;
972 while (!flags.empty()) {
974 flags = split(flags, flag, ',');
975 if (flag == "document")
976 flgs |= Format::document;
977 else if (flag == "vector")
978 flgs |= Format::vector;
980 LYXERR0("Ignoring unknown flag `"
981 << flag << "' for format `"
984 if (prettyname.empty()) {
985 if (theConverters().formatIsUsed(format))
986 LYXERR0("Can't delete format " << format);
988 formats.erase(format);
990 formats.add(format, extension, prettyname,
991 shortcut, viewer, editor, flgs);
995 case RC_DEFAULT_LANGUAGE:
996 lexrc >> default_language;
999 case RC_ENV_GUI_LANGUAGE:
1000 lexrc >> env_gui_language;
1003 case RC_GUI_LANGUAGE:
1004 lexrc >> gui_language;
1007 case RC_LABEL_INIT_LENGTH:
1008 lexrc >> label_init_length;
1011 case RC_SHOW_BANNER:
1012 lexrc >> show_banner;
1017 string const tmp = lexrc.getString();
1018 if (tmp == "true" || tmp == "on")
1019 preview = PREVIEW_ON;
1020 else if (tmp == "no_math")
1021 preview = PREVIEW_NO_MATH;
1023 preview = PREVIEW_OFF;
1024 if (tmp != "false" && tmp != "off")
1025 LYXERR0("Unrecognized preview status \""
1031 case RC_PREVIEW_HASHED_LABELS:
1032 lexrc >> preview_hashed_labels;
1035 case RC_PREVIEW_SCALE_FACTOR:
1036 lexrc >> preview_scale_factor;
1043 lexrc >> user_email;
1046 case RC_PATH_PREFIX:
1047 lexrc >> path_prefix;
1050 case RC_USE_CONVERTER_CACHE:
1051 lexrc >> use_converter_cache;
1053 case RC_CONVERTER_CACHE_MAXAGE:
1054 lexrc >> converter_cache_maxage;
1057 case RC_SORT_LAYOUTS:
1058 lexrc >> sort_layouts;
1060 case RC_GROUP_LAYOUTS:
1061 lexrc >> group_layouts;
1063 case RC_FULL_SCREEN_LIMIT:
1064 lexrc >> full_screen_limit;
1066 case RC_FULL_SCREEN_TOOLBARS:
1067 lexrc >> full_screen_toolbars;
1069 case RC_FULL_SCREEN_SCROLLBAR:
1070 lexrc >> full_screen_scrollbar;
1072 case RC_FULL_SCREEN_TABBAR:
1073 lexrc >> full_screen_tabbar;
1075 case RC_FULL_SCREEN_WIDTH:
1076 lexrc >> full_screen_width;
1078 case RC_OPEN_BUFFERS_IN_TABS:
1079 lexrc >> open_buffers_in_tabs;
1083 break; // this is just a dummy
1087 /// Update converters data-structures
1088 theConverters().update(formats);
1089 theConverters().buildGraph();
1095 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1097 ofstream ofs(filename.toFilesystemEncoding().c_str());
1099 write(ofs, ignore_system_lyxrc);
1103 void LyXRC::print() const
1105 if (lyxerr.debugging())
1106 write(lyxerr, false);
1114 typedef pair<string, SpecialisedMover> Data;
1116 SameMover(Data const & comparison)
1117 : comparison_(comparison) {}
1119 bool operator()(Data const & data) const
1121 return data.first == comparison_.first &&
1122 data.second.command() == comparison_.second.command();
1132 // Escape \ and " so that LyXLex can read the string later
1133 string escapeCommand(string const & str) {
1134 return subst(subst(str , "\\", "\\\\"),
1141 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1143 LyXRCTags tag = RC_LAST;
1145 if (!name.empty()) {
1146 for (int i = 0; i != lyxrcCount; ++i)
1147 if ("\\" + name == lyxrcTags[i].tag)
1148 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1152 os << "# This file is written by LyX, if you want to make your own\n"
1153 << "# modifications you should do them from inside LyX and save\n"
1156 // Why the switch you might ask. It is a trick to ensure that all
1157 // the elements in the LyXRCTags enum are handled. As you can see
1158 // there are no breaks at all. So it is just a huge fall-through.
1159 // The nice thing is that we will get a warning from the compiler
1160 // if we forget an element.
1164 // input/include files are not done here
1166 if (ignore_system_lyxrc ||
1167 bind_file != system_lyxrc.bind_file) {
1168 string const path = os::external_path(bind_file);
1169 os << "\\bind_file \"" << path << "\"\n";
1175 if (ignore_system_lyxrc ||
1176 def_file != system_lyxrc.def_file) {
1177 string const path = os::external_path(def_file);
1178 os << "\\def_file \"" << path << "\"\n";
1187 << "# MISC SECTION ######################################\n"
1189 // bind files are not done here.
1191 case RC_PATH_PREFIX:
1192 if (ignore_system_lyxrc ||
1193 path_prefix != system_lyxrc.path_prefix) {
1194 os << "\\path_prefix \"" << path_prefix << "\"\n";
1199 if (ignore_system_lyxrc ||
1200 ui_file != system_lyxrc.ui_file) {
1201 string const path = os::external_path(ui_file);
1202 os << "\\ui_file \"" << path << "\"\n";
1206 case RC_AUTOREGIONDELETE:
1207 if (ignore_system_lyxrc ||
1208 auto_region_delete != system_lyxrc.auto_region_delete) {
1209 os << "# Set to false to inhibit automatic replacement of\n"
1210 << "# the current selection.\n"
1211 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1216 case RC_AUTORESET_OPTIONS:
1217 if (ignore_system_lyxrc ||
1218 auto_reset_options != system_lyxrc.auto_reset_options) {
1219 os << "# Set to false to inhibit automatic reset of\n"
1220 << "# the class options to defaults on class change.\n"
1221 << "\\auto_reset_options "
1222 << convert<string>(auto_reset_options)
1228 if (ignore_system_lyxrc ||
1229 autosave != system_lyxrc.autosave) {
1230 os << "# The time interval between auto-saves in seconds.\n"
1231 << "\\autosave " << autosave << '\n';
1235 case RC_DISPLAY_GRAPHICS:
1236 if (ignore_system_lyxrc ||
1237 display_graphics != system_lyxrc.display_graphics) {
1238 os << "# Display graphics within LyX\n"
1240 << "\\display_graphics "
1241 << (display_graphics ? "true" : "false")
1246 case RC_SORT_LAYOUTS:
1247 if (ignore_system_lyxrc ||
1248 sort_layouts != system_lyxrc.sort_layouts) {
1249 os << "# Sort layouts alphabetically.\n"
1250 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1254 case RC_GROUP_LAYOUTS:
1255 if (ignore_system_lyxrc ||
1256 group_layouts != system_lyxrc.group_layouts) {
1257 os << "# Group layouts by their category.\n"
1258 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1262 case RC_VIEWDVI_PAPEROPTION:
1263 if (ignore_system_lyxrc ||
1264 view_dvi_paper_option
1265 != system_lyxrc.view_dvi_paper_option) {
1266 os << "# Options used to specify paper size to the\n"
1267 << "# view_dvi_command (e.g. -paper)\n"
1268 << "\\view_dvi_paper_option \""
1269 << view_dvi_paper_option << "\"\n";
1273 case RC_DEFAULT_PAPERSIZE:
1274 if (ignore_system_lyxrc ||
1275 default_papersize != system_lyxrc.default_papersize) {
1276 os << "# The default papersize to use.\n"
1277 << "\\default_papersize \"";
1278 switch (default_papersize) {
1280 os << "default"; break;
1281 case PAPER_USLETTER:
1282 os << "usletter"; break;
1284 os << "legal"; break;
1285 case PAPER_USEXECUTIVE:
1286 os << "executive"; break;
1297 case PAPER_B4: break;
1303 case RC_CHKTEX_COMMAND:
1304 if (ignore_system_lyxrc ||
1305 chktex_command != system_lyxrc.chktex_command) {
1306 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1310 case RC_BIBTEX_COMMAND:
1311 if (ignore_system_lyxrc ||
1312 bibtex_command != system_lyxrc.bibtex_command) {
1313 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1317 case RC_INDEX_COMMAND:
1318 if (ignore_system_lyxrc ||
1319 index_command != system_lyxrc.index_command) {
1320 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1324 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1325 if (ignore_system_lyxrc ||
1326 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1327 os << "\\tex_expects_windows_paths "
1328 << convert<string>(windows_style_tex_paths) << '\n';
1332 case RC_TEX_ALLOWS_SPACES:
1333 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1334 os << "\\tex_allows_spaces "
1335 << convert<string>(tex_allows_spaces) << '\n';
1340 if (ignore_system_lyxrc ||
1341 use_kbmap != system_lyxrc.use_kbmap) {
1342 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1346 case RC_KBMAP_PRIMARY:
1347 if (ignore_system_lyxrc ||
1348 primary_kbmap != system_lyxrc.primary_kbmap) {
1349 string const path = os::external_path(primary_kbmap);
1350 os << "\\kbmap_primary \"" << path << "\"\n";
1354 case RC_KBMAP_SECONDARY:
1355 if (ignore_system_lyxrc ||
1356 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1357 string const path = os::external_path(secondary_kbmap);
1358 os << "\\kbmap_secondary \"" << path << "\"\n";
1363 if (ignore_system_lyxrc ||
1364 lyxpipes != system_lyxrc.lyxpipes) {
1365 string const path = os::external_path(lyxpipes);
1366 os << "\\serverpipe \"" << path << "\"\n";
1370 case RC_DATE_INSERT_FORMAT:
1371 if (ignore_system_lyxrc ||
1372 date_insert_format != system_lyxrc.date_insert_format) {
1373 os << "\\date_insert_format \"" << date_insert_format
1378 case RC_LABEL_INIT_LENGTH:
1379 if (ignore_system_lyxrc ||
1380 label_init_length != system_lyxrc.label_init_length) {
1381 os << "\\label_init_length " << label_init_length
1388 os << "\\user_name \"" << user_name << "\"\n";
1393 os << "\\user_email \"" << user_email << "\"\n";
1397 case RC_SHOW_BANNER:
1398 if (ignore_system_lyxrc ||
1399 show_banner != system_lyxrc.show_banner) {
1400 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1406 if (ignore_system_lyxrc ||
1407 preview != system_lyxrc.preview) {
1413 case PREVIEW_NO_MATH:
1420 os << "\\preview " << status << '\n';
1425 case RC_PREVIEW_HASHED_LABELS:
1426 if (ignore_system_lyxrc ||
1427 preview_hashed_labels !=
1428 system_lyxrc.preview_hashed_labels) {
1429 os << "\\preview_hashed_labels "
1430 << convert<string>(preview_hashed_labels) << '\n';
1435 case RC_PREVIEW_SCALE_FACTOR:
1436 if (ignore_system_lyxrc ||
1437 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1438 os << "\\preview_scale_factor "
1439 << preview_scale_factor << '\n';
1444 case RC_USE_CONVERTER_CACHE:
1445 if (ignore_system_lyxrc ||
1446 use_converter_cache != system_lyxrc.use_converter_cache) {
1447 os << "\\use_converter_cache "
1448 << convert<string>(use_converter_cache) << '\n';
1453 case RC_CONVERTER_CACHE_MAXAGE:
1454 if (ignore_system_lyxrc ||
1455 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1456 os << "\\converter_cache_maxage "
1457 << converter_cache_maxage << '\n';
1463 << "# SCREEN & FONTS SECTION ############################\n"
1467 if (ignore_system_lyxrc ||
1468 dpi != system_lyxrc.dpi) {
1469 os << "\\screen_dpi " << dpi << '\n';
1473 case RC_SCREEN_ZOOM:
1474 if (ignore_system_lyxrc ||
1475 zoom != system_lyxrc.zoom) {
1476 os << "\\screen_zoom " << zoom << '\n';
1480 case RC_GEOMETRY_SESSION:
1481 if (ignore_system_lyxrc ||
1482 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1483 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1488 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1489 if (ignore_system_lyxrc ||
1490 cursor_follows_scrollbar
1491 != system_lyxrc.cursor_follows_scrollbar) {
1492 os << "\\cursor_follows_scrollbar "
1493 << convert<string>(cursor_follows_scrollbar) << '\n';
1497 case RC_MACRO_EDIT_STYLE:
1498 if (ignore_system_lyxrc ||
1500 != system_lyxrc.macro_edit_style) {
1501 os << "\\macro_edit_style ";
1502 switch (macro_edit_style) {
1503 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1504 case MACRO_EDIT_INLINE: os << "1\n"; break;
1505 case MACRO_EDIT_LIST: os << "2\n"; break;
1510 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1511 if (ignore_system_lyxrc ||
1512 dialogs_iconify_with_main
1513 != system_lyxrc.dialogs_iconify_with_main) {
1514 os << "\\dialogs_iconify_with_main "
1515 << convert<string>(dialogs_iconify_with_main) << '\n';
1519 case RC_SCREEN_FONT_ROMAN:
1520 if (ignore_system_lyxrc ||
1521 roman_font_name != system_lyxrc.roman_font_name) {
1522 os << "\\screen_font_roman \"" << roman_font_name
1527 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1528 if (ignore_system_lyxrc ||
1529 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1530 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1535 case RC_SCREEN_FONT_SANS:
1536 if (ignore_system_lyxrc ||
1537 sans_font_name != system_lyxrc.sans_font_name) {
1538 os << "\\screen_font_sans \"" << sans_font_name
1543 case RC_SCREEN_FONT_SANS_FOUNDRY:
1544 if (ignore_system_lyxrc ||
1545 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1546 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1551 case RC_SCREEN_FONT_TYPEWRITER:
1552 if (ignore_system_lyxrc ||
1553 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1554 os << "\\screen_font_typewriter \""
1555 << typewriter_font_name << "\"\n";
1559 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1560 if (ignore_system_lyxrc ||
1561 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1562 os << "\\screen_font_typewriter_foundry \""
1563 << typewriter_font_foundry << "\"\n";
1568 case RC_SCREEN_FONT_SCALABLE:
1569 if (ignore_system_lyxrc ||
1570 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1571 os << "\\screen_font_scalable "
1572 << convert<string>(use_scalable_fonts)
1577 case RC_SCREEN_FONT_SIZES:
1578 if (ignore_system_lyxrc ||
1579 font_sizes[FONT_SIZE_TINY]
1580 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1581 font_sizes[FONT_SIZE_SCRIPT]
1582 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1583 font_sizes[FONT_SIZE_FOOTNOTE]
1584 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1585 font_sizes[FONT_SIZE_SMALL]
1586 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1587 font_sizes[FONT_SIZE_NORMAL]
1588 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1589 font_sizes[FONT_SIZE_LARGE]
1590 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1591 font_sizes[FONT_SIZE_LARGER]
1592 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1593 font_sizes[FONT_SIZE_LARGEST]
1594 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1595 font_sizes[FONT_SIZE_HUGE]
1596 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1597 font_sizes[FONT_SIZE_HUGER]
1598 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1599 os.setf(ios::fixed);
1601 os << "\\screen_font_sizes"
1602 << ' ' << font_sizes[FONT_SIZE_TINY]
1603 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1604 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1605 << ' ' << font_sizes[FONT_SIZE_SMALL]
1606 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1607 << ' ' << font_sizes[FONT_SIZE_LARGE]
1608 << ' ' << font_sizes[FONT_SIZE_LARGER]
1609 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1610 << ' ' << font_sizes[FONT_SIZE_HUGE]
1611 << ' ' << font_sizes[FONT_SIZE_HUGER]
1616 case RC_FULL_SCREEN_LIMIT:
1617 if (ignore_system_lyxrc ||
1618 full_screen_limit != system_lyxrc.full_screen_limit) {
1619 os << "\\fullscreen_limit "
1620 << convert<string>(full_screen_limit)
1625 case RC_FULL_SCREEN_TOOLBARS:
1626 if (ignore_system_lyxrc ||
1627 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1628 os << "\\fullscreen_toolbars "
1629 << convert<string>(full_screen_toolbars)
1634 case RC_FULL_SCREEN_SCROLLBAR:
1635 if (ignore_system_lyxrc ||
1636 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1637 os << "\\fullscreen_scrollbar "
1638 << convert<string>(full_screen_scrollbar)
1643 case RC_FULL_SCREEN_TABBAR:
1644 if (ignore_system_lyxrc ||
1645 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1646 os << "\\fullscreen_tabbar "
1647 << convert<string>(full_screen_tabbar)
1652 case RC_FULL_SCREEN_WIDTH:
1653 if (ignore_system_lyxrc ||
1654 full_screen_width != system_lyxrc.full_screen_width) {
1655 os << "\\fullscreen_width "
1656 << convert<string>(full_screen_width)
1661 case RC_OPEN_BUFFERS_IN_TABS:
1662 if (ignore_system_lyxrc ||
1663 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1664 os << "\\open_buffers_in_tabs "
1665 << convert<string>(open_buffers_in_tabs)
1672 << "# COLOR SECTION ###################################\n"
1676 for (int i = 0; i < Color_ignore; ++i) {
1677 ColorCode lc = static_cast<ColorCode>(i);
1678 string const col = lcolor.getX11Name(lc);
1679 if (ignore_system_lyxrc
1680 || col != system_lcolor.getX11Name(lc)) {
1681 os << "\\set_color \""
1682 << lcolor.getLyXName(lc) << "\" \""
1690 << "# PRINTER SECTION ###################################\n"
1694 if (ignore_system_lyxrc ||
1695 printer != system_lyxrc.printer) {
1696 os << "\\printer \"" << printer << "\"\n";
1700 case RC_PRINT_ADAPTOUTPUT:
1701 if (ignore_system_lyxrc ||
1702 print_adapt_output != system_lyxrc.print_adapt_output) {
1703 os << "\\print_adapt_output "
1704 << convert<string>(print_adapt_output)
1709 case RC_PRINT_COMMAND:
1710 if (ignore_system_lyxrc ||
1711 print_command != system_lyxrc.print_command) {
1712 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1716 case RC_PRINTEXSTRAOPTIONS:
1717 if (ignore_system_lyxrc ||
1718 print_extra_options != system_lyxrc.print_extra_options) {
1719 os << "\\print_extra_options \"" << print_extra_options
1724 case RC_PRINTSPOOL_COMMAND:
1725 if (ignore_system_lyxrc ||
1726 print_spool_command != system_lyxrc.print_spool_command) {
1727 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1732 case RC_PRINTSPOOL_PRINTERPREFIX:
1733 if (ignore_system_lyxrc ||
1734 print_spool_printerprefix
1735 != system_lyxrc.print_spool_printerprefix) {
1736 os << "\\print_spool_printerprefix \""
1737 << print_spool_printerprefix << "\"\n";
1741 case RC_PRINTEVENPAGEFLAG:
1742 if (ignore_system_lyxrc ||
1743 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1744 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1749 case RC_PRINTODDPAGEFLAG:
1750 if (ignore_system_lyxrc ||
1751 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1752 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1757 case RC_PRINTREVERSEFLAG:
1758 if (ignore_system_lyxrc ||
1759 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1760 os << "\\print_reverse_flag \"" << print_reverse_flag
1765 case RC_PRINTLANDSCAPEFLAG:
1766 if (ignore_system_lyxrc ||
1767 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1768 os << "\\print_landscape_flag \"" << print_landscape_flag
1773 case RC_PRINTPAGERANGEFLAG:
1774 if (ignore_system_lyxrc ||
1775 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1776 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1781 case RC_PRINTCOPIESFLAG:
1782 if (ignore_system_lyxrc ||
1783 print_copies_flag != system_lyxrc.print_copies_flag) {
1784 os << "\\print_copies_flag \"" << print_copies_flag
1789 case RC_PRINTCOLLCOPIESFLAG:
1790 if (ignore_system_lyxrc ||
1791 print_collcopies_flag
1792 != system_lyxrc.print_collcopies_flag) {
1793 os << "\\print_collcopies_flag \""
1794 << print_collcopies_flag
1799 case RC_PRINTPAPERFLAG:
1800 if (ignore_system_lyxrc ||
1801 print_paper_flag != system_lyxrc.print_paper_flag) {
1802 os << "\\print_paper_flag \"" << print_paper_flag
1807 case RC_PRINTPAPERDIMENSIONFLAG:
1808 if (ignore_system_lyxrc ||
1809 print_paper_dimension_flag
1810 != system_lyxrc.print_paper_dimension_flag) {
1811 os << "\\print_paper_dimension_flag \""
1812 << print_paper_dimension_flag << "\"\n";
1816 case RC_PRINTTOPRINTER:
1817 if (ignore_system_lyxrc ||
1818 print_to_printer != system_lyxrc.print_to_printer) {
1819 os << "\\print_to_printer \"" << print_to_printer
1824 case RC_PRINTTOFILE:
1825 if (ignore_system_lyxrc ||
1826 print_to_file != system_lyxrc.print_to_file) {
1827 string const path = os::external_path(print_to_file);
1828 os << "\\print_to_file \"" << path << "\"\n";
1832 case RC_PRINTFILEEXTENSION:
1833 if (ignore_system_lyxrc ||
1834 print_file_extension != system_lyxrc.print_file_extension) {
1835 os << "\\print_file_extension \""
1836 << print_file_extension
1843 << "# EXPORT SECTION ####################################\n"
1846 case RC_CUSTOM_EXPORT_COMMAND:
1847 if (ignore_system_lyxrc ||
1848 custom_export_command
1849 != system_lyxrc.custom_export_command) {
1850 os << "\\custom_export_command \""
1851 << custom_export_command
1856 case RC_CUSTOM_EXPORT_FORMAT:
1857 if (ignore_system_lyxrc ||
1858 custom_export_format
1859 != system_lyxrc.custom_export_format) {
1860 os << "\\custom_export_format \"" << custom_export_format
1867 << "# TEX SECTION #######################################\n"
1870 case RC_FONT_ENCODING:
1871 if (ignore_system_lyxrc ||
1872 fontenc != system_lyxrc.fontenc) {
1873 os << "\\font_encoding \"" << fontenc << "\"\n";
1879 << "# FILE SECTION ######################################\n"
1882 case RC_DOCUMENTPATH:
1883 if (ignore_system_lyxrc ||
1884 document_path != system_lyxrc.document_path) {
1885 string const path = os::external_path(document_path);
1886 os << "\\document_path \"" << path << "\"\n";
1890 case RC_USELASTFILEPOS:
1891 if (ignore_system_lyxrc ||
1892 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1893 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1898 case RC_LOADSESSION:
1899 if (ignore_system_lyxrc ||
1900 load_session != system_lyxrc.load_session) {
1901 os << "\\load_session " << convert<string>(load_session)
1906 case RC_MOUSE_WHEEL_SPEED:
1907 if (ignore_system_lyxrc ||
1908 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1909 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1913 case RC_COMPLETION_INLINE_DELAY:
1914 if (ignore_system_lyxrc ||
1915 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1916 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1920 case RC_COMPLETION_INLINE_MATH:
1921 if (ignore_system_lyxrc ||
1922 completion_inline_math != system_lyxrc.completion_inline_math) {
1923 os << "\\completion_inline_math "
1924 << convert<string>(completion_inline_math) << '\n';
1928 case RC_COMPLETION_INLINE_TEXT:
1929 if (ignore_system_lyxrc ||
1930 completion_inline_text != system_lyxrc.completion_inline_text) {
1931 os << "\\completion_inline_text "
1932 << convert<string>(completion_inline_text) << '\n';
1936 case RC_COMPLETION_INLINE_DOTS:
1937 if (ignore_system_lyxrc ||
1938 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1939 os << "\\completion_inline_dots "
1940 << convert<string>(completion_inline_dots) << '\n';
1944 case RC_COMPLETION_POPUP_DELAY:
1945 if (ignore_system_lyxrc ||
1946 completion_popup_delay != system_lyxrc.completion_popup_delay) {
1947 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
1951 case RC_COMPLETION_POPUP_MATH:
1952 if (ignore_system_lyxrc ||
1953 completion_popup_math != system_lyxrc.completion_popup_math) {
1954 os << "\\completion_popup_math "
1955 << convert<string>(completion_popup_math) << '\n';
1959 case RC_COMPLETION_POPUP_TEXT:
1960 if (ignore_system_lyxrc ||
1961 completion_popup_text != system_lyxrc.completion_popup_text) {
1962 os << "\\completion_popup_text "
1963 << convert<string>(completion_popup_text) << '\n';
1967 case RC_COMPLETION_CURSOR_TEXT:
1968 if (ignore_system_lyxrc ||
1969 completion_cursor_text != system_lyxrc.completion_cursor_text) {
1970 os << "\\completion_cursor_text "
1971 << convert<string>(completion_cursor_text) << '\n';
1975 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
1976 if (ignore_system_lyxrc ||
1977 completion_popup_after_complete
1978 != system_lyxrc.completion_popup_after_complete) {
1979 os << "\\completion_popup_after_complete "
1980 << convert<string>(completion_popup_after_complete) << '\n';
1984 case RC_NUMLASTFILES:
1985 if (ignore_system_lyxrc ||
1986 num_lastfiles != system_lyxrc.num_lastfiles) {
1987 os << "\\num_lastfiles " << num_lastfiles << '\n';
1991 case RC_CHECKLASTFILES:
1992 if (ignore_system_lyxrc ||
1993 check_lastfiles != system_lyxrc.check_lastfiles) {
1994 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
1999 case RC_EXAMPLEPATH:
2000 if (ignore_system_lyxrc ||
2001 example_path != system_lyxrc.example_path) {
2002 string const path = os::external_path(example_path);
2003 os << "\\example_path \"" << path << "\"\n";
2007 case RC_TEMPLATEPATH:
2008 if (ignore_system_lyxrc ||
2009 template_path != system_lyxrc.template_path) {
2010 string const path = os::external_path(template_path);
2011 os << "\\template_path \"" << path << "\"\n";
2015 case RC_TEMPDIRPATH:
2016 if (ignore_system_lyxrc ||
2017 tempdir_path != system_lyxrc.tempdir_path) {
2018 string const path = os::external_path(tempdir_path);
2019 os << "\\tempdir_path \"" << path << "\"\n";
2027 case RC_PLAINTEXT_LINELEN:
2028 if (ignore_system_lyxrc ||
2029 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2030 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2034 case RC_MAKE_BACKUP:
2035 if (ignore_system_lyxrc ||
2036 make_backup != system_lyxrc.make_backup) {
2037 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2041 case RC_BACKUPDIR_PATH:
2042 if (ignore_system_lyxrc ||
2043 backupdir_path != system_lyxrc.backupdir_path) {
2044 string const path = os::external_path(backupdir_path);
2045 os << "\\backupdir_path \"" << path << "\"\n";
2051 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2054 case RC_PLAINTEXT_ROFF_COMMAND:
2055 if (ignore_system_lyxrc ||
2056 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2057 os << "\\plaintext_roff_command \"" << escapeCommand(plaintext_roff_command)
2064 << "# SPELLCHECKER SECTION ##############################\n"
2066 case RC_USE_SPELL_LIB:
2067 if (ignore_system_lyxrc ||
2068 use_spell_lib != system_lyxrc.use_spell_lib) {
2069 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2073 case RC_SPELL_COMMAND:
2074 if (ignore_system_lyxrc ||
2075 isp_command != system_lyxrc.isp_command) {
2076 os << "\\spell_command \"" << escapeCommand(isp_command) << "\"\n";
2080 case RC_ACCEPT_COMPOUND:
2081 if (ignore_system_lyxrc ||
2082 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2083 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2088 case RC_USE_ALT_LANG:
2089 if (ignore_system_lyxrc ||
2090 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2091 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2097 if (ignore_system_lyxrc ||
2098 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2099 os << "\\alternate_language \"" << isp_alt_lang
2104 case RC_USE_ESC_CHARS:
2105 if (ignore_system_lyxrc ||
2106 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2107 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2113 if (ignore_system_lyxrc ||
2114 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2115 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2119 case RC_USE_PERS_DICT:
2120 if (ignore_system_lyxrc ||
2121 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2122 os << "\\use_personal_dictionary "
2123 << convert<string>(isp_use_pers_dict)
2128 case RC_USE_TOOLTIP:
2129 if (ignore_system_lyxrc ||
2130 use_tooltip != system_lyxrc.use_tooltip) {
2131 os << "\\use_tooltip "
2132 << convert<string>(use_tooltip)
2135 case RC_USE_PIXMAP_CACHE:
2136 if (ignore_system_lyxrc ||
2137 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2138 os << "\\use_pixmap_cache "
2139 << convert<string>(use_pixmap_cache)
2143 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2144 string const path = os::external_path(isp_pers_dict);
2145 os << "\\personal_dictionary \"" << path << "\"\n";
2149 case RC_USE_INP_ENC:
2150 if (ignore_system_lyxrc ||
2151 isp_use_input_encoding
2152 != system_lyxrc.isp_use_input_encoding) {
2153 os << "\\use_input_encoding "
2154 << convert<string>(isp_use_input_encoding)
2161 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2164 case RC_RTL_SUPPORT:
2165 if (ignore_system_lyxrc ||
2166 rtl_support != system_lyxrc.rtl_support) {
2167 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2171 case RC_VISUAL_CURSOR:
2172 if (ignore_system_lyxrc ||
2173 visual_cursor != system_lyxrc.visual_cursor) {
2174 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2178 case RC_LANGUAGE_PACKAGE:
2179 if (ignore_system_lyxrc ||
2180 language_package != system_lyxrc.language_package) {
2181 os << "\\language_package \"" << language_package
2186 case RC_LANGUAGE_GLOBAL_OPTIONS:
2187 if (ignore_system_lyxrc ||
2188 language_global_options
2189 != system_lyxrc.language_global_options) {
2190 os << "\\language_global_options \""
2191 << convert<string>(language_global_options)
2196 case RC_LANGUAGE_USE_BABEL:
2197 if (ignore_system_lyxrc ||
2198 language_use_babel != system_lyxrc.language_use_babel) {
2199 os << "\\language_use_babel \""
2200 << convert<string>(language_use_babel)
2205 case RC_LANGUAGE_COMMAND_BEGIN:
2206 if (ignore_system_lyxrc ||
2207 language_command_begin
2208 != system_lyxrc.language_command_begin) {
2209 os << "\\language_command_begin \""
2210 << language_command_begin
2215 case RC_LANGUAGE_COMMAND_END:
2216 if (ignore_system_lyxrc ||
2217 language_command_end
2218 != system_lyxrc.language_command_end) {
2219 os << "\\language_command_end \"" << language_command_end
2224 case RC_LANGUAGE_COMMAND_LOCAL:
2225 if (ignore_system_lyxrc ||
2226 language_command_local
2227 != system_lyxrc.language_command_local) {
2228 os << "\\language_command_local \""
2229 << language_command_local
2234 case RC_LANGUAGE_AUTO_BEGIN:
2235 if (ignore_system_lyxrc ||
2236 language_auto_begin != system_lyxrc.language_auto_begin) {
2237 os << "\\language_auto_begin "
2238 << convert<string>(language_auto_begin) << '\n';
2242 case RC_LANGUAGE_AUTO_END:
2243 if (ignore_system_lyxrc ||
2244 language_auto_end != system_lyxrc.language_auto_end) {
2245 os << "\\language_auto_end "
2246 << convert<string>(language_auto_end) << '\n';
2250 case RC_MARK_FOREIGN_LANGUAGE:
2251 if (ignore_system_lyxrc ||
2252 mark_foreign_language
2253 != system_lyxrc.mark_foreign_language) {
2254 os << "\\mark_foreign_language " <<
2255 convert<string>(mark_foreign_language) << '\n';
2261 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2264 case RC_AUTO_NUMBER:
2265 if (ignore_system_lyxrc ||
2266 auto_number != system_lyxrc.auto_number) {
2267 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2271 case RC_DEFAULT_LANGUAGE:
2272 if (ignore_system_lyxrc ||
2273 default_language != system_lyxrc.default_language) {
2274 os << "\\default_language " << default_language << '\n';
2278 case RC_ENV_GUI_LANGUAGE:
2279 if (ignore_system_lyxrc ||
2280 env_gui_language != system_lyxrc.env_gui_language) {
2281 os << "\\env_gui_language " << env_gui_language << '\n';
2285 case RC_GUI_LANGUAGE:
2286 if (ignore_system_lyxrc ||
2287 gui_language != system_lyxrc.gui_language) {
2288 os << "\\gui_language " << gui_language << '\n';
2294 << "# FORMATS SECTION ##########################\n"
2298 // New/modified formats
2299 for (Formats::const_iterator cit = formats.begin();
2300 cit != formats.end(); ++cit) {
2301 Format const * format =
2302 system_formats.getFormat(cit->name());
2304 format->extension() != cit->extension() ||
2305 format->prettyname() != cit->prettyname() ||
2306 format->shortcut() != cit->shortcut() ||
2307 format->viewer() != cit->viewer() ||
2308 format->editor() != cit->editor() ||
2309 format->documentFormat() != cit->documentFormat() ||
2310 format->vectorFormat() != cit->vectorFormat()) {
2311 os << "\\format \"" << cit->name() << "\" \""
2312 << cit->extension() << "\" \""
2313 << cit->prettyname() << "\" \""
2314 << cit->shortcut() << "\" \""
2315 << escapeCommand(cit->viewer()) << "\" \""
2316 << escapeCommand(cit->editor()) << "\" \"";
2317 vector<string> flags;
2318 if (cit->documentFormat())
2319 flags.push_back("document");
2320 if (cit->vectorFormat())
2321 flags.push_back("vector");
2322 os << getStringFromVector(flags);
2327 // Look for deleted formats
2328 for (Formats::const_iterator cit = system_formats.begin();
2329 cit != system_formats.end(); ++cit)
2330 if (!formats.getFormat(cit->name()))
2331 os << "\\format \"" << cit->name()
2332 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2341 << "# CONVERTERS SECTION ##########################\n"
2345 // Look for new converters
2346 for (Converters::const_iterator cit = theConverters().begin();
2347 cit != theConverters().end(); ++cit) {
2348 Converter const * converter =
2349 theSystemConverters().getConverter(cit->from,
2352 converter->command != cit->command ||
2353 converter->flags != cit->flags)
2354 os << "\\converter \"" << cit->from << "\" \""
2355 << cit->to << "\" \""
2356 << escapeCommand(cit->command) << "\" \""
2357 << cit->flags << "\"\n";
2360 // New/modifed converters
2361 for (Converters::const_iterator cit = theSystemConverters().begin();
2362 cit != theSystemConverters().end(); ++cit)
2363 if (!theConverters().getConverter(cit->from, cit->to))
2364 os << "\\converter \"" << cit->from
2365 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2372 << "# COPIERS SECTION ##########################\n"
2375 // Look for new movers
2376 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2377 Movers::const_iterator const sysend = theSystemMovers().end();
2378 Movers::const_iterator it = theMovers().begin();
2379 Movers::const_iterator end = theMovers().end();
2381 for (; it != end; ++it) {
2382 Movers::const_iterator const sysit =
2383 find_if(sysbegin, sysend, SameMover(*it));
2384 if (sysit == sysend) {
2385 string const & fmt = it->first;
2386 string const & command =
2387 it->second.command();
2389 os << "\\copier " << fmt
2390 << " \"" << escapeCommand(command) << "\"\n";
2396 // We don't actually delete SpecialisedMover(s) from the
2397 // map, just clear their 'command', so there's no need
2398 // to test for anything else.
2406 string const LyXRC::getDescription(LyXRCTags tag)
2411 case RC_ACCEPT_COMPOUND:
2412 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2416 case RC_USE_ALT_LANG:
2417 str = _("Specify an alternate language. The default is to use the language of the document.");
2420 case RC_PLAINTEXT_ROFF_COMMAND:
2421 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.");
2424 case RC_PLAINTEXT_LINELEN:
2425 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.");
2428 case RC_AUTOREGIONDELETE:
2429 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2432 case RC_AUTORESET_OPTIONS:
2433 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2437 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2440 case RC_AUTO_NUMBER:
2443 case RC_BACKUPDIR_PATH:
2444 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.");
2447 case RC_BIBTEX_COMMAND:
2448 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2452 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2455 case RC_CHECKLASTFILES:
2456 str = _("Select to check whether the lastfiles still exist.");
2459 case RC_CHKTEX_COMMAND:
2460 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2469 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2470 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.");
2473 case RC_SHOW_MACRO_LABEL:
2474 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2477 case RC_CUSTOM_EXPORT_COMMAND:
2480 case RC_CUSTOM_EXPORT_FORMAT:
2483 case RC_DATE_INSERT_FORMAT:
2484 //xgettext:no-c-format
2485 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2489 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2492 case RC_DEFAULT_LANGUAGE:
2493 str = _("New documents will be assigned this language.");
2496 case RC_DEFAULT_PAPERSIZE:
2497 str = _("Specify the default paper size.");
2500 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2501 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2504 case RC_DISPLAY_GRAPHICS:
2505 str = _("Select how LyX will display any graphics.");
2508 case RC_DOCUMENTPATH:
2509 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2513 case RC_USE_ESC_CHARS:
2514 str = _("Specify additional chars that can be part of a word.");
2517 case RC_EXAMPLEPATH:
2518 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2521 case RC_FONT_ENCODING:
2522 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2528 case RC_INDEX_COMMAND:
2529 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\".");
2536 case RC_KBMAP_PRIMARY:
2537 case RC_KBMAP_SECONDARY:
2538 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.");
2541 case RC_LABEL_INIT_LENGTH:
2542 str = _("Maximum number of words in the initialization string for a new label");
2545 case RC_LANGUAGE_AUTO_BEGIN:
2546 str = _("Select if a language switching command is needed at the beginning of the document.");
2549 case RC_LANGUAGE_AUTO_END:
2550 str = _("Select if a language switching command is needed at the end of the document.");
2553 case RC_LANGUAGE_COMMAND_BEGIN:
2554 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.");
2557 case RC_LANGUAGE_COMMAND_END:
2558 str = _("The LaTeX command for changing back to the language of the document.");
2561 case RC_LANGUAGE_COMMAND_LOCAL:
2562 str = _("The LaTeX command for local changing of the language.");
2565 case RC_LANGUAGE_GLOBAL_OPTIONS:
2566 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2569 case RC_LANGUAGE_PACKAGE:
2570 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2573 case RC_LANGUAGE_USE_BABEL:
2574 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2577 case RC_USELASTFILEPOS:
2578 str = _("De-select if you do not want LyX to scroll to saved position.");
2581 case RC_LOADSESSION:
2582 str = _("De-select to prevent loading files opened from the last LyX session.");
2585 case RC_MAKE_BACKUP:
2586 str = _("De-select if you don't want LyX to create backup files.");
2589 case RC_MARK_FOREIGN_LANGUAGE:
2590 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2593 case RC_MOUSE_WHEEL_SPEED:
2594 str = bformat(_("The scrolling speed of the mouse wheel."),
2598 case RC_COMPLETION_POPUP_DELAY:
2599 str = _("The completion popup delay.");
2602 case RC_COMPLETION_POPUP_MATH:
2603 str = _("Select to display the completion popup in math mode.");
2606 case RC_COMPLETION_POPUP_TEXT:
2607 str = _("Select to display the completion popup in text mode.");
2610 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2611 str = _("Show the completion popup without delay after non-unique completion attempt.");
2614 case RC_COMPLETION_POPUP_TEXT:
2615 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2618 case RC_COMPLETION_POPUP_DELAY:
2619 str = _("The inline completion delay.");
2622 case RC_COMPLETION_INLINE_MATH:
2623 str = _("Select to display the inline completion in math mode.");
2626 case RC_COMPLETION_INLINE_TEXT:
2627 str = _("Select to display the inline completion in text mode.");
2630 case RC_COMPLETION_INLINE_DOTS:
2631 str = _("Use \"...\" to shorten long completions.");
2634 case RC_NUMLASTFILES:
2635 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2639 case RC_PATH_PREFIX:
2640 str = _("Specify those directories which should be "
2641 "prepended to the PATH environment variable. "
2642 "Use the OS native format.");
2646 case RC_USE_PERS_DICT:
2647 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2651 str = _("Shows a typeset preview of things such as math");
2654 case RC_PREVIEW_HASHED_LABELS:
2655 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2658 case RC_PREVIEW_SCALE_FACTOR:
2659 str = _("Scale the preview size to suit.");
2662 case RC_PRINTCOLLCOPIESFLAG:
2663 str = _("The option for specifying whether the copies should be collated.");
2666 case RC_PRINTCOPIESFLAG:
2667 str = _("The option for specifying the number of copies to print.");
2671 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2674 case RC_PRINTEVENPAGEFLAG:
2675 str = _("The option to print only even pages.");
2678 case RC_PRINTEXSTRAOPTIONS:
2679 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2682 case RC_PRINTFILEEXTENSION:
2683 str = _("Extension of printer program output file. Usually \".ps\".");
2686 case RC_PRINTLANDSCAPEFLAG:
2687 str = _("The option to print out in landscape.");
2690 case RC_PRINTODDPAGEFLAG:
2691 str = _("The option to print only odd pages.");
2694 case RC_PRINTPAGERANGEFLAG:
2695 str = _("The option for specifying a comma-separated list of pages to print.");
2698 case RC_PRINTPAPERDIMENSIONFLAG:
2699 str = _("Option to specify the dimensions of the print paper.");
2702 case RC_PRINTPAPERFLAG:
2703 str = _("The option to specify paper type.");
2706 case RC_PRINTREVERSEFLAG:
2707 str = _("The option to reverse the order of the pages printed.");
2710 case RC_PRINTSPOOL_COMMAND:
2711 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.");
2714 case RC_PRINTSPOOL_PRINTERPREFIX:
2715 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.");
2718 case RC_PRINTTOFILE:
2719 str = _("Option to pass to the print program to print to a file.");
2722 case RC_PRINTTOPRINTER:
2723 str = _("Option to pass to the print program to print on a specific printer.");
2726 case RC_PRINT_ADAPTOUTPUT:
2727 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2730 case RC_PRINT_COMMAND:
2731 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2734 case RC_RTL_SUPPORT:
2735 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2738 case RC_VISUAL_CURSOR:
2739 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2743 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2746 case RC_SCREEN_FONT_ROMAN:
2747 case RC_SCREEN_FONT_SANS:
2748 case RC_SCREEN_FONT_TYPEWRITER:
2749 str = _("The screen fonts used to display the text while editing.");
2752 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2753 case RC_SCREEN_FONT_SANS_FOUNDRY:
2754 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2757 case RC_SCREEN_FONT_SCALABLE:
2758 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.");
2761 case RC_SCREEN_FONT_SIZES:
2762 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2765 case RC_SCREEN_ZOOM:
2766 //xgettext:no-c-format
2767 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2770 case RC_GEOMETRY_SESSION:
2771 str = _("Allow session manager to save and restore windows geometry.");
2775 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2781 case RC_SHOW_BANNER:
2782 str = _("De-select if you don't want the startup banner.");
2785 case RC_SPELL_COMMAND:
2786 str = _("What command runs the spellchecker?");
2789 case RC_TEMPDIRPATH:
2790 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2793 case RC_TEMPLATEPATH:
2794 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2797 case RC_TEX_ALLOWS_SPACES:
2800 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2804 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2816 case RC_USE_INP_ENC:
2817 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.");
2820 case RC_USE_TOOLTIP:
2821 str = _("Enable the automatic appearance of tool tips in the work area.");
2824 case RC_USE_PIXMAP_CACHE:
2825 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2828 case RC_USE_SPELL_LIB:
2831 case RC_VIEWDVI_PAPEROPTION:
2832 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2847 // The global instance
2850 // The global copy of the system lyxrc entries (everything except preferences)