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_bundled_format", LyXRC::RC_USE_BUNDLED_FORMAT },
167 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
168 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
169 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
170 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
171 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
172 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
173 // compatibility with versions older than 1.4.0 only
174 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
175 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
176 // compatibility with versions older than 1.4.0 only
177 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
178 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
179 { "\\user_email", LyXRC::RC_USER_EMAIL },
180 { "\\user_name", LyXRC::RC_USER_NAME },
181 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
182 // compatibility with versions older than 1.4.0 only
183 { "\\viewer", LyXRC::RC_VIEWER},
184 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
187 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
198 void LyXRC::setDefaults()
201 def_file = "default";
203 // Get printer from the environment. If fail, use default "",
204 // assuming that everything is set up correctly.
205 printer = getEnv("PRINTER");
206 print_adapt_output = false;
207 print_command = "dvips";
208 print_evenpage_flag = "-B";
209 print_oddpage_flag = "-A";
210 print_pagerange_flag = "-pp";
211 print_copies_flag = "-c";
212 print_collcopies_flag = "-C";
213 print_reverse_flag = "-r";
214 print_landscape_flag = "-t landscape";
215 print_to_printer = "-P";
216 print_to_file = "-o ";
217 print_file_extension = ".ps";
218 print_paper_flag = "-t";
219 print_paper_dimension_flag = "-T";
220 document_path.erase();
221 view_dvi_paper_option.erase();
222 default_papersize = PAPER_DEFAULT;
223 custom_export_format = "ps";
224 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
225 bibtex_command = "bibtex";
227 index_command = "makeindex -c -q";
229 // Because a screen typically is wider than a piece of paper:
231 allow_geometry_session = true;
232 // Default LaTeX font size:
233 font_sizes[FONT_SIZE_TINY] = "5.0";
234 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
235 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
236 font_sizes[FONT_SIZE_SMALL] = "9.0";
237 font_sizes[FONT_SIZE_NORMAL] = "10.0";
238 font_sizes[FONT_SIZE_LARGE] = "12.0";
239 font_sizes[FONT_SIZE_LARGER] = "14.4";
240 font_sizes[FONT_SIZE_LARGEST] = "17.26";
241 font_sizes[FONT_SIZE_HUGE] = "20.74";
242 font_sizes[FONT_SIZE_HUGER] = "24.88";
243 use_scalable_fonts = true;
244 roman_font_name = "";
246 typewriter_font_name = "";
248 auto_region_delete = true;
249 auto_reset_options = false;
250 plaintext_linelen = 65;
251 mouse_wheel_speed = 1.0;
252 num_lastfiles = maxlastfiles;
253 check_lastfiles = true;
254 use_lastfilepos = true;
255 load_session = false;
257 backupdir_path.erase();
258 display_graphics = graphics::ColorDisplay;
259 // Spellchecker settings:
260 use_spell_lib = true;
261 isp_command = "ispell";
262 isp_accept_compound = false;
263 isp_use_input_encoding = false;
264 isp_use_alt_lang = false;
265 isp_use_pers_dict = false;
266 isp_use_esc_chars = false;
269 visual_cursor = false;
271 mark_foreign_language = true;
272 language_auto_begin = true;
273 language_auto_end = true;
274 language_global_options = true;
275 language_use_babel = true;
276 language_package = "\\usepackage{babel}";
277 language_command_begin = "\\selectlanguage{$$lang}";
278 language_command_local = "\\foreignlanguage{$$lang}{";
279 sort_layouts = false;
280 group_layouts = true;
281 default_language = "english";
283 windows_style_tex_paths = false;
284 tex_allows_spaces = false;
285 date_insert_format = "%x";
286 cursor_follows_scrollbar = false;
287 macro_edit_style = MACRO_EDIT_INLINE_BOX;
288 dialogs_iconify_with_main = false;
289 label_init_length = 3;
290 preview = PREVIEW_OFF;
291 preview_hashed_labels = false;
292 preview_scale_factor = "0.9";
293 use_converter_cache = true;
295 use_pixmap_cache = false;
296 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
297 user_name = to_utf8(support::user_name());
298 user_email = to_utf8(support::user_email());
299 open_buffers_in_tabs = true;
300 use_bundled_format = false;
302 // Fullscreen settings
303 full_screen_limit = false;
304 full_screen_toolbars = true;
305 full_screen_tabbar = true;
306 full_screen_scrollbar = true;
307 full_screen_width = 700;
309 completion_cursor_text = true;
310 completion_popup_math = true;
311 completion_popup_text = false;
312 completion_popup_delay = 2.0;
313 completion_popup_after_complete = true;
314 completion_inline_math = true;
315 completion_inline_text = false;
316 completion_inline_dots = -1;
317 completion_inline_delay = 0.2;
323 void oldFontFormat(string & family, string & foundry)
325 if (family.empty() || family[0] != '-')
327 foundry = token(family, '-', 1);
328 family = token(family, '-', 2);
336 int LyXRC::read(FileName const & filename)
338 Lexer lexrc(lyxrcTags);
339 if (lyxerr.debugging(Debug::PARSER))
340 lexrc.printTable(lyxerr);
342 lexrc.setFile(filename);
346 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
352 int LyXRC::read(istream & is)
354 Lexer lexrc(lyxrcTags);
355 if (lyxerr.debugging(Debug::PARSER))
356 lexrc.printTable(lyxerr);
362 LYXERR(Debug::LYXRC, "Reading istream...");
368 int LyXRC::read(Lexer & lexrc)
370 if (!lexrc.isOK()) return -2;
372 while (lexrc.isOK()) {
373 // By using two switches we take advantage of the compiler
374 // telling us if we have missed a LyXRCTags element in
375 // the second switch.
376 // Note that this also shows a problem with Lexer since it
377 // helps us avoid taking advantage of the strictness of the
380 int le = lexrc.lex();
382 case Lexer::LEX_UNDEF:
383 lexrc.printError("Unknown tag `$$Token'");
385 case Lexer::LEX_FEOF:
389 switch (static_cast<LyXRCTags>(le)) {
390 case RC_INPUT: // Include file
393 libFileSearch(string(),
396 lexrc.printError("Error reading "
397 "included file: " + tmp.absFilename());
403 bind_file = os::internal_path(lexrc.getString());
409 def_file = os::internal_path(lexrc.getString());
415 ui_file = os::internal_path(lexrc.getString());
419 case RC_AUTORESET_OPTIONS:
420 lexrc >> auto_reset_options;
423 case RC_DISPLAY_GRAPHICS:
425 display_graphics = graphics::displayTranslator().find(lexrc.getString());
428 case RC_TEX_EXPECTS_WINDOWS_PATHS:
429 lexrc >> windows_style_tex_paths;
432 case RC_TEX_ALLOWS_SPACES:
433 lexrc >> tex_allows_spaces;
440 case RC_KBMAP_PRIMARY:
442 string const kmap(os::internal_path(lexrc.getString()));
445 } else if (!libFileSearch("kbd", kmap,
447 primary_kbmap = kmap;
449 lexrc.printError("LyX: Keymap `$$Token' not found");
454 case RC_KBMAP_SECONDARY:
456 string const kmap(os::internal_path(lexrc.getString()));
459 } else if (!libFileSearch("kbd", kmap,
461 secondary_kbmap = kmap;
463 lexrc.printError("LyX: Keymap `$$Token' not found");
468 case RC_FONT_ENCODING:
476 case RC_PRINT_COMMAND:
477 lexrc >> print_command;
480 case RC_PRINTEVENPAGEFLAG:
481 lexrc >> print_evenpage_flag;
484 case RC_PRINTODDPAGEFLAG:
485 lexrc >> print_oddpage_flag;
488 case RC_PRINTPAGERANGEFLAG:
489 lexrc >> print_pagerange_flag;
492 case RC_PRINTCOPIESFLAG:
493 lexrc >> print_copies_flag;
496 case RC_PRINTCOLLCOPIESFLAG:
497 lexrc >> print_collcopies_flag;
500 case RC_PRINTREVERSEFLAG:
501 lexrc >> print_reverse_flag;
504 case RC_PRINTLANDSCAPEFLAG:
505 lexrc >> print_landscape_flag;
508 case RC_PRINTTOPRINTER:
509 lexrc >> print_to_printer;
512 case RC_PRINT_ADAPTOUTPUT:
513 lexrc >> print_adapt_output;
517 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:
555 ascii_lowercase(lexrc.getString());
556 if (size == "usletter")
559 else if (size == "legal")
562 else if (size == "executive")
565 else if (size == "a3")
568 else if (size == "a4")
571 else if (size == "a5")
574 else if (size == "b5")
577 else if (size == "default")
583 case RC_VIEWDVI_PAPEROPTION:
585 view_dvi_paper_option = lexrc.getString();
587 view_dvi_paper_option.erase();
591 case RC_CHKTEX_COMMAND:
592 lexrc >> chktex_command;
595 case RC_BIBTEX_COMMAND:
596 lexrc >> bibtex_command;
599 case RC_INDEX_COMMAND:
600 lexrc >> index_command;
611 case RC_GEOMETRY_SESSION:
612 lexrc >> allow_geometry_session;
615 case RC_SCREEN_FONT_SIZES:
616 lexrc >> font_sizes[FONT_SIZE_TINY];
617 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
618 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
619 lexrc >> font_sizes[FONT_SIZE_SMALL];
620 lexrc >> font_sizes[FONT_SIZE_NORMAL];
621 lexrc >> font_sizes[FONT_SIZE_LARGE];
622 lexrc >> font_sizes[FONT_SIZE_LARGER];
623 lexrc >> font_sizes[FONT_SIZE_LARGEST];
624 lexrc >> font_sizes[FONT_SIZE_HUGE];
625 lexrc >> font_sizes[FONT_SIZE_HUGER];
628 case RC_SCREEN_FONT_SCALABLE:
629 lexrc >> use_scalable_fonts;
636 case RC_DOCUMENTPATH:
638 document_path = os::internal_path(lexrc.getString());
639 document_path = expandPath(document_path);
645 example_path = os::internal_path(lexrc.getString());
646 example_path = expandPath(example_path);
650 case RC_TEMPLATEPATH:
652 template_path = os::internal_path(lexrc.getString());
653 template_path = expandPath(template_path);
659 tempdir_path = os::internal_path(lexrc.getString());
660 tempdir_path = expandPath(tempdir_path);
666 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
670 case RC_USELASTFILEPOS:
671 lexrc >> use_lastfilepos;
675 lexrc >> load_session;
678 case RC_MOUSE_WHEEL_SPEED:
679 lexrc >> mouse_wheel_speed;
682 case RC_COMPLETION_INLINE_DELAY:
683 lexrc >> completion_inline_delay;
686 case RC_COMPLETION_INLINE_MATH:
687 lexrc >> completion_inline_math;
690 case RC_COMPLETION_INLINE_TEXT:
691 lexrc >> completion_inline_text;
694 case RC_COMPLETION_INLINE_DOTS:
695 lexrc >> completion_inline_dots;
698 case RC_COMPLETION_POPUP_DELAY:
699 lexrc >> completion_popup_delay;
702 case RC_COMPLETION_POPUP_MATH:
703 lexrc >> completion_popup_math;
706 case RC_COMPLETION_POPUP_TEXT:
707 lexrc >> completion_popup_text;
710 case RC_COMPLETION_CURSOR_TEXT:
711 lexrc >> completion_cursor_text;
714 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
715 lexrc >> completion_popup_after_complete;
718 case RC_NUMLASTFILES:
719 lexrc >> num_lastfiles;
722 case RC_CHECKLASTFILES:
723 lexrc >> check_lastfiles;
726 case RC_SCREEN_FONT_ROMAN:
728 roman_font_name = lexrc.getString();
729 oldFontFormat(roman_font_name,
734 case RC_SCREEN_FONT_SANS:
736 sans_font_name = lexrc.getString();
737 oldFontFormat(sans_font_name, sans_font_foundry);
741 case RC_SCREEN_FONT_TYPEWRITER:
743 typewriter_font_name = lexrc.getString();
744 oldFontFormat(typewriter_font_name,
745 typewriter_font_foundry);
749 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
751 roman_font_foundry = lexrc.getString();
755 case RC_SCREEN_FONT_SANS_FOUNDRY:
757 sans_font_foundry = lexrc.getString();
761 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
763 typewriter_font_foundry = lexrc.getString();
769 string lyx_name, x11_name;
772 lyx_name = lexrc.getString();
774 lexrc.printError("Missing color tag.");
779 x11_name = lexrc.getString();
781 lexrc.printError("Missing color name for color: `$$Token'");
785 ColorCode const col =
786 lcolor.getFromLyXName(lyx_name);
787 if (col == Color_none ||
788 col == Color_inherit ||
792 if (!lcolor.setColor(col, x11_name)) {
793 lyxerr << "Bad lyxrc set_color for "
799 case RC_AUTOREGIONDELETE:
800 // Auto region delete defaults to true
802 auto_region_delete = lexrc.getBool();
808 lyxpipes = os::internal_path(lexrc.getString());
809 lyxpipes = expandPath(lyxpipes);
813 case RC_CURSOR_FOLLOWS_SCROLLBAR:
815 cursor_follows_scrollbar = lexrc.getBool();
819 case RC_MACRO_EDIT_STYLE:
821 switch (lexrc.getInteger()) {
822 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
823 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
824 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
829 case RC_DIALOGS_ICONIFY_WITH_MAIN:
831 dialogs_iconify_with_main = lexrc.getBool();
835 case RC_PLAINTEXT_ROFF_COMMAND:
837 plaintext_roff_command = lexrc.getString();
840 case RC_PLAINTEXT_LINELEN:
842 plaintext_linelen = lexrc.getInteger();
845 // Spellchecker settings:
846 case RC_USE_SPELL_LIB:
848 use_spell_lib = lexrc.getBool();
851 case RC_SPELL_COMMAND:
853 isp_command = lexrc.getString();
856 case RC_ACCEPT_COMPOUND:
858 isp_accept_compound = lexrc.getBool();
863 isp_use_input_encoding = lexrc.getBool();
866 case RC_USE_ALT_LANG:
868 isp_use_alt_lang = lexrc.getBool();
871 case RC_USE_PERS_DICT:
873 isp_use_pers_dict = lexrc.getBool();
878 use_tooltip = lexrc.getBool();
881 case RC_USE_PIXMAP_CACHE:
883 use_pixmap_cache = lexrc.getBool();
886 case RC_USE_ESC_CHARS:
888 isp_use_esc_chars = lexrc.getBool();
893 isp_alt_lang = lexrc.getString();
898 isp_pers_dict = os::internal_path(lexrc.getString());
903 isp_esc_chars = lexrc.getString();
908 make_backup = lexrc.getBool();
911 case RC_BACKUPDIR_PATH:
913 backupdir_path = os::internal_path(lexrc.getString());
914 backupdir_path = expandPath(backupdir_path);
917 case RC_DATE_INSERT_FORMAT:
919 date_insert_format = lexrc.getString();
922 case RC_LANGUAGE_PACKAGE:
924 language_package = lexrc.getString();
927 case RC_LANGUAGE_AUTO_BEGIN:
929 language_auto_begin = lexrc.getBool();
932 case RC_LANGUAGE_AUTO_END:
934 language_auto_end = lexrc.getBool();
937 case RC_LANGUAGE_GLOBAL_OPTIONS:
939 language_global_options = lexrc.getBool();
942 case RC_LANGUAGE_USE_BABEL:
944 language_use_babel = lexrc.getBool();
947 case RC_LANGUAGE_COMMAND_BEGIN:
949 language_command_begin = lexrc.getString();
952 case RC_LANGUAGE_COMMAND_END:
954 language_command_end = lexrc.getString();
957 case RC_LANGUAGE_COMMAND_LOCAL:
959 language_command_local = lexrc.getString();
964 rtl_support = lexrc.getBool();
967 case RC_VISUAL_CURSOR:
969 visual_cursor = lexrc.getBool();
974 auto_number = lexrc.getBool();
977 case RC_MARK_FOREIGN_LANGUAGE:
979 mark_foreign_language = lexrc.getBool();
985 lexrc >> fmt >> command;
986 setMover(fmt, command);
991 string from, to, command, flags;
992 lexrc >> from >> to >> command >> flags;
994 theConverters().erase(from, to);
996 theConverters().add(from, to, command, flags);
999 // compatibility with versions older than 1.4.0 only
1001 string format, command;
1002 lexrc >> format >> command;
1003 formats.setViewer(format, command);
1007 string format, extension, prettyname, shortcut;
1008 lexrc >> format >> extension >> prettyname >> shortcut;
1009 string viewer, editor;
1010 lexrc >> viewer >> editor;
1012 // Hack to ensure compatibility with versions older
1014 int le = lexrc.lex();
1015 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1016 flags = lexrc.getString();
1017 if (le != Lexer::LEX_DATA) {
1018 // We have got a known token.
1019 // Therefore this is an old style
1020 // format definition without
1022 lexrc.pushToken(flags);
1026 int flgs = Format::none;
1027 while (!flags.empty()) {
1029 flags = split(flags, flag, ',');
1030 if (flag == "document")
1031 flgs |= Format::document;
1032 else if (flag == "vector")
1033 flgs |= Format::vector;
1035 lyxerr << "Ignoring unknown flag `"
1036 << flag << "' for format `"
1037 << format << "'." << endl;
1039 if (prettyname.empty()) {
1040 if (theConverters().formatIsUsed(format)) {
1041 lyxerr << "Can't delete format "
1044 formats.erase(format);
1047 formats.add(format, extension, prettyname,
1048 shortcut, viewer, editor, flgs);
1052 case RC_DEFAULT_LANGUAGE:
1054 default_language = lexrc.getString();
1058 case RC_LABEL_INIT_LENGTH:
1060 label_init_length = lexrc.getInteger();
1064 case RC_SHOW_BANNER:
1066 show_banner = lexrc.getBool();
1072 string const tmp = lexrc.getString();
1073 if (tmp == "true" || tmp == "on")
1074 preview = PREVIEW_ON;
1075 else if (tmp == "no_math")
1076 preview = PREVIEW_NO_MATH;
1078 preview = PREVIEW_OFF;
1079 if (tmp != "false" && tmp != "off")
1080 lyxerr << "Unrecognized "
1082 << tmp << '\n' << endl;
1087 case RC_PREVIEW_HASHED_LABELS:
1089 preview_hashed_labels = lexrc.getBool();
1093 case RC_PREVIEW_SCALE_FACTOR:
1095 preview_scale_factor = lexrc.getString();
1101 user_name = lexrc.getString();
1106 user_email = lexrc.getString();
1109 case RC_PATH_PREFIX:
1111 path_prefix = lexrc.getString();
1114 case RC_USE_CONVERTER_CACHE:
1116 use_converter_cache = lexrc.getBool();
1119 case RC_CONVERTER_CACHE_MAXAGE:
1121 converter_cache_maxage =
1122 convert<unsigned int>(lexrc.getString());
1125 case RC_SORT_LAYOUTS:
1127 sort_layouts = lexrc.getBool();
1129 case RC_GROUP_LAYOUTS:
1131 group_layouts = lexrc.getBool();
1133 case RC_FULL_SCREEN_LIMIT:
1135 full_screen_limit = lexrc.getBool();
1137 case RC_FULL_SCREEN_TOOLBARS:
1139 full_screen_toolbars = lexrc.getBool();
1141 case RC_FULL_SCREEN_SCROLLBAR:
1143 full_screen_scrollbar = lexrc.getBool();
1145 case RC_FULL_SCREEN_TABBAR:
1147 full_screen_tabbar = lexrc.getBool();
1149 case RC_FULL_SCREEN_WIDTH:
1151 full_screen_width = lexrc.getInteger();
1153 case RC_OPEN_BUFFERS_IN_TABS:
1155 open_buffers_in_tabs = lexrc.getBool();
1157 case RC_USE_BUNDLED_FORMAT:
1159 use_bundled_format = lexrc.getBool();
1162 case RC_LAST: break; // this is just a dummy
1166 /// Update converters data-structures
1167 theConverters().update(formats);
1168 theConverters().buildGraph();
1174 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1176 ofstream ofs(filename.toFilesystemEncoding().c_str());
1178 write(ofs, ignore_system_lyxrc);
1182 void LyXRC::print() const
1184 if (lyxerr.debugging())
1185 write(lyxerr, false);
1193 typedef pair<string, SpecialisedMover> Data;
1195 SameMover(Data const & comparison)
1196 : comparison_(comparison) {}
1198 bool operator()(Data const & data) const
1200 return data.first == comparison_.first &&
1201 data.second.command() == comparison_.second.command();
1209 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1211 LyXRCTags tag = RC_LAST;
1213 if (!name.empty()) {
1214 for (int i = 0; i != lyxrcCount; ++i)
1215 if ("\\" + name == lyxrcTags[i].tag)
1216 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1220 os << "### This file is part of\n"
1221 << "### ========================================================\n"
1222 << "### LyX, The Document Processor\n"
1224 << "### Copyright 1995 Matthias Ettrich\n"
1225 << "### Copyright 1995-2007 The LyX Team.\n"
1227 << "### ========================================================\n"
1229 << "# This file is written by LyX, if you want to make your own\n"
1230 << "# modifications you should do them from inside LyX and save\n"
1233 // Why the switch you might ask. It is a trick to ensure that all
1234 // the elements in the LyXRCTags enum is handled. As you can see
1235 // there are no breaks at all. So it is just a huge fall-through.
1236 // The nice thing is that we will get a warning from the compiler
1237 // if we forget an element.
1241 // input/include files are not done here
1243 if (ignore_system_lyxrc ||
1244 bind_file != system_lyxrc.bind_file) {
1245 string const path = os::external_path(bind_file);
1246 os << "\\bind_file \"" << path << "\"\n";
1252 if (ignore_system_lyxrc ||
1253 def_file != system_lyxrc.def_file) {
1254 string const path = os::external_path(def_file);
1255 os << "\\def_file \"" << path << "\"\n";
1264 << "# MISC SECTION ######################################\n"
1266 // bind files are not done here.
1268 case RC_PATH_PREFIX:
1269 if (ignore_system_lyxrc ||
1270 path_prefix != system_lyxrc.path_prefix) {
1271 os << "\\path_prefix \"" << path_prefix << "\"\n";
1276 if (ignore_system_lyxrc ||
1277 ui_file != system_lyxrc.ui_file) {
1278 string const path = os::external_path(ui_file);
1279 os << "\\ui_file \"" << path << "\"\n";
1283 case RC_AUTOREGIONDELETE:
1284 if (ignore_system_lyxrc ||
1285 auto_region_delete != system_lyxrc.auto_region_delete) {
1286 os << "# Set to false to inhibit automatic replacement of\n"
1287 << "# the current selection.\n"
1288 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1293 case RC_AUTORESET_OPTIONS:
1294 if (ignore_system_lyxrc ||
1295 auto_reset_options != system_lyxrc.auto_reset_options) {
1296 os << "# Set to false to inhibit automatic reset of\n"
1297 << "# the class options to defaults on class change.\n"
1298 << "\\auto_reset_options "
1299 << convert<string>(auto_reset_options)
1305 if (ignore_system_lyxrc ||
1306 autosave != system_lyxrc.autosave) {
1307 os << "# The time interval between auto-saves in seconds.\n"
1308 << "\\autosave " << autosave << '\n';
1312 case RC_DISPLAY_GRAPHICS:
1313 if (ignore_system_lyxrc ||
1314 display_graphics != system_lyxrc.display_graphics) {
1315 os << "# Display graphics within LyX\n"
1316 << "# monochrome|grayscale|color|none\n"
1317 << "\\display_graphics "
1318 << graphics::displayTranslator().find(
1319 graphics::DisplayType(display_graphics))
1324 case RC_SORT_LAYOUTS:
1325 if (ignore_system_lyxrc ||
1326 sort_layouts != system_lyxrc.sort_layouts) {
1327 os << "# Sort layouts alphabetically.\n"
1328 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1332 case RC_GROUP_LAYOUTS:
1333 if (ignore_system_lyxrc ||
1334 group_layouts != system_lyxrc.group_layouts) {
1335 os << "# Group layouts by their category.\n"
1336 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1340 case RC_VIEWDVI_PAPEROPTION:
1341 if (ignore_system_lyxrc ||
1342 view_dvi_paper_option
1343 != system_lyxrc.view_dvi_paper_option) {
1344 os << "# Options used to specify paper size to the\n"
1345 << "# view_dvi_command (e.g. -paper)\n"
1346 << "\\view_dvi_paper_option \""
1347 << view_dvi_paper_option << "\"\n";
1351 case RC_DEFAULT_PAPERSIZE:
1352 if (ignore_system_lyxrc ||
1353 default_papersize != system_lyxrc.default_papersize) {
1354 os << "# The default papersize to use.\n"
1355 << "\\default_papersize \"";
1356 switch (default_papersize) {
1358 os << "default"; break;
1359 case PAPER_USLETTER:
1360 os << "usletter"; break;
1362 os << "legal"; break;
1363 case PAPER_USEXECUTIVE:
1364 os << "executive"; break;
1375 case PAPER_B4: break;
1381 case RC_CHKTEX_COMMAND:
1382 if (ignore_system_lyxrc ||
1383 chktex_command != system_lyxrc.chktex_command) {
1384 os << "\\chktex_command \"" << chktex_command << "\"\n";
1388 case RC_BIBTEX_COMMAND:
1389 if (ignore_system_lyxrc ||
1390 bibtex_command != system_lyxrc.bibtex_command) {
1391 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1395 case RC_INDEX_COMMAND:
1396 if (ignore_system_lyxrc ||
1397 index_command != system_lyxrc.index_command) {
1398 os << "\\index_command \"" << index_command << "\"\n";
1402 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1403 if (ignore_system_lyxrc ||
1404 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1405 os << "\\tex_expects_windows_paths "
1406 << convert<string>(windows_style_tex_paths) << '\n';
1410 case RC_TEX_ALLOWS_SPACES:
1411 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1412 os << "\\tex_allows_spaces "
1413 << convert<string>(tex_allows_spaces) << '\n';
1418 if (ignore_system_lyxrc ||
1419 use_kbmap != system_lyxrc.use_kbmap) {
1420 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1424 case RC_KBMAP_PRIMARY:
1425 if (ignore_system_lyxrc ||
1426 primary_kbmap != system_lyxrc.primary_kbmap) {
1427 string const path = os::external_path(primary_kbmap);
1428 os << "\\kbmap_primary \"" << path << "\"\n";
1432 case RC_KBMAP_SECONDARY:
1433 if (ignore_system_lyxrc ||
1434 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1435 string const path = os::external_path(secondary_kbmap);
1436 os << "\\kbmap_secondary \"" << path << "\"\n";
1441 if (ignore_system_lyxrc ||
1442 lyxpipes != system_lyxrc.lyxpipes) {
1443 string const path = os::external_path(lyxpipes);
1444 os << "\\serverpipe \"" << path << "\"\n";
1448 case RC_DATE_INSERT_FORMAT:
1449 if (ignore_system_lyxrc ||
1450 date_insert_format != system_lyxrc.date_insert_format) {
1451 os << "\\date_insert_format \"" << date_insert_format
1456 case RC_LABEL_INIT_LENGTH:
1457 if (ignore_system_lyxrc ||
1458 label_init_length != system_lyxrc.label_init_length) {
1459 os << "\\label_init_length " << label_init_length
1466 os << "\\user_name \"" << user_name << "\"\n";
1471 os << "\\user_email \"" << user_email << "\"\n";
1475 case RC_SHOW_BANNER:
1476 if (ignore_system_lyxrc ||
1477 show_banner != system_lyxrc.show_banner) {
1478 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1484 if (ignore_system_lyxrc ||
1485 preview != system_lyxrc.preview) {
1491 case PREVIEW_NO_MATH:
1498 os << "\\preview " << status << '\n';
1503 case RC_PREVIEW_HASHED_LABELS:
1504 if (ignore_system_lyxrc ||
1505 preview_hashed_labels !=
1506 system_lyxrc.preview_hashed_labels) {
1507 os << "\\preview_hashed_labels "
1508 << convert<string>(preview_hashed_labels) << '\n';
1513 case RC_PREVIEW_SCALE_FACTOR:
1514 if (ignore_system_lyxrc ||
1515 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1516 os << "\\preview_scale_factor "
1517 << preview_scale_factor << '\n';
1522 case RC_USE_CONVERTER_CACHE:
1523 if (ignore_system_lyxrc ||
1524 use_converter_cache != system_lyxrc.use_converter_cache) {
1525 os << "\\use_converter_cache "
1526 << convert<string>(use_converter_cache) << '\n';
1531 case RC_CONVERTER_CACHE_MAXAGE:
1532 if (ignore_system_lyxrc ||
1533 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1534 os << "\\converter_cache_maxage "
1535 << converter_cache_maxage << '\n';
1541 << "# SCREEN & FONTS SECTION ############################\n"
1545 if (ignore_system_lyxrc ||
1546 dpi != system_lyxrc.dpi) {
1547 os << "\\screen_dpi " << dpi << '\n';
1551 case RC_SCREEN_ZOOM:
1552 if (ignore_system_lyxrc ||
1553 zoom != system_lyxrc.zoom) {
1554 os << "\\screen_zoom " << zoom << '\n';
1558 case RC_GEOMETRY_SESSION:
1559 if (ignore_system_lyxrc ||
1560 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1561 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1566 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1567 if (ignore_system_lyxrc ||
1568 cursor_follows_scrollbar
1569 != system_lyxrc.cursor_follows_scrollbar) {
1570 os << "\\cursor_follows_scrollbar "
1571 << convert<string>(cursor_follows_scrollbar) << '\n';
1575 case RC_MACRO_EDIT_STYLE:
1576 if (ignore_system_lyxrc ||
1578 != system_lyxrc.macro_edit_style) {
1579 os << "\\macro_edit_style ";
1580 switch (macro_edit_style) {
1581 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1582 case MACRO_EDIT_INLINE: os << "1\n"; break;
1583 case MACRO_EDIT_LIST: os << "2\n"; break;
1588 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1589 if (ignore_system_lyxrc ||
1590 dialogs_iconify_with_main
1591 != system_lyxrc.dialogs_iconify_with_main) {
1592 os << "\\dialogs_iconify_with_main "
1593 << convert<string>(dialogs_iconify_with_main) << '\n';
1597 case RC_SCREEN_FONT_ROMAN:
1598 if (ignore_system_lyxrc ||
1599 roman_font_name != system_lyxrc.roman_font_name) {
1600 os << "\\screen_font_roman \"" << roman_font_name
1605 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1606 if (ignore_system_lyxrc ||
1607 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1608 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1613 case RC_SCREEN_FONT_SANS:
1614 if (ignore_system_lyxrc ||
1615 sans_font_name != system_lyxrc.sans_font_name) {
1616 os << "\\screen_font_sans \"" << sans_font_name
1621 case RC_SCREEN_FONT_SANS_FOUNDRY:
1622 if (ignore_system_lyxrc ||
1623 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1624 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1629 case RC_SCREEN_FONT_TYPEWRITER:
1630 if (ignore_system_lyxrc ||
1631 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1632 os << "\\screen_font_typewriter \""
1633 << typewriter_font_name << "\"\n";
1637 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1638 if (ignore_system_lyxrc ||
1639 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1640 os << "\\screen_font_typewriter_foundry \""
1641 << typewriter_font_foundry << "\"\n";
1646 case RC_SCREEN_FONT_SCALABLE:
1647 if (ignore_system_lyxrc ||
1648 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1649 os << "\\screen_font_scalable "
1650 << convert<string>(use_scalable_fonts)
1655 case RC_SCREEN_FONT_SIZES:
1656 if (ignore_system_lyxrc ||
1657 font_sizes[FONT_SIZE_TINY]
1658 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1659 font_sizes[FONT_SIZE_SCRIPT]
1660 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1661 font_sizes[FONT_SIZE_FOOTNOTE]
1662 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1663 font_sizes[FONT_SIZE_SMALL]
1664 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1665 font_sizes[FONT_SIZE_NORMAL]
1666 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1667 font_sizes[FONT_SIZE_LARGE]
1668 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1669 font_sizes[FONT_SIZE_LARGER]
1670 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1671 font_sizes[FONT_SIZE_LARGEST]
1672 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1673 font_sizes[FONT_SIZE_HUGE]
1674 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1675 font_sizes[FONT_SIZE_HUGER]
1676 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1677 os.setf(ios::fixed);
1679 os << "\\screen_font_sizes"
1680 << ' ' << font_sizes[FONT_SIZE_TINY]
1681 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1682 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1683 << ' ' << font_sizes[FONT_SIZE_SMALL]
1684 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1685 << ' ' << font_sizes[FONT_SIZE_LARGE]
1686 << ' ' << font_sizes[FONT_SIZE_LARGER]
1687 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1688 << ' ' << font_sizes[FONT_SIZE_HUGE]
1689 << ' ' << font_sizes[FONT_SIZE_HUGER]
1694 case RC_FULL_SCREEN_LIMIT:
1695 if (ignore_system_lyxrc ||
1696 full_screen_limit != system_lyxrc.full_screen_limit) {
1697 os << "\\fullscreen_limit "
1698 << convert<string>(full_screen_limit)
1703 case RC_FULL_SCREEN_TOOLBARS:
1704 if (ignore_system_lyxrc ||
1705 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1706 os << "\\fullscreen_toolbars "
1707 << convert<string>(full_screen_toolbars)
1712 case RC_FULL_SCREEN_SCROLLBAR:
1713 if (ignore_system_lyxrc ||
1714 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1715 os << "\\fullscreen_scrollbar "
1716 << convert<string>(full_screen_scrollbar)
1721 case RC_FULL_SCREEN_TABBAR:
1722 if (ignore_system_lyxrc ||
1723 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1724 os << "\\fullscreen_tabbar "
1725 << convert<string>(full_screen_tabbar)
1730 case RC_FULL_SCREEN_WIDTH:
1731 if (ignore_system_lyxrc ||
1732 full_screen_width != system_lyxrc.full_screen_width) {
1733 os << "\\fullscreen_width "
1734 << convert<string>(full_screen_width)
1739 case RC_OPEN_BUFFERS_IN_TABS:
1740 if (ignore_system_lyxrc ||
1741 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1742 os << "\\open_buffers_in_tabs "
1743 << convert<string>(open_buffers_in_tabs)
1748 case RC_USE_BUNDLED_FORMAT:
1749 if (ignore_system_lyxrc ||
1750 use_bundled_format != system_lyxrc.use_bundled_format) {
1751 os << "\\use_bundled_format "
1752 << convert<string>(use_bundled_format)
1759 << "# COLOR SECTION ###################################\n"
1763 for (int i = 0; i < Color_ignore; ++i) {
1764 ColorCode lc = static_cast<ColorCode>(i);
1766 string const col(lcolor.getX11Name(lc));
1767 if (ignore_system_lyxrc ||
1768 col != system_lcolor.getX11Name(lc)) {
1769 os << "\\set_color \""
1770 << lcolor.getLyXName(lc) << "\" \""
1778 << "# PRINTER SECTION ###################################\n"
1782 if (ignore_system_lyxrc ||
1783 printer != system_lyxrc.printer) {
1784 os << "\\printer \"" << printer << "\"\n";
1788 case RC_PRINT_ADAPTOUTPUT:
1789 if (ignore_system_lyxrc ||
1790 print_adapt_output != system_lyxrc.print_adapt_output) {
1791 os << "\\print_adapt_output "
1792 << convert<string>(print_adapt_output)
1797 case RC_PRINT_COMMAND:
1798 if (ignore_system_lyxrc ||
1799 print_command != system_lyxrc.print_command) {
1800 os << "\\print_command \"" << print_command << "\"\n";
1804 case RC_PRINTEXSTRAOPTIONS:
1805 if (ignore_system_lyxrc ||
1806 print_extra_options != system_lyxrc.print_extra_options) {
1807 os << "\\print_extra_options \"" << print_extra_options
1812 case RC_PRINTSPOOL_COMMAND:
1813 if (ignore_system_lyxrc ||
1814 print_spool_command != system_lyxrc.print_spool_command) {
1815 os << "\\print_spool_command \"" << print_spool_command
1820 case RC_PRINTSPOOL_PRINTERPREFIX:
1821 if (ignore_system_lyxrc ||
1822 print_spool_printerprefix
1823 != system_lyxrc.print_spool_printerprefix) {
1824 os << "\\print_spool_printerprefix \""
1825 << print_spool_printerprefix << "\"\n";
1829 case RC_PRINTEVENPAGEFLAG:
1830 if (ignore_system_lyxrc ||
1831 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1832 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1837 case RC_PRINTODDPAGEFLAG:
1838 if (ignore_system_lyxrc ||
1839 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1840 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1845 case RC_PRINTREVERSEFLAG:
1846 if (ignore_system_lyxrc ||
1847 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1848 os << "\\print_reverse_flag \"" << print_reverse_flag
1853 case RC_PRINTLANDSCAPEFLAG:
1854 if (ignore_system_lyxrc ||
1855 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1856 os << "\\print_landscape_flag \"" << print_landscape_flag
1861 case RC_PRINTPAGERANGEFLAG:
1862 if (ignore_system_lyxrc ||
1863 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1864 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1869 case RC_PRINTCOPIESFLAG:
1870 if (ignore_system_lyxrc ||
1871 print_copies_flag != system_lyxrc.print_copies_flag) {
1872 os << "\\print_copies_flag \"" << print_copies_flag
1877 case RC_PRINTCOLLCOPIESFLAG:
1878 if (ignore_system_lyxrc ||
1879 print_collcopies_flag
1880 != system_lyxrc.print_collcopies_flag) {
1881 os << "\\print_collcopies_flag \""
1882 << print_collcopies_flag
1887 case RC_PRINTPAPERFLAG:
1888 if (ignore_system_lyxrc ||
1889 print_paper_flag != system_lyxrc.print_paper_flag) {
1890 os << "\\print_paper_flag \"" << print_paper_flag
1895 case RC_PRINTPAPERDIMENSIONFLAG:
1896 if (ignore_system_lyxrc ||
1897 print_paper_dimension_flag
1898 != system_lyxrc.print_paper_dimension_flag) {
1899 os << "\\print_paper_dimension_flag \""
1900 << print_paper_dimension_flag << "\"\n";
1904 case RC_PRINTTOPRINTER:
1905 if (ignore_system_lyxrc ||
1906 print_to_printer != system_lyxrc.print_to_printer) {
1907 os << "\\print_to_printer \"" << print_to_printer
1912 case RC_PRINTTOFILE:
1913 if (ignore_system_lyxrc ||
1914 print_to_file != system_lyxrc.print_to_file) {
1915 string const path = os::external_path(print_to_file);
1916 os << "\\print_to_file \"" << path << "\"\n";
1920 case RC_PRINTFILEEXTENSION:
1921 if (ignore_system_lyxrc ||
1922 print_file_extension != system_lyxrc.print_file_extension) {
1923 os << "\\print_file_extension \""
1924 << print_file_extension
1931 << "# EXPORT SECTION ####################################\n"
1934 case RC_CUSTOM_EXPORT_COMMAND:
1935 if (ignore_system_lyxrc ||
1936 custom_export_command
1937 != system_lyxrc.custom_export_command) {
1938 os << "\\custom_export_command \""
1939 << custom_export_command
1944 case RC_CUSTOM_EXPORT_FORMAT:
1945 if (ignore_system_lyxrc ||
1946 custom_export_format
1947 != system_lyxrc.custom_export_format) {
1948 os << "\\custom_export_format \"" << custom_export_format
1955 << "# TEX SECTION #######################################\n"
1958 case RC_FONT_ENCODING:
1959 if (ignore_system_lyxrc ||
1960 fontenc != system_lyxrc.fontenc) {
1961 os << "\\font_encoding \"" << fontenc << "\"\n";
1967 << "# FILE SECTION ######################################\n"
1970 case RC_DOCUMENTPATH:
1971 if (ignore_system_lyxrc ||
1972 document_path != system_lyxrc.document_path) {
1973 string const path = os::external_path(document_path);
1974 os << "\\document_path \"" << path << "\"\n";
1978 case RC_USELASTFILEPOS:
1979 if (ignore_system_lyxrc ||
1980 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1981 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1986 case RC_LOADSESSION:
1987 if (ignore_system_lyxrc ||
1988 load_session != system_lyxrc.load_session) {
1989 os << "\\load_session " << convert<string>(load_session)
1994 case RC_MOUSE_WHEEL_SPEED:
1995 if (ignore_system_lyxrc ||
1996 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1997 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2001 case RC_COMPLETION_INLINE_DELAY:
2002 if (ignore_system_lyxrc ||
2003 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2004 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2008 case RC_COMPLETION_INLINE_MATH:
2009 if (ignore_system_lyxrc ||
2010 completion_inline_math != system_lyxrc.completion_inline_math) {
2011 os << "\\completion_inline_math "
2012 << convert<string>(completion_inline_math) << '\n';
2016 case RC_COMPLETION_INLINE_TEXT:
2017 if (ignore_system_lyxrc ||
2018 completion_inline_text != system_lyxrc.completion_inline_text) {
2019 os << "\\completion_inline_text "
2020 << convert<string>(completion_inline_text) << '\n';
2024 case RC_COMPLETION_INLINE_DOTS:
2025 if (ignore_system_lyxrc ||
2026 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2027 os << "\\completion_inline_dots "
2028 << convert<string>(completion_inline_dots) << '\n';
2032 case RC_COMPLETION_POPUP_DELAY:
2033 if (ignore_system_lyxrc ||
2034 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2035 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2039 case RC_COMPLETION_POPUP_MATH:
2040 if (ignore_system_lyxrc ||
2041 completion_popup_math != system_lyxrc.completion_popup_math) {
2042 os << "\\completion_popup_math "
2043 << convert<string>(completion_popup_math) << '\n';
2047 case RC_COMPLETION_POPUP_TEXT:
2048 if (ignore_system_lyxrc ||
2049 completion_popup_text != system_lyxrc.completion_popup_text) {
2050 os << "\\completion_popup_text "
2051 << convert<string>(completion_popup_text) << '\n';
2055 case RC_COMPLETION_CURSOR_TEXT:
2056 if (ignore_system_lyxrc ||
2057 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2058 os << "\\completion_cursor_text "
2059 << convert<string>(completion_cursor_text) << '\n';
2063 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2064 if (ignore_system_lyxrc ||
2065 completion_popup_after_complete
2066 != system_lyxrc.completion_popup_after_complete) {
2067 os << "\\completion_popup_after_complete "
2068 << convert<string>(completion_popup_after_complete) << '\n';
2072 case RC_NUMLASTFILES:
2073 if (ignore_system_lyxrc ||
2074 num_lastfiles != system_lyxrc.num_lastfiles) {
2075 os << "\\num_lastfiles " << num_lastfiles << '\n';
2079 case RC_CHECKLASTFILES:
2080 if (ignore_system_lyxrc ||
2081 check_lastfiles != system_lyxrc.check_lastfiles) {
2082 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2087 case RC_EXAMPLEPATH:
2088 if (ignore_system_lyxrc ||
2089 example_path != system_lyxrc.example_path) {
2090 string const path = os::external_path(example_path);
2091 os << "\\example_path \"" << path << "\"\n";
2095 case RC_TEMPLATEPATH:
2096 if (ignore_system_lyxrc ||
2097 template_path != system_lyxrc.template_path) {
2098 string const path = os::external_path(template_path);
2099 os << "\\template_path \"" << path << "\"\n";
2103 case RC_TEMPDIRPATH:
2104 if (ignore_system_lyxrc ||
2105 tempdir_path != system_lyxrc.tempdir_path) {
2106 string const path = os::external_path(tempdir_path);
2107 os << "\\tempdir_path \"" << path << "\"\n";
2115 case RC_PLAINTEXT_LINELEN:
2116 if (ignore_system_lyxrc ||
2117 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2118 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2122 case RC_MAKE_BACKUP:
2123 if (ignore_system_lyxrc ||
2124 make_backup != system_lyxrc.make_backup) {
2125 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2129 case RC_BACKUPDIR_PATH:
2130 if (ignore_system_lyxrc ||
2131 backupdir_path != system_lyxrc.backupdir_path) {
2132 string const path = os::external_path(backupdir_path);
2133 os << "\\backupdir_path \"" << path << "\"\n";
2139 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2142 case RC_PLAINTEXT_ROFF_COMMAND:
2143 if (ignore_system_lyxrc ||
2144 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2145 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2152 << "# SPELLCHECKER SECTION ##############################\n"
2154 case RC_USE_SPELL_LIB:
2155 if (ignore_system_lyxrc ||
2156 use_spell_lib != system_lyxrc.use_spell_lib) {
2157 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2161 case RC_SPELL_COMMAND:
2162 if (ignore_system_lyxrc ||
2163 isp_command != system_lyxrc.isp_command) {
2164 os << "\\spell_command \"" << isp_command << "\"\n";
2168 case RC_ACCEPT_COMPOUND:
2169 if (ignore_system_lyxrc ||
2170 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2171 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2176 case RC_USE_ALT_LANG:
2177 if (ignore_system_lyxrc ||
2178 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2179 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2185 if (ignore_system_lyxrc ||
2186 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2187 os << "\\alternate_language \"" << isp_alt_lang
2192 case RC_USE_ESC_CHARS:
2193 if (ignore_system_lyxrc ||
2194 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2195 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2201 if (ignore_system_lyxrc ||
2202 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2203 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2207 case RC_USE_PERS_DICT:
2208 if (ignore_system_lyxrc ||
2209 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2210 os << "\\use_personal_dictionary "
2211 << convert<string>(isp_use_pers_dict)
2216 case RC_USE_TOOLTIP:
2217 if (ignore_system_lyxrc ||
2218 use_tooltip != system_lyxrc.use_tooltip) {
2219 os << "\\use_tooltip "
2220 << convert<string>(use_tooltip)
2223 case RC_USE_PIXMAP_CACHE:
2224 if (ignore_system_lyxrc ||
2225 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2226 os << "\\use_pixmap_cache "
2227 << convert<string>(use_pixmap_cache)
2231 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2232 string const path = os::external_path(isp_pers_dict);
2233 os << "\\personal_dictionary \"" << path << "\"\n";
2237 case RC_USE_INP_ENC:
2238 if (ignore_system_lyxrc ||
2239 isp_use_input_encoding
2240 != system_lyxrc.isp_use_input_encoding) {
2241 os << "\\use_input_encoding "
2242 << convert<string>(isp_use_input_encoding)
2249 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2252 case RC_RTL_SUPPORT:
2253 if (ignore_system_lyxrc ||
2254 rtl_support != system_lyxrc.rtl_support) {
2255 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2259 case RC_VISUAL_CURSOR:
2260 if (ignore_system_lyxrc ||
2261 visual_cursor != system_lyxrc.visual_cursor) {
2262 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2266 case RC_LANGUAGE_PACKAGE:
2267 if (ignore_system_lyxrc ||
2268 language_package != system_lyxrc.language_package) {
2269 os << "\\language_package \"" << language_package
2274 case RC_LANGUAGE_GLOBAL_OPTIONS:
2275 if (ignore_system_lyxrc ||
2276 language_global_options
2277 != system_lyxrc.language_global_options) {
2278 os << "\\language_global_options \""
2279 << convert<string>(language_global_options)
2284 case RC_LANGUAGE_USE_BABEL:
2285 if (ignore_system_lyxrc ||
2286 language_use_babel != system_lyxrc.language_use_babel) {
2287 os << "\\language_use_babel \""
2288 << convert<string>(language_use_babel)
2293 case RC_LANGUAGE_COMMAND_BEGIN:
2294 if (ignore_system_lyxrc ||
2295 language_command_begin
2296 != system_lyxrc.language_command_begin) {
2297 os << "\\language_command_begin \""
2298 << language_command_begin
2303 case RC_LANGUAGE_COMMAND_END:
2304 if (ignore_system_lyxrc ||
2305 language_command_end
2306 != system_lyxrc.language_command_end) {
2307 os << "\\language_command_end \"" << language_command_end
2312 case RC_LANGUAGE_COMMAND_LOCAL:
2313 if (ignore_system_lyxrc ||
2314 language_command_local
2315 != system_lyxrc.language_command_local) {
2316 os << "\\language_command_local \""
2317 << language_command_local
2322 case RC_LANGUAGE_AUTO_BEGIN:
2323 if (ignore_system_lyxrc ||
2324 language_auto_begin != system_lyxrc.language_auto_begin) {
2325 os << "\\language_auto_begin "
2326 << convert<string>(language_auto_begin) << '\n';
2330 case RC_LANGUAGE_AUTO_END:
2331 if (ignore_system_lyxrc ||
2332 language_auto_end != system_lyxrc.language_auto_end) {
2333 os << "\\language_auto_end "
2334 << convert<string>(language_auto_end) << '\n';
2338 case RC_MARK_FOREIGN_LANGUAGE:
2339 if (ignore_system_lyxrc ||
2340 mark_foreign_language
2341 != system_lyxrc.mark_foreign_language) {
2342 os << "\\mark_foreign_language " <<
2343 convert<string>(mark_foreign_language) << '\n';
2349 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2352 case RC_AUTO_NUMBER:
2353 if (ignore_system_lyxrc ||
2354 auto_number != system_lyxrc.auto_number) {
2355 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2359 case RC_DEFAULT_LANGUAGE:
2360 if (ignore_system_lyxrc ||
2361 default_language != system_lyxrc.default_language) {
2362 os << "\\default_language " << default_language << '\n';
2368 << "# FORMATS SECTION ##########################\n"
2372 // New/modified formats
2373 for (Formats::const_iterator cit = formats.begin();
2374 cit != formats.end(); ++cit) {
2375 Format const * format =
2376 system_formats.getFormat(cit->name());
2378 format->extension() != cit->extension() ||
2379 format->prettyname() != cit->prettyname() ||
2380 format->shortcut() != cit->shortcut() ||
2381 format->viewer() != cit->viewer() ||
2382 format->editor() != cit->editor() ||
2383 format->documentFormat() != cit->documentFormat() ||
2384 format->vectorFormat() != cit->vectorFormat()) {
2385 os << "\\format \"" << cit->name() << "\" \""
2386 << cit->extension() << "\" \""
2387 << cit->prettyname() << "\" \""
2388 << cit->shortcut() << "\" \""
2389 << cit->viewer() << "\" \""
2390 << cit->editor() << "\" \"";
2391 vector<string> flags;
2392 if (cit->documentFormat())
2393 flags.push_back("document");
2394 if (cit->vectorFormat())
2395 flags.push_back("vector");
2396 os << getStringFromVector(flags);
2401 // Look for deleted formats
2402 for (Formats::const_iterator cit = system_formats.begin();
2403 cit != system_formats.end(); ++cit)
2404 if (!formats.getFormat(cit->name()))
2405 os << "\\format \"" << cit->name()
2406 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2415 << "# CONVERTERS SECTION ##########################\n"
2419 // Look for new converters
2420 for (Converters::const_iterator cit = theConverters().begin();
2421 cit != theConverters().end(); ++cit) {
2422 Converter const * converter =
2423 theSystemConverters().getConverter(cit->from,
2426 converter->command != cit->command ||
2427 converter->flags != cit->flags)
2428 os << "\\converter \"" << cit->from << "\" \""
2429 << cit->to << "\" \""
2430 << cit->command << "\" \""
2431 << cit->flags << "\"\n";
2434 // New/modifed converters
2435 for (Converters::const_iterator cit = theSystemConverters().begin();
2436 cit != theSystemConverters().end(); ++cit)
2437 if (!theConverters().getConverter(cit->from, cit->to))
2438 os << "\\converter \"" << cit->from
2439 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2446 << "# COPIERS SECTION ##########################\n"
2449 // Look for new movers
2450 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2451 Movers::const_iterator const sysend = theSystemMovers().end();
2452 Movers::const_iterator it = theMovers().begin();
2453 Movers::const_iterator end = theMovers().end();
2455 for (; it != end; ++it) {
2456 Movers::const_iterator const sysit =
2457 find_if(sysbegin, sysend, SameMover(*it));
2458 if (sysit == sysend) {
2459 string const & fmt = it->first;
2460 string const & command =
2461 it->second.command();
2463 os << "\\copier " << fmt
2464 << " \"" << command << "\"\n";
2470 // We don't actually delete SpecialisedMover(s) from the
2471 // map, just clear their 'command', so there's no need
2472 // to test for anything else.
2480 string const LyXRC::getDescription(LyXRCTags tag)
2485 case RC_ACCEPT_COMPOUND:
2486 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2490 case RC_USE_ALT_LANG:
2491 str = _("Specify an alternate language. The default is to use the language of the document.");
2494 case RC_PLAINTEXT_ROFF_COMMAND:
2495 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.");
2498 case RC_PLAINTEXT_LINELEN:
2499 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.");
2502 case RC_AUTOREGIONDELETE:
2503 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2506 case RC_AUTORESET_OPTIONS:
2507 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2511 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2514 case RC_AUTO_NUMBER:
2517 case RC_BACKUPDIR_PATH:
2518 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.");
2521 case RC_BIBTEX_COMMAND:
2522 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2526 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2529 case RC_CHECKLASTFILES:
2530 str = _("Select to check whether the lastfiles still exist.");
2533 case RC_CHKTEX_COMMAND:
2534 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2543 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2544 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.");
2547 case RC_SHOW_MACRO_LABEL:
2548 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2551 case RC_CUSTOM_EXPORT_COMMAND:
2554 case RC_CUSTOM_EXPORT_FORMAT:
2557 case RC_DATE_INSERT_FORMAT:
2558 //xgettext:no-c-format
2559 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2563 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2566 case RC_DEFAULT_LANGUAGE:
2567 str = _("New documents will be assigned this language.");
2570 case RC_DEFAULT_PAPERSIZE:
2571 str = _("Specify the default paper size.");
2574 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2575 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2578 case RC_DISPLAY_GRAPHICS:
2579 str = _("Select how LyX will display any graphics.");
2582 case RC_DOCUMENTPATH:
2583 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2587 case RC_USE_ESC_CHARS:
2588 str = _("Specify additional chars that can be part of a word.");
2591 case RC_EXAMPLEPATH:
2592 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2595 case RC_FONT_ENCODING:
2596 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2602 case RC_INDEX_COMMAND:
2603 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\".");
2610 case RC_KBMAP_PRIMARY:
2611 case RC_KBMAP_SECONDARY:
2612 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.");
2615 case RC_LABEL_INIT_LENGTH:
2616 str = _("Maximum number of words in the initialization string for a new label");
2619 case RC_LANGUAGE_AUTO_BEGIN:
2620 str = _("Select if a language switching command is needed at the beginning of the document.");
2623 case RC_LANGUAGE_AUTO_END:
2624 str = _("Select if a language switching command is needed at the end of the document.");
2627 case RC_LANGUAGE_COMMAND_BEGIN:
2628 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.");
2631 case RC_LANGUAGE_COMMAND_END:
2632 str = _("The LaTeX command for changing back to the language of the document.");
2635 case RC_LANGUAGE_COMMAND_LOCAL:
2636 str = _("The LaTeX command for local changing of the language.");
2639 case RC_LANGUAGE_GLOBAL_OPTIONS:
2640 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2643 case RC_LANGUAGE_PACKAGE:
2644 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2647 case RC_LANGUAGE_USE_BABEL:
2648 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2651 case RC_USELASTFILEPOS:
2652 str = _("De-select if you do not want LyX to scroll to saved position.");
2655 case RC_LOADSESSION:
2656 str = _("De-select to prevent loading files opened from the last LyX session.");
2659 case RC_MAKE_BACKUP:
2660 str = _("De-select if you don't want LyX to create backup files.");
2663 case RC_MARK_FOREIGN_LANGUAGE:
2664 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2667 case RC_MOUSE_WHEEL_SPEED:
2668 str = bformat(_("The scrolling speed of the mouse wheel."),
2672 case RC_COMPLETION_POPUP_DELAY:
2673 str = _("The completion popup delay.");
2676 case RC_COMPLETION_POPUP_MATH:
2677 str = _("Select to display the completion popup in math mode.");
2680 case RC_COMPLETION_POPUP_TEXT:
2681 str = _("Select to display the completion popup in text mode.");
2684 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2685 str = _("Show the completion popup without delay after non-unique completion attempt.");
2688 case RC_COMPLETION_POPUP_TEXT:
2689 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2692 case RC_COMPLETION_POPUP_DELAY:
2693 str = _("The inline completion delay.");
2696 case RC_COMPLETION_INLINE_MATH:
2697 str = _("Select to display the inline completion in math mode.");
2700 case RC_COMPLETION_INLINE_TEXT:
2701 str = _("Select to display the inline completion in text mode.");
2704 case RC_COMPLETION_INLINE_DOTS:
2705 str = _("Use \"...\" to shorten long completions.");
2708 case RC_NUMLASTFILES:
2709 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2713 case RC_PATH_PREFIX:
2714 str = _("Specify those directories which should be "
2715 "prepended to the PATH environment variable. "
2716 "Use the OS native format.");
2720 case RC_USE_PERS_DICT:
2721 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2725 str = _("Shows a typeset preview of things such as math");
2728 case RC_PREVIEW_HASHED_LABELS:
2729 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2732 case RC_PREVIEW_SCALE_FACTOR:
2733 str = _("Scale the preview size to suit.");
2736 case RC_PRINTCOLLCOPIESFLAG:
2737 str = _("The option for specifying whether the copies should be collated.");
2740 case RC_PRINTCOPIESFLAG:
2741 str = _("The option for specifying the number of copies to print.");
2745 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2748 case RC_PRINTEVENPAGEFLAG:
2749 str = _("The option to print only even pages.");
2752 case RC_PRINTEXSTRAOPTIONS:
2753 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2756 case RC_PRINTFILEEXTENSION:
2757 str = _("Extension of printer program output file. Usually \".ps\".");
2760 case RC_PRINTLANDSCAPEFLAG:
2761 str = _("The option to print out in landscape.");
2764 case RC_PRINTODDPAGEFLAG:
2765 str = _("The option to print only odd pages.");
2768 case RC_PRINTPAGERANGEFLAG:
2769 str = _("The option for specifying a comma-separated list of pages to print.");
2772 case RC_PRINTPAPERDIMENSIONFLAG:
2773 str = _("Option to specify the dimensions of the print paper.");
2776 case RC_PRINTPAPERFLAG:
2777 str = _("The option to specify paper type.");
2780 case RC_PRINTREVERSEFLAG:
2781 str = _("The option to reverse the order of the pages printed.");
2784 case RC_PRINTSPOOL_COMMAND:
2785 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.");
2788 case RC_PRINTSPOOL_PRINTERPREFIX:
2789 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.");
2792 case RC_PRINTTOFILE:
2793 str = _("Option to pass to the print program to print to a file.");
2796 case RC_PRINTTOPRINTER:
2797 str = _("Option to pass to the print program to print on a specific printer.");
2800 case RC_PRINT_ADAPTOUTPUT:
2801 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2804 case RC_PRINT_COMMAND:
2805 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2808 case RC_RTL_SUPPORT:
2809 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2812 case RC_VISUAL_CURSOR:
2813 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2817 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2820 case RC_SCREEN_FONT_ROMAN:
2821 case RC_SCREEN_FONT_SANS:
2822 case RC_SCREEN_FONT_TYPEWRITER:
2823 str = _("The screen fonts used to display the text while editing.");
2826 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2827 case RC_SCREEN_FONT_SANS_FOUNDRY:
2828 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2831 case RC_SCREEN_FONT_SCALABLE:
2832 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.");
2835 case RC_SCREEN_FONT_SIZES:
2836 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2839 case RC_SCREEN_ZOOM:
2840 //xgettext:no-c-format
2841 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2844 case RC_GEOMETRY_SESSION:
2845 str = _("Allow session manager to save and restore windows geometry.");
2849 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2855 case RC_SHOW_BANNER:
2856 str = _("De-select if you don't want the startup banner.");
2859 case RC_SPELL_COMMAND:
2860 str = _("What command runs the spellchecker?");
2863 case RC_TEMPDIRPATH:
2864 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2867 case RC_TEMPLATEPATH:
2868 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2871 case RC_TEX_ALLOWS_SPACES:
2874 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2878 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2890 case RC_USE_INP_ENC:
2891 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.");
2894 case RC_USE_TOOLTIP:
2895 str = _("Enable the automatic appearance of tool tips in the work area.");
2898 case RC_USE_PIXMAP_CACHE:
2899 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2902 case RC_USE_SPELL_LIB:
2905 case RC_VIEWDVI_PAPEROPTION:
2906 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2921 // The global instance
2924 // The global copy of the system lyxrc entries (everything except preferences)