3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
25 #include "Converter.h"
29 #include "FontEnums.h"
32 #include "graphics/GraphicsTypes.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/userinfo.h"
44 using namespace lyx::support;
48 namespace os = support::os;
52 // when adding something to this array keep it sorted!
53 LexerKeyword lyxrcTags[] = {
54 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
55 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
56 { "\\alternate_language", LyXRC::RC_ALT_LANG },
57 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
58 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
59 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
60 { "\\autosave", LyXRC::RC_AUTOSAVE },
61 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
62 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
63 { "\\bind_file", LyXRC::RC_BINDFILE },
64 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
65 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
66 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
67 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
68 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
69 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
70 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
71 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
72 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
73 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
74 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
75 { "\\converter", LyXRC::RC_CONVERTER },
76 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
77 { "\\copier", LyXRC::RC_COPIER },
78 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
79 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
80 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
81 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
82 { "\\def_file", LyXRC::RC_DEFFILE },
83 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
84 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
85 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
86 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
87 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
88 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
89 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
90 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
91 { "\\format", LyXRC::RC_FORMAT },
92 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
93 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
94 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
95 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
96 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
97 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
98 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
99 { "\\input", LyXRC::RC_INPUT },
100 { "\\kbmap", LyXRC::RC_KBMAP },
101 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
102 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
103 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
104 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
105 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
106 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
107 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
108 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
109 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
110 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
111 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
112 { "\\load_session", LyXRC::RC_LOADSESSION },
113 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
114 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
115 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
116 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
117 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
118 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
119 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
120 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
121 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
122 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
123 { "\\preview", LyXRC::RC_PREVIEW },
124 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
125 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
126 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
127 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
128 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
129 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
130 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
131 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
132 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
133 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
134 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
135 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
136 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
137 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
138 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
139 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
140 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
141 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
142 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
143 { "\\printer", LyXRC::RC_PRINTER },
144 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
145 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
146 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
147 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
148 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
149 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
150 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
151 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
152 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
153 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
154 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
155 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
156 { "\\set_color", LyXRC::RC_SET_COLOR },
157 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
158 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
159 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
160 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
161 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
162 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
163 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
164 { "\\ui_file", LyXRC::RC_UIFILE },
165 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
166 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
167 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
168 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
169 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
170 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
171 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
172 // compatibility with versions older than 1.4.0 only
173 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
174 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
175 // compatibility with versions older than 1.4.0 only
176 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
177 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
178 { "\\user_email", LyXRC::RC_USER_EMAIL },
179 { "\\user_name", LyXRC::RC_USER_NAME },
180 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
181 // compatibility with versions older than 1.4.0 only
182 { "\\viewer", LyXRC::RC_VIEWER},
183 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
186 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
197 void LyXRC::setDefaults()
200 def_file = "default";
202 // Get printer from the environment. If fail, use default "",
203 // assuming that everything is set up correctly.
204 printer = getEnv("PRINTER");
205 print_adapt_output = false;
206 print_command = "dvips";
207 print_evenpage_flag = "-B";
208 print_oddpage_flag = "-A";
209 print_pagerange_flag = "-pp";
210 print_copies_flag = "-c";
211 print_collcopies_flag = "-C";
212 print_reverse_flag = "-r";
213 print_landscape_flag = "-t landscape";
214 print_to_printer = "-P";
215 print_to_file = "-o ";
216 print_file_extension = ".ps";
217 print_paper_flag = "-t";
218 print_paper_dimension_flag = "-T";
219 document_path.erase();
220 view_dvi_paper_option.erase();
221 default_papersize = PAPER_DEFAULT;
222 custom_export_format = "ps";
223 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
224 bibtex_command = "bibtex";
226 index_command = "makeindex -c -q";
228 // Because a screen typically is wider than a piece of paper:
230 allow_geometry_session = true;
231 // Default LaTeX font size:
232 font_sizes[FONT_SIZE_TINY] = "5.0";
233 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
234 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
235 font_sizes[FONT_SIZE_SMALL] = "9.0";
236 font_sizes[FONT_SIZE_NORMAL] = "10.0";
237 font_sizes[FONT_SIZE_LARGE] = "12.0";
238 font_sizes[FONT_SIZE_LARGER] = "14.4";
239 font_sizes[FONT_SIZE_LARGEST] = "17.26";
240 font_sizes[FONT_SIZE_HUGE] = "20.74";
241 font_sizes[FONT_SIZE_HUGER] = "24.88";
242 use_scalable_fonts = true;
243 roman_font_name = "";
245 typewriter_font_name = "";
247 auto_region_delete = true;
248 auto_reset_options = false;
249 plaintext_linelen = 65;
250 mouse_wheel_speed = 1.0;
251 num_lastfiles = maxlastfiles;
252 check_lastfiles = true;
253 use_lastfilepos = true;
254 load_session = false;
256 backupdir_path.erase();
257 display_graphics = graphics::ColorDisplay;
258 // Spellchecker settings:
259 use_spell_lib = true;
260 isp_command = "ispell";
261 isp_accept_compound = false;
262 isp_use_input_encoding = false;
263 isp_use_alt_lang = false;
264 isp_use_pers_dict = false;
265 isp_use_esc_chars = false;
268 visual_cursor = false;
270 mark_foreign_language = true;
271 language_auto_begin = true;
272 language_auto_end = true;
273 language_global_options = true;
274 language_use_babel = true;
275 language_package = "\\usepackage{babel}";
276 language_command_begin = "\\selectlanguage{$$lang}";
277 language_command_local = "\\foreignlanguage{$$lang}{";
278 sort_layouts = false;
279 group_layouts = true;
280 default_language = "english";
282 windows_style_tex_paths = false;
283 tex_allows_spaces = false;
284 date_insert_format = "%x";
285 cursor_follows_scrollbar = false;
286 macro_edit_style = MACRO_EDIT_INLINE_BOX;
287 dialogs_iconify_with_main = false;
288 label_init_length = 3;
289 preview = PREVIEW_OFF;
290 preview_hashed_labels = false;
291 preview_scale_factor = "0.9";
292 use_converter_cache = true;
294 use_pixmap_cache = false;
295 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
296 user_name = to_utf8(support::user_name());
297 user_email = to_utf8(support::user_email());
298 open_buffers_in_tabs = true;
300 // Fullscreen settings
301 full_screen_limit = false;
302 full_screen_toolbars = true;
303 full_screen_tabbar = true;
304 full_screen_scrollbar = true;
305 full_screen_width = 700;
307 completion_cursor_text = true;
308 completion_popup_math = true;
309 completion_popup_text = false;
310 completion_popup_delay = 2.0;
311 completion_popup_after_complete = true;
312 completion_inline_math = true;
313 completion_inline_text = false;
314 completion_inline_dots = -1;
315 completion_inline_delay = 0.2;
321 void oldFontFormat(string & family, string & foundry)
323 if (family.empty() || family[0] != '-')
325 foundry = token(family, '-', 1);
326 family = token(family, '-', 2);
334 int LyXRC::read(FileName const & filename)
336 Lexer lexrc(lyxrcTags);
337 if (lyxerr.debugging(Debug::PARSER))
338 lexrc.printTable(lyxerr);
340 lexrc.setFile(filename);
344 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
350 int LyXRC::read(istream & is)
352 Lexer lexrc(lyxrcTags);
353 if (lyxerr.debugging(Debug::PARSER))
354 lexrc.printTable(lyxerr);
360 LYXERR(Debug::LYXRC, "Reading istream...");
366 int LyXRC::read(Lexer & lexrc)
368 if (!lexrc.isOK()) return -2;
370 while (lexrc.isOK()) {
371 // By using two switches we take advantage of the compiler
372 // telling us if we have missed a LyXRCTags element in
373 // the second switch.
374 // Note that this also shows a problem with Lexer since it
375 // helps us avoid taking advantage of the strictness of the
378 int le = lexrc.lex();
380 case Lexer::LEX_UNDEF:
381 lexrc.printError("Unknown tag `$$Token'");
383 case Lexer::LEX_FEOF:
387 switch (static_cast<LyXRCTags>(le)) {
388 case RC_INPUT: // Include file
391 libFileSearch(string(),
394 lexrc.printError("Error reading "
395 "included file: " + tmp.absFilename());
401 bind_file = os::internal_path(lexrc.getString());
407 def_file = os::internal_path(lexrc.getString());
413 ui_file = os::internal_path(lexrc.getString());
417 case RC_AUTORESET_OPTIONS:
418 lexrc >> auto_reset_options;
421 case RC_DISPLAY_GRAPHICS:
423 display_graphics = graphics::displayTranslator().find(lexrc.getString());
426 case RC_TEX_EXPECTS_WINDOWS_PATHS:
427 lexrc >> windows_style_tex_paths;
430 case RC_TEX_ALLOWS_SPACES:
431 lexrc >> tex_allows_spaces;
438 case RC_KBMAP_PRIMARY:
440 string const kmap(os::internal_path(lexrc.getString()));
443 } else if (!libFileSearch("kbd", kmap,
445 primary_kbmap = kmap;
447 lexrc.printError("LyX: Keymap `$$Token' not found");
452 case RC_KBMAP_SECONDARY:
454 string const kmap(os::internal_path(lexrc.getString()));
457 } else if (!libFileSearch("kbd", kmap,
459 secondary_kbmap = kmap;
461 lexrc.printError("LyX: Keymap `$$Token' not found");
466 case RC_FONT_ENCODING:
474 case RC_PRINT_COMMAND:
475 lexrc >> print_command;
478 case RC_PRINTEVENPAGEFLAG:
479 lexrc >> print_evenpage_flag;
482 case RC_PRINTODDPAGEFLAG:
483 lexrc >> print_oddpage_flag;
486 case RC_PRINTPAGERANGEFLAG:
487 lexrc >> print_pagerange_flag;
490 case RC_PRINTCOPIESFLAG:
491 lexrc >> print_copies_flag;
494 case RC_PRINTCOLLCOPIESFLAG:
495 lexrc >> print_collcopies_flag;
498 case RC_PRINTREVERSEFLAG:
499 lexrc >> print_reverse_flag;
502 case RC_PRINTLANDSCAPEFLAG:
503 lexrc >> print_landscape_flag;
506 case RC_PRINTTOPRINTER:
507 lexrc >> print_to_printer;
510 case RC_PRINT_ADAPTOUTPUT:
511 lexrc >> print_adapt_output;
516 print_to_file = os::internal_path(lexrc.getString());
520 case RC_PRINTFILEEXTENSION:
521 lexrc >> print_file_extension;
524 case RC_PRINTEXSTRAOPTIONS:
525 lexrc >> print_extra_options;
528 case RC_PRINTSPOOL_COMMAND:
529 lexrc >> print_spool_command;
532 case RC_PRINTSPOOL_PRINTERPREFIX:
533 lexrc >> print_spool_printerprefix;
536 case RC_PRINTPAPERDIMENSIONFLAG:
537 lexrc >> print_paper_dimension_flag;
540 case RC_PRINTPAPERFLAG:
541 lexrc >> print_paper_flag;
544 case RC_CUSTOM_EXPORT_COMMAND:
545 lexrc >> custom_export_command;
548 case RC_CUSTOM_EXPORT_FORMAT:
549 lexrc >> custom_export_format;
552 case RC_DEFAULT_PAPERSIZE:
554 string const size = ascii_lowercase(lexrc.getString());
555 if (size == "usletter")
556 default_papersize = PAPER_USLETTER;
557 else if (size == "legal")
558 default_papersize = PAPER_USLEGAL;
559 else if (size == "executive")
560 default_papersize = PAPER_USEXECUTIVE;
561 else if (size == "a3")
562 default_papersize = PAPER_A3;
563 else if (size == "a4")
564 default_papersize = PAPER_A4;
565 else if (size == "a5")
566 default_papersize = PAPER_A5;
567 else if (size == "b5")
568 default_papersize = PAPER_B5;
569 else if (size == "default")
570 default_papersize = PAPER_DEFAULT;
574 case RC_VIEWDVI_PAPEROPTION:
576 view_dvi_paper_option = lexrc.getString();
578 view_dvi_paper_option.erase();
581 case RC_CHKTEX_COMMAND:
582 lexrc >> chktex_command;
585 case RC_BIBTEX_COMMAND:
586 lexrc >> bibtex_command;
589 case RC_INDEX_COMMAND:
590 lexrc >> index_command;
601 case RC_GEOMETRY_SESSION:
602 lexrc >> allow_geometry_session;
605 case RC_SCREEN_FONT_SIZES:
606 lexrc >> font_sizes[FONT_SIZE_TINY];
607 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
608 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
609 lexrc >> font_sizes[FONT_SIZE_SMALL];
610 lexrc >> font_sizes[FONT_SIZE_NORMAL];
611 lexrc >> font_sizes[FONT_SIZE_LARGE];
612 lexrc >> font_sizes[FONT_SIZE_LARGER];
613 lexrc >> font_sizes[FONT_SIZE_LARGEST];
614 lexrc >> font_sizes[FONT_SIZE_HUGE];
615 lexrc >> font_sizes[FONT_SIZE_HUGER];
618 case RC_SCREEN_FONT_SCALABLE:
619 lexrc >> use_scalable_fonts;
626 case RC_DOCUMENTPATH:
628 document_path = os::internal_path(lexrc.getString());
629 document_path = expandPath(document_path);
635 example_path = os::internal_path(lexrc.getString());
636 example_path = expandPath(example_path);
640 case RC_TEMPLATEPATH:
642 template_path = os::internal_path(lexrc.getString());
643 template_path = expandPath(template_path);
649 tempdir_path = os::internal_path(lexrc.getString());
650 tempdir_path = expandPath(tempdir_path);
656 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
659 case RC_USELASTFILEPOS:
660 lexrc >> use_lastfilepos;
664 lexrc >> load_session;
667 case RC_MOUSE_WHEEL_SPEED:
668 lexrc >> mouse_wheel_speed;
671 case RC_COMPLETION_INLINE_DELAY:
672 lexrc >> completion_inline_delay;
675 case RC_COMPLETION_INLINE_MATH:
676 lexrc >> completion_inline_math;
679 case RC_COMPLETION_INLINE_TEXT:
680 lexrc >> completion_inline_text;
683 case RC_COMPLETION_INLINE_DOTS:
684 lexrc >> completion_inline_dots;
687 case RC_COMPLETION_POPUP_DELAY:
688 lexrc >> completion_popup_delay;
691 case RC_COMPLETION_POPUP_MATH:
692 lexrc >> completion_popup_math;
695 case RC_COMPLETION_POPUP_TEXT:
696 lexrc >> completion_popup_text;
699 case RC_COMPLETION_CURSOR_TEXT:
700 lexrc >> completion_cursor_text;
703 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
704 lexrc >> completion_popup_after_complete;
707 case RC_NUMLASTFILES:
708 lexrc >> num_lastfiles;
711 case RC_CHECKLASTFILES:
712 lexrc >> check_lastfiles;
715 case RC_SCREEN_FONT_ROMAN:
717 roman_font_name = lexrc.getString();
718 oldFontFormat(roman_font_name,
723 case RC_SCREEN_FONT_SANS:
725 sans_font_name = lexrc.getString();
726 oldFontFormat(sans_font_name, sans_font_foundry);
730 case RC_SCREEN_FONT_TYPEWRITER:
732 typewriter_font_name = lexrc.getString();
733 oldFontFormat(typewriter_font_name,
734 typewriter_font_foundry);
738 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
739 lexrc >> roman_font_foundry;
742 case RC_SCREEN_FONT_SANS_FOUNDRY:
743 lexrc >> sans_font_foundry;
746 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
747 lexrc >> typewriter_font_foundry;
752 string lyx_name, x11_name;
755 lyx_name = lexrc.getString();
757 lexrc.printError("Missing color tag.");
762 x11_name = lexrc.getString();
764 lexrc.printError("Missing color name for color: `$$Token'");
768 ColorCode const col =
769 lcolor.getFromLyXName(lyx_name);
770 if (col == Color_none ||
771 col == Color_inherit ||
775 if (!lcolor.setColor(col, x11_name)) {
776 lyxerr << "Bad lyxrc set_color for "
782 case RC_AUTOREGIONDELETE:
783 // Auto region delete defaults to true
784 lexrc >> auto_region_delete;
789 lyxpipes = os::internal_path(lexrc.getString());
790 lyxpipes = expandPath(lyxpipes);
794 case RC_CURSOR_FOLLOWS_SCROLLBAR:
795 lexrc >> cursor_follows_scrollbar;
798 case RC_MACRO_EDIT_STYLE:
800 switch (lexrc.getInteger()) {
801 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
802 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
803 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
808 case RC_DIALOGS_ICONIFY_WITH_MAIN:
809 lexrc >> dialogs_iconify_with_main;
812 case RC_PLAINTEXT_ROFF_COMMAND:
813 lexrc >> plaintext_roff_command;
815 case RC_PLAINTEXT_LINELEN:
816 lexrc >> plaintext_linelen;
818 // Spellchecker settings:
819 case RC_USE_SPELL_LIB:
820 lexrc >> use_spell_lib;
822 case RC_SPELL_COMMAND:
823 lexrc >> isp_command;
825 case RC_ACCEPT_COMPOUND:
826 lexrc >> isp_accept_compound;
829 lexrc >> isp_use_input_encoding;
831 case RC_USE_ALT_LANG:
832 lexrc >> isp_use_alt_lang;
834 case RC_USE_PERS_DICT:
835 lexrc >> isp_use_pers_dict;
838 lexrc >> use_tooltip;
840 case RC_USE_PIXMAP_CACHE:
841 lexrc >> use_pixmap_cache;
843 case RC_USE_ESC_CHARS:
844 lexrc >> isp_use_esc_chars;
847 lexrc >> isp_alt_lang;
851 isp_pers_dict = os::internal_path(lexrc.getString());
854 lexrc >> isp_esc_chars;
857 lexrc >> make_backup;
859 case RC_BACKUPDIR_PATH:
861 backupdir_path = os::internal_path(lexrc.getString());
862 backupdir_path = expandPath(backupdir_path);
865 case RC_DATE_INSERT_FORMAT:
866 lexrc >> date_insert_format;
868 case RC_LANGUAGE_PACKAGE:
869 lexrc >> language_package;
871 case RC_LANGUAGE_AUTO_BEGIN:
872 lexrc >> language_auto_begin;
874 case RC_LANGUAGE_AUTO_END:
875 lexrc >> language_auto_end;
877 case RC_LANGUAGE_GLOBAL_OPTIONS:
878 lexrc >> language_global_options;
880 case RC_LANGUAGE_USE_BABEL:
881 lexrc >> language_use_babel;
883 case RC_LANGUAGE_COMMAND_BEGIN:
884 lexrc >> language_command_begin;
886 case RC_LANGUAGE_COMMAND_END:
887 lexrc >> language_command_end;
889 case RC_LANGUAGE_COMMAND_LOCAL:
890 lexrc >> language_command_local;
893 lexrc >> rtl_support;
895 case RC_VISUAL_CURSOR:
896 lexrc >> visual_cursor;
899 lexrc >> auto_number;
901 case RC_MARK_FOREIGN_LANGUAGE:
902 lexrc >> mark_foreign_language;
907 lexrc >> fmt >> command;
908 setMover(fmt, command);
913 string from, to, command, flags;
914 lexrc >> from >> to >> command >> flags;
916 theConverters().erase(from, to);
918 theConverters().add(from, to, command, flags);
921 // compatibility with versions older than 1.4.0 only
923 string format, command;
924 lexrc >> format >> command;
925 formats.setViewer(format, command);
929 string format, extension, prettyname, shortcut;
930 lexrc >> format >> extension >> prettyname >> shortcut;
931 string viewer, editor;
932 lexrc >> viewer >> editor;
934 // Hack to ensure compatibility with versions older
936 int le = lexrc.lex();
937 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
938 flags = lexrc.getString();
939 if (le != Lexer::LEX_DATA) {
940 // We have got a known token.
941 // Therefore this is an old style
942 // format definition without
944 lexrc.pushToken(flags);
948 int flgs = Format::none;
949 while (!flags.empty()) {
951 flags = split(flags, flag, ',');
952 if (flag == "document")
953 flgs |= Format::document;
954 else if (flag == "vector")
955 flgs |= Format::vector;
957 lyxerr << "Ignoring unknown flag `"
958 << flag << "' for format `"
959 << format << "'." << endl;
961 if (prettyname.empty()) {
962 if (theConverters().formatIsUsed(format))
963 LYXERR0( "Can't delete format " << format);
965 formats.erase(format);
967 formats.add(format, extension, prettyname,
968 shortcut, viewer, editor, flgs);
972 case RC_DEFAULT_LANGUAGE:
973 lexrc >> default_language;
976 case RC_LABEL_INIT_LENGTH:
977 lexrc >> label_init_length;
981 lexrc >> show_banner;
986 string const tmp = lexrc.getString();
987 if (tmp == "true" || tmp == "on")
988 preview = PREVIEW_ON;
989 else if (tmp == "no_math")
990 preview = PREVIEW_NO_MATH;
992 preview = PREVIEW_OFF;
993 if (tmp != "false" && tmp != "off")
994 lyxerr << "Unrecognized "
996 << tmp << '\n' << endl;
1001 case RC_PREVIEW_HASHED_LABELS:
1002 lexrc >> preview_hashed_labels;
1005 case RC_PREVIEW_SCALE_FACTOR:
1006 lexrc >> preview_scale_factor;
1013 lexrc >> user_email;
1016 case RC_PATH_PREFIX:
1017 lexrc >> path_prefix;
1020 case RC_USE_CONVERTER_CACHE:
1021 lexrc >> use_converter_cache;
1023 case RC_CONVERTER_CACHE_MAXAGE:
1024 lexrc >> converter_cache_maxage;
1027 case RC_SORT_LAYOUTS:
1028 lexrc >> sort_layouts;
1030 case RC_GROUP_LAYOUTS:
1031 lexrc >> group_layouts;
1033 case RC_FULL_SCREEN_LIMIT:
1034 lexrc >> full_screen_limit;
1036 case RC_FULL_SCREEN_TOOLBARS:
1037 lexrc >> full_screen_toolbars;
1039 case RC_FULL_SCREEN_SCROLLBAR:
1040 lexrc >> full_screen_scrollbar;
1042 case RC_FULL_SCREEN_TABBAR:
1043 lexrc >> full_screen_tabbar;
1045 case RC_FULL_SCREEN_WIDTH:
1046 lexrc >> full_screen_width;
1048 case RC_OPEN_BUFFERS_IN_TABS:
1049 lexrc >> open_buffers_in_tabs;
1053 break; // this is just a dummy
1057 /// Update converters data-structures
1058 theConverters().update(formats);
1059 theConverters().buildGraph();
1065 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1067 ofstream ofs(filename.toFilesystemEncoding().c_str());
1069 write(ofs, ignore_system_lyxrc);
1073 void LyXRC::print() const
1075 if (lyxerr.debugging())
1076 write(lyxerr, false);
1084 typedef pair<string, SpecialisedMover> Data;
1086 SameMover(Data const & comparison)
1087 : comparison_(comparison) {}
1089 bool operator()(Data const & data) const
1091 return data.first == comparison_.first &&
1092 data.second.command() == comparison_.second.command();
1100 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1102 LyXRCTags tag = RC_LAST;
1104 if (!name.empty()) {
1105 for (int i = 0; i != lyxrcCount; ++i)
1106 if ("\\" + name == lyxrcTags[i].tag)
1107 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1111 os << "### This file is part of\n"
1112 << "### ========================================================\n"
1113 << "### LyX, The Document Processor\n"
1115 << "### Copyright 1995 Matthias Ettrich\n"
1116 << "### Copyright 1995-2007 The LyX Team.\n"
1118 << "### ========================================================\n"
1120 << "# This file is written by LyX, if you want to make your own\n"
1121 << "# modifications you should do them from inside LyX and save\n"
1124 // Why the switch you might ask. It is a trick to ensure that all
1125 // the elements in the LyXRCTags enum is handled. As you can see
1126 // there are no breaks at all. So it is just a huge fall-through.
1127 // The nice thing is that we will get a warning from the compiler
1128 // if we forget an element.
1132 // input/include files are not done here
1134 if (ignore_system_lyxrc ||
1135 bind_file != system_lyxrc.bind_file) {
1136 string const path = os::external_path(bind_file);
1137 os << "\\bind_file \"" << path << "\"\n";
1143 if (ignore_system_lyxrc ||
1144 def_file != system_lyxrc.def_file) {
1145 string const path = os::external_path(def_file);
1146 os << "\\def_file \"" << path << "\"\n";
1155 << "# MISC SECTION ######################################\n"
1157 // bind files are not done here.
1159 case RC_PATH_PREFIX:
1160 if (ignore_system_lyxrc ||
1161 path_prefix != system_lyxrc.path_prefix) {
1162 os << "\\path_prefix \"" << path_prefix << "\"\n";
1167 if (ignore_system_lyxrc ||
1168 ui_file != system_lyxrc.ui_file) {
1169 string const path = os::external_path(ui_file);
1170 os << "\\ui_file \"" << path << "\"\n";
1174 case RC_AUTOREGIONDELETE:
1175 if (ignore_system_lyxrc ||
1176 auto_region_delete != system_lyxrc.auto_region_delete) {
1177 os << "# Set to false to inhibit automatic replacement of\n"
1178 << "# the current selection.\n"
1179 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1184 case RC_AUTORESET_OPTIONS:
1185 if (ignore_system_lyxrc ||
1186 auto_reset_options != system_lyxrc.auto_reset_options) {
1187 os << "# Set to false to inhibit automatic reset of\n"
1188 << "# the class options to defaults on class change.\n"
1189 << "\\auto_reset_options "
1190 << convert<string>(auto_reset_options)
1196 if (ignore_system_lyxrc ||
1197 autosave != system_lyxrc.autosave) {
1198 os << "# The time interval between auto-saves in seconds.\n"
1199 << "\\autosave " << autosave << '\n';
1203 case RC_DISPLAY_GRAPHICS:
1204 if (ignore_system_lyxrc ||
1205 display_graphics != system_lyxrc.display_graphics) {
1206 os << "# Display graphics within LyX\n"
1207 << "# monochrome|grayscale|color|none\n"
1208 << "\\display_graphics "
1209 << graphics::displayTranslator().find(
1210 graphics::DisplayType(display_graphics))
1215 case RC_SORT_LAYOUTS:
1216 if (ignore_system_lyxrc ||
1217 sort_layouts != system_lyxrc.sort_layouts) {
1218 os << "# Sort layouts alphabetically.\n"
1219 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1223 case RC_GROUP_LAYOUTS:
1224 if (ignore_system_lyxrc ||
1225 group_layouts != system_lyxrc.group_layouts) {
1226 os << "# Group layouts by their category.\n"
1227 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1231 case RC_VIEWDVI_PAPEROPTION:
1232 if (ignore_system_lyxrc ||
1233 view_dvi_paper_option
1234 != system_lyxrc.view_dvi_paper_option) {
1235 os << "# Options used to specify paper size to the\n"
1236 << "# view_dvi_command (e.g. -paper)\n"
1237 << "\\view_dvi_paper_option \""
1238 << view_dvi_paper_option << "\"\n";
1242 case RC_DEFAULT_PAPERSIZE:
1243 if (ignore_system_lyxrc ||
1244 default_papersize != system_lyxrc.default_papersize) {
1245 os << "# The default papersize to use.\n"
1246 << "\\default_papersize \"";
1247 switch (default_papersize) {
1249 os << "default"; break;
1250 case PAPER_USLETTER:
1251 os << "usletter"; break;
1253 os << "legal"; break;
1254 case PAPER_USEXECUTIVE:
1255 os << "executive"; break;
1266 case PAPER_B4: break;
1272 case RC_CHKTEX_COMMAND:
1273 if (ignore_system_lyxrc ||
1274 chktex_command != system_lyxrc.chktex_command) {
1275 os << "\\chktex_command \"" << chktex_command << "\"\n";
1279 case RC_BIBTEX_COMMAND:
1280 if (ignore_system_lyxrc ||
1281 bibtex_command != system_lyxrc.bibtex_command) {
1282 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1286 case RC_INDEX_COMMAND:
1287 if (ignore_system_lyxrc ||
1288 index_command != system_lyxrc.index_command) {
1289 os << "\\index_command \"" << index_command << "\"\n";
1293 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1294 if (ignore_system_lyxrc ||
1295 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1296 os << "\\tex_expects_windows_paths "
1297 << convert<string>(windows_style_tex_paths) << '\n';
1301 case RC_TEX_ALLOWS_SPACES:
1302 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1303 os << "\\tex_allows_spaces "
1304 << convert<string>(tex_allows_spaces) << '\n';
1309 if (ignore_system_lyxrc ||
1310 use_kbmap != system_lyxrc.use_kbmap) {
1311 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1315 case RC_KBMAP_PRIMARY:
1316 if (ignore_system_lyxrc ||
1317 primary_kbmap != system_lyxrc.primary_kbmap) {
1318 string const path = os::external_path(primary_kbmap);
1319 os << "\\kbmap_primary \"" << path << "\"\n";
1323 case RC_KBMAP_SECONDARY:
1324 if (ignore_system_lyxrc ||
1325 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1326 string const path = os::external_path(secondary_kbmap);
1327 os << "\\kbmap_secondary \"" << path << "\"\n";
1332 if (ignore_system_lyxrc ||
1333 lyxpipes != system_lyxrc.lyxpipes) {
1334 string const path = os::external_path(lyxpipes);
1335 os << "\\serverpipe \"" << path << "\"\n";
1339 case RC_DATE_INSERT_FORMAT:
1340 if (ignore_system_lyxrc ||
1341 date_insert_format != system_lyxrc.date_insert_format) {
1342 os << "\\date_insert_format \"" << date_insert_format
1347 case RC_LABEL_INIT_LENGTH:
1348 if (ignore_system_lyxrc ||
1349 label_init_length != system_lyxrc.label_init_length) {
1350 os << "\\label_init_length " << label_init_length
1357 os << "\\user_name \"" << user_name << "\"\n";
1362 os << "\\user_email \"" << user_email << "\"\n";
1366 case RC_SHOW_BANNER:
1367 if (ignore_system_lyxrc ||
1368 show_banner != system_lyxrc.show_banner) {
1369 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1375 if (ignore_system_lyxrc ||
1376 preview != system_lyxrc.preview) {
1382 case PREVIEW_NO_MATH:
1389 os << "\\preview " << status << '\n';
1394 case RC_PREVIEW_HASHED_LABELS:
1395 if (ignore_system_lyxrc ||
1396 preview_hashed_labels !=
1397 system_lyxrc.preview_hashed_labels) {
1398 os << "\\preview_hashed_labels "
1399 << convert<string>(preview_hashed_labels) << '\n';
1404 case RC_PREVIEW_SCALE_FACTOR:
1405 if (ignore_system_lyxrc ||
1406 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1407 os << "\\preview_scale_factor "
1408 << preview_scale_factor << '\n';
1413 case RC_USE_CONVERTER_CACHE:
1414 if (ignore_system_lyxrc ||
1415 use_converter_cache != system_lyxrc.use_converter_cache) {
1416 os << "\\use_converter_cache "
1417 << convert<string>(use_converter_cache) << '\n';
1422 case RC_CONVERTER_CACHE_MAXAGE:
1423 if (ignore_system_lyxrc ||
1424 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1425 os << "\\converter_cache_maxage "
1426 << converter_cache_maxage << '\n';
1432 << "# SCREEN & FONTS SECTION ############################\n"
1436 if (ignore_system_lyxrc ||
1437 dpi != system_lyxrc.dpi) {
1438 os << "\\screen_dpi " << dpi << '\n';
1442 case RC_SCREEN_ZOOM:
1443 if (ignore_system_lyxrc ||
1444 zoom != system_lyxrc.zoom) {
1445 os << "\\screen_zoom " << zoom << '\n';
1449 case RC_GEOMETRY_SESSION:
1450 if (ignore_system_lyxrc ||
1451 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1452 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1457 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1458 if (ignore_system_lyxrc ||
1459 cursor_follows_scrollbar
1460 != system_lyxrc.cursor_follows_scrollbar) {
1461 os << "\\cursor_follows_scrollbar "
1462 << convert<string>(cursor_follows_scrollbar) << '\n';
1466 case RC_MACRO_EDIT_STYLE:
1467 if (ignore_system_lyxrc ||
1469 != system_lyxrc.macro_edit_style) {
1470 os << "\\macro_edit_style ";
1471 switch (macro_edit_style) {
1472 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1473 case MACRO_EDIT_INLINE: os << "1\n"; break;
1474 case MACRO_EDIT_LIST: os << "2\n"; break;
1479 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1480 if (ignore_system_lyxrc ||
1481 dialogs_iconify_with_main
1482 != system_lyxrc.dialogs_iconify_with_main) {
1483 os << "\\dialogs_iconify_with_main "
1484 << convert<string>(dialogs_iconify_with_main) << '\n';
1488 case RC_SCREEN_FONT_ROMAN:
1489 if (ignore_system_lyxrc ||
1490 roman_font_name != system_lyxrc.roman_font_name) {
1491 os << "\\screen_font_roman \"" << roman_font_name
1496 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1497 if (ignore_system_lyxrc ||
1498 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1499 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1504 case RC_SCREEN_FONT_SANS:
1505 if (ignore_system_lyxrc ||
1506 sans_font_name != system_lyxrc.sans_font_name) {
1507 os << "\\screen_font_sans \"" << sans_font_name
1512 case RC_SCREEN_FONT_SANS_FOUNDRY:
1513 if (ignore_system_lyxrc ||
1514 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1515 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1520 case RC_SCREEN_FONT_TYPEWRITER:
1521 if (ignore_system_lyxrc ||
1522 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1523 os << "\\screen_font_typewriter \""
1524 << typewriter_font_name << "\"\n";
1528 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1529 if (ignore_system_lyxrc ||
1530 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1531 os << "\\screen_font_typewriter_foundry \""
1532 << typewriter_font_foundry << "\"\n";
1537 case RC_SCREEN_FONT_SCALABLE:
1538 if (ignore_system_lyxrc ||
1539 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1540 os << "\\screen_font_scalable "
1541 << convert<string>(use_scalable_fonts)
1546 case RC_SCREEN_FONT_SIZES:
1547 if (ignore_system_lyxrc ||
1548 font_sizes[FONT_SIZE_TINY]
1549 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1550 font_sizes[FONT_SIZE_SCRIPT]
1551 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1552 font_sizes[FONT_SIZE_FOOTNOTE]
1553 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1554 font_sizes[FONT_SIZE_SMALL]
1555 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1556 font_sizes[FONT_SIZE_NORMAL]
1557 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1558 font_sizes[FONT_SIZE_LARGE]
1559 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1560 font_sizes[FONT_SIZE_LARGER]
1561 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1562 font_sizes[FONT_SIZE_LARGEST]
1563 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1564 font_sizes[FONT_SIZE_HUGE]
1565 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1566 font_sizes[FONT_SIZE_HUGER]
1567 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1568 os.setf(ios::fixed);
1570 os << "\\screen_font_sizes"
1571 << ' ' << font_sizes[FONT_SIZE_TINY]
1572 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1573 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1574 << ' ' << font_sizes[FONT_SIZE_SMALL]
1575 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1576 << ' ' << font_sizes[FONT_SIZE_LARGE]
1577 << ' ' << font_sizes[FONT_SIZE_LARGER]
1578 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1579 << ' ' << font_sizes[FONT_SIZE_HUGE]
1580 << ' ' << font_sizes[FONT_SIZE_HUGER]
1585 case RC_FULL_SCREEN_LIMIT:
1586 if (ignore_system_lyxrc ||
1587 full_screen_limit != system_lyxrc.full_screen_limit) {
1588 os << "\\fullscreen_limit "
1589 << convert<string>(full_screen_limit)
1594 case RC_FULL_SCREEN_TOOLBARS:
1595 if (ignore_system_lyxrc ||
1596 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1597 os << "\\fullscreen_toolbars "
1598 << convert<string>(full_screen_toolbars)
1603 case RC_FULL_SCREEN_SCROLLBAR:
1604 if (ignore_system_lyxrc ||
1605 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1606 os << "\\fullscreen_scrollbar "
1607 << convert<string>(full_screen_scrollbar)
1612 case RC_FULL_SCREEN_TABBAR:
1613 if (ignore_system_lyxrc ||
1614 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1615 os << "\\fullscreen_tabbar "
1616 << convert<string>(full_screen_tabbar)
1621 case RC_FULL_SCREEN_WIDTH:
1622 if (ignore_system_lyxrc ||
1623 full_screen_width != system_lyxrc.full_screen_width) {
1624 os << "\\fullscreen_width "
1625 << convert<string>(full_screen_width)
1630 case RC_OPEN_BUFFERS_IN_TABS:
1631 if (ignore_system_lyxrc ||
1632 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1633 os << "\\open_buffers_in_tabs "
1634 << convert<string>(open_buffers_in_tabs)
1641 << "# COLOR SECTION ###################################\n"
1645 for (int i = 0; i < Color_ignore; ++i) {
1646 ColorCode lc = static_cast<ColorCode>(i);
1648 string const col(lcolor.getX11Name(lc));
1649 if (ignore_system_lyxrc ||
1650 col != system_lcolor.getX11Name(lc)) {
1651 os << "\\set_color \""
1652 << lcolor.getLyXName(lc) << "\" \""
1660 << "# PRINTER SECTION ###################################\n"
1664 if (ignore_system_lyxrc ||
1665 printer != system_lyxrc.printer) {
1666 os << "\\printer \"" << printer << "\"\n";
1670 case RC_PRINT_ADAPTOUTPUT:
1671 if (ignore_system_lyxrc ||
1672 print_adapt_output != system_lyxrc.print_adapt_output) {
1673 os << "\\print_adapt_output "
1674 << convert<string>(print_adapt_output)
1679 case RC_PRINT_COMMAND:
1680 if (ignore_system_lyxrc ||
1681 print_command != system_lyxrc.print_command) {
1682 os << "\\print_command \"" << print_command << "\"\n";
1686 case RC_PRINTEXSTRAOPTIONS:
1687 if (ignore_system_lyxrc ||
1688 print_extra_options != system_lyxrc.print_extra_options) {
1689 os << "\\print_extra_options \"" << print_extra_options
1694 case RC_PRINTSPOOL_COMMAND:
1695 if (ignore_system_lyxrc ||
1696 print_spool_command != system_lyxrc.print_spool_command) {
1697 os << "\\print_spool_command \"" << print_spool_command
1702 case RC_PRINTSPOOL_PRINTERPREFIX:
1703 if (ignore_system_lyxrc ||
1704 print_spool_printerprefix
1705 != system_lyxrc.print_spool_printerprefix) {
1706 os << "\\print_spool_printerprefix \""
1707 << print_spool_printerprefix << "\"\n";
1711 case RC_PRINTEVENPAGEFLAG:
1712 if (ignore_system_lyxrc ||
1713 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1714 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1719 case RC_PRINTODDPAGEFLAG:
1720 if (ignore_system_lyxrc ||
1721 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1722 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1727 case RC_PRINTREVERSEFLAG:
1728 if (ignore_system_lyxrc ||
1729 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1730 os << "\\print_reverse_flag \"" << print_reverse_flag
1735 case RC_PRINTLANDSCAPEFLAG:
1736 if (ignore_system_lyxrc ||
1737 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1738 os << "\\print_landscape_flag \"" << print_landscape_flag
1743 case RC_PRINTPAGERANGEFLAG:
1744 if (ignore_system_lyxrc ||
1745 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1746 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1751 case RC_PRINTCOPIESFLAG:
1752 if (ignore_system_lyxrc ||
1753 print_copies_flag != system_lyxrc.print_copies_flag) {
1754 os << "\\print_copies_flag \"" << print_copies_flag
1759 case RC_PRINTCOLLCOPIESFLAG:
1760 if (ignore_system_lyxrc ||
1761 print_collcopies_flag
1762 != system_lyxrc.print_collcopies_flag) {
1763 os << "\\print_collcopies_flag \""
1764 << print_collcopies_flag
1769 case RC_PRINTPAPERFLAG:
1770 if (ignore_system_lyxrc ||
1771 print_paper_flag != system_lyxrc.print_paper_flag) {
1772 os << "\\print_paper_flag \"" << print_paper_flag
1777 case RC_PRINTPAPERDIMENSIONFLAG:
1778 if (ignore_system_lyxrc ||
1779 print_paper_dimension_flag
1780 != system_lyxrc.print_paper_dimension_flag) {
1781 os << "\\print_paper_dimension_flag \""
1782 << print_paper_dimension_flag << "\"\n";
1786 case RC_PRINTTOPRINTER:
1787 if (ignore_system_lyxrc ||
1788 print_to_printer != system_lyxrc.print_to_printer) {
1789 os << "\\print_to_printer \"" << print_to_printer
1794 case RC_PRINTTOFILE:
1795 if (ignore_system_lyxrc ||
1796 print_to_file != system_lyxrc.print_to_file) {
1797 string const path = os::external_path(print_to_file);
1798 os << "\\print_to_file \"" << path << "\"\n";
1802 case RC_PRINTFILEEXTENSION:
1803 if (ignore_system_lyxrc ||
1804 print_file_extension != system_lyxrc.print_file_extension) {
1805 os << "\\print_file_extension \""
1806 << print_file_extension
1813 << "# EXPORT SECTION ####################################\n"
1816 case RC_CUSTOM_EXPORT_COMMAND:
1817 if (ignore_system_lyxrc ||
1818 custom_export_command
1819 != system_lyxrc.custom_export_command) {
1820 os << "\\custom_export_command \""
1821 << custom_export_command
1826 case RC_CUSTOM_EXPORT_FORMAT:
1827 if (ignore_system_lyxrc ||
1828 custom_export_format
1829 != system_lyxrc.custom_export_format) {
1830 os << "\\custom_export_format \"" << custom_export_format
1837 << "# TEX SECTION #######################################\n"
1840 case RC_FONT_ENCODING:
1841 if (ignore_system_lyxrc ||
1842 fontenc != system_lyxrc.fontenc) {
1843 os << "\\font_encoding \"" << fontenc << "\"\n";
1849 << "# FILE SECTION ######################################\n"
1852 case RC_DOCUMENTPATH:
1853 if (ignore_system_lyxrc ||
1854 document_path != system_lyxrc.document_path) {
1855 string const path = os::external_path(document_path);
1856 os << "\\document_path \"" << path << "\"\n";
1860 case RC_USELASTFILEPOS:
1861 if (ignore_system_lyxrc ||
1862 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1863 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1868 case RC_LOADSESSION:
1869 if (ignore_system_lyxrc ||
1870 load_session != system_lyxrc.load_session) {
1871 os << "\\load_session " << convert<string>(load_session)
1876 case RC_MOUSE_WHEEL_SPEED:
1877 if (ignore_system_lyxrc ||
1878 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1879 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1883 case RC_COMPLETION_INLINE_DELAY:
1884 if (ignore_system_lyxrc ||
1885 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1886 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1890 case RC_COMPLETION_INLINE_MATH:
1891 if (ignore_system_lyxrc ||
1892 completion_inline_math != system_lyxrc.completion_inline_math) {
1893 os << "\\completion_inline_math "
1894 << convert<string>(completion_inline_math) << '\n';
1898 case RC_COMPLETION_INLINE_TEXT:
1899 if (ignore_system_lyxrc ||
1900 completion_inline_text != system_lyxrc.completion_inline_text) {
1901 os << "\\completion_inline_text "
1902 << convert<string>(completion_inline_text) << '\n';
1906 case RC_COMPLETION_INLINE_DOTS:
1907 if (ignore_system_lyxrc ||
1908 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1909 os << "\\completion_inline_dots "
1910 << convert<string>(completion_inline_dots) << '\n';
1914 case RC_COMPLETION_POPUP_DELAY:
1915 if (ignore_system_lyxrc ||
1916 completion_popup_delay != system_lyxrc.completion_popup_delay) {
1917 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
1921 case RC_COMPLETION_POPUP_MATH:
1922 if (ignore_system_lyxrc ||
1923 completion_popup_math != system_lyxrc.completion_popup_math) {
1924 os << "\\completion_popup_math "
1925 << convert<string>(completion_popup_math) << '\n';
1929 case RC_COMPLETION_POPUP_TEXT:
1930 if (ignore_system_lyxrc ||
1931 completion_popup_text != system_lyxrc.completion_popup_text) {
1932 os << "\\completion_popup_text "
1933 << convert<string>(completion_popup_text) << '\n';
1937 case RC_COMPLETION_CURSOR_TEXT:
1938 if (ignore_system_lyxrc ||
1939 completion_cursor_text != system_lyxrc.completion_cursor_text) {
1940 os << "\\completion_cursor_text "
1941 << convert<string>(completion_cursor_text) << '\n';
1945 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
1946 if (ignore_system_lyxrc ||
1947 completion_popup_after_complete
1948 != system_lyxrc.completion_popup_after_complete) {
1949 os << "\\completion_popup_after_complete "
1950 << convert<string>(completion_popup_after_complete) << '\n';
1954 case RC_NUMLASTFILES:
1955 if (ignore_system_lyxrc ||
1956 num_lastfiles != system_lyxrc.num_lastfiles) {
1957 os << "\\num_lastfiles " << num_lastfiles << '\n';
1961 case RC_CHECKLASTFILES:
1962 if (ignore_system_lyxrc ||
1963 check_lastfiles != system_lyxrc.check_lastfiles) {
1964 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
1969 case RC_EXAMPLEPATH:
1970 if (ignore_system_lyxrc ||
1971 example_path != system_lyxrc.example_path) {
1972 string const path = os::external_path(example_path);
1973 os << "\\example_path \"" << path << "\"\n";
1977 case RC_TEMPLATEPATH:
1978 if (ignore_system_lyxrc ||
1979 template_path != system_lyxrc.template_path) {
1980 string const path = os::external_path(template_path);
1981 os << "\\template_path \"" << path << "\"\n";
1985 case RC_TEMPDIRPATH:
1986 if (ignore_system_lyxrc ||
1987 tempdir_path != system_lyxrc.tempdir_path) {
1988 string const path = os::external_path(tempdir_path);
1989 os << "\\tempdir_path \"" << path << "\"\n";
1997 case RC_PLAINTEXT_LINELEN:
1998 if (ignore_system_lyxrc ||
1999 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2000 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2004 case RC_MAKE_BACKUP:
2005 if (ignore_system_lyxrc ||
2006 make_backup != system_lyxrc.make_backup) {
2007 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2011 case RC_BACKUPDIR_PATH:
2012 if (ignore_system_lyxrc ||
2013 backupdir_path != system_lyxrc.backupdir_path) {
2014 string const path = os::external_path(backupdir_path);
2015 os << "\\backupdir_path \"" << path << "\"\n";
2021 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2024 case RC_PLAINTEXT_ROFF_COMMAND:
2025 if (ignore_system_lyxrc ||
2026 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2027 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2034 << "# SPELLCHECKER SECTION ##############################\n"
2036 case RC_USE_SPELL_LIB:
2037 if (ignore_system_lyxrc ||
2038 use_spell_lib != system_lyxrc.use_spell_lib) {
2039 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2043 case RC_SPELL_COMMAND:
2044 if (ignore_system_lyxrc ||
2045 isp_command != system_lyxrc.isp_command) {
2046 os << "\\spell_command \"" << isp_command << "\"\n";
2050 case RC_ACCEPT_COMPOUND:
2051 if (ignore_system_lyxrc ||
2052 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2053 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2058 case RC_USE_ALT_LANG:
2059 if (ignore_system_lyxrc ||
2060 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2061 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2067 if (ignore_system_lyxrc ||
2068 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2069 os << "\\alternate_language \"" << isp_alt_lang
2074 case RC_USE_ESC_CHARS:
2075 if (ignore_system_lyxrc ||
2076 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2077 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2083 if (ignore_system_lyxrc ||
2084 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2085 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2089 case RC_USE_PERS_DICT:
2090 if (ignore_system_lyxrc ||
2091 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2092 os << "\\use_personal_dictionary "
2093 << convert<string>(isp_use_pers_dict)
2098 case RC_USE_TOOLTIP:
2099 if (ignore_system_lyxrc ||
2100 use_tooltip != system_lyxrc.use_tooltip) {
2101 os << "\\use_tooltip "
2102 << convert<string>(use_tooltip)
2105 case RC_USE_PIXMAP_CACHE:
2106 if (ignore_system_lyxrc ||
2107 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2108 os << "\\use_pixmap_cache "
2109 << convert<string>(use_pixmap_cache)
2113 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2114 string const path = os::external_path(isp_pers_dict);
2115 os << "\\personal_dictionary \"" << path << "\"\n";
2119 case RC_USE_INP_ENC:
2120 if (ignore_system_lyxrc ||
2121 isp_use_input_encoding
2122 != system_lyxrc.isp_use_input_encoding) {
2123 os << "\\use_input_encoding "
2124 << convert<string>(isp_use_input_encoding)
2131 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2134 case RC_RTL_SUPPORT:
2135 if (ignore_system_lyxrc ||
2136 rtl_support != system_lyxrc.rtl_support) {
2137 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2141 case RC_VISUAL_CURSOR:
2142 if (ignore_system_lyxrc ||
2143 visual_cursor != system_lyxrc.visual_cursor) {
2144 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2148 case RC_LANGUAGE_PACKAGE:
2149 if (ignore_system_lyxrc ||
2150 language_package != system_lyxrc.language_package) {
2151 os << "\\language_package \"" << language_package
2156 case RC_LANGUAGE_GLOBAL_OPTIONS:
2157 if (ignore_system_lyxrc ||
2158 language_global_options
2159 != system_lyxrc.language_global_options) {
2160 os << "\\language_global_options \""
2161 << convert<string>(language_global_options)
2166 case RC_LANGUAGE_USE_BABEL:
2167 if (ignore_system_lyxrc ||
2168 language_use_babel != system_lyxrc.language_use_babel) {
2169 os << "\\language_use_babel \""
2170 << convert<string>(language_use_babel)
2175 case RC_LANGUAGE_COMMAND_BEGIN:
2176 if (ignore_system_lyxrc ||
2177 language_command_begin
2178 != system_lyxrc.language_command_begin) {
2179 os << "\\language_command_begin \""
2180 << language_command_begin
2185 case RC_LANGUAGE_COMMAND_END:
2186 if (ignore_system_lyxrc ||
2187 language_command_end
2188 != system_lyxrc.language_command_end) {
2189 os << "\\language_command_end \"" << language_command_end
2194 case RC_LANGUAGE_COMMAND_LOCAL:
2195 if (ignore_system_lyxrc ||
2196 language_command_local
2197 != system_lyxrc.language_command_local) {
2198 os << "\\language_command_local \""
2199 << language_command_local
2204 case RC_LANGUAGE_AUTO_BEGIN:
2205 if (ignore_system_lyxrc ||
2206 language_auto_begin != system_lyxrc.language_auto_begin) {
2207 os << "\\language_auto_begin "
2208 << convert<string>(language_auto_begin) << '\n';
2212 case RC_LANGUAGE_AUTO_END:
2213 if (ignore_system_lyxrc ||
2214 language_auto_end != system_lyxrc.language_auto_end) {
2215 os << "\\language_auto_end "
2216 << convert<string>(language_auto_end) << '\n';
2220 case RC_MARK_FOREIGN_LANGUAGE:
2221 if (ignore_system_lyxrc ||
2222 mark_foreign_language
2223 != system_lyxrc.mark_foreign_language) {
2224 os << "\\mark_foreign_language " <<
2225 convert<string>(mark_foreign_language) << '\n';
2231 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2234 case RC_AUTO_NUMBER:
2235 if (ignore_system_lyxrc ||
2236 auto_number != system_lyxrc.auto_number) {
2237 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2241 case RC_DEFAULT_LANGUAGE:
2242 if (ignore_system_lyxrc ||
2243 default_language != system_lyxrc.default_language) {
2244 os << "\\default_language " << default_language << '\n';
2250 << "# FORMATS SECTION ##########################\n"
2254 // New/modified formats
2255 for (Formats::const_iterator cit = formats.begin();
2256 cit != formats.end(); ++cit) {
2257 Format const * format =
2258 system_formats.getFormat(cit->name());
2260 format->extension() != cit->extension() ||
2261 format->prettyname() != cit->prettyname() ||
2262 format->shortcut() != cit->shortcut() ||
2263 format->viewer() != cit->viewer() ||
2264 format->editor() != cit->editor() ||
2265 format->documentFormat() != cit->documentFormat() ||
2266 format->vectorFormat() != cit->vectorFormat()) {
2267 os << "\\format \"" << cit->name() << "\" \""
2268 << cit->extension() << "\" \""
2269 << cit->prettyname() << "\" \""
2270 << cit->shortcut() << "\" \""
2271 << cit->viewer() << "\" \""
2272 << cit->editor() << "\" \"";
2273 vector<string> flags;
2274 if (cit->documentFormat())
2275 flags.push_back("document");
2276 if (cit->vectorFormat())
2277 flags.push_back("vector");
2278 os << getStringFromVector(flags);
2283 // Look for deleted formats
2284 for (Formats::const_iterator cit = system_formats.begin();
2285 cit != system_formats.end(); ++cit)
2286 if (!formats.getFormat(cit->name()))
2287 os << "\\format \"" << cit->name()
2288 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2297 << "# CONVERTERS SECTION ##########################\n"
2301 // Look for new converters
2302 for (Converters::const_iterator cit = theConverters().begin();
2303 cit != theConverters().end(); ++cit) {
2304 Converter const * converter =
2305 theSystemConverters().getConverter(cit->from,
2308 converter->command != cit->command ||
2309 converter->flags != cit->flags)
2310 os << "\\converter \"" << cit->from << "\" \""
2311 << cit->to << "\" \""
2312 << cit->command << "\" \""
2313 << cit->flags << "\"\n";
2316 // New/modifed converters
2317 for (Converters::const_iterator cit = theSystemConverters().begin();
2318 cit != theSystemConverters().end(); ++cit)
2319 if (!theConverters().getConverter(cit->from, cit->to))
2320 os << "\\converter \"" << cit->from
2321 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2328 << "# COPIERS SECTION ##########################\n"
2331 // Look for new movers
2332 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2333 Movers::const_iterator const sysend = theSystemMovers().end();
2334 Movers::const_iterator it = theMovers().begin();
2335 Movers::const_iterator end = theMovers().end();
2337 for (; it != end; ++it) {
2338 Movers::const_iterator const sysit =
2339 find_if(sysbegin, sysend, SameMover(*it));
2340 if (sysit == sysend) {
2341 string const & fmt = it->first;
2342 string const & command =
2343 it->second.command();
2345 os << "\\copier " << fmt
2346 << " \"" << command << "\"\n";
2352 // We don't actually delete SpecialisedMover(s) from the
2353 // map, just clear their 'command', so there's no need
2354 // to test for anything else.
2362 string const LyXRC::getDescription(LyXRCTags tag)
2367 case RC_ACCEPT_COMPOUND:
2368 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2372 case RC_USE_ALT_LANG:
2373 str = _("Specify an alternate language. The default is to use the language of the document.");
2376 case RC_PLAINTEXT_ROFF_COMMAND:
2377 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.");
2380 case RC_PLAINTEXT_LINELEN:
2381 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.");
2384 case RC_AUTOREGIONDELETE:
2385 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2388 case RC_AUTORESET_OPTIONS:
2389 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2393 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2396 case RC_AUTO_NUMBER:
2399 case RC_BACKUPDIR_PATH:
2400 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.");
2403 case RC_BIBTEX_COMMAND:
2404 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2408 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2411 case RC_CHECKLASTFILES:
2412 str = _("Select to check whether the lastfiles still exist.");
2415 case RC_CHKTEX_COMMAND:
2416 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2425 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2426 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.");
2429 case RC_SHOW_MACRO_LABEL:
2430 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2433 case RC_CUSTOM_EXPORT_COMMAND:
2436 case RC_CUSTOM_EXPORT_FORMAT:
2439 case RC_DATE_INSERT_FORMAT:
2440 //xgettext:no-c-format
2441 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2445 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2448 case RC_DEFAULT_LANGUAGE:
2449 str = _("New documents will be assigned this language.");
2452 case RC_DEFAULT_PAPERSIZE:
2453 str = _("Specify the default paper size.");
2456 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2457 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2460 case RC_DISPLAY_GRAPHICS:
2461 str = _("Select how LyX will display any graphics.");
2464 case RC_DOCUMENTPATH:
2465 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2469 case RC_USE_ESC_CHARS:
2470 str = _("Specify additional chars that can be part of a word.");
2473 case RC_EXAMPLEPATH:
2474 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2477 case RC_FONT_ENCODING:
2478 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2484 case RC_INDEX_COMMAND:
2485 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\".");
2492 case RC_KBMAP_PRIMARY:
2493 case RC_KBMAP_SECONDARY:
2494 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.");
2497 case RC_LABEL_INIT_LENGTH:
2498 str = _("Maximum number of words in the initialization string for a new label");
2501 case RC_LANGUAGE_AUTO_BEGIN:
2502 str = _("Select if a language switching command is needed at the beginning of the document.");
2505 case RC_LANGUAGE_AUTO_END:
2506 str = _("Select if a language switching command is needed at the end of the document.");
2509 case RC_LANGUAGE_COMMAND_BEGIN:
2510 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.");
2513 case RC_LANGUAGE_COMMAND_END:
2514 str = _("The LaTeX command for changing back to the language of the document.");
2517 case RC_LANGUAGE_COMMAND_LOCAL:
2518 str = _("The LaTeX command for local changing of the language.");
2521 case RC_LANGUAGE_GLOBAL_OPTIONS:
2522 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2525 case RC_LANGUAGE_PACKAGE:
2526 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2529 case RC_LANGUAGE_USE_BABEL:
2530 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2533 case RC_USELASTFILEPOS:
2534 str = _("De-select if you do not want LyX to scroll to saved position.");
2537 case RC_LOADSESSION:
2538 str = _("De-select to prevent loading files opened from the last LyX session.");
2541 case RC_MAKE_BACKUP:
2542 str = _("De-select if you don't want LyX to create backup files.");
2545 case RC_MARK_FOREIGN_LANGUAGE:
2546 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2549 case RC_MOUSE_WHEEL_SPEED:
2550 str = bformat(_("The scrolling speed of the mouse wheel."),
2554 case RC_COMPLETION_POPUP_DELAY:
2555 str = _("The completion popup delay.");
2558 case RC_COMPLETION_POPUP_MATH:
2559 str = _("Select to display the completion popup in math mode.");
2562 case RC_COMPLETION_POPUP_TEXT:
2563 str = _("Select to display the completion popup in text mode.");
2566 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2567 str = _("Show the completion popup without delay after non-unique completion attempt.");
2570 case RC_COMPLETION_POPUP_TEXT:
2571 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2574 case RC_COMPLETION_POPUP_DELAY:
2575 str = _("The inline completion delay.");
2578 case RC_COMPLETION_INLINE_MATH:
2579 str = _("Select to display the inline completion in math mode.");
2582 case RC_COMPLETION_INLINE_TEXT:
2583 str = _("Select to display the inline completion in text mode.");
2586 case RC_COMPLETION_INLINE_DOTS:
2587 str = _("Use \"...\" to shorten long completions.");
2590 case RC_NUMLASTFILES:
2591 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2595 case RC_PATH_PREFIX:
2596 str = _("Specify those directories which should be "
2597 "prepended to the PATH environment variable. "
2598 "Use the OS native format.");
2602 case RC_USE_PERS_DICT:
2603 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2607 str = _("Shows a typeset preview of things such as math");
2610 case RC_PREVIEW_HASHED_LABELS:
2611 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2614 case RC_PREVIEW_SCALE_FACTOR:
2615 str = _("Scale the preview size to suit.");
2618 case RC_PRINTCOLLCOPIESFLAG:
2619 str = _("The option for specifying whether the copies should be collated.");
2622 case RC_PRINTCOPIESFLAG:
2623 str = _("The option for specifying the number of copies to print.");
2627 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2630 case RC_PRINTEVENPAGEFLAG:
2631 str = _("The option to print only even pages.");
2634 case RC_PRINTEXSTRAOPTIONS:
2635 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2638 case RC_PRINTFILEEXTENSION:
2639 str = _("Extension of printer program output file. Usually \".ps\".");
2642 case RC_PRINTLANDSCAPEFLAG:
2643 str = _("The option to print out in landscape.");
2646 case RC_PRINTODDPAGEFLAG:
2647 str = _("The option to print only odd pages.");
2650 case RC_PRINTPAGERANGEFLAG:
2651 str = _("The option for specifying a comma-separated list of pages to print.");
2654 case RC_PRINTPAPERDIMENSIONFLAG:
2655 str = _("Option to specify the dimensions of the print paper.");
2658 case RC_PRINTPAPERFLAG:
2659 str = _("The option to specify paper type.");
2662 case RC_PRINTREVERSEFLAG:
2663 str = _("The option to reverse the order of the pages printed.");
2666 case RC_PRINTSPOOL_COMMAND:
2667 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.");
2670 case RC_PRINTSPOOL_PRINTERPREFIX:
2671 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.");
2674 case RC_PRINTTOFILE:
2675 str = _("Option to pass to the print program to print to a file.");
2678 case RC_PRINTTOPRINTER:
2679 str = _("Option to pass to the print program to print on a specific printer.");
2682 case RC_PRINT_ADAPTOUTPUT:
2683 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2686 case RC_PRINT_COMMAND:
2687 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2690 case RC_RTL_SUPPORT:
2691 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2694 case RC_VISUAL_CURSOR:
2695 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2699 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2702 case RC_SCREEN_FONT_ROMAN:
2703 case RC_SCREEN_FONT_SANS:
2704 case RC_SCREEN_FONT_TYPEWRITER:
2705 str = _("The screen fonts used to display the text while editing.");
2708 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2709 case RC_SCREEN_FONT_SANS_FOUNDRY:
2710 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2713 case RC_SCREEN_FONT_SCALABLE:
2714 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.");
2717 case RC_SCREEN_FONT_SIZES:
2718 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2721 case RC_SCREEN_ZOOM:
2722 //xgettext:no-c-format
2723 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2726 case RC_GEOMETRY_SESSION:
2727 str = _("Allow session manager to save and restore windows geometry.");
2731 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2737 case RC_SHOW_BANNER:
2738 str = _("De-select if you don't want the startup banner.");
2741 case RC_SPELL_COMMAND:
2742 str = _("What command runs the spellchecker?");
2745 case RC_TEMPDIRPATH:
2746 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2749 case RC_TEMPLATEPATH:
2750 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2753 case RC_TEX_ALLOWS_SPACES:
2756 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2760 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2772 case RC_USE_INP_ENC:
2773 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.");
2776 case RC_USE_TOOLTIP:
2777 str = _("Enable the automatic appearance of tool tips in the work area.");
2780 case RC_USE_PIXMAP_CACHE:
2781 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2784 case RC_USE_SPELL_LIB:
2787 case RC_VIEWDVI_PAPEROPTION:
2788 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2803 // The global instance
2806 // The global copy of the system lyxrc entries (everything except preferences)