3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
25 #include "converter.h"
34 #include "graphics/GraphicsTypes.h"
36 #include "support/convert.h"
37 #include "support/environment.h"
38 #include "support/filetools.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/userinfo.h"
43 namespace os = lyx::support::os;
46 using lyx::support::ascii_lowercase;
47 using lyx::support::bformat;
48 using lyx::support::expandPath;
49 using lyx::support::getEnv;
50 using lyx::support::libFileSearch;
51 using lyx::support::token;
64 // when adding something to this array keep it sorted!
65 keyword_item lyxrcTags[] = {
66 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
67 { "\\alternate_language", LyXRC::RC_ALT_LANG },
68 { "\\ascii_linelen", LyXRC::RC_ASCII_LINELEN },
69 { "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
70 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
71 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
72 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
73 { "\\autosave", LyXRC::RC_AUTOSAVE },
74 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
75 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
76 { "\\bind_file", LyXRC::RC_BINDFILE },
77 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
78 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
79 { "\\converter", LyXRC::RC_CONVERTER },
80 { "\\copier", LyXRC::RC_COPIER },
81 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
82 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
83 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
84 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
85 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
86 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
87 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
88 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
89 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
90 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
91 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
92 { "\\format", LyXRC::RC_FORMAT },
93 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
94 { "\\input", LyXRC::RC_INPUT },
95 { "\\kbmap", LyXRC::RC_KBMAP },
96 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
97 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
98 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
99 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
100 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
101 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
102 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
103 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
104 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
105 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
106 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
107 { "\\load_session", LyXRC::RC_LOADSESSION },
108 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
109 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
110 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
111 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
112 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
113 { "\\popup_bold_font", LyXRC::RC_POPUP_BOLD_FONT },
114 { "\\popup_font_encoding", LyXRC::RC_POPUP_FONT_ENCODING },
115 { "\\popup_normal_font", LyXRC::RC_POPUP_NORMAL_FONT },
116 { "\\preview", LyXRC::RC_PREVIEW },
117 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
118 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
119 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
120 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
121 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
122 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
123 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
124 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
125 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
126 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
127 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
128 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
129 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
130 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
131 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
132 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
133 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
134 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
135 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
136 { "\\printer", LyXRC::RC_PRINTER },
137 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
138 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
139 { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
140 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
141 { "\\screen_font_encoding_menu", LyXRC::RC_POPUP_FONT_ENCODING },
142 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
143 { "\\screen_font_menu", LyXRC::RC_POPUP_BOLD_FONT },
144 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
145 { "\\screen_font_popup", LyXRC::RC_POPUP_NORMAL_FONT },
146 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
147 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
148 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
149 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
150 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
151 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
152 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
153 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
154 { "\\screen_geometry_height", LyXRC::RC_SCREEN_GEOMETRY_HEIGHT },
155 { "\\screen_geometry_width", LyXRC::RC_SCREEN_GEOMETRY_WIDTH },
156 { "\\screen_geometry_xysaved", LyXRC::RC_SCREEN_GEOMETRY_XYSAVED },
157 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
158 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
159 { "\\set_color", LyXRC::RC_SET_COLOR },
160 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
161 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
162 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
163 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
164 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
165 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
166 { "\\ui_file", LyXRC::RC_UIFILE },
167 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
168 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
169 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
170 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
171 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
172 // compatibility with versions older than 1.4.0 only
173 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
174 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
175 // compatibility with versions older than 1.4.0 only
176 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
177 { "\\user_email", LyXRC::RC_USER_EMAIL },
178 { "\\user_name", LyXRC::RC_USER_NAME },
179 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
180 // compatibility with versions older than 1.4.0 only
181 { "\\viewer" ,LyXRC::RC_VIEWER}
184 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
195 void LyXRC::setDefaults() {
198 // Get printer from the environment. If fail, use default "",
199 // assuming that everything is set up correctly.
200 printer = getEnv("PRINTER");
201 print_adapt_output = false;
202 print_command = "dvips";
203 print_evenpage_flag = "-B";
204 print_oddpage_flag = "-A";
205 print_pagerange_flag = "-pp";
206 print_copies_flag = "-c";
207 print_collcopies_flag = "-C";
208 print_reverse_flag = "-r";
209 print_landscape_flag = "-t landscape";
210 print_to_printer = "-P";
211 print_to_file = "-o ";
212 print_file_extension = ".ps";
213 print_paper_flag = "-t";
214 print_paper_dimension_flag = "-T";
215 document_path.erase();
216 view_dvi_paper_option.erase();
217 default_papersize = PAPER_DEFAULT;
218 custom_export_format = "ps";
219 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
220 bibtex_command = "bibtex";
222 index_command = "makeindex -c -q";
224 // Because a screen typically is wider than a piece of paper:
228 geometry_xysaved = true;
229 // Default LaTeX font size:
230 font_sizes[LyXFont::SIZE_TINY] = "5.0";
231 font_sizes[LyXFont::SIZE_SCRIPT] = "7.0";
232 font_sizes[LyXFont::SIZE_FOOTNOTE] = "8.0";
233 font_sizes[LyXFont::SIZE_SMALL] = "9.0";
234 font_sizes[LyXFont::SIZE_NORMAL] = "10.0";
235 font_sizes[LyXFont::SIZE_LARGE] = "12.0";
236 font_sizes[LyXFont::SIZE_LARGER] = "14.4";
237 font_sizes[LyXFont::SIZE_LARGEST] = "17.26";
238 font_sizes[LyXFont::SIZE_HUGE] = "20.74";
239 font_sizes[LyXFont::SIZE_HUGER] = "24.88";
240 use_scalable_fonts = true;
241 roman_font_name = "";
243 typewriter_font_name = "";
244 popup_bold_font = "-*-helvetica-bold-r";
245 popup_normal_font = "-*-helvetica-medium-r";
246 font_norm = "iso8859-1";
247 font_norm_type = ISO_8859_1;
248 popup_font_encoding.erase();
250 auto_region_delete = true;
251 auto_reset_options = false;
253 num_lastfiles = maxlastfiles;
254 check_lastfiles = true;
255 use_lastfilepos = true;
256 load_session = false;
258 backupdir_path.erase();
259 display_graphics = lyx::graphics::ColorDisplay;
260 // Spellchecker settings:
261 use_spell_lib = true;
262 isp_command = "ispell";
263 isp_accept_compound = false;
264 isp_use_input_encoding = false;
265 isp_use_alt_lang = false;
266 isp_use_pers_dict = false;
267 isp_use_esc_chars = false;
271 mark_foreign_language = true;
272 language_auto_begin = true;
273 language_auto_end = true;
274 language_global_options = true;
275 language_use_babel = true;
276 language_package = "\\usepackage{babel}";
277 language_command_begin = "\\selectlanguage{$$lang}";
278 language_command_local = "\\foreignlanguage{$$lang}{";
279 default_language = "english";
281 windows_style_tex_paths = false;
282 tex_allows_spaces = false;
283 date_insert_format = "%A, %e %B %Y";
284 cursor_follows_scrollbar = false;
285 dialogs_iconify_with_main = false;
286 label_init_length = 3;
287 preview = PREVIEW_OFF;
288 preview_hashed_labels = false;
289 preview_scale_factor = "0.9";
291 user_name = lyx::support::user_name();
293 user_email = lyx::support::user_email();
299 void oldFontFormat(string & family, string & foundry)
301 if (family.empty() || family[0] != '-')
303 foundry = token(family, '-', 1);
304 family = token(family, '-', 2);
312 int LyXRC::read(string const & filename)
314 LyXLex lexrc(lyxrcTags, lyxrcCount);
315 if (lyxerr.debugging(Debug::PARSER))
316 lexrc.printTable(lyxerr);
318 lexrc.setFile(filename);
319 if (!lexrc.isOK()) return -2;
321 lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
327 int LyXRC::read(std::istream & is)
329 LyXLex lexrc(lyxrcTags, lyxrcCount);
330 if (lyxerr.debugging(Debug::PARSER))
331 lexrc.printTable(lyxerr);
334 if (!lexrc.isOK()) return -2;
336 lyxerr[Debug::LYXRC] << "Reading istream..." << endl;
342 int LyXRC::read(LyXLex & lexrc)
344 if (!lexrc.isOK()) return -2;
346 while (lexrc.isOK()) {
347 // By using two switches we take advantage of the compiler
348 // telling us if we have missed a LyXRCTags element in
349 // the second switch.
350 // Note that this also shows a problem with LyXLex since it
351 // helps us avoid taking advantage of the strictness of the
354 int le = lexrc.lex();
356 case LyXLex::LEX_UNDEF:
357 lexrc.printError("Unknown tag `$$Token'");
359 case LyXLex::LEX_FEOF:
363 switch (static_cast<LyXRCTags>(le)) {
364 case RC_INPUT: // Include file
367 libFileSearch(string(),
370 lexrc.printError("Error reading "
371 "included file: "+tmp);
377 bind_file = os::internal_path(lexrc.getString());
383 ui_file = os::internal_path(lexrc.getString());
387 case RC_AUTORESET_OPTIONS:
389 auto_reset_options = lexrc.getBool();
393 case RC_DISPLAY_GRAPHICS:
395 display_graphics = lyx::graphics::displayTranslator().find(lexrc.getString());
399 case RC_TEX_EXPECTS_WINDOWS_PATHS:
401 windows_style_tex_paths = lexrc.getBool();
405 case RC_TEX_ALLOWS_SPACES:
407 tex_allows_spaces = lexrc.getBool();
413 use_kbmap = lexrc.getBool();
417 case RC_KBMAP_PRIMARY:
419 string const kmap(os::internal_path(lexrc.getString()));
422 } else if (!libFileSearch("kbd", kmap,
424 primary_kbmap = kmap;
426 lexrc.printError("LyX: Keymap `$$Token' not found");
431 case RC_KBMAP_SECONDARY:
433 string const kmap(os::internal_path(lexrc.getString()));
436 } else if (!libFileSearch("kbd", kmap,
438 secondary_kbmap = kmap;
440 lexrc.printError("LyX: Keymap `$$Token' not found");
445 case RC_FONT_ENCODING:
447 fontenc = lexrc.getString();
453 printer = lexrc.getString();
457 case RC_PRINT_COMMAND:
459 print_command = lexrc.getString();
463 case RC_PRINTEVENPAGEFLAG:
465 print_evenpage_flag = lexrc.getString();
469 case RC_PRINTODDPAGEFLAG:
471 print_oddpage_flag = lexrc.getString();
475 case RC_PRINTPAGERANGEFLAG:
477 print_pagerange_flag = lexrc.getString();
481 case RC_PRINTCOPIESFLAG:
483 print_copies_flag = lexrc.getString();
487 case RC_PRINTCOLLCOPIESFLAG:
489 print_collcopies_flag = lexrc.getString();
493 case RC_PRINTREVERSEFLAG:
495 print_reverse_flag = lexrc.getString();
499 case RC_PRINTLANDSCAPEFLAG:
501 print_landscape_flag = lexrc.getString();
505 case RC_PRINTTOPRINTER:
507 print_to_printer = lexrc.getString();
511 case RC_PRINT_ADAPTOUTPUT:
513 print_adapt_output = lexrc.getBool();
519 print_to_file = os::internal_path(lexrc.getString());
523 case RC_PRINTFILEEXTENSION:
525 print_file_extension = lexrc.getString();
529 case RC_PRINTEXSTRAOPTIONS:
531 print_extra_options = lexrc.getString();
535 case RC_PRINTSPOOL_COMMAND:
537 print_spool_command = lexrc.getString();
541 case RC_PRINTSPOOL_PRINTERPREFIX:
543 print_spool_printerprefix = lexrc.getString();
547 case RC_PRINTPAPERDIMENSIONFLAG:
549 print_paper_dimension_flag = lexrc.getString();
553 case RC_PRINTPAPERFLAG:
555 print_paper_flag = lexrc.getString();
559 case RC_CUSTOM_EXPORT_COMMAND:
561 custom_export_command = lexrc.getString();
565 case RC_CUSTOM_EXPORT_FORMAT:
567 custom_export_format = lexrc.getString();
571 case RC_DEFAULT_PAPERSIZE:
574 ascii_lowercase(lexrc.getString());
575 if (size == "usletter")
578 else if (size == "legal")
581 else if (size == "executive")
584 else if (size == "a3")
587 else if (size == "a4")
590 else if (size == "a5")
593 else if (size == "b5")
596 else if (size == "default")
602 case RC_VIEWDVI_PAPEROPTION:
604 view_dvi_paper_option = lexrc.getString();
606 view_dvi_paper_option.erase();
610 case RC_CHKTEX_COMMAND:
612 chktex_command = lexrc.getString();
616 case RC_BIBTEX_COMMAND:
618 bibtex_command = lexrc.getString();
622 case RC_INDEX_COMMAND:
624 index_command = lexrc.getString();
630 dpi = lexrc.getInteger();
636 zoom = lexrc.getInteger();
640 case RC_SCREEN_GEOMETRY_HEIGHT:
642 geometry_height = lexrc.getInteger();
646 case RC_SCREEN_GEOMETRY_WIDTH:
648 geometry_width = lexrc.getInteger();
652 case RC_SCREEN_GEOMETRY_XYSAVED:
654 geometry_xysaved = lexrc.getBool();
658 case RC_SCREEN_FONT_SIZES:
660 font_sizes[LyXFont::SIZE_TINY] =
664 font_sizes[LyXFont::SIZE_SCRIPT] =
668 font_sizes[LyXFont::SIZE_FOOTNOTE] =
672 font_sizes[LyXFont::SIZE_SMALL] =
676 font_sizes[LyXFont::SIZE_NORMAL] =
680 font_sizes[LyXFont::SIZE_LARGE] =
684 font_sizes[LyXFont::SIZE_LARGER] =
688 font_sizes[LyXFont::SIZE_LARGEST] =
692 font_sizes[LyXFont::SIZE_HUGE] =
696 font_sizes[LyXFont::SIZE_HUGER] =
701 case RC_SCREEN_FONT_SCALABLE:
703 use_scalable_fonts = lexrc.getBool();
709 autosave = lexrc.getInteger();
713 case RC_DOCUMENTPATH:
715 document_path = os::internal_path(lexrc.getString());
716 document_path = expandPath(document_path);
720 case RC_TEMPLATEPATH:
722 template_path = os::internal_path(lexrc.getString());
723 template_path = expandPath(template_path);
729 tempdir_path = os::internal_path(lexrc.getString());
730 tempdir_path = expandPath(tempdir_path);
736 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
740 case RC_USELASTFILEPOS:
742 use_lastfilepos = lexrc.getBool();
748 load_session = lexrc.getBool();
752 case RC_NUMLASTFILES:
754 num_lastfiles = lexrc.getInteger();
758 case RC_CHECKLASTFILES:
760 check_lastfiles = lexrc.getBool();
764 case RC_SCREEN_FONT_ROMAN:
766 roman_font_name = lexrc.getString();
767 oldFontFormat(roman_font_name,
772 case RC_SCREEN_FONT_SANS:
774 sans_font_name = lexrc.getString();
775 oldFontFormat(sans_font_name, sans_font_foundry);
779 case RC_SCREEN_FONT_TYPEWRITER:
781 typewriter_font_name = lexrc.getString();
782 oldFontFormat(typewriter_font_name,
783 typewriter_font_foundry);
787 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
789 roman_font_foundry = lexrc.getString();
793 case RC_SCREEN_FONT_SANS_FOUNDRY:
795 sans_font_foundry = lexrc.getString();
799 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
801 typewriter_font_foundry = lexrc.getString();
805 case RC_SCREEN_FONT_ENCODING:
807 font_norm = lexrc.getString();
808 set_font_norm_type();
812 case RC_POPUP_BOLD_FONT:
814 popup_bold_font = lexrc.getString();
818 case RC_POPUP_NORMAL_FONT:
820 popup_normal_font = lexrc.getString();
824 case RC_POPUP_FONT_ENCODING:
826 popup_font_encoding = lexrc.getString();
832 string lyx_name, x11_name;
835 lyx_name = lexrc.getString();
837 lexrc.printError("Missing color tag.");
842 x11_name = lexrc.getString();
844 lexrc.printError("Missing color name for color: `$$Token'");
848 LColor::color const col =
849 lcolor.getFromLyXName(lyx_name);
850 if (col == LColor::none ||
851 col == LColor::inherit ||
852 col == LColor::ignore)
855 if (!lcolor.setColor(col, x11_name)) {
856 lyxerr << "Bad lyxrc set_color for "
862 case RC_AUTOREGIONDELETE:
863 // Auto region delete defaults to true
865 auto_region_delete = lexrc.getBool();
871 lyxpipes = os::internal_path(lexrc.getString());
872 lyxpipes = expandPath(lyxpipes);
876 case RC_CURSOR_FOLLOWS_SCROLLBAR:
878 cursor_follows_scrollbar = lexrc.getBool();
882 case RC_DIALOGS_ICONIFY_WITH_MAIN:
884 dialogs_iconify_with_main = lexrc.getBool();
888 case RC_ASCIIROFF_COMMAND:
890 ascii_roff_command = lexrc.getString();
893 case RC_ASCII_LINELEN:
895 ascii_linelen = lexrc.getInteger();
898 // Spellchecker settings:
899 case RC_USE_SPELL_LIB:
901 use_spell_lib = lexrc.getBool();
904 case RC_SPELL_COMMAND:
906 isp_command = lexrc.getString();
909 case RC_ACCEPT_COMPOUND:
911 isp_accept_compound = lexrc.getBool();
916 isp_use_input_encoding = lexrc.getBool();
919 case RC_USE_ALT_LANG:
921 isp_use_alt_lang = lexrc.getBool();
924 case RC_USE_PERS_DICT:
926 isp_use_pers_dict = lexrc.getBool();
929 case RC_USE_ESC_CHARS:
931 isp_use_esc_chars = lexrc.getBool();
936 isp_alt_lang = lexrc.getString();
941 isp_pers_dict = os::internal_path(lexrc.getString());
946 isp_esc_chars = lexrc.getString();
951 make_backup = lexrc.getBool();
954 case RC_BACKUPDIR_PATH:
956 backupdir_path = os::internal_path(lexrc.getString());
957 backupdir_path = expandPath(backupdir_path);
960 case RC_DATE_INSERT_FORMAT:
962 date_insert_format = lexrc.getString();
965 case RC_LANGUAGE_PACKAGE:
967 language_package = lexrc.getString();
970 case RC_LANGUAGE_AUTO_BEGIN:
972 language_auto_begin = lexrc.getBool();
975 case RC_LANGUAGE_AUTO_END:
977 language_auto_end = lexrc.getBool();
980 case RC_LANGUAGE_GLOBAL_OPTIONS:
982 language_global_options = lexrc.getBool();
985 case RC_LANGUAGE_USE_BABEL:
987 language_use_babel = lexrc.getBool();
990 case RC_LANGUAGE_COMMAND_BEGIN:
992 language_command_begin = lexrc.getString();
995 case RC_LANGUAGE_COMMAND_END:
997 language_command_end = lexrc.getString();
1000 case RC_LANGUAGE_COMMAND_LOCAL:
1002 language_command_local = lexrc.getString();
1005 case RC_RTL_SUPPORT:
1007 rtl_support = lexrc.getBool();
1010 case RC_AUTO_NUMBER:
1012 auto_number = lexrc.getBool();
1015 case RC_MARK_FOREIGN_LANGUAGE:
1017 mark_foreign_language = lexrc.getBool();
1022 string fmt, command;
1024 fmt = lexrc.getString();
1027 command = lexrc.getString();
1029 movers.set(fmt, command);
1033 case RC_CONVERTER: {
1034 string from, to, command, flags;
1036 from = lexrc.getString();
1039 to = lexrc.getString();
1042 command = lexrc.getString();
1045 flags = lexrc.getString();
1047 if (command.empty()) {
1048 converters.erase(from, to);
1050 converters.add(from, to, command, flags);
1054 // compatibility with versions older than 1.4.0 only
1056 string format, command;
1058 format = lexrc.getString();
1061 command = lexrc.getString();
1063 formats.setViewer(format, command);
1067 string format, extension, prettyname, shortcut;
1069 format = lexrc.getString();
1072 extension = lexrc.getString();
1075 prettyname = lexrc.getString();
1078 shortcut = lexrc.getString();
1080 string viewer, editor;
1082 viewer = lexrc.getString();
1084 editor = lexrc.getString();
1086 // Hack to ensure compatibility with versions older
1088 int le = lexrc.lex();
1089 if (le != LyXLex::LEX_FEOF && le != LyXLex::LEX_UNDEF) {
1090 flags = lexrc.getString();
1091 if (le != LyXLex::LEX_DATA) {
1092 // We have got a known token.
1093 // Therefore this is an old style
1094 // format definition without
1096 lexrc.pushToken(flags);
1100 int flgs = Format::none;
1101 while (!flags.empty()) {
1103 flags = lyx::support::split(flags, flag, ',');
1104 if (flag == "document")
1105 flgs |= Format::document;
1106 else if (flag == "vector")
1107 flgs |= Format::vector;
1109 lyxerr << "Ignoring unknown flag `"
1110 << flag << "' for format `"
1111 << format << "'." << endl;
1113 if (prettyname.empty()) {
1114 if (converters.formatIsUsed(format)) {
1115 lyxerr << "Can't delete format "
1118 formats.erase(format);
1121 formats.add(format, extension, prettyname,
1122 shortcut, viewer, editor, flgs);
1126 case RC_DEFAULT_LANGUAGE:
1128 default_language = lexrc.getString();
1132 case RC_LABEL_INIT_LENGTH:
1134 label_init_length = lexrc.getInteger();
1138 case RC_SHOW_BANNER:
1140 show_banner = lexrc.getBool();
1146 string const tmp = lexrc.getString();
1147 if (tmp == "true" || tmp == "on")
1148 preview = PREVIEW_ON;
1149 else if (tmp == "no_math")
1150 preview = PREVIEW_NO_MATH;
1152 preview = PREVIEW_OFF;
1153 if (tmp != "false" && tmp != "off")
1154 lyxerr << "Unrecognized "
1156 << tmp << '\n' << endl;
1161 case RC_PREVIEW_HASHED_LABELS:
1163 preview_hashed_labels = lexrc.getBool();
1167 case RC_PREVIEW_SCALE_FACTOR:
1169 preview_scale_factor = lexrc.getString();
1175 user_name = lexrc.getString();
1180 user_email = lexrc.getString();
1183 case RC_PATH_PREFIX:
1185 path_prefix = lexrc.getString();
1188 case RC_LAST: break; // this is just a dummy
1192 /// Update converters data-structures
1193 converters.update(formats);
1194 converters.buildGraph();
1200 void LyXRC::write(string const & filename, bool ignore_system_lyxrc) const
1202 ofstream ofs(filename.c_str());
1204 write(ofs, ignore_system_lyxrc);
1208 void LyXRC::print() const
1210 if (lyxerr.debugging())
1211 write(lyxerr, false);
1219 typedef std::pair<std::string, SpecialisedMover> Data;
1221 SameMover(Data const & comparison)
1222 : comparison_(comparison) {}
1224 bool operator()(Data const & data) const
1226 return data.first == comparison_.first &&
1227 data.second.command() == comparison_.second.command();
1235 void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const
1237 os << "### This file is part of\n"
1238 << "### ========================================================\n"
1239 << "### LyX, The Document Processor\n"
1241 << "### Copyright 1995 Matthias Ettrich\n"
1242 << "### Copyright 1995-2001 The LyX Team.\n"
1244 << "### ========================================================\n"
1246 << "# This file is written by LyX, if you want to make your own\n"
1247 << "# modifications you should do them from inside LyX and save\n"
1250 // Why the switch you might ask. It is a trick to ensure that all
1251 // the elements in the LyXRCTags enum is handled. As you can see
1252 // there are no breaks at all. So it is just a huge fall-through.
1253 // The nice thing is that we will get a warning from the compiler
1254 // if we forget an element.
1255 LyXRCTags tag = RC_LAST;
1259 // input/include files are not done here
1261 if (ignore_system_lyxrc ||
1262 bind_file != system_lyxrc.bind_file) {
1263 string const path = os::external_path(bind_file);
1264 os << "\\bind_file \"" << path << "\"\n";
1270 << "# MISC SECTION ######################################\n"
1273 // bind files are not done here.
1275 case RC_PATH_PREFIX:
1276 if (ignore_system_lyxrc ||
1277 path_prefix != system_lyxrc.path_prefix) {
1278 os << "\\path_prefix \"" << path_prefix << "\"\n";
1282 if (ignore_system_lyxrc ||
1283 ui_file != system_lyxrc.ui_file) {
1284 string const path = os::external_path(ui_file);
1285 os << "\\ui_file \"" << path << "\"\n";
1287 case RC_AUTOREGIONDELETE:
1288 if (ignore_system_lyxrc ||
1289 auto_region_delete != system_lyxrc.auto_region_delete) {
1290 os << "# Set to false to inhibit automatic replacement of\n"
1291 << "# the current selection.\n"
1292 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1295 case RC_AUTORESET_OPTIONS:
1296 if (ignore_system_lyxrc ||
1297 auto_reset_options != system_lyxrc.auto_reset_options) {
1298 os << "# Set to false to inhibit automatic reset of\n"
1299 << "# the class options to defaults on class change.\n"
1300 << "\\auto_reset_options "
1301 << convert<string>(auto_reset_options)
1305 if (ignore_system_lyxrc ||
1306 autosave != system_lyxrc.autosave) {
1307 os << "# The time interval between auto-saves in seconds.\n"
1308 << "\\autosave " << autosave << '\n';
1310 case RC_DISPLAY_GRAPHICS:
1311 if (ignore_system_lyxrc ||
1312 display_graphics != system_lyxrc.display_graphics) {
1313 os << "# Display graphics within LyX\n"
1314 << "# monochrome|grayscale|color|none\n"
1315 << "\\display_graphics "
1316 << lyx::graphics::displayTranslator().find(display_graphics)
1320 case RC_VIEWDVI_PAPEROPTION:
1321 if (ignore_system_lyxrc ||
1322 view_dvi_paper_option
1323 != system_lyxrc.view_dvi_paper_option) {
1324 os << "# Options used to specify paper size to the\n"
1325 << "# view_dvi_command (e.g. -paper)\n"
1326 << "\\view_dvi_paper_option \""
1327 << view_dvi_paper_option << "\"\n";
1329 case RC_DEFAULT_PAPERSIZE:
1330 if (ignore_system_lyxrc ||
1331 default_papersize != system_lyxrc.default_papersize) {
1332 os << "# The default papersize to use.\n"
1333 << "\\default_papersize \"";
1334 switch (default_papersize) {
1336 os << "default"; break;
1337 case PAPER_USLETTER:
1338 os << "usletter"; break;
1340 os << "legal"; break;
1341 case PAPER_USEXECUTIVE:
1342 os << "executive"; break;
1353 case PAPER_B4: break;
1357 case RC_CHKTEX_COMMAND:
1358 if (ignore_system_lyxrc ||
1359 chktex_command != system_lyxrc.chktex_command) {
1360 os << "\\chktex_command \"" << chktex_command << "\"\n";
1362 case RC_BIBTEX_COMMAND:
1363 if (ignore_system_lyxrc ||
1364 bibtex_command != system_lyxrc.bibtex_command) {
1365 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1367 case RC_INDEX_COMMAND:
1368 if (ignore_system_lyxrc ||
1369 index_command != system_lyxrc.index_command) {
1370 os << "\\index_command \"" << index_command << "\"\n";
1372 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1373 if (ignore_system_lyxrc ||
1374 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1375 os << "\\tex_expects_windows_paths "
1376 << convert<string>(windows_style_tex_paths) << '\n';
1378 case RC_TEX_ALLOWS_SPACES:
1379 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1380 os << "\\tex_allows_spaces "
1381 << convert<string>(tex_allows_spaces) << '\n';
1384 if (ignore_system_lyxrc ||
1385 use_kbmap != system_lyxrc.use_kbmap) {
1386 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1388 case RC_KBMAP_PRIMARY:
1389 if (ignore_system_lyxrc ||
1390 primary_kbmap != system_lyxrc.primary_kbmap) {
1391 string const path = os::external_path(primary_kbmap);
1392 os << "\\kbmap_primary \"" << path << "\"\n";
1394 case RC_KBMAP_SECONDARY:
1395 if (ignore_system_lyxrc ||
1396 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1397 string const path = os::external_path(secondary_kbmap);
1398 os << "\\kbmap_secondary \"" << path << "\"\n";
1401 if (ignore_system_lyxrc ||
1402 lyxpipes != system_lyxrc.lyxpipes) {
1403 string const path = os::external_path(lyxpipes);
1404 os << "\\serverpipe \"" << path << "\"\n";
1406 case RC_DATE_INSERT_FORMAT:
1407 if (ignore_system_lyxrc ||
1408 date_insert_format != system_lyxrc.date_insert_format) {
1409 os << "\\date_insert_format \"" << date_insert_format
1412 case RC_LABEL_INIT_LENGTH:
1413 if (ignore_system_lyxrc ||
1414 label_init_length != system_lyxrc.label_init_length) {
1415 os << "\\label_init_length " << label_init_length
1420 os << "\\user_name \"" << user_name << "\"\n";
1423 os << "\\user_email \"" << user_email << "\"\n";
1425 case RC_SHOW_BANNER:
1426 if (ignore_system_lyxrc ||
1427 show_banner != system_lyxrc.show_banner) {
1428 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1432 if (ignore_system_lyxrc ||
1433 preview != system_lyxrc.preview) {
1439 case PREVIEW_NO_MATH:
1446 os << "\\preview " << status << '\n';
1449 case RC_PREVIEW_HASHED_LABELS:
1450 if (ignore_system_lyxrc ||
1451 preview_hashed_labels !=
1452 system_lyxrc.preview_hashed_labels) {
1453 os << "\\preview_hashed_labels "
1454 << convert<string>(preview_hashed_labels) << '\n';
1457 case RC_PREVIEW_SCALE_FACTOR:
1458 if (ignore_system_lyxrc ||
1459 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1460 os << "\\preview_scale_factor "
1461 << preview_scale_factor << '\n';
1465 << "# SCREEN & FONTS SECTION ############################\n"
1468 case RC_POPUP_NORMAL_FONT:
1469 if (ignore_system_lyxrc ||
1470 popup_normal_font != system_lyxrc.popup_normal_font) {
1471 os << "\\popup_normal_font \"" << popup_normal_font
1474 case RC_POPUP_BOLD_FONT:
1475 if (ignore_system_lyxrc ||
1476 popup_bold_font != system_lyxrc.popup_bold_font) {
1477 os << "\\popup_bold_font \"" << popup_bold_font
1480 case RC_POPUP_FONT_ENCODING:
1481 if (ignore_system_lyxrc ||
1482 popup_font_encoding != system_lyxrc.popup_font_encoding) {
1483 os << "\\popup_font_encoding \"" << popup_font_encoding
1487 if (ignore_system_lyxrc ||
1488 dpi != system_lyxrc.dpi) {
1489 os << "\\screen_dpi " << dpi << '\n';
1491 case RC_SCREEN_ZOOM:
1492 if (ignore_system_lyxrc ||
1493 zoom != system_lyxrc.zoom) {
1494 os << "\\screen_zoom " << zoom << '\n';
1496 case RC_SCREEN_GEOMETRY_HEIGHT:
1497 if (ignore_system_lyxrc ||
1498 geometry_height != system_lyxrc.geometry_height) {
1499 os << "\\screen_geometry_height " << geometry_height
1502 case RC_SCREEN_GEOMETRY_WIDTH:
1503 if (ignore_system_lyxrc ||
1504 geometry_width != system_lyxrc.geometry_width) {
1505 os << "\\screen_geometry_width " << geometry_width
1508 case RC_SCREEN_GEOMETRY_XYSAVED:
1509 if (ignore_system_lyxrc ||
1510 geometry_xysaved != system_lyxrc.geometry_xysaved) {
1511 os << "\\screen_geometry_xysaved " << convert<string>(geometry_xysaved)
1514 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1515 if (ignore_system_lyxrc ||
1516 cursor_follows_scrollbar
1517 != system_lyxrc.cursor_follows_scrollbar) {
1518 os << "\\cursor_follows_scrollbar "
1519 << convert<string>(cursor_follows_scrollbar) << '\n';
1521 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1522 if (ignore_system_lyxrc ||
1523 dialogs_iconify_with_main
1524 != system_lyxrc.dialogs_iconify_with_main) {
1525 os << "\\dialogs_iconify_with_main "
1526 << convert<string>(dialogs_iconify_with_main) << '\n';
1528 case RC_SCREEN_FONT_ROMAN:
1529 if (ignore_system_lyxrc ||
1530 roman_font_name != system_lyxrc.roman_font_name) {
1531 os << "\\screen_font_roman \"" << roman_font_name
1534 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1535 if (ignore_system_lyxrc ||
1536 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1537 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1540 case RC_SCREEN_FONT_SANS:
1541 if (ignore_system_lyxrc ||
1542 sans_font_name != system_lyxrc.sans_font_name) {
1543 os << "\\screen_font_sans \"" << sans_font_name
1546 case RC_SCREEN_FONT_SANS_FOUNDRY:
1547 if (ignore_system_lyxrc ||
1548 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1549 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1552 case RC_SCREEN_FONT_TYPEWRITER:
1553 if (ignore_system_lyxrc ||
1554 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1555 os << "\\screen_font_typewriter \""
1556 << typewriter_font_name << "\"\n";
1558 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1559 if (ignore_system_lyxrc ||
1560 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1561 os << "\\screen_font_typewriter_foundry \""
1562 << typewriter_font_foundry << "\"\n";
1565 case RC_SCREEN_FONT_SCALABLE:
1566 if (ignore_system_lyxrc ||
1567 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1568 os << "\\screen_font_scalable "
1569 << convert<string>(use_scalable_fonts)
1572 case RC_SCREEN_FONT_ENCODING:
1573 if (ignore_system_lyxrc ||
1574 font_norm != system_lyxrc.font_norm) {
1575 os << "\\screen_font_encoding \"" << font_norm
1578 case RC_SCREEN_FONT_SIZES:
1579 if (ignore_system_lyxrc ||
1580 font_sizes[LyXFont::SIZE_TINY]
1581 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1582 font_sizes[LyXFont::SIZE_SCRIPT]
1583 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1584 font_sizes[LyXFont::SIZE_FOOTNOTE]
1585 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1586 font_sizes[LyXFont::SIZE_SMALL]
1587 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1588 font_sizes[LyXFont::SIZE_NORMAL]
1589 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1590 font_sizes[LyXFont::SIZE_LARGE]
1591 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1592 font_sizes[LyXFont::SIZE_LARGER]
1593 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1594 font_sizes[LyXFont::SIZE_LARGEST]
1595 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1596 font_sizes[LyXFont::SIZE_HUGE]
1597 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1598 font_sizes[LyXFont::SIZE_HUGER]
1599 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1600 os.setf(ios::fixed);
1602 os << "\\screen_font_sizes"
1603 << ' ' << font_sizes[LyXFont::SIZE_TINY]
1604 << ' ' << font_sizes[LyXFont::SIZE_SCRIPT]
1605 << ' ' << font_sizes[LyXFont::SIZE_FOOTNOTE]
1606 << ' ' << font_sizes[LyXFont::SIZE_SMALL]
1607 << ' ' << font_sizes[LyXFont::SIZE_NORMAL]
1608 << ' ' << font_sizes[LyXFont::SIZE_LARGE]
1609 << ' ' << font_sizes[LyXFont::SIZE_LARGER]
1610 << ' ' << font_sizes[LyXFont::SIZE_LARGEST]
1611 << ' ' << font_sizes[LyXFont::SIZE_HUGE]
1612 << ' ' << font_sizes[LyXFont::SIZE_HUGER]
1617 << "# COLOR SECTION ###################################\n"
1621 for (int i = 0; i < LColor::ignore; ++i) {
1622 LColor::color lc = static_cast<LColor::color>(i);
1624 string const col(lcolor.getX11Name(lc));
1625 if (ignore_system_lyxrc ||
1626 col != system_lcolor.getX11Name(lc)) {
1627 os << "\\set_color \""
1628 << lcolor.getLyXName(lc) << "\" \""
1634 << "# PRINTER SECTION ###################################\n"
1638 if (ignore_system_lyxrc ||
1639 printer != system_lyxrc.printer) {
1640 os << "\\printer \"" << printer << "\"\n";
1642 case RC_PRINT_ADAPTOUTPUT:
1643 if (ignore_system_lyxrc ||
1644 print_adapt_output != system_lyxrc.print_adapt_output) {
1645 os << "\\print_adapt_output "
1646 << convert<string>(print_adapt_output)
1649 case RC_PRINT_COMMAND:
1650 if (ignore_system_lyxrc ||
1651 print_command != system_lyxrc.print_command) {
1652 os << "\\print_command \"" << print_command << "\"\n";
1654 case RC_PRINTEXSTRAOPTIONS:
1655 if (ignore_system_lyxrc ||
1656 print_extra_options != system_lyxrc.print_extra_options) {
1657 os << "\\print_extra_options \"" << print_extra_options
1660 case RC_PRINTSPOOL_COMMAND:
1661 if (ignore_system_lyxrc ||
1662 print_spool_command != system_lyxrc.print_spool_command) {
1663 os << "\\print_spool_command \"" << print_spool_command
1666 case RC_PRINTSPOOL_PRINTERPREFIX:
1667 if (ignore_system_lyxrc ||
1668 print_spool_printerprefix
1669 != system_lyxrc.print_spool_printerprefix) {
1670 os << "\\print_spool_printerprefix \""
1671 << print_spool_printerprefix << "\"\n";
1673 case RC_PRINTEVENPAGEFLAG:
1674 if (ignore_system_lyxrc ||
1675 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1676 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1679 case RC_PRINTODDPAGEFLAG:
1680 if (ignore_system_lyxrc ||
1681 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1682 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1685 case RC_PRINTREVERSEFLAG:
1686 if (ignore_system_lyxrc ||
1687 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1688 os << "\\print_reverse_flag \"" << print_reverse_flag
1691 case RC_PRINTLANDSCAPEFLAG:
1692 if (ignore_system_lyxrc ||
1693 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1694 os << "\\print_landscape_flag \"" << print_landscape_flag
1697 case RC_PRINTPAGERANGEFLAG:
1698 if (ignore_system_lyxrc ||
1699 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1700 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1703 case RC_PRINTCOPIESFLAG:
1704 if (ignore_system_lyxrc ||
1705 print_copies_flag != system_lyxrc.print_copies_flag) {
1706 os << "\\print_copies_flag \"" << print_copies_flag
1709 case RC_PRINTCOLLCOPIESFLAG:
1710 if (ignore_system_lyxrc ||
1711 print_collcopies_flag
1712 != system_lyxrc.print_collcopies_flag) {
1713 os << "\\print_collcopies_flag \""
1714 << print_collcopies_flag
1717 case RC_PRINTPAPERFLAG:
1718 if (ignore_system_lyxrc ||
1719 print_paper_flag != system_lyxrc.print_paper_flag) {
1720 os << "\\print_paper_flag \"" << print_paper_flag
1723 case RC_PRINTPAPERDIMENSIONFLAG:
1724 if (ignore_system_lyxrc ||
1725 print_paper_dimension_flag
1726 != system_lyxrc.print_paper_dimension_flag) {
1727 os << "\\print_paper_dimension_flag \""
1728 << print_paper_dimension_flag << "\"\n";
1730 case RC_PRINTTOPRINTER:
1731 if (ignore_system_lyxrc ||
1732 print_to_printer != system_lyxrc.print_to_printer) {
1733 os << "\\print_to_printer \"" << print_to_printer
1736 case RC_PRINTTOFILE:
1737 if (ignore_system_lyxrc ||
1738 print_to_file != system_lyxrc.print_to_file) {
1739 string const path = os::external_path(print_to_file);
1740 os << "\\print_to_file \"" << path << "\"\n";
1742 case RC_PRINTFILEEXTENSION:
1743 if (ignore_system_lyxrc ||
1744 print_file_extension != system_lyxrc.print_file_extension) {
1745 os << "\\print_file_extension \""
1746 << print_file_extension
1751 << "# EXPORT SECTION ####################################\n"
1754 case RC_CUSTOM_EXPORT_COMMAND:
1755 if (ignore_system_lyxrc ||
1756 custom_export_command
1757 != system_lyxrc.custom_export_command) {
1758 os << "\\custom_export_command \""
1759 << custom_export_command
1762 case RC_CUSTOM_EXPORT_FORMAT:
1763 if (ignore_system_lyxrc ||
1764 custom_export_format
1765 != system_lyxrc.custom_export_format) {
1766 os << "\\custom_export_format \"" << custom_export_format
1771 << "# TEX SECTION #######################################\n"
1774 case RC_FONT_ENCODING:
1775 if (ignore_system_lyxrc ||
1776 fontenc != system_lyxrc.fontenc) {
1777 os << "\\font_encoding \"" << fontenc << "\"\n";
1781 << "# FILE SECTION ######################################\n"
1784 case RC_DOCUMENTPATH:
1785 if (ignore_system_lyxrc ||
1786 document_path != system_lyxrc.document_path) {
1787 string const path = os::external_path(document_path);
1788 os << "\\document_path \"" << path << "\"\n";
1790 case RC_USELASTFILEPOS:
1791 if (ignore_system_lyxrc ||
1792 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1793 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1796 case RC_LOADSESSION:
1797 if (ignore_system_lyxrc ||
1798 load_session != system_lyxrc.load_session) {
1799 os << "\\load_session " << convert<string>(load_session)
1802 case RC_NUMLASTFILES:
1803 if (ignore_system_lyxrc ||
1804 num_lastfiles != system_lyxrc.num_lastfiles) {
1805 os << "\\num_lastfiles " << num_lastfiles << '\n';
1807 case RC_CHECKLASTFILES:
1808 if (ignore_system_lyxrc ||
1809 check_lastfiles != system_lyxrc.check_lastfiles) {
1810 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
1813 case RC_TEMPLATEPATH:
1814 if (ignore_system_lyxrc ||
1815 template_path != system_lyxrc.template_path) {
1816 string const path = os::external_path(template_path);
1817 os << "\\template_path \"" << path << "\"\n";
1819 case RC_TEMPDIRPATH:
1820 if (ignore_system_lyxrc ||
1821 tempdir_path != system_lyxrc.tempdir_path) {
1822 string const path = os::external_path(tempdir_path);
1823 os << "\\tempdir_path \"" << path << "\"\n";
1827 case RC_ASCII_LINELEN:
1828 if (ignore_system_lyxrc ||
1829 ascii_linelen != system_lyxrc.ascii_linelen) {
1830 os << "\\ascii_linelen " << ascii_linelen << '\n';
1832 case RC_MAKE_BACKUP:
1833 if (ignore_system_lyxrc ||
1834 make_backup != system_lyxrc.make_backup) {
1835 os << "\\make_backup " << convert<string>(make_backup) << '\n';
1837 case RC_BACKUPDIR_PATH:
1838 if (ignore_system_lyxrc ||
1839 backupdir_path != system_lyxrc.backupdir_path) {
1840 string const path = os::external_path(backupdir_path);
1841 os << "\\backupdir_path \"" << path << "\"\n";
1845 << "# ASCII EXPORT SECTION ##############################\n"
1848 case RC_ASCIIROFF_COMMAND:
1849 if (ignore_system_lyxrc ||
1850 ascii_roff_command != system_lyxrc.ascii_roff_command) {
1851 os << "\\ascii_roff_command \"" << ascii_roff_command
1856 << "# SPELLCHECKER SECTION ##############################\n"
1858 case RC_USE_SPELL_LIB:
1859 if (ignore_system_lyxrc ||
1860 use_spell_lib != system_lyxrc.use_spell_lib) {
1861 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
1863 case RC_SPELL_COMMAND:
1864 if (ignore_system_lyxrc ||
1865 isp_command != system_lyxrc.isp_command) {
1866 os << "\\spell_command \"" << isp_command << "\"\n";
1868 case RC_ACCEPT_COMPOUND:
1869 if (ignore_system_lyxrc ||
1870 isp_accept_compound != system_lyxrc.isp_accept_compound) {
1871 os << "\\accept_compound " << convert<string>(isp_accept_compound)
1874 case RC_USE_ALT_LANG:
1875 if (ignore_system_lyxrc ||
1876 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1877 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
1881 if (ignore_system_lyxrc ||
1882 isp_alt_lang != system_lyxrc.isp_alt_lang) {
1883 os << "\\alternate_language \"" << isp_alt_lang
1886 case RC_USE_ESC_CHARS:
1887 if (ignore_system_lyxrc ||
1888 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1889 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
1893 if (ignore_system_lyxrc ||
1894 isp_esc_chars != system_lyxrc.isp_esc_chars) {
1895 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1897 case RC_USE_PERS_DICT:
1898 if (ignore_system_lyxrc ||
1899 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1900 os << "\\use_personal_dictionary "
1901 << convert<string>(isp_use_pers_dict)
1905 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1906 string const path = os::external_path(isp_pers_dict);
1907 os << "\\personal_dictionary \"" << path << "\"\n";
1909 case RC_USE_INP_ENC:
1910 if (ignore_system_lyxrc ||
1911 isp_use_input_encoding
1912 != system_lyxrc.isp_use_input_encoding) {
1913 os << "\\use_input_encoding "
1914 << convert<string>(isp_use_input_encoding)
1919 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1922 case RC_RTL_SUPPORT:
1923 if (ignore_system_lyxrc ||
1924 rtl_support != system_lyxrc.rtl_support) {
1925 os << "\\rtl " << convert<string>(rtl_support) << '\n';
1927 case RC_LANGUAGE_PACKAGE:
1928 if (ignore_system_lyxrc ||
1929 language_package != system_lyxrc.language_package) {
1930 os << "\\language_package \"" << language_package
1933 case RC_LANGUAGE_GLOBAL_OPTIONS:
1934 if (ignore_system_lyxrc ||
1935 language_global_options
1936 != system_lyxrc.language_global_options) {
1937 os << "\\language_global_options \""
1938 << convert<string>(language_global_options)
1941 case RC_LANGUAGE_USE_BABEL:
1942 if (ignore_system_lyxrc ||
1943 language_use_babel != system_lyxrc.language_use_babel) {
1944 os << "\\language_use_babel \""
1945 << convert<string>(language_use_babel)
1948 case RC_LANGUAGE_COMMAND_BEGIN:
1949 if (ignore_system_lyxrc ||
1950 language_command_begin
1951 != system_lyxrc.language_command_begin) {
1952 os << "\\language_command_begin \""
1953 << language_command_begin
1956 case RC_LANGUAGE_COMMAND_END:
1957 if (ignore_system_lyxrc ||
1958 language_command_end
1959 != system_lyxrc.language_command_end) {
1960 os << "\\language_command_end \"" << language_command_end
1963 case RC_LANGUAGE_COMMAND_LOCAL:
1964 if (ignore_system_lyxrc ||
1965 language_command_local
1966 != system_lyxrc.language_command_local) {
1967 os << "\\language_command_local \""
1968 << language_command_local
1971 case RC_LANGUAGE_AUTO_BEGIN:
1972 if (ignore_system_lyxrc ||
1973 language_auto_begin != system_lyxrc.language_auto_begin) {
1974 os << "\\language_auto_begin "
1975 << convert<string>(language_auto_begin) << '\n';
1977 case RC_LANGUAGE_AUTO_END:
1978 if (ignore_system_lyxrc ||
1979 language_auto_end != system_lyxrc.language_auto_end) {
1980 os << "\\language_auto_end "
1981 << convert<string>(language_auto_end) << '\n';
1983 case RC_MARK_FOREIGN_LANGUAGE:
1984 if (ignore_system_lyxrc ||
1985 mark_foreign_language
1986 != system_lyxrc.mark_foreign_language) {
1987 os << "\\mark_foreign_language " <<
1988 convert<string>(mark_foreign_language) << '\n';
1992 << "# 2nd MISC SUPPORT SECTION ##########################\n"
1995 case RC_AUTO_NUMBER:
1996 if (ignore_system_lyxrc ||
1997 auto_number != system_lyxrc.auto_number) {
1998 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2000 case RC_DEFAULT_LANGUAGE:
2001 if (ignore_system_lyxrc ||
2002 default_language != system_lyxrc.default_language) {
2003 os << "\\default_language " << default_language << '\n';
2007 << "# FORMATS SECTION ##########################\n"
2011 // New/modified formats
2012 for (Formats::const_iterator cit = formats.begin();
2013 cit != formats.end(); ++cit) {
2014 Format const * format =
2015 system_formats.getFormat(cit->name());
2017 format->extension() != cit->extension() ||
2018 format->prettyname() != cit->prettyname() ||
2019 format->shortcut() != cit->shortcut() ||
2020 format->viewer() != cit->viewer() ||
2021 format->editor() != cit->editor() ||
2022 format->documentFormat() != cit->documentFormat() ||
2023 format->vectorFormat() != cit->vectorFormat()) {
2024 os << "\\format \"" << cit->name() << "\" \""
2025 << cit->extension() << "\" \""
2026 << cit->prettyname() << "\" \""
2027 << cit->shortcut() << "\" \""
2028 << cit->viewer() << "\" \""
2029 << cit->editor() << "\" \"";
2030 std::vector<string> flags;
2031 if (cit->documentFormat())
2032 flags.push_back("document");
2033 if (cit->vectorFormat())
2034 flags.push_back("vector");
2035 os << lyx::support::getStringFromVector(flags);
2040 // Look for deleted formats
2041 for (Formats::const_iterator cit = system_formats.begin();
2042 cit != system_formats.end(); ++cit)
2043 if (!formats.getFormat(cit->name()))
2044 os << "\\format \"" << cit->name()
2045 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2050 << "# CONVERTERS SECTION ##########################\n"
2054 // Look for new converters
2055 for (Converters::const_iterator cit = converters.begin();
2056 cit != converters.end(); ++cit) {
2057 Converter const * converter =
2058 system_converters.getConverter(cit->from,
2061 converter->command != cit->command ||
2062 converter->flags != cit->flags)
2063 os << "\\converter \"" << cit->from << "\" \""
2064 << cit->to << "\" \""
2065 << cit->command << "\" \""
2066 << cit->flags << "\"\n";
2069 // New/modifed converters
2070 for (Converters::const_iterator cit = system_converters.begin();
2071 cit != system_converters.end(); ++cit)
2072 if (!converters.getConverter(cit->from, cit->to))
2073 os << "\\converter \"" << cit->from
2074 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2078 << "# COPIERS SECTION ##########################\n"
2081 // Look for new movers
2082 Movers::iterator const sysbegin = system_movers.begin();
2083 Movers::iterator const sysend = system_movers.end();
2085 for (Movers::iterator it = movers.begin(), end = movers.end();
2087 Movers::iterator const sysit =
2088 std::find_if(sysbegin, sysend, SameMover(*it));
2089 if (sysit == sysend) {
2090 std::string const & fmt = it->first;
2091 std::string const & command =
2092 it->second.command();
2094 os << "\\copier " << fmt
2095 << " \"" << command << "\"\n";
2099 // We don't actually delete SpecialisedMover(s) from the
2100 // map, just clear their 'command', so there's no need
2101 // to test for anything else.
2107 void LyXRC::set_font_norm_type()
2109 if (font_norm == "iso10646-1")
2110 font_norm_type = ISO_10646_1;
2111 else if (font_norm == "iso8859-1")
2112 font_norm_type = ISO_8859_1;
2113 else if (font_norm == "iso8859-3")
2114 font_norm_type = ISO_8859_3;
2115 else if (font_norm == "iso8859-4")
2116 font_norm_type = ISO_8859_4;
2117 else if (font_norm == "iso8859-6.8x")
2118 font_norm_type = ISO_8859_6_8;
2119 else if (font_norm == "iso8859-9")
2120 font_norm_type = ISO_8859_9;
2121 else if (font_norm == "iso8859-15")
2122 font_norm_type = ISO_8859_15;
2124 font_norm_type = OTHER_ENCODING;
2128 string const LyXRC::getDescription(LyXRCTags tag)
2133 case RC_ACCEPT_COMPOUND:
2134 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2138 case RC_USE_ALT_LANG:
2139 str = _("Specify an alternate language. The default is to use the language of the document.");
2142 case RC_ASCIIROFF_COMMAND:
2143 str = _("Use to define an external program to render tables in plain text output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"\" is specified, an internal routine is used.");
2146 case RC_ASCII_LINELEN:
2147 str = _("This is the maximum line length of an exported text file (LaTeX, SGML or plain text).");
2150 case RC_AUTOREGIONDELETE:
2151 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2154 case RC_AUTORESET_OPTIONS:
2155 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2159 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2162 case RC_AUTO_NUMBER:
2165 case RC_BACKUPDIR_PATH:
2166 str = _("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.");
2169 case RC_BIBTEX_COMMAND:
2170 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2174 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2177 case RC_CHECKLASTFILES:
2178 str = _("Select to check whether the lastfiles still exist.");
2181 case RC_CHKTEX_COMMAND:
2182 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2191 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2192 str = _("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.");
2195 case RC_CUSTOM_EXPORT_COMMAND:
2198 case RC_CUSTOM_EXPORT_FORMAT:
2201 case RC_DATE_INSERT_FORMAT:
2202 //xgettext:no-c-format
2203 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2206 case RC_DEFAULT_LANGUAGE:
2207 str = _("New documents will be assigned this language.");
2210 case RC_DEFAULT_PAPERSIZE:
2211 str = _("Specify the default paper size.");
2214 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2215 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2218 case RC_DISPLAY_GRAPHICS:
2219 str = _("Select how LyX will display any graphics.");
2222 case RC_DOCUMENTPATH:
2223 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2227 case RC_USE_ESC_CHARS:
2228 str = _("Specify additional chars that can be part of a word.");
2231 case RC_FONT_ENCODING:
2232 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2238 case RC_INDEX_COMMAND:
2239 str = _("Define the options of makeindex (cf. man makeindex) or select an alternative compiler. E.g., using xindy/make-rules, the command string would be \"makeindex.sh -m $$lang\".");
2246 case RC_KBMAP_PRIMARY:
2247 case RC_KBMAP_SECONDARY:
2248 str = _("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.");
2251 case RC_LABEL_INIT_LENGTH:
2252 str = _("Maximum number of words in the initialization string for a new label");
2255 case RC_LANGUAGE_AUTO_BEGIN:
2256 str = _("Select if a language switching command is needed at the beginning of the document.");
2259 case RC_LANGUAGE_AUTO_END:
2260 str = _("Select if a language switching command is needed at the end of the document.");
2263 case RC_LANGUAGE_COMMAND_BEGIN:
2264 str = _("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.");
2267 case RC_LANGUAGE_COMMAND_END:
2268 str = _("The LaTeX command for changing back to the language of the document.");
2271 case RC_LANGUAGE_COMMAND_LOCAL:
2272 str = _("The LaTeX command for local changing of the language.");
2275 case RC_LANGUAGE_GLOBAL_OPTIONS:
2276 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2279 case RC_LANGUAGE_PACKAGE:
2280 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2283 case RC_LANGUAGE_USE_BABEL:
2284 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2287 case RC_USELASTFILEPOS:
2288 str = _("De-select if you do not want LyX to scroll to saved position.");
2291 case RC_LOADSESSION:
2292 str = _("De-select to prevent loading files opened from the last lyx session.");
2295 case RC_MAKE_BACKUP:
2296 str = _("De-select if you don't want LyX to create backup files.");
2299 case RC_MARK_FOREIGN_LANGUAGE:
2300 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2303 case RC_NUMLASTFILES:
2304 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2308 case RC_PATH_PREFIX:
2309 str = _("Specify those directories which should be "
2310 "prepended to the PATH environment variable. "
2311 "Use the OS native format.");
2315 case RC_USE_PERS_DICT:
2316 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2319 case RC_POPUP_BOLD_FONT:
2320 str = _("The bold font in the dialogs.");
2323 case RC_POPUP_FONT_ENCODING:
2324 str = _("The encoding for the menu/popups fonts.");
2327 case RC_POPUP_NORMAL_FONT:
2328 str = _("The normal font in the dialogs.");
2332 str = _("Shows a typeset preview of things such as math");
2335 case RC_PREVIEW_HASHED_LABELS:
2336 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2339 case RC_PREVIEW_SCALE_FACTOR:
2340 str = _("Scale the preview size to suit.");
2343 case RC_PRINTCOLLCOPIESFLAG:
2344 str = _("The option for specifying whether the copies should be collated.");
2347 case RC_PRINTCOPIESFLAG:
2348 str = _("The option for specifying the number of copies to print.");
2352 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2355 case RC_PRINTEVENPAGEFLAG:
2356 str = _("The option to print only even pages.");
2359 case RC_PRINTEXSTRAOPTIONS:
2360 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2363 case RC_PRINTFILEEXTENSION:
2364 str = _("Extension of printer program output file. Usually \".ps\".");
2367 case RC_PRINTLANDSCAPEFLAG:
2368 str = _("The option to print out in landscape.");
2371 case RC_PRINTODDPAGEFLAG:
2372 str = _("The option to print only odd pages.");
2375 case RC_PRINTPAGERANGEFLAG:
2376 str = _("The option for specifying a comma-separated list of pages to print.");
2379 case RC_PRINTPAPERDIMENSIONFLAG:
2380 str = _("Option to specify the dimensions of the print paper.");
2383 case RC_PRINTPAPERFLAG:
2384 str = _("The option to specify paper type.");
2387 case RC_PRINTREVERSEFLAG:
2388 str = _("The option to reverse the order of the pages printed.");
2391 case RC_PRINTSPOOL_COMMAND:
2392 str = _("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.");
2395 case RC_PRINTSPOOL_PRINTERPREFIX:
2396 str = _("If you specify a printer name in the print dialog, the following argument is prepended along with the printer name after the spool command.");
2399 case RC_PRINTTOFILE:
2400 str = _("Option to pass to the print program to print to a file.");
2403 case RC_PRINTTOPRINTER:
2404 str = _("Option to pass to the print program to print on a specific printer.");
2407 case RC_PRINT_ADAPTOUTPUT:
2408 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2411 case RC_PRINT_COMMAND:
2412 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2415 case RC_RTL_SUPPORT:
2416 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2420 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2423 case RC_SCREEN_FONT_ENCODING:
2424 str = _("The encoding for the screen fonts.");
2427 case RC_SCREEN_FONT_ROMAN:
2428 case RC_SCREEN_FONT_SANS:
2429 case RC_SCREEN_FONT_TYPEWRITER:
2430 str = _("The screen fonts used to display the text while editing.");
2433 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2434 case RC_SCREEN_FONT_SANS_FOUNDRY:
2435 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2438 case RC_SCREEN_FONT_SCALABLE:
2439 str = _("Allow bitmap fonts to be resized. If you are using a bitmap font, selecting this option may make some fonts look blocky in LyX. Deselecting this option makes LyX use the nearest bitmap font size available, instead of scaling.");
2442 case RC_SCREEN_FONT_SIZES:
2443 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2446 case RC_SCREEN_ZOOM:
2447 //xgettext:no-c-format
2448 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2451 case RC_SCREEN_GEOMETRY_HEIGHT:
2452 case RC_SCREEN_GEOMETRY_WIDTH:
2453 str = _("Specify geometry of the main view in width x height (values from last session will not be used if non-zero values are specified).");
2456 case RC_SCREEN_GEOMETRY_XYSAVED:
2457 str = _("Allow session manager to save and restore windows position.");
2461 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2467 case RC_SHOW_BANNER:
2468 str = _("De-select if you don't want the startup banner.");
2471 case RC_SPELL_COMMAND:
2472 str = _("What command runs the spellchecker?");
2475 case RC_TEMPDIRPATH:
2476 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2479 case RC_TEMPLATEPATH:
2480 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2483 case RC_TEX_ALLOWS_SPACES:
2486 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2490 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2502 case RC_USE_INP_ENC:
2503 str = _("Specify whether to pass the -T input encoding option to ispell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
2506 case RC_USE_SPELL_LIB:
2509 case RC_VIEWDVI_PAPEROPTION:
2510 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2520 return lyx::to_utf8(str);
2523 // The global instance
2526 // The global copy of the system lyxrc entries (everything except preferences)