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"
42 extern LyXAction lyxaction;
43 extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
47 keyword_item lyxrcTags[] = {
48 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
49 { "\\alternate_language", LyXRC::RC_ALT_LANG },
50 { "\\ascii_linelen", LyXRC::RC_ASCII_LINELEN },
51 { "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
52 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
53 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
54 { "\\autosave", LyXRC::RC_AUTOSAVE },
55 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
56 { "\\bind", LyXRC::RC_BIND },
57 { "\\bind_file", LyXRC::RC_BINDFILE },
58 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
59 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
60 { "\\converter", LyXRC::RC_CONVERTER },
61 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
62 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
63 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
64 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
65 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
66 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
67 { "\\display_shortcuts", LyXRC::RC_DISPLAY_SHORTCUTS },
68 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
69 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
70 { "\\exit_confirmation", LyXRC::RC_EXIT_CONFIRMATION },
71 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
72 { "\\format", LyXRC::RC_FORMAT },
73 { "\\input", LyXRC::RC_INPUT },
74 { "\\kbmap", LyXRC::RC_KBMAP },
75 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
76 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
77 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
78 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
79 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
80 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
81 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
82 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
83 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
84 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
85 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
86 { "\\lastfiles", LyXRC::RC_LASTFILES },
87 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
88 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
89 { "\\new_ask_filename", LyXRC::RC_NEW_ASK_FILENAME },
90 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
91 { "\\override_x_deadkeys", LyXRC::RC_OVERRIDE_X_DEADKEYS },
92 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
93 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
94 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
95 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
96 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
97 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
98 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
99 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
100 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
101 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
102 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
103 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
104 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
105 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
106 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
107 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
108 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
109 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
110 { "\\printer", LyXRC::RC_PRINTER },
111 { "\\ps_command", LyXRC::RC_PS_COMMAND },
112 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
113 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
114 { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
115 { "\\screen_font_encoding_menu", LyXRC::RC_SCREEN_FONT_ENCODING_MENU },
116 { "\\screen_font_menu", LyXRC::RC_SCREEN_FONT_MENU },
117 { "\\screen_font_popup", LyXRC::RC_SCREEN_FONT_POPUP },
118 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
119 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
120 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
121 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
122 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
123 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
124 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
125 { "\\set_color", LyXRC::RC_SET_COLOR },
126 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
127 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
128 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
129 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
130 { "\\ui_file", LyXRC::RC_UIFILE },
131 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
132 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
133 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
134 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
135 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
136 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
137 { "\\viewer" ,LyXRC::RC_VIEWER},
138 { "\\wheel_jump", LyXRC::RC_WHEEL_JUMP }
141 /* Let the range depend of the size of lyxrcTags. Alejandro 240596 */
142 static const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
151 void LyXRC::setDefaults() {
155 // Get printer from the environment. If fail, use default "",
156 // assuming that everything is set up correctly.
157 printer = GetEnv("PRINTER");
158 print_adapt_output = false;
159 print_command = "dvips";
160 print_evenpage_flag = "-B";
161 print_oddpage_flag = "-A";
162 print_pagerange_flag = "-pp";
163 print_copies_flag = "-c";
164 print_collcopies_flag = "-C";
165 print_reverse_flag = "-r";
166 print_landscape_flag = "-t landscape";
167 print_to_printer = "-P";
168 print_to_file = "-o ";
169 print_file_extension = ".ps";
170 print_paper_flag = "-t";
171 print_paper_dimension_flag = "-T";
172 document_path = GetEnvPath("HOME");
173 tempdir_path = "/tmp";
176 view_dvi_paper_option = "-paper";
177 default_papersize = BufferParams::PAPER_USLETTER;
178 custom_export_format = "ps";
179 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
182 // Because a screen typically is wider than a piece of paper:
185 // Default LaTeX font size:
186 font_sizes[LyXFont::SIZE_TINY] = 5.0;
187 font_sizes[LyXFont::SIZE_SCRIPT] = 7.0;
188 font_sizes[LyXFont::SIZE_FOOTNOTE] = 8.0;
189 font_sizes[LyXFont::SIZE_SMALL] = 9.0;
190 font_sizes[LyXFont::SIZE_NORMAL] = 10.0;
191 font_sizes[LyXFont::SIZE_LARGE] = 12.0;
192 font_sizes[LyXFont::SIZE_LARGER] = 14.4;
193 font_sizes[LyXFont::SIZE_LARGEST] = 17.26;
194 font_sizes[LyXFont::SIZE_HUGE] = 20.74;
195 font_sizes[LyXFont::SIZE_HUGER] = 24.88;
196 use_scalable_fonts = true;
197 roman_font_name = "-*-times";
198 sans_font_name = "-*-helvetica";
199 typewriter_font_name = "-*-courier";
200 menu_font_name = "-*-helvetica-bold-r";
201 popup_font_name = "-*-helvetica-medium-r";
202 font_norm = "iso8859-1";
203 font_norm_type = ISO_8859_1;
205 override_x_deadkeys = true;
207 auto_region_delete = true;
210 check_lastfiles = true;
213 exit_confirmation = true;
214 display_shortcuts = true;
215 // Spellchecker settings:
216 isp_command = "ispell";
217 isp_accept_compound = false;
218 isp_use_input_encoding = false;
219 isp_use_alt_lang = false;
220 isp_use_pers_dict = false;
221 isp_use_esc_chars = false;
225 mark_foreign_language = true;
226 language_auto_begin = true;
227 language_auto_end = true;
228 language_global_options = true;
229 language_use_babel = true;
230 language_package = "\\usepackage{babel}";
231 language_command_begin = "\\selectlanguage{$$lang}";
232 language_command_end = "\\selectlanguage{$$lang}";
233 language_command_local = "\\foreignlanguage{$$lang}{";
234 default_language = "english";
236 new_ask_filename = false;
239 date_insert_format = "%A, %e %B %Y";
241 cursor_follows_scrollbar = false;
242 label_init_length = 3;
244 /// These variables are not stored on disk (perhaps they
245 // should be moved from the LyXRC class).
251 int LyXRC::ReadBindFile(string const & name)
254 string const tmp = i18nLibFileSearch("bind", name, "bind");
255 lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
256 int const result = read(tmp);
258 lyxerr << "Error reading bind file: " << tmp << endl;
263 void LyXRC::readBindFileIfNeeded()
266 ReadBindFile(bind_file);
269 int LyXRC::read(string const & filename)
271 LyXLex lexrc(lyxrcTags, lyxrcCount);
272 if (lyxerr.debugging(Debug::PARSER))
273 lexrc.printTable(lyxerr);
275 lexrc.setFile(filename);
276 if (!lexrc.IsOK()) return -2;
278 lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
280 while (lexrc.IsOK()) {
281 // By using two switches we take advantage of the compiler
282 // telling us if we have missed a LyXRCTags element in
283 // the second switch.
284 // Note that this also shows a problem with LyXLex since it
285 // helps us avoid taking advantage of the strictness of the
288 int le = lexrc.lex();
290 case LyXLex::LEX_UNDEF:
291 lexrc.printError("Unknown tag `$$Token'");
293 case LyXLex::LEX_FEOF:
297 switch (static_cast<LyXRCTags>(le)) {
298 case RC_INPUT: // Include file
300 string tmp = LibFileSearch(string(),
303 lexrc.printError("Error reading "
304 "included file: "+tmp);
308 case RC_BINDFILE: // RVDK_PATCH_5
310 string tmp(lexrc.GetString());
312 // We are already in the
313 // "actually read bind file"
317 // We are still in the "just
318 // remember the name of the
326 ui_file = lexrc.GetString();
330 case RC_EXIT_CONFIRMATION:
332 exit_confirmation = lexrc.GetBool();
335 case RC_DISPLAY_SHORTCUTS:
337 display_shortcuts = lexrc.GetBool();
342 use_kbmap = lexrc.GetBool();
345 case RC_KBMAP_PRIMARY:
347 string kmap(lexrc.GetString());
350 } else if (!LibFileSearch("kbd", kmap,
352 primary_kbmap = kmap;
354 lexrc.printError("LyX: Keymap `$$Token' not found");
358 case RC_KBMAP_SECONDARY:
360 string kmap(lexrc.GetString());
363 } else if (!LibFileSearch("kbd", kmap,
365 secondary_kbmap = kmap;
367 lexrc.printError("LyX: Keymap `$$Token' not found");
371 case RC_FONT_ENCODING:
373 fontenc = lexrc.GetString();
378 printer = lexrc.GetString();
381 case RC_PRINT_COMMAND:
383 print_command = lexrc.GetString();
386 case RC_PRINTEVENPAGEFLAG:
388 print_evenpage_flag = lexrc.GetString();
391 case RC_PRINTODDPAGEFLAG:
393 print_oddpage_flag = lexrc.GetString();
396 case RC_PRINTPAGERANGEFLAG:
398 print_pagerange_flag = lexrc.GetString();
401 case RC_PRINTCOPIESFLAG:
403 print_copies_flag = lexrc.GetString();
406 case RC_PRINTCOLLCOPIESFLAG:
408 print_collcopies_flag = lexrc.GetString();
411 case RC_PRINTREVERSEFLAG:
413 print_reverse_flag = lexrc.GetString();
416 case RC_PRINTLANDSCAPEFLAG:
418 print_landscape_flag = lexrc.GetString();
421 case RC_PRINTTOPRINTER:
423 print_to_printer = lexrc.GetString();
426 case RC_PRINT_ADAPTOUTPUT:
428 print_adapt_output = lexrc.GetBool();
433 print_to_file = lexrc.GetString();
436 case RC_PRINTFILEEXTENSION:
438 print_file_extension = lexrc.GetString();
441 case RC_PRINTEXSTRAOPTIONS:
443 print_extra_options = lexrc.GetString();
446 case RC_PRINTSPOOL_COMMAND:
448 print_spool_command = lexrc.GetString();
451 case RC_PRINTSPOOL_PRINTERPREFIX:
453 print_spool_printerprefix = lexrc.GetString();
456 case RC_PRINTPAPERDIMENSIONFLAG:
458 print_paper_dimension_flag = lexrc.GetString();
461 case RC_PRINTPAPERFLAG:
463 print_paper_flag = lexrc.GetString();
466 case RC_CUSTOM_EXPORT_COMMAND:
468 custom_export_command = lexrc.GetString();
471 case RC_CUSTOM_EXPORT_FORMAT:
473 custom_export_format = lexrc.GetString();
476 case RC_DEFAULT_PAPERSIZE:
478 string size = lowercase(lexrc.GetString());
479 if (size == "usletter")
481 BufferParams::PAPER_USLETTER;
482 else if (size == "legal")
484 BufferParams::PAPER_LEGALPAPER;
485 else if (size == "executive")
487 BufferParams::PAPER_EXECUTIVEPAPER;
488 else if (size == "a3")
490 BufferParams::PAPER_A3PAPER;
491 else if (size == "a4")
493 BufferParams::PAPER_A4PAPER;
494 else if (size == "a5")
496 BufferParams::PAPER_A5PAPER;
497 else if (size == "b5")
499 BufferParams::PAPER_B5PAPER;
503 case RC_VIEWDVI_PAPEROPTION:
505 view_dvi_paper_option = lexrc.GetString();
507 view_dvi_paper_option = "";
512 ps_command = lexrc.GetString();
515 case RC_CHKTEX_COMMAND:
517 chktex_command = lexrc.GetString();
522 dpi = lexrc.GetInteger();
527 zoom = lexrc.GetInteger();
532 wheel_jump = lexrc.GetInteger();
535 case RC_SCREEN_FONT_SIZES:
537 font_sizes[LyXFont::SIZE_TINY] =
540 font_sizes[LyXFont::SIZE_SCRIPT] =
543 font_sizes[LyXFont::SIZE_FOOTNOTE] =
546 font_sizes[LyXFont::SIZE_SMALL] =
549 font_sizes[LyXFont::SIZE_NORMAL] =
552 font_sizes[LyXFont::SIZE_LARGE] =
555 font_sizes[LyXFont::SIZE_LARGER] =
558 font_sizes[LyXFont::SIZE_LARGEST] =
561 font_sizes[LyXFont::SIZE_HUGE] =
564 font_sizes[LyXFont::SIZE_HUGER] =
568 case RC_SCREEN_FONT_SCALABLE:
570 use_scalable_fonts = lexrc.GetBool();
575 autosave = lexrc.GetInteger();
578 case RC_DOCUMENTPATH:
580 document_path = ExpandPath(lexrc.GetString());
584 case RC_TEMPLATEPATH:
586 template_path = ExpandPath(lexrc.GetString());
591 tempdir_path = ExpandPath(lexrc.GetString());
596 use_tempdir = lexrc.GetBool();
601 lastfiles = ExpandPath(lexrc.GetString());
604 case RC_NUMLASTFILES:
606 num_lastfiles = lexrc.GetInteger();
609 case RC_CHECKLASTFILES:
611 check_lastfiles = lexrc.GetBool();
614 case RC_SCREEN_FONT_ROMAN:
616 roman_font_name = lexrc.GetString();
619 case RC_SCREEN_FONT_SANS:
621 sans_font_name = lexrc.GetString();
624 case RC_SCREEN_FONT_TYPEWRITER:
626 typewriter_font_name = lexrc.GetString();
629 case RC_SCREEN_FONT_MENU:
631 menu_font_name = lexrc.GetString();
634 case RC_SCREEN_FONT_POPUP:
636 popup_font_name = lexrc.GetString();
639 case RC_SCREEN_FONT_ENCODING:
641 font_norm = lexrc.GetString();
642 set_font_norm_type();
646 case RC_SCREEN_FONT_ENCODING_MENU:
648 font_norm_menu = lexrc.GetString();
653 string lyx_name, x11_name;
656 lyx_name = lexrc.GetString();
658 lexrc.printError("Missing color tag.");
663 x11_name = lexrc.GetString();
665 lexrc.printError("Missing color name for color : `$$Token'");
669 if (!lcolor.setColor(lyx_name, x11_name))
670 lyxerr << "Bad lyxrc set_color for "
675 case RC_AUTOREGIONDELETE:
676 // Auto region delete defaults to true
678 auto_region_delete = lexrc.GetBool();
683 // we should not do an explicit binding before
684 // loading a bind file. So, in this case, load
685 // the default bind file.
686 readBindFileIfNeeded();
688 // !!!chb, dynamic key binding...
692 if (lexrc.lex() == LyXLex::LEX_DATA) {
693 seq = lexrc.GetString();
695 lexrc.printError("Bad key sequence: `$$Token'");
699 if (lexrc.lex() == LyXLex::LEX_DATA) {
700 cmd = lexrc.GetString();
702 lexrc.printError("Bad command: `$$Token'");
706 if ((action = lyxaction.LookupFunc(cmd))>= 0) {
707 if (lyxerr.debugging(Debug::KBMAP)) {
708 lyxerr << "RC_BIND: Sequence `"
709 << seq << "' Command `"
710 << cmd << "' Action `"
711 << action << '\'' << endl;
713 res = toplevel_keymap->bind(seq, action);
716 "Invalid key sequence `"
719 } else {// cmd is the last token read.
721 "Unknown LyX function `$$Token'");
725 case RC_OVERRIDE_X_DEADKEYS:
727 override_x_deadkeys = lexrc.GetBool();
732 lyxpipes = ExpandPath(lexrc.GetString());
735 case RC_CURSOR_FOLLOWS_SCROLLBAR:
737 cursor_follows_scrollbar = lexrc.GetBool();
740 case RC_ASCIIROFF_COMMAND:
742 ascii_roff_command = lexrc.GetString();
744 case RC_ASCII_LINELEN:
746 ascii_linelen = lexrc.GetInteger();
748 // Spellchecker settings:
749 case RC_SPELL_COMMAND:
751 isp_command = lexrc.GetString();
753 case RC_ACCEPT_COMPOUND:
755 isp_accept_compound = lexrc.GetBool();
759 isp_use_input_encoding = lexrc.GetBool();
761 case RC_USE_ALT_LANG:
763 isp_use_alt_lang = lexrc.GetBool();
765 case RC_USE_PERS_DICT:
767 isp_use_pers_dict = lexrc.GetBool();
769 case RC_USE_ESC_CHARS:
771 isp_use_esc_chars = lexrc.GetBool();
775 isp_alt_lang = lexrc.GetString();
779 isp_pers_dict = lexrc.GetString();
783 isp_esc_chars = lexrc.GetString();
787 make_backup = lexrc.GetBool();
789 case RC_BACKUPDIR_PATH:
791 backupdir_path = ExpandPath(lexrc.GetString());
793 case RC_DATE_INSERT_FORMAT:
795 date_insert_format = lexrc.GetString();
797 case RC_LANGUAGE_PACKAGE:
799 language_package = lexrc.GetString();
801 case RC_LANGUAGE_AUTO_BEGIN:
803 language_auto_begin = lexrc.GetBool();
805 case RC_LANGUAGE_AUTO_END:
807 language_auto_end = lexrc.GetBool();
809 case RC_LANGUAGE_GLOBAL_OPTIONS:
811 language_global_options = lexrc.GetBool();
813 case RC_LANGUAGE_USE_BABEL:
815 language_use_babel = lexrc.GetBool();
817 case RC_LANGUAGE_COMMAND_BEGIN:
819 language_command_begin = lexrc.GetString();
821 case RC_LANGUAGE_COMMAND_END:
823 language_command_end = lexrc.GetString();
825 case RC_LANGUAGE_COMMAND_LOCAL:
827 language_command_local = lexrc.GetString();
831 rtl_support = lexrc.GetBool();
835 auto_number = lexrc.GetBool();
837 case RC_MARK_FOREIGN_LANGUAGE:
839 mark_foreign_language = lexrc.GetBool();
843 show_banner = lexrc.GetBool();
846 case RC_NEW_ASK_FILENAME:
848 new_ask_filename = lexrc.GetBool();
851 string from, to, command, flags;
853 from = lexrc.GetString();
855 to = lexrc.GetString();
857 command = lexrc.GetString();
859 flags = lexrc.GetString();
860 if (command.empty() || command == "none")
861 converters.Delete(from, to);
863 converters.Add(from, to, command, flags);
867 string format, command;
869 format = lexrc.GetString();
871 command = lexrc.GetString();
872 formats.SetViewer(format, command);
876 string format, extension, prettyname, shortcut;
878 format = lexrc.GetString();
880 extension = lexrc.GetString();
882 prettyname = lexrc.GetString();
884 shortcut = lexrc.GetString();
885 if (prettyname.empty()) {
886 if (converters.FormatIsUsed(format))
887 lyxerr << "Can't delete format "
890 formats.Delete(format);
893 formats.Add(format, extension, prettyname,
897 case RC_DEFAULT_LANGUAGE:
899 default_language = lexrc.GetString();
902 case RC_LABEL_INIT_LENGTH:
904 label_init_length = lexrc.GetInteger();
907 case RC_LAST: break; // this is just a dummy
911 /// Update converters data-structures
912 converters.Update(formats);
913 converters.BuildGraph();
919 void LyXRC::write(string const & filename) const
921 ofstream ofs(filename.c_str());
927 void LyXRC::print() const
929 if (lyxerr.debugging())
936 void LyXRC::output(ostream & os) const
938 os << "### This file is part of\n"
939 << "### ========================================================\n"
940 << "### LyX, The Document Processor\n"
942 << "### Copyright 1995 Matthias Ettrich\n"
943 << "### Copyright 1995-2000 The LyX Team.\n"
945 << "### ========================================================\n"
947 << "# This file is written by LyX, if you want to make your own\n"
948 << "# modifications you should do them from inside LyX and save\n"
951 // Why the switch you might ask. It is a trick to ensure that all
952 // the elements in the LyXRCTags enum is handled. As you can see
953 // there are no breaks at all. So it is just a huge fall-through.
954 // The nice thing is that we will get a warning from the compiler
955 // if we forget an element.
956 LyXRCTags tag = RC_LAST;
960 // input/include files are not done here
962 // bindings is not written to the preferences file.
964 if (bind_file != system_lyxrc.bind_file) {
965 os << "\\bind_file " << bind_file << "\n";
971 << "# MISC SECTION ######################################\n"
975 if (show_banner != system_lyxrc.show_banner) {
976 os << "# Set to false to inhibit the startup banner.\n"
977 << "\\show_banner " << tostr(show_banner) << "\n";
979 // bind files are not done here.
981 if (ui_file != system_lyxrc.ui_file) {
982 os << "\\ui_file \"" << ui_file << "\"\n";
984 case RC_AUTOREGIONDELETE:
985 if (auto_region_delete != system_lyxrc.auto_region_delete) {
986 os << "# Set to false to inhibit automatic replacement of\n"
987 << "# the current selection.\n"
988 << "\\auto_region_delete " << tostr(auto_region_delete)
992 if (autosave != system_lyxrc.autosave) {
993 os << "# The time interval between auto-saves in seconds.\n"
994 << "\\autosave " << autosave << "\n";
996 case RC_EXIT_CONFIRMATION:
997 if (exit_confirmation != system_lyxrc.exit_confirmation) {
998 os << "# Ask for confirmation before exit if there are\n"
999 << "# unsaved changed documents.\n"
1000 << "\\exit_confirmation " << tostr(exit_confirmation)
1003 case RC_DISPLAY_SHORTCUTS:
1004 if (display_shortcuts != system_lyxrc.display_shortcuts) {
1005 os << "# Display name of the last command executed,\n"
1006 << "# with a list of short-cuts in the minibuffer.\n"
1007 << "\\display_shortcuts " << tostr(display_shortcuts)
1010 case RC_VIEWDVI_PAPEROPTION:
1011 if (view_dvi_paper_option
1012 != system_lyxrc.view_dvi_paper_option) {
1013 os << "# Options used to specify paper size to the\n"
1014 << "# view_dvi_command\n"
1015 << "\\view_dvi_paper_option \""
1016 << view_dvi_paper_option << "\"\n";
1018 case RC_DEFAULT_PAPERSIZE:
1019 if (default_papersize != system_lyxrc.default_papersize) {
1020 os << "# The default papersize to use.\n"
1021 << "\\default_papersize \"";
1022 switch (default_papersize) {
1023 case BufferParams::PAPER_USLETTER:
1024 os << "usletter"; break;
1025 case BufferParams::PAPER_LEGALPAPER:
1026 os << "legal"; break;
1027 case BufferParams::PAPER_EXECUTIVEPAPER:
1028 os << "executive"; break;
1029 case BufferParams::PAPER_A3PAPER:
1031 case BufferParams::PAPER_A4PAPER:
1033 case BufferParams::PAPER_A5PAPER:
1035 case BufferParams::PAPER_B5PAPER:
1037 case BufferParams::PAPER_DEFAULT: break;
1042 if (ps_command != system_lyxrc.ps_command) {
1043 os << "# Program used for interpreting postscript.\n"
1044 << "\\ps_command \"" << ps_command << "\"\n";
1046 case RC_CHKTEX_COMMAND:
1047 if (chktex_command != system_lyxrc.chktex_command) {
1048 os << "\\chktex_command \"" << chktex_command << "\"\n";
1051 if (use_kbmap != system_lyxrc.use_kbmap) {
1052 os << "\\kbmap " << tostr(use_kbmap) << "\n";
1054 case RC_KBMAP_PRIMARY:
1055 if (primary_kbmap != system_lyxrc.primary_kbmap) {
1056 os << "\\kbmap_primary \"" << primary_kbmap << "\"\n";
1058 case RC_KBMAP_SECONDARY:
1059 if (secondary_kbmap != system_lyxrc.secondary_kbmap) {
1060 os << "\\kbmap_secondary \"" << secondary_kbmap
1064 if (lyxpipes != system_lyxrc.lyxpipes) {
1065 os << "\\serverpipe \"" << lyxpipes << "\"\n";
1067 case RC_DATE_INSERT_FORMAT:
1068 if (date_insert_format != system_lyxrc.date_insert_format) {
1069 os << "\\date_insert_format \"" << date_insert_format
1072 case RC_LABEL_INIT_LENGTH:
1073 if (label_init_length != system_lyxrc.label_init_length) {
1074 os << "\\label_init_length " << label_init_length
1079 << "# SCREEN & FONTS SECTION ############################\n"
1083 if (dpi != system_lyxrc.dpi) {
1084 os << "\\screen_dpi " << dpi << "\n";
1086 case RC_SCREEN_ZOOM:
1087 if (zoom != system_lyxrc.zoom) {
1088 os << "\\screen_zoom " << zoom << "\n";
1091 if (wheel_jump != system_lyxrc.wheel_jump) {
1092 os << "\\wheel_jump " << wheel_jump << "\n";
1094 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1095 if (cursor_follows_scrollbar
1096 != system_lyxrc.cursor_follows_scrollbar) {
1097 os << "\\cursor_follows_scrollbar "
1098 << tostr(cursor_follows_scrollbar) << "\n";
1100 case RC_SCREEN_FONT_ROMAN:
1101 if (roman_font_name != system_lyxrc.roman_font_name) {
1102 os << "\\screen_font_roman \"" << roman_font_name
1105 case RC_SCREEN_FONT_SANS:
1106 if (sans_font_name != system_lyxrc.sans_font_name) {
1107 os << "\\screen_font_sans \"" << sans_font_name
1110 case RC_SCREEN_FONT_TYPEWRITER:
1111 if (typewriter_font_name != system_lyxrc.typewriter_font_name) {
1112 os << "\\screen_font_typewriter \""
1113 << typewriter_font_name << "\"\n";
1115 case RC_SCREEN_FONT_SCALABLE:
1116 if (use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1117 os << "\\screen_font_scalable "
1118 << tostr(use_scalable_fonts)
1121 case RC_SCREEN_FONT_ENCODING:
1122 if (font_norm != system_lyxrc.font_norm) {
1123 os << "\\screen_font_encoding \"" << font_norm
1126 case RC_SCREEN_FONT_POPUP:
1127 if (popup_font_name != system_lyxrc.popup_font_name) {
1128 os << "\\screen_font_popup \"" << popup_font_name
1131 case RC_SCREEN_FONT_MENU:
1132 if (menu_font_name != system_lyxrc.menu_font_name) {
1133 os << "\\screen_font_menu \"" << menu_font_name
1136 case RC_SCREEN_FONT_SIZES:
1137 if (font_sizes[LyXFont::SIZE_TINY]
1138 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1139 font_sizes[LyXFont::SIZE_SCRIPT]
1140 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1141 font_sizes[LyXFont::SIZE_FOOTNOTE]
1142 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1143 font_sizes[LyXFont::SIZE_SMALL]
1144 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1145 font_sizes[LyXFont::SIZE_NORMAL]
1146 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1147 font_sizes[LyXFont::SIZE_LARGE]
1148 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1149 font_sizes[LyXFont::SIZE_LARGER]
1150 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1151 font_sizes[LyXFont::SIZE_LARGEST]
1152 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1153 font_sizes[LyXFont::SIZE_HUGE]
1154 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1155 font_sizes[LyXFont::SIZE_HUGER]
1156 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1157 os.setf(ios::fixed);
1159 os << "\\screen_font_sizes"
1160 << " " << font_sizes[LyXFont::SIZE_TINY]
1161 << " " << font_sizes[LyXFont::SIZE_SCRIPT]
1162 << " " << font_sizes[LyXFont::SIZE_FOOTNOTE]
1163 << " " << font_sizes[LyXFont::SIZE_SMALL]
1164 << " " << font_sizes[LyXFont::SIZE_NORMAL]
1165 << " " << font_sizes[LyXFont::SIZE_LARGE]
1166 << " " << font_sizes[LyXFont::SIZE_LARGER]
1167 << " " << font_sizes[LyXFont::SIZE_LARGEST]
1168 << " " << font_sizes[LyXFont::SIZE_HUGE]
1169 << " " << font_sizes[LyXFont::SIZE_HUGER]
1174 << "# COLOR SECTION ###################################\n"
1178 for (int i = 0; i < LColor::ignore; ++i ) {
1179 LColor::color lc = static_cast<LColor::color>(i);
1181 string const col(lcolor.getX11Name(lc));
1182 if (col != system_lcolor.getX11Name(lc)) {
1183 os << "\\set_color \""
1184 << lcolor.getLyXName(lc) << "\" \""
1190 << "# PRINTER SECTION ###################################\n"
1194 if (printer != system_lyxrc.printer) {
1195 os << "\\printer \"" << printer << "\"\n";
1197 case RC_PRINT_ADAPTOUTPUT:
1198 if (print_adapt_output != system_lyxrc.print_adapt_output) {
1199 os << "\\print_adapt_output "
1200 << tostr(print_adapt_output)
1203 case RC_PRINT_COMMAND:
1204 if (print_command != system_lyxrc.print_command) {
1205 os << "\\print_command \"" << print_command << "\"\n";
1207 case RC_PRINTEXSTRAOPTIONS:
1208 if (print_extra_options != system_lyxrc.print_extra_options) {
1209 os << "\\print_extra_options \"" << print_extra_options
1212 case RC_PRINTSPOOL_COMMAND:
1213 if (print_spool_command != system_lyxrc.print_spool_command) {
1214 os << "\\print_spool_command \"" << print_spool_command
1217 case RC_PRINTSPOOL_PRINTERPREFIX:
1218 if (print_spool_printerprefix
1219 != system_lyxrc.print_spool_printerprefix) {
1220 os << "\\print_spool_printerprefix \""
1221 << print_spool_printerprefix << "\"\n";
1223 case RC_PRINTEVENPAGEFLAG:
1224 if (print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1225 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1228 case RC_PRINTODDPAGEFLAG:
1229 if (print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1230 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1233 case RC_PRINTREVERSEFLAG:
1234 if (print_reverse_flag != system_lyxrc.print_reverse_flag) {
1235 os << "\\print_reverse_flag \"" << print_reverse_flag
1238 case RC_PRINTLANDSCAPEFLAG:
1239 if (print_landscape_flag != system_lyxrc.print_landscape_flag) {
1240 os << "\\print_landscape_flag \"" << print_landscape_flag
1243 case RC_PRINTPAGERANGEFLAG:
1244 if (print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1245 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1248 case RC_PRINTCOPIESFLAG:
1249 if (print_copies_flag != system_lyxrc.print_copies_flag) {
1250 os << "\\print_copies_flag \"" << print_copies_flag
1253 case RC_PRINTCOLLCOPIESFLAG:
1254 if (print_collcopies_flag
1255 != system_lyxrc.print_collcopies_flag) {
1256 os << "\\print_collcopies_flag \""
1257 << print_collcopies_flag
1260 case RC_PRINTPAPERFLAG:
1261 if (print_paper_flag != system_lyxrc.print_paper_flag) {
1262 os << "\\print_paper_flag \"" << print_paper_flag
1265 case RC_PRINTPAPERDIMENSIONFLAG:
1266 if (print_paper_dimension_flag
1267 != system_lyxrc.print_paper_dimension_flag) {
1268 os << "\\print_paper_dimension_flag \""
1269 << print_paper_dimension_flag << "\"\n";
1271 case RC_PRINTTOPRINTER:
1272 if (print_to_printer != system_lyxrc.print_to_printer) {
1273 os << "\\print_to_printer \"" << print_to_printer
1276 case RC_PRINTTOFILE:
1277 if (print_to_file != system_lyxrc.print_to_file) {
1278 os << "\\print_to_file \"" << print_to_file << "\"\n";
1280 case RC_PRINTFILEEXTENSION:
1281 if (print_file_extension != system_lyxrc.print_file_extension) {
1282 os << "\\print_file_extension \""
1283 << print_file_extension
1288 << "# EXPORT SECTION ####################################\n"
1291 case RC_CUSTOM_EXPORT_COMMAND:
1292 if (custom_export_command
1293 != system_lyxrc.custom_export_command) {
1294 os << "\\custom_export_command \""
1295 << custom_export_command
1298 case RC_CUSTOM_EXPORT_FORMAT:
1299 if (custom_export_format
1300 != system_lyxrc.custom_export_format) {
1301 os << "\\custom_export_format \"" << custom_export_format
1306 << "# TEX SECTION #######################################\n"
1309 case RC_FONT_ENCODING:
1310 if (fontenc != system_lyxrc.fontenc) {
1311 os << "\\font_encoding \"" << fontenc << "\"\n";
1315 << "# FILE SECTION ######################################\n"
1318 case RC_DOCUMENTPATH:
1319 if (document_path != system_lyxrc.document_path) {
1320 os << "\\document_path \"" << document_path << "\"\n";
1323 if (lastfiles != system_lyxrc.lastfiles) {
1324 os << "\\lastfiles \"" << lastfiles << "\"\n";
1326 case RC_NUMLASTFILES:
1327 if (num_lastfiles != system_lyxrc.num_lastfiles) {
1328 os << "\\num_lastfiles " << num_lastfiles << "\n";
1330 case RC_CHECKLASTFILES:
1331 if (check_lastfiles != system_lyxrc.check_lastfiles) {
1332 os << "\\check_lastfiles " << tostr(check_lastfiles)
1335 case RC_TEMPLATEPATH:
1336 if (template_path != system_lyxrc.template_path) {
1337 os << "\\template_path \"" << template_path << "\"\n";
1339 case RC_TEMPDIRPATH:
1340 if (tempdir_path != system_lyxrc.tempdir_path) {
1341 os << "\\tempdir_path \"" << tempdir_path << "\"\n";
1344 if (use_tempdir != system_lyxrc.use_tempdir) {
1345 os << "\\use_tempdir " << tostr(use_tempdir) << "\n";
1347 case RC_ASCII_LINELEN:
1348 if (ascii_linelen != system_lyxrc.ascii_linelen) {
1349 os << "\\ascii_linelen " << ascii_linelen << "\n";
1351 case RC_MAKE_BACKUP:
1352 if (make_backup != system_lyxrc.make_backup) {
1353 os << "\\make_backup " << tostr(make_backup) << "\n";
1355 case RC_BACKUPDIR_PATH:
1356 if (backupdir_path != system_lyxrc.backupdir_path) {
1357 os << "\\backupdir_path \"" << backupdir_path << "\"\n";
1361 << "# ASCII EXPORT SECTION ##############################\n"
1364 case RC_ASCIIROFF_COMMAND:
1365 if (ascii_roff_command != system_lyxrc.ascii_roff_command) {
1366 os << "\\ascii_roff_command \"" << ascii_roff_command
1371 << "# SPELLCHECKER SECTION ##############################\n"
1374 case RC_SPELL_COMMAND:
1375 if (isp_command != system_lyxrc.isp_command) {
1376 os << "\\spell_command \"" << isp_command << "\"\n";
1378 case RC_ACCEPT_COMPOUND:
1379 if (isp_accept_compound != system_lyxrc.isp_accept_compound) {
1380 os << "\\accept_compound " << tostr(isp_accept_compound)
1383 case RC_USE_ALT_LANG:
1384 if (isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1385 os << "\\use_alt_language " << tostr(isp_use_alt_lang)
1389 if (isp_alt_lang != system_lyxrc.isp_alt_lang) {
1390 os << "\\alternate_language \"" << isp_alt_lang
1393 case RC_USE_ESC_CHARS:
1394 if (isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1395 os << "\\use_escape_chars " << tostr(isp_use_esc_chars)
1399 if (isp_esc_chars != system_lyxrc.isp_esc_chars) {
1400 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1402 case RC_USE_PERS_DICT:
1403 if (isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1404 os << "\\use_personal_dictionary "
1405 << tostr(isp_use_pers_dict)
1409 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1410 os << "\\personal_dictionary \"" << isp_pers_dict
1413 case RC_USE_INP_ENC:
1414 if (isp_use_input_encoding
1415 != system_lyxrc.isp_use_input_encoding) {
1416 os << "\\use_input_encoding "
1417 << tostr(isp_use_input_encoding)
1422 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1425 case RC_RTL_SUPPORT:
1426 if (rtl_support != system_lyxrc.rtl_support) {
1427 os << "\\rtl " << tostr(rtl_support) << "\n";
1429 case RC_LANGUAGE_PACKAGE:
1430 if (language_package != system_lyxrc.language_package) {
1431 os << "\\language_package \"" << language_package
1434 case RC_LANGUAGE_GLOBAL_OPTIONS:
1435 if (language_global_options
1436 != system_lyxrc.language_global_options) {
1437 os << "\\language_global_options \""
1438 << tostr(language_global_options)
1441 case RC_LANGUAGE_USE_BABEL:
1442 if (language_use_babel != system_lyxrc.language_use_babel) {
1443 os << "\\language_use_babel \""
1444 << tostr(language_use_babel)
1447 case RC_LANGUAGE_COMMAND_BEGIN:
1448 if (language_command_begin
1449 != system_lyxrc.language_command_begin) {
1450 os << "\\language_command_begin \""
1451 << language_command_begin
1454 case RC_LANGUAGE_COMMAND_END:
1455 if (language_command_end
1456 != system_lyxrc.language_command_end) {
1457 os << "\\language_command_end \"" << language_command_end
1460 case RC_LANGUAGE_COMMAND_LOCAL:
1461 if (language_command_local
1462 != system_lyxrc.language_command_local) {
1463 os << "\\language_command_local \""
1464 << language_command_local
1467 case RC_LANGUAGE_AUTO_BEGIN:
1468 if (language_auto_begin != system_lyxrc.language_auto_begin) {
1469 os << "\\language_auto_begin "
1470 << tostr(language_auto_begin) << "\n";
1472 case RC_LANGUAGE_AUTO_END:
1473 if (language_auto_end != system_lyxrc.language_auto_end) {
1474 os << "\\language_auto_end "
1475 << tostr(language_auto_end) << "\n";
1477 case RC_MARK_FOREIGN_LANGUAGE:
1478 if (mark_foreign_language
1479 != system_lyxrc.mark_foreign_language) {
1480 os << "\\mark_foreign_language " <<
1481 tostr(mark_foreign_language) << "\n";
1485 << "# 2nd MISC SUPPORT SECTION ##########################\n"
1488 case RC_OVERRIDE_X_DEADKEYS:
1489 if (override_x_deadkeys != system_lyxrc.override_x_deadkeys) {
1490 os << "\\override_x_deadkeys "
1491 << tostr(override_x_deadkeys) << "\n";
1493 case RC_SCREEN_FONT_ENCODING_MENU:
1494 if (font_norm_menu != system_lyxrc.font_norm_menu) {
1495 os << "\\screen_font_encoding_menu \"" << font_norm_menu
1498 case RC_AUTO_NUMBER:
1499 if (auto_number != system_lyxrc.auto_number) {
1500 os << "\\auto_number " << tostr(auto_number) << "\n";
1502 case RC_NEW_ASK_FILENAME:
1503 if (new_ask_filename != system_lyxrc.new_ask_filename) {
1504 os << "\\new_ask_filename " << tostr(new_ask_filename)
1507 case RC_DEFAULT_LANGUAGE:
1508 if (default_language != system_lyxrc.default_language) {
1509 os << "\\default_language " << default_language << "\n";
1513 << "# FORMATS SECTION ##########################\n"
1517 // Look for deleted formats
1518 for (Formats::const_iterator cit = formats.begin();
1519 cit != formats.end(); ++cit) {
1520 Format const * format =
1521 system_formats.GetFormat(cit->name());
1523 format->extension() != cit->extension() ||
1524 format->prettyname() != cit->prettyname() ||
1525 format->shortcut() != cit->shortcut())
1526 os << "\\format \"" << cit->name() << "\" \""
1527 << cit->extension() << "\" \""
1528 << cit->prettyname() << "\" \""
1529 << cit->shortcut() << "\"\n";
1532 // New/modifed formats
1533 for (Formats::const_iterator cit = system_formats.begin();
1534 cit != system_formats.end(); ++cit)
1535 if (!formats.GetFormat(cit->name()))
1536 os << "\\format \"" << cit->name()
1537 << "\" \"\" \"\" \"\"\n";
1539 for (Formats::const_iterator cit = formats.begin();
1540 cit != formats.end(); ++cit) {
1541 Format const * format =
1542 system_formats.GetFormat(cit->name());
1543 if ((!format || format->viewer() != cit->viewer()) &&
1544 (format || !cit->viewer().empty()))
1545 os << "\\viewer \"" << cit->name() << "\" \""
1546 << cit->viewer() << "\"\n";
1550 << "# CONVERTERS SECTION ##########################\n"
1554 // Look for new converters
1555 for (Converters::const_iterator cit = converters.begin();
1556 cit != converters.end(); ++cit) {
1557 Converter const * converter =
1558 system_converters.GetConverter(cit->from,
1561 converter->command != cit->command ||
1562 converter->flags != cit->flags)
1563 os << "\\converter \"" << cit->from << "\" \""
1564 << cit->to << "\" \""
1565 << cit->command << "\" \""
1566 << cit->flags << "\"\n";
1569 // New/modifed converters
1570 for (Converters::const_iterator cit = system_converters.begin();
1571 cit != system_converters.end(); ++cit)
1572 if (!converters.GetConverter(cit->from, cit->to))
1573 os << "\\converter \"" << cit->from
1574 << "\" \"" << cit->to << "\" \"\" \"\"\n";
1579 void LyXRC::set_font_norm_type()
1581 if (font_norm == "iso10646-1")
1582 font_norm_type = ISO_10646_1;
1583 else if (font_norm == "iso8859-1")
1584 font_norm_type = ISO_8859_1;
1585 else if (font_norm == "iso8859-6.8x")
1586 font_norm_type = ISO_8859_6_8;
1587 else if (font_norm == "iso8859-9")
1588 font_norm_type = ISO_8859_9;
1590 font_norm_type = OTHER_ENCODING;
1594 string const LyXRC::getDescription(LyXRCTags tag)
1599 case RC_FONT_ENCODING:
1600 str = N_("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
1604 str = N_("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
1607 case RC_PRINT_COMMAND:
1608 str = N_("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
1611 case RC_PRINTEVENPAGEFLAG:
1612 str = N_("The option to print only even pages.");
1615 case RC_PRINTODDPAGEFLAG:
1616 str = N_("The option to print only odd pages.");
1619 case RC_PRINTPAGERANGEFLAG:
1620 str = N_("The option for specifying a comma-separated list of pages to print.");
1623 case RC_PRINTCOPIESFLAG:
1624 str = N_("The option for specifying the number of copies to print.");
1627 case RC_PRINTCOLLCOPIESFLAG:
1628 str = N_("The option for specifying whether the copies should be collated.");
1631 case RC_PRINTREVERSEFLAG:
1632 str = N_("The option to reverse the order of the pages printed.");
1635 case RC_PRINTLANDSCAPEFLAG:
1636 str = N_("The option to print out in landscape.");
1639 case RC_PRINTPAPERFLAG:
1640 str = N_("The option to specify paper type.");
1643 case RC_PRINTPAPERDIMENSIONFLAG:
1644 str = N_("Option to specify the dimensions of the print paper.");
1647 case RC_PRINTTOPRINTER:
1648 str = N_("Option to pass to the print program to print on a specific printer.");
1651 case RC_PRINT_ADAPTOUTPUT:
1652 str = N_("Select for LyX to pass the name of the destination printer to your print command.");
1655 case RC_PRINTTOFILE:
1656 str = N_("Option to pass to the print program to print to a file.");
1659 case RC_PRINTFILEEXTENSION:
1660 str = N_("Extension of printer program output file. Usually \".ps\".");
1663 case RC_PRINTEXSTRAOPTIONS:
1664 str = N_("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
1667 case RC_PRINTSPOOL_COMMAND:
1668 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.");
1671 case RC_PRINTSPOOL_PRINTERPREFIX:
1672 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.");
1676 str = N_("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
1679 case RC_SCREEN_ZOOM:
1680 //xgettext:no-c-format
1681 str = N_("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
1684 case RC_SCREEN_FONT_SIZES:
1685 str = N_("The font sizes used for calculating the scaling of the screen fonts.");
1688 case RC_SCREEN_FONT_ROMAN:
1689 case RC_SCREEN_FONT_SANS:
1690 case RC_SCREEN_FONT_TYPEWRITER:
1691 str = N_("The screen fonts used to display the text while editing.");
1694 case RC_SCREEN_FONT_MENU:
1695 str = N_("The font for menus (and groups titles in popups).");
1698 case RC_SCREEN_FONT_POPUP:
1699 str = N_("The font for popups.");
1702 case RC_SCREEN_FONT_ENCODING:
1703 str = N_("The encoding for the screen fonts.");
1706 case RC_SCREEN_FONT_ENCODING_MENU:
1707 str = N_("The encoding for the menu/popups fonts.");
1714 str = N_("The time interval between auto-saves (in seconds). 0 means no auto-save.");
1717 case RC_DOCUMENTPATH:
1718 str = N_("The default path for your documents.");
1721 case RC_TEMPLATEPATH:
1722 str = N_("The path that LyX will set when offering to choose a template.");
1725 case RC_TEMPDIRPATH:
1726 str = N_("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
1730 str = N_("Select if you wish to use a temporary directory structure to store temporary TeX output.");
1734 str = N_("The file where the last-files information should be stored.");
1737 case RC_AUTOREGIONDELETE:
1738 str = N_("De-select if you don't want the current selection to be replaced automatically by what you type.");
1741 case RC_OVERRIDE_X_DEADKEYS:
1742 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.");
1747 str = N_("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
1751 str = N_("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
1755 str = N_("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
1759 case RC_KBMAP_PRIMARY:
1760 case RC_KBMAP_SECONDARY:
1761 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.");
1764 case RC_ASCIIROFF_COMMAND:
1765 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.");
1768 case RC_ASCII_LINELEN:
1769 str = N_("This is the maximum line length of an exported ASCII file (LaTeX, SGML or plain text).");
1772 case RC_NUMLASTFILES:
1773 str = N_("Maximal number of lastfiles. Up to 9 can appear in the file menu.");
1776 case RC_CHECKLASTFILES:
1777 str = N_("Select to check whether the lastfiles still exist.");
1780 case RC_VIEWDVI_PAPEROPTION:
1783 case RC_DEFAULT_PAPERSIZE:
1784 str = N_("Specify the default paper size.");
1790 case RC_ACCEPT_COMPOUND:
1791 str = N_("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
1794 case RC_SPELL_COMMAND:
1795 str = N_("What command runs the spell checker?");
1798 case RC_USE_INP_ENC:
1799 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.");
1802 case RC_USE_ALT_LANG:
1804 str = N_("Specify an alternate language. The default is to use the language of the document.");
1807 case RC_USE_PERS_DICT:
1809 str = N_("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
1812 case RC_USE_ESC_CHARS:
1814 str = N_("Specify additional chars that can be part of a word.");
1817 case RC_SCREEN_FONT_SCALABLE:
1818 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.");
1821 case RC_CHKTEX_COMMAND:
1822 str = N_("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
1825 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1826 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.");
1829 case RC_EXIT_CONFIRMATION:
1830 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.)");
1833 case RC_DISPLAY_SHORTCUTS:
1834 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.");
1837 case RC_MAKE_BACKUP:
1838 str = N_("De-select if you don't want LyX to create backup files.");
1841 case RC_BACKUPDIR_PATH:
1842 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.");
1845 case RC_RTL_SUPPORT:
1846 str = N_("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
1849 case RC_MARK_FOREIGN_LANGUAGE:
1850 str = N_("Select to control the highlighting of words with a language foreign to that of the document.");
1853 case RC_LANGUAGE_PACKAGE:
1854 str = N_("The latex command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
1857 case RC_LANGUAGE_GLOBAL_OPTIONS:
1858 str = N_("De-select if you don't want the language(s) used as an argument to \\documentclass.");
1861 case RC_LANGUAGE_USE_BABEL:
1862 str = N_("De-select if you don't want babel to be used when the language of the document is the default language.");
1865 case RC_LANGUAGE_AUTO_BEGIN:
1866 str = N_("Select if a language switching command is needed at the beginning of the document.");
1869 case RC_LANGUAGE_AUTO_END:
1870 str = N_("Select if a language switching command is needed at the end of the document.");
1873 case RC_LANGUAGE_COMMAND_BEGIN:
1874 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.");
1877 case RC_LANGUAGE_COMMAND_END:
1878 str = N_("The latex command for changing back to the language of the document.");
1881 case RC_LANGUAGE_COMMAND_LOCAL:
1882 str = N_("The latex command for local changing of the language.");
1885 case RC_DATE_INSERT_FORMAT:
1886 //xgettext:no-c-format
1887 str = N_("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
1890 case RC_SHOW_BANNER:
1891 str = N_("De-select if you don't want the startup banner.");
1895 str = N_("The wheel movement factor (for mice with wheels or five button mice).");
1907 case RC_NEW_ASK_FILENAME:
1908 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.");
1911 case RC_DEFAULT_LANGUAGE:
1912 str = N_("New documents will be assigned this language.");
1915 case RC_LABEL_INIT_LENGTH:
1916 str = N_("Maximum number of words in the initialization string for a new label");
1926 // The global instance
1929 // The global copy of the system lyxrc entries (everything except preferences)