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 = "";
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);
279 int LyXRC::read(string const & filename)
281 LyXLex lexrc(lyxrcTags, lyxrcCount);
282 if (lyxerr.debugging(Debug::PARSER))
283 lexrc.printTable(lyxerr);
285 lexrc.setFile(filename);
286 if (!lexrc.isOK()) return -2;
288 lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
290 while (lexrc.isOK()) {
291 // By using two switches we take advantage of the compiler
292 // telling us if we have missed a LyXRCTags element in
293 // the second switch.
294 // Note that this also shows a problem with LyXLex since it
295 // helps us avoid taking advantage of the strictness of the
298 int le = lexrc.lex();
300 case LyXLex::LEX_UNDEF:
301 lexrc.printError("Unknown tag `$$Token'");
303 case LyXLex::LEX_FEOF:
307 switch (static_cast<LyXRCTags>(le)) {
308 case RC_INPUT: // Include file
311 LibFileSearch(string(),
314 lexrc.printError("Error reading "
315 "included file: "+tmp);
319 case RC_BINDFILE: // RVDK_PATCH_5
321 string const tmp(lexrc.getString());
323 // We are already in the
324 // "actually read bind file"
328 // We are still in the "just
329 // remember the name of the
337 ui_file = lexrc.getString();
341 case RC_EXIT_CONFIRMATION:
343 exit_confirmation = lexrc.getBool();
346 case RC_DISPLAY_SHORTCUTS:
348 display_shortcuts = lexrc.getBool();
353 use_kbmap = lexrc.getBool();
356 case RC_KBMAP_PRIMARY:
358 string const kmap(lexrc.getString());
361 } else if (!LibFileSearch("kbd", kmap,
363 primary_kbmap = kmap;
365 lexrc.printError("LyX: Keymap `$$Token' not found");
369 case RC_KBMAP_SECONDARY:
371 string const kmap(lexrc.getString());
374 } else if (!LibFileSearch("kbd", kmap,
376 secondary_kbmap = kmap;
378 lexrc.printError("LyX: Keymap `$$Token' not found");
382 case RC_FONT_ENCODING:
384 fontenc = lexrc.getString();
389 printer = lexrc.getString();
392 case RC_PRINT_COMMAND:
394 print_command = lexrc.getString();
397 case RC_PRINTEVENPAGEFLAG:
399 print_evenpage_flag = lexrc.getString();
402 case RC_PRINTODDPAGEFLAG:
404 print_oddpage_flag = lexrc.getString();
407 case RC_PRINTPAGERANGEFLAG:
409 print_pagerange_flag = lexrc.getString();
412 case RC_PRINTCOPIESFLAG:
414 print_copies_flag = lexrc.getString();
417 case RC_PRINTCOLLCOPIESFLAG:
419 print_collcopies_flag = lexrc.getString();
422 case RC_PRINTREVERSEFLAG:
424 print_reverse_flag = lexrc.getString();
427 case RC_PRINTLANDSCAPEFLAG:
429 print_landscape_flag = lexrc.getString();
432 case RC_PRINTTOPRINTER:
434 print_to_printer = lexrc.getString();
437 case RC_PRINT_ADAPTOUTPUT:
439 print_adapt_output = lexrc.getBool();
444 print_to_file = lexrc.getString();
447 case RC_PRINTFILEEXTENSION:
449 print_file_extension = lexrc.getString();
452 case RC_PRINTEXSTRAOPTIONS:
454 print_extra_options = lexrc.getString();
457 case RC_PRINTSPOOL_COMMAND:
459 print_spool_command = lexrc.getString();
462 case RC_PRINTSPOOL_PRINTERPREFIX:
464 print_spool_printerprefix = lexrc.getString();
467 case RC_PRINTPAPERDIMENSIONFLAG:
469 print_paper_dimension_flag = lexrc.getString();
472 case RC_PRINTPAPERFLAG:
474 print_paper_flag = lexrc.getString();
477 case RC_CUSTOM_EXPORT_COMMAND:
479 custom_export_command = lexrc.getString();
482 case RC_CUSTOM_EXPORT_FORMAT:
484 custom_export_format = lexrc.getString();
487 case RC_DEFAULT_PAPERSIZE:
490 lowercase(lexrc.getString());
491 if (size == "usletter")
493 BufferParams::PAPER_USLETTER;
494 else if (size == "legal")
496 BufferParams::PAPER_LEGALPAPER;
497 else if (size == "executive")
499 BufferParams::PAPER_EXECUTIVEPAPER;
500 else if (size == "a3")
502 BufferParams::PAPER_A3PAPER;
503 else if (size == "a4")
505 BufferParams::PAPER_A4PAPER;
506 else if (size == "a5")
508 BufferParams::PAPER_A5PAPER;
509 else if (size == "b5")
511 BufferParams::PAPER_B5PAPER;
515 case RC_VIEWDVI_PAPEROPTION:
517 view_dvi_paper_option = lexrc.getString();
519 view_dvi_paper_option = "";
524 ps_command = lexrc.getString();
527 case RC_CHKTEX_COMMAND:
529 chktex_command = lexrc.getString();
534 dpi = lexrc.getInteger();
539 zoom = lexrc.getInteger();
544 wheel_jump = lexrc.getInteger();
547 case RC_SCREEN_FONT_SIZES:
549 font_sizes[LyXFont::SIZE_TINY] =
552 font_sizes[LyXFont::SIZE_SCRIPT] =
555 font_sizes[LyXFont::SIZE_FOOTNOTE] =
558 font_sizes[LyXFont::SIZE_SMALL] =
561 font_sizes[LyXFont::SIZE_NORMAL] =
564 font_sizes[LyXFont::SIZE_LARGE] =
567 font_sizes[LyXFont::SIZE_LARGER] =
570 font_sizes[LyXFont::SIZE_LARGEST] =
573 font_sizes[LyXFont::SIZE_HUGE] =
576 font_sizes[LyXFont::SIZE_HUGER] =
580 case RC_SCREEN_FONT_SCALABLE:
582 use_scalable_fonts = lexrc.getBool();
587 autosave = lexrc.getInteger();
590 case RC_DOCUMENTPATH:
592 document_path = ExpandPath(lexrc.getString());
596 case RC_TEMPLATEPATH:
598 template_path = ExpandPath(lexrc.getString());
603 tempdir_path = ExpandPath(lexrc.getString());
608 use_tempdir = lexrc.getBool();
613 lastfiles = ExpandPath(lexrc.getString());
616 case RC_NUMLASTFILES:
618 num_lastfiles = lexrc.getInteger();
621 case RC_CHECKLASTFILES:
623 check_lastfiles = lexrc.getBool();
626 case RC_SCREEN_FONT_ROMAN:
628 roman_font_name = lexrc.getString();
631 case RC_SCREEN_FONT_SANS:
633 sans_font_name = lexrc.getString();
636 case RC_SCREEN_FONT_TYPEWRITER:
638 typewriter_font_name = lexrc.getString();
641 case RC_SCREEN_FONT_MENU:
643 menu_font_name = lexrc.getString();
646 case RC_SCREEN_FONT_POPUP:
648 popup_font_name = lexrc.getString();
651 case RC_SCREEN_FONT_ENCODING:
653 font_norm = lexrc.getString();
654 set_font_norm_type();
658 case RC_SCREEN_FONT_ENCODING_MENU:
660 font_norm_menu = lexrc.getString();
665 string lyx_name, x11_name;
668 lyx_name = lexrc.getString();
670 lexrc.printError("Missing color tag.");
675 x11_name = lexrc.getString();
677 lexrc.printError("Missing color name for color : `$$Token'");
681 if (!lcolor.setColor(lyx_name, x11_name))
682 lyxerr << "Bad lyxrc set_color for "
687 case RC_AUTOREGIONDELETE:
688 // Auto region delete defaults to true
690 auto_region_delete = lexrc.getBool();
695 // we should not do an explicit binding before
696 // loading a bind file. So, in this case, load
697 // the default bind file.
698 readBindFileIfNeeded();
700 // !!!chb, dynamic key binding...
705 seq = lexrc.getString();
707 lexrc.printError("RC_BIND: Missing key sequence");
711 if (lexrc.next(true)) {
712 cmd = lexrc.getString();
714 lexrc.printError("RC_BIND: missing command");
718 if ((action = lyxaction.LookupFunc(cmd))>= 0) {
719 if (lyxerr.debugging(Debug::LYXRC)) {
720 lyxerr << "RC_BIND: Sequence `"
721 << seq << "' Command `"
722 << cmd << "' Action `"
723 << action << '\'' << endl;
725 res = toplevel_keymap->bind(seq, action);
727 && lyxerr.debugging(Debug::LYXRC)) {
730 "Invalid key sequence `"
733 } else {// cmd is the last token read.
735 "Unknown LyX function `$$Token'");
739 case RC_OVERRIDE_X_DEADKEYS:
741 override_x_deadkeys = lexrc.getBool();
746 lyxpipes = ExpandPath(lexrc.getString());
749 case RC_CURSOR_FOLLOWS_SCROLLBAR:
751 cursor_follows_scrollbar = lexrc.getBool();
754 case RC_ASCIIROFF_COMMAND:
756 ascii_roff_command = lexrc.getString();
758 case RC_ASCII_LINELEN:
760 ascii_linelen = lexrc.getInteger();
762 // Spellchecker settings:
766 use_pspell = lexrc.getBool();
769 case RC_SPELL_COMMAND:
771 isp_command = lexrc.getString();
773 case RC_ACCEPT_COMPOUND:
775 isp_accept_compound = lexrc.getBool();
779 isp_use_input_encoding = lexrc.getBool();
781 case RC_USE_ALT_LANG:
783 isp_use_alt_lang = lexrc.getBool();
785 case RC_USE_PERS_DICT:
787 isp_use_pers_dict = lexrc.getBool();
789 case RC_USE_ESC_CHARS:
791 isp_use_esc_chars = lexrc.getBool();
795 isp_alt_lang = lexrc.getString();
799 isp_pers_dict = lexrc.getString();
803 isp_esc_chars = lexrc.getString();
807 make_backup = lexrc.getBool();
809 case RC_BACKUPDIR_PATH:
811 backupdir_path = ExpandPath(lexrc.getString());
813 case RC_DATE_INSERT_FORMAT:
815 date_insert_format = lexrc.getString();
817 case RC_LANGUAGE_PACKAGE:
819 language_package = lexrc.getString();
821 case RC_LANGUAGE_AUTO_BEGIN:
823 language_auto_begin = lexrc.getBool();
825 case RC_LANGUAGE_AUTO_END:
827 language_auto_end = lexrc.getBool();
829 case RC_LANGUAGE_GLOBAL_OPTIONS:
831 language_global_options = lexrc.getBool();
833 case RC_LANGUAGE_USE_BABEL:
835 language_use_babel = lexrc.getBool();
837 case RC_LANGUAGE_COMMAND_BEGIN:
839 language_command_begin = lexrc.getString();
841 case RC_LANGUAGE_COMMAND_END:
843 language_command_end = lexrc.getString();
845 case RC_LANGUAGE_COMMAND_LOCAL:
847 language_command_local = lexrc.getString();
851 rtl_support = lexrc.getBool();
855 auto_number = lexrc.getBool();
857 case RC_MARK_FOREIGN_LANGUAGE:
859 mark_foreign_language = lexrc.getBool();
863 show_banner = lexrc.getBool();
866 case RC_NEW_ASK_FILENAME:
868 new_ask_filename = lexrc.getBool();
871 string from, to, command, flags;
873 from = lexrc.getString();
875 to = lexrc.getString();
877 command = lexrc.getString();
879 flags = lexrc.getString();
880 if (command.empty() || command == "none")
881 converters.erase(from, to);
883 converters.add(from, to, command, flags);
887 string format, command;
889 format = lexrc.getString();
891 command = lexrc.getString();
892 formats.setViewer(format, command);
896 string format, extension, prettyname, shortcut;
898 format = lexrc.getString();
900 extension = lexrc.getString();
902 prettyname = lexrc.getString();
904 shortcut = lexrc.getString();
905 if (prettyname.empty()) {
906 if (converters.formatIsUsed(format))
907 lyxerr << "Can't delete format "
910 formats.erase(format);
913 formats.add(format, extension, prettyname,
917 case RC_DEFAULT_LANGUAGE:
919 default_language = lexrc.getString();
922 case RC_LABEL_INIT_LENGTH:
924 label_init_length = lexrc.getInteger();
927 case RC_LAST: break; // this is just a dummy
931 /// Update converters data-structures
932 converters.update(formats);
933 converters.buildGraph();
939 void LyXRC::write(string const & filename) const
941 ofstream ofs(filename.c_str());
947 void LyXRC::print() const
949 if (lyxerr.debugging())
956 void LyXRC::output(ostream & os) const
958 os << "### This file is part of\n"
959 << "### ========================================================\n"
960 << "### LyX, The Document Processor\n"
962 << "### Copyright 1995 Matthias Ettrich\n"
963 << "### Copyright 1995-2001 The LyX Team.\n"
965 << "### ========================================================\n"
967 << "# This file is written by LyX, if you want to make your own\n"
968 << "# modifications you should do them from inside LyX and save\n"
971 // Why the switch you might ask. It is a trick to ensure that all
972 // the elements in the LyXRCTags enum is handled. As you can see
973 // there are no breaks at all. So it is just a huge fall-through.
974 // The nice thing is that we will get a warning from the compiler
975 // if we forget an element.
976 LyXRCTags tag = RC_LAST;
980 // input/include files are not done here
982 // bindings is not written to the preferences file.
984 if (bind_file != system_lyxrc.bind_file) {
985 os << "\\bind_file " << bind_file << "\n";
991 << "# MISC SECTION ######################################\n"
995 if (show_banner != system_lyxrc.show_banner) {
996 os << "# Set to false to inhibit the startup banner.\n"
997 << "\\show_banner " << tostr(show_banner) << "\n";
999 // bind files are not done here.
1001 if (ui_file != system_lyxrc.ui_file) {
1002 os << "\\ui_file \"" << ui_file << "\"\n";
1004 case RC_AUTOREGIONDELETE:
1005 if (auto_region_delete != system_lyxrc.auto_region_delete) {
1006 os << "# Set to false to inhibit automatic replacement of\n"
1007 << "# the current selection.\n"
1008 << "\\auto_region_delete " << tostr(auto_region_delete)
1012 if (autosave != system_lyxrc.autosave) {
1013 os << "# The time interval between auto-saves in seconds.\n"
1014 << "\\autosave " << autosave << "\n";
1016 case RC_EXIT_CONFIRMATION:
1017 if (exit_confirmation != system_lyxrc.exit_confirmation) {
1018 os << "# Ask for confirmation before exit if there are\n"
1019 << "# unsaved changed documents.\n"
1020 << "\\exit_confirmation " << tostr(exit_confirmation)
1023 case RC_DISPLAY_SHORTCUTS:
1024 if (display_shortcuts != system_lyxrc.display_shortcuts) {
1025 os << "# Display name of the last command executed,\n"
1026 << "# with a list of short-cuts in the minibuffer.\n"
1027 << "\\display_shortcuts " << tostr(display_shortcuts)
1030 case RC_VIEWDVI_PAPEROPTION:
1031 if (view_dvi_paper_option
1032 != system_lyxrc.view_dvi_paper_option) {
1033 os << "# Options used to specify paper size to the\n"
1034 << "# view_dvi_command (e.g. -paper)\n"
1035 << "\\view_dvi_paper_option \""
1036 << view_dvi_paper_option << "\"\n";
1038 case RC_DEFAULT_PAPERSIZE:
1039 if (default_papersize != system_lyxrc.default_papersize) {
1040 os << "# The default papersize to use.\n"
1041 << "\\default_papersize \"";
1042 switch (default_papersize) {
1043 case BufferParams::PAPER_USLETTER:
1044 os << "usletter"; break;
1045 case BufferParams::PAPER_LEGALPAPER:
1046 os << "legal"; break;
1047 case BufferParams::PAPER_EXECUTIVEPAPER:
1048 os << "executive"; break;
1049 case BufferParams::PAPER_A3PAPER:
1051 case BufferParams::PAPER_A4PAPER:
1053 case BufferParams::PAPER_A5PAPER:
1055 case BufferParams::PAPER_B5PAPER:
1057 case BufferParams::PAPER_DEFAULT: break;
1062 if (ps_command != system_lyxrc.ps_command) {
1063 os << "# Program used for interpreting postscript.\n"
1064 << "\\ps_command \"" << ps_command << "\"\n";
1066 case RC_CHKTEX_COMMAND:
1067 if (chktex_command != system_lyxrc.chktex_command) {
1068 os << "\\chktex_command \"" << chktex_command << "\"\n";
1071 if (use_kbmap != system_lyxrc.use_kbmap) {
1072 os << "\\kbmap " << tostr(use_kbmap) << "\n";
1074 case RC_KBMAP_PRIMARY:
1075 if (primary_kbmap != system_lyxrc.primary_kbmap) {
1076 os << "\\kbmap_primary \"" << primary_kbmap << "\"\n";
1078 case RC_KBMAP_SECONDARY:
1079 if (secondary_kbmap != system_lyxrc.secondary_kbmap) {
1080 os << "\\kbmap_secondary \"" << secondary_kbmap
1084 if (lyxpipes != system_lyxrc.lyxpipes) {
1085 os << "\\serverpipe \"" << lyxpipes << "\"\n";
1087 case RC_DATE_INSERT_FORMAT:
1088 if (date_insert_format != system_lyxrc.date_insert_format) {
1089 os << "\\date_insert_format \"" << date_insert_format
1092 case RC_LABEL_INIT_LENGTH:
1093 if (label_init_length != system_lyxrc.label_init_length) {
1094 os << "\\label_init_length " << label_init_length
1099 << "# SCREEN & FONTS SECTION ############################\n"
1103 if (dpi != system_lyxrc.dpi) {
1104 os << "\\screen_dpi " << dpi << "\n";
1106 case RC_SCREEN_ZOOM:
1107 if (zoom != system_lyxrc.zoom) {
1108 os << "\\screen_zoom " << zoom << "\n";
1111 if (wheel_jump != system_lyxrc.wheel_jump) {
1112 os << "\\wheel_jump " << wheel_jump << "\n";
1114 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1115 if (cursor_follows_scrollbar
1116 != system_lyxrc.cursor_follows_scrollbar) {
1117 os << "\\cursor_follows_scrollbar "
1118 << tostr(cursor_follows_scrollbar) << "\n";
1120 case RC_SCREEN_FONT_ROMAN:
1121 if (roman_font_name != system_lyxrc.roman_font_name) {
1122 os << "\\screen_font_roman \"" << roman_font_name
1125 case RC_SCREEN_FONT_SANS:
1126 if (sans_font_name != system_lyxrc.sans_font_name) {
1127 os << "\\screen_font_sans \"" << sans_font_name
1130 case RC_SCREEN_FONT_TYPEWRITER:
1131 if (typewriter_font_name != system_lyxrc.typewriter_font_name) {
1132 os << "\\screen_font_typewriter \""
1133 << typewriter_font_name << "\"\n";
1135 case RC_SCREEN_FONT_SCALABLE:
1136 if (use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1137 os << "\\screen_font_scalable "
1138 << tostr(use_scalable_fonts)
1141 case RC_SCREEN_FONT_ENCODING:
1142 if (font_norm != system_lyxrc.font_norm) {
1143 os << "\\screen_font_encoding \"" << font_norm
1146 case RC_SCREEN_FONT_POPUP:
1147 if (popup_font_name != system_lyxrc.popup_font_name) {
1148 os << "\\screen_font_popup \"" << popup_font_name
1151 case RC_SCREEN_FONT_MENU:
1152 if (menu_font_name != system_lyxrc.menu_font_name) {
1153 os << "\\screen_font_menu \"" << menu_font_name
1156 case RC_SCREEN_FONT_SIZES:
1157 if (font_sizes[LyXFont::SIZE_TINY]
1158 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1159 font_sizes[LyXFont::SIZE_SCRIPT]
1160 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1161 font_sizes[LyXFont::SIZE_FOOTNOTE]
1162 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1163 font_sizes[LyXFont::SIZE_SMALL]
1164 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1165 font_sizes[LyXFont::SIZE_NORMAL]
1166 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1167 font_sizes[LyXFont::SIZE_LARGE]
1168 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1169 font_sizes[LyXFont::SIZE_LARGER]
1170 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1171 font_sizes[LyXFont::SIZE_LARGEST]
1172 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1173 font_sizes[LyXFont::SIZE_HUGE]
1174 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1175 font_sizes[LyXFont::SIZE_HUGER]
1176 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1177 os.setf(ios::fixed);
1179 os << "\\screen_font_sizes"
1180 << " " << font_sizes[LyXFont::SIZE_TINY]
1181 << " " << font_sizes[LyXFont::SIZE_SCRIPT]
1182 << " " << font_sizes[LyXFont::SIZE_FOOTNOTE]
1183 << " " << font_sizes[LyXFont::SIZE_SMALL]
1184 << " " << font_sizes[LyXFont::SIZE_NORMAL]
1185 << " " << font_sizes[LyXFont::SIZE_LARGE]
1186 << " " << font_sizes[LyXFont::SIZE_LARGER]
1187 << " " << font_sizes[LyXFont::SIZE_LARGEST]
1188 << " " << font_sizes[LyXFont::SIZE_HUGE]
1189 << " " << font_sizes[LyXFont::SIZE_HUGER]
1194 << "# COLOR SECTION ###################################\n"
1198 for (int i = 0; i < LColor::ignore; ++i ) {
1199 LColor::color lc = static_cast<LColor::color>(i);
1201 string const col(lcolor.getX11Name(lc));
1202 if (col != system_lcolor.getX11Name(lc)) {
1203 os << "\\set_color \""
1204 << lcolor.getLyXName(lc) << "\" \""
1210 << "# PRINTER SECTION ###################################\n"
1214 if (printer != system_lyxrc.printer) {
1215 os << "\\printer \"" << printer << "\"\n";
1217 case RC_PRINT_ADAPTOUTPUT:
1218 if (print_adapt_output != system_lyxrc.print_adapt_output) {
1219 os << "\\print_adapt_output "
1220 << tostr(print_adapt_output)
1223 case RC_PRINT_COMMAND:
1224 if (print_command != system_lyxrc.print_command) {
1225 os << "\\print_command \"" << print_command << "\"\n";
1227 case RC_PRINTEXSTRAOPTIONS:
1228 if (print_extra_options != system_lyxrc.print_extra_options) {
1229 os << "\\print_extra_options \"" << print_extra_options
1232 case RC_PRINTSPOOL_COMMAND:
1233 if (print_spool_command != system_lyxrc.print_spool_command) {
1234 os << "\\print_spool_command \"" << print_spool_command
1237 case RC_PRINTSPOOL_PRINTERPREFIX:
1238 if (print_spool_printerprefix
1239 != system_lyxrc.print_spool_printerprefix) {
1240 os << "\\print_spool_printerprefix \""
1241 << print_spool_printerprefix << "\"\n";
1243 case RC_PRINTEVENPAGEFLAG:
1244 if (print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1245 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1248 case RC_PRINTODDPAGEFLAG:
1249 if (print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1250 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1253 case RC_PRINTREVERSEFLAG:
1254 if (print_reverse_flag != system_lyxrc.print_reverse_flag) {
1255 os << "\\print_reverse_flag \"" << print_reverse_flag
1258 case RC_PRINTLANDSCAPEFLAG:
1259 if (print_landscape_flag != system_lyxrc.print_landscape_flag) {
1260 os << "\\print_landscape_flag \"" << print_landscape_flag
1263 case RC_PRINTPAGERANGEFLAG:
1264 if (print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1265 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1268 case RC_PRINTCOPIESFLAG:
1269 if (print_copies_flag != system_lyxrc.print_copies_flag) {
1270 os << "\\print_copies_flag \"" << print_copies_flag
1273 case RC_PRINTCOLLCOPIESFLAG:
1274 if (print_collcopies_flag
1275 != system_lyxrc.print_collcopies_flag) {
1276 os << "\\print_collcopies_flag \""
1277 << print_collcopies_flag
1280 case RC_PRINTPAPERFLAG:
1281 if (print_paper_flag != system_lyxrc.print_paper_flag) {
1282 os << "\\print_paper_flag \"" << print_paper_flag
1285 case RC_PRINTPAPERDIMENSIONFLAG:
1286 if (print_paper_dimension_flag
1287 != system_lyxrc.print_paper_dimension_flag) {
1288 os << "\\print_paper_dimension_flag \""
1289 << print_paper_dimension_flag << "\"\n";
1291 case RC_PRINTTOPRINTER:
1292 if (print_to_printer != system_lyxrc.print_to_printer) {
1293 os << "\\print_to_printer \"" << print_to_printer
1296 case RC_PRINTTOFILE:
1297 if (print_to_file != system_lyxrc.print_to_file) {
1298 os << "\\print_to_file \"" << print_to_file << "\"\n";
1300 case RC_PRINTFILEEXTENSION:
1301 if (print_file_extension != system_lyxrc.print_file_extension) {
1302 os << "\\print_file_extension \""
1303 << print_file_extension
1308 << "# EXPORT SECTION ####################################\n"
1311 case RC_CUSTOM_EXPORT_COMMAND:
1312 if (custom_export_command
1313 != system_lyxrc.custom_export_command) {
1314 os << "\\custom_export_command \""
1315 << custom_export_command
1318 case RC_CUSTOM_EXPORT_FORMAT:
1319 if (custom_export_format
1320 != system_lyxrc.custom_export_format) {
1321 os << "\\custom_export_format \"" << custom_export_format
1326 << "# TEX SECTION #######################################\n"
1329 case RC_FONT_ENCODING:
1330 if (fontenc != system_lyxrc.fontenc) {
1331 os << "\\font_encoding \"" << fontenc << "\"\n";
1335 << "# FILE SECTION ######################################\n"
1338 case RC_DOCUMENTPATH:
1339 if (document_path != system_lyxrc.document_path) {
1340 os << "\\document_path \"" << document_path << "\"\n";
1343 if (lastfiles != system_lyxrc.lastfiles) {
1344 os << "\\lastfiles \"" << lastfiles << "\"\n";
1346 case RC_NUMLASTFILES:
1347 if (num_lastfiles != system_lyxrc.num_lastfiles) {
1348 os << "\\num_lastfiles " << num_lastfiles << "\n";
1350 case RC_CHECKLASTFILES:
1351 if (check_lastfiles != system_lyxrc.check_lastfiles) {
1352 os << "\\check_lastfiles " << tostr(check_lastfiles)
1355 case RC_TEMPLATEPATH:
1356 if (template_path != system_lyxrc.template_path) {
1357 os << "\\template_path \"" << template_path << "\"\n";
1359 case RC_TEMPDIRPATH:
1360 if (tempdir_path != system_lyxrc.tempdir_path) {
1361 os << "\\tempdir_path \"" << tempdir_path << "\"\n";
1364 if (use_tempdir != system_lyxrc.use_tempdir) {
1365 os << "\\use_tempdir " << tostr(use_tempdir) << "\n";
1367 case RC_ASCII_LINELEN:
1368 if (ascii_linelen != system_lyxrc.ascii_linelen) {
1369 os << "\\ascii_linelen " << ascii_linelen << "\n";
1371 case RC_MAKE_BACKUP:
1372 if (make_backup != system_lyxrc.make_backup) {
1373 os << "\\make_backup " << tostr(make_backup) << "\n";
1375 case RC_BACKUPDIR_PATH:
1376 if (backupdir_path != system_lyxrc.backupdir_path) {
1377 os << "\\backupdir_path \"" << backupdir_path << "\"\n";
1381 << "# ASCII EXPORT SECTION ##############################\n"
1384 case RC_ASCIIROFF_COMMAND:
1385 if (ascii_roff_command != system_lyxrc.ascii_roff_command) {
1386 os << "\\ascii_roff_command \"" << ascii_roff_command
1391 << "# SPELLCHECKER SECTION ##############################\n"
1395 if (use_pspell != system_lyxrc.use_pspell) {
1396 os << "\\use_pspell \"" << use_pspell << "\"\n";
1399 case RC_SPELL_COMMAND:
1400 if (isp_command != system_lyxrc.isp_command) {
1401 os << "\\spell_command \"" << isp_command << "\"\n";
1403 case RC_ACCEPT_COMPOUND:
1404 if (isp_accept_compound != system_lyxrc.isp_accept_compound) {
1405 os << "\\accept_compound " << tostr(isp_accept_compound)
1408 case RC_USE_ALT_LANG:
1409 if (isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1410 os << "\\use_alt_language " << tostr(isp_use_alt_lang)
1414 if (isp_alt_lang != system_lyxrc.isp_alt_lang) {
1415 os << "\\alternate_language \"" << isp_alt_lang
1418 case RC_USE_ESC_CHARS:
1419 if (isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1420 os << "\\use_escape_chars " << tostr(isp_use_esc_chars)
1424 if (isp_esc_chars != system_lyxrc.isp_esc_chars) {
1425 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1427 case RC_USE_PERS_DICT:
1428 if (isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1429 os << "\\use_personal_dictionary "
1430 << tostr(isp_use_pers_dict)
1434 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1435 os << "\\personal_dictionary \"" << isp_pers_dict
1438 case RC_USE_INP_ENC:
1439 if (isp_use_input_encoding
1440 != system_lyxrc.isp_use_input_encoding) {
1441 os << "\\use_input_encoding "
1442 << tostr(isp_use_input_encoding)
1447 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1450 case RC_RTL_SUPPORT:
1451 if (rtl_support != system_lyxrc.rtl_support) {
1452 os << "\\rtl " << tostr(rtl_support) << "\n";
1454 case RC_LANGUAGE_PACKAGE:
1455 if (language_package != system_lyxrc.language_package) {
1456 os << "\\language_package \"" << language_package
1459 case RC_LANGUAGE_GLOBAL_OPTIONS:
1460 if (language_global_options
1461 != system_lyxrc.language_global_options) {
1462 os << "\\language_global_options \""
1463 << tostr(language_global_options)
1466 case RC_LANGUAGE_USE_BABEL:
1467 if (language_use_babel != system_lyxrc.language_use_babel) {
1468 os << "\\language_use_babel \""
1469 << tostr(language_use_babel)
1472 case RC_LANGUAGE_COMMAND_BEGIN:
1473 if (language_command_begin
1474 != system_lyxrc.language_command_begin) {
1475 os << "\\language_command_begin \""
1476 << language_command_begin
1479 case RC_LANGUAGE_COMMAND_END:
1480 if (language_command_end
1481 != system_lyxrc.language_command_end) {
1482 os << "\\language_command_end \"" << language_command_end
1485 case RC_LANGUAGE_COMMAND_LOCAL:
1486 if (language_command_local
1487 != system_lyxrc.language_command_local) {
1488 os << "\\language_command_local \""
1489 << language_command_local
1492 case RC_LANGUAGE_AUTO_BEGIN:
1493 if (language_auto_begin != system_lyxrc.language_auto_begin) {
1494 os << "\\language_auto_begin "
1495 << tostr(language_auto_begin) << "\n";
1497 case RC_LANGUAGE_AUTO_END:
1498 if (language_auto_end != system_lyxrc.language_auto_end) {
1499 os << "\\language_auto_end "
1500 << tostr(language_auto_end) << "\n";
1502 case RC_MARK_FOREIGN_LANGUAGE:
1503 if (mark_foreign_language
1504 != system_lyxrc.mark_foreign_language) {
1505 os << "\\mark_foreign_language " <<
1506 tostr(mark_foreign_language) << "\n";
1510 << "# 2nd MISC SUPPORT SECTION ##########################\n"
1513 case RC_OVERRIDE_X_DEADKEYS:
1514 if (override_x_deadkeys != system_lyxrc.override_x_deadkeys) {
1515 os << "\\override_x_deadkeys "
1516 << tostr(override_x_deadkeys) << "\n";
1518 case RC_SCREEN_FONT_ENCODING_MENU:
1519 if (font_norm_menu != system_lyxrc.font_norm_menu) {
1520 os << "\\screen_font_encoding_menu \"" << font_norm_menu
1523 case RC_AUTO_NUMBER:
1524 if (auto_number != system_lyxrc.auto_number) {
1525 os << "\\auto_number " << tostr(auto_number) << "\n";
1527 case RC_NEW_ASK_FILENAME:
1528 if (new_ask_filename != system_lyxrc.new_ask_filename) {
1529 os << "\\new_ask_filename " << tostr(new_ask_filename)
1532 case RC_DEFAULT_LANGUAGE:
1533 if (default_language != system_lyxrc.default_language) {
1534 os << "\\default_language " << default_language << "\n";
1538 << "# FORMATS SECTION ##########################\n"
1542 // Look for deleted formats
1543 for (Formats::const_iterator cit = formats.begin();
1544 cit != formats.end(); ++cit) {
1545 Format const * format =
1546 system_formats.getFormat(cit->name());
1548 format->extension() != cit->extension() ||
1549 format->prettyname() != cit->prettyname() ||
1550 format->shortcut() != cit->shortcut())
1551 os << "\\format \"" << cit->name() << "\" \""
1552 << cit->extension() << "\" \""
1553 << cit->prettyname() << "\" \""
1554 << cit->shortcut() << "\"\n";
1557 // New/modifed formats
1558 for (Formats::const_iterator cit = system_formats.begin();
1559 cit != system_formats.end(); ++cit)
1560 if (!formats.getFormat(cit->name()))
1561 os << "\\format \"" << cit->name()
1562 << "\" \"\" \"\" \"\"\n";
1564 for (Formats::const_iterator cit = formats.begin();
1565 cit != formats.end(); ++cit) {
1566 Format const * format =
1567 system_formats.getFormat(cit->name());
1568 if ((!format || format->viewer() != cit->viewer()) &&
1569 (format || !cit->viewer().empty()))
1570 os << "\\viewer \"" << cit->name() << "\" \""
1571 << cit->viewer() << "\"\n";
1575 << "# CONVERTERS SECTION ##########################\n"
1579 // Look for new converters
1580 for (Converters::const_iterator cit = converters.begin();
1581 cit != converters.end(); ++cit) {
1582 Converter const * converter =
1583 system_converters.getConverter(cit->from,
1586 converter->command != cit->command ||
1587 converter->flags != cit->flags)
1588 os << "\\converter \"" << cit->from << "\" \""
1589 << cit->to << "\" \""
1590 << cit->command << "\" \""
1591 << cit->flags << "\"\n";
1594 // New/modifed converters
1595 for (Converters::const_iterator cit = system_converters.begin();
1596 cit != system_converters.end(); ++cit)
1597 if (!converters.getConverter(cit->from, cit->to))
1598 os << "\\converter \"" << cit->from
1599 << "\" \"" << cit->to << "\" \"\" \"\"\n";
1604 void LyXRC::set_font_norm_type()
1606 if (font_norm == "iso10646-1")
1607 font_norm_type = ISO_10646_1;
1608 else if (font_norm == "iso8859-1")
1609 font_norm_type = ISO_8859_1;
1610 else if (font_norm == "iso8859-6.8x")
1611 font_norm_type = ISO_8859_6_8;
1612 else if (font_norm == "iso8859-9")
1613 font_norm_type = ISO_8859_9;
1614 else if (font_norm == "iso8859-15")
1615 font_norm_type = ISO_8859_15;
1617 font_norm_type = OTHER_ENCODING;
1621 string const LyXRC::getDescription(LyXRCTags tag)
1626 case RC_FONT_ENCODING:
1627 str = N_("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
1631 str = N_("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
1634 case RC_PRINT_COMMAND:
1635 str = N_("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
1638 case RC_PRINTEVENPAGEFLAG:
1639 str = N_("The option to print only even pages.");
1642 case RC_PRINTODDPAGEFLAG:
1643 str = N_("The option to print only odd pages.");
1646 case RC_PRINTPAGERANGEFLAG:
1647 str = N_("The option for specifying a comma-separated list of pages to print.");
1650 case RC_PRINTCOPIESFLAG:
1651 str = N_("The option for specifying the number of copies to print.");
1654 case RC_PRINTCOLLCOPIESFLAG:
1655 str = N_("The option for specifying whether the copies should be collated.");
1658 case RC_PRINTREVERSEFLAG:
1659 str = N_("The option to reverse the order of the pages printed.");
1662 case RC_PRINTLANDSCAPEFLAG:
1663 str = N_("The option to print out in landscape.");
1666 case RC_PRINTPAPERFLAG:
1667 str = N_("The option to specify paper type.");
1670 case RC_PRINTPAPERDIMENSIONFLAG:
1671 str = N_("Option to specify the dimensions of the print paper.");
1674 case RC_PRINTTOPRINTER:
1675 str = N_("Option to pass to the print program to print on a specific printer.");
1678 case RC_PRINT_ADAPTOUTPUT:
1679 str = N_("Select for LyX to pass the name of the destination printer to your print command.");
1682 case RC_PRINTTOFILE:
1683 str = N_("Option to pass to the print program to print to a file.");
1686 case RC_PRINTFILEEXTENSION:
1687 str = N_("Extension of printer program output file. Usually \".ps\".");
1690 case RC_PRINTEXSTRAOPTIONS:
1691 str = N_("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
1694 case RC_PRINTSPOOL_COMMAND:
1695 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.");
1698 case RC_PRINTSPOOL_PRINTERPREFIX:
1699 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.");
1703 str = N_("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
1706 case RC_SCREEN_ZOOM:
1707 //xgettext:no-c-format
1708 str = N_("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
1711 case RC_SCREEN_FONT_SIZES:
1712 str = N_("The font sizes used for calculating the scaling of the screen fonts.");
1715 case RC_SCREEN_FONT_ROMAN:
1716 case RC_SCREEN_FONT_SANS:
1717 case RC_SCREEN_FONT_TYPEWRITER:
1718 str = N_("The screen fonts used to display the text while editing.");
1721 case RC_SCREEN_FONT_MENU:
1722 str = N_("The font for menus (and groups titles in popups).");
1725 case RC_SCREEN_FONT_POPUP:
1726 str = N_("The font for popups.");
1729 case RC_SCREEN_FONT_ENCODING:
1730 str = N_("The encoding for the screen fonts.");
1733 case RC_SCREEN_FONT_ENCODING_MENU:
1734 str = N_("The encoding for the menu/popups fonts.");
1741 str = N_("The time interval between auto-saves (in seconds). 0 means no auto-save.");
1744 case RC_DOCUMENTPATH:
1745 str = N_("The default path for your documents.");
1748 case RC_TEMPLATEPATH:
1749 str = N_("The path that LyX will set when offering to choose a template.");
1752 case RC_TEMPDIRPATH:
1753 str = N_("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
1757 str = N_("Select if you wish to use a temporary directory structure to store temporary TeX output.");
1761 str = N_("The file where the last-files information should be stored.");
1764 case RC_AUTOREGIONDELETE:
1765 str = N_("De-select if you don't want the current selection to be replaced automatically by what you type.");
1768 case RC_OVERRIDE_X_DEADKEYS:
1769 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.");
1774 str = N_("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
1778 str = N_("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
1782 str = N_("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
1786 case RC_KBMAP_PRIMARY:
1787 case RC_KBMAP_SECONDARY:
1788 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.");
1791 case RC_ASCIIROFF_COMMAND:
1792 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.");
1795 case RC_ASCII_LINELEN:
1796 str = N_("This is the maximum line length of an exported ASCII file (LaTeX, SGML or plain text).");
1799 case RC_NUMLASTFILES:
1800 str = N_("Maximal number of lastfiles. Up to 9 can appear in the file menu.");
1803 case RC_CHECKLASTFILES:
1804 str = N_("Select to check whether the lastfiles still exist.");
1807 case RC_VIEWDVI_PAPEROPTION:
1808 str = N_("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
1811 case RC_DEFAULT_PAPERSIZE:
1812 str = N_("Specify the default paper size.");
1818 case RC_ACCEPT_COMPOUND:
1819 str = N_("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
1822 case RC_SPELL_COMMAND:
1823 str = N_("What command runs the spell checker?");
1826 case RC_USE_INP_ENC:
1827 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.");
1830 case RC_USE_ALT_LANG:
1832 str = N_("Specify an alternate language. The default is to use the language of the document.");
1835 case RC_USE_PERS_DICT:
1837 str = N_("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
1840 case RC_USE_ESC_CHARS:
1842 str = N_("Specify additional chars that can be part of a word.");
1845 case RC_SCREEN_FONT_SCALABLE:
1846 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.");
1849 case RC_CHKTEX_COMMAND:
1850 str = N_("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
1853 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1854 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.");
1857 case RC_EXIT_CONFIRMATION:
1858 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.)");
1861 case RC_DISPLAY_SHORTCUTS:
1862 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.");
1865 case RC_MAKE_BACKUP:
1866 str = N_("De-select if you don't want LyX to create backup files.");
1869 case RC_BACKUPDIR_PATH:
1870 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.");
1873 case RC_RTL_SUPPORT:
1874 str = N_("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
1877 case RC_MARK_FOREIGN_LANGUAGE:
1878 str = N_("Select to control the highlighting of words with a language foreign to that of the document.");
1881 case RC_LANGUAGE_PACKAGE:
1882 str = N_("The latex command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
1885 case RC_LANGUAGE_GLOBAL_OPTIONS:
1886 str = N_("De-select if you don't want the language(s) used as an argument to \\documentclass.");
1889 case RC_LANGUAGE_USE_BABEL:
1890 str = N_("De-select if you don't want babel to be used when the language of the document is the default language.");
1893 case RC_LANGUAGE_AUTO_BEGIN:
1894 str = N_("Select if a language switching command is needed at the beginning of the document.");
1897 case RC_LANGUAGE_AUTO_END:
1898 str = N_("Select if a language switching command is needed at the end of the document.");
1901 case RC_LANGUAGE_COMMAND_BEGIN:
1902 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.");
1905 case RC_LANGUAGE_COMMAND_END:
1906 str = N_("The latex command for changing back to the language of the document.");
1909 case RC_LANGUAGE_COMMAND_LOCAL:
1910 str = N_("The latex command for local changing of the language.");
1913 case RC_DATE_INSERT_FORMAT:
1914 //xgettext:no-c-format
1915 str = N_("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
1918 case RC_SHOW_BANNER:
1919 str = N_("De-select if you don't want the startup banner.");
1923 str = N_("The wheel movement factor (for mice with wheels or five button mice).");
1935 case RC_NEW_ASK_FILENAME:
1936 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.");
1939 case RC_DEFAULT_LANGUAGE:
1940 str = N_("New documents will be assigned this language.");
1943 case RC_LABEL_INIT_LENGTH:
1944 str = N_("Maximum number of words in the initialization string for a new label");
1954 // The global instance
1957 // The global copy of the system lyxrc entries (everything except preferences)