1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2001 The LyX Team.
9 * ====================================================== */
14 #pragma implementation "lyxrc.h"
25 #include "LyXAction.h"
26 #include "lyxserver.h"
29 #include "tex-strings.h"
30 #include "support/path.h"
31 #include "support/filetools.h"
33 #include "converter.h"
43 extern LyXAction lyxaction;
44 extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
48 keyword_item lyxrcTags[] = {
49 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
50 { "\\alternate_language", LyXRC::RC_ALT_LANG },
51 { "\\ascii_linelen", LyXRC::RC_ASCII_LINELEN },
52 { "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
53 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
54 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
55 { "\\autosave", LyXRC::RC_AUTOSAVE },
56 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
57 { "\\bind", LyXRC::RC_BIND },
58 { "\\bind_file", LyXRC::RC_BINDFILE },
59 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
60 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
61 { "\\converter", LyXRC::RC_CONVERTER },
62 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
63 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
64 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
65 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
66 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
67 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
68 { "\\display_shortcuts", LyXRC::RC_DISPLAY_SHORTCUTS },
69 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
70 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
71 { "\\exit_confirmation", LyXRC::RC_EXIT_CONFIRMATION },
72 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
73 { "\\format", LyXRC::RC_FORMAT },
74 { "\\input", LyXRC::RC_INPUT },
75 { "\\kbmap", LyXRC::RC_KBMAP },
76 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
77 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
78 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
79 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
80 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
81 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
82 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
83 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
84 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
85 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
86 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
87 { "\\lastfiles", LyXRC::RC_LASTFILES },
88 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
89 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
90 { "\\new_ask_filename", LyXRC::RC_NEW_ASK_FILENAME },
91 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
92 { "\\override_x_deadkeys", LyXRC::RC_OVERRIDE_X_DEADKEYS },
93 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
94 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
95 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
96 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
97 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
98 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
99 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
100 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
101 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
102 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
103 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
104 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
105 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
106 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
107 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
108 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
109 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
110 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
111 { "\\printer", LyXRC::RC_PRINTER },
112 { "\\ps_command", LyXRC::RC_PS_COMMAND },
113 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
114 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
115 { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
116 { "\\screen_font_encoding_menu", LyXRC::RC_SCREEN_FONT_ENCODING_MENU },
117 { "\\screen_font_menu", LyXRC::RC_SCREEN_FONT_MENU },
118 { "\\screen_font_popup", LyXRC::RC_SCREEN_FONT_POPUP },
119 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
120 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
121 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
122 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
123 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
124 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
125 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
126 { "\\set_color", LyXRC::RC_SET_COLOR },
127 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
128 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
129 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
130 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
131 { "\\ui_file", LyXRC::RC_UIFILE },
132 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
133 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
134 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
135 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
137 { "\\use_pspell", LyXRC::RC_USE_PSPELL },
139 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
140 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
141 { "\\viewer" ,LyXRC::RC_VIEWER},
142 { "\\wheel_jump", LyXRC::RC_WHEEL_JUMP }
145 /* Let the range depend of the size of lyxrcTags. Alejandro 240596 */
146 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
157 void LyXRC::setDefaults() {
161 // Get printer from the environment. If fail, use default "",
162 // assuming that everything is set up correctly.
163 printer = GetEnv("PRINTER");
164 print_adapt_output = false;
165 print_command = "dvips";
166 print_evenpage_flag = "-B";
167 print_oddpage_flag = "-A";
168 print_pagerange_flag = "-pp";
169 print_copies_flag = "-c";
170 print_collcopies_flag = "-C";
171 print_reverse_flag = "-r";
172 print_landscape_flag = "-t landscape";
173 print_to_printer = "-P";
174 print_to_file = "-o ";
175 print_file_extension = ".ps";
176 print_paper_flag = "-t";
177 print_paper_dimension_flag = "-T";
178 document_path = GetEnvPath("HOME");
179 tempdir_path = "/tmp";
182 view_dvi_paper_option = "-paper";
183 default_papersize = BufferParams::PAPER_USLETTER;
184 custom_export_format = "ps";
185 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
188 // Because a screen typically is wider than a piece of paper:
191 // Default LaTeX font size:
192 font_sizes[LyXFont::SIZE_TINY] = 5.0;
193 font_sizes[LyXFont::SIZE_SCRIPT] = 7.0;
194 font_sizes[LyXFont::SIZE_FOOTNOTE] = 8.0;
195 font_sizes[LyXFont::SIZE_SMALL] = 9.0;
196 font_sizes[LyXFont::SIZE_NORMAL] = 10.0;
197 font_sizes[LyXFont::SIZE_LARGE] = 12.0;
198 font_sizes[LyXFont::SIZE_LARGER] = 14.4;
199 font_sizes[LyXFont::SIZE_LARGEST] = 17.26;
200 font_sizes[LyXFont::SIZE_HUGE] = 20.74;
201 font_sizes[LyXFont::SIZE_HUGER] = 24.88;
202 use_scalable_fonts = true;
203 roman_font_name = "-*-times";
204 sans_font_name = "-*-helvetica";
205 typewriter_font_name = "-*-courier";
206 menu_font_name = "-*-helvetica-bold-r";
207 popup_font_name = "-*-helvetica-medium-r";
208 font_norm = "iso8859-1";
209 font_norm_type = ISO_8859_1;
211 override_x_deadkeys = true;
213 auto_region_delete = true;
216 check_lastfiles = true;
219 exit_confirmation = true;
220 display_shortcuts = true;
221 // Spellchecker settings:
225 isp_command = "ispell";
226 isp_accept_compound = false;
227 isp_use_input_encoding = false;
228 isp_use_alt_lang = false;
229 isp_use_pers_dict = false;
230 isp_use_esc_chars = false;
234 mark_foreign_language = true;
235 language_auto_begin = true;
236 language_auto_end = true;
237 language_global_options = true;
238 language_use_babel = true;
239 language_package = "\\usepackage{babel}";
240 language_command_begin = "\\selectlanguage{$$lang}";
241 language_command_end = "\\selectlanguage{$$lang}";
242 language_command_local = "\\foreignlanguage{$$lang}{";
243 default_language = "english";
245 new_ask_filename = false;
248 date_insert_format = "%A, %e %B %Y";
250 cursor_follows_scrollbar = false;
251 label_init_length = 3;
253 /// These variables are not stored on disk (perhaps they
254 // should be moved from the LyXRC class).
260 int LyXRC::ReadBindFile(string const & name)
263 string const tmp = i18nLibFileSearch("bind", name, "bind");
264 lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
265 int const result = read(tmp);
267 lyxerr << "Error reading bind file: " << tmp << endl;
272 void LyXRC::readBindFileIfNeeded()
275 ReadBindFile(bind_file);
278 int LyXRC::read(string const & filename)
280 LyXLex lexrc(lyxrcTags, lyxrcCount);
281 if (lyxerr.debugging(Debug::PARSER))
282 lexrc.printTable(lyxerr);
284 lexrc.setFile(filename);
285 if (!lexrc.IsOK()) return -2;
287 lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
289 while (lexrc.IsOK()) {
290 // By using two switches we take advantage of the compiler
291 // telling us if we have missed a LyXRCTags element in
292 // the second switch.
293 // Note that this also shows a problem with LyXLex since it
294 // helps us avoid taking advantage of the strictness of the
297 int le = lexrc.lex();
299 case LyXLex::LEX_UNDEF:
300 lexrc.printError("Unknown tag `$$Token'");
302 case LyXLex::LEX_FEOF:
306 switch (static_cast<LyXRCTags>(le)) {
307 case RC_INPUT: // Include file
309 string tmp = LibFileSearch(string(),
312 lexrc.printError("Error reading "
313 "included file: "+tmp);
317 case RC_BINDFILE: // RVDK_PATCH_5
319 string tmp(lexrc.GetString());
321 // We are already in the
322 // "actually read bind file"
326 // We are still in the "just
327 // remember the name of the
335 ui_file = lexrc.GetString();
339 case RC_EXIT_CONFIRMATION:
341 exit_confirmation = lexrc.GetBool();
344 case RC_DISPLAY_SHORTCUTS:
346 display_shortcuts = lexrc.GetBool();
351 use_kbmap = lexrc.GetBool();
354 case RC_KBMAP_PRIMARY:
356 string kmap(lexrc.GetString());
359 } else if (!LibFileSearch("kbd", kmap,
361 primary_kbmap = kmap;
363 lexrc.printError("LyX: Keymap `$$Token' not found");
367 case RC_KBMAP_SECONDARY:
369 string kmap(lexrc.GetString());
372 } else if (!LibFileSearch("kbd", kmap,
374 secondary_kbmap = kmap;
376 lexrc.printError("LyX: Keymap `$$Token' not found");
380 case RC_FONT_ENCODING:
382 fontenc = lexrc.GetString();
387 printer = lexrc.GetString();
390 case RC_PRINT_COMMAND:
392 print_command = lexrc.GetString();
395 case RC_PRINTEVENPAGEFLAG:
397 print_evenpage_flag = lexrc.GetString();
400 case RC_PRINTODDPAGEFLAG:
402 print_oddpage_flag = lexrc.GetString();
405 case RC_PRINTPAGERANGEFLAG:
407 print_pagerange_flag = lexrc.GetString();
410 case RC_PRINTCOPIESFLAG:
412 print_copies_flag = lexrc.GetString();
415 case RC_PRINTCOLLCOPIESFLAG:
417 print_collcopies_flag = lexrc.GetString();
420 case RC_PRINTREVERSEFLAG:
422 print_reverse_flag = lexrc.GetString();
425 case RC_PRINTLANDSCAPEFLAG:
427 print_landscape_flag = lexrc.GetString();
430 case RC_PRINTTOPRINTER:
432 print_to_printer = lexrc.GetString();
435 case RC_PRINT_ADAPTOUTPUT:
437 print_adapt_output = lexrc.GetBool();
442 print_to_file = lexrc.GetString();
445 case RC_PRINTFILEEXTENSION:
447 print_file_extension = lexrc.GetString();
450 case RC_PRINTEXSTRAOPTIONS:
452 print_extra_options = lexrc.GetString();
455 case RC_PRINTSPOOL_COMMAND:
457 print_spool_command = lexrc.GetString();
460 case RC_PRINTSPOOL_PRINTERPREFIX:
462 print_spool_printerprefix = lexrc.GetString();
465 case RC_PRINTPAPERDIMENSIONFLAG:
467 print_paper_dimension_flag = lexrc.GetString();
470 case RC_PRINTPAPERFLAG:
472 print_paper_flag = lexrc.GetString();
475 case RC_CUSTOM_EXPORT_COMMAND:
477 custom_export_command = lexrc.GetString();
480 case RC_CUSTOM_EXPORT_FORMAT:
482 custom_export_format = lexrc.GetString();
485 case RC_DEFAULT_PAPERSIZE:
487 string size = lowercase(lexrc.GetString());
488 if (size == "usletter")
490 BufferParams::PAPER_USLETTER;
491 else if (size == "legal")
493 BufferParams::PAPER_LEGALPAPER;
494 else if (size == "executive")
496 BufferParams::PAPER_EXECUTIVEPAPER;
497 else if (size == "a3")
499 BufferParams::PAPER_A3PAPER;
500 else if (size == "a4")
502 BufferParams::PAPER_A4PAPER;
503 else if (size == "a5")
505 BufferParams::PAPER_A5PAPER;
506 else if (size == "b5")
508 BufferParams::PAPER_B5PAPER;
512 case RC_VIEWDVI_PAPEROPTION:
514 view_dvi_paper_option = lexrc.GetString();
516 view_dvi_paper_option = "";
521 ps_command = lexrc.GetString();
524 case RC_CHKTEX_COMMAND:
526 chktex_command = lexrc.GetString();
531 dpi = lexrc.GetInteger();
536 zoom = lexrc.GetInteger();
541 wheel_jump = lexrc.GetInteger();
544 case RC_SCREEN_FONT_SIZES:
546 font_sizes[LyXFont::SIZE_TINY] =
549 font_sizes[LyXFont::SIZE_SCRIPT] =
552 font_sizes[LyXFont::SIZE_FOOTNOTE] =
555 font_sizes[LyXFont::SIZE_SMALL] =
558 font_sizes[LyXFont::SIZE_NORMAL] =
561 font_sizes[LyXFont::SIZE_LARGE] =
564 font_sizes[LyXFont::SIZE_LARGER] =
567 font_sizes[LyXFont::SIZE_LARGEST] =
570 font_sizes[LyXFont::SIZE_HUGE] =
573 font_sizes[LyXFont::SIZE_HUGER] =
577 case RC_SCREEN_FONT_SCALABLE:
579 use_scalable_fonts = lexrc.GetBool();
584 autosave = lexrc.GetInteger();
587 case RC_DOCUMENTPATH:
589 document_path = ExpandPath(lexrc.GetString());
593 case RC_TEMPLATEPATH:
595 template_path = ExpandPath(lexrc.GetString());
600 tempdir_path = ExpandPath(lexrc.GetString());
605 use_tempdir = lexrc.GetBool();
610 lastfiles = ExpandPath(lexrc.GetString());
613 case RC_NUMLASTFILES:
615 num_lastfiles = lexrc.GetInteger();
618 case RC_CHECKLASTFILES:
620 check_lastfiles = lexrc.GetBool();
623 case RC_SCREEN_FONT_ROMAN:
625 roman_font_name = lexrc.GetString();
628 case RC_SCREEN_FONT_SANS:
630 sans_font_name = lexrc.GetString();
633 case RC_SCREEN_FONT_TYPEWRITER:
635 typewriter_font_name = lexrc.GetString();
638 case RC_SCREEN_FONT_MENU:
640 menu_font_name = lexrc.GetString();
643 case RC_SCREEN_FONT_POPUP:
645 popup_font_name = lexrc.GetString();
648 case RC_SCREEN_FONT_ENCODING:
650 font_norm = lexrc.GetString();
651 set_font_norm_type();
655 case RC_SCREEN_FONT_ENCODING_MENU:
657 font_norm_menu = lexrc.GetString();
662 string lyx_name, x11_name;
665 lyx_name = lexrc.GetString();
667 lexrc.printError("Missing color tag.");
672 x11_name = lexrc.GetString();
674 lexrc.printError("Missing color name for color : `$$Token'");
678 if (!lcolor.setColor(lyx_name, x11_name))
679 lyxerr << "Bad lyxrc set_color for "
684 case RC_AUTOREGIONDELETE:
685 // Auto region delete defaults to true
687 auto_region_delete = lexrc.GetBool();
692 // we should not do an explicit binding before
693 // loading a bind file. So, in this case, load
694 // the default bind file.
695 readBindFileIfNeeded();
697 // !!!chb, dynamic key binding...
702 seq = lexrc.GetString();
704 lexrc.printError("RC_BIND: Missing key sequence");
708 if (lexrc.next(true)) {
709 cmd = lexrc.GetString();
711 lexrc.printError("RC_BIND: missing command");
715 if ((action = lyxaction.LookupFunc(cmd))>= 0) {
716 if (lyxerr.debugging(Debug::LYXRC)) {
717 lyxerr << "RC_BIND: Sequence `"
718 << seq << "' Command `"
719 << cmd << "' Action `"
720 << action << '\'' << endl;
722 res = toplevel_keymap->bind(seq, action);
724 && lyxerr.debugging(Debug::LYXRC)) {
727 "Invalid key sequence `"
730 } else {// cmd is the last token read.
732 "Unknown LyX function `$$Token'");
736 case RC_OVERRIDE_X_DEADKEYS:
738 override_x_deadkeys = lexrc.GetBool();
743 lyxpipes = ExpandPath(lexrc.GetString());
746 case RC_CURSOR_FOLLOWS_SCROLLBAR:
748 cursor_follows_scrollbar = lexrc.GetBool();
751 case RC_ASCIIROFF_COMMAND:
753 ascii_roff_command = lexrc.GetString();
755 case RC_ASCII_LINELEN:
757 ascii_linelen = lexrc.GetInteger();
759 // Spellchecker settings:
763 use_pspell = lexrc.GetBool();
766 case RC_SPELL_COMMAND:
768 isp_command = lexrc.GetString();
770 case RC_ACCEPT_COMPOUND:
772 isp_accept_compound = lexrc.GetBool();
776 isp_use_input_encoding = lexrc.GetBool();
778 case RC_USE_ALT_LANG:
780 isp_use_alt_lang = lexrc.GetBool();
782 case RC_USE_PERS_DICT:
784 isp_use_pers_dict = lexrc.GetBool();
786 case RC_USE_ESC_CHARS:
788 isp_use_esc_chars = lexrc.GetBool();
792 isp_alt_lang = lexrc.GetString();
796 isp_pers_dict = lexrc.GetString();
800 isp_esc_chars = lexrc.GetString();
804 make_backup = lexrc.GetBool();
806 case RC_BACKUPDIR_PATH:
808 backupdir_path = ExpandPath(lexrc.GetString());
810 case RC_DATE_INSERT_FORMAT:
812 date_insert_format = lexrc.GetString();
814 case RC_LANGUAGE_PACKAGE:
816 language_package = lexrc.GetString();
818 case RC_LANGUAGE_AUTO_BEGIN:
820 language_auto_begin = lexrc.GetBool();
822 case RC_LANGUAGE_AUTO_END:
824 language_auto_end = lexrc.GetBool();
826 case RC_LANGUAGE_GLOBAL_OPTIONS:
828 language_global_options = lexrc.GetBool();
830 case RC_LANGUAGE_USE_BABEL:
832 language_use_babel = lexrc.GetBool();
834 case RC_LANGUAGE_COMMAND_BEGIN:
836 language_command_begin = lexrc.GetString();
838 case RC_LANGUAGE_COMMAND_END:
840 language_command_end = lexrc.GetString();
842 case RC_LANGUAGE_COMMAND_LOCAL:
844 language_command_local = lexrc.GetString();
848 rtl_support = lexrc.GetBool();
852 auto_number = lexrc.GetBool();
854 case RC_MARK_FOREIGN_LANGUAGE:
856 mark_foreign_language = lexrc.GetBool();
860 show_banner = lexrc.GetBool();
863 case RC_NEW_ASK_FILENAME:
865 new_ask_filename = lexrc.GetBool();
868 string from, to, command, flags;
870 from = lexrc.GetString();
872 to = lexrc.GetString();
874 command = lexrc.GetString();
876 flags = lexrc.GetString();
877 if (command.empty() || command == "none")
878 converters.erase(from, to);
880 converters.add(from, to, command, flags);
884 string format, command;
886 format = lexrc.GetString();
888 command = lexrc.GetString();
889 formats.setViewer(format, command);
893 string format, extension, prettyname, shortcut;
895 format = lexrc.GetString();
897 extension = lexrc.GetString();
899 prettyname = lexrc.GetString();
901 shortcut = lexrc.GetString();
902 if (prettyname.empty()) {
903 if (converters.formatIsUsed(format))
904 lyxerr << "Can't delete format "
907 formats.erase(format);
910 formats.add(format, extension, prettyname,
914 case RC_DEFAULT_LANGUAGE:
916 default_language = lexrc.GetString();
919 case RC_LABEL_INIT_LENGTH:
921 label_init_length = lexrc.GetInteger();
924 case RC_LAST: break; // this is just a dummy
928 /// Update converters data-structures
929 converters.update(formats);
930 converters.buildGraph();
936 void LyXRC::write(string const & filename) const
938 ofstream ofs(filename.c_str());
944 void LyXRC::print() const
946 if (lyxerr.debugging())
953 void LyXRC::output(ostream & os) const
955 os << "### This file is part of\n"
956 << "### ========================================================\n"
957 << "### LyX, The Document Processor\n"
959 << "### Copyright 1995 Matthias Ettrich\n"
960 << "### Copyright 1995-2001 The LyX Team.\n"
962 << "### ========================================================\n"
964 << "# This file is written by LyX, if you want to make your own\n"
965 << "# modifications you should do them from inside LyX and save\n"
968 // Why the switch you might ask. It is a trick to ensure that all
969 // the elements in the LyXRCTags enum is handled. As you can see
970 // there are no breaks at all. So it is just a huge fall-through.
971 // The nice thing is that we will get a warning from the compiler
972 // if we forget an element.
973 LyXRCTags tag = RC_LAST;
977 // input/include files are not done here
979 // bindings is not written to the preferences file.
981 if (bind_file != system_lyxrc.bind_file) {
982 os << "\\bind_file " << bind_file << "\n";
988 << "# MISC SECTION ######################################\n"
992 if (show_banner != system_lyxrc.show_banner) {
993 os << "# Set to false to inhibit the startup banner.\n"
994 << "\\show_banner " << tostr(show_banner) << "\n";
996 // bind files are not done here.
998 if (ui_file != system_lyxrc.ui_file) {
999 os << "\\ui_file \"" << ui_file << "\"\n";
1001 case RC_AUTOREGIONDELETE:
1002 if (auto_region_delete != system_lyxrc.auto_region_delete) {
1003 os << "# Set to false to inhibit automatic replacement of\n"
1004 << "# the current selection.\n"
1005 << "\\auto_region_delete " << tostr(auto_region_delete)
1009 if (autosave != system_lyxrc.autosave) {
1010 os << "# The time interval between auto-saves in seconds.\n"
1011 << "\\autosave " << autosave << "\n";
1013 case RC_EXIT_CONFIRMATION:
1014 if (exit_confirmation != system_lyxrc.exit_confirmation) {
1015 os << "# Ask for confirmation before exit if there are\n"
1016 << "# unsaved changed documents.\n"
1017 << "\\exit_confirmation " << tostr(exit_confirmation)
1020 case RC_DISPLAY_SHORTCUTS:
1021 if (display_shortcuts != system_lyxrc.display_shortcuts) {
1022 os << "# Display name of the last command executed,\n"
1023 << "# with a list of short-cuts in the minibuffer.\n"
1024 << "\\display_shortcuts " << tostr(display_shortcuts)
1027 case RC_VIEWDVI_PAPEROPTION:
1028 if (view_dvi_paper_option
1029 != system_lyxrc.view_dvi_paper_option) {
1030 os << "# Options used to specify paper size to the\n"
1031 << "# view_dvi_command\n"
1032 << "\\view_dvi_paper_option \""
1033 << view_dvi_paper_option << "\"\n";
1035 case RC_DEFAULT_PAPERSIZE:
1036 if (default_papersize != system_lyxrc.default_papersize) {
1037 os << "# The default papersize to use.\n"
1038 << "\\default_papersize \"";
1039 switch (default_papersize) {
1040 case BufferParams::PAPER_USLETTER:
1041 os << "usletter"; break;
1042 case BufferParams::PAPER_LEGALPAPER:
1043 os << "legal"; break;
1044 case BufferParams::PAPER_EXECUTIVEPAPER:
1045 os << "executive"; break;
1046 case BufferParams::PAPER_A3PAPER:
1048 case BufferParams::PAPER_A4PAPER:
1050 case BufferParams::PAPER_A5PAPER:
1052 case BufferParams::PAPER_B5PAPER:
1054 case BufferParams::PAPER_DEFAULT: break;
1059 if (ps_command != system_lyxrc.ps_command) {
1060 os << "# Program used for interpreting postscript.\n"
1061 << "\\ps_command \"" << ps_command << "\"\n";
1063 case RC_CHKTEX_COMMAND:
1064 if (chktex_command != system_lyxrc.chktex_command) {
1065 os << "\\chktex_command \"" << chktex_command << "\"\n";
1068 if (use_kbmap != system_lyxrc.use_kbmap) {
1069 os << "\\kbmap " << tostr(use_kbmap) << "\n";
1071 case RC_KBMAP_PRIMARY:
1072 if (primary_kbmap != system_lyxrc.primary_kbmap) {
1073 os << "\\kbmap_primary \"" << primary_kbmap << "\"\n";
1075 case RC_KBMAP_SECONDARY:
1076 if (secondary_kbmap != system_lyxrc.secondary_kbmap) {
1077 os << "\\kbmap_secondary \"" << secondary_kbmap
1081 if (lyxpipes != system_lyxrc.lyxpipes) {
1082 os << "\\serverpipe \"" << lyxpipes << "\"\n";
1084 case RC_DATE_INSERT_FORMAT:
1085 if (date_insert_format != system_lyxrc.date_insert_format) {
1086 os << "\\date_insert_format \"" << date_insert_format
1089 case RC_LABEL_INIT_LENGTH:
1090 if (label_init_length != system_lyxrc.label_init_length) {
1091 os << "\\label_init_length " << label_init_length
1096 << "# SCREEN & FONTS SECTION ############################\n"
1100 if (dpi != system_lyxrc.dpi) {
1101 os << "\\screen_dpi " << dpi << "\n";
1103 case RC_SCREEN_ZOOM:
1104 if (zoom != system_lyxrc.zoom) {
1105 os << "\\screen_zoom " << zoom << "\n";
1108 if (wheel_jump != system_lyxrc.wheel_jump) {
1109 os << "\\wheel_jump " << wheel_jump << "\n";
1111 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1112 if (cursor_follows_scrollbar
1113 != system_lyxrc.cursor_follows_scrollbar) {
1114 os << "\\cursor_follows_scrollbar "
1115 << tostr(cursor_follows_scrollbar) << "\n";
1117 case RC_SCREEN_FONT_ROMAN:
1118 if (roman_font_name != system_lyxrc.roman_font_name) {
1119 os << "\\screen_font_roman \"" << roman_font_name
1122 case RC_SCREEN_FONT_SANS:
1123 if (sans_font_name != system_lyxrc.sans_font_name) {
1124 os << "\\screen_font_sans \"" << sans_font_name
1127 case RC_SCREEN_FONT_TYPEWRITER:
1128 if (typewriter_font_name != system_lyxrc.typewriter_font_name) {
1129 os << "\\screen_font_typewriter \""
1130 << typewriter_font_name << "\"\n";
1132 case RC_SCREEN_FONT_SCALABLE:
1133 if (use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1134 os << "\\screen_font_scalable "
1135 << tostr(use_scalable_fonts)
1138 case RC_SCREEN_FONT_ENCODING:
1139 if (font_norm != system_lyxrc.font_norm) {
1140 os << "\\screen_font_encoding \"" << font_norm
1143 case RC_SCREEN_FONT_POPUP:
1144 if (popup_font_name != system_lyxrc.popup_font_name) {
1145 os << "\\screen_font_popup \"" << popup_font_name
1148 case RC_SCREEN_FONT_MENU:
1149 if (menu_font_name != system_lyxrc.menu_font_name) {
1150 os << "\\screen_font_menu \"" << menu_font_name
1153 case RC_SCREEN_FONT_SIZES:
1154 if (font_sizes[LyXFont::SIZE_TINY]
1155 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1156 font_sizes[LyXFont::SIZE_SCRIPT]
1157 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1158 font_sizes[LyXFont::SIZE_FOOTNOTE]
1159 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1160 font_sizes[LyXFont::SIZE_SMALL]
1161 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1162 font_sizes[LyXFont::SIZE_NORMAL]
1163 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1164 font_sizes[LyXFont::SIZE_LARGE]
1165 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1166 font_sizes[LyXFont::SIZE_LARGER]
1167 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1168 font_sizes[LyXFont::SIZE_LARGEST]
1169 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1170 font_sizes[LyXFont::SIZE_HUGE]
1171 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1172 font_sizes[LyXFont::SIZE_HUGER]
1173 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1174 os.setf(ios::fixed);
1176 os << "\\screen_font_sizes"
1177 << " " << font_sizes[LyXFont::SIZE_TINY]
1178 << " " << font_sizes[LyXFont::SIZE_SCRIPT]
1179 << " " << font_sizes[LyXFont::SIZE_FOOTNOTE]
1180 << " " << font_sizes[LyXFont::SIZE_SMALL]
1181 << " " << font_sizes[LyXFont::SIZE_NORMAL]
1182 << " " << font_sizes[LyXFont::SIZE_LARGE]
1183 << " " << font_sizes[LyXFont::SIZE_LARGER]
1184 << " " << font_sizes[LyXFont::SIZE_LARGEST]
1185 << " " << font_sizes[LyXFont::SIZE_HUGE]
1186 << " " << font_sizes[LyXFont::SIZE_HUGER]
1191 << "# COLOR SECTION ###################################\n"
1195 for (int i = 0; i < LColor::ignore; ++i ) {
1196 LColor::color lc = static_cast<LColor::color>(i);
1198 string const col(lcolor.getX11Name(lc));
1199 if (col != system_lcolor.getX11Name(lc)) {
1200 os << "\\set_color \""
1201 << lcolor.getLyXName(lc) << "\" \""
1207 << "# PRINTER SECTION ###################################\n"
1211 if (printer != system_lyxrc.printer) {
1212 os << "\\printer \"" << printer << "\"\n";
1214 case RC_PRINT_ADAPTOUTPUT:
1215 if (print_adapt_output != system_lyxrc.print_adapt_output) {
1216 os << "\\print_adapt_output "
1217 << tostr(print_adapt_output)
1220 case RC_PRINT_COMMAND:
1221 if (print_command != system_lyxrc.print_command) {
1222 os << "\\print_command \"" << print_command << "\"\n";
1224 case RC_PRINTEXSTRAOPTIONS:
1225 if (print_extra_options != system_lyxrc.print_extra_options) {
1226 os << "\\print_extra_options \"" << print_extra_options
1229 case RC_PRINTSPOOL_COMMAND:
1230 if (print_spool_command != system_lyxrc.print_spool_command) {
1231 os << "\\print_spool_command \"" << print_spool_command
1234 case RC_PRINTSPOOL_PRINTERPREFIX:
1235 if (print_spool_printerprefix
1236 != system_lyxrc.print_spool_printerprefix) {
1237 os << "\\print_spool_printerprefix \""
1238 << print_spool_printerprefix << "\"\n";
1240 case RC_PRINTEVENPAGEFLAG:
1241 if (print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1242 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1245 case RC_PRINTODDPAGEFLAG:
1246 if (print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1247 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1250 case RC_PRINTREVERSEFLAG:
1251 if (print_reverse_flag != system_lyxrc.print_reverse_flag) {
1252 os << "\\print_reverse_flag \"" << print_reverse_flag
1255 case RC_PRINTLANDSCAPEFLAG:
1256 if (print_landscape_flag != system_lyxrc.print_landscape_flag) {
1257 os << "\\print_landscape_flag \"" << print_landscape_flag
1260 case RC_PRINTPAGERANGEFLAG:
1261 if (print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1262 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1265 case RC_PRINTCOPIESFLAG:
1266 if (print_copies_flag != system_lyxrc.print_copies_flag) {
1267 os << "\\print_copies_flag \"" << print_copies_flag
1270 case RC_PRINTCOLLCOPIESFLAG:
1271 if (print_collcopies_flag
1272 != system_lyxrc.print_collcopies_flag) {
1273 os << "\\print_collcopies_flag \""
1274 << print_collcopies_flag
1277 case RC_PRINTPAPERFLAG:
1278 if (print_paper_flag != system_lyxrc.print_paper_flag) {
1279 os << "\\print_paper_flag \"" << print_paper_flag
1282 case RC_PRINTPAPERDIMENSIONFLAG:
1283 if (print_paper_dimension_flag
1284 != system_lyxrc.print_paper_dimension_flag) {
1285 os << "\\print_paper_dimension_flag \""
1286 << print_paper_dimension_flag << "\"\n";
1288 case RC_PRINTTOPRINTER:
1289 if (print_to_printer != system_lyxrc.print_to_printer) {
1290 os << "\\print_to_printer \"" << print_to_printer
1293 case RC_PRINTTOFILE:
1294 if (print_to_file != system_lyxrc.print_to_file) {
1295 os << "\\print_to_file \"" << print_to_file << "\"\n";
1297 case RC_PRINTFILEEXTENSION:
1298 if (print_file_extension != system_lyxrc.print_file_extension) {
1299 os << "\\print_file_extension \""
1300 << print_file_extension
1305 << "# EXPORT SECTION ####################################\n"
1308 case RC_CUSTOM_EXPORT_COMMAND:
1309 if (custom_export_command
1310 != system_lyxrc.custom_export_command) {
1311 os << "\\custom_export_command \""
1312 << custom_export_command
1315 case RC_CUSTOM_EXPORT_FORMAT:
1316 if (custom_export_format
1317 != system_lyxrc.custom_export_format) {
1318 os << "\\custom_export_format \"" << custom_export_format
1323 << "# TEX SECTION #######################################\n"
1326 case RC_FONT_ENCODING:
1327 if (fontenc != system_lyxrc.fontenc) {
1328 os << "\\font_encoding \"" << fontenc << "\"\n";
1332 << "# FILE SECTION ######################################\n"
1335 case RC_DOCUMENTPATH:
1336 if (document_path != system_lyxrc.document_path) {
1337 os << "\\document_path \"" << document_path << "\"\n";
1340 if (lastfiles != system_lyxrc.lastfiles) {
1341 os << "\\lastfiles \"" << lastfiles << "\"\n";
1343 case RC_NUMLASTFILES:
1344 if (num_lastfiles != system_lyxrc.num_lastfiles) {
1345 os << "\\num_lastfiles " << num_lastfiles << "\n";
1347 case RC_CHECKLASTFILES:
1348 if (check_lastfiles != system_lyxrc.check_lastfiles) {
1349 os << "\\check_lastfiles " << tostr(check_lastfiles)
1352 case RC_TEMPLATEPATH:
1353 if (template_path != system_lyxrc.template_path) {
1354 os << "\\template_path \"" << template_path << "\"\n";
1356 case RC_TEMPDIRPATH:
1357 if (tempdir_path != system_lyxrc.tempdir_path) {
1358 os << "\\tempdir_path \"" << tempdir_path << "\"\n";
1361 if (use_tempdir != system_lyxrc.use_tempdir) {
1362 os << "\\use_tempdir " << tostr(use_tempdir) << "\n";
1364 case RC_ASCII_LINELEN:
1365 if (ascii_linelen != system_lyxrc.ascii_linelen) {
1366 os << "\\ascii_linelen " << ascii_linelen << "\n";
1368 case RC_MAKE_BACKUP:
1369 if (make_backup != system_lyxrc.make_backup) {
1370 os << "\\make_backup " << tostr(make_backup) << "\n";
1372 case RC_BACKUPDIR_PATH:
1373 if (backupdir_path != system_lyxrc.backupdir_path) {
1374 os << "\\backupdir_path \"" << backupdir_path << "\"\n";
1378 << "# ASCII EXPORT SECTION ##############################\n"
1381 case RC_ASCIIROFF_COMMAND:
1382 if (ascii_roff_command != system_lyxrc.ascii_roff_command) {
1383 os << "\\ascii_roff_command \"" << ascii_roff_command
1388 << "# SPELLCHECKER SECTION ##############################\n"
1392 if (use_pspell != system_lyxrc.use_pspell) {
1393 os << "\\use_pspell \"" << use_pspell << "\"\n";
1396 case RC_SPELL_COMMAND:
1397 if (isp_command != system_lyxrc.isp_command) {
1398 os << "\\spell_command \"" << isp_command << "\"\n";
1400 case RC_ACCEPT_COMPOUND:
1401 if (isp_accept_compound != system_lyxrc.isp_accept_compound) {
1402 os << "\\accept_compound " << tostr(isp_accept_compound)
1405 case RC_USE_ALT_LANG:
1406 if (isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1407 os << "\\use_alt_language " << tostr(isp_use_alt_lang)
1411 if (isp_alt_lang != system_lyxrc.isp_alt_lang) {
1412 os << "\\alternate_language \"" << isp_alt_lang
1415 case RC_USE_ESC_CHARS:
1416 if (isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1417 os << "\\use_escape_chars " << tostr(isp_use_esc_chars)
1421 if (isp_esc_chars != system_lyxrc.isp_esc_chars) {
1422 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1424 case RC_USE_PERS_DICT:
1425 if (isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1426 os << "\\use_personal_dictionary "
1427 << tostr(isp_use_pers_dict)
1431 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1432 os << "\\personal_dictionary \"" << isp_pers_dict
1435 case RC_USE_INP_ENC:
1436 if (isp_use_input_encoding
1437 != system_lyxrc.isp_use_input_encoding) {
1438 os << "\\use_input_encoding "
1439 << tostr(isp_use_input_encoding)
1444 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1447 case RC_RTL_SUPPORT:
1448 if (rtl_support != system_lyxrc.rtl_support) {
1449 os << "\\rtl " << tostr(rtl_support) << "\n";
1451 case RC_LANGUAGE_PACKAGE:
1452 if (language_package != system_lyxrc.language_package) {
1453 os << "\\language_package \"" << language_package
1456 case RC_LANGUAGE_GLOBAL_OPTIONS:
1457 if (language_global_options
1458 != system_lyxrc.language_global_options) {
1459 os << "\\language_global_options \""
1460 << tostr(language_global_options)
1463 case RC_LANGUAGE_USE_BABEL:
1464 if (language_use_babel != system_lyxrc.language_use_babel) {
1465 os << "\\language_use_babel \""
1466 << tostr(language_use_babel)
1469 case RC_LANGUAGE_COMMAND_BEGIN:
1470 if (language_command_begin
1471 != system_lyxrc.language_command_begin) {
1472 os << "\\language_command_begin \""
1473 << language_command_begin
1476 case RC_LANGUAGE_COMMAND_END:
1477 if (language_command_end
1478 != system_lyxrc.language_command_end) {
1479 os << "\\language_command_end \"" << language_command_end
1482 case RC_LANGUAGE_COMMAND_LOCAL:
1483 if (language_command_local
1484 != system_lyxrc.language_command_local) {
1485 os << "\\language_command_local \""
1486 << language_command_local
1489 case RC_LANGUAGE_AUTO_BEGIN:
1490 if (language_auto_begin != system_lyxrc.language_auto_begin) {
1491 os << "\\language_auto_begin "
1492 << tostr(language_auto_begin) << "\n";
1494 case RC_LANGUAGE_AUTO_END:
1495 if (language_auto_end != system_lyxrc.language_auto_end) {
1496 os << "\\language_auto_end "
1497 << tostr(language_auto_end) << "\n";
1499 case RC_MARK_FOREIGN_LANGUAGE:
1500 if (mark_foreign_language
1501 != system_lyxrc.mark_foreign_language) {
1502 os << "\\mark_foreign_language " <<
1503 tostr(mark_foreign_language) << "\n";
1507 << "# 2nd MISC SUPPORT SECTION ##########################\n"
1510 case RC_OVERRIDE_X_DEADKEYS:
1511 if (override_x_deadkeys != system_lyxrc.override_x_deadkeys) {
1512 os << "\\override_x_deadkeys "
1513 << tostr(override_x_deadkeys) << "\n";
1515 case RC_SCREEN_FONT_ENCODING_MENU:
1516 if (font_norm_menu != system_lyxrc.font_norm_menu) {
1517 os << "\\screen_font_encoding_menu \"" << font_norm_menu
1520 case RC_AUTO_NUMBER:
1521 if (auto_number != system_lyxrc.auto_number) {
1522 os << "\\auto_number " << tostr(auto_number) << "\n";
1524 case RC_NEW_ASK_FILENAME:
1525 if (new_ask_filename != system_lyxrc.new_ask_filename) {
1526 os << "\\new_ask_filename " << tostr(new_ask_filename)
1529 case RC_DEFAULT_LANGUAGE:
1530 if (default_language != system_lyxrc.default_language) {
1531 os << "\\default_language " << default_language << "\n";
1535 << "# FORMATS SECTION ##########################\n"
1539 // Look for deleted formats
1540 for (Formats::const_iterator cit = formats.begin();
1541 cit != formats.end(); ++cit) {
1542 Format const * format =
1543 system_formats.getFormat(cit->name());
1545 format->extension() != cit->extension() ||
1546 format->prettyname() != cit->prettyname() ||
1547 format->shortcut() != cit->shortcut())
1548 os << "\\format \"" << cit->name() << "\" \""
1549 << cit->extension() << "\" \""
1550 << cit->prettyname() << "\" \""
1551 << cit->shortcut() << "\"\n";
1554 // New/modifed formats
1555 for (Formats::const_iterator cit = system_formats.begin();
1556 cit != system_formats.end(); ++cit)
1557 if (!formats.getFormat(cit->name()))
1558 os << "\\format \"" << cit->name()
1559 << "\" \"\" \"\" \"\"\n";
1561 for (Formats::const_iterator cit = formats.begin();
1562 cit != formats.end(); ++cit) {
1563 Format const * format =
1564 system_formats.getFormat(cit->name());
1565 if ((!format || format->viewer() != cit->viewer()) &&
1566 (format || !cit->viewer().empty()))
1567 os << "\\viewer \"" << cit->name() << "\" \""
1568 << cit->viewer() << "\"\n";
1572 << "# CONVERTERS SECTION ##########################\n"
1576 // Look for new converters
1577 for (Converters::const_iterator cit = converters.begin();
1578 cit != converters.end(); ++cit) {
1579 Converter const * converter =
1580 system_converters.getConverter(cit->from,
1583 converter->command != cit->command ||
1584 converter->flags != cit->flags)
1585 os << "\\converter \"" << cit->from << "\" \""
1586 << cit->to << "\" \""
1587 << cit->command << "\" \""
1588 << cit->flags << "\"\n";
1591 // New/modifed converters
1592 for (Converters::const_iterator cit = system_converters.begin();
1593 cit != system_converters.end(); ++cit)
1594 if (!converters.getConverter(cit->from, cit->to))
1595 os << "\\converter \"" << cit->from
1596 << "\" \"" << cit->to << "\" \"\" \"\"\n";
1601 void LyXRC::set_font_norm_type()
1603 if (font_norm == "iso10646-1")
1604 font_norm_type = ISO_10646_1;
1605 else if (font_norm == "iso8859-1")
1606 font_norm_type = ISO_8859_1;
1607 else if (font_norm == "iso8859-6.8x")
1608 font_norm_type = ISO_8859_6_8;
1609 else if (font_norm == "iso8859-9")
1610 font_norm_type = ISO_8859_9;
1611 else if (font_norm == "iso8859-15")
1612 font_norm_type = ISO_8859_15;
1614 font_norm_type = OTHER_ENCODING;
1618 string const LyXRC::getDescription(LyXRCTags tag)
1623 case RC_FONT_ENCODING:
1624 str = N_("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
1628 str = N_("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
1631 case RC_PRINT_COMMAND:
1632 str = N_("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
1635 case RC_PRINTEVENPAGEFLAG:
1636 str = N_("The option to print only even pages.");
1639 case RC_PRINTODDPAGEFLAG:
1640 str = N_("The option to print only odd pages.");
1643 case RC_PRINTPAGERANGEFLAG:
1644 str = N_("The option for specifying a comma-separated list of pages to print.");
1647 case RC_PRINTCOPIESFLAG:
1648 str = N_("The option for specifying the number of copies to print.");
1651 case RC_PRINTCOLLCOPIESFLAG:
1652 str = N_("The option for specifying whether the copies should be collated.");
1655 case RC_PRINTREVERSEFLAG:
1656 str = N_("The option to reverse the order of the pages printed.");
1659 case RC_PRINTLANDSCAPEFLAG:
1660 str = N_("The option to print out in landscape.");
1663 case RC_PRINTPAPERFLAG:
1664 str = N_("The option to specify paper type.");
1667 case RC_PRINTPAPERDIMENSIONFLAG:
1668 str = N_("Option to specify the dimensions of the print paper.");
1671 case RC_PRINTTOPRINTER:
1672 str = N_("Option to pass to the print program to print on a specific printer.");
1675 case RC_PRINT_ADAPTOUTPUT:
1676 str = N_("Select for LyX to pass the name of the destination printer to your print command.");
1679 case RC_PRINTTOFILE:
1680 str = N_("Option to pass to the print program to print to a file.");
1683 case RC_PRINTFILEEXTENSION:
1684 str = N_("Extension of printer program output file. Usually \".ps\".");
1687 case RC_PRINTEXSTRAOPTIONS:
1688 str = N_("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
1691 case RC_PRINTSPOOL_COMMAND:
1692 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.");
1695 case RC_PRINTSPOOL_PRINTERPREFIX:
1696 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.");
1700 str = N_("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
1703 case RC_SCREEN_ZOOM:
1704 //xgettext:no-c-format
1705 str = N_("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
1708 case RC_SCREEN_FONT_SIZES:
1709 str = N_("The font sizes used for calculating the scaling of the screen fonts.");
1712 case RC_SCREEN_FONT_ROMAN:
1713 case RC_SCREEN_FONT_SANS:
1714 case RC_SCREEN_FONT_TYPEWRITER:
1715 str = N_("The screen fonts used to display the text while editing.");
1718 case RC_SCREEN_FONT_MENU:
1719 str = N_("The font for menus (and groups titles in popups).");
1722 case RC_SCREEN_FONT_POPUP:
1723 str = N_("The font for popups.");
1726 case RC_SCREEN_FONT_ENCODING:
1727 str = N_("The encoding for the screen fonts.");
1730 case RC_SCREEN_FONT_ENCODING_MENU:
1731 str = N_("The encoding for the menu/popups fonts.");
1738 str = N_("The time interval between auto-saves (in seconds). 0 means no auto-save.");
1741 case RC_DOCUMENTPATH:
1742 str = N_("The default path for your documents.");
1745 case RC_TEMPLATEPATH:
1746 str = N_("The path that LyX will set when offering to choose a template.");
1749 case RC_TEMPDIRPATH:
1750 str = N_("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
1754 str = N_("Select if you wish to use a temporary directory structure to store temporary TeX output.");
1758 str = N_("The file where the last-files information should be stored.");
1761 case RC_AUTOREGIONDELETE:
1762 str = N_("De-select if you don't want the current selection to be replaced automatically by what you type.");
1765 case RC_OVERRIDE_X_DEADKEYS:
1766 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.");
1771 str = N_("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
1775 str = N_("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
1779 str = N_("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
1783 case RC_KBMAP_PRIMARY:
1784 case RC_KBMAP_SECONDARY:
1785 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.");
1788 case RC_ASCIIROFF_COMMAND:
1789 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.");
1792 case RC_ASCII_LINELEN:
1793 str = N_("This is the maximum line length of an exported ASCII file (LaTeX, SGML or plain text).");
1796 case RC_NUMLASTFILES:
1797 str = N_("Maximal number of lastfiles. Up to 9 can appear in the file menu.");
1800 case RC_CHECKLASTFILES:
1801 str = N_("Select to check whether the lastfiles still exist.");
1804 case RC_VIEWDVI_PAPEROPTION:
1807 case RC_DEFAULT_PAPERSIZE:
1808 str = N_("Specify the default paper size.");
1814 case RC_ACCEPT_COMPOUND:
1815 str = N_("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
1818 case RC_SPELL_COMMAND:
1819 str = N_("What command runs the spell checker?");
1822 case RC_USE_INP_ENC:
1823 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.");
1826 case RC_USE_ALT_LANG:
1828 str = N_("Specify an alternate language. The default is to use the language of the document.");
1831 case RC_USE_PERS_DICT:
1833 str = N_("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
1836 case RC_USE_ESC_CHARS:
1838 str = N_("Specify additional chars that can be part of a word.");
1841 case RC_SCREEN_FONT_SCALABLE:
1842 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.");
1845 case RC_CHKTEX_COMMAND:
1846 str = N_("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
1849 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1850 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.");
1853 case RC_EXIT_CONFIRMATION:
1854 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.)");
1857 case RC_DISPLAY_SHORTCUTS:
1858 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.");
1861 case RC_MAKE_BACKUP:
1862 str = N_("De-select if you don't want LyX to create backup files.");
1865 case RC_BACKUPDIR_PATH:
1866 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.");
1869 case RC_RTL_SUPPORT:
1870 str = N_("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
1873 case RC_MARK_FOREIGN_LANGUAGE:
1874 str = N_("Select to control the highlighting of words with a language foreign to that of the document.");
1877 case RC_LANGUAGE_PACKAGE:
1878 str = N_("The latex command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
1881 case RC_LANGUAGE_GLOBAL_OPTIONS:
1882 str = N_("De-select if you don't want the language(s) used as an argument to \\documentclass.");
1885 case RC_LANGUAGE_USE_BABEL:
1886 str = N_("De-select if you don't want babel to be used when the language of the document is the default language.");
1889 case RC_LANGUAGE_AUTO_BEGIN:
1890 str = N_("Select if a language switching command is needed at the beginning of the document.");
1893 case RC_LANGUAGE_AUTO_END:
1894 str = N_("Select if a language switching command is needed at the end of the document.");
1897 case RC_LANGUAGE_COMMAND_BEGIN:
1898 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.");
1901 case RC_LANGUAGE_COMMAND_END:
1902 str = N_("The latex command for changing back to the language of the document.");
1905 case RC_LANGUAGE_COMMAND_LOCAL:
1906 str = N_("The latex command for local changing of the language.");
1909 case RC_DATE_INSERT_FORMAT:
1910 //xgettext:no-c-format
1911 str = N_("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
1914 case RC_SHOW_BANNER:
1915 str = N_("De-select if you don't want the startup banner.");
1919 str = N_("The wheel movement factor (for mice with wheels or five button mice).");
1931 case RC_NEW_ASK_FILENAME:
1932 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.");
1935 case RC_DEFAULT_LANGUAGE:
1936 str = N_("New documents will be assigned this language.");
1939 case RC_LABEL_INIT_LENGTH:
1940 str = N_("Maximum number of words in the initialization string for a new label");
1950 // The global instance
1953 // The global copy of the system lyxrc entries (everything except preferences)