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 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
153 void LyXRC::setDefaults() {
157 // Get printer from the environment. If fail, use default "",
158 // assuming that everything is set up correctly.
159 printer = GetEnv("PRINTER");
160 print_adapt_output = false;
161 print_command = "dvips";
162 print_evenpage_flag = "-B";
163 print_oddpage_flag = "-A";
164 print_pagerange_flag = "-pp";
165 print_copies_flag = "-c";
166 print_collcopies_flag = "-C";
167 print_reverse_flag = "-r";
168 print_landscape_flag = "-t landscape";
169 print_to_printer = "-P";
170 print_to_file = "-o ";
171 print_file_extension = ".ps";
172 print_paper_flag = "-t";
173 print_paper_dimension_flag = "-T";
174 document_path = GetEnvPath("HOME");
175 tempdir_path = "/tmp";
178 view_dvi_paper_option = "-paper";
179 default_papersize = BufferParams::PAPER_USLETTER;
180 custom_export_format = "ps";
181 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
184 // Because a screen typically is wider than a piece of paper:
187 // Default LaTeX font size:
188 font_sizes[LyXFont::SIZE_TINY] = 5.0;
189 font_sizes[LyXFont::SIZE_SCRIPT] = 7.0;
190 font_sizes[LyXFont::SIZE_FOOTNOTE] = 8.0;
191 font_sizes[LyXFont::SIZE_SMALL] = 9.0;
192 font_sizes[LyXFont::SIZE_NORMAL] = 10.0;
193 font_sizes[LyXFont::SIZE_LARGE] = 12.0;
194 font_sizes[LyXFont::SIZE_LARGER] = 14.4;
195 font_sizes[LyXFont::SIZE_LARGEST] = 17.26;
196 font_sizes[LyXFont::SIZE_HUGE] = 20.74;
197 font_sizes[LyXFont::SIZE_HUGER] = 24.88;
198 use_scalable_fonts = true;
199 roman_font_name = "-*-times";
200 sans_font_name = "-*-helvetica";
201 typewriter_font_name = "-*-courier";
202 menu_font_name = "-*-helvetica-bold-r";
203 popup_font_name = "-*-helvetica-medium-r";
204 font_norm = "iso8859-1";
205 font_norm_type = ISO_8859_1;
207 override_x_deadkeys = true;
209 auto_region_delete = true;
212 check_lastfiles = true;
215 exit_confirmation = true;
216 display_shortcuts = true;
217 // Spellchecker settings:
218 isp_command = "ispell";
219 isp_accept_compound = false;
220 isp_use_input_encoding = false;
221 isp_use_alt_lang = false;
222 isp_use_pers_dict = false;
223 isp_use_esc_chars = false;
227 mark_foreign_language = true;
228 language_auto_begin = true;
229 language_auto_end = true;
230 language_global_options = true;
231 language_use_babel = true;
232 language_package = "\\usepackage{babel}";
233 language_command_begin = "\\selectlanguage{$$lang}";
234 language_command_end = "\\selectlanguage{$$lang}";
235 language_command_local = "\\foreignlanguage{$$lang}{";
236 default_language = "english";
238 new_ask_filename = false;
241 date_insert_format = "%A, %e %B %Y";
243 cursor_follows_scrollbar = false;
244 label_init_length = 3;
246 /// These variables are not stored on disk (perhaps they
247 // should be moved from the LyXRC class).
253 int LyXRC::ReadBindFile(string const & name)
256 string const tmp = i18nLibFileSearch("bind", name, "bind");
257 lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
258 int const result = read(tmp);
260 lyxerr << "Error reading bind file: " << tmp << endl;
265 void LyXRC::readBindFileIfNeeded()
268 ReadBindFile(bind_file);
271 int LyXRC::read(string const & filename)
273 LyXLex lexrc(lyxrcTags, lyxrcCount);
274 if (lyxerr.debugging(Debug::PARSER))
275 lexrc.printTable(lyxerr);
277 lexrc.setFile(filename);
278 if (!lexrc.IsOK()) return -2;
280 lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
282 while (lexrc.IsOK()) {
283 // By using two switches we take advantage of the compiler
284 // telling us if we have missed a LyXRCTags element in
285 // the second switch.
286 // Note that this also shows a problem with LyXLex since it
287 // helps us avoid taking advantage of the strictness of the
290 int le = lexrc.lex();
292 case LyXLex::LEX_UNDEF:
293 lexrc.printError("Unknown tag `$$Token'");
295 case LyXLex::LEX_FEOF:
299 switch (static_cast<LyXRCTags>(le)) {
300 case RC_INPUT: // Include file
302 string tmp = LibFileSearch(string(),
305 lexrc.printError("Error reading "
306 "included file: "+tmp);
310 case RC_BINDFILE: // RVDK_PATCH_5
312 string tmp(lexrc.GetString());
314 // We are already in the
315 // "actually read bind file"
319 // We are still in the "just
320 // remember the name of the
328 ui_file = lexrc.GetString();
332 case RC_EXIT_CONFIRMATION:
334 exit_confirmation = lexrc.GetBool();
337 case RC_DISPLAY_SHORTCUTS:
339 display_shortcuts = lexrc.GetBool();
344 use_kbmap = lexrc.GetBool();
347 case RC_KBMAP_PRIMARY:
349 string kmap(lexrc.GetString());
352 } else if (!LibFileSearch("kbd", kmap,
354 primary_kbmap = kmap;
356 lexrc.printError("LyX: Keymap `$$Token' not found");
360 case RC_KBMAP_SECONDARY:
362 string kmap(lexrc.GetString());
365 } else if (!LibFileSearch("kbd", kmap,
367 secondary_kbmap = kmap;
369 lexrc.printError("LyX: Keymap `$$Token' not found");
373 case RC_FONT_ENCODING:
375 fontenc = lexrc.GetString();
380 printer = lexrc.GetString();
383 case RC_PRINT_COMMAND:
385 print_command = lexrc.GetString();
388 case RC_PRINTEVENPAGEFLAG:
390 print_evenpage_flag = lexrc.GetString();
393 case RC_PRINTODDPAGEFLAG:
395 print_oddpage_flag = lexrc.GetString();
398 case RC_PRINTPAGERANGEFLAG:
400 print_pagerange_flag = lexrc.GetString();
403 case RC_PRINTCOPIESFLAG:
405 print_copies_flag = lexrc.GetString();
408 case RC_PRINTCOLLCOPIESFLAG:
410 print_collcopies_flag = lexrc.GetString();
413 case RC_PRINTREVERSEFLAG:
415 print_reverse_flag = lexrc.GetString();
418 case RC_PRINTLANDSCAPEFLAG:
420 print_landscape_flag = lexrc.GetString();
423 case RC_PRINTTOPRINTER:
425 print_to_printer = lexrc.GetString();
428 case RC_PRINT_ADAPTOUTPUT:
430 print_adapt_output = lexrc.GetBool();
435 print_to_file = lexrc.GetString();
438 case RC_PRINTFILEEXTENSION:
440 print_file_extension = lexrc.GetString();
443 case RC_PRINTEXSTRAOPTIONS:
445 print_extra_options = lexrc.GetString();
448 case RC_PRINTSPOOL_COMMAND:
450 print_spool_command = lexrc.GetString();
453 case RC_PRINTSPOOL_PRINTERPREFIX:
455 print_spool_printerprefix = lexrc.GetString();
458 case RC_PRINTPAPERDIMENSIONFLAG:
460 print_paper_dimension_flag = lexrc.GetString();
463 case RC_PRINTPAPERFLAG:
465 print_paper_flag = lexrc.GetString();
468 case RC_CUSTOM_EXPORT_COMMAND:
470 custom_export_command = lexrc.GetString();
473 case RC_CUSTOM_EXPORT_FORMAT:
475 custom_export_format = lexrc.GetString();
478 case RC_DEFAULT_PAPERSIZE:
480 string size = lowercase(lexrc.GetString());
481 if (size == "usletter")
483 BufferParams::PAPER_USLETTER;
484 else if (size == "legal")
486 BufferParams::PAPER_LEGALPAPER;
487 else if (size == "executive")
489 BufferParams::PAPER_EXECUTIVEPAPER;
490 else if (size == "a3")
492 BufferParams::PAPER_A3PAPER;
493 else if (size == "a4")
495 BufferParams::PAPER_A4PAPER;
496 else if (size == "a5")
498 BufferParams::PAPER_A5PAPER;
499 else if (size == "b5")
501 BufferParams::PAPER_B5PAPER;
505 case RC_VIEWDVI_PAPEROPTION:
507 view_dvi_paper_option = lexrc.GetString();
509 view_dvi_paper_option = "";
514 ps_command = lexrc.GetString();
517 case RC_CHKTEX_COMMAND:
519 chktex_command = lexrc.GetString();
524 dpi = lexrc.GetInteger();
529 zoom = lexrc.GetInteger();
534 wheel_jump = lexrc.GetInteger();
537 case RC_SCREEN_FONT_SIZES:
539 font_sizes[LyXFont::SIZE_TINY] =
542 font_sizes[LyXFont::SIZE_SCRIPT] =
545 font_sizes[LyXFont::SIZE_FOOTNOTE] =
548 font_sizes[LyXFont::SIZE_SMALL] =
551 font_sizes[LyXFont::SIZE_NORMAL] =
554 font_sizes[LyXFont::SIZE_LARGE] =
557 font_sizes[LyXFont::SIZE_LARGER] =
560 font_sizes[LyXFont::SIZE_LARGEST] =
563 font_sizes[LyXFont::SIZE_HUGE] =
566 font_sizes[LyXFont::SIZE_HUGER] =
570 case RC_SCREEN_FONT_SCALABLE:
572 use_scalable_fonts = lexrc.GetBool();
577 autosave = lexrc.GetInteger();
580 case RC_DOCUMENTPATH:
582 document_path = ExpandPath(lexrc.GetString());
586 case RC_TEMPLATEPATH:
588 template_path = ExpandPath(lexrc.GetString());
593 tempdir_path = ExpandPath(lexrc.GetString());
598 use_tempdir = lexrc.GetBool();
603 lastfiles = ExpandPath(lexrc.GetString());
606 case RC_NUMLASTFILES:
608 num_lastfiles = lexrc.GetInteger();
611 case RC_CHECKLASTFILES:
613 check_lastfiles = lexrc.GetBool();
616 case RC_SCREEN_FONT_ROMAN:
618 roman_font_name = lexrc.GetString();
621 case RC_SCREEN_FONT_SANS:
623 sans_font_name = lexrc.GetString();
626 case RC_SCREEN_FONT_TYPEWRITER:
628 typewriter_font_name = lexrc.GetString();
631 case RC_SCREEN_FONT_MENU:
633 menu_font_name = lexrc.GetString();
636 case RC_SCREEN_FONT_POPUP:
638 popup_font_name = lexrc.GetString();
641 case RC_SCREEN_FONT_ENCODING:
643 font_norm = lexrc.GetString();
644 set_font_norm_type();
648 case RC_SCREEN_FONT_ENCODING_MENU:
650 font_norm_menu = lexrc.GetString();
655 string lyx_name, x11_name;
658 lyx_name = lexrc.GetString();
660 lexrc.printError("Missing color tag.");
665 x11_name = lexrc.GetString();
667 lexrc.printError("Missing color name for color : `$$Token'");
671 if (!lcolor.setColor(lyx_name, x11_name))
672 lyxerr << "Bad lyxrc set_color for "
677 case RC_AUTOREGIONDELETE:
678 // Auto region delete defaults to true
680 auto_region_delete = lexrc.GetBool();
685 // we should not do an explicit binding before
686 // loading a bind file. So, in this case, load
687 // the default bind file.
688 readBindFileIfNeeded();
690 // !!!chb, dynamic key binding...
694 if (lexrc.lex() == LyXLex::LEX_DATA) {
695 seq = lexrc.GetString();
697 lexrc.printError("Bad key sequence: `$$Token'");
701 if (lexrc.lex() == LyXLex::LEX_DATA) {
702 cmd = lexrc.GetString();
704 lexrc.printError("Bad command: `$$Token'");
708 if ((action = lyxaction.LookupFunc(cmd))>= 0) {
709 if (lyxerr.debugging(Debug::KBMAP)) {
710 lyxerr << "RC_BIND: Sequence `"
711 << seq << "' Command `"
712 << cmd << "' Action `"
713 << action << '\'' << endl;
715 res = toplevel_keymap->bind(seq, action);
718 "Invalid key sequence `"
721 } else {// cmd is the last token read.
723 "Unknown LyX function `$$Token'");
727 case RC_OVERRIDE_X_DEADKEYS:
729 override_x_deadkeys = lexrc.GetBool();
734 lyxpipes = ExpandPath(lexrc.GetString());
737 case RC_CURSOR_FOLLOWS_SCROLLBAR:
739 cursor_follows_scrollbar = lexrc.GetBool();
742 case RC_ASCIIROFF_COMMAND:
744 ascii_roff_command = lexrc.GetString();
746 case RC_ASCII_LINELEN:
748 ascii_linelen = lexrc.GetInteger();
750 // Spellchecker settings:
751 case RC_SPELL_COMMAND:
753 isp_command = lexrc.GetString();
755 case RC_ACCEPT_COMPOUND:
757 isp_accept_compound = lexrc.GetBool();
761 isp_use_input_encoding = lexrc.GetBool();
763 case RC_USE_ALT_LANG:
765 isp_use_alt_lang = lexrc.GetBool();
767 case RC_USE_PERS_DICT:
769 isp_use_pers_dict = lexrc.GetBool();
771 case RC_USE_ESC_CHARS:
773 isp_use_esc_chars = lexrc.GetBool();
777 isp_alt_lang = lexrc.GetString();
781 isp_pers_dict = lexrc.GetString();
785 isp_esc_chars = lexrc.GetString();
789 make_backup = lexrc.GetBool();
791 case RC_BACKUPDIR_PATH:
793 backupdir_path = ExpandPath(lexrc.GetString());
795 case RC_DATE_INSERT_FORMAT:
797 date_insert_format = lexrc.GetString();
799 case RC_LANGUAGE_PACKAGE:
801 language_package = lexrc.GetString();
803 case RC_LANGUAGE_AUTO_BEGIN:
805 language_auto_begin = lexrc.GetBool();
807 case RC_LANGUAGE_AUTO_END:
809 language_auto_end = lexrc.GetBool();
811 case RC_LANGUAGE_GLOBAL_OPTIONS:
813 language_global_options = lexrc.GetBool();
815 case RC_LANGUAGE_USE_BABEL:
817 language_use_babel = lexrc.GetBool();
819 case RC_LANGUAGE_COMMAND_BEGIN:
821 language_command_begin = lexrc.GetString();
823 case RC_LANGUAGE_COMMAND_END:
825 language_command_end = lexrc.GetString();
827 case RC_LANGUAGE_COMMAND_LOCAL:
829 language_command_local = lexrc.GetString();
833 rtl_support = lexrc.GetBool();
837 auto_number = lexrc.GetBool();
839 case RC_MARK_FOREIGN_LANGUAGE:
841 mark_foreign_language = lexrc.GetBool();
845 show_banner = lexrc.GetBool();
848 case RC_NEW_ASK_FILENAME:
850 new_ask_filename = lexrc.GetBool();
853 string from, to, command, flags;
855 from = lexrc.GetString();
857 to = lexrc.GetString();
859 command = lexrc.GetString();
861 flags = lexrc.GetString();
862 if (command.empty() || command == "none")
863 converters.Delete(from, to);
865 converters.Add(from, to, command, flags);
869 string format, command;
871 format = lexrc.GetString();
873 command = lexrc.GetString();
874 formats.SetViewer(format, command);
878 string format, extension, prettyname, shortcut;
880 format = lexrc.GetString();
882 extension = lexrc.GetString();
884 prettyname = lexrc.GetString();
886 shortcut = lexrc.GetString();
887 if (prettyname.empty()) {
888 if (converters.FormatIsUsed(format))
889 lyxerr << "Can't delete format "
892 formats.Delete(format);
895 formats.Add(format, extension, prettyname,
899 case RC_DEFAULT_LANGUAGE:
901 default_language = lexrc.GetString();
904 case RC_LABEL_INIT_LENGTH:
906 label_init_length = lexrc.GetInteger();
909 case RC_LAST: break; // this is just a dummy
913 /// Update converters data-structures
914 converters.Update(formats);
915 converters.BuildGraph();
921 void LyXRC::write(string const & filename) const
923 ofstream ofs(filename.c_str());
929 void LyXRC::print() const
931 if (lyxerr.debugging())
938 void LyXRC::output(ostream & os) const
940 os << "### This file is part of\n"
941 << "### ========================================================\n"
942 << "### LyX, The Document Processor\n"
944 << "### Copyright 1995 Matthias Ettrich\n"
945 << "### Copyright 1995-2000 The LyX Team.\n"
947 << "### ========================================================\n"
949 << "# This file is written by LyX, if you want to make your own\n"
950 << "# modifications you should do them from inside LyX and save\n"
953 // Why the switch you might ask. It is a trick to ensure that all
954 // the elements in the LyXRCTags enum is handled. As you can see
955 // there are no breaks at all. So it is just a huge fall-through.
956 // The nice thing is that we will get a warning from the compiler
957 // if we forget an element.
958 LyXRCTags tag = RC_LAST;
962 // input/include files are not done here
964 // bindings is not written to the preferences file.
966 if (bind_file != system_lyxrc.bind_file) {
967 os << "\\bind_file " << bind_file << "\n";
973 << "# MISC SECTION ######################################\n"
977 if (show_banner != system_lyxrc.show_banner) {
978 os << "# Set to false to inhibit the startup banner.\n"
979 << "\\show_banner " << tostr(show_banner) << "\n";
981 // bind files are not done here.
983 if (ui_file != system_lyxrc.ui_file) {
984 os << "\\ui_file \"" << ui_file << "\"\n";
986 case RC_AUTOREGIONDELETE:
987 if (auto_region_delete != system_lyxrc.auto_region_delete) {
988 os << "# Set to false to inhibit automatic replacement of\n"
989 << "# the current selection.\n"
990 << "\\auto_region_delete " << tostr(auto_region_delete)
994 if (autosave != system_lyxrc.autosave) {
995 os << "# The time interval between auto-saves in seconds.\n"
996 << "\\autosave " << autosave << "\n";
998 case RC_EXIT_CONFIRMATION:
999 if (exit_confirmation != system_lyxrc.exit_confirmation) {
1000 os << "# Ask for confirmation before exit if there are\n"
1001 << "# unsaved changed documents.\n"
1002 << "\\exit_confirmation " << tostr(exit_confirmation)
1005 case RC_DISPLAY_SHORTCUTS:
1006 if (display_shortcuts != system_lyxrc.display_shortcuts) {
1007 os << "# Display name of the last command executed,\n"
1008 << "# with a list of short-cuts in the minibuffer.\n"
1009 << "\\display_shortcuts " << tostr(display_shortcuts)
1012 case RC_VIEWDVI_PAPEROPTION:
1013 if (view_dvi_paper_option
1014 != system_lyxrc.view_dvi_paper_option) {
1015 os << "# Options used to specify paper size to the\n"
1016 << "# view_dvi_command\n"
1017 << "\\view_dvi_paper_option \""
1018 << view_dvi_paper_option << "\"\n";
1020 case RC_DEFAULT_PAPERSIZE:
1021 if (default_papersize != system_lyxrc.default_papersize) {
1022 os << "# The default papersize to use.\n"
1023 << "\\default_papersize \"";
1024 switch (default_papersize) {
1025 case BufferParams::PAPER_USLETTER:
1026 os << "usletter"; break;
1027 case BufferParams::PAPER_LEGALPAPER:
1028 os << "legal"; break;
1029 case BufferParams::PAPER_EXECUTIVEPAPER:
1030 os << "executive"; break;
1031 case BufferParams::PAPER_A3PAPER:
1033 case BufferParams::PAPER_A4PAPER:
1035 case BufferParams::PAPER_A5PAPER:
1037 case BufferParams::PAPER_B5PAPER:
1039 case BufferParams::PAPER_DEFAULT: break;
1044 if (ps_command != system_lyxrc.ps_command) {
1045 os << "# Program used for interpreting postscript.\n"
1046 << "\\ps_command \"" << ps_command << "\"\n";
1048 case RC_CHKTEX_COMMAND:
1049 if (chktex_command != system_lyxrc.chktex_command) {
1050 os << "\\chktex_command \"" << chktex_command << "\"\n";
1053 if (use_kbmap != system_lyxrc.use_kbmap) {
1054 os << "\\kbmap " << tostr(use_kbmap) << "\n";
1056 case RC_KBMAP_PRIMARY:
1057 if (primary_kbmap != system_lyxrc.primary_kbmap) {
1058 os << "\\kbmap_primary \"" << primary_kbmap << "\"\n";
1060 case RC_KBMAP_SECONDARY:
1061 if (secondary_kbmap != system_lyxrc.secondary_kbmap) {
1062 os << "\\kbmap_secondary \"" << secondary_kbmap
1066 if (lyxpipes != system_lyxrc.lyxpipes) {
1067 os << "\\serverpipe \"" << lyxpipes << "\"\n";
1069 case RC_DATE_INSERT_FORMAT:
1070 if (date_insert_format != system_lyxrc.date_insert_format) {
1071 os << "\\date_insert_format \"" << date_insert_format
1074 case RC_LABEL_INIT_LENGTH:
1075 if (label_init_length != system_lyxrc.label_init_length) {
1076 os << "\\label_init_length " << label_init_length
1081 << "# SCREEN & FONTS SECTION ############################\n"
1085 if (dpi != system_lyxrc.dpi) {
1086 os << "\\screen_dpi " << dpi << "\n";
1088 case RC_SCREEN_ZOOM:
1089 if (zoom != system_lyxrc.zoom) {
1090 os << "\\screen_zoom " << zoom << "\n";
1093 if (wheel_jump != system_lyxrc.wheel_jump) {
1094 os << "\\wheel_jump " << wheel_jump << "\n";
1096 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1097 if (cursor_follows_scrollbar
1098 != system_lyxrc.cursor_follows_scrollbar) {
1099 os << "\\cursor_follows_scrollbar "
1100 << tostr(cursor_follows_scrollbar) << "\n";
1102 case RC_SCREEN_FONT_ROMAN:
1103 if (roman_font_name != system_lyxrc.roman_font_name) {
1104 os << "\\screen_font_roman \"" << roman_font_name
1107 case RC_SCREEN_FONT_SANS:
1108 if (sans_font_name != system_lyxrc.sans_font_name) {
1109 os << "\\screen_font_sans \"" << sans_font_name
1112 case RC_SCREEN_FONT_TYPEWRITER:
1113 if (typewriter_font_name != system_lyxrc.typewriter_font_name) {
1114 os << "\\screen_font_typewriter \""
1115 << typewriter_font_name << "\"\n";
1117 case RC_SCREEN_FONT_SCALABLE:
1118 if (use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1119 os << "\\screen_font_scalable "
1120 << tostr(use_scalable_fonts)
1123 case RC_SCREEN_FONT_ENCODING:
1124 if (font_norm != system_lyxrc.font_norm) {
1125 os << "\\screen_font_encoding \"" << font_norm
1128 case RC_SCREEN_FONT_POPUP:
1129 if (popup_font_name != system_lyxrc.popup_font_name) {
1130 os << "\\screen_font_popup \"" << popup_font_name
1133 case RC_SCREEN_FONT_MENU:
1134 if (menu_font_name != system_lyxrc.menu_font_name) {
1135 os << "\\screen_font_menu \"" << menu_font_name
1138 case RC_SCREEN_FONT_SIZES:
1139 if (font_sizes[LyXFont::SIZE_TINY]
1140 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1141 font_sizes[LyXFont::SIZE_SCRIPT]
1142 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1143 font_sizes[LyXFont::SIZE_FOOTNOTE]
1144 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1145 font_sizes[LyXFont::SIZE_SMALL]
1146 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1147 font_sizes[LyXFont::SIZE_NORMAL]
1148 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1149 font_sizes[LyXFont::SIZE_LARGE]
1150 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1151 font_sizes[LyXFont::SIZE_LARGER]
1152 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1153 font_sizes[LyXFont::SIZE_LARGEST]
1154 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1155 font_sizes[LyXFont::SIZE_HUGE]
1156 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1157 font_sizes[LyXFont::SIZE_HUGER]
1158 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1159 os.setf(ios::fixed);
1161 os << "\\screen_font_sizes"
1162 << " " << font_sizes[LyXFont::SIZE_TINY]
1163 << " " << font_sizes[LyXFont::SIZE_SCRIPT]
1164 << " " << font_sizes[LyXFont::SIZE_FOOTNOTE]
1165 << " " << font_sizes[LyXFont::SIZE_SMALL]
1166 << " " << font_sizes[LyXFont::SIZE_NORMAL]
1167 << " " << font_sizes[LyXFont::SIZE_LARGE]
1168 << " " << font_sizes[LyXFont::SIZE_LARGER]
1169 << " " << font_sizes[LyXFont::SIZE_LARGEST]
1170 << " " << font_sizes[LyXFont::SIZE_HUGE]
1171 << " " << font_sizes[LyXFont::SIZE_HUGER]
1176 << "# COLOR SECTION ###################################\n"
1180 for (int i = 0; i < LColor::ignore; ++i ) {
1181 LColor::color lc = static_cast<LColor::color>(i);
1183 string const col(lcolor.getX11Name(lc));
1184 if (col != system_lcolor.getX11Name(lc)) {
1185 os << "\\set_color \""
1186 << lcolor.getLyXName(lc) << "\" \""
1192 << "# PRINTER SECTION ###################################\n"
1196 if (printer != system_lyxrc.printer) {
1197 os << "\\printer \"" << printer << "\"\n";
1199 case RC_PRINT_ADAPTOUTPUT:
1200 if (print_adapt_output != system_lyxrc.print_adapt_output) {
1201 os << "\\print_adapt_output "
1202 << tostr(print_adapt_output)
1205 case RC_PRINT_COMMAND:
1206 if (print_command != system_lyxrc.print_command) {
1207 os << "\\print_command \"" << print_command << "\"\n";
1209 case RC_PRINTEXSTRAOPTIONS:
1210 if (print_extra_options != system_lyxrc.print_extra_options) {
1211 os << "\\print_extra_options \"" << print_extra_options
1214 case RC_PRINTSPOOL_COMMAND:
1215 if (print_spool_command != system_lyxrc.print_spool_command) {
1216 os << "\\print_spool_command \"" << print_spool_command
1219 case RC_PRINTSPOOL_PRINTERPREFIX:
1220 if (print_spool_printerprefix
1221 != system_lyxrc.print_spool_printerprefix) {
1222 os << "\\print_spool_printerprefix \""
1223 << print_spool_printerprefix << "\"\n";
1225 case RC_PRINTEVENPAGEFLAG:
1226 if (print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1227 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1230 case RC_PRINTODDPAGEFLAG:
1231 if (print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1232 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1235 case RC_PRINTREVERSEFLAG:
1236 if (print_reverse_flag != system_lyxrc.print_reverse_flag) {
1237 os << "\\print_reverse_flag \"" << print_reverse_flag
1240 case RC_PRINTLANDSCAPEFLAG:
1241 if (print_landscape_flag != system_lyxrc.print_landscape_flag) {
1242 os << "\\print_landscape_flag \"" << print_landscape_flag
1245 case RC_PRINTPAGERANGEFLAG:
1246 if (print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1247 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1250 case RC_PRINTCOPIESFLAG:
1251 if (print_copies_flag != system_lyxrc.print_copies_flag) {
1252 os << "\\print_copies_flag \"" << print_copies_flag
1255 case RC_PRINTCOLLCOPIESFLAG:
1256 if (print_collcopies_flag
1257 != system_lyxrc.print_collcopies_flag) {
1258 os << "\\print_collcopies_flag \""
1259 << print_collcopies_flag
1262 case RC_PRINTPAPERFLAG:
1263 if (print_paper_flag != system_lyxrc.print_paper_flag) {
1264 os << "\\print_paper_flag \"" << print_paper_flag
1267 case RC_PRINTPAPERDIMENSIONFLAG:
1268 if (print_paper_dimension_flag
1269 != system_lyxrc.print_paper_dimension_flag) {
1270 os << "\\print_paper_dimension_flag \""
1271 << print_paper_dimension_flag << "\"\n";
1273 case RC_PRINTTOPRINTER:
1274 if (print_to_printer != system_lyxrc.print_to_printer) {
1275 os << "\\print_to_printer \"" << print_to_printer
1278 case RC_PRINTTOFILE:
1279 if (print_to_file != system_lyxrc.print_to_file) {
1280 os << "\\print_to_file \"" << print_to_file << "\"\n";
1282 case RC_PRINTFILEEXTENSION:
1283 if (print_file_extension != system_lyxrc.print_file_extension) {
1284 os << "\\print_file_extension \""
1285 << print_file_extension
1290 << "# EXPORT SECTION ####################################\n"
1293 case RC_CUSTOM_EXPORT_COMMAND:
1294 if (custom_export_command
1295 != system_lyxrc.custom_export_command) {
1296 os << "\\custom_export_command \""
1297 << custom_export_command
1300 case RC_CUSTOM_EXPORT_FORMAT:
1301 if (custom_export_format
1302 != system_lyxrc.custom_export_format) {
1303 os << "\\custom_export_format \"" << custom_export_format
1308 << "# TEX SECTION #######################################\n"
1311 case RC_FONT_ENCODING:
1312 if (fontenc != system_lyxrc.fontenc) {
1313 os << "\\font_encoding \"" << fontenc << "\"\n";
1317 << "# FILE SECTION ######################################\n"
1320 case RC_DOCUMENTPATH:
1321 if (document_path != system_lyxrc.document_path) {
1322 os << "\\document_path \"" << document_path << "\"\n";
1325 if (lastfiles != system_lyxrc.lastfiles) {
1326 os << "\\lastfiles \"" << lastfiles << "\"\n";
1328 case RC_NUMLASTFILES:
1329 if (num_lastfiles != system_lyxrc.num_lastfiles) {
1330 os << "\\num_lastfiles " << num_lastfiles << "\n";
1332 case RC_CHECKLASTFILES:
1333 if (check_lastfiles != system_lyxrc.check_lastfiles) {
1334 os << "\\check_lastfiles " << tostr(check_lastfiles)
1337 case RC_TEMPLATEPATH:
1338 if (template_path != system_lyxrc.template_path) {
1339 os << "\\template_path \"" << template_path << "\"\n";
1341 case RC_TEMPDIRPATH:
1342 if (tempdir_path != system_lyxrc.tempdir_path) {
1343 os << "\\tempdir_path \"" << tempdir_path << "\"\n";
1346 if (use_tempdir != system_lyxrc.use_tempdir) {
1347 os << "\\use_tempdir " << tostr(use_tempdir) << "\n";
1349 case RC_ASCII_LINELEN:
1350 if (ascii_linelen != system_lyxrc.ascii_linelen) {
1351 os << "\\ascii_linelen " << ascii_linelen << "\n";
1353 case RC_MAKE_BACKUP:
1354 if (make_backup != system_lyxrc.make_backup) {
1355 os << "\\make_backup " << tostr(make_backup) << "\n";
1357 case RC_BACKUPDIR_PATH:
1358 if (backupdir_path != system_lyxrc.backupdir_path) {
1359 os << "\\backupdir_path \"" << backupdir_path << "\"\n";
1363 << "# ASCII EXPORT SECTION ##############################\n"
1366 case RC_ASCIIROFF_COMMAND:
1367 if (ascii_roff_command != system_lyxrc.ascii_roff_command) {
1368 os << "\\ascii_roff_command \"" << ascii_roff_command
1373 << "# SPELLCHECKER SECTION ##############################\n"
1376 case RC_SPELL_COMMAND:
1377 if (isp_command != system_lyxrc.isp_command) {
1378 os << "\\spell_command \"" << isp_command << "\"\n";
1380 case RC_ACCEPT_COMPOUND:
1381 if (isp_accept_compound != system_lyxrc.isp_accept_compound) {
1382 os << "\\accept_compound " << tostr(isp_accept_compound)
1385 case RC_USE_ALT_LANG:
1386 if (isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1387 os << "\\use_alt_language " << tostr(isp_use_alt_lang)
1391 if (isp_alt_lang != system_lyxrc.isp_alt_lang) {
1392 os << "\\alternate_language \"" << isp_alt_lang
1395 case RC_USE_ESC_CHARS:
1396 if (isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1397 os << "\\use_escape_chars " << tostr(isp_use_esc_chars)
1401 if (isp_esc_chars != system_lyxrc.isp_esc_chars) {
1402 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1404 case RC_USE_PERS_DICT:
1405 if (isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1406 os << "\\use_personal_dictionary "
1407 << tostr(isp_use_pers_dict)
1411 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1412 os << "\\personal_dictionary \"" << isp_pers_dict
1415 case RC_USE_INP_ENC:
1416 if (isp_use_input_encoding
1417 != system_lyxrc.isp_use_input_encoding) {
1418 os << "\\use_input_encoding "
1419 << tostr(isp_use_input_encoding)
1424 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1427 case RC_RTL_SUPPORT:
1428 if (rtl_support != system_lyxrc.rtl_support) {
1429 os << "\\rtl " << tostr(rtl_support) << "\n";
1431 case RC_LANGUAGE_PACKAGE:
1432 if (language_package != system_lyxrc.language_package) {
1433 os << "\\language_package \"" << language_package
1436 case RC_LANGUAGE_GLOBAL_OPTIONS:
1437 if (language_global_options
1438 != system_lyxrc.language_global_options) {
1439 os << "\\language_global_options \""
1440 << tostr(language_global_options)
1443 case RC_LANGUAGE_USE_BABEL:
1444 if (language_use_babel != system_lyxrc.language_use_babel) {
1445 os << "\\language_use_babel \""
1446 << tostr(language_use_babel)
1449 case RC_LANGUAGE_COMMAND_BEGIN:
1450 if (language_command_begin
1451 != system_lyxrc.language_command_begin) {
1452 os << "\\language_command_begin \""
1453 << language_command_begin
1456 case RC_LANGUAGE_COMMAND_END:
1457 if (language_command_end
1458 != system_lyxrc.language_command_end) {
1459 os << "\\language_command_end \"" << language_command_end
1462 case RC_LANGUAGE_COMMAND_LOCAL:
1463 if (language_command_local
1464 != system_lyxrc.language_command_local) {
1465 os << "\\language_command_local \""
1466 << language_command_local
1469 case RC_LANGUAGE_AUTO_BEGIN:
1470 if (language_auto_begin != system_lyxrc.language_auto_begin) {
1471 os << "\\language_auto_begin "
1472 << tostr(language_auto_begin) << "\n";
1474 case RC_LANGUAGE_AUTO_END:
1475 if (language_auto_end != system_lyxrc.language_auto_end) {
1476 os << "\\language_auto_end "
1477 << tostr(language_auto_end) << "\n";
1479 case RC_MARK_FOREIGN_LANGUAGE:
1480 if (mark_foreign_language
1481 != system_lyxrc.mark_foreign_language) {
1482 os << "\\mark_foreign_language " <<
1483 tostr(mark_foreign_language) << "\n";
1487 << "# 2nd MISC SUPPORT SECTION ##########################\n"
1490 case RC_OVERRIDE_X_DEADKEYS:
1491 if (override_x_deadkeys != system_lyxrc.override_x_deadkeys) {
1492 os << "\\override_x_deadkeys "
1493 << tostr(override_x_deadkeys) << "\n";
1495 case RC_SCREEN_FONT_ENCODING_MENU:
1496 if (font_norm_menu != system_lyxrc.font_norm_menu) {
1497 os << "\\screen_font_encoding_menu \"" << font_norm_menu
1500 case RC_AUTO_NUMBER:
1501 if (auto_number != system_lyxrc.auto_number) {
1502 os << "\\auto_number " << tostr(auto_number) << "\n";
1504 case RC_NEW_ASK_FILENAME:
1505 if (new_ask_filename != system_lyxrc.new_ask_filename) {
1506 os << "\\new_ask_filename " << tostr(new_ask_filename)
1509 case RC_DEFAULT_LANGUAGE:
1510 if (default_language != system_lyxrc.default_language) {
1511 os << "\\default_language " << default_language << "\n";
1515 << "# FORMATS SECTION ##########################\n"
1519 // Look for deleted formats
1520 for (Formats::const_iterator cit = formats.begin();
1521 cit != formats.end(); ++cit) {
1522 Format const * format =
1523 system_formats.GetFormat(cit->name());
1525 format->extension() != cit->extension() ||
1526 format->prettyname() != cit->prettyname() ||
1527 format->shortcut() != cit->shortcut())
1528 os << "\\format \"" << cit->name() << "\" \""
1529 << cit->extension() << "\" \""
1530 << cit->prettyname() << "\" \""
1531 << cit->shortcut() << "\"\n";
1534 // New/modifed formats
1535 for (Formats::const_iterator cit = system_formats.begin();
1536 cit != system_formats.end(); ++cit)
1537 if (!formats.GetFormat(cit->name()))
1538 os << "\\format \"" << cit->name()
1539 << "\" \"\" \"\" \"\"\n";
1541 for (Formats::const_iterator cit = formats.begin();
1542 cit != formats.end(); ++cit) {
1543 Format const * format =
1544 system_formats.GetFormat(cit->name());
1545 if ((!format || format->viewer() != cit->viewer()) &&
1546 (format || !cit->viewer().empty()))
1547 os << "\\viewer \"" << cit->name() << "\" \""
1548 << cit->viewer() << "\"\n";
1552 << "# CONVERTERS SECTION ##########################\n"
1556 // Look for new converters
1557 for (Converters::const_iterator cit = converters.begin();
1558 cit != converters.end(); ++cit) {
1559 Converter const * converter =
1560 system_converters.GetConverter(cit->from,
1563 converter->command != cit->command ||
1564 converter->flags != cit->flags)
1565 os << "\\converter \"" << cit->from << "\" \""
1566 << cit->to << "\" \""
1567 << cit->command << "\" \""
1568 << cit->flags << "\"\n";
1571 // New/modifed converters
1572 for (Converters::const_iterator cit = system_converters.begin();
1573 cit != system_converters.end(); ++cit)
1574 if (!converters.GetConverter(cit->from, cit->to))
1575 os << "\\converter \"" << cit->from
1576 << "\" \"" << cit->to << "\" \"\" \"\"\n";
1581 void LyXRC::set_font_norm_type()
1583 if (font_norm == "iso10646-1")
1584 font_norm_type = ISO_10646_1;
1585 else if (font_norm == "iso8859-1")
1586 font_norm_type = ISO_8859_1;
1587 else if (font_norm == "iso8859-6.8x")
1588 font_norm_type = ISO_8859_6_8;
1589 else if (font_norm == "iso8859-9")
1590 font_norm_type = ISO_8859_9;
1592 font_norm_type = OTHER_ENCODING;
1596 string const LyXRC::getDescription(LyXRCTags tag)
1601 case RC_FONT_ENCODING:
1602 str = N_("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
1606 str = N_("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
1609 case RC_PRINT_COMMAND:
1610 str = N_("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
1613 case RC_PRINTEVENPAGEFLAG:
1614 str = N_("The option to print only even pages.");
1617 case RC_PRINTODDPAGEFLAG:
1618 str = N_("The option to print only odd pages.");
1621 case RC_PRINTPAGERANGEFLAG:
1622 str = N_("The option for specifying a comma-separated list of pages to print.");
1625 case RC_PRINTCOPIESFLAG:
1626 str = N_("The option for specifying the number of copies to print.");
1629 case RC_PRINTCOLLCOPIESFLAG:
1630 str = N_("The option for specifying whether the copies should be collated.");
1633 case RC_PRINTREVERSEFLAG:
1634 str = N_("The option to reverse the order of the pages printed.");
1637 case RC_PRINTLANDSCAPEFLAG:
1638 str = N_("The option to print out in landscape.");
1641 case RC_PRINTPAPERFLAG:
1642 str = N_("The option to specify paper type.");
1645 case RC_PRINTPAPERDIMENSIONFLAG:
1646 str = N_("Option to specify the dimensions of the print paper.");
1649 case RC_PRINTTOPRINTER:
1650 str = N_("Option to pass to the print program to print on a specific printer.");
1653 case RC_PRINT_ADAPTOUTPUT:
1654 str = N_("Select for LyX to pass the name of the destination printer to your print command.");
1657 case RC_PRINTTOFILE:
1658 str = N_("Option to pass to the print program to print to a file.");
1661 case RC_PRINTFILEEXTENSION:
1662 str = N_("Extension of printer program output file. Usually \".ps\".");
1665 case RC_PRINTEXSTRAOPTIONS:
1666 str = N_("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
1669 case RC_PRINTSPOOL_COMMAND:
1670 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.");
1673 case RC_PRINTSPOOL_PRINTERPREFIX:
1674 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.");
1678 str = N_("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
1681 case RC_SCREEN_ZOOM:
1682 //xgettext:no-c-format
1683 str = N_("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
1686 case RC_SCREEN_FONT_SIZES:
1687 str = N_("The font sizes used for calculating the scaling of the screen fonts.");
1690 case RC_SCREEN_FONT_ROMAN:
1691 case RC_SCREEN_FONT_SANS:
1692 case RC_SCREEN_FONT_TYPEWRITER:
1693 str = N_("The screen fonts used to display the text while editing.");
1696 case RC_SCREEN_FONT_MENU:
1697 str = N_("The font for menus (and groups titles in popups).");
1700 case RC_SCREEN_FONT_POPUP:
1701 str = N_("The font for popups.");
1704 case RC_SCREEN_FONT_ENCODING:
1705 str = N_("The encoding for the screen fonts.");
1708 case RC_SCREEN_FONT_ENCODING_MENU:
1709 str = N_("The encoding for the menu/popups fonts.");
1716 str = N_("The time interval between auto-saves (in seconds). 0 means no auto-save.");
1719 case RC_DOCUMENTPATH:
1720 str = N_("The default path for your documents.");
1723 case RC_TEMPLATEPATH:
1724 str = N_("The path that LyX will set when offering to choose a template.");
1727 case RC_TEMPDIRPATH:
1728 str = N_("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
1732 str = N_("Select if you wish to use a temporary directory structure to store temporary TeX output.");
1736 str = N_("The file where the last-files information should be stored.");
1739 case RC_AUTOREGIONDELETE:
1740 str = N_("De-select if you don't want the current selection to be replaced automatically by what you type.");
1743 case RC_OVERRIDE_X_DEADKEYS:
1744 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.");
1749 str = N_("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
1753 str = N_("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
1757 str = N_("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
1761 case RC_KBMAP_PRIMARY:
1762 case RC_KBMAP_SECONDARY:
1763 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.");
1766 case RC_ASCIIROFF_COMMAND:
1767 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.");
1770 case RC_ASCII_LINELEN:
1771 str = N_("This is the maximum line length of an exported ASCII file (LaTeX, SGML or plain text).");
1774 case RC_NUMLASTFILES:
1775 str = N_("Maximal number of lastfiles. Up to 9 can appear in the file menu.");
1778 case RC_CHECKLASTFILES:
1779 str = N_("Select to check whether the lastfiles still exist.");
1782 case RC_VIEWDVI_PAPEROPTION:
1785 case RC_DEFAULT_PAPERSIZE:
1786 str = N_("Specify the default paper size.");
1792 case RC_ACCEPT_COMPOUND:
1793 str = N_("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
1796 case RC_SPELL_COMMAND:
1797 str = N_("What command runs the spell checker?");
1800 case RC_USE_INP_ENC:
1801 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.");
1804 case RC_USE_ALT_LANG:
1806 str = N_("Specify an alternate language. The default is to use the language of the document.");
1809 case RC_USE_PERS_DICT:
1811 str = N_("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
1814 case RC_USE_ESC_CHARS:
1816 str = N_("Specify additional chars that can be part of a word.");
1819 case RC_SCREEN_FONT_SCALABLE:
1820 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.");
1823 case RC_CHKTEX_COMMAND:
1824 str = N_("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
1827 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1828 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.");
1831 case RC_EXIT_CONFIRMATION:
1832 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.)");
1835 case RC_DISPLAY_SHORTCUTS:
1836 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.");
1839 case RC_MAKE_BACKUP:
1840 str = N_("De-select if you don't want LyX to create backup files.");
1843 case RC_BACKUPDIR_PATH:
1844 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.");
1847 case RC_RTL_SUPPORT:
1848 str = N_("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
1851 case RC_MARK_FOREIGN_LANGUAGE:
1852 str = N_("Select to control the highlighting of words with a language foreign to that of the document.");
1855 case RC_LANGUAGE_PACKAGE:
1856 str = N_("The latex command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
1859 case RC_LANGUAGE_GLOBAL_OPTIONS:
1860 str = N_("De-select if you don't want the language(s) used as an argument to \\documentclass.");
1863 case RC_LANGUAGE_USE_BABEL:
1864 str = N_("De-select if you don't want babel to be used when the language of the document is the default language.");
1867 case RC_LANGUAGE_AUTO_BEGIN:
1868 str = N_("Select if a language switching command is needed at the beginning of the document.");
1871 case RC_LANGUAGE_AUTO_END:
1872 str = N_("Select if a language switching command is needed at the end of the document.");
1875 case RC_LANGUAGE_COMMAND_BEGIN:
1876 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.");
1879 case RC_LANGUAGE_COMMAND_END:
1880 str = N_("The latex command for changing back to the language of the document.");
1883 case RC_LANGUAGE_COMMAND_LOCAL:
1884 str = N_("The latex command for local changing of the language.");
1887 case RC_DATE_INSERT_FORMAT:
1888 //xgettext:no-c-format
1889 str = N_("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
1892 case RC_SHOW_BANNER:
1893 str = N_("De-select if you don't want the startup banner.");
1897 str = N_("The wheel movement factor (for mice with wheels or five button mice).");
1909 case RC_NEW_ASK_FILENAME:
1910 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.");
1913 case RC_DEFAULT_LANGUAGE:
1914 str = N_("New documents will be assigned this language.");
1917 case RC_LABEL_INIT_LENGTH:
1918 str = N_("Maximum number of words in the initialization string for a new label");
1928 // The global instance
1931 // The global copy of the system lyxrc entries (everything except preferences)