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"
26 #include "FontEnums.h"
33 #include "graphics/GraphicsTypes.h"
35 #include "support/convert.h"
36 #include "support/debug.h"
37 #include "support/environment.h"
38 #include "support/filetools.h"
39 #include "support/gettext.h"
40 #include "support/lstrings.h"
41 #include "support/os.h"
42 #include "support/userinfo.h"
45 using namespace lyx::support;
49 namespace os = support::os;
53 // when adding something to this array keep it sorted!
54 LexerKeyword lyxrcTags[] = {
55 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
56 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
57 { "\\alternate_language", LyXRC::RC_ALT_LANG },
58 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
59 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
60 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
61 { "\\autosave", LyXRC::RC_AUTOSAVE },
62 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
63 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
64 { "\\bind_file", LyXRC::RC_BINDFILE },
65 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
66 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
67 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
68 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
69 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
70 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
71 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
72 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
73 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
74 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
75 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
76 { "\\converter", LyXRC::RC_CONVERTER },
77 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
78 { "\\copier", LyXRC::RC_COPIER },
79 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
80 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
81 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
82 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
83 { "\\def_file", LyXRC::RC_DEFFILE },
84 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
85 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
86 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
87 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
88 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
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 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
116 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
117 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
118 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
119 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
120 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
121 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
122 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
123 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
124 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
125 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
126 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
127 { "\\preview", LyXRC::RC_PREVIEW },
128 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
129 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
130 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
131 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
132 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
133 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
134 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
135 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
136 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
137 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
138 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
139 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
140 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
141 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
142 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
143 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
144 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
145 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
146 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
147 { "\\printer", LyXRC::RC_PRINTER },
148 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
149 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
150 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
151 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
152 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
153 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
154 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
155 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
156 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
157 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
158 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
159 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
160 { "\\set_color", LyXRC::RC_SET_COLOR },
161 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
162 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
163 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
164 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
165 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
166 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
167 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
168 { "\\ui_file", LyXRC::RC_UIFILE },
169 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
170 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
171 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
172 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
173 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
174 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
175 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
176 // compatibility with versions older than 1.4.0 only
177 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
178 // compatibility with versions older than 1.4.0 only
179 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
180 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
181 { "\\user_email", LyXRC::RC_USER_EMAIL },
182 { "\\user_name", LyXRC::RC_USER_NAME },
183 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
184 // compatibility with versions older than 1.4.0 only
185 { "\\viewer", LyXRC::RC_VIEWER},
186 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
189 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
200 void LyXRC::setDefaults()
203 def_file = "default";
205 // Get printer from the environment. If fail, use default "",
206 // assuming that everything is set up correctly.
207 printer = getEnv("PRINTER");
208 print_adapt_output = false;
209 print_command = "dvips";
210 print_evenpage_flag = "-B";
211 print_oddpage_flag = "-A";
212 print_pagerange_flag = "-pp";
213 print_copies_flag = "-c";
214 print_collcopies_flag = "-C";
215 print_reverse_flag = "-r";
216 print_landscape_flag = "-t landscape";
217 print_to_printer = "-P";
218 print_to_file = "-o ";
219 print_file_extension = ".ps";
220 print_paper_flag = "-t";
221 print_paper_dimension_flag = "-T";
222 document_path.erase();
223 view_dvi_paper_option.erase();
224 default_papersize = PAPER_DEFAULT;
225 custom_export_format = "ps";
226 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
227 bibtex_command = "bibtex";
229 index_command = "makeindex -c -q";
230 nomencl_command = "makeindex -s nomencl.ist";
232 // Because a screen typically is wider than a piece of paper:
234 allow_geometry_session = true;
235 // Default LaTeX font size:
236 font_sizes[FONT_SIZE_TINY] = "5.0";
237 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
238 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
239 font_sizes[FONT_SIZE_SMALL] = "9.0";
240 font_sizes[FONT_SIZE_NORMAL] = "10.0";
241 font_sizes[FONT_SIZE_LARGE] = "12.0";
242 font_sizes[FONT_SIZE_LARGER] = "14.4";
243 font_sizes[FONT_SIZE_LARGEST] = "17.26";
244 font_sizes[FONT_SIZE_HUGE] = "20.74";
245 font_sizes[FONT_SIZE_HUGER] = "24.88";
246 use_scalable_fonts = true;
247 roman_font_name = "";
249 typewriter_font_name = "";
251 auto_region_delete = true;
252 auto_reset_options = false;
253 plaintext_linelen = 65;
254 mouse_wheel_speed = 1.0;
255 num_lastfiles = maxlastfiles;
256 check_lastfiles = true;
257 use_lastfilepos = true;
258 load_session = false;
260 backupdir_path.erase();
261 display_graphics = true;
262 // Spellchecker settings:
263 spellchecker_accept_compound = false;
264 spellchecker_use_input_encoding = false;
265 spellchecker_use_alt_lang = false;
266 spellchecker_use_pers_dict = false;
267 spellchecker_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 gui_language = "auto";
285 windows_style_tex_paths = false;
286 tex_allows_spaces = false;
287 date_insert_format = "%x";
288 cursor_follows_scrollbar = false;
289 mac_like_word_movement = 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)
375 while (lexrc.isOK()) {
376 // By using two switches we take advantage of the compiler
377 // telling us if we have missed a LyXRCTags element in
378 // the second switch.
379 // Note that this also shows a problem with Lexer since it
380 // helps us avoid taking advantage of the strictness of the
383 int le = lexrc.lex();
385 case Lexer::LEX_UNDEF:
386 lexrc.printError("Unknown tag `$$Token'");
388 case Lexer::LEX_FEOF:
393 switch (static_cast<LyXRCTags>(le)) {
394 case RC_INPUT: // Include file
397 libFileSearch(string(),
400 lexrc.printError("Error reading "
401 "included file: " + tmp.absFilename());
407 bind_file = os::internal_path(lexrc.getString());
412 def_file = os::internal_path(lexrc.getString());
417 ui_file = os::internal_path(lexrc.getString());
420 case RC_AUTORESET_OPTIONS:
421 lexrc >> auto_reset_options;
424 case RC_DISPLAY_GRAPHICS:
426 display_graphics = lexrc.getString() == "true";
429 case RC_TEX_EXPECTS_WINDOWS_PATHS:
430 lexrc >> windows_style_tex_paths;
433 case RC_TEX_ALLOWS_SPACES:
434 lexrc >> tex_allows_spaces;
441 case RC_KBMAP_PRIMARY:
443 string const kmap(os::internal_path(lexrc.getString()));
446 } else if (!libFileSearch("kbd", kmap,
448 primary_kbmap = kmap;
450 lexrc.printError("LyX: Keymap `$$Token' not found");
455 case RC_KBMAP_SECONDARY:
457 string const kmap(os::internal_path(lexrc.getString()));
460 } else if (!libFileSearch("kbd", kmap,
462 secondary_kbmap = kmap;
464 lexrc.printError("LyX: Keymap `$$Token' not found");
469 case RC_FONT_ENCODING:
477 case RC_PRINT_COMMAND:
478 if (lexrc.next(true)) {
479 print_command = lexrc.getString();
483 case RC_PRINTEVENPAGEFLAG:
484 lexrc >> print_evenpage_flag;
487 case RC_PRINTODDPAGEFLAG:
488 lexrc >> print_oddpage_flag;
491 case RC_PRINTPAGERANGEFLAG:
492 lexrc >> print_pagerange_flag;
495 case RC_PRINTCOPIESFLAG:
496 lexrc >> print_copies_flag;
499 case RC_PRINTCOLLCOPIESFLAG:
500 lexrc >> print_collcopies_flag;
503 case RC_PRINTREVERSEFLAG:
504 lexrc >> print_reverse_flag;
507 case RC_PRINTLANDSCAPEFLAG:
508 lexrc >> print_landscape_flag;
511 case RC_PRINTTOPRINTER:
512 lexrc >> print_to_printer;
515 case RC_PRINT_ADAPTOUTPUT:
516 lexrc >> print_adapt_output;
521 print_to_file = os::internal_path(lexrc.getString());
525 case RC_PRINTFILEEXTENSION:
526 lexrc >> print_file_extension;
529 case RC_PRINTEXSTRAOPTIONS:
530 lexrc >> print_extra_options;
533 case RC_PRINTSPOOL_COMMAND:
534 if (lexrc.next(true)) {
535 print_spool_command = lexrc.getString();
539 case RC_PRINTSPOOL_PRINTERPREFIX:
540 lexrc >> print_spool_printerprefix;
543 case RC_PRINTPAPERDIMENSIONFLAG:
544 lexrc >> print_paper_dimension_flag;
547 case RC_PRINTPAPERFLAG:
548 lexrc >> print_paper_flag;
551 case RC_CUSTOM_EXPORT_COMMAND:
552 lexrc >> custom_export_command;
555 case RC_CUSTOM_EXPORT_FORMAT:
556 lexrc >> custom_export_format;
559 case RC_DEFAULT_PAPERSIZE:
561 string const size = ascii_lowercase(lexrc.getString());
562 if (size == "usletter")
563 default_papersize = PAPER_USLETTER;
564 else if (size == "legal")
565 default_papersize = PAPER_USLEGAL;
566 else if (size == "executive")
567 default_papersize = PAPER_USEXECUTIVE;
568 else if (size == "a3")
569 default_papersize = PAPER_A3;
570 else if (size == "a4")
571 default_papersize = PAPER_A4;
572 else if (size == "a5")
573 default_papersize = PAPER_A5;
574 else if (size == "b5")
575 default_papersize = PAPER_B5;
576 else if (size == "default")
577 default_papersize = PAPER_DEFAULT;
581 case RC_VIEWDVI_PAPEROPTION:
583 view_dvi_paper_option = lexrc.getString();
585 view_dvi_paper_option.erase();
588 case RC_CHKTEX_COMMAND:
589 if (lexrc.next(true)) {
590 chktex_command = lexrc.getString();
594 case RC_BIBTEX_COMMAND:
595 if (lexrc.next(true)) {
596 bibtex_command = lexrc.getString();
600 case RC_INDEX_COMMAND:
601 if (lexrc.next(true)) {
602 index_command = lexrc.getString();
606 case RC_NOMENCL_COMMAND:
607 if (lexrc.next(true)) {
608 nomencl_command = lexrc.getString();
620 case RC_GEOMETRY_SESSION:
621 lexrc >> allow_geometry_session;
624 case RC_SCREEN_FONT_SIZES:
625 lexrc >> font_sizes[FONT_SIZE_TINY];
626 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
627 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
628 lexrc >> font_sizes[FONT_SIZE_SMALL];
629 lexrc >> font_sizes[FONT_SIZE_NORMAL];
630 lexrc >> font_sizes[FONT_SIZE_LARGE];
631 lexrc >> font_sizes[FONT_SIZE_LARGER];
632 lexrc >> font_sizes[FONT_SIZE_LARGEST];
633 lexrc >> font_sizes[FONT_SIZE_HUGE];
634 lexrc >> font_sizes[FONT_SIZE_HUGER];
637 case RC_SCREEN_FONT_SCALABLE:
638 lexrc >> use_scalable_fonts;
645 case RC_DOCUMENTPATH:
647 document_path = os::internal_path(lexrc.getString());
648 document_path = expandPath(document_path);
654 example_path = os::internal_path(lexrc.getString());
655 example_path = expandPath(example_path);
659 case RC_TEMPLATEPATH:
661 template_path = os::internal_path(lexrc.getString());
662 template_path = expandPath(template_path);
668 tempdir_path = os::internal_path(lexrc.getString());
669 tempdir_path = expandPath(tempdir_path);
675 LYXERR0("Ignoring obsolete use_tempdir flag.");
678 case RC_USELASTFILEPOS:
679 lexrc >> use_lastfilepos;
683 lexrc >> load_session;
686 case RC_MOUSE_WHEEL_SPEED:
687 lexrc >> mouse_wheel_speed;
690 case RC_COMPLETION_INLINE_DELAY:
691 lexrc >> completion_inline_delay;
694 case RC_COMPLETION_INLINE_MATH:
695 lexrc >> completion_inline_math;
698 case RC_COMPLETION_INLINE_TEXT:
699 lexrc >> completion_inline_text;
702 case RC_COMPLETION_INLINE_DOTS:
703 lexrc >> completion_inline_dots;
706 case RC_COMPLETION_POPUP_DELAY:
707 lexrc >> completion_popup_delay;
710 case RC_COMPLETION_POPUP_MATH:
711 lexrc >> completion_popup_math;
714 case RC_COMPLETION_POPUP_TEXT:
715 lexrc >> completion_popup_text;
718 case RC_COMPLETION_CURSOR_TEXT:
719 lexrc >> completion_cursor_text;
722 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
723 lexrc >> completion_popup_after_complete;
726 case RC_NUMLASTFILES:
727 lexrc >> num_lastfiles;
730 case RC_CHECKLASTFILES:
731 lexrc >> check_lastfiles;
734 case RC_SCREEN_FONT_ROMAN:
736 roman_font_name = lexrc.getString();
737 oldFontFormat(roman_font_name,
742 case RC_SCREEN_FONT_SANS:
744 sans_font_name = lexrc.getString();
745 oldFontFormat(sans_font_name, sans_font_foundry);
749 case RC_SCREEN_FONT_TYPEWRITER:
751 typewriter_font_name = lexrc.getString();
752 oldFontFormat(typewriter_font_name,
753 typewriter_font_foundry);
757 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
758 lexrc >> roman_font_foundry;
761 case RC_SCREEN_FONT_SANS_FOUNDRY:
762 lexrc >> sans_font_foundry;
765 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
766 lexrc >> typewriter_font_foundry;
771 lexrc.printError("Missing color tag.");
774 string lyx_name = lexrc.getString();
777 lexrc.printError("Missing color name for color: `$$Token'");
780 string x11_name = lexrc.getString();
782 ColorCode const col =
783 lcolor.getFromLyXName(lyx_name);
784 if (col == Color_none ||
785 col == Color_inherit ||
789 if (!lcolor.setColor(col, x11_name))
790 LYXERR0("Bad lyxrc set_color for " << lyx_name);
794 case RC_AUTOREGIONDELETE:
795 // Auto region delete defaults to true
796 lexrc >> auto_region_delete;
801 lyxpipes = os::internal_path(lexrc.getString());
802 lyxpipes = expandPath(lyxpipes);
806 case RC_CURSOR_FOLLOWS_SCROLLBAR:
807 lexrc >> cursor_follows_scrollbar;
810 case RC_MAC_LIKE_WORD_MOVEMENT:
811 lexrc >> mac_like_word_movement;
814 case RC_MACRO_EDIT_STYLE:
816 switch (lexrc.getInteger()) {
817 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
818 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
819 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
824 case RC_DIALOGS_ICONIFY_WITH_MAIN:
825 lexrc >> dialogs_iconify_with_main;
828 case RC_PLAINTEXT_ROFF_COMMAND:
829 (void) lexrc.getString(); // Obsoleted in 2.0
831 case RC_PLAINTEXT_LINELEN:
832 lexrc >> plaintext_linelen;
834 // Spellchecker settings:
835 case RC_ACCEPT_COMPOUND:
836 lexrc >> spellchecker_accept_compound;
839 lexrc >> spellchecker_use_input_encoding;
841 case RC_USE_ALT_LANG:
842 lexrc >> spellchecker_use_alt_lang;
844 case RC_USE_PERS_DICT:
845 lexrc >> spellchecker_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 >> spellchecker_use_esc_chars;
857 lexrc >> spellchecker_alt_lang;
861 spellchecker_pers_dict = os::internal_path(lexrc.getString());
864 lexrc >> spellchecker_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_GUI_LANGUAGE:
1000 lexrc >> gui_language;
1003 case RC_LABEL_INIT_LENGTH:
1004 lexrc >> label_init_length;
1007 case RC_SHOW_BANNER:
1008 lexrc >> show_banner;
1013 string const tmp = lexrc.getString();
1014 if (tmp == "true" || tmp == "on")
1015 preview = PREVIEW_ON;
1016 else if (tmp == "no_math")
1017 preview = PREVIEW_NO_MATH;
1019 preview = PREVIEW_OFF;
1020 if (tmp != "false" && tmp != "off")
1021 LYXERR0("Unrecognized preview status \""
1027 case RC_PREVIEW_HASHED_LABELS:
1028 lexrc >> preview_hashed_labels;
1031 case RC_PREVIEW_SCALE_FACTOR:
1032 lexrc >> preview_scale_factor;
1039 lexrc >> user_email;
1042 case RC_PATH_PREFIX:
1043 lexrc >> path_prefix;
1046 case RC_USE_CONVERTER_CACHE:
1047 lexrc >> use_converter_cache;
1049 case RC_CONVERTER_CACHE_MAXAGE:
1050 lexrc >> converter_cache_maxage;
1053 case RC_SORT_LAYOUTS:
1054 lexrc >> sort_layouts;
1056 case RC_GROUP_LAYOUTS:
1057 lexrc >> group_layouts;
1059 case RC_FULL_SCREEN_LIMIT:
1060 lexrc >> full_screen_limit;
1062 case RC_FULL_SCREEN_TOOLBARS:
1063 lexrc >> full_screen_toolbars;
1065 case RC_FULL_SCREEN_SCROLLBAR:
1066 lexrc >> full_screen_scrollbar;
1068 case RC_FULL_SCREEN_TABBAR:
1069 lexrc >> full_screen_tabbar;
1071 case RC_FULL_SCREEN_WIDTH:
1072 lexrc >> full_screen_width;
1074 case RC_OPEN_BUFFERS_IN_TABS:
1075 lexrc >> open_buffers_in_tabs;
1079 case RC_SPELL_COMMAND:
1080 case RC_USE_SPELL_LIB:
1081 (void) lexrc.getString();
1085 break; // this is just a dummy
1089 /// Update converters data-structures
1090 theConverters().update(formats);
1091 theConverters().buildGraph();
1097 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1099 ofstream ofs(filename.toFilesystemEncoding().c_str());
1101 write(ofs, ignore_system_lyxrc);
1105 void LyXRC::print() const
1107 if (lyxerr.debugging())
1108 write(lyxerr, false);
1116 typedef pair<string, SpecialisedMover> Data;
1118 SameMover(Data const & comparison)
1119 : comparison_(comparison) {}
1121 bool operator()(Data const & data) const
1123 return data.first == comparison_.first &&
1124 data.second.command() == comparison_.second.command();
1134 // Escape \ and " so that LyXLex can read the string later
1135 string escapeCommand(string const & str) {
1136 return subst(subst(str , "\\", "\\\\"),
1143 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1145 LyXRCTags tag = RC_LAST;
1147 if (!name.empty()) {
1148 for (int i = 0; i != lyxrcCount; ++i)
1149 if ("\\" + name == lyxrcTags[i].tag)
1150 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1154 os << "# LyX " << lyx_version
1155 << " generated this file. If you want to make your own\n"
1156 << "# modifications you should do them from inside LyX and save.\n"
1159 // Why the switch you might ask. It is a trick to ensure that all
1160 // the elements in the LyXRCTags enum are handled. As you can see
1161 // there are no breaks at all. So it is just a huge fall-through.
1162 // The nice thing is that we will get a warning from the compiler
1163 // if we forget an element.
1167 // input/include files are not done here
1169 if (ignore_system_lyxrc ||
1170 bind_file != system_lyxrc.bind_file) {
1171 string const path = os::external_path(bind_file);
1172 os << "\\bind_file \"" << path << "\"\n";
1178 if (ignore_system_lyxrc ||
1179 def_file != system_lyxrc.def_file) {
1180 string const path = os::external_path(def_file);
1181 os << "\\def_file \"" << path << "\"\n";
1190 << "# MISC SECTION ######################################\n"
1192 // bind files are not done here.
1194 case RC_PATH_PREFIX:
1195 if (ignore_system_lyxrc ||
1196 path_prefix != system_lyxrc.path_prefix) {
1197 os << "\\path_prefix \"" << path_prefix << "\"\n";
1202 if (ignore_system_lyxrc ||
1203 ui_file != system_lyxrc.ui_file) {
1204 string const path = os::external_path(ui_file);
1205 os << "\\ui_file \"" << path << "\"\n";
1209 case RC_AUTOREGIONDELETE:
1210 if (ignore_system_lyxrc ||
1211 auto_region_delete != system_lyxrc.auto_region_delete) {
1212 os << "# Set to false to inhibit automatic replacement of\n"
1213 << "# the current selection.\n"
1214 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1219 case RC_AUTORESET_OPTIONS:
1220 if (ignore_system_lyxrc ||
1221 auto_reset_options != system_lyxrc.auto_reset_options) {
1222 os << "# Set to false to inhibit automatic reset of\n"
1223 << "# the class options to defaults on class change.\n"
1224 << "\\auto_reset_options "
1225 << convert<string>(auto_reset_options)
1231 if (ignore_system_lyxrc ||
1232 autosave != system_lyxrc.autosave) {
1233 os << "# The time interval between auto-saves in seconds.\n"
1234 << "\\autosave " << autosave << '\n';
1238 case RC_DISPLAY_GRAPHICS:
1239 if (ignore_system_lyxrc ||
1240 display_graphics != system_lyxrc.display_graphics) {
1241 os << "# Display graphics within LyX\n"
1243 << "\\display_graphics "
1244 << (display_graphics ? "true" : "false")
1249 case RC_SORT_LAYOUTS:
1250 if (ignore_system_lyxrc ||
1251 sort_layouts != system_lyxrc.sort_layouts) {
1252 os << "# Sort layouts alphabetically.\n"
1253 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1257 case RC_GROUP_LAYOUTS:
1258 if (ignore_system_lyxrc ||
1259 group_layouts != system_lyxrc.group_layouts) {
1260 os << "# Group layouts by their category.\n"
1261 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1265 case RC_VIEWDVI_PAPEROPTION:
1266 if (ignore_system_lyxrc ||
1267 view_dvi_paper_option
1268 != system_lyxrc.view_dvi_paper_option) {
1269 os << "# Options used to specify paper size to the\n"
1270 << "# view_dvi_command (e.g. -paper)\n"
1271 << "\\view_dvi_paper_option \""
1272 << view_dvi_paper_option << "\"\n";
1276 case RC_DEFAULT_PAPERSIZE:
1277 if (ignore_system_lyxrc ||
1278 default_papersize != system_lyxrc.default_papersize) {
1279 os << "# The default papersize to use.\n"
1280 << "\\default_papersize \"";
1281 switch (default_papersize) {
1283 os << "default"; break;
1284 case PAPER_USLETTER:
1285 os << "usletter"; break;
1287 os << "legal"; break;
1288 case PAPER_USEXECUTIVE:
1289 os << "executive"; break;
1300 case PAPER_B4: break;
1306 case RC_CHKTEX_COMMAND:
1307 if (ignore_system_lyxrc ||
1308 chktex_command != system_lyxrc.chktex_command) {
1309 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1313 case RC_BIBTEX_COMMAND:
1314 if (ignore_system_lyxrc ||
1315 bibtex_command != system_lyxrc.bibtex_command) {
1316 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1320 case RC_INDEX_COMMAND:
1321 if (ignore_system_lyxrc ||
1322 index_command != system_lyxrc.index_command) {
1323 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1327 case RC_NOMENCL_COMMAND:
1328 if (ignore_system_lyxrc ||
1329 nomencl_command != system_lyxrc.nomencl_command) {
1330 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1334 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1335 if (ignore_system_lyxrc ||
1336 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1337 os << "\\tex_expects_windows_paths "
1338 << convert<string>(windows_style_tex_paths) << '\n';
1342 case RC_TEX_ALLOWS_SPACES:
1343 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1344 os << "\\tex_allows_spaces "
1345 << convert<string>(tex_allows_spaces) << '\n';
1350 if (ignore_system_lyxrc ||
1351 use_kbmap != system_lyxrc.use_kbmap) {
1352 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1356 case RC_KBMAP_PRIMARY:
1357 if (ignore_system_lyxrc ||
1358 primary_kbmap != system_lyxrc.primary_kbmap) {
1359 string const path = os::external_path(primary_kbmap);
1360 os << "\\kbmap_primary \"" << path << "\"\n";
1364 case RC_KBMAP_SECONDARY:
1365 if (ignore_system_lyxrc ||
1366 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1367 string const path = os::external_path(secondary_kbmap);
1368 os << "\\kbmap_secondary \"" << path << "\"\n";
1373 if (ignore_system_lyxrc ||
1374 lyxpipes != system_lyxrc.lyxpipes) {
1375 string const path = os::external_path(lyxpipes);
1376 os << "\\serverpipe \"" << path << "\"\n";
1380 case RC_DATE_INSERT_FORMAT:
1381 if (ignore_system_lyxrc ||
1382 date_insert_format != system_lyxrc.date_insert_format) {
1383 os << "\\date_insert_format \"" << date_insert_format
1388 case RC_LABEL_INIT_LENGTH:
1389 if (ignore_system_lyxrc ||
1390 label_init_length != system_lyxrc.label_init_length) {
1391 os << "\\label_init_length " << label_init_length
1398 os << "\\user_name \"" << user_name << "\"\n";
1403 os << "\\user_email \"" << user_email << "\"\n";
1407 case RC_SHOW_BANNER:
1408 if (ignore_system_lyxrc ||
1409 show_banner != system_lyxrc.show_banner) {
1410 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1416 if (ignore_system_lyxrc ||
1417 preview != system_lyxrc.preview) {
1423 case PREVIEW_NO_MATH:
1430 os << "\\preview " << status << '\n';
1435 case RC_PREVIEW_HASHED_LABELS:
1436 if (ignore_system_lyxrc ||
1437 preview_hashed_labels !=
1438 system_lyxrc.preview_hashed_labels) {
1439 os << "\\preview_hashed_labels "
1440 << convert<string>(preview_hashed_labels) << '\n';
1445 case RC_PREVIEW_SCALE_FACTOR:
1446 if (ignore_system_lyxrc ||
1447 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1448 os << "\\preview_scale_factor "
1449 << preview_scale_factor << '\n';
1454 case RC_USE_CONVERTER_CACHE:
1455 if (ignore_system_lyxrc ||
1456 use_converter_cache != system_lyxrc.use_converter_cache) {
1457 os << "\\use_converter_cache "
1458 << convert<string>(use_converter_cache) << '\n';
1463 case RC_CONVERTER_CACHE_MAXAGE:
1464 if (ignore_system_lyxrc ||
1465 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1466 os << "\\converter_cache_maxage "
1467 << converter_cache_maxage << '\n';
1473 << "# SCREEN & FONTS SECTION ############################\n"
1477 if (ignore_system_lyxrc ||
1478 dpi != system_lyxrc.dpi) {
1479 os << "\\screen_dpi " << dpi << '\n';
1483 case RC_SCREEN_ZOOM:
1484 if (ignore_system_lyxrc ||
1485 zoom != system_lyxrc.zoom) {
1486 os << "\\screen_zoom " << zoom << '\n';
1490 case RC_GEOMETRY_SESSION:
1491 if (ignore_system_lyxrc ||
1492 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1493 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1498 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1499 if (ignore_system_lyxrc ||
1500 cursor_follows_scrollbar
1501 != system_lyxrc.cursor_follows_scrollbar) {
1502 os << "\\cursor_follows_scrollbar "
1503 << convert<string>(cursor_follows_scrollbar) << '\n';
1507 case RC_MAC_LIKE_WORD_MOVEMENT:
1508 if (ignore_system_lyxrc ||
1509 mac_like_word_movement
1510 != system_lyxrc.mac_like_word_movement) {
1511 os << "\\mac_like_word_movement "
1512 << convert<string>(mac_like_word_movement) << '\n';
1516 case RC_MACRO_EDIT_STYLE:
1517 if (ignore_system_lyxrc ||
1519 != system_lyxrc.macro_edit_style) {
1520 os << "\\macro_edit_style ";
1521 switch (macro_edit_style) {
1522 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1523 case MACRO_EDIT_INLINE: os << "1\n"; break;
1524 case MACRO_EDIT_LIST: os << "2\n"; break;
1529 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1530 if (ignore_system_lyxrc ||
1531 dialogs_iconify_with_main
1532 != system_lyxrc.dialogs_iconify_with_main) {
1533 os << "\\dialogs_iconify_with_main "
1534 << convert<string>(dialogs_iconify_with_main) << '\n';
1538 case RC_SCREEN_FONT_ROMAN:
1539 if (ignore_system_lyxrc ||
1540 roman_font_name != system_lyxrc.roman_font_name) {
1541 os << "\\screen_font_roman \"" << roman_font_name
1546 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1547 if (ignore_system_lyxrc ||
1548 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1549 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1554 case RC_SCREEN_FONT_SANS:
1555 if (ignore_system_lyxrc ||
1556 sans_font_name != system_lyxrc.sans_font_name) {
1557 os << "\\screen_font_sans \"" << sans_font_name
1562 case RC_SCREEN_FONT_SANS_FOUNDRY:
1563 if (ignore_system_lyxrc ||
1564 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1565 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1570 case RC_SCREEN_FONT_TYPEWRITER:
1571 if (ignore_system_lyxrc ||
1572 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1573 os << "\\screen_font_typewriter \""
1574 << typewriter_font_name << "\"\n";
1578 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1579 if (ignore_system_lyxrc ||
1580 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1581 os << "\\screen_font_typewriter_foundry \""
1582 << typewriter_font_foundry << "\"\n";
1587 case RC_SCREEN_FONT_SCALABLE:
1588 if (ignore_system_lyxrc ||
1589 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1590 os << "\\screen_font_scalable "
1591 << convert<string>(use_scalable_fonts)
1596 case RC_SCREEN_FONT_SIZES:
1597 if (ignore_system_lyxrc ||
1598 font_sizes[FONT_SIZE_TINY]
1599 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1600 font_sizes[FONT_SIZE_SCRIPT]
1601 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1602 font_sizes[FONT_SIZE_FOOTNOTE]
1603 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1604 font_sizes[FONT_SIZE_SMALL]
1605 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1606 font_sizes[FONT_SIZE_NORMAL]
1607 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1608 font_sizes[FONT_SIZE_LARGE]
1609 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1610 font_sizes[FONT_SIZE_LARGER]
1611 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1612 font_sizes[FONT_SIZE_LARGEST]
1613 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1614 font_sizes[FONT_SIZE_HUGE]
1615 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1616 font_sizes[FONT_SIZE_HUGER]
1617 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1618 os.setf(ios::fixed);
1620 os << "\\screen_font_sizes"
1621 << ' ' << font_sizes[FONT_SIZE_TINY]
1622 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1623 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1624 << ' ' << font_sizes[FONT_SIZE_SMALL]
1625 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1626 << ' ' << font_sizes[FONT_SIZE_LARGE]
1627 << ' ' << font_sizes[FONT_SIZE_LARGER]
1628 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1629 << ' ' << font_sizes[FONT_SIZE_HUGE]
1630 << ' ' << font_sizes[FONT_SIZE_HUGER]
1635 case RC_FULL_SCREEN_LIMIT:
1636 if (ignore_system_lyxrc ||
1637 full_screen_limit != system_lyxrc.full_screen_limit) {
1638 os << "\\fullscreen_limit "
1639 << convert<string>(full_screen_limit)
1644 case RC_FULL_SCREEN_TOOLBARS:
1645 if (ignore_system_lyxrc ||
1646 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1647 os << "\\fullscreen_toolbars "
1648 << convert<string>(full_screen_toolbars)
1653 case RC_FULL_SCREEN_SCROLLBAR:
1654 if (ignore_system_lyxrc ||
1655 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1656 os << "\\fullscreen_scrollbar "
1657 << convert<string>(full_screen_scrollbar)
1662 case RC_FULL_SCREEN_TABBAR:
1663 if (ignore_system_lyxrc ||
1664 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1665 os << "\\fullscreen_tabbar "
1666 << convert<string>(full_screen_tabbar)
1671 case RC_FULL_SCREEN_WIDTH:
1672 if (ignore_system_lyxrc ||
1673 full_screen_width != system_lyxrc.full_screen_width) {
1674 os << "\\fullscreen_width "
1675 << convert<string>(full_screen_width)
1680 case RC_OPEN_BUFFERS_IN_TABS:
1681 if (ignore_system_lyxrc ||
1682 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1683 os << "\\open_buffers_in_tabs "
1684 << convert<string>(open_buffers_in_tabs)
1691 << "# COLOR SECTION ###################################\n"
1695 for (int i = 0; i < Color_ignore; ++i) {
1696 ColorCode lc = static_cast<ColorCode>(i);
1697 string const col = lcolor.getX11Name(lc);
1698 if (ignore_system_lyxrc
1699 || col != system_lcolor.getX11Name(lc)) {
1700 os << "\\set_color \""
1701 << lcolor.getLyXName(lc) << "\" \""
1709 << "# PRINTER SECTION ###################################\n"
1713 if (ignore_system_lyxrc ||
1714 printer != system_lyxrc.printer) {
1715 os << "\\printer \"" << printer << "\"\n";
1719 case RC_PRINT_ADAPTOUTPUT:
1720 if (ignore_system_lyxrc ||
1721 print_adapt_output != system_lyxrc.print_adapt_output) {
1722 os << "\\print_adapt_output "
1723 << convert<string>(print_adapt_output)
1728 case RC_PRINT_COMMAND:
1729 if (ignore_system_lyxrc ||
1730 print_command != system_lyxrc.print_command) {
1731 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1735 case RC_PRINTEXSTRAOPTIONS:
1736 if (ignore_system_lyxrc ||
1737 print_extra_options != system_lyxrc.print_extra_options) {
1738 os << "\\print_extra_options \"" << print_extra_options
1743 case RC_PRINTSPOOL_COMMAND:
1744 if (ignore_system_lyxrc ||
1745 print_spool_command != system_lyxrc.print_spool_command) {
1746 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1751 case RC_PRINTSPOOL_PRINTERPREFIX:
1752 if (ignore_system_lyxrc ||
1753 print_spool_printerprefix
1754 != system_lyxrc.print_spool_printerprefix) {
1755 os << "\\print_spool_printerprefix \""
1756 << print_spool_printerprefix << "\"\n";
1760 case RC_PRINTEVENPAGEFLAG:
1761 if (ignore_system_lyxrc ||
1762 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1763 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1768 case RC_PRINTODDPAGEFLAG:
1769 if (ignore_system_lyxrc ||
1770 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1771 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1776 case RC_PRINTREVERSEFLAG:
1777 if (ignore_system_lyxrc ||
1778 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1779 os << "\\print_reverse_flag \"" << print_reverse_flag
1784 case RC_PRINTLANDSCAPEFLAG:
1785 if (ignore_system_lyxrc ||
1786 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1787 os << "\\print_landscape_flag \"" << print_landscape_flag
1792 case RC_PRINTPAGERANGEFLAG:
1793 if (ignore_system_lyxrc ||
1794 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1795 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1800 case RC_PRINTCOPIESFLAG:
1801 if (ignore_system_lyxrc ||
1802 print_copies_flag != system_lyxrc.print_copies_flag) {
1803 os << "\\print_copies_flag \"" << print_copies_flag
1808 case RC_PRINTCOLLCOPIESFLAG:
1809 if (ignore_system_lyxrc ||
1810 print_collcopies_flag
1811 != system_lyxrc.print_collcopies_flag) {
1812 os << "\\print_collcopies_flag \""
1813 << print_collcopies_flag
1818 case RC_PRINTPAPERFLAG:
1819 if (ignore_system_lyxrc ||
1820 print_paper_flag != system_lyxrc.print_paper_flag) {
1821 os << "\\print_paper_flag \"" << print_paper_flag
1826 case RC_PRINTPAPERDIMENSIONFLAG:
1827 if (ignore_system_lyxrc ||
1828 print_paper_dimension_flag
1829 != system_lyxrc.print_paper_dimension_flag) {
1830 os << "\\print_paper_dimension_flag \""
1831 << print_paper_dimension_flag << "\"\n";
1835 case RC_PRINTTOPRINTER:
1836 if (ignore_system_lyxrc ||
1837 print_to_printer != system_lyxrc.print_to_printer) {
1838 os << "\\print_to_printer \"" << print_to_printer
1843 case RC_PRINTTOFILE:
1844 if (ignore_system_lyxrc ||
1845 print_to_file != system_lyxrc.print_to_file) {
1846 string const path = os::external_path(print_to_file);
1847 os << "\\print_to_file \"" << path << "\"\n";
1851 case RC_PRINTFILEEXTENSION:
1852 if (ignore_system_lyxrc ||
1853 print_file_extension != system_lyxrc.print_file_extension) {
1854 os << "\\print_file_extension \""
1855 << print_file_extension
1862 << "# EXPORT SECTION ####################################\n"
1865 case RC_CUSTOM_EXPORT_COMMAND:
1866 if (ignore_system_lyxrc ||
1867 custom_export_command
1868 != system_lyxrc.custom_export_command) {
1869 os << "\\custom_export_command \""
1870 << custom_export_command
1875 case RC_CUSTOM_EXPORT_FORMAT:
1876 if (ignore_system_lyxrc ||
1877 custom_export_format
1878 != system_lyxrc.custom_export_format) {
1879 os << "\\custom_export_format \"" << custom_export_format
1886 << "# TEX SECTION #######################################\n"
1889 case RC_FONT_ENCODING:
1890 if (ignore_system_lyxrc ||
1891 fontenc != system_lyxrc.fontenc) {
1892 os << "\\font_encoding \"" << fontenc << "\"\n";
1898 << "# FILE SECTION ######################################\n"
1901 case RC_DOCUMENTPATH:
1902 if (ignore_system_lyxrc ||
1903 document_path != system_lyxrc.document_path) {
1904 string const path = os::external_path(document_path);
1905 os << "\\document_path \"" << path << "\"\n";
1909 case RC_USELASTFILEPOS:
1910 if (ignore_system_lyxrc ||
1911 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1912 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1917 case RC_LOADSESSION:
1918 if (ignore_system_lyxrc ||
1919 load_session != system_lyxrc.load_session) {
1920 os << "\\load_session " << convert<string>(load_session)
1925 case RC_MOUSE_WHEEL_SPEED:
1926 if (ignore_system_lyxrc ||
1927 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1928 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1932 case RC_COMPLETION_INLINE_DELAY:
1933 if (ignore_system_lyxrc ||
1934 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1935 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1939 case RC_COMPLETION_INLINE_MATH:
1940 if (ignore_system_lyxrc ||
1941 completion_inline_math != system_lyxrc.completion_inline_math) {
1942 os << "\\completion_inline_math "
1943 << convert<string>(completion_inline_math) << '\n';
1947 case RC_COMPLETION_INLINE_TEXT:
1948 if (ignore_system_lyxrc ||
1949 completion_inline_text != system_lyxrc.completion_inline_text) {
1950 os << "\\completion_inline_text "
1951 << convert<string>(completion_inline_text) << '\n';
1955 case RC_COMPLETION_INLINE_DOTS:
1956 if (ignore_system_lyxrc ||
1957 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1958 os << "\\completion_inline_dots "
1959 << convert<string>(completion_inline_dots) << '\n';
1963 case RC_COMPLETION_POPUP_DELAY:
1964 if (ignore_system_lyxrc ||
1965 completion_popup_delay != system_lyxrc.completion_popup_delay) {
1966 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
1970 case RC_COMPLETION_POPUP_MATH:
1971 if (ignore_system_lyxrc ||
1972 completion_popup_math != system_lyxrc.completion_popup_math) {
1973 os << "\\completion_popup_math "
1974 << convert<string>(completion_popup_math) << '\n';
1978 case RC_COMPLETION_POPUP_TEXT:
1979 if (ignore_system_lyxrc ||
1980 completion_popup_text != system_lyxrc.completion_popup_text) {
1981 os << "\\completion_popup_text "
1982 << convert<string>(completion_popup_text) << '\n';
1986 case RC_COMPLETION_CURSOR_TEXT:
1987 if (ignore_system_lyxrc ||
1988 completion_cursor_text != system_lyxrc.completion_cursor_text) {
1989 os << "\\completion_cursor_text "
1990 << convert<string>(completion_cursor_text) << '\n';
1994 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
1995 if (ignore_system_lyxrc ||
1996 completion_popup_after_complete
1997 != system_lyxrc.completion_popup_after_complete) {
1998 os << "\\completion_popup_after_complete "
1999 << convert<string>(completion_popup_after_complete) << '\n';
2003 case RC_NUMLASTFILES:
2004 if (ignore_system_lyxrc ||
2005 num_lastfiles != system_lyxrc.num_lastfiles) {
2006 os << "\\num_lastfiles " << num_lastfiles << '\n';
2010 case RC_CHECKLASTFILES:
2011 if (ignore_system_lyxrc ||
2012 check_lastfiles != system_lyxrc.check_lastfiles) {
2013 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2018 case RC_EXAMPLEPATH:
2019 if (ignore_system_lyxrc ||
2020 example_path != system_lyxrc.example_path) {
2021 string const path = os::external_path(example_path);
2022 os << "\\example_path \"" << path << "\"\n";
2026 case RC_TEMPLATEPATH:
2027 if (ignore_system_lyxrc ||
2028 template_path != system_lyxrc.template_path) {
2029 string const path = os::external_path(template_path);
2030 os << "\\template_path \"" << path << "\"\n";
2034 case RC_TEMPDIRPATH:
2035 if (ignore_system_lyxrc ||
2036 tempdir_path != system_lyxrc.tempdir_path) {
2037 string const path = os::external_path(tempdir_path);
2038 os << "\\tempdir_path \"" << path << "\"\n";
2046 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2049 case RC_PLAINTEXT_LINELEN:
2050 if (ignore_system_lyxrc ||
2051 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2052 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2056 case RC_MAKE_BACKUP:
2057 if (ignore_system_lyxrc ||
2058 make_backup != system_lyxrc.make_backup) {
2059 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2063 case RC_BACKUPDIR_PATH:
2064 if (ignore_system_lyxrc ||
2065 backupdir_path != system_lyxrc.backupdir_path) {
2066 string const path = os::external_path(backupdir_path);
2067 os << "\\backupdir_path \"" << path << "\"\n";
2073 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2077 << "# SPELLCHECKER SECTION ##############################\n"
2079 case RC_SPELL_COMMAND:
2080 case RC_USE_SPELL_LIB:
2084 case RC_ACCEPT_COMPOUND:
2085 if (ignore_system_lyxrc ||
2086 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2087 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2092 case RC_USE_ALT_LANG:
2093 if (ignore_system_lyxrc ||
2094 spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
2095 os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
2101 if (ignore_system_lyxrc ||
2102 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2103 os << "\\alternate_language \"" << spellchecker_alt_lang
2108 case RC_USE_ESC_CHARS:
2109 if (ignore_system_lyxrc ||
2110 spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
2111 os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
2117 if (ignore_system_lyxrc ||
2118 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2119 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2123 case RC_USE_PERS_DICT:
2124 if (ignore_system_lyxrc ||
2125 spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
2126 os << "\\use_personal_dictionary "
2127 << convert<string>(spellchecker_use_pers_dict)
2132 case RC_USE_TOOLTIP:
2133 if (ignore_system_lyxrc ||
2134 use_tooltip != system_lyxrc.use_tooltip) {
2135 os << "\\use_tooltip "
2136 << convert<string>(use_tooltip)
2139 case RC_USE_PIXMAP_CACHE:
2140 if (ignore_system_lyxrc ||
2141 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2142 os << "\\use_pixmap_cache "
2143 << convert<string>(use_pixmap_cache)
2147 if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
2148 string const path = os::external_path(spellchecker_pers_dict);
2149 os << "\\personal_dictionary \"" << path << "\"\n";
2153 case RC_USE_INP_ENC:
2154 if (ignore_system_lyxrc ||
2155 spellchecker_use_input_encoding
2156 != system_lyxrc.spellchecker_use_input_encoding) {
2157 os << "\\use_input_encoding "
2158 << convert<string>(spellchecker_use_input_encoding)
2165 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2168 case RC_RTL_SUPPORT:
2169 if (ignore_system_lyxrc ||
2170 rtl_support != system_lyxrc.rtl_support) {
2171 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2175 case RC_VISUAL_CURSOR:
2176 if (ignore_system_lyxrc ||
2177 visual_cursor != system_lyxrc.visual_cursor) {
2178 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2182 case RC_LANGUAGE_PACKAGE:
2183 if (ignore_system_lyxrc ||
2184 language_package != system_lyxrc.language_package) {
2185 os << "\\language_package \"" << language_package
2190 case RC_LANGUAGE_GLOBAL_OPTIONS:
2191 if (ignore_system_lyxrc ||
2192 language_global_options
2193 != system_lyxrc.language_global_options) {
2194 os << "\\language_global_options \""
2195 << convert<string>(language_global_options)
2200 case RC_LANGUAGE_USE_BABEL:
2201 if (ignore_system_lyxrc ||
2202 language_use_babel != system_lyxrc.language_use_babel) {
2203 os << "\\language_use_babel \""
2204 << convert<string>(language_use_babel)
2209 case RC_LANGUAGE_COMMAND_BEGIN:
2210 if (ignore_system_lyxrc ||
2211 language_command_begin
2212 != system_lyxrc.language_command_begin) {
2213 os << "\\language_command_begin \""
2214 << language_command_begin
2219 case RC_LANGUAGE_COMMAND_END:
2220 if (ignore_system_lyxrc ||
2221 language_command_end
2222 != system_lyxrc.language_command_end) {
2223 os << "\\language_command_end \"" << language_command_end
2228 case RC_LANGUAGE_COMMAND_LOCAL:
2229 if (ignore_system_lyxrc ||
2230 language_command_local
2231 != system_lyxrc.language_command_local) {
2232 os << "\\language_command_local \""
2233 << language_command_local
2238 case RC_LANGUAGE_AUTO_BEGIN:
2239 if (ignore_system_lyxrc ||
2240 language_auto_begin != system_lyxrc.language_auto_begin) {
2241 os << "\\language_auto_begin "
2242 << convert<string>(language_auto_begin) << '\n';
2246 case RC_LANGUAGE_AUTO_END:
2247 if (ignore_system_lyxrc ||
2248 language_auto_end != system_lyxrc.language_auto_end) {
2249 os << "\\language_auto_end "
2250 << convert<string>(language_auto_end) << '\n';
2254 case RC_MARK_FOREIGN_LANGUAGE:
2255 if (ignore_system_lyxrc ||
2256 mark_foreign_language
2257 != system_lyxrc.mark_foreign_language) {
2258 os << "\\mark_foreign_language " <<
2259 convert<string>(mark_foreign_language) << '\n';
2265 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2268 case RC_AUTO_NUMBER:
2269 if (ignore_system_lyxrc ||
2270 auto_number != system_lyxrc.auto_number) {
2271 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2275 case RC_DEFAULT_LANGUAGE:
2276 if (ignore_system_lyxrc ||
2277 default_language != system_lyxrc.default_language) {
2278 os << "\\default_language " << default_language << '\n';
2282 case RC_GUI_LANGUAGE:
2283 if (ignore_system_lyxrc ||
2284 gui_language != system_lyxrc.gui_language) {
2285 os << "\\gui_language " << gui_language << '\n';
2291 << "# FORMATS SECTION ##########################\n"
2295 // New/modified formats
2296 for (Formats::const_iterator cit = formats.begin();
2297 cit != formats.end(); ++cit) {
2298 Format const * format =
2299 system_formats.getFormat(cit->name());
2301 format->extension() != cit->extension() ||
2302 format->prettyname() != cit->prettyname() ||
2303 format->shortcut() != cit->shortcut() ||
2304 format->viewer() != cit->viewer() ||
2305 format->editor() != cit->editor() ||
2306 format->documentFormat() != cit->documentFormat() ||
2307 format->vectorFormat() != cit->vectorFormat()) {
2308 os << "\\format \"" << cit->name() << "\" \""
2309 << cit->extension() << "\" \""
2310 << cit->prettyname() << "\" \""
2311 << cit->shortcut() << "\" \""
2312 << escapeCommand(cit->viewer()) << "\" \""
2313 << escapeCommand(cit->editor()) << "\" \"";
2314 vector<string> flags;
2315 if (cit->documentFormat())
2316 flags.push_back("document");
2317 if (cit->vectorFormat())
2318 flags.push_back("vector");
2319 os << getStringFromVector(flags);
2324 // Look for deleted formats
2325 for (Formats::const_iterator cit = system_formats.begin();
2326 cit != system_formats.end(); ++cit)
2327 if (!formats.getFormat(cit->name()))
2328 os << "\\format \"" << cit->name()
2329 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2338 << "# CONVERTERS SECTION ##########################\n"
2342 // Look for new converters
2343 for (Converters::const_iterator cit = theConverters().begin();
2344 cit != theConverters().end(); ++cit) {
2345 Converter const * converter =
2346 theSystemConverters().getConverter(cit->from,
2349 converter->command != cit->command ||
2350 converter->flags != cit->flags)
2351 os << "\\converter \"" << cit->from << "\" \""
2352 << cit->to << "\" \""
2353 << escapeCommand(cit->command) << "\" \""
2354 << cit->flags << "\"\n";
2357 // New/modifed converters
2358 for (Converters::const_iterator cit = theSystemConverters().begin();
2359 cit != theSystemConverters().end(); ++cit)
2360 if (!theConverters().getConverter(cit->from, cit->to))
2361 os << "\\converter \"" << cit->from
2362 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2369 << "# COPIERS SECTION ##########################\n"
2372 // Look for new movers
2373 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2374 Movers::const_iterator const sysend = theSystemMovers().end();
2375 Movers::const_iterator it = theMovers().begin();
2376 Movers::const_iterator end = theMovers().end();
2378 for (; it != end; ++it) {
2379 Movers::const_iterator const sysit =
2380 find_if(sysbegin, sysend, SameMover(*it));
2381 if (sysit == sysend) {
2382 string const & fmt = it->first;
2383 string const & command =
2384 it->second.command();
2386 os << "\\copier " << fmt
2387 << " \"" << escapeCommand(command) << "\"\n";
2393 // We don't actually delete SpecialisedMover(s) from the
2394 // map, just clear their 'command', so there's no need
2395 // to test for anything else.
2403 string const LyXRC::getDescription(LyXRCTags tag)
2408 case RC_ACCEPT_COMPOUND:
2409 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2413 case RC_USE_ALT_LANG:
2414 str = _("Specify an alternate language. The default is to use the language of the document.");
2417 case RC_PLAINTEXT_ROFF_COMMAND:
2418 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.");
2421 case RC_PLAINTEXT_LINELEN:
2422 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.");
2425 case RC_AUTOREGIONDELETE:
2426 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2429 case RC_AUTORESET_OPTIONS:
2430 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2434 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2437 case RC_AUTO_NUMBER:
2440 case RC_BACKUPDIR_PATH:
2441 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.");
2444 case RC_BIBTEX_COMMAND:
2445 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2449 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2452 case RC_CHECKLASTFILES:
2453 str = _("Select to check whether the lastfiles still exist.");
2456 case RC_CHKTEX_COMMAND:
2457 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2466 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2467 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.");
2470 case RC_MAC_LIKE_WORD_MOVEMENT:
2471 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2474 case RC_SHOW_MACRO_LABEL:
2475 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2478 case RC_CUSTOM_EXPORT_COMMAND:
2481 case RC_CUSTOM_EXPORT_FORMAT:
2484 case RC_DATE_INSERT_FORMAT:
2485 //xgettext:no-c-format
2486 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2490 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2493 case RC_DEFAULT_LANGUAGE:
2494 str = _("New documents will be assigned this language.");
2497 case RC_DEFAULT_PAPERSIZE:
2498 str = _("Specify the default paper size.");
2501 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2502 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2505 case RC_DISPLAY_GRAPHICS:
2506 str = _("Select how LyX will display any graphics.");
2509 case RC_DOCUMENTPATH:
2510 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2514 case RC_USE_ESC_CHARS:
2515 str = _("Specify additional chars that can be part of a word.");
2518 case RC_EXAMPLEPATH:
2519 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2522 case RC_FONT_ENCODING:
2523 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2529 case RC_INDEX_COMMAND:
2530 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\".");
2533 case RC_NOMENCL_COMMAND:
2534 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2541 case RC_KBMAP_PRIMARY:
2542 case RC_KBMAP_SECONDARY:
2543 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.");
2546 case RC_LABEL_INIT_LENGTH:
2547 str = _("Maximum number of words in the initialization string for a new label");
2550 case RC_LANGUAGE_AUTO_BEGIN:
2551 str = _("Select if a language switching command is needed at the beginning of the document.");
2554 case RC_LANGUAGE_AUTO_END:
2555 str = _("Select if a language switching command is needed at the end of the document.");
2558 case RC_LANGUAGE_COMMAND_BEGIN:
2559 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.");
2562 case RC_LANGUAGE_COMMAND_END:
2563 str = _("The LaTeX command for changing back to the language of the document.");
2566 case RC_LANGUAGE_COMMAND_LOCAL:
2567 str = _("The LaTeX command for local changing of the language.");
2570 case RC_LANGUAGE_GLOBAL_OPTIONS:
2571 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2574 case RC_LANGUAGE_PACKAGE:
2575 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2578 case RC_LANGUAGE_USE_BABEL:
2579 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2582 case RC_USELASTFILEPOS:
2583 str = _("De-select if you do not want LyX to scroll to saved position.");
2586 case RC_LOADSESSION:
2587 str = _("De-select to prevent loading files opened from the last LyX session.");
2590 case RC_MAKE_BACKUP:
2591 str = _("De-select if you don't want LyX to create backup files.");
2594 case RC_MARK_FOREIGN_LANGUAGE:
2595 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2598 case RC_MOUSE_WHEEL_SPEED:
2599 str = bformat(_("The scrolling speed of the mouse wheel."),
2603 case RC_COMPLETION_POPUP_DELAY:
2604 str = _("The completion popup delay.");
2607 case RC_COMPLETION_POPUP_MATH:
2608 str = _("Select to display the completion popup in math mode.");
2611 case RC_COMPLETION_POPUP_TEXT:
2612 str = _("Select to display the completion popup in text mode.");
2615 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2616 str = _("Show the completion popup without delay after non-unique completion attempt.");
2619 case RC_COMPLETION_POPUP_TEXT:
2620 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2623 case RC_COMPLETION_POPUP_DELAY:
2624 str = _("The inline completion delay.");
2627 case RC_COMPLETION_INLINE_MATH:
2628 str = _("Select to display the inline completion in math mode.");
2631 case RC_COMPLETION_INLINE_TEXT:
2632 str = _("Select to display the inline completion in text mode.");
2635 case RC_COMPLETION_INLINE_DOTS:
2636 str = _("Use \"...\" to shorten long completions.");
2639 case RC_NUMLASTFILES:
2640 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2644 case RC_PATH_PREFIX:
2645 str = _("Specify those directories which should be "
2646 "prepended to the PATH environment variable. "
2647 "Use the OS native format.");
2651 case RC_USE_PERS_DICT:
2652 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2656 str = _("Shows a typeset preview of things such as math");
2659 case RC_PREVIEW_HASHED_LABELS:
2660 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2663 case RC_PREVIEW_SCALE_FACTOR:
2664 str = _("Scale the preview size to suit.");
2667 case RC_PRINTCOLLCOPIESFLAG:
2668 str = _("The option for specifying whether the copies should be collated.");
2671 case RC_PRINTCOPIESFLAG:
2672 str = _("The option for specifying the number of copies to print.");
2676 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2679 case RC_PRINTEVENPAGEFLAG:
2680 str = _("The option to print only even pages.");
2683 case RC_PRINTEXSTRAOPTIONS:
2684 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2687 case RC_PRINTFILEEXTENSION:
2688 str = _("Extension of printer program output file. Usually \".ps\".");
2691 case RC_PRINTLANDSCAPEFLAG:
2692 str = _("The option to print out in landscape.");
2695 case RC_PRINTODDPAGEFLAG:
2696 str = _("The option to print only odd pages.");
2699 case RC_PRINTPAGERANGEFLAG:
2700 str = _("The option for specifying a comma-separated list of pages to print.");
2703 case RC_PRINTPAPERDIMENSIONFLAG:
2704 str = _("Option to specify the dimensions of the print paper.");
2707 case RC_PRINTPAPERFLAG:
2708 str = _("The option to specify paper type.");
2711 case RC_PRINTREVERSEFLAG:
2712 str = _("The option to reverse the order of the pages printed.");
2715 case RC_PRINTSPOOL_COMMAND:
2716 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.");
2719 case RC_PRINTSPOOL_PRINTERPREFIX:
2720 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.");
2723 case RC_PRINTTOFILE:
2724 str = _("Option to pass to the print program to print to a file.");
2727 case RC_PRINTTOPRINTER:
2728 str = _("Option to pass to the print program to print on a specific printer.");
2731 case RC_PRINT_ADAPTOUTPUT:
2732 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2735 case RC_PRINT_COMMAND:
2736 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2739 case RC_RTL_SUPPORT:
2740 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2743 case RC_VISUAL_CURSOR:
2744 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2748 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2751 case RC_SCREEN_FONT_ROMAN:
2752 case RC_SCREEN_FONT_SANS:
2753 case RC_SCREEN_FONT_TYPEWRITER:
2754 str = _("The screen fonts used to display the text while editing.");
2757 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2758 case RC_SCREEN_FONT_SANS_FOUNDRY:
2759 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2762 case RC_SCREEN_FONT_SCALABLE:
2763 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.");
2766 case RC_SCREEN_FONT_SIZES:
2767 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2770 case RC_SCREEN_ZOOM:
2771 //xgettext:no-c-format
2772 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2775 case RC_GEOMETRY_SESSION:
2776 str = _("Allow session manager to save and restore windows geometry.");
2780 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2786 case RC_SHOW_BANNER:
2787 str = _("De-select if you don't want the startup banner.");
2790 case RC_TEMPDIRPATH:
2791 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2794 case RC_TEMPLATEPATH:
2795 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2798 case RC_TEX_ALLOWS_SPACES:
2801 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2805 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2817 case RC_USE_INP_ENC:
2818 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.");
2821 case RC_USE_TOOLTIP:
2822 str = _("Enable the automatic appearance of tool tips in the work area.");
2825 case RC_USE_PIXMAP_CACHE:
2826 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2829 case RC_USE_SPELL_LIB:
2832 case RC_VIEWDVI_PAPEROPTION:
2833 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2848 // The global instance
2851 // The global copy of the system lyxrc entries (everything except preferences)