1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
9 * ====================================================== */
14 #pragma implementation "lyxrc.h"
25 #include "LyXAction.h"
26 #include "lyxserver.h"
29 #include "tex-strings.h"
30 #include "support/path.h"
31 #include "support/filetools.h"
33 #include "converter.h"
42 extern LyXAction lyxaction;
43 extern kb_keymap * toplevel_keymap;
47 keyword_item lyxrcTags[] = {
48 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
49 { "\\alternate_language", LyXRC::RC_ALT_LANG },
50 { "\\ascii_linelen", LyXRC::RC_ASCII_LINELEN },
51 { "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
52 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
53 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
54 { "\\autosave", LyXRC::RC_AUTOSAVE },
55 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
56 { "\\bind", LyXRC::RC_BIND },
57 { "\\bind_file", LyXRC::RC_BINDFILE },
58 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
59 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
60 { "\\converter", LyXRC::RC_CONVERTER },
61 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
62 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
63 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
64 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
65 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
66 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
67 { "\\display_shortcuts", LyXRC::RC_DISPLAY_SHORTCUTS },
68 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
69 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
70 { "\\exit_confirmation", LyXRC::RC_EXIT_CONFIRMATION },
72 { "\\fax_command", LyXRC::RC_FAX_COMMAND },
73 { "\\fax_program", LyXRC::RC_FAXPROGRAM },
75 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
76 { "\\format", LyXRC::RC_FORMAT },
77 { "\\input", LyXRC::RC_INPUT },
78 { "\\kbmap", LyXRC::RC_KBMAP },
79 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
80 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
81 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
82 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
83 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
84 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
85 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
86 { "\\lastfiles", LyXRC::RC_LASTFILES },
87 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
88 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
89 { "\\new_ask_filename", LyXRC::RC_NEW_ASK_FILENAME },
90 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
91 { "\\override_x_deadkeys", LyXRC::RC_OVERRIDE_X_DEADKEYS },
92 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
94 { "\\phone_book", LyXRC::RC_PHONEBOOK },
96 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
97 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
98 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
99 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
100 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
101 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
102 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
103 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
104 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
105 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
106 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
107 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
108 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
109 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
110 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
111 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
112 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
113 { "\\printer", LyXRC::RC_PRINTER },
114 { "\\ps_command", LyXRC::RC_PS_COMMAND },
115 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
116 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
117 { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
118 { "\\screen_font_encoding_menu", LyXRC::RC_SCREEN_FONT_ENCODING_MENU },
119 { "\\screen_font_menu", LyXRC::RC_SCREEN_FONT_MENU },
120 { "\\screen_font_popup", LyXRC::RC_SCREEN_FONT_POPUP },
121 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
122 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
123 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
124 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
125 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
126 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
127 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
128 { "\\set_color", LyXRC::RC_SET_COLOR },
129 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
130 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
131 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
132 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
133 { "\\ui_file", LyXRC::RC_UIFILE },
134 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
135 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
136 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
137 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
138 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
139 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
140 { "\\viewer" ,LyXRC::RC_VIEWER},
141 { "\\wheel_jump", LyXRC::RC_WHEEL_JUMP }
144 /* Let the range depend of the size of lyxrcTags. Alejandro 240596 */
145 static const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
154 void LyXRC::setDefaults() {
156 // Get printer from the environment. If fail, use default "",
157 // assuming that everything is set up correctly.
158 printer = GetEnv("PRINTER");
159 print_adapt_output = false;
160 print_command = "dvips";
161 print_evenpage_flag = "-B";
162 print_oddpage_flag = "-A";
163 print_pagerange_flag = "-pp";
164 print_copies_flag = "-c";
165 print_collcopies_flag = "-C";
166 print_reverse_flag = "-r";
167 print_landscape_flag = "-t landscape";
168 print_to_printer = "-P";
169 print_to_file = "-o ";
170 print_file_extension = ".ps";
171 print_paper_flag = "-t";
172 print_paper_dimension_flag = "-T";
173 document_path = GetEnvPath("HOME");
174 tempdir_path = "/tmp";
177 view_dvi_paper_option = "-paper";
178 default_papersize = BufferParams::PAPER_USLETTER;
179 custom_export_format = "ps";
180 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
183 // Because a screen typically is wider than a piece of paper:
186 // Default LaTeX font size:
187 font_sizes[LyXFont::SIZE_TINY] = 5.0;
188 font_sizes[LyXFont::SIZE_SCRIPT] = 7.0;
189 font_sizes[LyXFont::SIZE_FOOTNOTE] = 8.0;
190 font_sizes[LyXFont::SIZE_SMALL] = 9.0;
191 font_sizes[LyXFont::SIZE_NORMAL] = 10.0;
192 font_sizes[LyXFont::SIZE_LARGE] = 12.0;
193 font_sizes[LyXFont::SIZE_LARGER] = 14.4;
194 font_sizes[LyXFont::SIZE_LARGEST] = 17.26;
195 font_sizes[LyXFont::SIZE_HUGE] = 20.74;
196 font_sizes[LyXFont::SIZE_HUGER] = 24.88;
197 use_scalable_fonts = true;
198 roman_font_name = "-*-times";
199 sans_font_name = "-*-helvetica";
200 typewriter_font_name = "-*-courier";
201 menu_font_name = "-*-helvetica-bold-r";
202 popup_font_name = "-*-helvetica-medium-r";
203 font_norm = "iso8859-1";
204 font_norm_type = OTHER_ENCODING;
206 override_x_deadkeys = true;
208 auto_region_delete = true;
211 check_lastfiles = true;
214 exit_confirmation = true;
215 display_shortcuts = true;
216 // Spellchecker settings:
217 isp_command = "ispell";
218 isp_accept_compound = false;
219 isp_use_input_encoding = false;
220 isp_use_alt_lang = false;
221 isp_use_pers_dict = false;
222 isp_use_esc_chars = false;
227 mark_foreign_language = true;
228 language_package = "\\usepackage{babel}";
229 language_auto_begin = true;
230 language_auto_end = true;
231 language_command_begin = "\\selectlanguage{$$lang}";
232 language_command_end = "\\selectlanguage{$$lang}";
233 default_language = "english";
235 new_ask_filename = false;
238 date_insert_format = "%A, %e %B %Y";
240 cursor_follows_scrollbar = false;
242 /// These variables are not stored on disk (perhaps they
243 // should be moved from the LyXRC class).
249 int LyXRC::ReadBindFile(string const & name)
252 string const tmp = i18nLibFileSearch("bind", name, "bind");
253 lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
254 int const result = read(tmp);
256 lyxerr << "Error reading bind file: " << tmp << endl;
262 int LyXRC::read(string const & filename)
265 static string const bindFile("cua");
267 LyXLex lexrc(lyxrcTags, lyxrcCount);
268 if (lyxerr.debugging(Debug::PARSER))
269 lexrc.printTable(lyxerr);
271 lexrc.setFile(filename);
272 if (!lexrc.IsOK()) return -2;
274 lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
276 while (lexrc.IsOK()) {
277 // By using two switches we take advantage of the compiler
278 // telling us if we have missed a LyXRCTags element in
279 // the second switch.
280 // Note that this also shows a problem with LyXLex since it
281 // helps us avoid taking advantage of the strictness of the
284 int le = lexrc.lex();
286 case LyXLex::LEX_UNDEF:
287 lexrc.printError("Unknown tag `$$Token'");
289 case LyXLex::LEX_FEOF:
293 switch (static_cast<LyXRCTags>(le)) {
294 case RC_INPUT: // Include file
296 string tmp = LibFileSearch(string(),
299 lexrc.printError("Error reading "
300 "included file: "+tmp);
304 case RC_BINDFILE: // RVDK_PATCH_5
306 string tmp(lexrc.GetString());
307 if (bind_file.empty()) {
308 // we only need the name of the first
309 // bind file since that (usually)
310 // includes several others.
319 ui_file = lexrc.GetString();
323 case RC_EXIT_CONFIRMATION:
325 exit_confirmation = lexrc.GetBool();
328 case RC_DISPLAY_SHORTCUTS:
330 display_shortcuts = lexrc.GetBool();
335 use_kbmap = lexrc.GetBool();
338 case RC_KBMAP_PRIMARY:
340 string kmap(lexrc.GetString());
343 } else if (!LibFileSearch("kbd", kmap,
345 primary_kbmap = kmap;
347 lexrc.printError("LyX: Keymap `$$Token' not found");
351 case RC_KBMAP_SECONDARY:
353 string kmap(lexrc.GetString());
356 } else if (!LibFileSearch("kbd", kmap,
358 secondary_kbmap = kmap;
360 lexrc.printError("LyX: Keymap `$$Token' not found");
364 case RC_FONT_ENCODING:
366 fontenc = lexrc.GetString();
371 printer = lexrc.GetString();
374 case RC_PRINT_COMMAND:
376 print_command = lexrc.GetString();
379 case RC_PRINTEVENPAGEFLAG:
381 print_evenpage_flag = lexrc.GetString();
384 case RC_PRINTODDPAGEFLAG:
386 print_oddpage_flag = lexrc.GetString();
389 case RC_PRINTPAGERANGEFLAG:
391 print_pagerange_flag = lexrc.GetString();
394 case RC_PRINTCOPIESFLAG:
396 print_copies_flag = lexrc.GetString();
399 case RC_PRINTCOLLCOPIESFLAG:
401 print_collcopies_flag = lexrc.GetString();
404 case RC_PRINTREVERSEFLAG:
406 print_reverse_flag = lexrc.GetString();
409 case RC_PRINTLANDSCAPEFLAG:
411 print_landscape_flag = lexrc.GetString();
414 case RC_PRINTTOPRINTER:
416 print_to_printer = lexrc.GetString();
419 case RC_PRINT_ADAPTOUTPUT:
421 print_adapt_output = lexrc.GetBool();
426 print_to_file = lexrc.GetString();
429 case RC_PRINTFILEEXTENSION:
431 print_file_extension = lexrc.GetString();
434 case RC_PRINTEXSTRAOPTIONS:
436 print_extra_options = lexrc.GetString();
439 case RC_PRINTSPOOL_COMMAND:
441 print_spool_command = lexrc.GetString();
444 case RC_PRINTSPOOL_PRINTERPREFIX:
446 print_spool_printerprefix = lexrc.GetString();
449 case RC_PRINTPAPERDIMENSIONFLAG:
451 print_paper_dimension_flag = lexrc.GetString();
454 case RC_PRINTPAPERFLAG:
456 print_paper_flag = lexrc.GetString();
459 case RC_CUSTOM_EXPORT_COMMAND:
461 custom_export_command = lexrc.GetString();
464 case RC_CUSTOM_EXPORT_FORMAT:
466 custom_export_format = lexrc.GetString();
469 case RC_DEFAULT_PAPERSIZE:
471 string size = lowercase(lexrc.GetString());
472 if (size == "usletter")
474 BufferParams::PAPER_USLETTER;
475 else if (size == "legal")
477 BufferParams::PAPER_LEGALPAPER;
478 else if (size == "executive")
480 BufferParams::PAPER_EXECUTIVEPAPER;
481 else if (size == "a3")
483 BufferParams::PAPER_A3PAPER;
484 else if (size == "a4")
486 BufferParams::PAPER_A4PAPER;
487 else if (size == "a5")
489 BufferParams::PAPER_A5PAPER;
490 else if (size == "b5")
492 BufferParams::PAPER_B5PAPER;
496 case RC_VIEWDVI_PAPEROPTION:
498 view_dvi_paper_option = lexrc.GetString();
500 view_dvi_paper_option = "";
505 ps_command = lexrc.GetString();
508 case RC_CHKTEX_COMMAND:
510 chktex_command = lexrc.GetString();
515 dpi = lexrc.GetInteger();
520 zoom = lexrc.GetInteger();
525 wheel_jump = lexrc.GetInteger();
528 case RC_SCREEN_FONT_SIZES:
530 font_sizes[LyXFont::SIZE_TINY] =
533 font_sizes[LyXFont::SIZE_SCRIPT] =
536 font_sizes[LyXFont::SIZE_FOOTNOTE] =
539 font_sizes[LyXFont::SIZE_SMALL] =
542 font_sizes[LyXFont::SIZE_NORMAL] =
545 font_sizes[LyXFont::SIZE_LARGE] =
548 font_sizes[LyXFont::SIZE_LARGER] =
551 font_sizes[LyXFont::SIZE_LARGEST] =
554 font_sizes[LyXFont::SIZE_HUGE] =
557 font_sizes[LyXFont::SIZE_HUGER] =
561 case RC_SCREEN_FONT_SCALABLE:
563 use_scalable_fonts = lexrc.GetBool();
568 autosave = lexrc.GetInteger();
571 case RC_DOCUMENTPATH:
573 document_path = ExpandPath(lexrc.GetString());
577 case RC_TEMPLATEPATH:
579 template_path = ExpandPath(lexrc.GetString());
584 tempdir_path = ExpandPath(lexrc.GetString());
589 use_tempdir = lexrc.GetBool();
594 lastfiles = ExpandPath(lexrc.GetString());
597 case RC_NUMLASTFILES:
599 num_lastfiles = lexrc.GetInteger();
602 case RC_CHECKLASTFILES:
604 check_lastfiles = lexrc.GetBool();
607 case RC_SCREEN_FONT_ROMAN:
609 roman_font_name = lexrc.GetString();
612 case RC_SCREEN_FONT_SANS:
614 sans_font_name = lexrc.GetString();
617 case RC_SCREEN_FONT_TYPEWRITER:
619 typewriter_font_name = lexrc.GetString();
622 case RC_SCREEN_FONT_MENU:
624 menu_font_name = lexrc.GetString();
627 case RC_SCREEN_FONT_POPUP:
629 popup_font_name = lexrc.GetString();
632 case RC_SCREEN_FONT_ENCODING:
634 font_norm = lexrc.GetString();
635 set_font_norm_type();
639 case RC_SCREEN_FONT_ENCODING_MENU:
641 font_norm_menu = lexrc.GetString();
646 string lyx_name, x11_name;
649 lyx_name = lexrc.GetString();
651 lexrc.printError("Missing color tag.");
656 x11_name = lexrc.GetString();
658 lexrc.printError("Missing color name for color : `$$Token'");
662 if (!lcolor.setColor(lyx_name, x11_name))
663 lyxerr << "Bad lyxrc set_color for "
668 case RC_AUTOREGIONDELETE:
669 // Auto region delete defaults to true
671 auto_region_delete = lexrc.GetBool();
676 // we should not do an explicit binding before
677 // loading a bind file. So, in this case, load
678 // the default bind file.
680 bind_file = bindFile;
683 // !!!chb, dynamic key binding...
687 if (lexrc.lex() == LyXLex::LEX_DATA) {
688 seq = lexrc.GetString();
690 lexrc.printError("Bad key sequence: `$$Token'");
694 if (lexrc.lex() == LyXLex::LEX_DATA) {
695 cmd = lexrc.GetString();
697 lexrc.printError("Bad command: `$$Token'");
701 if ((action = lyxaction.LookupFunc(cmd))>= 0) {
702 if (lyxerr.debugging(Debug::KBMAP)) {
703 lyxerr << "RC_BIND: Sequence `"
704 << seq << "' Command `"
705 << cmd << "' Action `"
706 << action << '\'' << endl;
708 res = toplevel_keymap->bind(seq, action);
711 "Invalid key sequence `"
714 } else {// cmd is the last token read.
716 "Unknown LyX function `$$Token'");
720 case RC_OVERRIDE_X_DEADKEYS:
722 override_x_deadkeys = lexrc.GetBool();
727 lyxpipes = ExpandPath(lexrc.GetString());
730 case RC_CURSOR_FOLLOWS_SCROLLBAR:
732 cursor_follows_scrollbar = lexrc.GetBool();
738 fax_command = lexrc.GetString();
742 fax_program = lexrc.GetString();
746 string s = lexrc.GetString();
750 phone_book = user_lyxdir + s;
754 case RC_ASCIIROFF_COMMAND:
756 ascii_roff_command = lexrc.GetString();
758 case RC_ASCII_LINELEN:
760 ascii_linelen = lexrc.GetInteger();
762 // Spellchecker settings:
763 case RC_SPELL_COMMAND:
765 isp_command = lexrc.GetString();
767 case RC_ACCEPT_COMPOUND:
769 isp_accept_compound = lexrc.GetBool();
773 isp_use_input_encoding = lexrc.GetBool();
775 case RC_USE_ALT_LANG:
777 isp_use_alt_lang = lexrc.GetBool();
779 case RC_USE_PERS_DICT:
781 isp_use_pers_dict = lexrc.GetBool();
783 case RC_USE_ESC_CHARS:
785 isp_use_esc_chars = lexrc.GetBool();
789 isp_alt_lang = lexrc.GetString();
793 isp_pers_dict = lexrc.GetString();
797 isp_esc_chars = lexrc.GetString();
801 make_backup = lexrc.GetBool();
803 case RC_BACKUPDIR_PATH:
805 backupdir_path = ExpandPath(lexrc.GetString());
807 case RC_DATE_INSERT_FORMAT:
809 date_insert_format = lexrc.GetString();
811 case RC_LANGUAGE_PACKAGE:
813 language_package = lexrc.GetString();
815 case RC_LANGUAGE_AUTO_BEGIN:
817 language_auto_begin = lexrc.GetBool();
819 case RC_LANGUAGE_AUTO_END:
821 language_auto_end = lexrc.GetBool();
823 case RC_LANGUAGE_COMMAND_BEGIN:
825 language_command_begin = lexrc.GetString();
827 case RC_LANGUAGE_COMMAND_END:
829 language_command_end = lexrc.GetString();
833 rtl_support = lexrc.GetBool();
837 auto_number = lexrc.GetBool();
839 case RC_MARK_FOREIGN_LANGUAGE:
841 mark_foreign_language = lexrc.GetBool();
845 show_banner = lexrc.GetBool();
848 case RC_NEW_ASK_FILENAME:
850 new_ask_filename = lexrc.GetBool();
853 string from, to, command, flags;
855 from = lexrc.GetString();
857 to = lexrc.GetString();
859 command = lexrc.GetString();
861 flags = lexrc.GetString();
862 if (command.empty() || command == "none")
863 converters.Delete(from, to);
865 converters.Add(from, to, command, flags);
869 string format, command;
871 format = lexrc.GetString();
873 command = lexrc.GetString();
874 formats.SetViewer(format, command);
878 string format, extension, prettyname, shortcut;
880 format = lexrc.GetString();
882 extension = lexrc.GetString();
884 prettyname = lexrc.GetString();
886 shortcut = lexrc.GetString();
887 if (prettyname.empty()) {
888 if (converters.FormatIsUsed(format))
889 lyxerr << "Can't delete format "
892 formats.Delete(format);
895 formats.Add(format, extension, prettyname,
899 case RC_DEFAULT_LANGUAGE:
901 default_language = lexrc.GetString();
904 case RC_LAST: break; // this is just a dummy
912 void LyXRC::write(string const & filename) const
914 ofstream ofs(filename.c_str());
920 void LyXRC::print() const
922 if (lyxerr.debugging())
929 void LyXRC::output(ostream & os) const
931 os << "### This file is part of\n"
932 << "### ========================================================\n"
933 << "### LyX, The Document Processor\n"
935 << "### Copyright 1995 Matthias Ettrich\n"
936 << "### Copyright 1995-2000 The LyX Team.\n"
938 << "### ========================================================\n"
940 << "# This file is written by LyX, if you want to make your own\n"
941 << "# modifications you should do them from inside LyX and save\n"
944 // Why the switch you might ask. It is a trick to ensure that all
945 // the elements in the LyXRCTags enum is handled. As you can see
946 // there are no breaks at all. So it is just a huge fall-through.
947 // The nice thing is that we will get a warning from the compiler
948 // if we forget an element.
949 LyXRCTags tag = RC_LAST;
953 // input/include files are not done here
955 // bindings is not written to the preferences file.
957 if (bind_file != system_lyxrc.bind_file) {
958 os << "\\bind_file " << bind_file << "\n";
964 << "# MISC SECTION ######################################\n"
968 if (show_banner != system_lyxrc.show_banner) {
969 os << "# Set to false to inhibit the startup banner.\n"
970 << "\\show_banner " << tostr(show_banner) << "\n";
972 // bind files are not done here.
974 if (ui_file != system_lyxrc.ui_file) {
975 os << "\\ui_file \"" << ui_file << "\"\n";
977 case RC_AUTOREGIONDELETE:
978 if (auto_region_delete != system_lyxrc.auto_region_delete) {
979 os << "# Set to false to inhibit automatic replacement of\n"
980 << "# the current selection.\n"
981 << "\\auto_region_delete " << tostr(auto_region_delete)
985 if (autosave != system_lyxrc.autosave) {
986 os << "# The time interval between auto-saves in seconds.\n"
987 << "\\autosave " << autosave << "\n";
989 case RC_EXIT_CONFIRMATION:
990 if (exit_confirmation != system_lyxrc.exit_confirmation) {
991 os << "# Ask for confirmation before exit if there are\n"
992 << "# unsaved changed documents.\n"
993 << "\\exit_confirmation " << tostr(exit_confirmation)
996 case RC_DISPLAY_SHORTCUTS:
997 if (display_shortcuts != system_lyxrc.display_shortcuts) {
998 os << "# Display name of the last command executed,\n"
999 << "# with a list of short-cuts in the minibuffer.\n"
1000 << "\\display_shortcuts " << tostr(display_shortcuts)
1003 case RC_VIEWDVI_PAPEROPTION:
1004 if (view_dvi_paper_option
1005 != system_lyxrc.view_dvi_paper_option) {
1006 os << "# Options used to specify paper size to the\n"
1007 << "# view_dvi_command\n"
1008 << "\\view_dvi_paper_option \""
1009 << view_dvi_paper_option << "\"\n";
1011 case RC_DEFAULT_PAPERSIZE:
1012 if (default_papersize != system_lyxrc.default_papersize) {
1013 os << "# The default papersize to use.\n"
1014 << "\\default_papersize \"";
1015 switch (default_papersize) {
1016 case BufferParams::PAPER_USLETTER:
1017 os << "usletter"; break;
1018 case BufferParams::PAPER_LEGALPAPER:
1019 os << "legal"; break;
1020 case BufferParams::PAPER_EXECUTIVEPAPER:
1021 os << "executive"; break;
1022 case BufferParams::PAPER_A3PAPER:
1024 case BufferParams::PAPER_A4PAPER:
1026 case BufferParams::PAPER_A5PAPER:
1028 case BufferParams::PAPER_B5PAPER:
1030 case BufferParams::PAPER_DEFAULT: break;
1035 if (ps_command != system_lyxrc.ps_command) {
1036 os << "# Program used for interpreting postscript.\n"
1037 << "\\ps_command \"" << ps_command << "\"\n";
1039 case RC_CHKTEX_COMMAND:
1040 if (chktex_command != system_lyxrc.chktex_command) {
1041 os << "\\chktex_command \"" << chktex_command << "\"\n";
1044 if (use_kbmap != system_lyxrc.use_kbmap) {
1045 os << "\\kbmap " << tostr(use_kbmap) << "\n";
1047 case RC_KBMAP_PRIMARY:
1048 if (primary_kbmap != system_lyxrc.primary_kbmap) {
1049 os << "\\kbmap_primary \"" << primary_kbmap << "\"\n";
1051 case RC_KBMAP_SECONDARY:
1052 if (secondary_kbmap != system_lyxrc.secondary_kbmap) {
1053 os << "\\kbmap_secondary \"" << secondary_kbmap
1057 if (lyxpipes != system_lyxrc.lyxpipes) {
1058 os << "\\serverpipe \"" << lyxpipes << "\"\n";
1060 case RC_DATE_INSERT_FORMAT:
1061 if (date_insert_format != system_lyxrc.date_insert_format) {
1062 os << "\\date_insert_format \"" << date_insert_format
1067 << "# SCREEN & FONTS SECTION ############################\n"
1071 if (dpi != system_lyxrc.dpi) {
1072 os << "\\screen_dpi " << dpi << "\n";
1074 case RC_SCREEN_ZOOM:
1075 if (zoom != system_lyxrc.zoom) {
1076 os << "\\screen_zoom " << zoom << "\n";
1079 if (wheel_jump != system_lyxrc.wheel_jump) {
1080 os << "\\wheel_jump " << wheel_jump << "\n";
1082 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1083 if (cursor_follows_scrollbar
1084 != system_lyxrc.cursor_follows_scrollbar) {
1085 os << "\\cursor_follows_scrollbar "
1086 << tostr(cursor_follows_scrollbar) << "\n";
1088 case RC_SCREEN_FONT_ROMAN:
1089 if (roman_font_name != system_lyxrc.roman_font_name) {
1090 os << "\\screen_font_roman \"" << roman_font_name
1093 case RC_SCREEN_FONT_SANS:
1094 if (sans_font_name != system_lyxrc.sans_font_name) {
1095 os << "\\screen_font_sans \"" << sans_font_name
1098 case RC_SCREEN_FONT_TYPEWRITER:
1099 if (typewriter_font_name != system_lyxrc.typewriter_font_name) {
1100 os << "\\screen_font_typewriter \""
1101 << typewriter_font_name << "\"\n";
1103 case RC_SCREEN_FONT_SCALABLE:
1104 if (use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1105 os << "\\screen_font_scalable "
1106 << tostr(use_scalable_fonts)
1109 case RC_SCREEN_FONT_ENCODING:
1110 if (font_norm != system_lyxrc.font_norm) {
1111 os << "\\screen_font_encoding \"" << font_norm
1114 case RC_SCREEN_FONT_POPUP:
1115 if (popup_font_name != system_lyxrc.popup_font_name) {
1116 os << "\\screen_font_popup \"" << popup_font_name
1119 case RC_SCREEN_FONT_MENU:
1120 if (menu_font_name != system_lyxrc.menu_font_name) {
1121 os << "\\screen_font_menu \"" << menu_font_name
1124 case RC_SCREEN_FONT_SIZES:
1125 if (font_sizes[LyXFont::SIZE_TINY]
1126 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1127 font_sizes[LyXFont::SIZE_SCRIPT]
1128 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1129 font_sizes[LyXFont::SIZE_FOOTNOTE]
1130 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1131 font_sizes[LyXFont::SIZE_SMALL]
1132 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1133 font_sizes[LyXFont::SIZE_NORMAL]
1134 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1135 font_sizes[LyXFont::SIZE_LARGE]
1136 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1137 font_sizes[LyXFont::SIZE_LARGER]
1138 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1139 font_sizes[LyXFont::SIZE_LARGEST]
1140 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1141 font_sizes[LyXFont::SIZE_HUGE]
1142 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1143 font_sizes[LyXFont::SIZE_HUGER]
1144 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1145 os.setf(ios::fixed);
1147 os << "\\screen_font_sizes"
1148 << " " << font_sizes[LyXFont::SIZE_TINY]
1149 << " " << font_sizes[LyXFont::SIZE_SCRIPT]
1150 << " " << font_sizes[LyXFont::SIZE_FOOTNOTE]
1151 << " " << font_sizes[LyXFont::SIZE_SMALL]
1152 << " " << font_sizes[LyXFont::SIZE_NORMAL]
1153 << " " << font_sizes[LyXFont::SIZE_LARGE]
1154 << " " << font_sizes[LyXFont::SIZE_LARGER]
1155 << " " << font_sizes[LyXFont::SIZE_LARGEST]
1156 << " " << font_sizes[LyXFont::SIZE_HUGE]
1157 << " " << font_sizes[LyXFont::SIZE_HUGER]
1162 << "# COLOR SECTION ###################################\n"
1166 for (int i = 0; i < LColor::ignore; ++i ) {
1167 LColor::color lc = static_cast<LColor::color>(i);
1169 string const col(lcolor.getX11Name(lc));
1170 if (col != system_lcolor.getX11Name(lc)) {
1171 os << "\\set_color \""
1172 << lcolor.getLyXName(lc) << "\" \""
1178 << "# PRINTER SECTION ###################################\n"
1182 if (printer != system_lyxrc.printer) {
1183 os << "\\printer \"" << printer << "\"\n";
1185 case RC_PRINT_ADAPTOUTPUT:
1186 if (print_adapt_output != system_lyxrc.print_adapt_output) {
1187 os << "\\print_adapt_output "
1188 << tostr(print_adapt_output)
1191 case RC_PRINT_COMMAND:
1192 if (print_command != system_lyxrc.print_command) {
1193 os << "\\print_command \"" << print_command << "\"\n";
1195 case RC_PRINTEXSTRAOPTIONS:
1196 if (print_extra_options != system_lyxrc.print_extra_options) {
1197 os << "\\print_extra_options \"" << print_extra_options
1200 case RC_PRINTSPOOL_COMMAND:
1201 if (print_spool_command != system_lyxrc.print_spool_command) {
1202 os << "\\print_spool_command \"" << print_spool_command
1205 case RC_PRINTSPOOL_PRINTERPREFIX:
1206 if (print_spool_printerprefix
1207 != system_lyxrc.print_spool_printerprefix) {
1208 os << "\\print_spool_printerprefix \""
1209 << print_spool_printerprefix << "\"\n";
1211 case RC_PRINTEVENPAGEFLAG:
1212 if (print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1213 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1216 case RC_PRINTODDPAGEFLAG:
1217 if (print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1218 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1221 case RC_PRINTREVERSEFLAG:
1222 if (print_reverse_flag != system_lyxrc.print_reverse_flag) {
1223 os << "\\print_reverse_flag \"" << print_reverse_flag
1226 case RC_PRINTLANDSCAPEFLAG:
1227 if (print_landscape_flag != system_lyxrc.print_landscape_flag) {
1228 os << "\\print_landscape_flag \"" << print_landscape_flag
1231 case RC_PRINTPAGERANGEFLAG:
1232 if (print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1233 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1236 case RC_PRINTCOPIESFLAG:
1237 if (print_copies_flag != system_lyxrc.print_copies_flag) {
1238 os << "\\print_copies_flag \"" << print_copies_flag
1241 case RC_PRINTCOLLCOPIESFLAG:
1242 if (print_collcopies_flag
1243 != system_lyxrc.print_collcopies_flag) {
1244 os << "\\print_collcopies_flag \""
1245 << print_collcopies_flag
1248 case RC_PRINTPAPERFLAG:
1249 if (print_paper_flag != system_lyxrc.print_paper_flag) {
1250 os << "\\print_paper_flag \"" << print_paper_flag
1253 case RC_PRINTPAPERDIMENSIONFLAG:
1254 if (print_paper_dimension_flag
1255 != system_lyxrc.print_paper_dimension_flag) {
1256 os << "\\print_paper_dimension_flag \""
1257 << print_paper_dimension_flag << "\"\n";
1259 case RC_PRINTTOPRINTER:
1260 if (print_to_printer != system_lyxrc.print_to_printer) {
1261 os << "\\print_to_printer \"" << print_to_printer
1264 case RC_PRINTTOFILE:
1265 if (print_to_file != system_lyxrc.print_to_file) {
1266 os << "\\print_to_file \"" << print_to_file << "\"\n";
1268 case RC_PRINTFILEEXTENSION:
1269 if (print_file_extension != system_lyxrc.print_file_extension) {
1270 os << "\\print_file_extension \""
1271 << print_file_extension
1276 << "# EXPORT SECTION ####################################\n"
1279 case RC_CUSTOM_EXPORT_COMMAND:
1280 if (custom_export_command
1281 != system_lyxrc.custom_export_command) {
1282 os << "\\custom_export_command \""
1283 << custom_export_command
1286 case RC_CUSTOM_EXPORT_FORMAT:
1287 if (custom_export_format
1288 != system_lyxrc.custom_export_format) {
1289 os << "\\custom_export_format \"" << custom_export_format
1294 << "# TEX SECTION #######################################\n"
1297 case RC_FONT_ENCODING:
1298 if (fontenc != system_lyxrc.fontenc) {
1299 os << "\\font_encoding \"" << fontenc << "\"\n";
1303 << "# FILE SECTION ######################################\n"
1306 case RC_DOCUMENTPATH:
1307 if (document_path != system_lyxrc.document_path) {
1308 os << "\\document_path \"" << document_path << "\"\n";
1311 if (lastfiles != system_lyxrc.lastfiles) {
1312 os << "\\lastfiles \"" << lastfiles << "\"\n";
1314 case RC_NUMLASTFILES:
1315 if (num_lastfiles != system_lyxrc.num_lastfiles) {
1316 os << "\\num_lastfiles " << num_lastfiles << "\n";
1318 case RC_CHECKLASTFILES:
1319 if (check_lastfiles != system_lyxrc.check_lastfiles) {
1320 os << "\\check_lastfiles " << tostr(check_lastfiles)
1323 case RC_TEMPLATEPATH:
1324 if (template_path != system_lyxrc.template_path) {
1325 os << "\\template_path \"" << template_path << "\"\n";
1327 case RC_TEMPDIRPATH:
1328 if (tempdir_path != system_lyxrc.tempdir_path) {
1329 os << "\\tempdir_path \"" << tempdir_path << "\"\n";
1332 if (use_tempdir != system_lyxrc.use_tempdir) {
1333 os << "\\use_tempdir " << tostr(use_tempdir) << "\n";
1335 case RC_ASCII_LINELEN:
1336 if (ascii_linelen != system_lyxrc.ascii_linelen) {
1337 os << "\\ascii_linelen " << ascii_linelen << "\n";
1339 case RC_MAKE_BACKUP:
1340 if (make_backup != system_lyxrc.make_backup) {
1341 os << "\\make_backup " << tostr(make_backup) << "\n";
1343 case RC_BACKUPDIR_PATH:
1344 if (backupdir_path != system_lyxrc.backupdir_path) {
1345 os << "\\backupdir_path \"" << backupdir_path << "\"\n";
1350 << "# FAX SECTION #######################################\n"
1353 case RC_FAX_COMMAND:
1354 if (fax_command != system_lyxrc.fax_command) {
1355 os << "\\fax_command \"" << fax_command << "\"\n";
1358 if (phone_book != system_lyxrc.phone_book) {
1359 os << "\\phone_book \"" << phone_book << "\"\n";
1362 if (fax_program != system_lyxrc.fax_program) {
1363 os << "\\fax_program \"" << fax_program << "\"\n";
1367 << "# ASCII EXPORT SECTION ##############################\n"
1370 case RC_ASCIIROFF_COMMAND:
1371 if (ascii_roff_command != system_lyxrc.ascii_roff_command) {
1372 os << "\\ascii_roff_command \"" << ascii_roff_command
1377 << "# SPELLCHECKER SECTION ##############################\n"
1380 case RC_SPELL_COMMAND:
1381 if (isp_command != system_lyxrc.isp_command) {
1382 os << "\\spell_command \"" << isp_command << "\"\n";
1384 case RC_ACCEPT_COMPOUND:
1385 if (isp_accept_compound != system_lyxrc.isp_accept_compound) {
1386 os << "\\accept_compound " << tostr(isp_accept_compound)
1389 case RC_USE_ALT_LANG:
1390 if (isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1391 os << "\\use_alt_language " << tostr(isp_use_alt_lang)
1395 if (isp_alt_lang != system_lyxrc.isp_alt_lang) {
1396 os << "\\alternate_language \"" << isp_alt_lang
1399 case RC_USE_ESC_CHARS:
1400 if (isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1401 os << "\\use_escape_chars " << tostr(isp_use_esc_chars)
1405 if (isp_esc_chars != system_lyxrc.isp_esc_chars) {
1406 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1408 case RC_USE_PERS_DICT:
1409 if (isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1410 os << "\\use_personal_dictionary "
1411 << tostr(isp_use_pers_dict)
1415 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1416 os << "\\personal_dictionary \"" << isp_pers_dict
1419 case RC_USE_INP_ENC:
1420 if (isp_use_input_encoding
1421 != system_lyxrc.isp_use_input_encoding) {
1422 os << "\\use_input_encoding "
1423 << tostr(isp_use_input_encoding)
1428 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1431 case RC_RTL_SUPPORT:
1432 if (rtl_support != system_lyxrc.rtl_support) {
1433 os << "\\rtl " << tostr(rtl_support) << "\n";
1435 case RC_LANGUAGE_PACKAGE:
1436 if (language_package != system_lyxrc.language_package) {
1437 os << "\\language_package \"" << language_package
1440 case RC_LANGUAGE_COMMAND_BEGIN:
1441 if (language_command_begin
1442 != system_lyxrc.language_command_begin) {
1443 os << "\\language_command_begin \""
1444 << language_command_begin
1447 case RC_LANGUAGE_COMMAND_END:
1448 if (language_command_end
1449 != system_lyxrc.language_command_end) {
1450 os << "\\language_command_end \"" << language_command_end
1453 case RC_LANGUAGE_AUTO_BEGIN:
1454 if (language_auto_begin != system_lyxrc.language_auto_begin) {
1455 os << "\\language_auto_begin "
1456 << tostr(language_auto_begin) << "\n";
1458 case RC_LANGUAGE_AUTO_END:
1459 if (language_auto_end != system_lyxrc.language_auto_end) {
1460 os << "\\language_auto_end "
1461 << tostr(language_auto_end) << "\n";
1463 case RC_MARK_FOREIGN_LANGUAGE:
1464 if (mark_foreign_language
1465 != system_lyxrc.mark_foreign_language) {
1466 os << "\\mark_foreign_language " <<
1467 tostr(mark_foreign_language) << "\n";
1471 << "# 2nd MISC SUPPORT SECTION ##########################\n"
1474 case RC_OVERRIDE_X_DEADKEYS:
1475 if (override_x_deadkeys != system_lyxrc.override_x_deadkeys) {
1476 os << "\\override_x_deadkeys "
1477 << tostr(override_x_deadkeys) << "\n";
1479 case RC_SCREEN_FONT_ENCODING_MENU:
1480 if (font_norm_menu != system_lyxrc.font_norm_menu) {
1481 os << "\\screen_font_encoding_menu \"" << font_norm_menu
1484 case RC_AUTO_NUMBER:
1485 if (auto_number != system_lyxrc.auto_number) {
1486 os << "\\auto_number " << tostr(auto_number) << "\n";
1488 case RC_NEW_ASK_FILENAME:
1489 if (new_ask_filename != system_lyxrc.new_ask_filename) {
1490 os << "\\new_ask_filename " << tostr(new_ask_filename)
1493 case RC_DEFAULT_LANGUAGE:
1494 if (default_language != system_lyxrc.default_language) {
1495 os << "\\default_language " << default_language << "\n";
1499 << "# FORMATS SECTION ##########################\n"
1503 // Look for deleted formats
1504 for (Formats::const_iterator cit = formats.begin();
1505 cit != formats.end(); ++cit) {
1506 Format const * format =
1507 system_formats.GetFormat(cit->name());
1509 format->extension() != cit->extension() ||
1510 format->prettyname() != cit->prettyname() ||
1511 format->shortcut() != cit->shortcut())
1512 os << "\\format \"" << cit->name() << "\" \""
1513 << cit->extension() << "\" \""
1514 << cit->prettyname() << "\" \""
1515 << cit->shortcut() << "\"\n";
1518 // New/modifed formats
1519 for (Formats::const_iterator cit = system_formats.begin();
1520 cit != system_formats.end(); ++cit)
1521 if (!formats.GetFormat(cit->name()))
1522 os << "\\format \"" << cit->name()
1523 << "\" \"\" \"\" \"\"\n";
1525 for (Formats::const_iterator cit = formats.begin();
1526 cit != formats.end(); ++cit) {
1527 Format const * format =
1528 system_formats.GetFormat(cit->name());
1529 if ((!format || format->viewer() != cit->viewer()) &&
1530 (format || !cit->viewer().empty()))
1531 os << "\\viewer \"" << cit->name() << "\" \""
1532 << cit->viewer() << "\"\n";
1536 << "# CONVERTERS SECTION ##########################\n"
1540 // Look for new converters
1541 for (Converters::const_iterator cit = converters.begin();
1542 cit != converters.end(); ++cit) {
1543 Converter const * converter =
1544 system_converters.GetConverter(cit->from,
1547 converter->command != cit->command ||
1548 converter->flags != cit->flags)
1549 os << "\\converter \"" << cit->from << "\" \""
1550 << cit->to << "\" \""
1551 << cit->command << "\" \""
1552 << cit->flags << "\"\n";
1555 // New/modifed converters
1556 for (Converters::const_iterator cit = system_converters.begin();
1557 cit != system_converters.end(); ++cit)
1558 if (!converters.GetConverter(cit->from, cit->to))
1559 os << "\\converter \"" << cit->from
1560 << "\" \"" << cit->to << "\" \"\" \"\"\n";
1565 void LyXRC::set_font_norm_type()
1567 if (font_norm == "iso10646-1")
1568 font_norm_type = ISO_10646_1;
1569 else if (font_norm == "iso8859-1")
1570 font_norm_type = ISO_8859_1;
1571 else if (font_norm == "iso8859-6.8x")
1572 font_norm_type = ISO_8859_6_8;
1573 else if (font_norm == "iso8859-9")
1574 font_norm_type = ISO_8859_9;
1576 font_norm_type = OTHER_ENCODING;
1580 string const LyXRC::getDescription(LyXRCTags tag)
1585 case RC_FONT_ENCODING:
1586 str = N_("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
1590 str = N_("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
1593 case RC_PRINT_COMMAND:
1594 str = N_("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
1597 case RC_PRINTEVENPAGEFLAG:
1598 str = N_("The option to print only even pages.");
1601 case RC_PRINTODDPAGEFLAG:
1602 str = N_("The option to print only odd pages.");
1605 case RC_PRINTPAGERANGEFLAG:
1606 str = N_("The option for specifying a comma-separated list of pages to print.");
1609 case RC_PRINTCOPIESFLAG:
1610 str = N_("The option for specifying the number of copies to print.");
1613 case RC_PRINTCOLLCOPIESFLAG:
1614 str = N_("The option for specifying whether the copies should be collated.");
1617 case RC_PRINTREVERSEFLAG:
1618 str = N_("The option to reverse the order of the pages printed.");
1621 case RC_PRINTLANDSCAPEFLAG:
1622 str = N_("The option to print out in landscape.");
1625 case RC_PRINTPAPERFLAG:
1626 str = N_("The option to specify paper type.");
1629 case RC_PRINTPAPERDIMENSIONFLAG:
1630 str = N_("Option to specify the dimensions of the print paper.");
1633 case RC_PRINTTOPRINTER:
1634 str = N_("Option to pass to the print program to print on a specific printer.");
1637 case RC_PRINT_ADAPTOUTPUT:
1638 str = N_("Select for LyX to pass the name of the destination printer to your print command.");
1641 case RC_PRINTTOFILE:
1642 str = N_("Option to pass to the print program to print to a file.");
1645 case RC_PRINTFILEEXTENSION:
1646 str = N_("Extension of printer program output file. Usually \".ps\".");
1649 case RC_PRINTEXSTRAOPTIONS:
1650 str = N_("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
1653 case RC_PRINTSPOOL_COMMAND:
1654 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.");
1657 case RC_PRINTSPOOL_PRINTERPREFIX:
1658 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.");
1662 str = N_("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
1665 case RC_SCREEN_ZOOM:
1666 //xgettext:no-c-format
1667 str = N_("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
1670 case RC_SCREEN_FONT_SIZES:
1671 str = N_("The font sizes used for calculating the scaling of the screen fonts.");
1674 case RC_SCREEN_FONT_ROMAN:
1675 case RC_SCREEN_FONT_SANS:
1676 case RC_SCREEN_FONT_TYPEWRITER:
1677 str = N_("The screen fonts used to display the text while editing.");
1680 case RC_SCREEN_FONT_MENU:
1681 str = N_("The font for menus (and groups titles in popups).");
1684 case RC_SCREEN_FONT_POPUP:
1685 str = N_("The font for popups.");
1688 case RC_SCREEN_FONT_ENCODING:
1689 str = N_("The encoding for the screen fonts.");
1692 case RC_SCREEN_FONT_ENCODING_MENU:
1693 str = N_("The encoding for the menu/popups fonts.");
1700 str = N_("The time interval between auto-saves (in seconds). 0 means no auto-save.");
1703 case RC_DOCUMENTPATH:
1704 str = N_("The default path for your documents.");
1707 case RC_TEMPLATEPATH:
1708 str = N_("The path that LyX will set when offering to choose a template.");
1711 case RC_TEMPDIRPATH:
1712 str = N_("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
1716 str = N_("Select if you wish to use a temporary directory structure to store temporary TeX output.");
1720 str = N_("The file where the last-files information should be stored.");
1723 case RC_AUTOREGIONDELETE:
1724 str = N_("De-select if you don't want the current selection to be replaced automatically by what you type.");
1727 case RC_OVERRIDE_X_DEADKEYS:
1728 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.");
1733 str = N_("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
1737 str = N_("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
1741 str = N_("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
1745 case RC_KBMAP_PRIMARY:
1746 case RC_KBMAP_SECONDARY:
1747 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.");
1751 case RC_FAX_COMMAND:
1760 case RC_ASCIIROFF_COMMAND:
1761 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.");
1764 case RC_ASCII_LINELEN:
1765 str = N_("This is the maximum line length of an exported ASCII file (LaTeX, SGML or plain text).");
1768 case RC_NUMLASTFILES:
1769 str = N_("Maximal number of lastfiles. Up to 9 can appear in the file menu.");
1772 case RC_CHECKLASTFILES:
1773 str = N_("Select to check whether the lastfiles still exist.");
1776 case RC_VIEWDVI_PAPEROPTION:
1779 case RC_DEFAULT_PAPERSIZE:
1780 str = N_("Specify the default paper size.");
1786 case RC_ACCEPT_COMPOUND:
1787 str = N_("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
1790 case RC_SPELL_COMMAND:
1791 str = N_("What command runs the spell checker?");
1794 case RC_USE_INP_ENC:
1795 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.");
1798 case RC_USE_ALT_LANG:
1800 str = N_("Specify an alternate language. The default is to use the language of the document.");
1803 case RC_USE_PERS_DICT:
1805 str = N_("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
1808 case RC_USE_ESC_CHARS:
1810 str = N_("Specify additional chars that can be part of a word.");
1813 case RC_SCREEN_FONT_SCALABLE:
1814 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.");
1817 case RC_CHKTEX_COMMAND:
1818 str = N_("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
1821 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1822 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.");
1825 case RC_EXIT_CONFIRMATION:
1826 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.)");
1829 case RC_DISPLAY_SHORTCUTS:
1830 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.");
1833 case RC_MAKE_BACKUP:
1834 str = N_("De-select if you don't want LyX to create backup files.");
1837 case RC_BACKUPDIR_PATH:
1838 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.");
1841 case RC_RTL_SUPPORT:
1842 str = N_("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
1845 case RC_MARK_FOREIGN_LANGUAGE:
1846 str = N_("Select to control the highlighting of words with a language foreign to that of the document.");
1849 case RC_LANGUAGE_PACKAGE:
1850 str = N_("The latex command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
1853 case RC_LANGUAGE_AUTO_BEGIN:
1854 str = N_("Select if a language switching command is needed at the beginning of the document.");
1857 case RC_LANGUAGE_AUTO_END:
1858 str = N_("Select if a language switching command is needed at the end of the document.");
1861 case RC_LANGUAGE_COMMAND_BEGIN:
1862 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.");
1865 case RC_LANGUAGE_COMMAND_END:
1866 str = N_("The latex command for changing back to the language of the document.");
1869 case RC_DATE_INSERT_FORMAT:
1870 //xgettext:no-c-format
1871 str = N_("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
1874 case RC_SHOW_BANNER:
1875 str = N_("De-select if you don't want the startup banner.");
1879 str = N_("The wheel movement factor (for mice with wheels or five button mice).");
1891 case RC_NEW_ASK_FILENAME:
1892 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.");
1895 case RC_DEFAULT_LANGUAGE:
1896 str = N_("New documents will be assigned this language.");
1906 // The global instance
1909 // The global copy of the system lyxrc entries (everything except preferences)