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 },
71 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
72 { "\\format", LyXRC::RC_FORMAT },
73 { "\\input", LyXRC::RC_INPUT },
74 { "\\kbmap", LyXRC::RC_KBMAP },
75 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
76 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
77 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
78 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
79 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
80 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
81 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
82 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
83 { "\\lastfiles", LyXRC::RC_LASTFILES },
84 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
85 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
86 { "\\new_ask_filename", LyXRC::RC_NEW_ASK_FILENAME },
87 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
88 { "\\override_x_deadkeys", LyXRC::RC_OVERRIDE_X_DEADKEYS },
89 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
90 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
91 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
92 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
93 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
94 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
95 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
96 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
97 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
98 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
99 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
100 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
101 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
102 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
103 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
104 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
105 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
106 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
107 { "\\printer", LyXRC::RC_PRINTER },
108 { "\\ps_command", LyXRC::RC_PS_COMMAND },
109 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
110 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
111 { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
112 { "\\screen_font_encoding_menu", LyXRC::RC_SCREEN_FONT_ENCODING_MENU },
113 { "\\screen_font_menu", LyXRC::RC_SCREEN_FONT_MENU },
114 { "\\screen_font_popup", LyXRC::RC_SCREEN_FONT_POPUP },
115 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
116 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
117 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
118 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
119 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
120 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
121 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
122 { "\\set_color", LyXRC::RC_SET_COLOR },
123 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
124 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
125 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
126 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
127 { "\\ui_file", LyXRC::RC_UIFILE },
128 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
129 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
130 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
131 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
132 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
133 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
134 { "\\viewer" ,LyXRC::RC_VIEWER},
135 { "\\wheel_jump", LyXRC::RC_WHEEL_JUMP }
138 /* Let the range depend of the size of lyxrcTags. Alejandro 240596 */
139 static const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
148 void LyXRC::setDefaults() {
152 // Get printer from the environment. If fail, use default "",
153 // assuming that everything is set up correctly.
154 printer = GetEnv("PRINTER");
155 print_adapt_output = false;
156 print_command = "dvips";
157 print_evenpage_flag = "-B";
158 print_oddpage_flag = "-A";
159 print_pagerange_flag = "-pp";
160 print_copies_flag = "-c";
161 print_collcopies_flag = "-C";
162 print_reverse_flag = "-r";
163 print_landscape_flag = "-t landscape";
164 print_to_printer = "-P";
165 print_to_file = "-o ";
166 print_file_extension = ".ps";
167 print_paper_flag = "-t";
168 print_paper_dimension_flag = "-T";
169 document_path = GetEnvPath("HOME");
170 tempdir_path = "/tmp";
173 view_dvi_paper_option = "-paper";
174 default_papersize = BufferParams::PAPER_USLETTER;
175 custom_export_format = "ps";
176 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
179 // Because a screen typically is wider than a piece of paper:
182 // Default LaTeX font size:
183 font_sizes[LyXFont::SIZE_TINY] = 5.0;
184 font_sizes[LyXFont::SIZE_SCRIPT] = 7.0;
185 font_sizes[LyXFont::SIZE_FOOTNOTE] = 8.0;
186 font_sizes[LyXFont::SIZE_SMALL] = 9.0;
187 font_sizes[LyXFont::SIZE_NORMAL] = 10.0;
188 font_sizes[LyXFont::SIZE_LARGE] = 12.0;
189 font_sizes[LyXFont::SIZE_LARGER] = 14.4;
190 font_sizes[LyXFont::SIZE_LARGEST] = 17.26;
191 font_sizes[LyXFont::SIZE_HUGE] = 20.74;
192 font_sizes[LyXFont::SIZE_HUGER] = 24.88;
193 use_scalable_fonts = true;
194 roman_font_name = "-*-times";
195 sans_font_name = "-*-helvetica";
196 typewriter_font_name = "-*-courier";
197 menu_font_name = "-*-helvetica-bold-r";
198 popup_font_name = "-*-helvetica-medium-r";
199 font_norm = "iso8859-1";
200 font_norm_type = ISO_8859_1;
202 override_x_deadkeys = true;
204 auto_region_delete = true;
207 check_lastfiles = true;
210 exit_confirmation = true;
211 display_shortcuts = true;
212 // Spellchecker settings:
213 isp_command = "ispell";
214 isp_accept_compound = false;
215 isp_use_input_encoding = false;
216 isp_use_alt_lang = false;
217 isp_use_pers_dict = false;
218 isp_use_esc_chars = false;
222 mark_foreign_language = true;
223 language_package = "\\usepackage{babel}";
224 language_auto_begin = true;
225 language_auto_end = true;
226 language_command_begin = "\\selectlanguage{$$lang}";
227 language_command_end = "\\selectlanguage{$$lang}";
228 default_language = "english";
230 new_ask_filename = false;
233 date_insert_format = "%A, %e %B %Y";
235 cursor_follows_scrollbar = false;
236 label_init_length = 3;
238 /// These variables are not stored on disk (perhaps they
239 // should be moved from the LyXRC class).
245 int LyXRC::ReadBindFile(string const & name)
248 string const tmp = i18nLibFileSearch("bind", name, "bind");
249 lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
250 int const result = read(tmp);
252 lyxerr << "Error reading bind file: " << tmp << endl;
257 void LyXRC::readBindFileIfNeeded()
260 ReadBindFile(bind_file);
263 int LyXRC::read(string const & filename)
265 LyXLex lexrc(lyxrcTags, lyxrcCount);
266 if (lyxerr.debugging(Debug::PARSER))
267 lexrc.printTable(lyxerr);
269 lexrc.setFile(filename);
270 if (!lexrc.IsOK()) return -2;
272 lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
274 while (lexrc.IsOK()) {
275 // By using two switches we take advantage of the compiler
276 // telling us if we have missed a LyXRCTags element in
277 // the second switch.
278 // Note that this also shows a problem with LyXLex since it
279 // helps us avoid taking advantage of the strictness of the
282 int le = lexrc.lex();
284 case LyXLex::LEX_UNDEF:
285 lexrc.printError("Unknown tag `$$Token'");
287 case LyXLex::LEX_FEOF:
291 switch (static_cast<LyXRCTags>(le)) {
292 case RC_INPUT: // Include file
294 string tmp = LibFileSearch(string(),
297 lexrc.printError("Error reading "
298 "included file: "+tmp);
302 case RC_BINDFILE: // RVDK_PATCH_5
304 string tmp(lexrc.GetString());
306 // We are already in the
307 // "actually read bind file"
311 // We are still in the "just
312 // remember the name of the
320 ui_file = lexrc.GetString();
324 case RC_EXIT_CONFIRMATION:
326 exit_confirmation = lexrc.GetBool();
329 case RC_DISPLAY_SHORTCUTS:
331 display_shortcuts = lexrc.GetBool();
336 use_kbmap = lexrc.GetBool();
339 case RC_KBMAP_PRIMARY:
341 string kmap(lexrc.GetString());
344 } else if (!LibFileSearch("kbd", kmap,
346 primary_kbmap = kmap;
348 lexrc.printError("LyX: Keymap `$$Token' not found");
352 case RC_KBMAP_SECONDARY:
354 string kmap(lexrc.GetString());
357 } else if (!LibFileSearch("kbd", kmap,
359 secondary_kbmap = kmap;
361 lexrc.printError("LyX: Keymap `$$Token' not found");
365 case RC_FONT_ENCODING:
367 fontenc = lexrc.GetString();
372 printer = lexrc.GetString();
375 case RC_PRINT_COMMAND:
377 print_command = lexrc.GetString();
380 case RC_PRINTEVENPAGEFLAG:
382 print_evenpage_flag = lexrc.GetString();
385 case RC_PRINTODDPAGEFLAG:
387 print_oddpage_flag = lexrc.GetString();
390 case RC_PRINTPAGERANGEFLAG:
392 print_pagerange_flag = lexrc.GetString();
395 case RC_PRINTCOPIESFLAG:
397 print_copies_flag = lexrc.GetString();
400 case RC_PRINTCOLLCOPIESFLAG:
402 print_collcopies_flag = lexrc.GetString();
405 case RC_PRINTREVERSEFLAG:
407 print_reverse_flag = lexrc.GetString();
410 case RC_PRINTLANDSCAPEFLAG:
412 print_landscape_flag = lexrc.GetString();
415 case RC_PRINTTOPRINTER:
417 print_to_printer = lexrc.GetString();
420 case RC_PRINT_ADAPTOUTPUT:
422 print_adapt_output = lexrc.GetBool();
427 print_to_file = lexrc.GetString();
430 case RC_PRINTFILEEXTENSION:
432 print_file_extension = lexrc.GetString();
435 case RC_PRINTEXSTRAOPTIONS:
437 print_extra_options = lexrc.GetString();
440 case RC_PRINTSPOOL_COMMAND:
442 print_spool_command = lexrc.GetString();
445 case RC_PRINTSPOOL_PRINTERPREFIX:
447 print_spool_printerprefix = lexrc.GetString();
450 case RC_PRINTPAPERDIMENSIONFLAG:
452 print_paper_dimension_flag = lexrc.GetString();
455 case RC_PRINTPAPERFLAG:
457 print_paper_flag = lexrc.GetString();
460 case RC_CUSTOM_EXPORT_COMMAND:
462 custom_export_command = lexrc.GetString();
465 case RC_CUSTOM_EXPORT_FORMAT:
467 custom_export_format = lexrc.GetString();
470 case RC_DEFAULT_PAPERSIZE:
472 string size = lowercase(lexrc.GetString());
473 if (size == "usletter")
475 BufferParams::PAPER_USLETTER;
476 else if (size == "legal")
478 BufferParams::PAPER_LEGALPAPER;
479 else if (size == "executive")
481 BufferParams::PAPER_EXECUTIVEPAPER;
482 else if (size == "a3")
484 BufferParams::PAPER_A3PAPER;
485 else if (size == "a4")
487 BufferParams::PAPER_A4PAPER;
488 else if (size == "a5")
490 BufferParams::PAPER_A5PAPER;
491 else if (size == "b5")
493 BufferParams::PAPER_B5PAPER;
497 case RC_VIEWDVI_PAPEROPTION:
499 view_dvi_paper_option = lexrc.GetString();
501 view_dvi_paper_option = "";
506 ps_command = lexrc.GetString();
509 case RC_CHKTEX_COMMAND:
511 chktex_command = lexrc.GetString();
516 dpi = lexrc.GetInteger();
521 zoom = lexrc.GetInteger();
526 wheel_jump = lexrc.GetInteger();
529 case RC_SCREEN_FONT_SIZES:
531 font_sizes[LyXFont::SIZE_TINY] =
534 font_sizes[LyXFont::SIZE_SCRIPT] =
537 font_sizes[LyXFont::SIZE_FOOTNOTE] =
540 font_sizes[LyXFont::SIZE_SMALL] =
543 font_sizes[LyXFont::SIZE_NORMAL] =
546 font_sizes[LyXFont::SIZE_LARGE] =
549 font_sizes[LyXFont::SIZE_LARGER] =
552 font_sizes[LyXFont::SIZE_LARGEST] =
555 font_sizes[LyXFont::SIZE_HUGE] =
558 font_sizes[LyXFont::SIZE_HUGER] =
562 case RC_SCREEN_FONT_SCALABLE:
564 use_scalable_fonts = lexrc.GetBool();
569 autosave = lexrc.GetInteger();
572 case RC_DOCUMENTPATH:
574 document_path = ExpandPath(lexrc.GetString());
578 case RC_TEMPLATEPATH:
580 template_path = ExpandPath(lexrc.GetString());
585 tempdir_path = ExpandPath(lexrc.GetString());
590 use_tempdir = lexrc.GetBool();
595 lastfiles = ExpandPath(lexrc.GetString());
598 case RC_NUMLASTFILES:
600 num_lastfiles = lexrc.GetInteger();
603 case RC_CHECKLASTFILES:
605 check_lastfiles = lexrc.GetBool();
608 case RC_SCREEN_FONT_ROMAN:
610 roman_font_name = lexrc.GetString();
613 case RC_SCREEN_FONT_SANS:
615 sans_font_name = lexrc.GetString();
618 case RC_SCREEN_FONT_TYPEWRITER:
620 typewriter_font_name = lexrc.GetString();
623 case RC_SCREEN_FONT_MENU:
625 menu_font_name = lexrc.GetString();
628 case RC_SCREEN_FONT_POPUP:
630 popup_font_name = lexrc.GetString();
633 case RC_SCREEN_FONT_ENCODING:
635 font_norm = lexrc.GetString();
636 set_font_norm_type();
640 case RC_SCREEN_FONT_ENCODING_MENU:
642 font_norm_menu = lexrc.GetString();
647 string lyx_name, x11_name;
650 lyx_name = lexrc.GetString();
652 lexrc.printError("Missing color tag.");
657 x11_name = lexrc.GetString();
659 lexrc.printError("Missing color name for color : `$$Token'");
663 if (!lcolor.setColor(lyx_name, x11_name))
664 lyxerr << "Bad lyxrc set_color for "
669 case RC_AUTOREGIONDELETE:
670 // Auto region delete defaults to true
672 auto_region_delete = lexrc.GetBool();
677 // we should not do an explicit binding before
678 // loading a bind file. So, in this case, load
679 // the default bind file.
680 readBindFileIfNeeded();
682 // !!!chb, dynamic key binding...
686 if (lexrc.lex() == LyXLex::LEX_DATA) {
687 seq = lexrc.GetString();
689 lexrc.printError("Bad key sequence: `$$Token'");
693 if (lexrc.lex() == LyXLex::LEX_DATA) {
694 cmd = lexrc.GetString();
696 lexrc.printError("Bad command: `$$Token'");
700 if ((action = lyxaction.LookupFunc(cmd))>= 0) {
701 if (lyxerr.debugging(Debug::KBMAP)) {
702 lyxerr << "RC_BIND: Sequence `"
703 << seq << "' Command `"
704 << cmd << "' Action `"
705 << action << '\'' << endl;
707 res = toplevel_keymap->bind(seq, action);
710 "Invalid key sequence `"
713 } else {// cmd is the last token read.
715 "Unknown LyX function `$$Token'");
719 case RC_OVERRIDE_X_DEADKEYS:
721 override_x_deadkeys = lexrc.GetBool();
726 lyxpipes = ExpandPath(lexrc.GetString());
729 case RC_CURSOR_FOLLOWS_SCROLLBAR:
731 cursor_follows_scrollbar = lexrc.GetBool();
734 case RC_ASCIIROFF_COMMAND:
736 ascii_roff_command = lexrc.GetString();
738 case RC_ASCII_LINELEN:
740 ascii_linelen = lexrc.GetInteger();
742 // Spellchecker settings:
743 case RC_SPELL_COMMAND:
745 isp_command = lexrc.GetString();
747 case RC_ACCEPT_COMPOUND:
749 isp_accept_compound = lexrc.GetBool();
753 isp_use_input_encoding = lexrc.GetBool();
755 case RC_USE_ALT_LANG:
757 isp_use_alt_lang = lexrc.GetBool();
759 case RC_USE_PERS_DICT:
761 isp_use_pers_dict = lexrc.GetBool();
763 case RC_USE_ESC_CHARS:
765 isp_use_esc_chars = lexrc.GetBool();
769 isp_alt_lang = lexrc.GetString();
773 isp_pers_dict = lexrc.GetString();
777 isp_esc_chars = lexrc.GetString();
781 make_backup = lexrc.GetBool();
783 case RC_BACKUPDIR_PATH:
785 backupdir_path = ExpandPath(lexrc.GetString());
787 case RC_DATE_INSERT_FORMAT:
789 date_insert_format = lexrc.GetString();
791 case RC_LANGUAGE_PACKAGE:
793 language_package = lexrc.GetString();
795 case RC_LANGUAGE_AUTO_BEGIN:
797 language_auto_begin = lexrc.GetBool();
799 case RC_LANGUAGE_AUTO_END:
801 language_auto_end = lexrc.GetBool();
803 case RC_LANGUAGE_COMMAND_BEGIN:
805 language_command_begin = lexrc.GetString();
807 case RC_LANGUAGE_COMMAND_END:
809 language_command_end = lexrc.GetString();
813 rtl_support = lexrc.GetBool();
817 auto_number = lexrc.GetBool();
819 case RC_MARK_FOREIGN_LANGUAGE:
821 mark_foreign_language = lexrc.GetBool();
825 show_banner = lexrc.GetBool();
828 case RC_NEW_ASK_FILENAME:
830 new_ask_filename = lexrc.GetBool();
833 string from, to, command, flags;
835 from = lexrc.GetString();
837 to = lexrc.GetString();
839 command = lexrc.GetString();
841 flags = lexrc.GetString();
842 if (command.empty() || command == "none")
843 converters.Delete(from, to);
845 converters.Add(from, to, command, flags);
849 string format, command;
851 format = lexrc.GetString();
853 command = lexrc.GetString();
854 formats.SetViewer(format, command);
858 string format, extension, prettyname, shortcut;
860 format = lexrc.GetString();
862 extension = lexrc.GetString();
864 prettyname = lexrc.GetString();
866 shortcut = lexrc.GetString();
867 if (prettyname.empty()) {
868 if (converters.FormatIsUsed(format))
869 lyxerr << "Can't delete format "
872 formats.Delete(format);
875 formats.Add(format, extension, prettyname,
879 case RC_DEFAULT_LANGUAGE:
881 default_language = lexrc.GetString();
884 case RC_LABEL_INIT_LENGTH:
886 label_init_length = lexrc.GetInteger();
889 case RC_LAST: break; // this is just a dummy
893 /// Update converters data-structures
894 converters.Update(formats);
895 converters.BuildGraph();
901 void LyXRC::write(string const & filename) const
903 ofstream ofs(filename.c_str());
909 void LyXRC::print() const
911 if (lyxerr.debugging())
918 void LyXRC::output(ostream & os) const
920 os << "### This file is part of\n"
921 << "### ========================================================\n"
922 << "### LyX, The Document Processor\n"
924 << "### Copyright 1995 Matthias Ettrich\n"
925 << "### Copyright 1995-2000 The LyX Team.\n"
927 << "### ========================================================\n"
929 << "# This file is written by LyX, if you want to make your own\n"
930 << "# modifications you should do them from inside LyX and save\n"
933 // Why the switch you might ask. It is a trick to ensure that all
934 // the elements in the LyXRCTags enum is handled. As you can see
935 // there are no breaks at all. So it is just a huge fall-through.
936 // The nice thing is that we will get a warning from the compiler
937 // if we forget an element.
938 LyXRCTags tag = RC_LAST;
942 // input/include files are not done here
944 // bindings is not written to the preferences file.
946 if (bind_file != system_lyxrc.bind_file) {
947 os << "\\bind_file " << bind_file << "\n";
953 << "# MISC SECTION ######################################\n"
957 if (show_banner != system_lyxrc.show_banner) {
958 os << "# Set to false to inhibit the startup banner.\n"
959 << "\\show_banner " << tostr(show_banner) << "\n";
961 // bind files are not done here.
963 if (ui_file != system_lyxrc.ui_file) {
964 os << "\\ui_file \"" << ui_file << "\"\n";
966 case RC_AUTOREGIONDELETE:
967 if (auto_region_delete != system_lyxrc.auto_region_delete) {
968 os << "# Set to false to inhibit automatic replacement of\n"
969 << "# the current selection.\n"
970 << "\\auto_region_delete " << tostr(auto_region_delete)
974 if (autosave != system_lyxrc.autosave) {
975 os << "# The time interval between auto-saves in seconds.\n"
976 << "\\autosave " << autosave << "\n";
978 case RC_EXIT_CONFIRMATION:
979 if (exit_confirmation != system_lyxrc.exit_confirmation) {
980 os << "# Ask for confirmation before exit if there are\n"
981 << "# unsaved changed documents.\n"
982 << "\\exit_confirmation " << tostr(exit_confirmation)
985 case RC_DISPLAY_SHORTCUTS:
986 if (display_shortcuts != system_lyxrc.display_shortcuts) {
987 os << "# Display name of the last command executed,\n"
988 << "# with a list of short-cuts in the minibuffer.\n"
989 << "\\display_shortcuts " << tostr(display_shortcuts)
992 case RC_VIEWDVI_PAPEROPTION:
993 if (view_dvi_paper_option
994 != system_lyxrc.view_dvi_paper_option) {
995 os << "# Options used to specify paper size to the\n"
996 << "# view_dvi_command\n"
997 << "\\view_dvi_paper_option \""
998 << view_dvi_paper_option << "\"\n";
1000 case RC_DEFAULT_PAPERSIZE:
1001 if (default_papersize != system_lyxrc.default_papersize) {
1002 os << "# The default papersize to use.\n"
1003 << "\\default_papersize \"";
1004 switch (default_papersize) {
1005 case BufferParams::PAPER_USLETTER:
1006 os << "usletter"; break;
1007 case BufferParams::PAPER_LEGALPAPER:
1008 os << "legal"; break;
1009 case BufferParams::PAPER_EXECUTIVEPAPER:
1010 os << "executive"; break;
1011 case BufferParams::PAPER_A3PAPER:
1013 case BufferParams::PAPER_A4PAPER:
1015 case BufferParams::PAPER_A5PAPER:
1017 case BufferParams::PAPER_B5PAPER:
1019 case BufferParams::PAPER_DEFAULT: break;
1024 if (ps_command != system_lyxrc.ps_command) {
1025 os << "# Program used for interpreting postscript.\n"
1026 << "\\ps_command \"" << ps_command << "\"\n";
1028 case RC_CHKTEX_COMMAND:
1029 if (chktex_command != system_lyxrc.chktex_command) {
1030 os << "\\chktex_command \"" << chktex_command << "\"\n";
1033 if (use_kbmap != system_lyxrc.use_kbmap) {
1034 os << "\\kbmap " << tostr(use_kbmap) << "\n";
1036 case RC_KBMAP_PRIMARY:
1037 if (primary_kbmap != system_lyxrc.primary_kbmap) {
1038 os << "\\kbmap_primary \"" << primary_kbmap << "\"\n";
1040 case RC_KBMAP_SECONDARY:
1041 if (secondary_kbmap != system_lyxrc.secondary_kbmap) {
1042 os << "\\kbmap_secondary \"" << secondary_kbmap
1046 if (lyxpipes != system_lyxrc.lyxpipes) {
1047 os << "\\serverpipe \"" << lyxpipes << "\"\n";
1049 case RC_DATE_INSERT_FORMAT:
1050 if (date_insert_format != system_lyxrc.date_insert_format) {
1051 os << "\\date_insert_format \"" << date_insert_format
1054 case RC_LABEL_INIT_LENGTH:
1055 if (label_init_length != system_lyxrc.label_init_length) {
1056 os << "\\label_init_length " << label_init_length
1061 << "# SCREEN & FONTS SECTION ############################\n"
1065 if (dpi != system_lyxrc.dpi) {
1066 os << "\\screen_dpi " << dpi << "\n";
1068 case RC_SCREEN_ZOOM:
1069 if (zoom != system_lyxrc.zoom) {
1070 os << "\\screen_zoom " << zoom << "\n";
1073 if (wheel_jump != system_lyxrc.wheel_jump) {
1074 os << "\\wheel_jump " << wheel_jump << "\n";
1076 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1077 if (cursor_follows_scrollbar
1078 != system_lyxrc.cursor_follows_scrollbar) {
1079 os << "\\cursor_follows_scrollbar "
1080 << tostr(cursor_follows_scrollbar) << "\n";
1082 case RC_SCREEN_FONT_ROMAN:
1083 if (roman_font_name != system_lyxrc.roman_font_name) {
1084 os << "\\screen_font_roman \"" << roman_font_name
1087 case RC_SCREEN_FONT_SANS:
1088 if (sans_font_name != system_lyxrc.sans_font_name) {
1089 os << "\\screen_font_sans \"" << sans_font_name
1092 case RC_SCREEN_FONT_TYPEWRITER:
1093 if (typewriter_font_name != system_lyxrc.typewriter_font_name) {
1094 os << "\\screen_font_typewriter \""
1095 << typewriter_font_name << "\"\n";
1097 case RC_SCREEN_FONT_SCALABLE:
1098 if (use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1099 os << "\\screen_font_scalable "
1100 << tostr(use_scalable_fonts)
1103 case RC_SCREEN_FONT_ENCODING:
1104 if (font_norm != system_lyxrc.font_norm) {
1105 os << "\\screen_font_encoding \"" << font_norm
1108 case RC_SCREEN_FONT_POPUP:
1109 if (popup_font_name != system_lyxrc.popup_font_name) {
1110 os << "\\screen_font_popup \"" << popup_font_name
1113 case RC_SCREEN_FONT_MENU:
1114 if (menu_font_name != system_lyxrc.menu_font_name) {
1115 os << "\\screen_font_menu \"" << menu_font_name
1118 case RC_SCREEN_FONT_SIZES:
1119 if (font_sizes[LyXFont::SIZE_TINY]
1120 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1121 font_sizes[LyXFont::SIZE_SCRIPT]
1122 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1123 font_sizes[LyXFont::SIZE_FOOTNOTE]
1124 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1125 font_sizes[LyXFont::SIZE_SMALL]
1126 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1127 font_sizes[LyXFont::SIZE_NORMAL]
1128 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1129 font_sizes[LyXFont::SIZE_LARGE]
1130 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1131 font_sizes[LyXFont::SIZE_LARGER]
1132 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1133 font_sizes[LyXFont::SIZE_LARGEST]
1134 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1135 font_sizes[LyXFont::SIZE_HUGE]
1136 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1137 font_sizes[LyXFont::SIZE_HUGER]
1138 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1139 os.setf(ios::fixed);
1141 os << "\\screen_font_sizes"
1142 << " " << font_sizes[LyXFont::SIZE_TINY]
1143 << " " << font_sizes[LyXFont::SIZE_SCRIPT]
1144 << " " << font_sizes[LyXFont::SIZE_FOOTNOTE]
1145 << " " << font_sizes[LyXFont::SIZE_SMALL]
1146 << " " << font_sizes[LyXFont::SIZE_NORMAL]
1147 << " " << font_sizes[LyXFont::SIZE_LARGE]
1148 << " " << font_sizes[LyXFont::SIZE_LARGER]
1149 << " " << font_sizes[LyXFont::SIZE_LARGEST]
1150 << " " << font_sizes[LyXFont::SIZE_HUGE]
1151 << " " << font_sizes[LyXFont::SIZE_HUGER]
1156 << "# COLOR SECTION ###################################\n"
1160 for (int i = 0; i < LColor::ignore; ++i ) {
1161 LColor::color lc = static_cast<LColor::color>(i);
1163 string const col(lcolor.getX11Name(lc));
1164 if (col != system_lcolor.getX11Name(lc)) {
1165 os << "\\set_color \""
1166 << lcolor.getLyXName(lc) << "\" \""
1172 << "# PRINTER SECTION ###################################\n"
1176 if (printer != system_lyxrc.printer) {
1177 os << "\\printer \"" << printer << "\"\n";
1179 case RC_PRINT_ADAPTOUTPUT:
1180 if (print_adapt_output != system_lyxrc.print_adapt_output) {
1181 os << "\\print_adapt_output "
1182 << tostr(print_adapt_output)
1185 case RC_PRINT_COMMAND:
1186 if (print_command != system_lyxrc.print_command) {
1187 os << "\\print_command \"" << print_command << "\"\n";
1189 case RC_PRINTEXSTRAOPTIONS:
1190 if (print_extra_options != system_lyxrc.print_extra_options) {
1191 os << "\\print_extra_options \"" << print_extra_options
1194 case RC_PRINTSPOOL_COMMAND:
1195 if (print_spool_command != system_lyxrc.print_spool_command) {
1196 os << "\\print_spool_command \"" << print_spool_command
1199 case RC_PRINTSPOOL_PRINTERPREFIX:
1200 if (print_spool_printerprefix
1201 != system_lyxrc.print_spool_printerprefix) {
1202 os << "\\print_spool_printerprefix \""
1203 << print_spool_printerprefix << "\"\n";
1205 case RC_PRINTEVENPAGEFLAG:
1206 if (print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1207 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1210 case RC_PRINTODDPAGEFLAG:
1211 if (print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1212 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1215 case RC_PRINTREVERSEFLAG:
1216 if (print_reverse_flag != system_lyxrc.print_reverse_flag) {
1217 os << "\\print_reverse_flag \"" << print_reverse_flag
1220 case RC_PRINTLANDSCAPEFLAG:
1221 if (print_landscape_flag != system_lyxrc.print_landscape_flag) {
1222 os << "\\print_landscape_flag \"" << print_landscape_flag
1225 case RC_PRINTPAGERANGEFLAG:
1226 if (print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1227 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1230 case RC_PRINTCOPIESFLAG:
1231 if (print_copies_flag != system_lyxrc.print_copies_flag) {
1232 os << "\\print_copies_flag \"" << print_copies_flag
1235 case RC_PRINTCOLLCOPIESFLAG:
1236 if (print_collcopies_flag
1237 != system_lyxrc.print_collcopies_flag) {
1238 os << "\\print_collcopies_flag \""
1239 << print_collcopies_flag
1242 case RC_PRINTPAPERFLAG:
1243 if (print_paper_flag != system_lyxrc.print_paper_flag) {
1244 os << "\\print_paper_flag \"" << print_paper_flag
1247 case RC_PRINTPAPERDIMENSIONFLAG:
1248 if (print_paper_dimension_flag
1249 != system_lyxrc.print_paper_dimension_flag) {
1250 os << "\\print_paper_dimension_flag \""
1251 << print_paper_dimension_flag << "\"\n";
1253 case RC_PRINTTOPRINTER:
1254 if (print_to_printer != system_lyxrc.print_to_printer) {
1255 os << "\\print_to_printer \"" << print_to_printer
1258 case RC_PRINTTOFILE:
1259 if (print_to_file != system_lyxrc.print_to_file) {
1260 os << "\\print_to_file \"" << print_to_file << "\"\n";
1262 case RC_PRINTFILEEXTENSION:
1263 if (print_file_extension != system_lyxrc.print_file_extension) {
1264 os << "\\print_file_extension \""
1265 << print_file_extension
1270 << "# EXPORT SECTION ####################################\n"
1273 case RC_CUSTOM_EXPORT_COMMAND:
1274 if (custom_export_command
1275 != system_lyxrc.custom_export_command) {
1276 os << "\\custom_export_command \""
1277 << custom_export_command
1280 case RC_CUSTOM_EXPORT_FORMAT:
1281 if (custom_export_format
1282 != system_lyxrc.custom_export_format) {
1283 os << "\\custom_export_format \"" << custom_export_format
1288 << "# TEX SECTION #######################################\n"
1291 case RC_FONT_ENCODING:
1292 if (fontenc != system_lyxrc.fontenc) {
1293 os << "\\font_encoding \"" << fontenc << "\"\n";
1297 << "# FILE SECTION ######################################\n"
1300 case RC_DOCUMENTPATH:
1301 if (document_path != system_lyxrc.document_path) {
1302 os << "\\document_path \"" << document_path << "\"\n";
1305 if (lastfiles != system_lyxrc.lastfiles) {
1306 os << "\\lastfiles \"" << lastfiles << "\"\n";
1308 case RC_NUMLASTFILES:
1309 if (num_lastfiles != system_lyxrc.num_lastfiles) {
1310 os << "\\num_lastfiles " << num_lastfiles << "\n";
1312 case RC_CHECKLASTFILES:
1313 if (check_lastfiles != system_lyxrc.check_lastfiles) {
1314 os << "\\check_lastfiles " << tostr(check_lastfiles)
1317 case RC_TEMPLATEPATH:
1318 if (template_path != system_lyxrc.template_path) {
1319 os << "\\template_path \"" << template_path << "\"\n";
1321 case RC_TEMPDIRPATH:
1322 if (tempdir_path != system_lyxrc.tempdir_path) {
1323 os << "\\tempdir_path \"" << tempdir_path << "\"\n";
1326 if (use_tempdir != system_lyxrc.use_tempdir) {
1327 os << "\\use_tempdir " << tostr(use_tempdir) << "\n";
1329 case RC_ASCII_LINELEN:
1330 if (ascii_linelen != system_lyxrc.ascii_linelen) {
1331 os << "\\ascii_linelen " << ascii_linelen << "\n";
1333 case RC_MAKE_BACKUP:
1334 if (make_backup != system_lyxrc.make_backup) {
1335 os << "\\make_backup " << tostr(make_backup) << "\n";
1337 case RC_BACKUPDIR_PATH:
1338 if (backupdir_path != system_lyxrc.backupdir_path) {
1339 os << "\\backupdir_path \"" << backupdir_path << "\"\n";
1343 << "# ASCII EXPORT SECTION ##############################\n"
1346 case RC_ASCIIROFF_COMMAND:
1347 if (ascii_roff_command != system_lyxrc.ascii_roff_command) {
1348 os << "\\ascii_roff_command \"" << ascii_roff_command
1353 << "# SPELLCHECKER SECTION ##############################\n"
1356 case RC_SPELL_COMMAND:
1357 if (isp_command != system_lyxrc.isp_command) {
1358 os << "\\spell_command \"" << isp_command << "\"\n";
1360 case RC_ACCEPT_COMPOUND:
1361 if (isp_accept_compound != system_lyxrc.isp_accept_compound) {
1362 os << "\\accept_compound " << tostr(isp_accept_compound)
1365 case RC_USE_ALT_LANG:
1366 if (isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1367 os << "\\use_alt_language " << tostr(isp_use_alt_lang)
1371 if (isp_alt_lang != system_lyxrc.isp_alt_lang) {
1372 os << "\\alternate_language \"" << isp_alt_lang
1375 case RC_USE_ESC_CHARS:
1376 if (isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1377 os << "\\use_escape_chars " << tostr(isp_use_esc_chars)
1381 if (isp_esc_chars != system_lyxrc.isp_esc_chars) {
1382 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1384 case RC_USE_PERS_DICT:
1385 if (isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1386 os << "\\use_personal_dictionary "
1387 << tostr(isp_use_pers_dict)
1391 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1392 os << "\\personal_dictionary \"" << isp_pers_dict
1395 case RC_USE_INP_ENC:
1396 if (isp_use_input_encoding
1397 != system_lyxrc.isp_use_input_encoding) {
1398 os << "\\use_input_encoding "
1399 << tostr(isp_use_input_encoding)
1404 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1407 case RC_RTL_SUPPORT:
1408 if (rtl_support != system_lyxrc.rtl_support) {
1409 os << "\\rtl " << tostr(rtl_support) << "\n";
1411 case RC_LANGUAGE_PACKAGE:
1412 if (language_package != system_lyxrc.language_package) {
1413 os << "\\language_package \"" << language_package
1416 case RC_LANGUAGE_COMMAND_BEGIN:
1417 if (language_command_begin
1418 != system_lyxrc.language_command_begin) {
1419 os << "\\language_command_begin \""
1420 << language_command_begin
1423 case RC_LANGUAGE_COMMAND_END:
1424 if (language_command_end
1425 != system_lyxrc.language_command_end) {
1426 os << "\\language_command_end \"" << language_command_end
1429 case RC_LANGUAGE_AUTO_BEGIN:
1430 if (language_auto_begin != system_lyxrc.language_auto_begin) {
1431 os << "\\language_auto_begin "
1432 << tostr(language_auto_begin) << "\n";
1434 case RC_LANGUAGE_AUTO_END:
1435 if (language_auto_end != system_lyxrc.language_auto_end) {
1436 os << "\\language_auto_end "
1437 << tostr(language_auto_end) << "\n";
1439 case RC_MARK_FOREIGN_LANGUAGE:
1440 if (mark_foreign_language
1441 != system_lyxrc.mark_foreign_language) {
1442 os << "\\mark_foreign_language " <<
1443 tostr(mark_foreign_language) << "\n";
1447 << "# 2nd MISC SUPPORT SECTION ##########################\n"
1450 case RC_OVERRIDE_X_DEADKEYS:
1451 if (override_x_deadkeys != system_lyxrc.override_x_deadkeys) {
1452 os << "\\override_x_deadkeys "
1453 << tostr(override_x_deadkeys) << "\n";
1455 case RC_SCREEN_FONT_ENCODING_MENU:
1456 if (font_norm_menu != system_lyxrc.font_norm_menu) {
1457 os << "\\screen_font_encoding_menu \"" << font_norm_menu
1460 case RC_AUTO_NUMBER:
1461 if (auto_number != system_lyxrc.auto_number) {
1462 os << "\\auto_number " << tostr(auto_number) << "\n";
1464 case RC_NEW_ASK_FILENAME:
1465 if (new_ask_filename != system_lyxrc.new_ask_filename) {
1466 os << "\\new_ask_filename " << tostr(new_ask_filename)
1469 case RC_DEFAULT_LANGUAGE:
1470 if (default_language != system_lyxrc.default_language) {
1471 os << "\\default_language " << default_language << "\n";
1475 << "# FORMATS SECTION ##########################\n"
1479 // Look for deleted formats
1480 for (Formats::const_iterator cit = formats.begin();
1481 cit != formats.end(); ++cit) {
1482 Format const * format =
1483 system_formats.GetFormat(cit->name());
1485 format->extension() != cit->extension() ||
1486 format->prettyname() != cit->prettyname() ||
1487 format->shortcut() != cit->shortcut())
1488 os << "\\format \"" << cit->name() << "\" \""
1489 << cit->extension() << "\" \""
1490 << cit->prettyname() << "\" \""
1491 << cit->shortcut() << "\"\n";
1494 // New/modifed formats
1495 for (Formats::const_iterator cit = system_formats.begin();
1496 cit != system_formats.end(); ++cit)
1497 if (!formats.GetFormat(cit->name()))
1498 os << "\\format \"" << cit->name()
1499 << "\" \"\" \"\" \"\"\n";
1501 for (Formats::const_iterator cit = formats.begin();
1502 cit != formats.end(); ++cit) {
1503 Format const * format =
1504 system_formats.GetFormat(cit->name());
1505 if ((!format || format->viewer() != cit->viewer()) &&
1506 (format || !cit->viewer().empty()))
1507 os << "\\viewer \"" << cit->name() << "\" \""
1508 << cit->viewer() << "\"\n";
1512 << "# CONVERTERS SECTION ##########################\n"
1516 // Look for new converters
1517 for (Converters::const_iterator cit = converters.begin();
1518 cit != converters.end(); ++cit) {
1519 Converter const * converter =
1520 system_converters.GetConverter(cit->from,
1523 converter->command != cit->command ||
1524 converter->flags != cit->flags)
1525 os << "\\converter \"" << cit->from << "\" \""
1526 << cit->to << "\" \""
1527 << cit->command << "\" \""
1528 << cit->flags << "\"\n";
1531 // New/modifed converters
1532 for (Converters::const_iterator cit = system_converters.begin();
1533 cit != system_converters.end(); ++cit)
1534 if (!converters.GetConverter(cit->from, cit->to))
1535 os << "\\converter \"" << cit->from
1536 << "\" \"" << cit->to << "\" \"\" \"\"\n";
1541 void LyXRC::set_font_norm_type()
1543 if (font_norm == "iso10646-1")
1544 font_norm_type = ISO_10646_1;
1545 else if (font_norm == "iso8859-1")
1546 font_norm_type = ISO_8859_1;
1547 else if (font_norm == "iso8859-6.8x")
1548 font_norm_type = ISO_8859_6_8;
1549 else if (font_norm == "iso8859-9")
1550 font_norm_type = ISO_8859_9;
1552 font_norm_type = OTHER_ENCODING;
1556 string const LyXRC::getDescription(LyXRCTags tag)
1561 case RC_FONT_ENCODING:
1562 str = N_("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
1566 str = N_("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
1569 case RC_PRINT_COMMAND:
1570 str = N_("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
1573 case RC_PRINTEVENPAGEFLAG:
1574 str = N_("The option to print only even pages.");
1577 case RC_PRINTODDPAGEFLAG:
1578 str = N_("The option to print only odd pages.");
1581 case RC_PRINTPAGERANGEFLAG:
1582 str = N_("The option for specifying a comma-separated list of pages to print.");
1585 case RC_PRINTCOPIESFLAG:
1586 str = N_("The option for specifying the number of copies to print.");
1589 case RC_PRINTCOLLCOPIESFLAG:
1590 str = N_("The option for specifying whether the copies should be collated.");
1593 case RC_PRINTREVERSEFLAG:
1594 str = N_("The option to reverse the order of the pages printed.");
1597 case RC_PRINTLANDSCAPEFLAG:
1598 str = N_("The option to print out in landscape.");
1601 case RC_PRINTPAPERFLAG:
1602 str = N_("The option to specify paper type.");
1605 case RC_PRINTPAPERDIMENSIONFLAG:
1606 str = N_("Option to specify the dimensions of the print paper.");
1609 case RC_PRINTTOPRINTER:
1610 str = N_("Option to pass to the print program to print on a specific printer.");
1613 case RC_PRINT_ADAPTOUTPUT:
1614 str = N_("Select for LyX to pass the name of the destination printer to your print command.");
1617 case RC_PRINTTOFILE:
1618 str = N_("Option to pass to the print program to print to a file.");
1621 case RC_PRINTFILEEXTENSION:
1622 str = N_("Extension of printer program output file. Usually \".ps\".");
1625 case RC_PRINTEXSTRAOPTIONS:
1626 str = N_("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
1629 case RC_PRINTSPOOL_COMMAND:
1630 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.");
1633 case RC_PRINTSPOOL_PRINTERPREFIX:
1634 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.");
1638 str = N_("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
1641 case RC_SCREEN_ZOOM:
1642 //xgettext:no-c-format
1643 str = N_("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
1646 case RC_SCREEN_FONT_SIZES:
1647 str = N_("The font sizes used for calculating the scaling of the screen fonts.");
1650 case RC_SCREEN_FONT_ROMAN:
1651 case RC_SCREEN_FONT_SANS:
1652 case RC_SCREEN_FONT_TYPEWRITER:
1653 str = N_("The screen fonts used to display the text while editing.");
1656 case RC_SCREEN_FONT_MENU:
1657 str = N_("The font for menus (and groups titles in popups).");
1660 case RC_SCREEN_FONT_POPUP:
1661 str = N_("The font for popups.");
1664 case RC_SCREEN_FONT_ENCODING:
1665 str = N_("The encoding for the screen fonts.");
1668 case RC_SCREEN_FONT_ENCODING_MENU:
1669 str = N_("The encoding for the menu/popups fonts.");
1676 str = N_("The time interval between auto-saves (in seconds). 0 means no auto-save.");
1679 case RC_DOCUMENTPATH:
1680 str = N_("The default path for your documents.");
1683 case RC_TEMPLATEPATH:
1684 str = N_("The path that LyX will set when offering to choose a template.");
1687 case RC_TEMPDIRPATH:
1688 str = N_("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
1692 str = N_("Select if you wish to use a temporary directory structure to store temporary TeX output.");
1696 str = N_("The file where the last-files information should be stored.");
1699 case RC_AUTOREGIONDELETE:
1700 str = N_("De-select if you don't want the current selection to be replaced automatically by what you type.");
1703 case RC_OVERRIDE_X_DEADKEYS:
1704 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.");
1709 str = N_("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
1713 str = N_("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
1717 str = N_("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
1721 case RC_KBMAP_PRIMARY:
1722 case RC_KBMAP_SECONDARY:
1723 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.");
1726 case RC_ASCIIROFF_COMMAND:
1727 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.");
1730 case RC_ASCII_LINELEN:
1731 str = N_("This is the maximum line length of an exported ASCII file (LaTeX, SGML or plain text).");
1734 case RC_NUMLASTFILES:
1735 str = N_("Maximal number of lastfiles. Up to 9 can appear in the file menu.");
1738 case RC_CHECKLASTFILES:
1739 str = N_("Select to check whether the lastfiles still exist.");
1742 case RC_VIEWDVI_PAPEROPTION:
1745 case RC_DEFAULT_PAPERSIZE:
1746 str = N_("Specify the default paper size.");
1752 case RC_ACCEPT_COMPOUND:
1753 str = N_("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
1756 case RC_SPELL_COMMAND:
1757 str = N_("What command runs the spell checker?");
1760 case RC_USE_INP_ENC:
1761 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.");
1764 case RC_USE_ALT_LANG:
1766 str = N_("Specify an alternate language. The default is to use the language of the document.");
1769 case RC_USE_PERS_DICT:
1771 str = N_("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
1774 case RC_USE_ESC_CHARS:
1776 str = N_("Specify additional chars that can be part of a word.");
1779 case RC_SCREEN_FONT_SCALABLE:
1780 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.");
1783 case RC_CHKTEX_COMMAND:
1784 str = N_("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
1787 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1788 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.");
1791 case RC_EXIT_CONFIRMATION:
1792 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.)");
1795 case RC_DISPLAY_SHORTCUTS:
1796 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.");
1799 case RC_MAKE_BACKUP:
1800 str = N_("De-select if you don't want LyX to create backup files.");
1803 case RC_BACKUPDIR_PATH:
1804 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.");
1807 case RC_RTL_SUPPORT:
1808 str = N_("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
1811 case RC_MARK_FOREIGN_LANGUAGE:
1812 str = N_("Select to control the highlighting of words with a language foreign to that of the document.");
1815 case RC_LANGUAGE_PACKAGE:
1816 str = N_("The latex command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
1819 case RC_LANGUAGE_AUTO_BEGIN:
1820 str = N_("Select if a language switching command is needed at the beginning of the document.");
1823 case RC_LANGUAGE_AUTO_END:
1824 str = N_("Select if a language switching command is needed at the end of the document.");
1827 case RC_LANGUAGE_COMMAND_BEGIN:
1828 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.");
1831 case RC_LANGUAGE_COMMAND_END:
1832 str = N_("The latex command for changing back to the language of the document.");
1835 case RC_DATE_INSERT_FORMAT:
1836 //xgettext:no-c-format
1837 str = N_("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
1840 case RC_SHOW_BANNER:
1841 str = N_("De-select if you don't want the startup banner.");
1845 str = N_("The wheel movement factor (for mice with wheels or five button mice).");
1857 case RC_NEW_ASK_FILENAME:
1858 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.");
1861 case RC_DEFAULT_LANGUAGE:
1862 str = N_("New documents will be assigned this language.");
1865 case RC_LABEL_INIT_LENGTH:
1866 str = N_("Maximum number of words in the initialization string for a new label");
1876 // The global instance
1879 // The global copy of the system lyxrc entries (everything except preferences)