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 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
82 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
83 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
84 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
85 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
86 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
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 },
95 { "\\phone_book", LyXRC::RC_PHONEBOOK },
97 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
98 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
99 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
100 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
101 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
102 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
103 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
104 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
105 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
106 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
107 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
108 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
109 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
110 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
111 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
112 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
113 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
114 { "\\printer", LyXRC::RC_PRINTER },
115 { "\\ps_command", LyXRC::RC_PS_COMMAND },
116 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
117 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
118 { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
119 { "\\screen_font_encoding_menu", LyXRC::RC_SCREEN_FONT_ENCODING_MENU },
120 { "\\screen_font_menu", LyXRC::RC_SCREEN_FONT_MENU },
121 { "\\screen_font_popup", LyXRC::RC_SCREEN_FONT_POPUP },
122 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
123 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
124 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
125 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
126 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
127 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
128 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
129 { "\\set_color", LyXRC::RC_SET_COLOR },
130 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
131 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
132 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
133 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
134 { "\\ui_file", LyXRC::RC_UIFILE },
135 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
136 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
137 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
138 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
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 static const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
155 void LyXRC::setDefaults() {
157 // Get printer from the environment. If fail, use default "",
158 // assuming that everything is set up correctly.
159 printer = GetEnv("PRINTER");
160 print_adapt_output = false;
161 print_command = "dvips";
162 print_evenpage_flag = "-B";
163 print_oddpage_flag = "-A";
164 print_pagerange_flag = "-pp";
165 print_copies_flag = "-c";
166 print_collcopies_flag = "-C";
167 print_reverse_flag = "-r";
168 print_landscape_flag = "-t landscape";
169 print_to_printer = "-P";
170 print_to_file = "-o ";
171 print_file_extension = ".ps";
172 print_paper_flag = "-t";
173 print_paper_dimension_flag = "-T";
174 document_path = GetEnvPath("HOME");
175 tempdir_path = "/tmp";
178 view_dvi_paper_option = "-paper";
179 default_papersize = BufferParams::PAPER_USLETTER;
180 custom_export_format = "ps";
181 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
184 // Because a screen typically is wider than a piece of paper:
187 // Default LaTeX font size:
188 font_sizes[LyXFont::SIZE_TINY] = 5.0;
189 font_sizes[LyXFont::SIZE_SCRIPT] = 7.0;
190 font_sizes[LyXFont::SIZE_FOOTNOTE] = 8.0;
191 font_sizes[LyXFont::SIZE_SMALL] = 9.0;
192 font_sizes[LyXFont::SIZE_NORMAL] = 10.0;
193 font_sizes[LyXFont::SIZE_LARGE] = 12.0;
194 font_sizes[LyXFont::SIZE_LARGER] = 14.4;
195 font_sizes[LyXFont::SIZE_LARGEST] = 17.26;
196 font_sizes[LyXFont::SIZE_HUGE] = 20.74;
197 font_sizes[LyXFont::SIZE_HUGER] = 24.88;
198 use_scalable_fonts = true;
199 roman_font_name = "-*-times";
200 sans_font_name = "-*-helvetica";
201 typewriter_font_name = "-*-courier";
202 menu_font_name = "-*-helvetica-bold-r";
203 popup_font_name = "-*-helvetica-medium-r";
204 font_norm = "iso8859-1";
205 font_norm_type = OTHER_ENCODING;
207 override_x_deadkeys = true;
209 auto_region_delete = true;
212 check_lastfiles = true;
215 exit_confirmation = true;
216 display_shortcuts = true;
217 // Spellchecker settings:
218 isp_command = "ispell";
219 isp_accept_compound = false;
220 isp_use_input_encoding = false;
221 isp_use_alt_lang = false;
222 isp_use_pers_dict = false;
223 isp_use_esc_chars = false;
228 mark_foreign_language = true;
229 language_package = "\\usepackage{babel}";
230 language_auto_begin = true;
231 language_auto_end = true;
232 language_command_begin = "\\selectlanguage{$$lang}";
233 language_command_end = "\\selectlanguage{$$lang}";
234 default_language = "english";
236 new_ask_filename = false;
239 date_insert_format = "%A, %e %B %Y";
241 cursor_follows_scrollbar = false;
242 label_init_length = 3;
244 /// These variables are not stored on disk (perhaps they
245 // should be moved from the LyXRC class).
251 int LyXRC::ReadBindFile(string const & name)
254 string const tmp = i18nLibFileSearch("bind", name, "bind");
255 lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
256 int const result = read(tmp);
258 lyxerr << "Error reading bind file: " << tmp << endl;
264 int LyXRC::read(string const & filename)
267 static string const bindFile("cua");
269 LyXLex lexrc(lyxrcTags, lyxrcCount);
270 if (lyxerr.debugging(Debug::PARSER))
271 lexrc.printTable(lyxerr);
273 lexrc.setFile(filename);
274 if (!lexrc.IsOK()) return -2;
276 lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
278 while (lexrc.IsOK()) {
279 // By using two switches we take advantage of the compiler
280 // telling us if we have missed a LyXRCTags element in
281 // the second switch.
282 // Note that this also shows a problem with LyXLex since it
283 // helps us avoid taking advantage of the strictness of the
286 int le = lexrc.lex();
288 case LyXLex::LEX_UNDEF:
289 lexrc.printError("Unknown tag `$$Token'");
291 case LyXLex::LEX_FEOF:
295 switch (static_cast<LyXRCTags>(le)) {
296 case RC_INPUT: // Include file
298 string tmp = LibFileSearch(string(),
301 lexrc.printError("Error reading "
302 "included file: "+tmp);
306 case RC_BINDFILE: // RVDK_PATCH_5
308 string tmp(lexrc.GetString());
309 if (bind_file.empty()) {
310 // we only need the name of the first
311 // bind file since that (usually)
312 // includes several others.
321 ui_file = lexrc.GetString();
325 case RC_EXIT_CONFIRMATION:
327 exit_confirmation = lexrc.GetBool();
330 case RC_DISPLAY_SHORTCUTS:
332 display_shortcuts = lexrc.GetBool();
337 use_kbmap = lexrc.GetBool();
340 case RC_KBMAP_PRIMARY:
342 string kmap(lexrc.GetString());
345 } else if (!LibFileSearch("kbd", kmap,
347 primary_kbmap = kmap;
349 lexrc.printError("LyX: Keymap `$$Token' not found");
353 case RC_KBMAP_SECONDARY:
355 string kmap(lexrc.GetString());
358 } else if (!LibFileSearch("kbd", kmap,
360 secondary_kbmap = kmap;
362 lexrc.printError("LyX: Keymap `$$Token' not found");
366 case RC_FONT_ENCODING:
368 fontenc = lexrc.GetString();
373 printer = lexrc.GetString();
376 case RC_PRINT_COMMAND:
378 print_command = lexrc.GetString();
381 case RC_PRINTEVENPAGEFLAG:
383 print_evenpage_flag = lexrc.GetString();
386 case RC_PRINTODDPAGEFLAG:
388 print_oddpage_flag = lexrc.GetString();
391 case RC_PRINTPAGERANGEFLAG:
393 print_pagerange_flag = lexrc.GetString();
396 case RC_PRINTCOPIESFLAG:
398 print_copies_flag = lexrc.GetString();
401 case RC_PRINTCOLLCOPIESFLAG:
403 print_collcopies_flag = lexrc.GetString();
406 case RC_PRINTREVERSEFLAG:
408 print_reverse_flag = lexrc.GetString();
411 case RC_PRINTLANDSCAPEFLAG:
413 print_landscape_flag = lexrc.GetString();
416 case RC_PRINTTOPRINTER:
418 print_to_printer = lexrc.GetString();
421 case RC_PRINT_ADAPTOUTPUT:
423 print_adapt_output = lexrc.GetBool();
428 print_to_file = lexrc.GetString();
431 case RC_PRINTFILEEXTENSION:
433 print_file_extension = lexrc.GetString();
436 case RC_PRINTEXSTRAOPTIONS:
438 print_extra_options = lexrc.GetString();
441 case RC_PRINTSPOOL_COMMAND:
443 print_spool_command = lexrc.GetString();
446 case RC_PRINTSPOOL_PRINTERPREFIX:
448 print_spool_printerprefix = lexrc.GetString();
451 case RC_PRINTPAPERDIMENSIONFLAG:
453 print_paper_dimension_flag = lexrc.GetString();
456 case RC_PRINTPAPERFLAG:
458 print_paper_flag = lexrc.GetString();
461 case RC_CUSTOM_EXPORT_COMMAND:
463 custom_export_command = lexrc.GetString();
466 case RC_CUSTOM_EXPORT_FORMAT:
468 custom_export_format = lexrc.GetString();
471 case RC_DEFAULT_PAPERSIZE:
473 string size = lowercase(lexrc.GetString());
474 if (size == "usletter")
476 BufferParams::PAPER_USLETTER;
477 else if (size == "legal")
479 BufferParams::PAPER_LEGALPAPER;
480 else if (size == "executive")
482 BufferParams::PAPER_EXECUTIVEPAPER;
483 else if (size == "a3")
485 BufferParams::PAPER_A3PAPER;
486 else if (size == "a4")
488 BufferParams::PAPER_A4PAPER;
489 else if (size == "a5")
491 BufferParams::PAPER_A5PAPER;
492 else if (size == "b5")
494 BufferParams::PAPER_B5PAPER;
498 case RC_VIEWDVI_PAPEROPTION:
500 view_dvi_paper_option = lexrc.GetString();
502 view_dvi_paper_option = "";
507 ps_command = lexrc.GetString();
510 case RC_CHKTEX_COMMAND:
512 chktex_command = lexrc.GetString();
517 dpi = lexrc.GetInteger();
522 zoom = lexrc.GetInteger();
527 wheel_jump = lexrc.GetInteger();
530 case RC_SCREEN_FONT_SIZES:
532 font_sizes[LyXFont::SIZE_TINY] =
535 font_sizes[LyXFont::SIZE_SCRIPT] =
538 font_sizes[LyXFont::SIZE_FOOTNOTE] =
541 font_sizes[LyXFont::SIZE_SMALL] =
544 font_sizes[LyXFont::SIZE_NORMAL] =
547 font_sizes[LyXFont::SIZE_LARGE] =
550 font_sizes[LyXFont::SIZE_LARGER] =
553 font_sizes[LyXFont::SIZE_LARGEST] =
556 font_sizes[LyXFont::SIZE_HUGE] =
559 font_sizes[LyXFont::SIZE_HUGER] =
563 case RC_SCREEN_FONT_SCALABLE:
565 use_scalable_fonts = lexrc.GetBool();
570 autosave = lexrc.GetInteger();
573 case RC_DOCUMENTPATH:
575 document_path = ExpandPath(lexrc.GetString());
579 case RC_TEMPLATEPATH:
581 template_path = ExpandPath(lexrc.GetString());
586 tempdir_path = ExpandPath(lexrc.GetString());
591 use_tempdir = lexrc.GetBool();
596 lastfiles = ExpandPath(lexrc.GetString());
599 case RC_NUMLASTFILES:
601 num_lastfiles = lexrc.GetInteger();
604 case RC_CHECKLASTFILES:
606 check_lastfiles = lexrc.GetBool();
609 case RC_SCREEN_FONT_ROMAN:
611 roman_font_name = lexrc.GetString();
614 case RC_SCREEN_FONT_SANS:
616 sans_font_name = lexrc.GetString();
619 case RC_SCREEN_FONT_TYPEWRITER:
621 typewriter_font_name = lexrc.GetString();
624 case RC_SCREEN_FONT_MENU:
626 menu_font_name = lexrc.GetString();
629 case RC_SCREEN_FONT_POPUP:
631 popup_font_name = lexrc.GetString();
634 case RC_SCREEN_FONT_ENCODING:
636 font_norm = lexrc.GetString();
637 set_font_norm_type();
641 case RC_SCREEN_FONT_ENCODING_MENU:
643 font_norm_menu = lexrc.GetString();
648 string lyx_name, x11_name;
651 lyx_name = lexrc.GetString();
653 lexrc.printError("Missing color tag.");
658 x11_name = lexrc.GetString();
660 lexrc.printError("Missing color name for color : `$$Token'");
664 if (!lcolor.setColor(lyx_name, x11_name))
665 lyxerr << "Bad lyxrc set_color for "
670 case RC_AUTOREGIONDELETE:
671 // Auto region delete defaults to true
673 auto_region_delete = lexrc.GetBool();
678 // we should not do an explicit binding before
679 // loading a bind file. So, in this case, load
680 // the default bind file.
682 bind_file = bindFile;
685 // !!!chb, dynamic key binding...
689 if (lexrc.lex() == LyXLex::LEX_DATA) {
690 seq = lexrc.GetString();
692 lexrc.printError("Bad key sequence: `$$Token'");
696 if (lexrc.lex() == LyXLex::LEX_DATA) {
697 cmd = lexrc.GetString();
699 lexrc.printError("Bad command: `$$Token'");
703 if ((action = lyxaction.LookupFunc(cmd))>= 0) {
704 if (lyxerr.debugging(Debug::KBMAP)) {
705 lyxerr << "RC_BIND: Sequence `"
706 << seq << "' Command `"
707 << cmd << "' Action `"
708 << action << '\'' << endl;
710 res = toplevel_keymap->bind(seq, action);
713 "Invalid key sequence `"
716 } else {// cmd is the last token read.
718 "Unknown LyX function `$$Token'");
722 case RC_OVERRIDE_X_DEADKEYS:
724 override_x_deadkeys = lexrc.GetBool();
729 lyxpipes = ExpandPath(lexrc.GetString());
732 case RC_CURSOR_FOLLOWS_SCROLLBAR:
734 cursor_follows_scrollbar = lexrc.GetBool();
740 fax_command = lexrc.GetString();
744 fax_program = lexrc.GetString();
748 string s = lexrc.GetString();
752 phone_book = user_lyxdir + s;
756 case RC_ASCIIROFF_COMMAND:
758 ascii_roff_command = lexrc.GetString();
760 case RC_ASCII_LINELEN:
762 ascii_linelen = lexrc.GetInteger();
764 // Spellchecker settings:
765 case RC_SPELL_COMMAND:
767 isp_command = lexrc.GetString();
769 case RC_ACCEPT_COMPOUND:
771 isp_accept_compound = lexrc.GetBool();
775 isp_use_input_encoding = lexrc.GetBool();
777 case RC_USE_ALT_LANG:
779 isp_use_alt_lang = lexrc.GetBool();
781 case RC_USE_PERS_DICT:
783 isp_use_pers_dict = lexrc.GetBool();
785 case RC_USE_ESC_CHARS:
787 isp_use_esc_chars = lexrc.GetBool();
791 isp_alt_lang = lexrc.GetString();
795 isp_pers_dict = lexrc.GetString();
799 isp_esc_chars = lexrc.GetString();
803 make_backup = lexrc.GetBool();
805 case RC_BACKUPDIR_PATH:
807 backupdir_path = ExpandPath(lexrc.GetString());
809 case RC_DATE_INSERT_FORMAT:
811 date_insert_format = lexrc.GetString();
813 case RC_LANGUAGE_PACKAGE:
815 language_package = lexrc.GetString();
817 case RC_LANGUAGE_AUTO_BEGIN:
819 language_auto_begin = lexrc.GetBool();
821 case RC_LANGUAGE_AUTO_END:
823 language_auto_end = lexrc.GetBool();
825 case RC_LANGUAGE_COMMAND_BEGIN:
827 language_command_begin = lexrc.GetString();
829 case RC_LANGUAGE_COMMAND_END:
831 language_command_end = lexrc.GetString();
835 rtl_support = lexrc.GetBool();
839 auto_number = lexrc.GetBool();
841 case RC_MARK_FOREIGN_LANGUAGE:
843 mark_foreign_language = lexrc.GetBool();
847 show_banner = lexrc.GetBool();
850 case RC_NEW_ASK_FILENAME:
852 new_ask_filename = lexrc.GetBool();
855 string from, to, command, flags;
857 from = lexrc.GetString();
859 to = lexrc.GetString();
861 command = lexrc.GetString();
863 flags = lexrc.GetString();
864 if (command.empty() || command == "none")
865 converters.Delete(from, to);
867 converters.Add(from, to, command, flags);
871 string format, command;
873 format = lexrc.GetString();
875 command = lexrc.GetString();
876 formats.SetViewer(format, command);
880 string format, extension, prettyname, shortcut;
882 format = lexrc.GetString();
884 extension = lexrc.GetString();
886 prettyname = lexrc.GetString();
888 shortcut = lexrc.GetString();
889 if (prettyname.empty()) {
890 if (converters.FormatIsUsed(format))
891 lyxerr << "Can't delete format "
894 formats.Delete(format);
897 formats.Add(format, extension, prettyname,
901 case RC_DEFAULT_LANGUAGE:
903 default_language = lexrc.GetString();
906 case RC_LABEL_INIT_LENGTH:
908 label_init_length = lexrc.GetInteger();
911 case RC_LAST: break; // this is just a dummy
919 void LyXRC::write(string const & filename) const
921 ofstream ofs(filename.c_str());
927 void LyXRC::print() const
929 if (lyxerr.debugging())
936 void LyXRC::output(ostream & os) const
938 os << "### This file is part of\n"
939 << "### ========================================================\n"
940 << "### LyX, The Document Processor\n"
942 << "### Copyright 1995 Matthias Ettrich\n"
943 << "### Copyright 1995-2000 The LyX Team.\n"
945 << "### ========================================================\n"
947 << "# This file is written by LyX, if you want to make your own\n"
948 << "# modifications you should do them from inside LyX and save\n"
951 // Why the switch you might ask. It is a trick to ensure that all
952 // the elements in the LyXRCTags enum is handled. As you can see
953 // there are no breaks at all. So it is just a huge fall-through.
954 // The nice thing is that we will get a warning from the compiler
955 // if we forget an element.
956 LyXRCTags tag = RC_LAST;
960 // input/include files are not done here
962 // bindings is not written to the preferences file.
964 if (bind_file != system_lyxrc.bind_file) {
965 os << "\\bind_file " << bind_file << "\n";
971 << "# MISC SECTION ######################################\n"
975 if (show_banner != system_lyxrc.show_banner) {
976 os << "# Set to false to inhibit the startup banner.\n"
977 << "\\show_banner " << tostr(show_banner) << "\n";
979 // bind files are not done here.
981 if (ui_file != system_lyxrc.ui_file) {
982 os << "\\ui_file \"" << ui_file << "\"\n";
984 case RC_AUTOREGIONDELETE:
985 if (auto_region_delete != system_lyxrc.auto_region_delete) {
986 os << "# Set to false to inhibit automatic replacement of\n"
987 << "# the current selection.\n"
988 << "\\auto_region_delete " << tostr(auto_region_delete)
992 if (autosave != system_lyxrc.autosave) {
993 os << "# The time interval between auto-saves in seconds.\n"
994 << "\\autosave " << autosave << "\n";
996 case RC_EXIT_CONFIRMATION:
997 if (exit_confirmation != system_lyxrc.exit_confirmation) {
998 os << "# Ask for confirmation before exit if there are\n"
999 << "# unsaved changed documents.\n"
1000 << "\\exit_confirmation " << tostr(exit_confirmation)
1003 case RC_DISPLAY_SHORTCUTS:
1004 if (display_shortcuts != system_lyxrc.display_shortcuts) {
1005 os << "# Display name of the last command executed,\n"
1006 << "# with a list of short-cuts in the minibuffer.\n"
1007 << "\\display_shortcuts " << tostr(display_shortcuts)
1010 case RC_VIEWDVI_PAPEROPTION:
1011 if (view_dvi_paper_option
1012 != system_lyxrc.view_dvi_paper_option) {
1013 os << "# Options used to specify paper size to the\n"
1014 << "# view_dvi_command\n"
1015 << "\\view_dvi_paper_option \""
1016 << view_dvi_paper_option << "\"\n";
1018 case RC_DEFAULT_PAPERSIZE:
1019 if (default_papersize != system_lyxrc.default_papersize) {
1020 os << "# The default papersize to use.\n"
1021 << "\\default_papersize \"";
1022 switch (default_papersize) {
1023 case BufferParams::PAPER_USLETTER:
1024 os << "usletter"; break;
1025 case BufferParams::PAPER_LEGALPAPER:
1026 os << "legal"; break;
1027 case BufferParams::PAPER_EXECUTIVEPAPER:
1028 os << "executive"; break;
1029 case BufferParams::PAPER_A3PAPER:
1031 case BufferParams::PAPER_A4PAPER:
1033 case BufferParams::PAPER_A5PAPER:
1035 case BufferParams::PAPER_B5PAPER:
1037 case BufferParams::PAPER_DEFAULT: break;
1042 if (ps_command != system_lyxrc.ps_command) {
1043 os << "# Program used for interpreting postscript.\n"
1044 << "\\ps_command \"" << ps_command << "\"\n";
1046 case RC_CHKTEX_COMMAND:
1047 if (chktex_command != system_lyxrc.chktex_command) {
1048 os << "\\chktex_command \"" << chktex_command << "\"\n";
1051 if (use_kbmap != system_lyxrc.use_kbmap) {
1052 os << "\\kbmap " << tostr(use_kbmap) << "\n";
1054 case RC_KBMAP_PRIMARY:
1055 if (primary_kbmap != system_lyxrc.primary_kbmap) {
1056 os << "\\kbmap_primary \"" << primary_kbmap << "\"\n";
1058 case RC_KBMAP_SECONDARY:
1059 if (secondary_kbmap != system_lyxrc.secondary_kbmap) {
1060 os << "\\kbmap_secondary \"" << secondary_kbmap
1064 if (lyxpipes != system_lyxrc.lyxpipes) {
1065 os << "\\serverpipe \"" << lyxpipes << "\"\n";
1067 case RC_DATE_INSERT_FORMAT:
1068 if (date_insert_format != system_lyxrc.date_insert_format) {
1069 os << "\\date_insert_format \"" << date_insert_format
1072 case RC_LABEL_INIT_LENGTH:
1073 if (label_init_length != system_lyxrc.label_init_length) {
1074 os << "\\label_init_length " << label_init_length
1079 << "# SCREEN & FONTS SECTION ############################\n"
1083 if (dpi != system_lyxrc.dpi) {
1084 os << "\\screen_dpi " << dpi << "\n";
1086 case RC_SCREEN_ZOOM:
1087 if (zoom != system_lyxrc.zoom) {
1088 os << "\\screen_zoom " << zoom << "\n";
1091 if (wheel_jump != system_lyxrc.wheel_jump) {
1092 os << "\\wheel_jump " << wheel_jump << "\n";
1094 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1095 if (cursor_follows_scrollbar
1096 != system_lyxrc.cursor_follows_scrollbar) {
1097 os << "\\cursor_follows_scrollbar "
1098 << tostr(cursor_follows_scrollbar) << "\n";
1100 case RC_SCREEN_FONT_ROMAN:
1101 if (roman_font_name != system_lyxrc.roman_font_name) {
1102 os << "\\screen_font_roman \"" << roman_font_name
1105 case RC_SCREEN_FONT_SANS:
1106 if (sans_font_name != system_lyxrc.sans_font_name) {
1107 os << "\\screen_font_sans \"" << sans_font_name
1110 case RC_SCREEN_FONT_TYPEWRITER:
1111 if (typewriter_font_name != system_lyxrc.typewriter_font_name) {
1112 os << "\\screen_font_typewriter \""
1113 << typewriter_font_name << "\"\n";
1115 case RC_SCREEN_FONT_SCALABLE:
1116 if (use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1117 os << "\\screen_font_scalable "
1118 << tostr(use_scalable_fonts)
1121 case RC_SCREEN_FONT_ENCODING:
1122 if (font_norm != system_lyxrc.font_norm) {
1123 os << "\\screen_font_encoding \"" << font_norm
1126 case RC_SCREEN_FONT_POPUP:
1127 if (popup_font_name != system_lyxrc.popup_font_name) {
1128 os << "\\screen_font_popup \"" << popup_font_name
1131 case RC_SCREEN_FONT_MENU:
1132 if (menu_font_name != system_lyxrc.menu_font_name) {
1133 os << "\\screen_font_menu \"" << menu_font_name
1136 case RC_SCREEN_FONT_SIZES:
1137 if (font_sizes[LyXFont::SIZE_TINY]
1138 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1139 font_sizes[LyXFont::SIZE_SCRIPT]
1140 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1141 font_sizes[LyXFont::SIZE_FOOTNOTE]
1142 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1143 font_sizes[LyXFont::SIZE_SMALL]
1144 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1145 font_sizes[LyXFont::SIZE_NORMAL]
1146 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1147 font_sizes[LyXFont::SIZE_LARGE]
1148 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1149 font_sizes[LyXFont::SIZE_LARGER]
1150 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1151 font_sizes[LyXFont::SIZE_LARGEST]
1152 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1153 font_sizes[LyXFont::SIZE_HUGE]
1154 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1155 font_sizes[LyXFont::SIZE_HUGER]
1156 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1157 os.setf(ios::fixed);
1159 os << "\\screen_font_sizes"
1160 << " " << font_sizes[LyXFont::SIZE_TINY]
1161 << " " << font_sizes[LyXFont::SIZE_SCRIPT]
1162 << " " << font_sizes[LyXFont::SIZE_FOOTNOTE]
1163 << " " << font_sizes[LyXFont::SIZE_SMALL]
1164 << " " << font_sizes[LyXFont::SIZE_NORMAL]
1165 << " " << font_sizes[LyXFont::SIZE_LARGE]
1166 << " " << font_sizes[LyXFont::SIZE_LARGER]
1167 << " " << font_sizes[LyXFont::SIZE_LARGEST]
1168 << " " << font_sizes[LyXFont::SIZE_HUGE]
1169 << " " << font_sizes[LyXFont::SIZE_HUGER]
1174 << "# COLOR SECTION ###################################\n"
1178 for (int i = 0; i < LColor::ignore; ++i ) {
1179 LColor::color lc = static_cast<LColor::color>(i);
1181 string const col(lcolor.getX11Name(lc));
1182 if (col != system_lcolor.getX11Name(lc)) {
1183 os << "\\set_color \""
1184 << lcolor.getLyXName(lc) << "\" \""
1190 << "# PRINTER SECTION ###################################\n"
1194 if (printer != system_lyxrc.printer) {
1195 os << "\\printer \"" << printer << "\"\n";
1197 case RC_PRINT_ADAPTOUTPUT:
1198 if (print_adapt_output != system_lyxrc.print_adapt_output) {
1199 os << "\\print_adapt_output "
1200 << tostr(print_adapt_output)
1203 case RC_PRINT_COMMAND:
1204 if (print_command != system_lyxrc.print_command) {
1205 os << "\\print_command \"" << print_command << "\"\n";
1207 case RC_PRINTEXSTRAOPTIONS:
1208 if (print_extra_options != system_lyxrc.print_extra_options) {
1209 os << "\\print_extra_options \"" << print_extra_options
1212 case RC_PRINTSPOOL_COMMAND:
1213 if (print_spool_command != system_lyxrc.print_spool_command) {
1214 os << "\\print_spool_command \"" << print_spool_command
1217 case RC_PRINTSPOOL_PRINTERPREFIX:
1218 if (print_spool_printerprefix
1219 != system_lyxrc.print_spool_printerprefix) {
1220 os << "\\print_spool_printerprefix \""
1221 << print_spool_printerprefix << "\"\n";
1223 case RC_PRINTEVENPAGEFLAG:
1224 if (print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1225 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1228 case RC_PRINTODDPAGEFLAG:
1229 if (print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1230 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1233 case RC_PRINTREVERSEFLAG:
1234 if (print_reverse_flag != system_lyxrc.print_reverse_flag) {
1235 os << "\\print_reverse_flag \"" << print_reverse_flag
1238 case RC_PRINTLANDSCAPEFLAG:
1239 if (print_landscape_flag != system_lyxrc.print_landscape_flag) {
1240 os << "\\print_landscape_flag \"" << print_landscape_flag
1243 case RC_PRINTPAGERANGEFLAG:
1244 if (print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1245 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1248 case RC_PRINTCOPIESFLAG:
1249 if (print_copies_flag != system_lyxrc.print_copies_flag) {
1250 os << "\\print_copies_flag \"" << print_copies_flag
1253 case RC_PRINTCOLLCOPIESFLAG:
1254 if (print_collcopies_flag
1255 != system_lyxrc.print_collcopies_flag) {
1256 os << "\\print_collcopies_flag \""
1257 << print_collcopies_flag
1260 case RC_PRINTPAPERFLAG:
1261 if (print_paper_flag != system_lyxrc.print_paper_flag) {
1262 os << "\\print_paper_flag \"" << print_paper_flag
1265 case RC_PRINTPAPERDIMENSIONFLAG:
1266 if (print_paper_dimension_flag
1267 != system_lyxrc.print_paper_dimension_flag) {
1268 os << "\\print_paper_dimension_flag \""
1269 << print_paper_dimension_flag << "\"\n";
1271 case RC_PRINTTOPRINTER:
1272 if (print_to_printer != system_lyxrc.print_to_printer) {
1273 os << "\\print_to_printer \"" << print_to_printer
1276 case RC_PRINTTOFILE:
1277 if (print_to_file != system_lyxrc.print_to_file) {
1278 os << "\\print_to_file \"" << print_to_file << "\"\n";
1280 case RC_PRINTFILEEXTENSION:
1281 if (print_file_extension != system_lyxrc.print_file_extension) {
1282 os << "\\print_file_extension \""
1283 << print_file_extension
1288 << "# EXPORT SECTION ####################################\n"
1291 case RC_CUSTOM_EXPORT_COMMAND:
1292 if (custom_export_command
1293 != system_lyxrc.custom_export_command) {
1294 os << "\\custom_export_command \""
1295 << custom_export_command
1298 case RC_CUSTOM_EXPORT_FORMAT:
1299 if (custom_export_format
1300 != system_lyxrc.custom_export_format) {
1301 os << "\\custom_export_format \"" << custom_export_format
1306 << "# TEX SECTION #######################################\n"
1309 case RC_FONT_ENCODING:
1310 if (fontenc != system_lyxrc.fontenc) {
1311 os << "\\font_encoding \"" << fontenc << "\"\n";
1315 << "# FILE SECTION ######################################\n"
1318 case RC_DOCUMENTPATH:
1319 if (document_path != system_lyxrc.document_path) {
1320 os << "\\document_path \"" << document_path << "\"\n";
1323 if (lastfiles != system_lyxrc.lastfiles) {
1324 os << "\\lastfiles \"" << lastfiles << "\"\n";
1326 case RC_NUMLASTFILES:
1327 if (num_lastfiles != system_lyxrc.num_lastfiles) {
1328 os << "\\num_lastfiles " << num_lastfiles << "\n";
1330 case RC_CHECKLASTFILES:
1331 if (check_lastfiles != system_lyxrc.check_lastfiles) {
1332 os << "\\check_lastfiles " << tostr(check_lastfiles)
1335 case RC_TEMPLATEPATH:
1336 if (template_path != system_lyxrc.template_path) {
1337 os << "\\template_path \"" << template_path << "\"\n";
1339 case RC_TEMPDIRPATH:
1340 if (tempdir_path != system_lyxrc.tempdir_path) {
1341 os << "\\tempdir_path \"" << tempdir_path << "\"\n";
1344 if (use_tempdir != system_lyxrc.use_tempdir) {
1345 os << "\\use_tempdir " << tostr(use_tempdir) << "\n";
1347 case RC_ASCII_LINELEN:
1348 if (ascii_linelen != system_lyxrc.ascii_linelen) {
1349 os << "\\ascii_linelen " << ascii_linelen << "\n";
1351 case RC_MAKE_BACKUP:
1352 if (make_backup != system_lyxrc.make_backup) {
1353 os << "\\make_backup " << tostr(make_backup) << "\n";
1355 case RC_BACKUPDIR_PATH:
1356 if (backupdir_path != system_lyxrc.backupdir_path) {
1357 os << "\\backupdir_path \"" << backupdir_path << "\"\n";
1362 << "# FAX SECTION #######################################\n"
1365 case RC_FAX_COMMAND:
1366 if (fax_command != system_lyxrc.fax_command) {
1367 os << "\\fax_command \"" << fax_command << "\"\n";
1370 if (phone_book != system_lyxrc.phone_book) {
1371 os << "\\phone_book \"" << phone_book << "\"\n";
1374 if (fax_program != system_lyxrc.fax_program) {
1375 os << "\\fax_program \"" << fax_program << "\"\n";
1379 << "# ASCII EXPORT SECTION ##############################\n"
1382 case RC_ASCIIROFF_COMMAND:
1383 if (ascii_roff_command != system_lyxrc.ascii_roff_command) {
1384 os << "\\ascii_roff_command \"" << ascii_roff_command
1389 << "# SPELLCHECKER SECTION ##############################\n"
1392 case RC_SPELL_COMMAND:
1393 if (isp_command != system_lyxrc.isp_command) {
1394 os << "\\spell_command \"" << isp_command << "\"\n";
1396 case RC_ACCEPT_COMPOUND:
1397 if (isp_accept_compound != system_lyxrc.isp_accept_compound) {
1398 os << "\\accept_compound " << tostr(isp_accept_compound)
1401 case RC_USE_ALT_LANG:
1402 if (isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1403 os << "\\use_alt_language " << tostr(isp_use_alt_lang)
1407 if (isp_alt_lang != system_lyxrc.isp_alt_lang) {
1408 os << "\\alternate_language \"" << isp_alt_lang
1411 case RC_USE_ESC_CHARS:
1412 if (isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1413 os << "\\use_escape_chars " << tostr(isp_use_esc_chars)
1417 if (isp_esc_chars != system_lyxrc.isp_esc_chars) {
1418 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1420 case RC_USE_PERS_DICT:
1421 if (isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1422 os << "\\use_personal_dictionary "
1423 << tostr(isp_use_pers_dict)
1427 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1428 os << "\\personal_dictionary \"" << isp_pers_dict
1431 case RC_USE_INP_ENC:
1432 if (isp_use_input_encoding
1433 != system_lyxrc.isp_use_input_encoding) {
1434 os << "\\use_input_encoding "
1435 << tostr(isp_use_input_encoding)
1440 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1443 case RC_RTL_SUPPORT:
1444 if (rtl_support != system_lyxrc.rtl_support) {
1445 os << "\\rtl " << tostr(rtl_support) << "\n";
1447 case RC_LANGUAGE_PACKAGE:
1448 if (language_package != system_lyxrc.language_package) {
1449 os << "\\language_package \"" << language_package
1452 case RC_LANGUAGE_COMMAND_BEGIN:
1453 if (language_command_begin
1454 != system_lyxrc.language_command_begin) {
1455 os << "\\language_command_begin \""
1456 << language_command_begin
1459 case RC_LANGUAGE_COMMAND_END:
1460 if (language_command_end
1461 != system_lyxrc.language_command_end) {
1462 os << "\\language_command_end \"" << language_command_end
1465 case RC_LANGUAGE_AUTO_BEGIN:
1466 if (language_auto_begin != system_lyxrc.language_auto_begin) {
1467 os << "\\language_auto_begin "
1468 << tostr(language_auto_begin) << "\n";
1470 case RC_LANGUAGE_AUTO_END:
1471 if (language_auto_end != system_lyxrc.language_auto_end) {
1472 os << "\\language_auto_end "
1473 << tostr(language_auto_end) << "\n";
1475 case RC_MARK_FOREIGN_LANGUAGE:
1476 if (mark_foreign_language
1477 != system_lyxrc.mark_foreign_language) {
1478 os << "\\mark_foreign_language " <<
1479 tostr(mark_foreign_language) << "\n";
1483 << "# 2nd MISC SUPPORT SECTION ##########################\n"
1486 case RC_OVERRIDE_X_DEADKEYS:
1487 if (override_x_deadkeys != system_lyxrc.override_x_deadkeys) {
1488 os << "\\override_x_deadkeys "
1489 << tostr(override_x_deadkeys) << "\n";
1491 case RC_SCREEN_FONT_ENCODING_MENU:
1492 if (font_norm_menu != system_lyxrc.font_norm_menu) {
1493 os << "\\screen_font_encoding_menu \"" << font_norm_menu
1496 case RC_AUTO_NUMBER:
1497 if (auto_number != system_lyxrc.auto_number) {
1498 os << "\\auto_number " << tostr(auto_number) << "\n";
1500 case RC_NEW_ASK_FILENAME:
1501 if (new_ask_filename != system_lyxrc.new_ask_filename) {
1502 os << "\\new_ask_filename " << tostr(new_ask_filename)
1505 case RC_DEFAULT_LANGUAGE:
1506 if (default_language != system_lyxrc.default_language) {
1507 os << "\\default_language " << default_language << "\n";
1511 << "# FORMATS SECTION ##########################\n"
1515 // Look for deleted formats
1516 for (Formats::const_iterator cit = formats.begin();
1517 cit != formats.end(); ++cit) {
1518 Format const * format =
1519 system_formats.GetFormat(cit->name());
1521 format->extension() != cit->extension() ||
1522 format->prettyname() != cit->prettyname() ||
1523 format->shortcut() != cit->shortcut())
1524 os << "\\format \"" << cit->name() << "\" \""
1525 << cit->extension() << "\" \""
1526 << cit->prettyname() << "\" \""
1527 << cit->shortcut() << "\"\n";
1530 // New/modifed formats
1531 for (Formats::const_iterator cit = system_formats.begin();
1532 cit != system_formats.end(); ++cit)
1533 if (!formats.GetFormat(cit->name()))
1534 os << "\\format \"" << cit->name()
1535 << "\" \"\" \"\" \"\"\n";
1537 for (Formats::const_iterator cit = formats.begin();
1538 cit != formats.end(); ++cit) {
1539 Format const * format =
1540 system_formats.GetFormat(cit->name());
1541 if ((!format || format->viewer() != cit->viewer()) &&
1542 (format || !cit->viewer().empty()))
1543 os << "\\viewer \"" << cit->name() << "\" \""
1544 << cit->viewer() << "\"\n";
1548 << "# CONVERTERS SECTION ##########################\n"
1552 // Look for new converters
1553 for (Converters::const_iterator cit = converters.begin();
1554 cit != converters.end(); ++cit) {
1555 Converter const * converter =
1556 system_converters.GetConverter(cit->from,
1559 converter->command != cit->command ||
1560 converter->flags != cit->flags)
1561 os << "\\converter \"" << cit->from << "\" \""
1562 << cit->to << "\" \""
1563 << cit->command << "\" \""
1564 << cit->flags << "\"\n";
1567 // New/modifed converters
1568 for (Converters::const_iterator cit = system_converters.begin();
1569 cit != system_converters.end(); ++cit)
1570 if (!converters.GetConverter(cit->from, cit->to))
1571 os << "\\converter \"" << cit->from
1572 << "\" \"" << cit->to << "\" \"\" \"\"\n";
1577 void LyXRC::set_font_norm_type()
1579 if (font_norm == "iso10646-1")
1580 font_norm_type = ISO_10646_1;
1581 else if (font_norm == "iso8859-1")
1582 font_norm_type = ISO_8859_1;
1583 else if (font_norm == "iso8859-6.8x")
1584 font_norm_type = ISO_8859_6_8;
1585 else if (font_norm == "iso8859-9")
1586 font_norm_type = ISO_8859_9;
1588 font_norm_type = OTHER_ENCODING;
1592 string const LyXRC::getDescription(LyXRCTags tag)
1597 case RC_FONT_ENCODING:
1598 str = N_("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
1602 str = N_("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
1605 case RC_PRINT_COMMAND:
1606 str = N_("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
1609 case RC_PRINTEVENPAGEFLAG:
1610 str = N_("The option to print only even pages.");
1613 case RC_PRINTODDPAGEFLAG:
1614 str = N_("The option to print only odd pages.");
1617 case RC_PRINTPAGERANGEFLAG:
1618 str = N_("The option for specifying a comma-separated list of pages to print.");
1621 case RC_PRINTCOPIESFLAG:
1622 str = N_("The option for specifying the number of copies to print.");
1625 case RC_PRINTCOLLCOPIESFLAG:
1626 str = N_("The option for specifying whether the copies should be collated.");
1629 case RC_PRINTREVERSEFLAG:
1630 str = N_("The option to reverse the order of the pages printed.");
1633 case RC_PRINTLANDSCAPEFLAG:
1634 str = N_("The option to print out in landscape.");
1637 case RC_PRINTPAPERFLAG:
1638 str = N_("The option to specify paper type.");
1641 case RC_PRINTPAPERDIMENSIONFLAG:
1642 str = N_("Option to specify the dimensions of the print paper.");
1645 case RC_PRINTTOPRINTER:
1646 str = N_("Option to pass to the print program to print on a specific printer.");
1649 case RC_PRINT_ADAPTOUTPUT:
1650 str = N_("Select for LyX to pass the name of the destination printer to your print command.");
1653 case RC_PRINTTOFILE:
1654 str = N_("Option to pass to the print program to print to a file.");
1657 case RC_PRINTFILEEXTENSION:
1658 str = N_("Extension of printer program output file. Usually \".ps\".");
1661 case RC_PRINTEXSTRAOPTIONS:
1662 str = N_("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
1665 case RC_PRINTSPOOL_COMMAND:
1666 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.");
1669 case RC_PRINTSPOOL_PRINTERPREFIX:
1670 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.");
1674 str = N_("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
1677 case RC_SCREEN_ZOOM:
1678 //xgettext:no-c-format
1679 str = N_("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
1682 case RC_SCREEN_FONT_SIZES:
1683 str = N_("The font sizes used for calculating the scaling of the screen fonts.");
1686 case RC_SCREEN_FONT_ROMAN:
1687 case RC_SCREEN_FONT_SANS:
1688 case RC_SCREEN_FONT_TYPEWRITER:
1689 str = N_("The screen fonts used to display the text while editing.");
1692 case RC_SCREEN_FONT_MENU:
1693 str = N_("The font for menus (and groups titles in popups).");
1696 case RC_SCREEN_FONT_POPUP:
1697 str = N_("The font for popups.");
1700 case RC_SCREEN_FONT_ENCODING:
1701 str = N_("The encoding for the screen fonts.");
1704 case RC_SCREEN_FONT_ENCODING_MENU:
1705 str = N_("The encoding for the menu/popups fonts.");
1712 str = N_("The time interval between auto-saves (in seconds). 0 means no auto-save.");
1715 case RC_DOCUMENTPATH:
1716 str = N_("The default path for your documents.");
1719 case RC_TEMPLATEPATH:
1720 str = N_("The path that LyX will set when offering to choose a template.");
1723 case RC_TEMPDIRPATH:
1724 str = N_("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
1728 str = N_("Select if you wish to use a temporary directory structure to store temporary TeX output.");
1732 str = N_("The file where the last-files information should be stored.");
1735 case RC_AUTOREGIONDELETE:
1736 str = N_("De-select if you don't want the current selection to be replaced automatically by what you type.");
1739 case RC_OVERRIDE_X_DEADKEYS:
1740 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.");
1745 str = N_("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
1749 str = N_("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
1753 str = N_("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
1757 case RC_KBMAP_PRIMARY:
1758 case RC_KBMAP_SECONDARY:
1759 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.");
1763 case RC_FAX_COMMAND:
1772 case RC_ASCIIROFF_COMMAND:
1773 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.");
1776 case RC_ASCII_LINELEN:
1777 str = N_("This is the maximum line length of an exported ASCII file (LaTeX, SGML or plain text).");
1780 case RC_NUMLASTFILES:
1781 str = N_("Maximal number of lastfiles. Up to 9 can appear in the file menu.");
1784 case RC_CHECKLASTFILES:
1785 str = N_("Select to check whether the lastfiles still exist.");
1788 case RC_VIEWDVI_PAPEROPTION:
1791 case RC_DEFAULT_PAPERSIZE:
1792 str = N_("Specify the default paper size.");
1798 case RC_ACCEPT_COMPOUND:
1799 str = N_("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
1802 case RC_SPELL_COMMAND:
1803 str = N_("What command runs the spell checker?");
1806 case RC_USE_INP_ENC:
1807 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.");
1810 case RC_USE_ALT_LANG:
1812 str = N_("Specify an alternate language. The default is to use the language of the document.");
1815 case RC_USE_PERS_DICT:
1817 str = N_("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
1820 case RC_USE_ESC_CHARS:
1822 str = N_("Specify additional chars that can be part of a word.");
1825 case RC_SCREEN_FONT_SCALABLE:
1826 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.");
1829 case RC_CHKTEX_COMMAND:
1830 str = N_("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
1833 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1834 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.");
1837 case RC_EXIT_CONFIRMATION:
1838 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.)");
1841 case RC_DISPLAY_SHORTCUTS:
1842 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.");
1845 case RC_MAKE_BACKUP:
1846 str = N_("De-select if you don't want LyX to create backup files.");
1849 case RC_BACKUPDIR_PATH:
1850 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.");
1853 case RC_RTL_SUPPORT:
1854 str = N_("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
1857 case RC_MARK_FOREIGN_LANGUAGE:
1858 str = N_("Select to control the highlighting of words with a language foreign to that of the document.");
1861 case RC_LANGUAGE_PACKAGE:
1862 str = N_("The latex command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
1865 case RC_LANGUAGE_AUTO_BEGIN:
1866 str = N_("Select if a language switching command is needed at the beginning of the document.");
1869 case RC_LANGUAGE_AUTO_END:
1870 str = N_("Select if a language switching command is needed at the end of the document.");
1873 case RC_LANGUAGE_COMMAND_BEGIN:
1874 str = N_("The latex command for changing from the language of the document to another language. E.g. \\selectlanguage{$$lang} where $$lang is substituted by the name of the second language.");
1877 case RC_LANGUAGE_COMMAND_END:
1878 str = N_("The latex command for changing back to the language of the document.");
1881 case RC_DATE_INSERT_FORMAT:
1882 //xgettext:no-c-format
1883 str = N_("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
1886 case RC_SHOW_BANNER:
1887 str = N_("De-select if you don't want the startup banner.");
1891 str = N_("The wheel movement factor (for mice with wheels or five button mice).");
1903 case RC_NEW_ASK_FILENAME:
1904 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.");
1907 case RC_DEFAULT_LANGUAGE:
1908 str = N_("New documents will be assigned this language.");
1911 case RC_LABEL_INIT_LENGTH:
1912 str = N_("Maximum number of words in the initialization string for a new label");
1922 // The global instance
1925 // The global copy of the system lyxrc entries (everything except preferences)