1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
9 * ====================================================== */
14 #pragma implementation "lyxrc.h"
25 #include "LyXAction.h"
26 #include "lyxserver.h"
29 #include "tex-strings.h"
30 #include "support/path.h"
31 #include "support/filetools.h"
33 #include "converter.h"
43 extern LyXAction lyxaction;
44 extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
48 keyword_item lyxrcTags[] = {
49 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
50 { "\\alternate_language", LyXRC::RC_ALT_LANG },
51 { "\\ascii_linelen", LyXRC::RC_ASCII_LINELEN },
52 { "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
53 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
54 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
55 { "\\autosave", LyXRC::RC_AUTOSAVE },
56 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
57 { "\\bind", LyXRC::RC_BIND },
58 { "\\bind_file", LyXRC::RC_BINDFILE },
59 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
60 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
61 { "\\converter", LyXRC::RC_CONVERTER },
62 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
63 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
64 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
65 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
66 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
67 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
68 { "\\display_shortcuts", LyXRC::RC_DISPLAY_SHORTCUTS },
69 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
70 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
71 { "\\exit_confirmation", LyXRC::RC_EXIT_CONFIRMATION },
72 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
73 { "\\format", LyXRC::RC_FORMAT },
74 { "\\input", LyXRC::RC_INPUT },
75 { "\\kbmap", LyXRC::RC_KBMAP },
76 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
77 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
78 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
79 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
80 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
81 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
82 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
83 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
84 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
85 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
86 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
87 { "\\lastfiles", LyXRC::RC_LASTFILES },
88 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
89 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
90 { "\\new_ask_filename", LyXRC::RC_NEW_ASK_FILENAME },
91 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
92 { "\\override_x_deadkeys", LyXRC::RC_OVERRIDE_X_DEADKEYS },
93 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
94 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
95 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
96 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
97 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
98 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
99 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
100 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
101 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
102 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
103 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
104 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
105 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
106 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
107 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
108 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
109 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
110 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
111 { "\\printer", LyXRC::RC_PRINTER },
112 { "\\ps_command", LyXRC::RC_PS_COMMAND },
113 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
114 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
115 { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
116 { "\\screen_font_encoding_menu", LyXRC::RC_SCREEN_FONT_ENCODING_MENU },
117 { "\\screen_font_menu", LyXRC::RC_SCREEN_FONT_MENU },
118 { "\\screen_font_popup", LyXRC::RC_SCREEN_FONT_POPUP },
119 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
120 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
121 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
122 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
123 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
124 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
125 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
126 { "\\set_color", LyXRC::RC_SET_COLOR },
127 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
128 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
129 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
130 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
131 { "\\ui_file", LyXRC::RC_UIFILE },
132 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
133 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
134 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
135 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
136 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
137 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
138 { "\\viewer" ,LyXRC::RC_VIEWER},
139 { "\\wheel_jump", LyXRC::RC_WHEEL_JUMP }
142 /* Let the range depend of the size of lyxrcTags. Alejandro 240596 */
143 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
154 void LyXRC::setDefaults() {
158 // Get printer from the environment. If fail, use default "",
159 // assuming that everything is set up correctly.
160 printer = GetEnv("PRINTER");
161 print_adapt_output = false;
162 print_command = "dvips";
163 print_evenpage_flag = "-B";
164 print_oddpage_flag = "-A";
165 print_pagerange_flag = "-pp";
166 print_copies_flag = "-c";
167 print_collcopies_flag = "-C";
168 print_reverse_flag = "-r";
169 print_landscape_flag = "-t landscape";
170 print_to_printer = "-P";
171 print_to_file = "-o ";
172 print_file_extension = ".ps";
173 print_paper_flag = "-t";
174 print_paper_dimension_flag = "-T";
175 document_path = GetEnvPath("HOME");
176 tempdir_path = "/tmp";
179 view_dvi_paper_option = "-paper";
180 default_papersize = BufferParams::PAPER_USLETTER;
181 custom_export_format = "ps";
182 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
185 // Because a screen typically is wider than a piece of paper:
188 // Default LaTeX font size:
189 font_sizes[LyXFont::SIZE_TINY] = 5.0;
190 font_sizes[LyXFont::SIZE_SCRIPT] = 7.0;
191 font_sizes[LyXFont::SIZE_FOOTNOTE] = 8.0;
192 font_sizes[LyXFont::SIZE_SMALL] = 9.0;
193 font_sizes[LyXFont::SIZE_NORMAL] = 10.0;
194 font_sizes[LyXFont::SIZE_LARGE] = 12.0;
195 font_sizes[LyXFont::SIZE_LARGER] = 14.4;
196 font_sizes[LyXFont::SIZE_LARGEST] = 17.26;
197 font_sizes[LyXFont::SIZE_HUGE] = 20.74;
198 font_sizes[LyXFont::SIZE_HUGER] = 24.88;
199 use_scalable_fonts = true;
200 roman_font_name = "-*-times";
201 sans_font_name = "-*-helvetica";
202 typewriter_font_name = "-*-courier";
203 menu_font_name = "-*-helvetica-bold-r";
204 popup_font_name = "-*-helvetica-medium-r";
205 font_norm = "iso8859-1";
206 font_norm_type = ISO_8859_1;
208 override_x_deadkeys = true;
210 auto_region_delete = true;
213 check_lastfiles = true;
216 exit_confirmation = true;
217 display_shortcuts = true;
218 // Spellchecker settings:
219 isp_command = "ispell";
220 isp_accept_compound = false;
221 isp_use_input_encoding = false;
222 isp_use_alt_lang = false;
223 isp_use_pers_dict = false;
224 isp_use_esc_chars = false;
228 mark_foreign_language = true;
229 language_auto_begin = true;
230 language_auto_end = true;
231 language_global_options = true;
232 language_use_babel = true;
233 language_package = "\\usepackage{babel}";
234 language_command_begin = "\\selectlanguage{$$lang}";
235 language_command_end = "\\selectlanguage{$$lang}";
236 language_command_local = "\\foreignlanguage{$$lang}{";
237 default_language = "english";
239 new_ask_filename = false;
242 date_insert_format = "%A, %e %B %Y";
244 cursor_follows_scrollbar = false;
245 label_init_length = 3;
247 /// These variables are not stored on disk (perhaps they
248 // should be moved from the LyXRC class).
254 int LyXRC::ReadBindFile(string const & name)
257 string const tmp = i18nLibFileSearch("bind", name, "bind");
258 lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
259 int const result = read(tmp);
261 lyxerr << "Error reading bind file: " << tmp << endl;
266 void LyXRC::readBindFileIfNeeded()
269 ReadBindFile(bind_file);
272 int LyXRC::read(string const & filename)
274 LyXLex lexrc(lyxrcTags, lyxrcCount);
275 if (lyxerr.debugging(Debug::PARSER))
276 lexrc.printTable(lyxerr);
278 lexrc.setFile(filename);
279 if (!lexrc.IsOK()) return -2;
281 lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
283 while (lexrc.IsOK()) {
284 // By using two switches we take advantage of the compiler
285 // telling us if we have missed a LyXRCTags element in
286 // the second switch.
287 // Note that this also shows a problem with LyXLex since it
288 // helps us avoid taking advantage of the strictness of the
291 int le = lexrc.lex();
293 case LyXLex::LEX_UNDEF:
294 lexrc.printError("Unknown tag `$$Token'");
296 case LyXLex::LEX_FEOF:
300 switch (static_cast<LyXRCTags>(le)) {
301 case RC_INPUT: // Include file
303 string tmp = LibFileSearch(string(),
306 lexrc.printError("Error reading "
307 "included file: "+tmp);
311 case RC_BINDFILE: // RVDK_PATCH_5
313 string tmp(lexrc.GetString());
315 // We are already in the
316 // "actually read bind file"
320 // We are still in the "just
321 // remember the name of the
329 ui_file = lexrc.GetString();
333 case RC_EXIT_CONFIRMATION:
335 exit_confirmation = lexrc.GetBool();
338 case RC_DISPLAY_SHORTCUTS:
340 display_shortcuts = lexrc.GetBool();
345 use_kbmap = lexrc.GetBool();
348 case RC_KBMAP_PRIMARY:
350 string kmap(lexrc.GetString());
353 } else if (!LibFileSearch("kbd", kmap,
355 primary_kbmap = kmap;
357 lexrc.printError("LyX: Keymap `$$Token' not found");
361 case RC_KBMAP_SECONDARY:
363 string kmap(lexrc.GetString());
366 } else if (!LibFileSearch("kbd", kmap,
368 secondary_kbmap = kmap;
370 lexrc.printError("LyX: Keymap `$$Token' not found");
374 case RC_FONT_ENCODING:
376 fontenc = lexrc.GetString();
381 printer = lexrc.GetString();
384 case RC_PRINT_COMMAND:
386 print_command = lexrc.GetString();
389 case RC_PRINTEVENPAGEFLAG:
391 print_evenpage_flag = lexrc.GetString();
394 case RC_PRINTODDPAGEFLAG:
396 print_oddpage_flag = lexrc.GetString();
399 case RC_PRINTPAGERANGEFLAG:
401 print_pagerange_flag = lexrc.GetString();
404 case RC_PRINTCOPIESFLAG:
406 print_copies_flag = lexrc.GetString();
409 case RC_PRINTCOLLCOPIESFLAG:
411 print_collcopies_flag = lexrc.GetString();
414 case RC_PRINTREVERSEFLAG:
416 print_reverse_flag = lexrc.GetString();
419 case RC_PRINTLANDSCAPEFLAG:
421 print_landscape_flag = lexrc.GetString();
424 case RC_PRINTTOPRINTER:
426 print_to_printer = lexrc.GetString();
429 case RC_PRINT_ADAPTOUTPUT:
431 print_adapt_output = lexrc.GetBool();
436 print_to_file = lexrc.GetString();
439 case RC_PRINTFILEEXTENSION:
441 print_file_extension = lexrc.GetString();
444 case RC_PRINTEXSTRAOPTIONS:
446 print_extra_options = lexrc.GetString();
449 case RC_PRINTSPOOL_COMMAND:
451 print_spool_command = lexrc.GetString();
454 case RC_PRINTSPOOL_PRINTERPREFIX:
456 print_spool_printerprefix = lexrc.GetString();
459 case RC_PRINTPAPERDIMENSIONFLAG:
461 print_paper_dimension_flag = lexrc.GetString();
464 case RC_PRINTPAPERFLAG:
466 print_paper_flag = lexrc.GetString();
469 case RC_CUSTOM_EXPORT_COMMAND:
471 custom_export_command = lexrc.GetString();
474 case RC_CUSTOM_EXPORT_FORMAT:
476 custom_export_format = lexrc.GetString();
479 case RC_DEFAULT_PAPERSIZE:
481 string size = lowercase(lexrc.GetString());
482 if (size == "usletter")
484 BufferParams::PAPER_USLETTER;
485 else if (size == "legal")
487 BufferParams::PAPER_LEGALPAPER;
488 else if (size == "executive")
490 BufferParams::PAPER_EXECUTIVEPAPER;
491 else if (size == "a3")
493 BufferParams::PAPER_A3PAPER;
494 else if (size == "a4")
496 BufferParams::PAPER_A4PAPER;
497 else if (size == "a5")
499 BufferParams::PAPER_A5PAPER;
500 else if (size == "b5")
502 BufferParams::PAPER_B5PAPER;
506 case RC_VIEWDVI_PAPEROPTION:
508 view_dvi_paper_option = lexrc.GetString();
510 view_dvi_paper_option = "";
515 ps_command = lexrc.GetString();
518 case RC_CHKTEX_COMMAND:
520 chktex_command = lexrc.GetString();
525 dpi = lexrc.GetInteger();
530 zoom = lexrc.GetInteger();
535 wheel_jump = lexrc.GetInteger();
538 case RC_SCREEN_FONT_SIZES:
540 font_sizes[LyXFont::SIZE_TINY] =
543 font_sizes[LyXFont::SIZE_SCRIPT] =
546 font_sizes[LyXFont::SIZE_FOOTNOTE] =
549 font_sizes[LyXFont::SIZE_SMALL] =
552 font_sizes[LyXFont::SIZE_NORMAL] =
555 font_sizes[LyXFont::SIZE_LARGE] =
558 font_sizes[LyXFont::SIZE_LARGER] =
561 font_sizes[LyXFont::SIZE_LARGEST] =
564 font_sizes[LyXFont::SIZE_HUGE] =
567 font_sizes[LyXFont::SIZE_HUGER] =
571 case RC_SCREEN_FONT_SCALABLE:
573 use_scalable_fonts = lexrc.GetBool();
578 autosave = lexrc.GetInteger();
581 case RC_DOCUMENTPATH:
583 document_path = ExpandPath(lexrc.GetString());
587 case RC_TEMPLATEPATH:
589 template_path = ExpandPath(lexrc.GetString());
594 tempdir_path = ExpandPath(lexrc.GetString());
599 use_tempdir = lexrc.GetBool();
604 lastfiles = ExpandPath(lexrc.GetString());
607 case RC_NUMLASTFILES:
609 num_lastfiles = lexrc.GetInteger();
612 case RC_CHECKLASTFILES:
614 check_lastfiles = lexrc.GetBool();
617 case RC_SCREEN_FONT_ROMAN:
619 roman_font_name = lexrc.GetString();
622 case RC_SCREEN_FONT_SANS:
624 sans_font_name = lexrc.GetString();
627 case RC_SCREEN_FONT_TYPEWRITER:
629 typewriter_font_name = lexrc.GetString();
632 case RC_SCREEN_FONT_MENU:
634 menu_font_name = lexrc.GetString();
637 case RC_SCREEN_FONT_POPUP:
639 popup_font_name = lexrc.GetString();
642 case RC_SCREEN_FONT_ENCODING:
644 font_norm = lexrc.GetString();
645 set_font_norm_type();
649 case RC_SCREEN_FONT_ENCODING_MENU:
651 font_norm_menu = lexrc.GetString();
656 string lyx_name, x11_name;
659 lyx_name = lexrc.GetString();
661 lexrc.printError("Missing color tag.");
666 x11_name = lexrc.GetString();
668 lexrc.printError("Missing color name for color : `$$Token'");
672 if (!lcolor.setColor(lyx_name, x11_name))
673 lyxerr << "Bad lyxrc set_color for "
678 case RC_AUTOREGIONDELETE:
679 // Auto region delete defaults to true
681 auto_region_delete = lexrc.GetBool();
686 // we should not do an explicit binding before
687 // loading a bind file. So, in this case, load
688 // the default bind file.
689 readBindFileIfNeeded();
691 // !!!chb, dynamic key binding...
695 if (lexrc.lex() == LyXLex::LEX_DATA) {
696 seq = lexrc.GetString();
698 lexrc.printError("Bad key sequence: `$$Token'");
702 if (lexrc.lex() == LyXLex::LEX_DATA) {
703 cmd = lexrc.GetString();
705 lexrc.printError("Bad command: `$$Token'");
709 if ((action = lyxaction.LookupFunc(cmd))>= 0) {
710 if (lyxerr.debugging(Debug::KBMAP)) {
711 lyxerr << "RC_BIND: Sequence `"
712 << seq << "' Command `"
713 << cmd << "' Action `"
714 << action << '\'' << endl;
716 res = toplevel_keymap->bind(seq, action);
719 "Invalid key sequence `"
722 } else {// cmd is the last token read.
724 "Unknown LyX function `$$Token'");
728 case RC_OVERRIDE_X_DEADKEYS:
730 override_x_deadkeys = lexrc.GetBool();
735 lyxpipes = ExpandPath(lexrc.GetString());
738 case RC_CURSOR_FOLLOWS_SCROLLBAR:
740 cursor_follows_scrollbar = lexrc.GetBool();
743 case RC_ASCIIROFF_COMMAND:
745 ascii_roff_command = lexrc.GetString();
747 case RC_ASCII_LINELEN:
749 ascii_linelen = lexrc.GetInteger();
751 // Spellchecker settings:
752 case RC_SPELL_COMMAND:
754 isp_command = lexrc.GetString();
756 case RC_ACCEPT_COMPOUND:
758 isp_accept_compound = lexrc.GetBool();
762 isp_use_input_encoding = lexrc.GetBool();
764 case RC_USE_ALT_LANG:
766 isp_use_alt_lang = lexrc.GetBool();
768 case RC_USE_PERS_DICT:
770 isp_use_pers_dict = lexrc.GetBool();
772 case RC_USE_ESC_CHARS:
774 isp_use_esc_chars = lexrc.GetBool();
778 isp_alt_lang = lexrc.GetString();
782 isp_pers_dict = lexrc.GetString();
786 isp_esc_chars = lexrc.GetString();
790 make_backup = lexrc.GetBool();
792 case RC_BACKUPDIR_PATH:
794 backupdir_path = ExpandPath(lexrc.GetString());
796 case RC_DATE_INSERT_FORMAT:
798 date_insert_format = lexrc.GetString();
800 case RC_LANGUAGE_PACKAGE:
802 language_package = lexrc.GetString();
804 case RC_LANGUAGE_AUTO_BEGIN:
806 language_auto_begin = lexrc.GetBool();
808 case RC_LANGUAGE_AUTO_END:
810 language_auto_end = lexrc.GetBool();
812 case RC_LANGUAGE_GLOBAL_OPTIONS:
814 language_global_options = lexrc.GetBool();
816 case RC_LANGUAGE_USE_BABEL:
818 language_use_babel = lexrc.GetBool();
820 case RC_LANGUAGE_COMMAND_BEGIN:
822 language_command_begin = lexrc.GetString();
824 case RC_LANGUAGE_COMMAND_END:
826 language_command_end = lexrc.GetString();
828 case RC_LANGUAGE_COMMAND_LOCAL:
830 language_command_local = lexrc.GetString();
834 rtl_support = lexrc.GetBool();
838 auto_number = lexrc.GetBool();
840 case RC_MARK_FOREIGN_LANGUAGE:
842 mark_foreign_language = lexrc.GetBool();
846 show_banner = lexrc.GetBool();
849 case RC_NEW_ASK_FILENAME:
851 new_ask_filename = lexrc.GetBool();
854 string from, to, command, flags;
856 from = lexrc.GetString();
858 to = lexrc.GetString();
860 command = lexrc.GetString();
862 flags = lexrc.GetString();
863 if (command.empty() || command == "none")
864 converters.Delete(from, to);
866 converters.Add(from, to, command, flags);
870 string format, command;
872 format = lexrc.GetString();
874 command = lexrc.GetString();
875 formats.SetViewer(format, command);
879 string format, extension, prettyname, shortcut;
881 format = lexrc.GetString();
883 extension = lexrc.GetString();
885 prettyname = lexrc.GetString();
887 shortcut = lexrc.GetString();
888 if (prettyname.empty()) {
889 if (converters.FormatIsUsed(format))
890 lyxerr << "Can't delete format "
893 formats.Delete(format);
896 formats.Add(format, extension, prettyname,
900 case RC_DEFAULT_LANGUAGE:
902 default_language = lexrc.GetString();
905 case RC_LABEL_INIT_LENGTH:
907 label_init_length = lexrc.GetInteger();
910 case RC_LAST: break; // this is just a dummy
914 /// Update converters data-structures
915 converters.Update(formats);
916 converters.BuildGraph();
922 void LyXRC::write(string const & filename) const
924 ofstream ofs(filename.c_str());
930 void LyXRC::print() const
932 if (lyxerr.debugging())
939 void LyXRC::output(ostream & os) const
941 os << "### This file is part of\n"
942 << "### ========================================================\n"
943 << "### LyX, The Document Processor\n"
945 << "### Copyright 1995 Matthias Ettrich\n"
946 << "### Copyright 1995-2000 The LyX Team.\n"
948 << "### ========================================================\n"
950 << "# This file is written by LyX, if you want to make your own\n"
951 << "# modifications you should do them from inside LyX and save\n"
954 // Why the switch you might ask. It is a trick to ensure that all
955 // the elements in the LyXRCTags enum is handled. As you can see
956 // there are no breaks at all. So it is just a huge fall-through.
957 // The nice thing is that we will get a warning from the compiler
958 // if we forget an element.
959 LyXRCTags tag = RC_LAST;
963 // input/include files are not done here
965 // bindings is not written to the preferences file.
967 if (bind_file != system_lyxrc.bind_file) {
968 os << "\\bind_file " << bind_file << "\n";
974 << "# MISC SECTION ######################################\n"
978 if (show_banner != system_lyxrc.show_banner) {
979 os << "# Set to false to inhibit the startup banner.\n"
980 << "\\show_banner " << tostr(show_banner) << "\n";
982 // bind files are not done here.
984 if (ui_file != system_lyxrc.ui_file) {
985 os << "\\ui_file \"" << ui_file << "\"\n";
987 case RC_AUTOREGIONDELETE:
988 if (auto_region_delete != system_lyxrc.auto_region_delete) {
989 os << "# Set to false to inhibit automatic replacement of\n"
990 << "# the current selection.\n"
991 << "\\auto_region_delete " << tostr(auto_region_delete)
995 if (autosave != system_lyxrc.autosave) {
996 os << "# The time interval between auto-saves in seconds.\n"
997 << "\\autosave " << autosave << "\n";
999 case RC_EXIT_CONFIRMATION:
1000 if (exit_confirmation != system_lyxrc.exit_confirmation) {
1001 os << "# Ask for confirmation before exit if there are\n"
1002 << "# unsaved changed documents.\n"
1003 << "\\exit_confirmation " << tostr(exit_confirmation)
1006 case RC_DISPLAY_SHORTCUTS:
1007 if (display_shortcuts != system_lyxrc.display_shortcuts) {
1008 os << "# Display name of the last command executed,\n"
1009 << "# with a list of short-cuts in the minibuffer.\n"
1010 << "\\display_shortcuts " << tostr(display_shortcuts)
1013 case RC_VIEWDVI_PAPEROPTION:
1014 if (view_dvi_paper_option
1015 != system_lyxrc.view_dvi_paper_option) {
1016 os << "# Options used to specify paper size to the\n"
1017 << "# view_dvi_command\n"
1018 << "\\view_dvi_paper_option \""
1019 << view_dvi_paper_option << "\"\n";
1021 case RC_DEFAULT_PAPERSIZE:
1022 if (default_papersize != system_lyxrc.default_papersize) {
1023 os << "# The default papersize to use.\n"
1024 << "\\default_papersize \"";
1025 switch (default_papersize) {
1026 case BufferParams::PAPER_USLETTER:
1027 os << "usletter"; break;
1028 case BufferParams::PAPER_LEGALPAPER:
1029 os << "legal"; break;
1030 case BufferParams::PAPER_EXECUTIVEPAPER:
1031 os << "executive"; break;
1032 case BufferParams::PAPER_A3PAPER:
1034 case BufferParams::PAPER_A4PAPER:
1036 case BufferParams::PAPER_A5PAPER:
1038 case BufferParams::PAPER_B5PAPER:
1040 case BufferParams::PAPER_DEFAULT: break;
1045 if (ps_command != system_lyxrc.ps_command) {
1046 os << "# Program used for interpreting postscript.\n"
1047 << "\\ps_command \"" << ps_command << "\"\n";
1049 case RC_CHKTEX_COMMAND:
1050 if (chktex_command != system_lyxrc.chktex_command) {
1051 os << "\\chktex_command \"" << chktex_command << "\"\n";
1054 if (use_kbmap != system_lyxrc.use_kbmap) {
1055 os << "\\kbmap " << tostr(use_kbmap) << "\n";
1057 case RC_KBMAP_PRIMARY:
1058 if (primary_kbmap != system_lyxrc.primary_kbmap) {
1059 os << "\\kbmap_primary \"" << primary_kbmap << "\"\n";
1061 case RC_KBMAP_SECONDARY:
1062 if (secondary_kbmap != system_lyxrc.secondary_kbmap) {
1063 os << "\\kbmap_secondary \"" << secondary_kbmap
1067 if (lyxpipes != system_lyxrc.lyxpipes) {
1068 os << "\\serverpipe \"" << lyxpipes << "\"\n";
1070 case RC_DATE_INSERT_FORMAT:
1071 if (date_insert_format != system_lyxrc.date_insert_format) {
1072 os << "\\date_insert_format \"" << date_insert_format
1075 case RC_LABEL_INIT_LENGTH:
1076 if (label_init_length != system_lyxrc.label_init_length) {
1077 os << "\\label_init_length " << label_init_length
1082 << "# SCREEN & FONTS SECTION ############################\n"
1086 if (dpi != system_lyxrc.dpi) {
1087 os << "\\screen_dpi " << dpi << "\n";
1089 case RC_SCREEN_ZOOM:
1090 if (zoom != system_lyxrc.zoom) {
1091 os << "\\screen_zoom " << zoom << "\n";
1094 if (wheel_jump != system_lyxrc.wheel_jump) {
1095 os << "\\wheel_jump " << wheel_jump << "\n";
1097 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1098 if (cursor_follows_scrollbar
1099 != system_lyxrc.cursor_follows_scrollbar) {
1100 os << "\\cursor_follows_scrollbar "
1101 << tostr(cursor_follows_scrollbar) << "\n";
1103 case RC_SCREEN_FONT_ROMAN:
1104 if (roman_font_name != system_lyxrc.roman_font_name) {
1105 os << "\\screen_font_roman \"" << roman_font_name
1108 case RC_SCREEN_FONT_SANS:
1109 if (sans_font_name != system_lyxrc.sans_font_name) {
1110 os << "\\screen_font_sans \"" << sans_font_name
1113 case RC_SCREEN_FONT_TYPEWRITER:
1114 if (typewriter_font_name != system_lyxrc.typewriter_font_name) {
1115 os << "\\screen_font_typewriter \""
1116 << typewriter_font_name << "\"\n";
1118 case RC_SCREEN_FONT_SCALABLE:
1119 if (use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1120 os << "\\screen_font_scalable "
1121 << tostr(use_scalable_fonts)
1124 case RC_SCREEN_FONT_ENCODING:
1125 if (font_norm != system_lyxrc.font_norm) {
1126 os << "\\screen_font_encoding \"" << font_norm
1129 case RC_SCREEN_FONT_POPUP:
1130 if (popup_font_name != system_lyxrc.popup_font_name) {
1131 os << "\\screen_font_popup \"" << popup_font_name
1134 case RC_SCREEN_FONT_MENU:
1135 if (menu_font_name != system_lyxrc.menu_font_name) {
1136 os << "\\screen_font_menu \"" << menu_font_name
1139 case RC_SCREEN_FONT_SIZES:
1140 if (font_sizes[LyXFont::SIZE_TINY]
1141 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1142 font_sizes[LyXFont::SIZE_SCRIPT]
1143 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1144 font_sizes[LyXFont::SIZE_FOOTNOTE]
1145 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1146 font_sizes[LyXFont::SIZE_SMALL]
1147 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1148 font_sizes[LyXFont::SIZE_NORMAL]
1149 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1150 font_sizes[LyXFont::SIZE_LARGE]
1151 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1152 font_sizes[LyXFont::SIZE_LARGER]
1153 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1154 font_sizes[LyXFont::SIZE_LARGEST]
1155 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1156 font_sizes[LyXFont::SIZE_HUGE]
1157 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1158 font_sizes[LyXFont::SIZE_HUGER]
1159 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1160 os.setf(ios::fixed);
1162 os << "\\screen_font_sizes"
1163 << " " << font_sizes[LyXFont::SIZE_TINY]
1164 << " " << font_sizes[LyXFont::SIZE_SCRIPT]
1165 << " " << font_sizes[LyXFont::SIZE_FOOTNOTE]
1166 << " " << font_sizes[LyXFont::SIZE_SMALL]
1167 << " " << font_sizes[LyXFont::SIZE_NORMAL]
1168 << " " << font_sizes[LyXFont::SIZE_LARGE]
1169 << " " << font_sizes[LyXFont::SIZE_LARGER]
1170 << " " << font_sizes[LyXFont::SIZE_LARGEST]
1171 << " " << font_sizes[LyXFont::SIZE_HUGE]
1172 << " " << font_sizes[LyXFont::SIZE_HUGER]
1177 << "# COLOR SECTION ###################################\n"
1181 for (int i = 0; i < LColor::ignore; ++i ) {
1182 LColor::color lc = static_cast<LColor::color>(i);
1184 string const col(lcolor.getX11Name(lc));
1185 if (col != system_lcolor.getX11Name(lc)) {
1186 os << "\\set_color \""
1187 << lcolor.getLyXName(lc) << "\" \""
1193 << "# PRINTER SECTION ###################################\n"
1197 if (printer != system_lyxrc.printer) {
1198 os << "\\printer \"" << printer << "\"\n";
1200 case RC_PRINT_ADAPTOUTPUT:
1201 if (print_adapt_output != system_lyxrc.print_adapt_output) {
1202 os << "\\print_adapt_output "
1203 << tostr(print_adapt_output)
1206 case RC_PRINT_COMMAND:
1207 if (print_command != system_lyxrc.print_command) {
1208 os << "\\print_command \"" << print_command << "\"\n";
1210 case RC_PRINTEXSTRAOPTIONS:
1211 if (print_extra_options != system_lyxrc.print_extra_options) {
1212 os << "\\print_extra_options \"" << print_extra_options
1215 case RC_PRINTSPOOL_COMMAND:
1216 if (print_spool_command != system_lyxrc.print_spool_command) {
1217 os << "\\print_spool_command \"" << print_spool_command
1220 case RC_PRINTSPOOL_PRINTERPREFIX:
1221 if (print_spool_printerprefix
1222 != system_lyxrc.print_spool_printerprefix) {
1223 os << "\\print_spool_printerprefix \""
1224 << print_spool_printerprefix << "\"\n";
1226 case RC_PRINTEVENPAGEFLAG:
1227 if (print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1228 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1231 case RC_PRINTODDPAGEFLAG:
1232 if (print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1233 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1236 case RC_PRINTREVERSEFLAG:
1237 if (print_reverse_flag != system_lyxrc.print_reverse_flag) {
1238 os << "\\print_reverse_flag \"" << print_reverse_flag
1241 case RC_PRINTLANDSCAPEFLAG:
1242 if (print_landscape_flag != system_lyxrc.print_landscape_flag) {
1243 os << "\\print_landscape_flag \"" << print_landscape_flag
1246 case RC_PRINTPAGERANGEFLAG:
1247 if (print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1248 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1251 case RC_PRINTCOPIESFLAG:
1252 if (print_copies_flag != system_lyxrc.print_copies_flag) {
1253 os << "\\print_copies_flag \"" << print_copies_flag
1256 case RC_PRINTCOLLCOPIESFLAG:
1257 if (print_collcopies_flag
1258 != system_lyxrc.print_collcopies_flag) {
1259 os << "\\print_collcopies_flag \""
1260 << print_collcopies_flag
1263 case RC_PRINTPAPERFLAG:
1264 if (print_paper_flag != system_lyxrc.print_paper_flag) {
1265 os << "\\print_paper_flag \"" << print_paper_flag
1268 case RC_PRINTPAPERDIMENSIONFLAG:
1269 if (print_paper_dimension_flag
1270 != system_lyxrc.print_paper_dimension_flag) {
1271 os << "\\print_paper_dimension_flag \""
1272 << print_paper_dimension_flag << "\"\n";
1274 case RC_PRINTTOPRINTER:
1275 if (print_to_printer != system_lyxrc.print_to_printer) {
1276 os << "\\print_to_printer \"" << print_to_printer
1279 case RC_PRINTTOFILE:
1280 if (print_to_file != system_lyxrc.print_to_file) {
1281 os << "\\print_to_file \"" << print_to_file << "\"\n";
1283 case RC_PRINTFILEEXTENSION:
1284 if (print_file_extension != system_lyxrc.print_file_extension) {
1285 os << "\\print_file_extension \""
1286 << print_file_extension
1291 << "# EXPORT SECTION ####################################\n"
1294 case RC_CUSTOM_EXPORT_COMMAND:
1295 if (custom_export_command
1296 != system_lyxrc.custom_export_command) {
1297 os << "\\custom_export_command \""
1298 << custom_export_command
1301 case RC_CUSTOM_EXPORT_FORMAT:
1302 if (custom_export_format
1303 != system_lyxrc.custom_export_format) {
1304 os << "\\custom_export_format \"" << custom_export_format
1309 << "# TEX SECTION #######################################\n"
1312 case RC_FONT_ENCODING:
1313 if (fontenc != system_lyxrc.fontenc) {
1314 os << "\\font_encoding \"" << fontenc << "\"\n";
1318 << "# FILE SECTION ######################################\n"
1321 case RC_DOCUMENTPATH:
1322 if (document_path != system_lyxrc.document_path) {
1323 os << "\\document_path \"" << document_path << "\"\n";
1326 if (lastfiles != system_lyxrc.lastfiles) {
1327 os << "\\lastfiles \"" << lastfiles << "\"\n";
1329 case RC_NUMLASTFILES:
1330 if (num_lastfiles != system_lyxrc.num_lastfiles) {
1331 os << "\\num_lastfiles " << num_lastfiles << "\n";
1333 case RC_CHECKLASTFILES:
1334 if (check_lastfiles != system_lyxrc.check_lastfiles) {
1335 os << "\\check_lastfiles " << tostr(check_lastfiles)
1338 case RC_TEMPLATEPATH:
1339 if (template_path != system_lyxrc.template_path) {
1340 os << "\\template_path \"" << template_path << "\"\n";
1342 case RC_TEMPDIRPATH:
1343 if (tempdir_path != system_lyxrc.tempdir_path) {
1344 os << "\\tempdir_path \"" << tempdir_path << "\"\n";
1347 if (use_tempdir != system_lyxrc.use_tempdir) {
1348 os << "\\use_tempdir " << tostr(use_tempdir) << "\n";
1350 case RC_ASCII_LINELEN:
1351 if (ascii_linelen != system_lyxrc.ascii_linelen) {
1352 os << "\\ascii_linelen " << ascii_linelen << "\n";
1354 case RC_MAKE_BACKUP:
1355 if (make_backup != system_lyxrc.make_backup) {
1356 os << "\\make_backup " << tostr(make_backup) << "\n";
1358 case RC_BACKUPDIR_PATH:
1359 if (backupdir_path != system_lyxrc.backupdir_path) {
1360 os << "\\backupdir_path \"" << backupdir_path << "\"\n";
1364 << "# ASCII EXPORT SECTION ##############################\n"
1367 case RC_ASCIIROFF_COMMAND:
1368 if (ascii_roff_command != system_lyxrc.ascii_roff_command) {
1369 os << "\\ascii_roff_command \"" << ascii_roff_command
1374 << "# SPELLCHECKER SECTION ##############################\n"
1377 case RC_SPELL_COMMAND:
1378 if (isp_command != system_lyxrc.isp_command) {
1379 os << "\\spell_command \"" << isp_command << "\"\n";
1381 case RC_ACCEPT_COMPOUND:
1382 if (isp_accept_compound != system_lyxrc.isp_accept_compound) {
1383 os << "\\accept_compound " << tostr(isp_accept_compound)
1386 case RC_USE_ALT_LANG:
1387 if (isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1388 os << "\\use_alt_language " << tostr(isp_use_alt_lang)
1392 if (isp_alt_lang != system_lyxrc.isp_alt_lang) {
1393 os << "\\alternate_language \"" << isp_alt_lang
1396 case RC_USE_ESC_CHARS:
1397 if (isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1398 os << "\\use_escape_chars " << tostr(isp_use_esc_chars)
1402 if (isp_esc_chars != system_lyxrc.isp_esc_chars) {
1403 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1405 case RC_USE_PERS_DICT:
1406 if (isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1407 os << "\\use_personal_dictionary "
1408 << tostr(isp_use_pers_dict)
1412 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1413 os << "\\personal_dictionary \"" << isp_pers_dict
1416 case RC_USE_INP_ENC:
1417 if (isp_use_input_encoding
1418 != system_lyxrc.isp_use_input_encoding) {
1419 os << "\\use_input_encoding "
1420 << tostr(isp_use_input_encoding)
1425 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1428 case RC_RTL_SUPPORT:
1429 if (rtl_support != system_lyxrc.rtl_support) {
1430 os << "\\rtl " << tostr(rtl_support) << "\n";
1432 case RC_LANGUAGE_PACKAGE:
1433 if (language_package != system_lyxrc.language_package) {
1434 os << "\\language_package \"" << language_package
1437 case RC_LANGUAGE_GLOBAL_OPTIONS:
1438 if (language_global_options
1439 != system_lyxrc.language_global_options) {
1440 os << "\\language_global_options \""
1441 << tostr(language_global_options)
1444 case RC_LANGUAGE_USE_BABEL:
1445 if (language_use_babel != system_lyxrc.language_use_babel) {
1446 os << "\\language_use_babel \""
1447 << tostr(language_use_babel)
1450 case RC_LANGUAGE_COMMAND_BEGIN:
1451 if (language_command_begin
1452 != system_lyxrc.language_command_begin) {
1453 os << "\\language_command_begin \""
1454 << language_command_begin
1457 case RC_LANGUAGE_COMMAND_END:
1458 if (language_command_end
1459 != system_lyxrc.language_command_end) {
1460 os << "\\language_command_end \"" << language_command_end
1463 case RC_LANGUAGE_COMMAND_LOCAL:
1464 if (language_command_local
1465 != system_lyxrc.language_command_local) {
1466 os << "\\language_command_local \""
1467 << language_command_local
1470 case RC_LANGUAGE_AUTO_BEGIN:
1471 if (language_auto_begin != system_lyxrc.language_auto_begin) {
1472 os << "\\language_auto_begin "
1473 << tostr(language_auto_begin) << "\n";
1475 case RC_LANGUAGE_AUTO_END:
1476 if (language_auto_end != system_lyxrc.language_auto_end) {
1477 os << "\\language_auto_end "
1478 << tostr(language_auto_end) << "\n";
1480 case RC_MARK_FOREIGN_LANGUAGE:
1481 if (mark_foreign_language
1482 != system_lyxrc.mark_foreign_language) {
1483 os << "\\mark_foreign_language " <<
1484 tostr(mark_foreign_language) << "\n";
1488 << "# 2nd MISC SUPPORT SECTION ##########################\n"
1491 case RC_OVERRIDE_X_DEADKEYS:
1492 if (override_x_deadkeys != system_lyxrc.override_x_deadkeys) {
1493 os << "\\override_x_deadkeys "
1494 << tostr(override_x_deadkeys) << "\n";
1496 case RC_SCREEN_FONT_ENCODING_MENU:
1497 if (font_norm_menu != system_lyxrc.font_norm_menu) {
1498 os << "\\screen_font_encoding_menu \"" << font_norm_menu
1501 case RC_AUTO_NUMBER:
1502 if (auto_number != system_lyxrc.auto_number) {
1503 os << "\\auto_number " << tostr(auto_number) << "\n";
1505 case RC_NEW_ASK_FILENAME:
1506 if (new_ask_filename != system_lyxrc.new_ask_filename) {
1507 os << "\\new_ask_filename " << tostr(new_ask_filename)
1510 case RC_DEFAULT_LANGUAGE:
1511 if (default_language != system_lyxrc.default_language) {
1512 os << "\\default_language " << default_language << "\n";
1516 << "# FORMATS SECTION ##########################\n"
1520 // Look for deleted formats
1521 for (Formats::const_iterator cit = formats.begin();
1522 cit != formats.end(); ++cit) {
1523 Format const * format =
1524 system_formats.GetFormat(cit->name());
1526 format->extension() != cit->extension() ||
1527 format->prettyname() != cit->prettyname() ||
1528 format->shortcut() != cit->shortcut())
1529 os << "\\format \"" << cit->name() << "\" \""
1530 << cit->extension() << "\" \""
1531 << cit->prettyname() << "\" \""
1532 << cit->shortcut() << "\"\n";
1535 // New/modifed formats
1536 for (Formats::const_iterator cit = system_formats.begin();
1537 cit != system_formats.end(); ++cit)
1538 if (!formats.GetFormat(cit->name()))
1539 os << "\\format \"" << cit->name()
1540 << "\" \"\" \"\" \"\"\n";
1542 for (Formats::const_iterator cit = formats.begin();
1543 cit != formats.end(); ++cit) {
1544 Format const * format =
1545 system_formats.GetFormat(cit->name());
1546 if ((!format || format->viewer() != cit->viewer()) &&
1547 (format || !cit->viewer().empty()))
1548 os << "\\viewer \"" << cit->name() << "\" \""
1549 << cit->viewer() << "\"\n";
1553 << "# CONVERTERS SECTION ##########################\n"
1557 // Look for new converters
1558 for (Converters::const_iterator cit = converters.begin();
1559 cit != converters.end(); ++cit) {
1560 Converter const * converter =
1561 system_converters.GetConverter(cit->from,
1564 converter->command != cit->command ||
1565 converter->flags != cit->flags)
1566 os << "\\converter \"" << cit->from << "\" \""
1567 << cit->to << "\" \""
1568 << cit->command << "\" \""
1569 << cit->flags << "\"\n";
1572 // New/modifed converters
1573 for (Converters::const_iterator cit = system_converters.begin();
1574 cit != system_converters.end(); ++cit)
1575 if (!converters.GetConverter(cit->from, cit->to))
1576 os << "\\converter \"" << cit->from
1577 << "\" \"" << cit->to << "\" \"\" \"\"\n";
1582 void LyXRC::set_font_norm_type()
1584 if (font_norm == "iso10646-1")
1585 font_norm_type = ISO_10646_1;
1586 else if (font_norm == "iso8859-1")
1587 font_norm_type = ISO_8859_1;
1588 else if (font_norm == "iso8859-6.8x")
1589 font_norm_type = ISO_8859_6_8;
1590 else if (font_norm == "iso8859-9")
1591 font_norm_type = ISO_8859_9;
1593 font_norm_type = OTHER_ENCODING;
1597 string const LyXRC::getDescription(LyXRCTags tag)
1602 case RC_FONT_ENCODING:
1603 str = N_("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
1607 str = N_("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
1610 case RC_PRINT_COMMAND:
1611 str = N_("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
1614 case RC_PRINTEVENPAGEFLAG:
1615 str = N_("The option to print only even pages.");
1618 case RC_PRINTODDPAGEFLAG:
1619 str = N_("The option to print only odd pages.");
1622 case RC_PRINTPAGERANGEFLAG:
1623 str = N_("The option for specifying a comma-separated list of pages to print.");
1626 case RC_PRINTCOPIESFLAG:
1627 str = N_("The option for specifying the number of copies to print.");
1630 case RC_PRINTCOLLCOPIESFLAG:
1631 str = N_("The option for specifying whether the copies should be collated.");
1634 case RC_PRINTREVERSEFLAG:
1635 str = N_("The option to reverse the order of the pages printed.");
1638 case RC_PRINTLANDSCAPEFLAG:
1639 str = N_("The option to print out in landscape.");
1642 case RC_PRINTPAPERFLAG:
1643 str = N_("The option to specify paper type.");
1646 case RC_PRINTPAPERDIMENSIONFLAG:
1647 str = N_("Option to specify the dimensions of the print paper.");
1650 case RC_PRINTTOPRINTER:
1651 str = N_("Option to pass to the print program to print on a specific printer.");
1654 case RC_PRINT_ADAPTOUTPUT:
1655 str = N_("Select for LyX to pass the name of the destination printer to your print command.");
1658 case RC_PRINTTOFILE:
1659 str = N_("Option to pass to the print program to print to a file.");
1662 case RC_PRINTFILEEXTENSION:
1663 str = N_("Extension of printer program output file. Usually \".ps\".");
1666 case RC_PRINTEXSTRAOPTIONS:
1667 str = N_("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
1670 case RC_PRINTSPOOL_COMMAND:
1671 str = N_("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.");
1674 case RC_PRINTSPOOL_PRINTERPREFIX:
1675 str = N_("If you specify a printer name in the print dialog, the following argument is prepended along with the printer name after the spool command.");
1679 str = N_("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
1682 case RC_SCREEN_ZOOM:
1683 //xgettext:no-c-format
1684 str = N_("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
1687 case RC_SCREEN_FONT_SIZES:
1688 str = N_("The font sizes used for calculating the scaling of the screen fonts.");
1691 case RC_SCREEN_FONT_ROMAN:
1692 case RC_SCREEN_FONT_SANS:
1693 case RC_SCREEN_FONT_TYPEWRITER:
1694 str = N_("The screen fonts used to display the text while editing.");
1697 case RC_SCREEN_FONT_MENU:
1698 str = N_("The font for menus (and groups titles in popups).");
1701 case RC_SCREEN_FONT_POPUP:
1702 str = N_("The font for popups.");
1705 case RC_SCREEN_FONT_ENCODING:
1706 str = N_("The encoding for the screen fonts.");
1709 case RC_SCREEN_FONT_ENCODING_MENU:
1710 str = N_("The encoding for the menu/popups fonts.");
1717 str = N_("The time interval between auto-saves (in seconds). 0 means no auto-save.");
1720 case RC_DOCUMENTPATH:
1721 str = N_("The default path for your documents.");
1724 case RC_TEMPLATEPATH:
1725 str = N_("The path that LyX will set when offering to choose a template.");
1728 case RC_TEMPDIRPATH:
1729 str = N_("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
1733 str = N_("Select if you wish to use a temporary directory structure to store temporary TeX output.");
1737 str = N_("The file where the last-files information should be stored.");
1740 case RC_AUTOREGIONDELETE:
1741 str = N_("De-select if you don't want the current selection to be replaced automatically by what you type.");
1744 case RC_OVERRIDE_X_DEADKEYS:
1745 str = N_("Select if LyX is to take over the handling of the dead keys (a.k.a. accent keys) that may be defined for your keyboard.");
1750 str = N_("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
1754 str = N_("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
1758 str = N_("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
1762 case RC_KBMAP_PRIMARY:
1763 case RC_KBMAP_SECONDARY:
1764 str = N_("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.");
1767 case RC_ASCIIROFF_COMMAND:
1768 str = N_("Use to define an external program to render tables in the ASCII output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"none\" is specified, an internal routine is used.");
1771 case RC_ASCII_LINELEN:
1772 str = N_("This is the maximum line length of an exported ASCII file (LaTeX, SGML or plain text).");
1775 case RC_NUMLASTFILES:
1776 str = N_("Maximal number of lastfiles. Up to 9 can appear in the file menu.");
1779 case RC_CHECKLASTFILES:
1780 str = N_("Select to check whether the lastfiles still exist.");
1783 case RC_VIEWDVI_PAPEROPTION:
1786 case RC_DEFAULT_PAPERSIZE:
1787 str = N_("Specify the default paper size.");
1793 case RC_ACCEPT_COMPOUND:
1794 str = N_("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
1797 case RC_SPELL_COMMAND:
1798 str = N_("What command runs the spell checker?");
1801 case RC_USE_INP_ENC:
1802 str = N_("Specify whether to pass the -T input encoding option to ispell. Enable this if you can't spellcheck words with international letters in them. This may not work with all dictionaries.");
1805 case RC_USE_ALT_LANG:
1807 str = N_("Specify an alternate language. The default is to use the language of the document.");
1810 case RC_USE_PERS_DICT:
1812 str = N_("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
1815 case RC_USE_ESC_CHARS:
1817 str = N_("Specify additional chars that can be part of a word.");
1820 case RC_SCREEN_FONT_SCALABLE:
1821 str = N_("Allow the use of scalable screen fonts? If false, LyX will use the closest existing size for a match. Use this if the scalable fonts look bad and you have many fixed size fonts.");
1824 case RC_CHKTEX_COMMAND:
1825 str = N_("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
1828 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1829 str = N_("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.");
1832 case RC_EXIT_CONFIRMATION:
1833 str = N_("Sets whether LyX asks for a second confirmation to exit when you have changed documents. (LyX will still ask to save changed documents.)");
1836 case RC_DISPLAY_SHORTCUTS:
1837 str = N_("LyX continously displays names of last command executed, along with a list of defined short-cuts for it in the minibuffer. Set to false if LyX seems slow.");
1840 case RC_MAKE_BACKUP:
1841 str = N_("De-select if you don't want LyX to create backup files.");
1844 case RC_BACKUPDIR_PATH:
1845 str = N_("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.");
1848 case RC_RTL_SUPPORT:
1849 str = N_("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
1852 case RC_MARK_FOREIGN_LANGUAGE:
1853 str = N_("Select to control the highlighting of words with a language foreign to that of the document.");
1856 case RC_LANGUAGE_PACKAGE:
1857 str = N_("The latex command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
1860 case RC_LANGUAGE_GLOBAL_OPTIONS:
1861 str = N_("De-select if you don't want the language(s) used as an argument to \\documentclass.");
1864 case RC_LANGUAGE_USE_BABEL:
1865 str = N_("De-select if you don't want babel to be used when the language of the document is the default language.");
1868 case RC_LANGUAGE_AUTO_BEGIN:
1869 str = N_("Select if a language switching command is needed at the beginning of the document.");
1872 case RC_LANGUAGE_AUTO_END:
1873 str = N_("Select if a language switching command is needed at the end of the document.");
1876 case RC_LANGUAGE_COMMAND_BEGIN:
1877 str = N_("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.");
1880 case RC_LANGUAGE_COMMAND_END:
1881 str = N_("The latex command for changing back to the language of the document.");
1884 case RC_LANGUAGE_COMMAND_LOCAL:
1885 str = N_("The latex command for local changing of the language.");
1888 case RC_DATE_INSERT_FORMAT:
1889 //xgettext:no-c-format
1890 str = N_("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
1893 case RC_SHOW_BANNER:
1894 str = N_("De-select if you don't want the startup banner.");
1898 str = N_("The wheel movement factor (for mice with wheels or five button mice).");
1910 case RC_NEW_ASK_FILENAME:
1911 str = N_("This sets the behaviour if you want to be asked for a filename when creating a new document or wait until you save it and be asked then.");
1914 case RC_DEFAULT_LANGUAGE:
1915 str = N_("New documents will be assigned this language.");
1918 case RC_LABEL_INIT_LENGTH:
1919 str = N_("Maximum number of words in the initialization string for a new label");
1929 // The global instance
1932 // The global copy of the system lyxrc entries (everything except preferences)