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:
387 if (lexrc.getString() != "\\plaintest_roff_command")
388 lexrc.printError("Unknown tag `$$Token'");
390 case Lexer::LEX_FEOF:
395 switch (static_cast<LyXRCTags>(le)) {
396 case RC_INPUT: // Include file
399 libFileSearch(string(),
402 lexrc.printError("Error reading "
403 "included file: " + tmp.absFilename());
409 bind_file = os::internal_path(lexrc.getString());
414 def_file = os::internal_path(lexrc.getString());
419 ui_file = os::internal_path(lexrc.getString());
422 case RC_AUTORESET_OPTIONS:
423 lexrc >> auto_reset_options;
426 case RC_DISPLAY_GRAPHICS:
428 display_graphics = lexrc.getString() == "true";
431 case RC_TEX_EXPECTS_WINDOWS_PATHS:
432 lexrc >> windows_style_tex_paths;
435 case RC_TEX_ALLOWS_SPACES:
436 lexrc >> tex_allows_spaces;
443 case RC_KBMAP_PRIMARY:
445 string const kmap(os::internal_path(lexrc.getString()));
448 } else if (!libFileSearch("kbd", kmap,
450 primary_kbmap = kmap;
452 lexrc.printError("LyX: Keymap `$$Token' not found");
457 case RC_KBMAP_SECONDARY:
459 string const kmap(os::internal_path(lexrc.getString()));
462 } else if (!libFileSearch("kbd", kmap,
464 secondary_kbmap = kmap;
466 lexrc.printError("LyX: Keymap `$$Token' not found");
471 case RC_FONT_ENCODING:
479 case RC_PRINT_COMMAND:
480 if (lexrc.next(true)) {
481 print_command = lexrc.getString();
485 case RC_PRINTEVENPAGEFLAG:
486 lexrc >> print_evenpage_flag;
489 case RC_PRINTODDPAGEFLAG:
490 lexrc >> print_oddpage_flag;
493 case RC_PRINTPAGERANGEFLAG:
494 lexrc >> print_pagerange_flag;
497 case RC_PRINTCOPIESFLAG:
498 lexrc >> print_copies_flag;
501 case RC_PRINTCOLLCOPIESFLAG:
502 lexrc >> print_collcopies_flag;
505 case RC_PRINTREVERSEFLAG:
506 lexrc >> print_reverse_flag;
509 case RC_PRINTLANDSCAPEFLAG:
510 lexrc >> print_landscape_flag;
513 case RC_PRINTTOPRINTER:
514 lexrc >> print_to_printer;
517 case RC_PRINT_ADAPTOUTPUT:
518 lexrc >> print_adapt_output;
523 print_to_file = os::internal_path(lexrc.getString());
527 case RC_PRINTFILEEXTENSION:
528 lexrc >> print_file_extension;
531 case RC_PRINTEXSTRAOPTIONS:
532 lexrc >> print_extra_options;
535 case RC_PRINTSPOOL_COMMAND:
536 if (lexrc.next(true)) {
537 print_spool_command = lexrc.getString();
541 case RC_PRINTSPOOL_PRINTERPREFIX:
542 lexrc >> print_spool_printerprefix;
545 case RC_PRINTPAPERDIMENSIONFLAG:
546 lexrc >> print_paper_dimension_flag;
549 case RC_PRINTPAPERFLAG:
550 lexrc >> print_paper_flag;
553 case RC_CUSTOM_EXPORT_COMMAND:
554 lexrc >> custom_export_command;
557 case RC_CUSTOM_EXPORT_FORMAT:
558 lexrc >> custom_export_format;
561 case RC_DEFAULT_PAPERSIZE:
563 string const size = ascii_lowercase(lexrc.getString());
564 if (size == "usletter")
565 default_papersize = PAPER_USLETTER;
566 else if (size == "legal")
567 default_papersize = PAPER_USLEGAL;
568 else if (size == "executive")
569 default_papersize = PAPER_USEXECUTIVE;
570 else if (size == "a3")
571 default_papersize = PAPER_A3;
572 else if (size == "a4")
573 default_papersize = PAPER_A4;
574 else if (size == "a5")
575 default_papersize = PAPER_A5;
576 else if (size == "b5")
577 default_papersize = PAPER_B5;
578 else if (size == "default")
579 default_papersize = PAPER_DEFAULT;
583 case RC_VIEWDVI_PAPEROPTION:
585 view_dvi_paper_option = lexrc.getString();
587 view_dvi_paper_option.erase();
590 case RC_CHKTEX_COMMAND:
591 if (lexrc.next(true)) {
592 chktex_command = lexrc.getString();
596 case RC_BIBTEX_COMMAND:
597 if (lexrc.next(true)) {
598 bibtex_command = lexrc.getString();
602 case RC_INDEX_COMMAND:
603 if (lexrc.next(true)) {
604 index_command = lexrc.getString();
608 case RC_NOMENCL_COMMAND:
609 if (lexrc.next(true)) {
610 nomencl_command = lexrc.getString();
622 case RC_GEOMETRY_SESSION:
623 lexrc >> allow_geometry_session;
626 case RC_SCREEN_FONT_SIZES:
627 lexrc >> font_sizes[FONT_SIZE_TINY];
628 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
629 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
630 lexrc >> font_sizes[FONT_SIZE_SMALL];
631 lexrc >> font_sizes[FONT_SIZE_NORMAL];
632 lexrc >> font_sizes[FONT_SIZE_LARGE];
633 lexrc >> font_sizes[FONT_SIZE_LARGER];
634 lexrc >> font_sizes[FONT_SIZE_LARGEST];
635 lexrc >> font_sizes[FONT_SIZE_HUGE];
636 lexrc >> font_sizes[FONT_SIZE_HUGER];
639 case RC_SCREEN_FONT_SCALABLE:
640 lexrc >> use_scalable_fonts;
647 case RC_DOCUMENTPATH:
649 document_path = os::internal_path(lexrc.getString());
650 document_path = expandPath(document_path);
656 example_path = os::internal_path(lexrc.getString());
657 example_path = expandPath(example_path);
661 case RC_TEMPLATEPATH:
663 template_path = os::internal_path(lexrc.getString());
664 template_path = expandPath(template_path);
670 tempdir_path = os::internal_path(lexrc.getString());
671 tempdir_path = expandPath(tempdir_path);
677 LYXERR0("Ignoring obsolete use_tempdir flag.");
680 case RC_USELASTFILEPOS:
681 lexrc >> use_lastfilepos;
685 lexrc >> load_session;
688 case RC_MOUSE_WHEEL_SPEED:
689 lexrc >> mouse_wheel_speed;
692 case RC_COMPLETION_INLINE_DELAY:
693 lexrc >> completion_inline_delay;
696 case RC_COMPLETION_INLINE_MATH:
697 lexrc >> completion_inline_math;
700 case RC_COMPLETION_INLINE_TEXT:
701 lexrc >> completion_inline_text;
704 case RC_COMPLETION_INLINE_DOTS:
705 lexrc >> completion_inline_dots;
708 case RC_COMPLETION_POPUP_DELAY:
709 lexrc >> completion_popup_delay;
712 case RC_COMPLETION_POPUP_MATH:
713 lexrc >> completion_popup_math;
716 case RC_COMPLETION_POPUP_TEXT:
717 lexrc >> completion_popup_text;
720 case RC_COMPLETION_CURSOR_TEXT:
721 lexrc >> completion_cursor_text;
724 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
725 lexrc >> completion_popup_after_complete;
728 case RC_NUMLASTFILES:
729 lexrc >> num_lastfiles;
732 case RC_CHECKLASTFILES:
733 lexrc >> check_lastfiles;
736 case RC_SCREEN_FONT_ROMAN:
738 roman_font_name = lexrc.getString();
739 oldFontFormat(roman_font_name,
744 case RC_SCREEN_FONT_SANS:
746 sans_font_name = lexrc.getString();
747 oldFontFormat(sans_font_name, sans_font_foundry);
751 case RC_SCREEN_FONT_TYPEWRITER:
753 typewriter_font_name = lexrc.getString();
754 oldFontFormat(typewriter_font_name,
755 typewriter_font_foundry);
759 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
760 lexrc >> roman_font_foundry;
763 case RC_SCREEN_FONT_SANS_FOUNDRY:
764 lexrc >> sans_font_foundry;
767 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
768 lexrc >> typewriter_font_foundry;
773 lexrc.printError("Missing color tag.");
776 string lyx_name = lexrc.getString();
779 lexrc.printError("Missing color name for color: `$$Token'");
782 string x11_name = lexrc.getString();
784 ColorCode const col =
785 lcolor.getFromLyXName(lyx_name);
786 if (col == Color_none ||
787 col == Color_inherit ||
791 if (!lcolor.setColor(col, x11_name))
792 LYXERR0("Bad lyxrc set_color for " << lyx_name);
796 case RC_AUTOREGIONDELETE:
797 // Auto region delete defaults to true
798 lexrc >> auto_region_delete;
803 lyxpipes = os::internal_path(lexrc.getString());
804 lyxpipes = expandPath(lyxpipes);
808 case RC_CURSOR_FOLLOWS_SCROLLBAR:
809 lexrc >> cursor_follows_scrollbar;
812 case RC_MAC_LIKE_WORD_MOVEMENT:
813 lexrc >> mac_like_word_movement;
816 case RC_MACRO_EDIT_STYLE:
818 switch (lexrc.getInteger()) {
819 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
820 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
821 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
826 case RC_DIALOGS_ICONIFY_WITH_MAIN:
827 lexrc >> dialogs_iconify_with_main;
830 case RC_PLAINTEXT_ROFF_COMMAND:
831 (void) lexrc.getString(); // Obsoleted in 1.7
833 case RC_PLAINTEXT_LINELEN:
834 lexrc >> plaintext_linelen;
836 // Spellchecker settings:
837 case RC_ACCEPT_COMPOUND:
838 lexrc >> spellchecker_accept_compound;
841 lexrc >> spellchecker_use_input_encoding;
843 case RC_USE_ALT_LANG:
844 lexrc >> spellchecker_use_alt_lang;
846 case RC_USE_PERS_DICT:
847 lexrc >> spellchecker_use_pers_dict;
850 lexrc >> use_tooltip;
852 case RC_USE_PIXMAP_CACHE:
853 lexrc >> use_pixmap_cache;
855 case RC_USE_ESC_CHARS:
856 lexrc >> spellchecker_use_esc_chars;
859 lexrc >> spellchecker_alt_lang;
863 spellchecker_pers_dict = os::internal_path(lexrc.getString());
866 lexrc >> spellchecker_esc_chars;
869 lexrc >> make_backup;
871 case RC_BACKUPDIR_PATH:
873 backupdir_path = os::internal_path(lexrc.getString());
874 backupdir_path = expandPath(backupdir_path);
877 case RC_DATE_INSERT_FORMAT:
878 lexrc >> date_insert_format;
880 case RC_LANGUAGE_PACKAGE:
881 lexrc >> language_package;
883 case RC_LANGUAGE_AUTO_BEGIN:
884 lexrc >> language_auto_begin;
886 case RC_LANGUAGE_AUTO_END:
887 lexrc >> language_auto_end;
889 case RC_LANGUAGE_GLOBAL_OPTIONS:
890 lexrc >> language_global_options;
892 case RC_LANGUAGE_USE_BABEL:
893 lexrc >> language_use_babel;
895 case RC_LANGUAGE_COMMAND_BEGIN:
896 lexrc >> language_command_begin;
898 case RC_LANGUAGE_COMMAND_END:
899 lexrc >> language_command_end;
901 case RC_LANGUAGE_COMMAND_LOCAL:
902 lexrc >> language_command_local;
905 lexrc >> rtl_support;
907 case RC_VISUAL_CURSOR:
908 lexrc >> visual_cursor;
911 lexrc >> auto_number;
913 case RC_MARK_FOREIGN_LANGUAGE:
914 lexrc >> mark_foreign_language;
920 fmt = lexrc.getString();
921 if (lexrc.next(true))
922 command = lexrc.getString();
923 setMover(fmt, command);
928 string from, to, command, flags;
930 from = lexrc.getString();
932 to = lexrc.getString();
933 if (lexrc.next(true))
934 command = lexrc.getString();
936 flags = lexrc.getString();
938 theConverters().erase(from, to);
940 theConverters().add(from, to, command, flags);
943 // compatibility with versions older than 1.4.0 only
945 string format, command;
946 lexrc >> format >> command;
947 formats.setViewer(format, command);
951 string format, extension, prettyname, shortcut;
952 lexrc >> format >> extension >> prettyname >> shortcut;
953 string viewer, editor;
954 if (lexrc.next(true))
955 viewer = lexrc.getString();
956 if (lexrc.next(true))
957 editor = lexrc.getString();
959 // Hack to ensure compatibility with versions older
961 int le = lexrc.lex();
962 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
963 flags = lexrc.getString();
964 if (le != Lexer::LEX_DATA) {
965 // We have got a known token.
966 // Therefore this is an old style
967 // format definition without
969 lexrc.pushToken(flags);
973 int flgs = Format::none;
974 while (!flags.empty()) {
976 flags = split(flags, flag, ',');
977 if (flag == "document")
978 flgs |= Format::document;
979 else if (flag == "vector")
980 flgs |= Format::vector;
982 LYXERR0("Ignoring unknown flag `"
983 << flag << "' for format `"
986 if (prettyname.empty()) {
987 if (theConverters().formatIsUsed(format))
988 LYXERR0("Can't delete format " << format);
990 formats.erase(format);
992 formats.add(format, extension, prettyname,
993 shortcut, viewer, editor, flgs);
997 case RC_DEFAULT_LANGUAGE:
998 lexrc >> default_language;
1001 case RC_GUI_LANGUAGE:
1002 lexrc >> gui_language;
1005 case RC_LABEL_INIT_LENGTH:
1006 lexrc >> label_init_length;
1009 case RC_SHOW_BANNER:
1010 lexrc >> show_banner;
1015 string const tmp = lexrc.getString();
1016 if (tmp == "true" || tmp == "on")
1017 preview = PREVIEW_ON;
1018 else if (tmp == "no_math")
1019 preview = PREVIEW_NO_MATH;
1021 preview = PREVIEW_OFF;
1022 if (tmp != "false" && tmp != "off")
1023 LYXERR0("Unrecognized preview status \""
1029 case RC_PREVIEW_HASHED_LABELS:
1030 lexrc >> preview_hashed_labels;
1033 case RC_PREVIEW_SCALE_FACTOR:
1034 lexrc >> preview_scale_factor;
1041 lexrc >> user_email;
1044 case RC_PATH_PREFIX:
1045 lexrc >> path_prefix;
1048 case RC_USE_CONVERTER_CACHE:
1049 lexrc >> use_converter_cache;
1051 case RC_CONVERTER_CACHE_MAXAGE:
1052 lexrc >> converter_cache_maxage;
1055 case RC_SORT_LAYOUTS:
1056 lexrc >> sort_layouts;
1058 case RC_GROUP_LAYOUTS:
1059 lexrc >> group_layouts;
1061 case RC_FULL_SCREEN_LIMIT:
1062 lexrc >> full_screen_limit;
1064 case RC_FULL_SCREEN_TOOLBARS:
1065 lexrc >> full_screen_toolbars;
1067 case RC_FULL_SCREEN_SCROLLBAR:
1068 lexrc >> full_screen_scrollbar;
1070 case RC_FULL_SCREEN_TABBAR:
1071 lexrc >> full_screen_tabbar;
1073 case RC_FULL_SCREEN_WIDTH:
1074 lexrc >> full_screen_width;
1076 case RC_OPEN_BUFFERS_IN_TABS:
1077 lexrc >> open_buffers_in_tabs;
1081 case RC_SPELL_COMMAND:
1082 (void) lexrc.getString();
1085 case RC_USE_SPELL_LIB:
1086 (void) lexrc.getString();
1090 break; // this is just a dummy
1094 /// Update converters data-structures
1095 theConverters().update(formats);
1096 theConverters().buildGraph();
1102 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1104 ofstream ofs(filename.toFilesystemEncoding().c_str());
1106 write(ofs, ignore_system_lyxrc);
1110 void LyXRC::print() const
1112 if (lyxerr.debugging())
1113 write(lyxerr, false);
1121 typedef pair<string, SpecialisedMover> Data;
1123 SameMover(Data const & comparison)
1124 : comparison_(comparison) {}
1126 bool operator()(Data const & data) const
1128 return data.first == comparison_.first &&
1129 data.second.command() == comparison_.second.command();
1139 // Escape \ and " so that LyXLex can read the string later
1140 string escapeCommand(string const & str) {
1141 return subst(subst(str , "\\", "\\\\"),
1148 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1150 LyXRCTags tag = RC_LAST;
1152 if (!name.empty()) {
1153 for (int i = 0; i != lyxrcCount; ++i)
1154 if ("\\" + name == lyxrcTags[i].tag)
1155 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1159 os << "# LyX " << lyx_version
1160 << " generated this file. If you want to make your own\n"
1161 << "# modifications you should do them from inside LyX and save.\n"
1164 // Why the switch you might ask. It is a trick to ensure that all
1165 // the elements in the LyXRCTags enum are handled. As you can see
1166 // there are no breaks at all. So it is just a huge fall-through.
1167 // The nice thing is that we will get a warning from the compiler
1168 // if we forget an element.
1172 // input/include files are not done here
1174 if (ignore_system_lyxrc ||
1175 bind_file != system_lyxrc.bind_file) {
1176 string const path = os::external_path(bind_file);
1177 os << "\\bind_file \"" << path << "\"\n";
1183 if (ignore_system_lyxrc ||
1184 def_file != system_lyxrc.def_file) {
1185 string const path = os::external_path(def_file);
1186 os << "\\def_file \"" << path << "\"\n";
1195 << "# MISC SECTION ######################################\n"
1197 // bind files are not done here.
1199 case RC_PATH_PREFIX:
1200 if (ignore_system_lyxrc ||
1201 path_prefix != system_lyxrc.path_prefix) {
1202 os << "\\path_prefix \"" << path_prefix << "\"\n";
1207 if (ignore_system_lyxrc ||
1208 ui_file != system_lyxrc.ui_file) {
1209 string const path = os::external_path(ui_file);
1210 os << "\\ui_file \"" << path << "\"\n";
1214 case RC_AUTOREGIONDELETE:
1215 if (ignore_system_lyxrc ||
1216 auto_region_delete != system_lyxrc.auto_region_delete) {
1217 os << "# Set to false to inhibit automatic replacement of\n"
1218 << "# the current selection.\n"
1219 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1224 case RC_AUTORESET_OPTIONS:
1225 if (ignore_system_lyxrc ||
1226 auto_reset_options != system_lyxrc.auto_reset_options) {
1227 os << "# Set to false to inhibit automatic reset of\n"
1228 << "# the class options to defaults on class change.\n"
1229 << "\\auto_reset_options "
1230 << convert<string>(auto_reset_options)
1236 if (ignore_system_lyxrc ||
1237 autosave != system_lyxrc.autosave) {
1238 os << "# The time interval between auto-saves in seconds.\n"
1239 << "\\autosave " << autosave << '\n';
1243 case RC_DISPLAY_GRAPHICS:
1244 if (ignore_system_lyxrc ||
1245 display_graphics != system_lyxrc.display_graphics) {
1246 os << "# Display graphics within LyX\n"
1248 << "\\display_graphics "
1249 << (display_graphics ? "true" : "false")
1254 case RC_SORT_LAYOUTS:
1255 if (ignore_system_lyxrc ||
1256 sort_layouts != system_lyxrc.sort_layouts) {
1257 os << "# Sort layouts alphabetically.\n"
1258 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1262 case RC_GROUP_LAYOUTS:
1263 if (ignore_system_lyxrc ||
1264 group_layouts != system_lyxrc.group_layouts) {
1265 os << "# Group layouts by their category.\n"
1266 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1270 case RC_VIEWDVI_PAPEROPTION:
1271 if (ignore_system_lyxrc ||
1272 view_dvi_paper_option
1273 != system_lyxrc.view_dvi_paper_option) {
1274 os << "# Options used to specify paper size to the\n"
1275 << "# view_dvi_command (e.g. -paper)\n"
1276 << "\\view_dvi_paper_option \""
1277 << view_dvi_paper_option << "\"\n";
1281 case RC_DEFAULT_PAPERSIZE:
1282 if (ignore_system_lyxrc ||
1283 default_papersize != system_lyxrc.default_papersize) {
1284 os << "# The default papersize to use.\n"
1285 << "\\default_papersize \"";
1286 switch (default_papersize) {
1288 os << "default"; break;
1289 case PAPER_USLETTER:
1290 os << "usletter"; break;
1292 os << "legal"; break;
1293 case PAPER_USEXECUTIVE:
1294 os << "executive"; break;
1305 case PAPER_B4: break;
1311 case RC_CHKTEX_COMMAND:
1312 if (ignore_system_lyxrc ||
1313 chktex_command != system_lyxrc.chktex_command) {
1314 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1318 case RC_BIBTEX_COMMAND:
1319 if (ignore_system_lyxrc ||
1320 bibtex_command != system_lyxrc.bibtex_command) {
1321 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1325 case RC_INDEX_COMMAND:
1326 if (ignore_system_lyxrc ||
1327 index_command != system_lyxrc.index_command) {
1328 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1332 case RC_NOMENCL_COMMAND:
1333 if (ignore_system_lyxrc ||
1334 nomencl_command != system_lyxrc.nomencl_command) {
1335 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1339 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1340 if (ignore_system_lyxrc ||
1341 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1342 os << "\\tex_expects_windows_paths "
1343 << convert<string>(windows_style_tex_paths) << '\n';
1347 case RC_TEX_ALLOWS_SPACES:
1348 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1349 os << "\\tex_allows_spaces "
1350 << convert<string>(tex_allows_spaces) << '\n';
1355 if (ignore_system_lyxrc ||
1356 use_kbmap != system_lyxrc.use_kbmap) {
1357 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1361 case RC_KBMAP_PRIMARY:
1362 if (ignore_system_lyxrc ||
1363 primary_kbmap != system_lyxrc.primary_kbmap) {
1364 string const path = os::external_path(primary_kbmap);
1365 os << "\\kbmap_primary \"" << path << "\"\n";
1369 case RC_KBMAP_SECONDARY:
1370 if (ignore_system_lyxrc ||
1371 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1372 string const path = os::external_path(secondary_kbmap);
1373 os << "\\kbmap_secondary \"" << path << "\"\n";
1378 if (ignore_system_lyxrc ||
1379 lyxpipes != system_lyxrc.lyxpipes) {
1380 string const path = os::external_path(lyxpipes);
1381 os << "\\serverpipe \"" << path << "\"\n";
1385 case RC_DATE_INSERT_FORMAT:
1386 if (ignore_system_lyxrc ||
1387 date_insert_format != system_lyxrc.date_insert_format) {
1388 os << "\\date_insert_format \"" << date_insert_format
1393 case RC_LABEL_INIT_LENGTH:
1394 if (ignore_system_lyxrc ||
1395 label_init_length != system_lyxrc.label_init_length) {
1396 os << "\\label_init_length " << label_init_length
1403 os << "\\user_name \"" << user_name << "\"\n";
1408 os << "\\user_email \"" << user_email << "\"\n";
1412 case RC_SHOW_BANNER:
1413 if (ignore_system_lyxrc ||
1414 show_banner != system_lyxrc.show_banner) {
1415 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1421 if (ignore_system_lyxrc ||
1422 preview != system_lyxrc.preview) {
1428 case PREVIEW_NO_MATH:
1435 os << "\\preview " << status << '\n';
1440 case RC_PREVIEW_HASHED_LABELS:
1441 if (ignore_system_lyxrc ||
1442 preview_hashed_labels !=
1443 system_lyxrc.preview_hashed_labels) {
1444 os << "\\preview_hashed_labels "
1445 << convert<string>(preview_hashed_labels) << '\n';
1450 case RC_PREVIEW_SCALE_FACTOR:
1451 if (ignore_system_lyxrc ||
1452 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1453 os << "\\preview_scale_factor "
1454 << preview_scale_factor << '\n';
1459 case RC_USE_CONVERTER_CACHE:
1460 if (ignore_system_lyxrc ||
1461 use_converter_cache != system_lyxrc.use_converter_cache) {
1462 os << "\\use_converter_cache "
1463 << convert<string>(use_converter_cache) << '\n';
1468 case RC_CONVERTER_CACHE_MAXAGE:
1469 if (ignore_system_lyxrc ||
1470 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1471 os << "\\converter_cache_maxage "
1472 << converter_cache_maxage << '\n';
1478 << "# SCREEN & FONTS SECTION ############################\n"
1482 if (ignore_system_lyxrc ||
1483 dpi != system_lyxrc.dpi) {
1484 os << "\\screen_dpi " << dpi << '\n';
1488 case RC_SCREEN_ZOOM:
1489 if (ignore_system_lyxrc ||
1490 zoom != system_lyxrc.zoom) {
1491 os << "\\screen_zoom " << zoom << '\n';
1495 case RC_GEOMETRY_SESSION:
1496 if (ignore_system_lyxrc ||
1497 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1498 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1503 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1504 if (ignore_system_lyxrc ||
1505 cursor_follows_scrollbar
1506 != system_lyxrc.cursor_follows_scrollbar) {
1507 os << "\\cursor_follows_scrollbar "
1508 << convert<string>(cursor_follows_scrollbar) << '\n';
1512 case RC_MAC_LIKE_WORD_MOVEMENT:
1513 if (ignore_system_lyxrc ||
1514 mac_like_word_movement
1515 != system_lyxrc.mac_like_word_movement) {
1516 os << "\\mac_like_word_movement "
1517 << convert<string>(mac_like_word_movement) << '\n';
1521 case RC_MACRO_EDIT_STYLE:
1522 if (ignore_system_lyxrc ||
1524 != system_lyxrc.macro_edit_style) {
1525 os << "\\macro_edit_style ";
1526 switch (macro_edit_style) {
1527 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1528 case MACRO_EDIT_INLINE: os << "1\n"; break;
1529 case MACRO_EDIT_LIST: os << "2\n"; break;
1534 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1535 if (ignore_system_lyxrc ||
1536 dialogs_iconify_with_main
1537 != system_lyxrc.dialogs_iconify_with_main) {
1538 os << "\\dialogs_iconify_with_main "
1539 << convert<string>(dialogs_iconify_with_main) << '\n';
1543 case RC_SCREEN_FONT_ROMAN:
1544 if (ignore_system_lyxrc ||
1545 roman_font_name != system_lyxrc.roman_font_name) {
1546 os << "\\screen_font_roman \"" << roman_font_name
1551 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1552 if (ignore_system_lyxrc ||
1553 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1554 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1559 case RC_SCREEN_FONT_SANS:
1560 if (ignore_system_lyxrc ||
1561 sans_font_name != system_lyxrc.sans_font_name) {
1562 os << "\\screen_font_sans \"" << sans_font_name
1567 case RC_SCREEN_FONT_SANS_FOUNDRY:
1568 if (ignore_system_lyxrc ||
1569 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1570 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1575 case RC_SCREEN_FONT_TYPEWRITER:
1576 if (ignore_system_lyxrc ||
1577 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1578 os << "\\screen_font_typewriter \""
1579 << typewriter_font_name << "\"\n";
1583 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1584 if (ignore_system_lyxrc ||
1585 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1586 os << "\\screen_font_typewriter_foundry \""
1587 << typewriter_font_foundry << "\"\n";
1592 case RC_SCREEN_FONT_SCALABLE:
1593 if (ignore_system_lyxrc ||
1594 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1595 os << "\\screen_font_scalable "
1596 << convert<string>(use_scalable_fonts)
1601 case RC_SCREEN_FONT_SIZES:
1602 if (ignore_system_lyxrc ||
1603 font_sizes[FONT_SIZE_TINY]
1604 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1605 font_sizes[FONT_SIZE_SCRIPT]
1606 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1607 font_sizes[FONT_SIZE_FOOTNOTE]
1608 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1609 font_sizes[FONT_SIZE_SMALL]
1610 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1611 font_sizes[FONT_SIZE_NORMAL]
1612 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1613 font_sizes[FONT_SIZE_LARGE]
1614 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1615 font_sizes[FONT_SIZE_LARGER]
1616 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1617 font_sizes[FONT_SIZE_LARGEST]
1618 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1619 font_sizes[FONT_SIZE_HUGE]
1620 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1621 font_sizes[FONT_SIZE_HUGER]
1622 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1623 os.setf(ios::fixed);
1625 os << "\\screen_font_sizes"
1626 << ' ' << font_sizes[FONT_SIZE_TINY]
1627 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1628 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1629 << ' ' << font_sizes[FONT_SIZE_SMALL]
1630 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1631 << ' ' << font_sizes[FONT_SIZE_LARGE]
1632 << ' ' << font_sizes[FONT_SIZE_LARGER]
1633 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1634 << ' ' << font_sizes[FONT_SIZE_HUGE]
1635 << ' ' << font_sizes[FONT_SIZE_HUGER]
1640 case RC_FULL_SCREEN_LIMIT:
1641 if (ignore_system_lyxrc ||
1642 full_screen_limit != system_lyxrc.full_screen_limit) {
1643 os << "\\fullscreen_limit "
1644 << convert<string>(full_screen_limit)
1649 case RC_FULL_SCREEN_TOOLBARS:
1650 if (ignore_system_lyxrc ||
1651 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1652 os << "\\fullscreen_toolbars "
1653 << convert<string>(full_screen_toolbars)
1658 case RC_FULL_SCREEN_SCROLLBAR:
1659 if (ignore_system_lyxrc ||
1660 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1661 os << "\\fullscreen_scrollbar "
1662 << convert<string>(full_screen_scrollbar)
1667 case RC_FULL_SCREEN_TABBAR:
1668 if (ignore_system_lyxrc ||
1669 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1670 os << "\\fullscreen_tabbar "
1671 << convert<string>(full_screen_tabbar)
1676 case RC_FULL_SCREEN_WIDTH:
1677 if (ignore_system_lyxrc ||
1678 full_screen_width != system_lyxrc.full_screen_width) {
1679 os << "\\fullscreen_width "
1680 << convert<string>(full_screen_width)
1685 case RC_OPEN_BUFFERS_IN_TABS:
1686 if (ignore_system_lyxrc ||
1687 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1688 os << "\\open_buffers_in_tabs "
1689 << convert<string>(open_buffers_in_tabs)
1696 << "# COLOR SECTION ###################################\n"
1700 for (int i = 0; i < Color_ignore; ++i) {
1701 ColorCode lc = static_cast<ColorCode>(i);
1702 string const col = lcolor.getX11Name(lc);
1703 if (ignore_system_lyxrc
1704 || col != system_lcolor.getX11Name(lc)) {
1705 os << "\\set_color \""
1706 << lcolor.getLyXName(lc) << "\" \""
1714 << "# PRINTER SECTION ###################################\n"
1718 if (ignore_system_lyxrc ||
1719 printer != system_lyxrc.printer) {
1720 os << "\\printer \"" << printer << "\"\n";
1724 case RC_PRINT_ADAPTOUTPUT:
1725 if (ignore_system_lyxrc ||
1726 print_adapt_output != system_lyxrc.print_adapt_output) {
1727 os << "\\print_adapt_output "
1728 << convert<string>(print_adapt_output)
1733 case RC_PRINT_COMMAND:
1734 if (ignore_system_lyxrc ||
1735 print_command != system_lyxrc.print_command) {
1736 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1740 case RC_PRINTEXSTRAOPTIONS:
1741 if (ignore_system_lyxrc ||
1742 print_extra_options != system_lyxrc.print_extra_options) {
1743 os << "\\print_extra_options \"" << print_extra_options
1748 case RC_PRINTSPOOL_COMMAND:
1749 if (ignore_system_lyxrc ||
1750 print_spool_command != system_lyxrc.print_spool_command) {
1751 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1756 case RC_PRINTSPOOL_PRINTERPREFIX:
1757 if (ignore_system_lyxrc ||
1758 print_spool_printerprefix
1759 != system_lyxrc.print_spool_printerprefix) {
1760 os << "\\print_spool_printerprefix \""
1761 << print_spool_printerprefix << "\"\n";
1765 case RC_PRINTEVENPAGEFLAG:
1766 if (ignore_system_lyxrc ||
1767 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1768 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1773 case RC_PRINTODDPAGEFLAG:
1774 if (ignore_system_lyxrc ||
1775 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1776 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1781 case RC_PRINTREVERSEFLAG:
1782 if (ignore_system_lyxrc ||
1783 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1784 os << "\\print_reverse_flag \"" << print_reverse_flag
1789 case RC_PRINTLANDSCAPEFLAG:
1790 if (ignore_system_lyxrc ||
1791 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1792 os << "\\print_landscape_flag \"" << print_landscape_flag
1797 case RC_PRINTPAGERANGEFLAG:
1798 if (ignore_system_lyxrc ||
1799 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1800 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1805 case RC_PRINTCOPIESFLAG:
1806 if (ignore_system_lyxrc ||
1807 print_copies_flag != system_lyxrc.print_copies_flag) {
1808 os << "\\print_copies_flag \"" << print_copies_flag
1813 case RC_PRINTCOLLCOPIESFLAG:
1814 if (ignore_system_lyxrc ||
1815 print_collcopies_flag
1816 != system_lyxrc.print_collcopies_flag) {
1817 os << "\\print_collcopies_flag \""
1818 << print_collcopies_flag
1823 case RC_PRINTPAPERFLAG:
1824 if (ignore_system_lyxrc ||
1825 print_paper_flag != system_lyxrc.print_paper_flag) {
1826 os << "\\print_paper_flag \"" << print_paper_flag
1831 case RC_PRINTPAPERDIMENSIONFLAG:
1832 if (ignore_system_lyxrc ||
1833 print_paper_dimension_flag
1834 != system_lyxrc.print_paper_dimension_flag) {
1835 os << "\\print_paper_dimension_flag \""
1836 << print_paper_dimension_flag << "\"\n";
1840 case RC_PRINTTOPRINTER:
1841 if (ignore_system_lyxrc ||
1842 print_to_printer != system_lyxrc.print_to_printer) {
1843 os << "\\print_to_printer \"" << print_to_printer
1848 case RC_PRINTTOFILE:
1849 if (ignore_system_lyxrc ||
1850 print_to_file != system_lyxrc.print_to_file) {
1851 string const path = os::external_path(print_to_file);
1852 os << "\\print_to_file \"" << path << "\"\n";
1856 case RC_PRINTFILEEXTENSION:
1857 if (ignore_system_lyxrc ||
1858 print_file_extension != system_lyxrc.print_file_extension) {
1859 os << "\\print_file_extension \""
1860 << print_file_extension
1867 << "# EXPORT SECTION ####################################\n"
1870 case RC_CUSTOM_EXPORT_COMMAND:
1871 if (ignore_system_lyxrc ||
1872 custom_export_command
1873 != system_lyxrc.custom_export_command) {
1874 os << "\\custom_export_command \""
1875 << custom_export_command
1880 case RC_CUSTOM_EXPORT_FORMAT:
1881 if (ignore_system_lyxrc ||
1882 custom_export_format
1883 != system_lyxrc.custom_export_format) {
1884 os << "\\custom_export_format \"" << custom_export_format
1891 << "# TEX SECTION #######################################\n"
1894 case RC_FONT_ENCODING:
1895 if (ignore_system_lyxrc ||
1896 fontenc != system_lyxrc.fontenc) {
1897 os << "\\font_encoding \"" << fontenc << "\"\n";
1903 << "# FILE SECTION ######################################\n"
1906 case RC_DOCUMENTPATH:
1907 if (ignore_system_lyxrc ||
1908 document_path != system_lyxrc.document_path) {
1909 string const path = os::external_path(document_path);
1910 os << "\\document_path \"" << path << "\"\n";
1914 case RC_USELASTFILEPOS:
1915 if (ignore_system_lyxrc ||
1916 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1917 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1922 case RC_LOADSESSION:
1923 if (ignore_system_lyxrc ||
1924 load_session != system_lyxrc.load_session) {
1925 os << "\\load_session " << convert<string>(load_session)
1930 case RC_MOUSE_WHEEL_SPEED:
1931 if (ignore_system_lyxrc ||
1932 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1933 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1937 case RC_COMPLETION_INLINE_DELAY:
1938 if (ignore_system_lyxrc ||
1939 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1940 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1944 case RC_COMPLETION_INLINE_MATH:
1945 if (ignore_system_lyxrc ||
1946 completion_inline_math != system_lyxrc.completion_inline_math) {
1947 os << "\\completion_inline_math "
1948 << convert<string>(completion_inline_math) << '\n';
1952 case RC_COMPLETION_INLINE_TEXT:
1953 if (ignore_system_lyxrc ||
1954 completion_inline_text != system_lyxrc.completion_inline_text) {
1955 os << "\\completion_inline_text "
1956 << convert<string>(completion_inline_text) << '\n';
1960 case RC_COMPLETION_INLINE_DOTS:
1961 if (ignore_system_lyxrc ||
1962 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1963 os << "\\completion_inline_dots "
1964 << convert<string>(completion_inline_dots) << '\n';
1968 case RC_COMPLETION_POPUP_DELAY:
1969 if (ignore_system_lyxrc ||
1970 completion_popup_delay != system_lyxrc.completion_popup_delay) {
1971 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
1975 case RC_COMPLETION_POPUP_MATH:
1976 if (ignore_system_lyxrc ||
1977 completion_popup_math != system_lyxrc.completion_popup_math) {
1978 os << "\\completion_popup_math "
1979 << convert<string>(completion_popup_math) << '\n';
1983 case RC_COMPLETION_POPUP_TEXT:
1984 if (ignore_system_lyxrc ||
1985 completion_popup_text != system_lyxrc.completion_popup_text) {
1986 os << "\\completion_popup_text "
1987 << convert<string>(completion_popup_text) << '\n';
1991 case RC_COMPLETION_CURSOR_TEXT:
1992 if (ignore_system_lyxrc ||
1993 completion_cursor_text != system_lyxrc.completion_cursor_text) {
1994 os << "\\completion_cursor_text "
1995 << convert<string>(completion_cursor_text) << '\n';
1999 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2000 if (ignore_system_lyxrc ||
2001 completion_popup_after_complete
2002 != system_lyxrc.completion_popup_after_complete) {
2003 os << "\\completion_popup_after_complete "
2004 << convert<string>(completion_popup_after_complete) << '\n';
2008 case RC_NUMLASTFILES:
2009 if (ignore_system_lyxrc ||
2010 num_lastfiles != system_lyxrc.num_lastfiles) {
2011 os << "\\num_lastfiles " << num_lastfiles << '\n';
2015 case RC_CHECKLASTFILES:
2016 if (ignore_system_lyxrc ||
2017 check_lastfiles != system_lyxrc.check_lastfiles) {
2018 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2023 case RC_EXAMPLEPATH:
2024 if (ignore_system_lyxrc ||
2025 example_path != system_lyxrc.example_path) {
2026 string const path = os::external_path(example_path);
2027 os << "\\example_path \"" << path << "\"\n";
2031 case RC_TEMPLATEPATH:
2032 if (ignore_system_lyxrc ||
2033 template_path != system_lyxrc.template_path) {
2034 string const path = os::external_path(template_path);
2035 os << "\\template_path \"" << path << "\"\n";
2039 case RC_TEMPDIRPATH:
2040 if (ignore_system_lyxrc ||
2041 tempdir_path != system_lyxrc.tempdir_path) {
2042 string const path = os::external_path(tempdir_path);
2043 os << "\\tempdir_path \"" << path << "\"\n";
2051 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 1.7
2054 case RC_PLAINTEXT_LINELEN:
2055 if (ignore_system_lyxrc ||
2056 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2057 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2061 case RC_MAKE_BACKUP:
2062 if (ignore_system_lyxrc ||
2063 make_backup != system_lyxrc.make_backup) {
2064 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2068 case RC_BACKUPDIR_PATH:
2069 if (ignore_system_lyxrc ||
2070 backupdir_path != system_lyxrc.backupdir_path) {
2071 string const path = os::external_path(backupdir_path);
2072 os << "\\backupdir_path \"" << path << "\"\n";
2078 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2082 << "# SPELLCHECKER SECTION ##############################\n"
2084 case RC_SPELL_COMMAND:
2086 case RC_USE_SPELL_LIB:
2088 case RC_ACCEPT_COMPOUND:
2089 if (ignore_system_lyxrc ||
2090 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2091 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2096 case RC_USE_ALT_LANG:
2097 if (ignore_system_lyxrc ||
2098 spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
2099 os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
2105 if (ignore_system_lyxrc ||
2106 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2107 os << "\\alternate_language \"" << spellchecker_alt_lang
2112 case RC_USE_ESC_CHARS:
2113 if (ignore_system_lyxrc ||
2114 spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
2115 os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
2121 if (ignore_system_lyxrc ||
2122 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2123 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2127 case RC_USE_PERS_DICT:
2128 if (ignore_system_lyxrc ||
2129 spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
2130 os << "\\use_personal_dictionary "
2131 << convert<string>(spellchecker_use_pers_dict)
2136 case RC_USE_TOOLTIP:
2137 if (ignore_system_lyxrc ||
2138 use_tooltip != system_lyxrc.use_tooltip) {
2139 os << "\\use_tooltip "
2140 << convert<string>(use_tooltip)
2143 case RC_USE_PIXMAP_CACHE:
2144 if (ignore_system_lyxrc ||
2145 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2146 os << "\\use_pixmap_cache "
2147 << convert<string>(use_pixmap_cache)
2151 if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
2152 string const path = os::external_path(spellchecker_pers_dict);
2153 os << "\\personal_dictionary \"" << path << "\"\n";
2157 case RC_USE_INP_ENC:
2158 if (ignore_system_lyxrc ||
2159 spellchecker_use_input_encoding
2160 != system_lyxrc.spellchecker_use_input_encoding) {
2161 os << "\\use_input_encoding "
2162 << convert<string>(spellchecker_use_input_encoding)
2169 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2172 case RC_RTL_SUPPORT:
2173 if (ignore_system_lyxrc ||
2174 rtl_support != system_lyxrc.rtl_support) {
2175 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2179 case RC_VISUAL_CURSOR:
2180 if (ignore_system_lyxrc ||
2181 visual_cursor != system_lyxrc.visual_cursor) {
2182 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2186 case RC_LANGUAGE_PACKAGE:
2187 if (ignore_system_lyxrc ||
2188 language_package != system_lyxrc.language_package) {
2189 os << "\\language_package \"" << language_package
2194 case RC_LANGUAGE_GLOBAL_OPTIONS:
2195 if (ignore_system_lyxrc ||
2196 language_global_options
2197 != system_lyxrc.language_global_options) {
2198 os << "\\language_global_options \""
2199 << convert<string>(language_global_options)
2204 case RC_LANGUAGE_USE_BABEL:
2205 if (ignore_system_lyxrc ||
2206 language_use_babel != system_lyxrc.language_use_babel) {
2207 os << "\\language_use_babel \""
2208 << convert<string>(language_use_babel)
2213 case RC_LANGUAGE_COMMAND_BEGIN:
2214 if (ignore_system_lyxrc ||
2215 language_command_begin
2216 != system_lyxrc.language_command_begin) {
2217 os << "\\language_command_begin \""
2218 << language_command_begin
2223 case RC_LANGUAGE_COMMAND_END:
2224 if (ignore_system_lyxrc ||
2225 language_command_end
2226 != system_lyxrc.language_command_end) {
2227 os << "\\language_command_end \"" << language_command_end
2232 case RC_LANGUAGE_COMMAND_LOCAL:
2233 if (ignore_system_lyxrc ||
2234 language_command_local
2235 != system_lyxrc.language_command_local) {
2236 os << "\\language_command_local \""
2237 << language_command_local
2242 case RC_LANGUAGE_AUTO_BEGIN:
2243 if (ignore_system_lyxrc ||
2244 language_auto_begin != system_lyxrc.language_auto_begin) {
2245 os << "\\language_auto_begin "
2246 << convert<string>(language_auto_begin) << '\n';
2250 case RC_LANGUAGE_AUTO_END:
2251 if (ignore_system_lyxrc ||
2252 language_auto_end != system_lyxrc.language_auto_end) {
2253 os << "\\language_auto_end "
2254 << convert<string>(language_auto_end) << '\n';
2258 case RC_MARK_FOREIGN_LANGUAGE:
2259 if (ignore_system_lyxrc ||
2260 mark_foreign_language
2261 != system_lyxrc.mark_foreign_language) {
2262 os << "\\mark_foreign_language " <<
2263 convert<string>(mark_foreign_language) << '\n';
2269 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2272 case RC_AUTO_NUMBER:
2273 if (ignore_system_lyxrc ||
2274 auto_number != system_lyxrc.auto_number) {
2275 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2279 case RC_DEFAULT_LANGUAGE:
2280 if (ignore_system_lyxrc ||
2281 default_language != system_lyxrc.default_language) {
2282 os << "\\default_language " << default_language << '\n';
2286 case RC_GUI_LANGUAGE:
2287 if (ignore_system_lyxrc ||
2288 gui_language != system_lyxrc.gui_language) {
2289 os << "\\gui_language " << gui_language << '\n';
2295 << "# FORMATS SECTION ##########################\n"
2299 // New/modified formats
2300 for (Formats::const_iterator cit = formats.begin();
2301 cit != formats.end(); ++cit) {
2302 Format const * format =
2303 system_formats.getFormat(cit->name());
2305 format->extension() != cit->extension() ||
2306 format->prettyname() != cit->prettyname() ||
2307 format->shortcut() != cit->shortcut() ||
2308 format->viewer() != cit->viewer() ||
2309 format->editor() != cit->editor() ||
2310 format->documentFormat() != cit->documentFormat() ||
2311 format->vectorFormat() != cit->vectorFormat()) {
2312 os << "\\format \"" << cit->name() << "\" \""
2313 << cit->extension() << "\" \""
2314 << cit->prettyname() << "\" \""
2315 << cit->shortcut() << "\" \""
2316 << escapeCommand(cit->viewer()) << "\" \""
2317 << escapeCommand(cit->editor()) << "\" \"";
2318 vector<string> flags;
2319 if (cit->documentFormat())
2320 flags.push_back("document");
2321 if (cit->vectorFormat())
2322 flags.push_back("vector");
2323 os << getStringFromVector(flags);
2328 // Look for deleted formats
2329 for (Formats::const_iterator cit = system_formats.begin();
2330 cit != system_formats.end(); ++cit)
2331 if (!formats.getFormat(cit->name()))
2332 os << "\\format \"" << cit->name()
2333 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2342 << "# CONVERTERS SECTION ##########################\n"
2346 // Look for new converters
2347 for (Converters::const_iterator cit = theConverters().begin();
2348 cit != theConverters().end(); ++cit) {
2349 Converter const * converter =
2350 theSystemConverters().getConverter(cit->from,
2353 converter->command != cit->command ||
2354 converter->flags != cit->flags)
2355 os << "\\converter \"" << cit->from << "\" \""
2356 << cit->to << "\" \""
2357 << escapeCommand(cit->command) << "\" \""
2358 << cit->flags << "\"\n";
2361 // New/modifed converters
2362 for (Converters::const_iterator cit = theSystemConverters().begin();
2363 cit != theSystemConverters().end(); ++cit)
2364 if (!theConverters().getConverter(cit->from, cit->to))
2365 os << "\\converter \"" << cit->from
2366 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2373 << "# COPIERS SECTION ##########################\n"
2376 // Look for new movers
2377 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2378 Movers::const_iterator const sysend = theSystemMovers().end();
2379 Movers::const_iterator it = theMovers().begin();
2380 Movers::const_iterator end = theMovers().end();
2382 for (; it != end; ++it) {
2383 Movers::const_iterator const sysit =
2384 find_if(sysbegin, sysend, SameMover(*it));
2385 if (sysit == sysend) {
2386 string const & fmt = it->first;
2387 string const & command =
2388 it->second.command();
2390 os << "\\copier " << fmt
2391 << " \"" << escapeCommand(command) << "\"\n";
2397 // We don't actually delete SpecialisedMover(s) from the
2398 // map, just clear their 'command', so there's no need
2399 // to test for anything else.
2407 string const LyXRC::getDescription(LyXRCTags tag)
2412 case RC_ACCEPT_COMPOUND:
2413 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2417 case RC_USE_ALT_LANG:
2418 str = _("Specify an alternate language. The default is to use the language of the document.");
2421 case RC_PLAINTEXT_ROFF_COMMAND:
2422 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.");
2425 case RC_PLAINTEXT_LINELEN:
2426 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.");
2429 case RC_AUTOREGIONDELETE:
2430 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2433 case RC_AUTORESET_OPTIONS:
2434 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2438 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2441 case RC_AUTO_NUMBER:
2444 case RC_BACKUPDIR_PATH:
2445 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.");
2448 case RC_BIBTEX_COMMAND:
2449 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2453 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2456 case RC_CHECKLASTFILES:
2457 str = _("Select to check whether the lastfiles still exist.");
2460 case RC_CHKTEX_COMMAND:
2461 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2470 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2471 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.");
2474 case RC_MAC_LIKE_WORD_MOVEMENT:
2475 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2478 case RC_SHOW_MACRO_LABEL:
2479 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2482 case RC_CUSTOM_EXPORT_COMMAND:
2485 case RC_CUSTOM_EXPORT_FORMAT:
2488 case RC_DATE_INSERT_FORMAT:
2489 //xgettext:no-c-format
2490 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2494 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2497 case RC_DEFAULT_LANGUAGE:
2498 str = _("New documents will be assigned this language.");
2501 case RC_DEFAULT_PAPERSIZE:
2502 str = _("Specify the default paper size.");
2505 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2506 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2509 case RC_DISPLAY_GRAPHICS:
2510 str = _("Select how LyX will display any graphics.");
2513 case RC_DOCUMENTPATH:
2514 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2518 case RC_USE_ESC_CHARS:
2519 str = _("Specify additional chars that can be part of a word.");
2522 case RC_EXAMPLEPATH:
2523 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2526 case RC_FONT_ENCODING:
2527 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2533 case RC_INDEX_COMMAND:
2534 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\".");
2537 case RC_NOMENCL_COMMAND:
2538 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2545 case RC_KBMAP_PRIMARY:
2546 case RC_KBMAP_SECONDARY:
2547 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.");
2550 case RC_LABEL_INIT_LENGTH:
2551 str = _("Maximum number of words in the initialization string for a new label");
2554 case RC_LANGUAGE_AUTO_BEGIN:
2555 str = _("Select if a language switching command is needed at the beginning of the document.");
2558 case RC_LANGUAGE_AUTO_END:
2559 str = _("Select if a language switching command is needed at the end of the document.");
2562 case RC_LANGUAGE_COMMAND_BEGIN:
2563 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.");
2566 case RC_LANGUAGE_COMMAND_END:
2567 str = _("The LaTeX command for changing back to the language of the document.");
2570 case RC_LANGUAGE_COMMAND_LOCAL:
2571 str = _("The LaTeX command for local changing of the language.");
2574 case RC_LANGUAGE_GLOBAL_OPTIONS:
2575 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2578 case RC_LANGUAGE_PACKAGE:
2579 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2582 case RC_LANGUAGE_USE_BABEL:
2583 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2586 case RC_USELASTFILEPOS:
2587 str = _("De-select if you do not want LyX to scroll to saved position.");
2590 case RC_LOADSESSION:
2591 str = _("De-select to prevent loading files opened from the last LyX session.");
2594 case RC_MAKE_BACKUP:
2595 str = _("De-select if you don't want LyX to create backup files.");
2598 case RC_MARK_FOREIGN_LANGUAGE:
2599 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2602 case RC_MOUSE_WHEEL_SPEED:
2603 str = bformat(_("The scrolling speed of the mouse wheel."),
2607 case RC_COMPLETION_POPUP_DELAY:
2608 str = _("The completion popup delay.");
2611 case RC_COMPLETION_POPUP_MATH:
2612 str = _("Select to display the completion popup in math mode.");
2615 case RC_COMPLETION_POPUP_TEXT:
2616 str = _("Select to display the completion popup in text mode.");
2619 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2620 str = _("Show the completion popup without delay after non-unique completion attempt.");
2623 case RC_COMPLETION_POPUP_TEXT:
2624 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2627 case RC_COMPLETION_POPUP_DELAY:
2628 str = _("The inline completion delay.");
2631 case RC_COMPLETION_INLINE_MATH:
2632 str = _("Select to display the inline completion in math mode.");
2635 case RC_COMPLETION_INLINE_TEXT:
2636 str = _("Select to display the inline completion in text mode.");
2639 case RC_COMPLETION_INLINE_DOTS:
2640 str = _("Use \"...\" to shorten long completions.");
2643 case RC_NUMLASTFILES:
2644 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2648 case RC_PATH_PREFIX:
2649 str = _("Specify those directories which should be "
2650 "prepended to the PATH environment variable. "
2651 "Use the OS native format.");
2655 case RC_USE_PERS_DICT:
2656 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2660 str = _("Shows a typeset preview of things such as math");
2663 case RC_PREVIEW_HASHED_LABELS:
2664 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2667 case RC_PREVIEW_SCALE_FACTOR:
2668 str = _("Scale the preview size to suit.");
2671 case RC_PRINTCOLLCOPIESFLAG:
2672 str = _("The option for specifying whether the copies should be collated.");
2675 case RC_PRINTCOPIESFLAG:
2676 str = _("The option for specifying the number of copies to print.");
2680 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2683 case RC_PRINTEVENPAGEFLAG:
2684 str = _("The option to print only even pages.");
2687 case RC_PRINTEXSTRAOPTIONS:
2688 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2691 case RC_PRINTFILEEXTENSION:
2692 str = _("Extension of printer program output file. Usually \".ps\".");
2695 case RC_PRINTLANDSCAPEFLAG:
2696 str = _("The option to print out in landscape.");
2699 case RC_PRINTODDPAGEFLAG:
2700 str = _("The option to print only odd pages.");
2703 case RC_PRINTPAGERANGEFLAG:
2704 str = _("The option for specifying a comma-separated list of pages to print.");
2707 case RC_PRINTPAPERDIMENSIONFLAG:
2708 str = _("Option to specify the dimensions of the print paper.");
2711 case RC_PRINTPAPERFLAG:
2712 str = _("The option to specify paper type.");
2715 case RC_PRINTREVERSEFLAG:
2716 str = _("The option to reverse the order of the pages printed.");
2719 case RC_PRINTSPOOL_COMMAND:
2720 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.");
2723 case RC_PRINTSPOOL_PRINTERPREFIX:
2724 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.");
2727 case RC_PRINTTOFILE:
2728 str = _("Option to pass to the print program to print to a file.");
2731 case RC_PRINTTOPRINTER:
2732 str = _("Option to pass to the print program to print on a specific printer.");
2735 case RC_PRINT_ADAPTOUTPUT:
2736 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2739 case RC_PRINT_COMMAND:
2740 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2743 case RC_RTL_SUPPORT:
2744 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2747 case RC_VISUAL_CURSOR:
2748 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2752 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2755 case RC_SCREEN_FONT_ROMAN:
2756 case RC_SCREEN_FONT_SANS:
2757 case RC_SCREEN_FONT_TYPEWRITER:
2758 str = _("The screen fonts used to display the text while editing.");
2761 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2762 case RC_SCREEN_FONT_SANS_FOUNDRY:
2763 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2766 case RC_SCREEN_FONT_SCALABLE:
2767 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.");
2770 case RC_SCREEN_FONT_SIZES:
2771 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2774 case RC_SCREEN_ZOOM:
2775 //xgettext:no-c-format
2776 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2779 case RC_GEOMETRY_SESSION:
2780 str = _("Allow session manager to save and restore windows geometry.");
2784 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2790 case RC_SHOW_BANNER:
2791 str = _("De-select if you don't want the startup banner.");
2794 case RC_TEMPDIRPATH:
2795 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2798 case RC_TEMPLATEPATH:
2799 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2802 case RC_TEX_ALLOWS_SPACES:
2805 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2809 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2821 case RC_USE_INP_ENC:
2822 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.");
2825 case RC_USE_TOOLTIP:
2826 str = _("Enable the automatic appearance of tool tips in the work area.");
2829 case RC_USE_PIXMAP_CACHE:
2830 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2833 case RC_USE_SPELL_LIB:
2836 case RC_VIEWDVI_PAPEROPTION:
2837 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2852 // The global instance
2855 // The global copy of the system lyxrc entries (everything except preferences)