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"
46 namespace os = support::os;
48 using support::ascii_lowercase;
49 using support::bformat;
50 using support::expandPath;
51 using support::getEnv;
52 using support::libFileSearch;
66 // when adding something to this array keep it sorted!
67 keyword_item lyxrcTags[] = {
68 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
69 { "\\alternate_language", LyXRC::RC_ALT_LANG },
70 { "\\ascii_linelen", LyXRC::RC_ASCII_LINELEN },
71 { "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
72 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
73 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
74 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
75 { "\\autosave", LyXRC::RC_AUTOSAVE },
76 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
77 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
78 { "\\bind_file", LyXRC::RC_BINDFILE },
79 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
80 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
81 { "\\converter", LyXRC::RC_CONVERTER },
82 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
83 { "\\copier", LyXRC::RC_COPIER },
84 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
85 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
86 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
87 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
88 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
89 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
90 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
91 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
92 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
93 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
94 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
95 { "\\format", LyXRC::RC_FORMAT },
96 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
97 { "\\input", LyXRC::RC_INPUT },
98 { "\\kbmap", LyXRC::RC_KBMAP },
99 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
100 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
101 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
102 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
103 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
104 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
105 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
106 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
107 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
108 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
109 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
110 { "\\load_session", LyXRC::RC_LOADSESSION },
111 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
112 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
113 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
114 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
115 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
116 { "\\popup_bold_font", LyXRC::RC_POPUP_BOLD_FONT },
117 { "\\popup_font_encoding", LyXRC::RC_POPUP_FONT_ENCODING },
118 { "\\popup_normal_font", LyXRC::RC_POPUP_NORMAL_FONT },
119 { "\\preview", LyXRC::RC_PREVIEW },
120 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
121 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
122 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
123 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
124 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
125 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
126 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
127 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
128 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
129 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
130 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
131 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
132 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
133 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
134 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
135 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
136 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
137 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
138 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
139 { "\\printer", LyXRC::RC_PRINTER },
140 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
141 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
142 { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
143 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
144 { "\\screen_font_encoding_menu", LyXRC::RC_POPUP_FONT_ENCODING },
145 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
146 { "\\screen_font_menu", LyXRC::RC_POPUP_BOLD_FONT },
147 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
148 { "\\screen_font_popup", LyXRC::RC_POPUP_NORMAL_FONT },
149 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
150 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
151 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
152 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
153 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
154 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
155 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
156 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
157 { "\\screen_geometry_height", LyXRC::RC_SCREEN_GEOMETRY_HEIGHT },
158 { "\\screen_geometry_width", LyXRC::RC_SCREEN_GEOMETRY_WIDTH },
159 { "\\screen_geometry_xysaved", LyXRC::RC_SCREEN_GEOMETRY_XYSAVED },
160 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
161 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
162 { "\\set_color", LyXRC::RC_SET_COLOR },
163 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
164 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
165 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
166 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
167 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
168 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
169 { "\\ui_file", LyXRC::RC_UIFILE },
170 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
171 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
172 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
173 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
174 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
175 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
176 // compatibility with versions older than 1.4.0 only
177 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
178 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
179 // compatibility with versions older than 1.4.0 only
180 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
181 { "\\user_email", LyXRC::RC_USER_EMAIL },
182 { "\\user_name", LyXRC::RC_USER_NAME },
183 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
184 // compatibility with versions older than 1.4.0 only
185 { "\\viewer" ,LyXRC::RC_VIEWER}
188 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
199 void LyXRC::setDefaults() {
202 // Get printer from the environment. If fail, use default "",
203 // assuming that everything is set up correctly.
204 printer = getEnv("PRINTER");
205 print_adapt_output = false;
206 print_command = "dvips";
207 print_evenpage_flag = "-B";
208 print_oddpage_flag = "-A";
209 print_pagerange_flag = "-pp";
210 print_copies_flag = "-c";
211 print_collcopies_flag = "-C";
212 print_reverse_flag = "-r";
213 print_landscape_flag = "-t landscape";
214 print_to_printer = "-P";
215 print_to_file = "-o ";
216 print_file_extension = ".ps";
217 print_paper_flag = "-t";
218 print_paper_dimension_flag = "-T";
219 document_path.erase();
220 view_dvi_paper_option.erase();
221 default_papersize = PAPER_DEFAULT;
222 custom_export_format = "ps";
223 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
224 bibtex_command = "bibtex";
226 index_command = "makeindex -c -q";
228 // Because a screen typically is wider than a piece of paper:
232 geometry_xysaved = true;
233 // Default LaTeX font size:
234 font_sizes[LyXFont::SIZE_TINY] = "5.0";
235 font_sizes[LyXFont::SIZE_SCRIPT] = "7.0";
236 font_sizes[LyXFont::SIZE_FOOTNOTE] = "8.0";
237 font_sizes[LyXFont::SIZE_SMALL] = "9.0";
238 font_sizes[LyXFont::SIZE_NORMAL] = "10.0";
239 font_sizes[LyXFont::SIZE_LARGE] = "12.0";
240 font_sizes[LyXFont::SIZE_LARGER] = "14.4";
241 font_sizes[LyXFont::SIZE_LARGEST] = "17.26";
242 font_sizes[LyXFont::SIZE_HUGE] = "20.74";
243 font_sizes[LyXFont::SIZE_HUGER] = "24.88";
244 use_scalable_fonts = true;
245 roman_font_name = "";
247 typewriter_font_name = "";
248 popup_bold_font = "-*-helvetica-bold-r";
249 popup_normal_font = "-*-helvetica-medium-r";
250 font_norm = "iso8859-1";
251 font_norm_type = ISO_8859_1;
252 popup_font_encoding.erase();
254 auto_region_delete = true;
255 auto_reset_options = false;
257 num_lastfiles = maxlastfiles;
258 check_lastfiles = true;
259 use_lastfilepos = true;
260 load_session = false;
262 backupdir_path.erase();
263 display_graphics = graphics::ColorDisplay;
264 // Spellchecker settings:
265 use_spell_lib = true;
266 isp_command = "ispell";
267 isp_accept_compound = false;
268 isp_use_input_encoding = false;
269 isp_use_alt_lang = false;
270 isp_use_pers_dict = false;
271 isp_use_esc_chars = false;
275 mark_foreign_language = true;
276 language_auto_begin = true;
277 language_auto_end = true;
278 language_global_options = true;
279 language_use_babel = true;
280 language_package = "\\usepackage{babel}";
281 language_command_begin = "\\selectlanguage{$$lang}";
282 language_command_local = "\\foreignlanguage{$$lang}{";
283 default_language = "english";
285 windows_style_tex_paths = false;
286 tex_allows_spaces = false;
287 date_insert_format = "%x";
288 cursor_follows_scrollbar = false;
289 dialogs_iconify_with_main = false;
290 label_init_length = 3;
291 preview = PREVIEW_OFF;
292 preview_hashed_labels = false;
293 preview_scale_factor = "0.9";
294 use_converter_cache = false;
295 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
297 user_name = support::user_name();
299 user_email = support::user_email();
305 void oldFontFormat(string & family, string & foundry)
307 if (family.empty() || family[0] != '-')
309 foundry = token(family, '-', 1);
310 family = token(family, '-', 2);
318 int LyXRC::read(string const & filename)
320 LyXLex lexrc(lyxrcTags, lyxrcCount);
321 if (lyxerr.debugging(Debug::PARSER))
322 lexrc.printTable(lyxerr);
324 lexrc.setFile(filename);
325 if (!lexrc.isOK()) return -2;
327 lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
333 int LyXRC::read(std::istream & is)
335 LyXLex lexrc(lyxrcTags, lyxrcCount);
336 if (lyxerr.debugging(Debug::PARSER))
337 lexrc.printTable(lyxerr);
340 if (!lexrc.isOK()) return -2;
342 lyxerr[Debug::LYXRC] << "Reading istream..." << endl;
348 int LyXRC::read(LyXLex & lexrc)
350 if (!lexrc.isOK()) return -2;
352 while (lexrc.isOK()) {
353 // By using two switches we take advantage of the compiler
354 // telling us if we have missed a LyXRCTags element in
355 // the second switch.
356 // Note that this also shows a problem with LyXLex since it
357 // helps us avoid taking advantage of the strictness of the
360 int le = lexrc.lex();
362 case LyXLex::LEX_UNDEF:
363 lexrc.printError("Unknown tag `$$Token'");
365 case LyXLex::LEX_FEOF:
369 switch (static_cast<LyXRCTags>(le)) {
370 case RC_INPUT: // Include file
373 libFileSearch(string(),
376 lexrc.printError("Error reading "
377 "included file: "+tmp);
383 bind_file = os::internal_path(lexrc.getString());
389 ui_file = os::internal_path(lexrc.getString());
393 case RC_AUTORESET_OPTIONS:
395 auto_reset_options = lexrc.getBool();
399 case RC_DISPLAY_GRAPHICS:
401 display_graphics = graphics::displayTranslator().find(lexrc.getString());
405 case RC_TEX_EXPECTS_WINDOWS_PATHS:
407 windows_style_tex_paths = lexrc.getBool();
411 case RC_TEX_ALLOWS_SPACES:
413 tex_allows_spaces = lexrc.getBool();
419 use_kbmap = lexrc.getBool();
423 case RC_KBMAP_PRIMARY:
425 string const kmap(os::internal_path(lexrc.getString()));
428 } else if (!libFileSearch("kbd", kmap,
430 primary_kbmap = kmap;
432 lexrc.printError("LyX: Keymap `$$Token' not found");
437 case RC_KBMAP_SECONDARY:
439 string const kmap(os::internal_path(lexrc.getString()));
442 } else if (!libFileSearch("kbd", kmap,
444 secondary_kbmap = kmap;
446 lexrc.printError("LyX: Keymap `$$Token' not found");
451 case RC_FONT_ENCODING:
453 fontenc = lexrc.getString();
459 printer = lexrc.getString();
463 case RC_PRINT_COMMAND:
465 print_command = lexrc.getString();
469 case RC_PRINTEVENPAGEFLAG:
471 print_evenpage_flag = lexrc.getString();
475 case RC_PRINTODDPAGEFLAG:
477 print_oddpage_flag = lexrc.getString();
481 case RC_PRINTPAGERANGEFLAG:
483 print_pagerange_flag = lexrc.getString();
487 case RC_PRINTCOPIESFLAG:
489 print_copies_flag = lexrc.getString();
493 case RC_PRINTCOLLCOPIESFLAG:
495 print_collcopies_flag = lexrc.getString();
499 case RC_PRINTREVERSEFLAG:
501 print_reverse_flag = lexrc.getString();
505 case RC_PRINTLANDSCAPEFLAG:
507 print_landscape_flag = lexrc.getString();
511 case RC_PRINTTOPRINTER:
513 print_to_printer = lexrc.getString();
517 case RC_PRINT_ADAPTOUTPUT:
519 print_adapt_output = lexrc.getBool();
525 print_to_file = os::internal_path(lexrc.getString());
529 case RC_PRINTFILEEXTENSION:
531 print_file_extension = lexrc.getString();
535 case RC_PRINTEXSTRAOPTIONS:
537 print_extra_options = lexrc.getString();
541 case RC_PRINTSPOOL_COMMAND:
543 print_spool_command = lexrc.getString();
547 case RC_PRINTSPOOL_PRINTERPREFIX:
549 print_spool_printerprefix = lexrc.getString();
553 case RC_PRINTPAPERDIMENSIONFLAG:
555 print_paper_dimension_flag = lexrc.getString();
559 case RC_PRINTPAPERFLAG:
561 print_paper_flag = lexrc.getString();
565 case RC_CUSTOM_EXPORT_COMMAND:
567 custom_export_command = lexrc.getString();
571 case RC_CUSTOM_EXPORT_FORMAT:
573 custom_export_format = lexrc.getString();
577 case RC_DEFAULT_PAPERSIZE:
580 ascii_lowercase(lexrc.getString());
581 if (size == "usletter")
584 else if (size == "legal")
587 else if (size == "executive")
590 else if (size == "a3")
593 else if (size == "a4")
596 else if (size == "a5")
599 else if (size == "b5")
602 else if (size == "default")
608 case RC_VIEWDVI_PAPEROPTION:
610 view_dvi_paper_option = lexrc.getString();
612 view_dvi_paper_option.erase();
616 case RC_CHKTEX_COMMAND:
618 chktex_command = lexrc.getString();
622 case RC_BIBTEX_COMMAND:
624 bibtex_command = lexrc.getString();
628 case RC_INDEX_COMMAND:
630 index_command = lexrc.getString();
636 dpi = lexrc.getInteger();
642 zoom = lexrc.getInteger();
646 case RC_SCREEN_GEOMETRY_HEIGHT:
648 geometry_height = lexrc.getInteger();
652 case RC_SCREEN_GEOMETRY_WIDTH:
654 geometry_width = lexrc.getInteger();
658 case RC_SCREEN_GEOMETRY_XYSAVED:
660 geometry_xysaved = lexrc.getBool();
664 case RC_SCREEN_FONT_SIZES:
666 font_sizes[LyXFont::SIZE_TINY] =
670 font_sizes[LyXFont::SIZE_SCRIPT] =
674 font_sizes[LyXFont::SIZE_FOOTNOTE] =
678 font_sizes[LyXFont::SIZE_SMALL] =
682 font_sizes[LyXFont::SIZE_NORMAL] =
686 font_sizes[LyXFont::SIZE_LARGE] =
690 font_sizes[LyXFont::SIZE_LARGER] =
694 font_sizes[LyXFont::SIZE_LARGEST] =
698 font_sizes[LyXFont::SIZE_HUGE] =
702 font_sizes[LyXFont::SIZE_HUGER] =
707 case RC_SCREEN_FONT_SCALABLE:
709 use_scalable_fonts = lexrc.getBool();
715 autosave = lexrc.getInteger();
719 case RC_DOCUMENTPATH:
721 document_path = os::internal_path(lexrc.getString());
722 document_path = expandPath(document_path);
726 case RC_TEMPLATEPATH:
728 template_path = os::internal_path(lexrc.getString());
729 template_path = expandPath(template_path);
735 tempdir_path = os::internal_path(lexrc.getString());
736 tempdir_path = expandPath(tempdir_path);
742 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
746 case RC_USELASTFILEPOS:
748 use_lastfilepos = lexrc.getBool();
754 load_session = lexrc.getBool();
758 case RC_NUMLASTFILES:
760 num_lastfiles = lexrc.getInteger();
764 case RC_CHECKLASTFILES:
766 check_lastfiles = lexrc.getBool();
770 case RC_SCREEN_FONT_ROMAN:
772 roman_font_name = lexrc.getString();
773 oldFontFormat(roman_font_name,
778 case RC_SCREEN_FONT_SANS:
780 sans_font_name = lexrc.getString();
781 oldFontFormat(sans_font_name, sans_font_foundry);
785 case RC_SCREEN_FONT_TYPEWRITER:
787 typewriter_font_name = lexrc.getString();
788 oldFontFormat(typewriter_font_name,
789 typewriter_font_foundry);
793 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
795 roman_font_foundry = lexrc.getString();
799 case RC_SCREEN_FONT_SANS_FOUNDRY:
801 sans_font_foundry = lexrc.getString();
805 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
807 typewriter_font_foundry = lexrc.getString();
811 case RC_SCREEN_FONT_ENCODING:
813 font_norm = lexrc.getString();
814 set_font_norm_type();
818 case RC_POPUP_BOLD_FONT:
820 popup_bold_font = lexrc.getString();
824 case RC_POPUP_NORMAL_FONT:
826 popup_normal_font = lexrc.getString();
830 case RC_POPUP_FONT_ENCODING:
832 popup_font_encoding = lexrc.getString();
838 string lyx_name, x11_name;
841 lyx_name = lexrc.getString();
843 lexrc.printError("Missing color tag.");
848 x11_name = lexrc.getString();
850 lexrc.printError("Missing color name for color: `$$Token'");
854 LColor::color const col =
855 lcolor.getFromLyXName(lyx_name);
856 if (col == LColor::none ||
857 col == LColor::inherit ||
858 col == LColor::ignore)
861 if (!lcolor.setColor(col, x11_name)) {
862 lyxerr << "Bad lyxrc set_color for "
868 case RC_AUTOREGIONDELETE:
869 // Auto region delete defaults to true
871 auto_region_delete = lexrc.getBool();
877 lyxpipes = os::internal_path(lexrc.getString());
878 lyxpipes = expandPath(lyxpipes);
882 case RC_CURSOR_FOLLOWS_SCROLLBAR:
884 cursor_follows_scrollbar = lexrc.getBool();
888 case RC_DIALOGS_ICONIFY_WITH_MAIN:
890 dialogs_iconify_with_main = lexrc.getBool();
894 case RC_ASCIIROFF_COMMAND:
896 ascii_roff_command = lexrc.getString();
899 case RC_ASCII_LINELEN:
901 ascii_linelen = lexrc.getInteger();
904 // Spellchecker settings:
905 case RC_USE_SPELL_LIB:
907 use_spell_lib = lexrc.getBool();
910 case RC_SPELL_COMMAND:
912 isp_command = lexrc.getString();
915 case RC_ACCEPT_COMPOUND:
917 isp_accept_compound = lexrc.getBool();
922 isp_use_input_encoding = lexrc.getBool();
925 case RC_USE_ALT_LANG:
927 isp_use_alt_lang = lexrc.getBool();
930 case RC_USE_PERS_DICT:
932 isp_use_pers_dict = lexrc.getBool();
935 case RC_USE_ESC_CHARS:
937 isp_use_esc_chars = lexrc.getBool();
942 isp_alt_lang = lexrc.getString();
947 isp_pers_dict = os::internal_path(lexrc.getString());
952 isp_esc_chars = lexrc.getString();
957 make_backup = lexrc.getBool();
960 case RC_BACKUPDIR_PATH:
962 backupdir_path = os::internal_path(lexrc.getString());
963 backupdir_path = expandPath(backupdir_path);
966 case RC_DATE_INSERT_FORMAT:
968 date_insert_format = lexrc.getString();
971 case RC_LANGUAGE_PACKAGE:
973 language_package = lexrc.getString();
976 case RC_LANGUAGE_AUTO_BEGIN:
978 language_auto_begin = lexrc.getBool();
981 case RC_LANGUAGE_AUTO_END:
983 language_auto_end = lexrc.getBool();
986 case RC_LANGUAGE_GLOBAL_OPTIONS:
988 language_global_options = lexrc.getBool();
991 case RC_LANGUAGE_USE_BABEL:
993 language_use_babel = lexrc.getBool();
996 case RC_LANGUAGE_COMMAND_BEGIN:
998 language_command_begin = lexrc.getString();
1001 case RC_LANGUAGE_COMMAND_END:
1003 language_command_end = lexrc.getString();
1006 case RC_LANGUAGE_COMMAND_LOCAL:
1008 language_command_local = lexrc.getString();
1011 case RC_RTL_SUPPORT:
1013 rtl_support = lexrc.getBool();
1016 case RC_AUTO_NUMBER:
1018 auto_number = lexrc.getBool();
1021 case RC_MARK_FOREIGN_LANGUAGE:
1023 mark_foreign_language = lexrc.getBool();
1028 string fmt, command;
1030 fmt = lexrc.getString();
1033 command = lexrc.getString();
1035 movers.set(fmt, command);
1039 case RC_CONVERTER: {
1040 string from, to, command, flags;
1042 from = lexrc.getString();
1045 to = lexrc.getString();
1048 command = lexrc.getString();
1051 flags = lexrc.getString();
1053 if (command.empty()) {
1054 converters.erase(from, to);
1056 converters.add(from, to, command, flags);
1060 // compatibility with versions older than 1.4.0 only
1062 string format, command;
1064 format = lexrc.getString();
1067 command = lexrc.getString();
1069 formats.setViewer(format, command);
1073 string format, extension, prettyname, shortcut;
1075 format = lexrc.getString();
1078 extension = lexrc.getString();
1081 prettyname = lexrc.getString();
1084 shortcut = lexrc.getString();
1086 string viewer, editor;
1088 viewer = lexrc.getString();
1090 editor = lexrc.getString();
1092 // Hack to ensure compatibility with versions older
1094 int le = lexrc.lex();
1095 if (le != LyXLex::LEX_FEOF && le != LyXLex::LEX_UNDEF) {
1096 flags = lexrc.getString();
1097 if (le != LyXLex::LEX_DATA) {
1098 // We have got a known token.
1099 // Therefore this is an old style
1100 // format definition without
1102 lexrc.pushToken(flags);
1106 int flgs = Format::none;
1107 while (!flags.empty()) {
1109 flags = support::split(flags, flag, ',');
1110 if (flag == "document")
1111 flgs |= Format::document;
1112 else if (flag == "vector")
1113 flgs |= Format::vector;
1115 lyxerr << "Ignoring unknown flag `"
1116 << flag << "' for format `"
1117 << format << "'." << endl;
1119 if (prettyname.empty()) {
1120 if (converters.formatIsUsed(format)) {
1121 lyxerr << "Can't delete format "
1124 formats.erase(format);
1127 formats.add(format, extension, prettyname,
1128 shortcut, viewer, editor, flgs);
1132 case RC_DEFAULT_LANGUAGE:
1134 default_language = lexrc.getString();
1138 case RC_LABEL_INIT_LENGTH:
1140 label_init_length = lexrc.getInteger();
1144 case RC_SHOW_BANNER:
1146 show_banner = lexrc.getBool();
1152 string const tmp = lexrc.getString();
1153 if (tmp == "true" || tmp == "on")
1154 preview = PREVIEW_ON;
1155 else if (tmp == "no_math")
1156 preview = PREVIEW_NO_MATH;
1158 preview = PREVIEW_OFF;
1159 if (tmp != "false" && tmp != "off")
1160 lyxerr << "Unrecognized "
1162 << tmp << '\n' << endl;
1167 case RC_PREVIEW_HASHED_LABELS:
1169 preview_hashed_labels = lexrc.getBool();
1173 case RC_PREVIEW_SCALE_FACTOR:
1175 preview_scale_factor = lexrc.getString();
1181 user_name = lexrc.getString();
1186 user_email = lexrc.getString();
1189 case RC_PATH_PREFIX:
1191 path_prefix = lexrc.getString();
1194 case RC_USE_CONVERTER_CACHE:
1196 use_converter_cache = lexrc.getBool();
1199 case RC_CONVERTER_CACHE_MAXAGE:
1201 converter_cache_maxage =
1202 convert<unsigned int>(lexrc.getString());
1205 case RC_LAST: break; // this is just a dummy
1209 /// Update converters data-structures
1210 converters.update(formats);
1211 converters.buildGraph();
1217 void LyXRC::write(string const & filename, bool ignore_system_lyxrc) const
1219 ofstream ofs(filename.c_str());
1221 write(ofs, ignore_system_lyxrc);
1225 void LyXRC::print() const
1227 if (lyxerr.debugging())
1228 write(lyxerr, false);
1236 typedef std::pair<std::string, SpecialisedMover> Data;
1238 SameMover(Data const & comparison)
1239 : comparison_(comparison) {}
1241 bool operator()(Data const & data) const
1243 return data.first == comparison_.first &&
1244 data.second.command() == comparison_.second.command();
1252 void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const
1254 os << "### This file is part of\n"
1255 << "### ========================================================\n"
1256 << "### LyX, The Document Processor\n"
1258 << "### Copyright 1995 Matthias Ettrich\n"
1259 << "### Copyright 1995-2001 The LyX Team.\n"
1261 << "### ========================================================\n"
1263 << "# This file is written by LyX, if you want to make your own\n"
1264 << "# modifications you should do them from inside LyX and save\n"
1267 // Why the switch you might ask. It is a trick to ensure that all
1268 // the elements in the LyXRCTags enum is handled. As you can see
1269 // there are no breaks at all. So it is just a huge fall-through.
1270 // The nice thing is that we will get a warning from the compiler
1271 // if we forget an element.
1272 LyXRCTags tag = RC_LAST;
1276 // input/include files are not done here
1278 if (ignore_system_lyxrc ||
1279 bind_file != system_lyxrc.bind_file) {
1280 string const path = os::external_path(bind_file);
1281 os << "\\bind_file \"" << path << "\"\n";
1287 << "# MISC SECTION ######################################\n"
1290 // bind files are not done here.
1292 case RC_PATH_PREFIX:
1293 if (ignore_system_lyxrc ||
1294 path_prefix != system_lyxrc.path_prefix) {
1295 os << "\\path_prefix \"" << path_prefix << "\"\n";
1299 if (ignore_system_lyxrc ||
1300 ui_file != system_lyxrc.ui_file) {
1301 string const path = os::external_path(ui_file);
1302 os << "\\ui_file \"" << path << "\"\n";
1304 case RC_AUTOREGIONDELETE:
1305 if (ignore_system_lyxrc ||
1306 auto_region_delete != system_lyxrc.auto_region_delete) {
1307 os << "# Set to false to inhibit automatic replacement of\n"
1308 << "# the current selection.\n"
1309 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1312 case RC_AUTORESET_OPTIONS:
1313 if (ignore_system_lyxrc ||
1314 auto_reset_options != system_lyxrc.auto_reset_options) {
1315 os << "# Set to false to inhibit automatic reset of\n"
1316 << "# the class options to defaults on class change.\n"
1317 << "\\auto_reset_options "
1318 << convert<string>(auto_reset_options)
1322 if (ignore_system_lyxrc ||
1323 autosave != system_lyxrc.autosave) {
1324 os << "# The time interval between auto-saves in seconds.\n"
1325 << "\\autosave " << autosave << '\n';
1327 case RC_DISPLAY_GRAPHICS:
1328 if (ignore_system_lyxrc ||
1329 display_graphics != system_lyxrc.display_graphics) {
1330 os << "# Display graphics within LyX\n"
1331 << "# monochrome|grayscale|color|none\n"
1332 << "\\display_graphics "
1333 << graphics::displayTranslator().find(display_graphics)
1337 case RC_VIEWDVI_PAPEROPTION:
1338 if (ignore_system_lyxrc ||
1339 view_dvi_paper_option
1340 != system_lyxrc.view_dvi_paper_option) {
1341 os << "# Options used to specify paper size to the\n"
1342 << "# view_dvi_command (e.g. -paper)\n"
1343 << "\\view_dvi_paper_option \""
1344 << view_dvi_paper_option << "\"\n";
1346 case RC_DEFAULT_PAPERSIZE:
1347 if (ignore_system_lyxrc ||
1348 default_papersize != system_lyxrc.default_papersize) {
1349 os << "# The default papersize to use.\n"
1350 << "\\default_papersize \"";
1351 switch (default_papersize) {
1353 os << "default"; break;
1354 case PAPER_USLETTER:
1355 os << "usletter"; break;
1357 os << "legal"; break;
1358 case PAPER_USEXECUTIVE:
1359 os << "executive"; break;
1370 case PAPER_B4: break;
1374 case RC_CHKTEX_COMMAND:
1375 if (ignore_system_lyxrc ||
1376 chktex_command != system_lyxrc.chktex_command) {
1377 os << "\\chktex_command \"" << chktex_command << "\"\n";
1379 case RC_BIBTEX_COMMAND:
1380 if (ignore_system_lyxrc ||
1381 bibtex_command != system_lyxrc.bibtex_command) {
1382 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1384 case RC_INDEX_COMMAND:
1385 if (ignore_system_lyxrc ||
1386 index_command != system_lyxrc.index_command) {
1387 os << "\\index_command \"" << index_command << "\"\n";
1389 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1390 if (ignore_system_lyxrc ||
1391 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1392 os << "\\tex_expects_windows_paths "
1393 << convert<string>(windows_style_tex_paths) << '\n';
1395 case RC_TEX_ALLOWS_SPACES:
1396 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1397 os << "\\tex_allows_spaces "
1398 << convert<string>(tex_allows_spaces) << '\n';
1401 if (ignore_system_lyxrc ||
1402 use_kbmap != system_lyxrc.use_kbmap) {
1403 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1405 case RC_KBMAP_PRIMARY:
1406 if (ignore_system_lyxrc ||
1407 primary_kbmap != system_lyxrc.primary_kbmap) {
1408 string const path = os::external_path(primary_kbmap);
1409 os << "\\kbmap_primary \"" << path << "\"\n";
1411 case RC_KBMAP_SECONDARY:
1412 if (ignore_system_lyxrc ||
1413 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1414 string const path = os::external_path(secondary_kbmap);
1415 os << "\\kbmap_secondary \"" << path << "\"\n";
1418 if (ignore_system_lyxrc ||
1419 lyxpipes != system_lyxrc.lyxpipes) {
1420 string const path = os::external_path(lyxpipes);
1421 os << "\\serverpipe \"" << path << "\"\n";
1423 case RC_DATE_INSERT_FORMAT:
1424 if (ignore_system_lyxrc ||
1425 date_insert_format != system_lyxrc.date_insert_format) {
1426 os << "\\date_insert_format \"" << date_insert_format
1429 case RC_LABEL_INIT_LENGTH:
1430 if (ignore_system_lyxrc ||
1431 label_init_length != system_lyxrc.label_init_length) {
1432 os << "\\label_init_length " << label_init_length
1437 os << "\\user_name \"" << user_name << "\"\n";
1440 os << "\\user_email \"" << user_email << "\"\n";
1442 case RC_SHOW_BANNER:
1443 if (ignore_system_lyxrc ||
1444 show_banner != system_lyxrc.show_banner) {
1445 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1449 if (ignore_system_lyxrc ||
1450 preview != system_lyxrc.preview) {
1456 case PREVIEW_NO_MATH:
1463 os << "\\preview " << status << '\n';
1466 case RC_PREVIEW_HASHED_LABELS:
1467 if (ignore_system_lyxrc ||
1468 preview_hashed_labels !=
1469 system_lyxrc.preview_hashed_labels) {
1470 os << "\\preview_hashed_labels "
1471 << convert<string>(preview_hashed_labels) << '\n';
1474 case RC_PREVIEW_SCALE_FACTOR:
1475 if (ignore_system_lyxrc ||
1476 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1477 os << "\\preview_scale_factor "
1478 << preview_scale_factor << '\n';
1481 case RC_USE_CONVERTER_CACHE:
1482 if (ignore_system_lyxrc ||
1483 use_converter_cache != system_lyxrc.use_converter_cache) {
1484 os << "\\use_converter_cache "
1485 << convert<string>(use_converter_cache) << '\n';
1488 case RC_CONVERTER_CACHE_MAXAGE:
1489 if (ignore_system_lyxrc ||
1490 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1491 os << "\\converter_cache_maxage"
1492 << converter_cache_maxage << '\n';
1496 << "# SCREEN & FONTS SECTION ############################\n"
1499 case RC_POPUP_NORMAL_FONT:
1500 if (ignore_system_lyxrc ||
1501 popup_normal_font != system_lyxrc.popup_normal_font) {
1502 os << "\\popup_normal_font \"" << popup_normal_font
1505 case RC_POPUP_BOLD_FONT:
1506 if (ignore_system_lyxrc ||
1507 popup_bold_font != system_lyxrc.popup_bold_font) {
1508 os << "\\popup_bold_font \"" << popup_bold_font
1511 case RC_POPUP_FONT_ENCODING:
1512 if (ignore_system_lyxrc ||
1513 popup_font_encoding != system_lyxrc.popup_font_encoding) {
1514 os << "\\popup_font_encoding \"" << popup_font_encoding
1518 if (ignore_system_lyxrc ||
1519 dpi != system_lyxrc.dpi) {
1520 os << "\\screen_dpi " << dpi << '\n';
1522 case RC_SCREEN_ZOOM:
1523 if (ignore_system_lyxrc ||
1524 zoom != system_lyxrc.zoom) {
1525 os << "\\screen_zoom " << zoom << '\n';
1527 case RC_SCREEN_GEOMETRY_HEIGHT:
1528 if (ignore_system_lyxrc ||
1529 geometry_height != system_lyxrc.geometry_height) {
1530 os << "\\screen_geometry_height " << geometry_height
1533 case RC_SCREEN_GEOMETRY_WIDTH:
1534 if (ignore_system_lyxrc ||
1535 geometry_width != system_lyxrc.geometry_width) {
1536 os << "\\screen_geometry_width " << geometry_width
1539 case RC_SCREEN_GEOMETRY_XYSAVED:
1540 if (ignore_system_lyxrc ||
1541 geometry_xysaved != system_lyxrc.geometry_xysaved) {
1542 os << "\\screen_geometry_xysaved " << convert<string>(geometry_xysaved)
1545 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1546 if (ignore_system_lyxrc ||
1547 cursor_follows_scrollbar
1548 != system_lyxrc.cursor_follows_scrollbar) {
1549 os << "\\cursor_follows_scrollbar "
1550 << convert<string>(cursor_follows_scrollbar) << '\n';
1552 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1553 if (ignore_system_lyxrc ||
1554 dialogs_iconify_with_main
1555 != system_lyxrc.dialogs_iconify_with_main) {
1556 os << "\\dialogs_iconify_with_main "
1557 << convert<string>(dialogs_iconify_with_main) << '\n';
1559 case RC_SCREEN_FONT_ROMAN:
1560 if (ignore_system_lyxrc ||
1561 roman_font_name != system_lyxrc.roman_font_name) {
1562 os << "\\screen_font_roman \"" << roman_font_name
1565 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1566 if (ignore_system_lyxrc ||
1567 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1568 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1571 case RC_SCREEN_FONT_SANS:
1572 if (ignore_system_lyxrc ||
1573 sans_font_name != system_lyxrc.sans_font_name) {
1574 os << "\\screen_font_sans \"" << sans_font_name
1577 case RC_SCREEN_FONT_SANS_FOUNDRY:
1578 if (ignore_system_lyxrc ||
1579 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1580 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1583 case RC_SCREEN_FONT_TYPEWRITER:
1584 if (ignore_system_lyxrc ||
1585 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1586 os << "\\screen_font_typewriter \""
1587 << typewriter_font_name << "\"\n";
1589 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1590 if (ignore_system_lyxrc ||
1591 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1592 os << "\\screen_font_typewriter_foundry \""
1593 << typewriter_font_foundry << "\"\n";
1596 case RC_SCREEN_FONT_SCALABLE:
1597 if (ignore_system_lyxrc ||
1598 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1599 os << "\\screen_font_scalable "
1600 << convert<string>(use_scalable_fonts)
1603 case RC_SCREEN_FONT_ENCODING:
1604 if (ignore_system_lyxrc ||
1605 font_norm != system_lyxrc.font_norm) {
1606 os << "\\screen_font_encoding \"" << font_norm
1609 case RC_SCREEN_FONT_SIZES:
1610 if (ignore_system_lyxrc ||
1611 font_sizes[LyXFont::SIZE_TINY]
1612 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1613 font_sizes[LyXFont::SIZE_SCRIPT]
1614 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1615 font_sizes[LyXFont::SIZE_FOOTNOTE]
1616 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1617 font_sizes[LyXFont::SIZE_SMALL]
1618 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1619 font_sizes[LyXFont::SIZE_NORMAL]
1620 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1621 font_sizes[LyXFont::SIZE_LARGE]
1622 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1623 font_sizes[LyXFont::SIZE_LARGER]
1624 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1625 font_sizes[LyXFont::SIZE_LARGEST]
1626 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1627 font_sizes[LyXFont::SIZE_HUGE]
1628 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1629 font_sizes[LyXFont::SIZE_HUGER]
1630 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1631 os.setf(ios::fixed);
1633 os << "\\screen_font_sizes"
1634 << ' ' << font_sizes[LyXFont::SIZE_TINY]
1635 << ' ' << font_sizes[LyXFont::SIZE_SCRIPT]
1636 << ' ' << font_sizes[LyXFont::SIZE_FOOTNOTE]
1637 << ' ' << font_sizes[LyXFont::SIZE_SMALL]
1638 << ' ' << font_sizes[LyXFont::SIZE_NORMAL]
1639 << ' ' << font_sizes[LyXFont::SIZE_LARGE]
1640 << ' ' << font_sizes[LyXFont::SIZE_LARGER]
1641 << ' ' << font_sizes[LyXFont::SIZE_LARGEST]
1642 << ' ' << font_sizes[LyXFont::SIZE_HUGE]
1643 << ' ' << font_sizes[LyXFont::SIZE_HUGER]
1648 << "# COLOR SECTION ###################################\n"
1652 for (int i = 0; i < LColor::ignore; ++i) {
1653 LColor::color lc = static_cast<LColor::color>(i);
1655 string const col(lcolor.getX11Name(lc));
1656 if (ignore_system_lyxrc ||
1657 col != system_lcolor.getX11Name(lc)) {
1658 os << "\\set_color \""
1659 << lcolor.getLyXName(lc) << "\" \""
1665 << "# PRINTER SECTION ###################################\n"
1669 if (ignore_system_lyxrc ||
1670 printer != system_lyxrc.printer) {
1671 os << "\\printer \"" << printer << "\"\n";
1673 case RC_PRINT_ADAPTOUTPUT:
1674 if (ignore_system_lyxrc ||
1675 print_adapt_output != system_lyxrc.print_adapt_output) {
1676 os << "\\print_adapt_output "
1677 << convert<string>(print_adapt_output)
1680 case RC_PRINT_COMMAND:
1681 if (ignore_system_lyxrc ||
1682 print_command != system_lyxrc.print_command) {
1683 os << "\\print_command \"" << print_command << "\"\n";
1685 case RC_PRINTEXSTRAOPTIONS:
1686 if (ignore_system_lyxrc ||
1687 print_extra_options != system_lyxrc.print_extra_options) {
1688 os << "\\print_extra_options \"" << print_extra_options
1691 case RC_PRINTSPOOL_COMMAND:
1692 if (ignore_system_lyxrc ||
1693 print_spool_command != system_lyxrc.print_spool_command) {
1694 os << "\\print_spool_command \"" << print_spool_command
1697 case RC_PRINTSPOOL_PRINTERPREFIX:
1698 if (ignore_system_lyxrc ||
1699 print_spool_printerprefix
1700 != system_lyxrc.print_spool_printerprefix) {
1701 os << "\\print_spool_printerprefix \""
1702 << print_spool_printerprefix << "\"\n";
1704 case RC_PRINTEVENPAGEFLAG:
1705 if (ignore_system_lyxrc ||
1706 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1707 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1710 case RC_PRINTODDPAGEFLAG:
1711 if (ignore_system_lyxrc ||
1712 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1713 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1716 case RC_PRINTREVERSEFLAG:
1717 if (ignore_system_lyxrc ||
1718 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1719 os << "\\print_reverse_flag \"" << print_reverse_flag
1722 case RC_PRINTLANDSCAPEFLAG:
1723 if (ignore_system_lyxrc ||
1724 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1725 os << "\\print_landscape_flag \"" << print_landscape_flag
1728 case RC_PRINTPAGERANGEFLAG:
1729 if (ignore_system_lyxrc ||
1730 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1731 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1734 case RC_PRINTCOPIESFLAG:
1735 if (ignore_system_lyxrc ||
1736 print_copies_flag != system_lyxrc.print_copies_flag) {
1737 os << "\\print_copies_flag \"" << print_copies_flag
1740 case RC_PRINTCOLLCOPIESFLAG:
1741 if (ignore_system_lyxrc ||
1742 print_collcopies_flag
1743 != system_lyxrc.print_collcopies_flag) {
1744 os << "\\print_collcopies_flag \""
1745 << print_collcopies_flag
1748 case RC_PRINTPAPERFLAG:
1749 if (ignore_system_lyxrc ||
1750 print_paper_flag != system_lyxrc.print_paper_flag) {
1751 os << "\\print_paper_flag \"" << print_paper_flag
1754 case RC_PRINTPAPERDIMENSIONFLAG:
1755 if (ignore_system_lyxrc ||
1756 print_paper_dimension_flag
1757 != system_lyxrc.print_paper_dimension_flag) {
1758 os << "\\print_paper_dimension_flag \""
1759 << print_paper_dimension_flag << "\"\n";
1761 case RC_PRINTTOPRINTER:
1762 if (ignore_system_lyxrc ||
1763 print_to_printer != system_lyxrc.print_to_printer) {
1764 os << "\\print_to_printer \"" << print_to_printer
1767 case RC_PRINTTOFILE:
1768 if (ignore_system_lyxrc ||
1769 print_to_file != system_lyxrc.print_to_file) {
1770 string const path = os::external_path(print_to_file);
1771 os << "\\print_to_file \"" << path << "\"\n";
1773 case RC_PRINTFILEEXTENSION:
1774 if (ignore_system_lyxrc ||
1775 print_file_extension != system_lyxrc.print_file_extension) {
1776 os << "\\print_file_extension \""
1777 << print_file_extension
1782 << "# EXPORT SECTION ####################################\n"
1785 case RC_CUSTOM_EXPORT_COMMAND:
1786 if (ignore_system_lyxrc ||
1787 custom_export_command
1788 != system_lyxrc.custom_export_command) {
1789 os << "\\custom_export_command \""
1790 << custom_export_command
1793 case RC_CUSTOM_EXPORT_FORMAT:
1794 if (ignore_system_lyxrc ||
1795 custom_export_format
1796 != system_lyxrc.custom_export_format) {
1797 os << "\\custom_export_format \"" << custom_export_format
1802 << "# TEX SECTION #######################################\n"
1805 case RC_FONT_ENCODING:
1806 if (ignore_system_lyxrc ||
1807 fontenc != system_lyxrc.fontenc) {
1808 os << "\\font_encoding \"" << fontenc << "\"\n";
1812 << "# FILE SECTION ######################################\n"
1815 case RC_DOCUMENTPATH:
1816 if (ignore_system_lyxrc ||
1817 document_path != system_lyxrc.document_path) {
1818 string const path = os::external_path(document_path);
1819 os << "\\document_path \"" << path << "\"\n";
1821 case RC_USELASTFILEPOS:
1822 if (ignore_system_lyxrc ||
1823 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1824 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1827 case RC_LOADSESSION:
1828 if (ignore_system_lyxrc ||
1829 load_session != system_lyxrc.load_session) {
1830 os << "\\load_session " << convert<string>(load_session)
1833 case RC_NUMLASTFILES:
1834 if (ignore_system_lyxrc ||
1835 num_lastfiles != system_lyxrc.num_lastfiles) {
1836 os << "\\num_lastfiles " << num_lastfiles << '\n';
1838 case RC_CHECKLASTFILES:
1839 if (ignore_system_lyxrc ||
1840 check_lastfiles != system_lyxrc.check_lastfiles) {
1841 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
1844 case RC_TEMPLATEPATH:
1845 if (ignore_system_lyxrc ||
1846 template_path != system_lyxrc.template_path) {
1847 string const path = os::external_path(template_path);
1848 os << "\\template_path \"" << path << "\"\n";
1850 case RC_TEMPDIRPATH:
1851 if (ignore_system_lyxrc ||
1852 tempdir_path != system_lyxrc.tempdir_path) {
1853 string const path = os::external_path(tempdir_path);
1854 os << "\\tempdir_path \"" << path << "\"\n";
1858 case RC_ASCII_LINELEN:
1859 if (ignore_system_lyxrc ||
1860 ascii_linelen != system_lyxrc.ascii_linelen) {
1861 os << "\\ascii_linelen " << ascii_linelen << '\n';
1863 case RC_MAKE_BACKUP:
1864 if (ignore_system_lyxrc ||
1865 make_backup != system_lyxrc.make_backup) {
1866 os << "\\make_backup " << convert<string>(make_backup) << '\n';
1868 case RC_BACKUPDIR_PATH:
1869 if (ignore_system_lyxrc ||
1870 backupdir_path != system_lyxrc.backupdir_path) {
1871 string const path = os::external_path(backupdir_path);
1872 os << "\\backupdir_path \"" << path << "\"\n";
1876 << "# ASCII EXPORT SECTION ##############################\n"
1879 case RC_ASCIIROFF_COMMAND:
1880 if (ignore_system_lyxrc ||
1881 ascii_roff_command != system_lyxrc.ascii_roff_command) {
1882 os << "\\ascii_roff_command \"" << ascii_roff_command
1887 << "# SPELLCHECKER SECTION ##############################\n"
1889 case RC_USE_SPELL_LIB:
1890 if (ignore_system_lyxrc ||
1891 use_spell_lib != system_lyxrc.use_spell_lib) {
1892 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
1894 case RC_SPELL_COMMAND:
1895 if (ignore_system_lyxrc ||
1896 isp_command != system_lyxrc.isp_command) {
1897 os << "\\spell_command \"" << isp_command << "\"\n";
1899 case RC_ACCEPT_COMPOUND:
1900 if (ignore_system_lyxrc ||
1901 isp_accept_compound != system_lyxrc.isp_accept_compound) {
1902 os << "\\accept_compound " << convert<string>(isp_accept_compound)
1905 case RC_USE_ALT_LANG:
1906 if (ignore_system_lyxrc ||
1907 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1908 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
1912 if (ignore_system_lyxrc ||
1913 isp_alt_lang != system_lyxrc.isp_alt_lang) {
1914 os << "\\alternate_language \"" << isp_alt_lang
1917 case RC_USE_ESC_CHARS:
1918 if (ignore_system_lyxrc ||
1919 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1920 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
1924 if (ignore_system_lyxrc ||
1925 isp_esc_chars != system_lyxrc.isp_esc_chars) {
1926 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1928 case RC_USE_PERS_DICT:
1929 if (ignore_system_lyxrc ||
1930 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1931 os << "\\use_personal_dictionary "
1932 << convert<string>(isp_use_pers_dict)
1936 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1937 string const path = os::external_path(isp_pers_dict);
1938 os << "\\personal_dictionary \"" << path << "\"\n";
1940 case RC_USE_INP_ENC:
1941 if (ignore_system_lyxrc ||
1942 isp_use_input_encoding
1943 != system_lyxrc.isp_use_input_encoding) {
1944 os << "\\use_input_encoding "
1945 << convert<string>(isp_use_input_encoding)
1950 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1953 case RC_RTL_SUPPORT:
1954 if (ignore_system_lyxrc ||
1955 rtl_support != system_lyxrc.rtl_support) {
1956 os << "\\rtl " << convert<string>(rtl_support) << '\n';
1958 case RC_LANGUAGE_PACKAGE:
1959 if (ignore_system_lyxrc ||
1960 language_package != system_lyxrc.language_package) {
1961 os << "\\language_package \"" << language_package
1964 case RC_LANGUAGE_GLOBAL_OPTIONS:
1965 if (ignore_system_lyxrc ||
1966 language_global_options
1967 != system_lyxrc.language_global_options) {
1968 os << "\\language_global_options \""
1969 << convert<string>(language_global_options)
1972 case RC_LANGUAGE_USE_BABEL:
1973 if (ignore_system_lyxrc ||
1974 language_use_babel != system_lyxrc.language_use_babel) {
1975 os << "\\language_use_babel \""
1976 << convert<string>(language_use_babel)
1979 case RC_LANGUAGE_COMMAND_BEGIN:
1980 if (ignore_system_lyxrc ||
1981 language_command_begin
1982 != system_lyxrc.language_command_begin) {
1983 os << "\\language_command_begin \""
1984 << language_command_begin
1987 case RC_LANGUAGE_COMMAND_END:
1988 if (ignore_system_lyxrc ||
1989 language_command_end
1990 != system_lyxrc.language_command_end) {
1991 os << "\\language_command_end \"" << language_command_end
1994 case RC_LANGUAGE_COMMAND_LOCAL:
1995 if (ignore_system_lyxrc ||
1996 language_command_local
1997 != system_lyxrc.language_command_local) {
1998 os << "\\language_command_local \""
1999 << language_command_local
2002 case RC_LANGUAGE_AUTO_BEGIN:
2003 if (ignore_system_lyxrc ||
2004 language_auto_begin != system_lyxrc.language_auto_begin) {
2005 os << "\\language_auto_begin "
2006 << convert<string>(language_auto_begin) << '\n';
2008 case RC_LANGUAGE_AUTO_END:
2009 if (ignore_system_lyxrc ||
2010 language_auto_end != system_lyxrc.language_auto_end) {
2011 os << "\\language_auto_end "
2012 << convert<string>(language_auto_end) << '\n';
2014 case RC_MARK_FOREIGN_LANGUAGE:
2015 if (ignore_system_lyxrc ||
2016 mark_foreign_language
2017 != system_lyxrc.mark_foreign_language) {
2018 os << "\\mark_foreign_language " <<
2019 convert<string>(mark_foreign_language) << '\n';
2023 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2026 case RC_AUTO_NUMBER:
2027 if (ignore_system_lyxrc ||
2028 auto_number != system_lyxrc.auto_number) {
2029 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2031 case RC_DEFAULT_LANGUAGE:
2032 if (ignore_system_lyxrc ||
2033 default_language != system_lyxrc.default_language) {
2034 os << "\\default_language " << default_language << '\n';
2038 << "# FORMATS SECTION ##########################\n"
2042 // New/modified formats
2043 for (Formats::const_iterator cit = formats.begin();
2044 cit != formats.end(); ++cit) {
2045 Format const * format =
2046 system_formats.getFormat(cit->name());
2048 format->extension() != cit->extension() ||
2049 format->prettyname() != cit->prettyname() ||
2050 format->shortcut() != cit->shortcut() ||
2051 format->viewer() != cit->viewer() ||
2052 format->editor() != cit->editor() ||
2053 format->documentFormat() != cit->documentFormat() ||
2054 format->vectorFormat() != cit->vectorFormat()) {
2055 os << "\\format \"" << cit->name() << "\" \""
2056 << cit->extension() << "\" \""
2057 << cit->prettyname() << "\" \""
2058 << cit->shortcut() << "\" \""
2059 << cit->viewer() << "\" \""
2060 << cit->editor() << "\" \"";
2061 std::vector<string> flags;
2062 if (cit->documentFormat())
2063 flags.push_back("document");
2064 if (cit->vectorFormat())
2065 flags.push_back("vector");
2066 os << support::getStringFromVector(flags);
2071 // Look for deleted formats
2072 for (Formats::const_iterator cit = system_formats.begin();
2073 cit != system_formats.end(); ++cit)
2074 if (!formats.getFormat(cit->name()))
2075 os << "\\format \"" << cit->name()
2076 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2081 << "# CONVERTERS SECTION ##########################\n"
2085 // Look for new converters
2086 for (Converters::const_iterator cit = converters.begin();
2087 cit != converters.end(); ++cit) {
2088 Converter const * converter =
2089 system_converters.getConverter(cit->from,
2092 converter->command != cit->command ||
2093 converter->flags != cit->flags)
2094 os << "\\converter \"" << cit->from << "\" \""
2095 << cit->to << "\" \""
2096 << cit->command << "\" \""
2097 << cit->flags << "\"\n";
2100 // New/modifed converters
2101 for (Converters::const_iterator cit = system_converters.begin();
2102 cit != system_converters.end(); ++cit)
2103 if (!converters.getConverter(cit->from, cit->to))
2104 os << "\\converter \"" << cit->from
2105 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2109 << "# COPIERS SECTION ##########################\n"
2112 // Look for new movers
2113 Movers::iterator const sysbegin = system_movers.begin();
2114 Movers::iterator const sysend = system_movers.end();
2116 for (Movers::iterator it = movers.begin(), end = movers.end();
2118 Movers::iterator const sysit =
2119 std::find_if(sysbegin, sysend, SameMover(*it));
2120 if (sysit == sysend) {
2121 std::string const & fmt = it->first;
2122 std::string const & command =
2123 it->second.command();
2125 os << "\\copier " << fmt
2126 << " \"" << command << "\"\n";
2130 // We don't actually delete SpecialisedMover(s) from the
2131 // map, just clear their 'command', so there's no need
2132 // to test for anything else.
2138 void LyXRC::set_font_norm_type()
2140 if (font_norm == "iso10646-1")
2141 font_norm_type = ISO_10646_1;
2142 else if (font_norm == "iso8859-1")
2143 font_norm_type = ISO_8859_1;
2144 else if (font_norm == "iso8859-3")
2145 font_norm_type = ISO_8859_3;
2146 else if (font_norm == "iso8859-4")
2147 font_norm_type = ISO_8859_4;
2148 else if (font_norm == "iso8859-6.8x")
2149 font_norm_type = ISO_8859_6_8;
2150 else if (font_norm == "iso8859-9")
2151 font_norm_type = ISO_8859_9;
2152 else if (font_norm == "iso8859-15")
2153 font_norm_type = ISO_8859_15;
2155 font_norm_type = OTHER_ENCODING;
2160 string const LyXRC::getDescription(LyXRCTags tag)
2165 case RC_ACCEPT_COMPOUND:
2166 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2170 case RC_USE_ALT_LANG:
2171 str = _("Specify an alternate language. The default is to use the language of the document.");
2174 case RC_ASCIIROFF_COMMAND:
2175 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.");
2178 case RC_ASCII_LINELEN:
2179 str = _("This is the maximum line length of an exported text file (LaTeX, SGML or plain text).");
2182 case RC_AUTOREGIONDELETE:
2183 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2186 case RC_AUTORESET_OPTIONS:
2187 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2191 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2194 case RC_AUTO_NUMBER:
2197 case RC_BACKUPDIR_PATH:
2198 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.");
2201 case RC_BIBTEX_COMMAND:
2202 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2206 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2209 case RC_CHECKLASTFILES:
2210 str = _("Select to check whether the lastfiles still exist.");
2213 case RC_CHKTEX_COMMAND:
2214 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2223 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2224 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.");
2227 case RC_CUSTOM_EXPORT_COMMAND:
2230 case RC_CUSTOM_EXPORT_FORMAT:
2233 case RC_DATE_INSERT_FORMAT:
2234 //xgettext:no-c-format
2235 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2238 case RC_DEFAULT_LANGUAGE:
2239 str = _("New documents will be assigned this language.");
2242 case RC_DEFAULT_PAPERSIZE:
2243 str = _("Specify the default paper size.");
2246 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2247 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2250 case RC_DISPLAY_GRAPHICS:
2251 str = _("Select how LyX will display any graphics.");
2254 case RC_DOCUMENTPATH:
2255 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2259 case RC_USE_ESC_CHARS:
2260 str = _("Specify additional chars that can be part of a word.");
2263 case RC_FONT_ENCODING:
2264 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2270 case RC_INDEX_COMMAND:
2271 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\".");
2278 case RC_KBMAP_PRIMARY:
2279 case RC_KBMAP_SECONDARY:
2280 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.");
2283 case RC_LABEL_INIT_LENGTH:
2284 str = _("Maximum number of words in the initialization string for a new label");
2287 case RC_LANGUAGE_AUTO_BEGIN:
2288 str = _("Select if a language switching command is needed at the beginning of the document.");
2291 case RC_LANGUAGE_AUTO_END:
2292 str = _("Select if a language switching command is needed at the end of the document.");
2295 case RC_LANGUAGE_COMMAND_BEGIN:
2296 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.");
2299 case RC_LANGUAGE_COMMAND_END:
2300 str = _("The LaTeX command for changing back to the language of the document.");
2303 case RC_LANGUAGE_COMMAND_LOCAL:
2304 str = _("The LaTeX command for local changing of the language.");
2307 case RC_LANGUAGE_GLOBAL_OPTIONS:
2308 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2311 case RC_LANGUAGE_PACKAGE:
2312 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2315 case RC_LANGUAGE_USE_BABEL:
2316 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2319 case RC_USELASTFILEPOS:
2320 str = _("De-select if you do not want LyX to scroll to saved position.");
2323 case RC_LOADSESSION:
2324 str = _("De-select to prevent loading files opened from the last lyx session.");
2327 case RC_MAKE_BACKUP:
2328 str = _("De-select if you don't want LyX to create backup files.");
2331 case RC_MARK_FOREIGN_LANGUAGE:
2332 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2335 case RC_NUMLASTFILES:
2336 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2340 case RC_PATH_PREFIX:
2341 str = _("Specify those directories which should be "
2342 "prepended to the PATH environment variable. "
2343 "Use the OS native format.");
2347 case RC_USE_PERS_DICT:
2348 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2351 case RC_POPUP_BOLD_FONT:
2352 str = _("The bold font in the dialogs.");
2355 case RC_POPUP_FONT_ENCODING:
2356 str = _("The encoding for the menu/popups fonts.");
2359 case RC_POPUP_NORMAL_FONT:
2360 str = _("The normal font in the dialogs.");
2364 str = _("Shows a typeset preview of things such as math");
2367 case RC_PREVIEW_HASHED_LABELS:
2368 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2371 case RC_PREVIEW_SCALE_FACTOR:
2372 str = _("Scale the preview size to suit.");
2375 case RC_PRINTCOLLCOPIESFLAG:
2376 str = _("The option for specifying whether the copies should be collated.");
2379 case RC_PRINTCOPIESFLAG:
2380 str = _("The option for specifying the number of copies to print.");
2384 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2387 case RC_PRINTEVENPAGEFLAG:
2388 str = _("The option to print only even pages.");
2391 case RC_PRINTEXSTRAOPTIONS:
2392 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2395 case RC_PRINTFILEEXTENSION:
2396 str = _("Extension of printer program output file. Usually \".ps\".");
2399 case RC_PRINTLANDSCAPEFLAG:
2400 str = _("The option to print out in landscape.");
2403 case RC_PRINTODDPAGEFLAG:
2404 str = _("The option to print only odd pages.");
2407 case RC_PRINTPAGERANGEFLAG:
2408 str = _("The option for specifying a comma-separated list of pages to print.");
2411 case RC_PRINTPAPERDIMENSIONFLAG:
2412 str = _("Option to specify the dimensions of the print paper.");
2415 case RC_PRINTPAPERFLAG:
2416 str = _("The option to specify paper type.");
2419 case RC_PRINTREVERSEFLAG:
2420 str = _("The option to reverse the order of the pages printed.");
2423 case RC_PRINTSPOOL_COMMAND:
2424 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.");
2427 case RC_PRINTSPOOL_PRINTERPREFIX:
2428 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.");
2431 case RC_PRINTTOFILE:
2432 str = _("Option to pass to the print program to print to a file.");
2435 case RC_PRINTTOPRINTER:
2436 str = _("Option to pass to the print program to print on a specific printer.");
2439 case RC_PRINT_ADAPTOUTPUT:
2440 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2443 case RC_PRINT_COMMAND:
2444 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2447 case RC_RTL_SUPPORT:
2448 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2452 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2455 case RC_SCREEN_FONT_ENCODING:
2456 str = _("The encoding for the screen fonts.");
2459 case RC_SCREEN_FONT_ROMAN:
2460 case RC_SCREEN_FONT_SANS:
2461 case RC_SCREEN_FONT_TYPEWRITER:
2462 str = _("The screen fonts used to display the text while editing.");
2465 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2466 case RC_SCREEN_FONT_SANS_FOUNDRY:
2467 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2470 case RC_SCREEN_FONT_SCALABLE:
2471 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.");
2474 case RC_SCREEN_FONT_SIZES:
2475 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2478 case RC_SCREEN_ZOOM:
2479 //xgettext:no-c-format
2480 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2483 case RC_SCREEN_GEOMETRY_HEIGHT:
2484 case RC_SCREEN_GEOMETRY_WIDTH:
2485 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).");
2488 case RC_SCREEN_GEOMETRY_XYSAVED:
2489 str = _("Allow session manager to save and restore windows position.");
2493 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2499 case RC_SHOW_BANNER:
2500 str = _("De-select if you don't want the startup banner.");
2503 case RC_SPELL_COMMAND:
2504 str = _("What command runs the spellchecker?");
2507 case RC_TEMPDIRPATH:
2508 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2511 case RC_TEMPLATEPATH:
2512 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2515 case RC_TEX_ALLOWS_SPACES:
2518 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2522 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2534 case RC_USE_INP_ENC:
2535 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.");
2538 case RC_USE_SPELL_LIB:
2541 case RC_VIEWDVI_PAPEROPTION:
2542 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2557 // The global instance
2560 // The global copy of the system lyxrc entries (everything except preferences)