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::FileName;
52 using support::getEnv;
53 using support::libFileSearch;
67 // when adding something to this array keep it sorted!
68 keyword_item lyxrcTags[] = {
69 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
70 { "\\alternate_language", LyXRC::RC_ALT_LANG },
71 { "\\ascii_linelen", LyXRC::RC_ASCII_LINELEN },
72 { "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
73 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
74 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
75 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
76 { "\\autosave", LyXRC::RC_AUTOSAVE },
77 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
78 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
79 { "\\bind_file", LyXRC::RC_BINDFILE },
80 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
81 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
82 { "\\converter", LyXRC::RC_CONVERTER },
83 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
84 { "\\copier", LyXRC::RC_COPIER },
85 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
86 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
87 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
88 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
89 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
90 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
91 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
92 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
93 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
94 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
95 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
96 { "\\format", LyXRC::RC_FORMAT },
97 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
98 { "\\input", LyXRC::RC_INPUT },
99 { "\\kbmap", LyXRC::RC_KBMAP },
100 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
101 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
102 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
103 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
104 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
105 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
106 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
107 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
108 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
109 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
110 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
111 { "\\load_session", LyXRC::RC_LOADSESSION },
112 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
113 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
114 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
115 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
116 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
117 { "\\popup_bold_font", LyXRC::RC_POPUP_BOLD_FONT },
118 { "\\popup_font_encoding", LyXRC::RC_POPUP_FONT_ENCODING },
119 { "\\popup_normal_font", LyXRC::RC_POPUP_NORMAL_FONT },
120 { "\\preview", LyXRC::RC_PREVIEW },
121 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
122 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
123 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
124 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
125 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
126 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
127 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
128 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
129 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
130 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
131 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
132 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
133 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
134 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
135 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
136 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
137 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
138 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
139 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
140 { "\\printer", LyXRC::RC_PRINTER },
141 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
142 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
143 { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
144 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
145 { "\\screen_font_encoding_menu", LyXRC::RC_POPUP_FONT_ENCODING },
146 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
147 { "\\screen_font_menu", LyXRC::RC_POPUP_BOLD_FONT },
148 // compatibility with versions older than 1.2.0 only Angus 10 Jan 2002
149 { "\\screen_font_popup", LyXRC::RC_POPUP_NORMAL_FONT },
150 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
151 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
152 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
153 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
154 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
155 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
156 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
157 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
158 { "\\screen_geometry_height", LyXRC::RC_SCREEN_GEOMETRY_HEIGHT },
159 { "\\screen_geometry_width", LyXRC::RC_SCREEN_GEOMETRY_WIDTH },
160 { "\\screen_geometry_xysaved", LyXRC::RC_SCREEN_GEOMETRY_XYSAVED },
161 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
162 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
163 { "\\set_color", LyXRC::RC_SET_COLOR },
164 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
165 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
166 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
167 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
168 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
169 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
170 { "\\ui_file", LyXRC::RC_UIFILE },
171 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
172 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
173 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
174 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
175 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
176 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
177 // compatibility with versions older than 1.4.0 only
178 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
179 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
180 // compatibility with versions older than 1.4.0 only
181 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
182 { "\\user_email", LyXRC::RC_USER_EMAIL },
183 { "\\user_name", LyXRC::RC_USER_NAME },
184 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
185 // compatibility with versions older than 1.4.0 only
186 { "\\viewer" ,LyXRC::RC_VIEWER}
189 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
200 void LyXRC::setDefaults() {
203 // Get printer from the environment. If fail, use default "",
204 // assuming that everything is set up correctly.
205 printer = getEnv("PRINTER");
206 print_adapt_output = false;
207 print_command = "dvips";
208 print_evenpage_flag = "-B";
209 print_oddpage_flag = "-A";
210 print_pagerange_flag = "-pp";
211 print_copies_flag = "-c";
212 print_collcopies_flag = "-C";
213 print_reverse_flag = "-r";
214 print_landscape_flag = "-t landscape";
215 print_to_printer = "-P";
216 print_to_file = "-o ";
217 print_file_extension = ".ps";
218 print_paper_flag = "-t";
219 print_paper_dimension_flag = "-T";
220 document_path.erase();
221 view_dvi_paper_option.erase();
222 default_papersize = PAPER_DEFAULT;
223 custom_export_format = "ps";
224 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
225 bibtex_command = "bibtex";
227 index_command = "makeindex -c -q";
229 // Because a screen typically is wider than a piece of paper:
233 geometry_xysaved = true;
234 // Default LaTeX font size:
235 font_sizes[LyXFont::SIZE_TINY] = "5.0";
236 font_sizes[LyXFont::SIZE_SCRIPT] = "7.0";
237 font_sizes[LyXFont::SIZE_FOOTNOTE] = "8.0";
238 font_sizes[LyXFont::SIZE_SMALL] = "9.0";
239 font_sizes[LyXFont::SIZE_NORMAL] = "10.0";
240 font_sizes[LyXFont::SIZE_LARGE] = "12.0";
241 font_sizes[LyXFont::SIZE_LARGER] = "14.4";
242 font_sizes[LyXFont::SIZE_LARGEST] = "17.26";
243 font_sizes[LyXFont::SIZE_HUGE] = "20.74";
244 font_sizes[LyXFont::SIZE_HUGER] = "24.88";
245 use_scalable_fonts = true;
246 roman_font_name = "";
248 typewriter_font_name = "";
249 popup_bold_font = "-*-helvetica-bold-r";
250 popup_normal_font = "-*-helvetica-medium-r";
251 font_norm = "iso8859-1";
252 font_norm_type = ISO_8859_1;
253 popup_font_encoding.erase();
255 auto_region_delete = true;
256 auto_reset_options = false;
258 num_lastfiles = maxlastfiles;
259 check_lastfiles = true;
260 use_lastfilepos = true;
261 load_session = false;
263 backupdir_path.erase();
264 display_graphics = graphics::ColorDisplay;
265 // Spellchecker settings:
266 use_spell_lib = true;
267 isp_command = "ispell";
268 isp_accept_compound = false;
269 isp_use_input_encoding = false;
270 isp_use_alt_lang = false;
271 isp_use_pers_dict = false;
272 isp_use_esc_chars = false;
276 mark_foreign_language = true;
277 language_auto_begin = true;
278 language_auto_end = true;
279 language_global_options = true;
280 language_use_babel = true;
281 language_package = "\\usepackage{babel}";
282 language_command_begin = "\\selectlanguage{$$lang}";
283 language_command_local = "\\foreignlanguage{$$lang}{";
284 default_language = "english";
286 windows_style_tex_paths = false;
287 tex_allows_spaces = false;
288 date_insert_format = "%x";
289 cursor_follows_scrollbar = false;
290 dialogs_iconify_with_main = false;
291 label_init_length = 3;
292 preview = PREVIEW_OFF;
293 preview_hashed_labels = false;
294 preview_scale_factor = "0.9";
295 use_converter_cache = false;
296 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
298 user_name = support::user_name();
300 user_email = support::user_email();
306 void oldFontFormat(string & family, string & foundry)
308 if (family.empty() || family[0] != '-')
310 foundry = token(family, '-', 1);
311 family = token(family, '-', 2);
319 int LyXRC::read(FileName const & filename)
321 LyXLex lexrc(lyxrcTags, lyxrcCount);
322 if (lyxerr.debugging(Debug::PARSER))
323 lexrc.printTable(lyxerr);
325 lexrc.setFile(filename);
326 if (!lexrc.isOK()) return -2;
328 lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
334 int LyXRC::read(std::istream & is)
336 LyXLex lexrc(lyxrcTags, lyxrcCount);
337 if (lyxerr.debugging(Debug::PARSER))
338 lexrc.printTable(lyxerr);
341 if (!lexrc.isOK()) return -2;
343 lyxerr[Debug::LYXRC] << "Reading istream..." << endl;
349 int LyXRC::read(LyXLex & lexrc)
351 if (!lexrc.isOK()) return -2;
353 while (lexrc.isOK()) {
354 // By using two switches we take advantage of the compiler
355 // telling us if we have missed a LyXRCTags element in
356 // the second switch.
357 // Note that this also shows a problem with LyXLex since it
358 // helps us avoid taking advantage of the strictness of the
361 int le = lexrc.lex();
363 case LyXLex::LEX_UNDEF:
364 lexrc.printError("Unknown tag `$$Token'");
366 case LyXLex::LEX_FEOF:
370 switch (static_cast<LyXRCTags>(le)) {
371 case RC_INPUT: // Include file
374 libFileSearch(string(),
377 lexrc.printError("Error reading "
378 "included file: " + tmp.absFilename());
384 bind_file = os::internal_path(lexrc.getString());
390 ui_file = os::internal_path(lexrc.getString());
394 case RC_AUTORESET_OPTIONS:
396 auto_reset_options = lexrc.getBool();
400 case RC_DISPLAY_GRAPHICS:
402 display_graphics = graphics::displayTranslator().find(lexrc.getString());
406 case RC_TEX_EXPECTS_WINDOWS_PATHS:
408 windows_style_tex_paths = lexrc.getBool();
412 case RC_TEX_ALLOWS_SPACES:
414 tex_allows_spaces = lexrc.getBool();
420 use_kbmap = lexrc.getBool();
424 case RC_KBMAP_PRIMARY:
426 string const kmap(os::internal_path(lexrc.getString()));
429 } else if (!libFileSearch("kbd", kmap,
431 primary_kbmap = kmap;
433 lexrc.printError("LyX: Keymap `$$Token' not found");
438 case RC_KBMAP_SECONDARY:
440 string const kmap(os::internal_path(lexrc.getString()));
443 } else if (!libFileSearch("kbd", kmap,
445 secondary_kbmap = kmap;
447 lexrc.printError("LyX: Keymap `$$Token' not found");
452 case RC_FONT_ENCODING:
454 fontenc = lexrc.getString();
460 printer = lexrc.getString();
464 case RC_PRINT_COMMAND:
466 print_command = lexrc.getString();
470 case RC_PRINTEVENPAGEFLAG:
472 print_evenpage_flag = lexrc.getString();
476 case RC_PRINTODDPAGEFLAG:
478 print_oddpage_flag = lexrc.getString();
482 case RC_PRINTPAGERANGEFLAG:
484 print_pagerange_flag = lexrc.getString();
488 case RC_PRINTCOPIESFLAG:
490 print_copies_flag = lexrc.getString();
494 case RC_PRINTCOLLCOPIESFLAG:
496 print_collcopies_flag = lexrc.getString();
500 case RC_PRINTREVERSEFLAG:
502 print_reverse_flag = lexrc.getString();
506 case RC_PRINTLANDSCAPEFLAG:
508 print_landscape_flag = lexrc.getString();
512 case RC_PRINTTOPRINTER:
514 print_to_printer = lexrc.getString();
518 case RC_PRINT_ADAPTOUTPUT:
520 print_adapt_output = lexrc.getBool();
526 print_to_file = os::internal_path(lexrc.getString());
530 case RC_PRINTFILEEXTENSION:
532 print_file_extension = lexrc.getString();
536 case RC_PRINTEXSTRAOPTIONS:
538 print_extra_options = lexrc.getString();
542 case RC_PRINTSPOOL_COMMAND:
544 print_spool_command = lexrc.getString();
548 case RC_PRINTSPOOL_PRINTERPREFIX:
550 print_spool_printerprefix = lexrc.getString();
554 case RC_PRINTPAPERDIMENSIONFLAG:
556 print_paper_dimension_flag = lexrc.getString();
560 case RC_PRINTPAPERFLAG:
562 print_paper_flag = lexrc.getString();
566 case RC_CUSTOM_EXPORT_COMMAND:
568 custom_export_command = lexrc.getString();
572 case RC_CUSTOM_EXPORT_FORMAT:
574 custom_export_format = lexrc.getString();
578 case RC_DEFAULT_PAPERSIZE:
581 ascii_lowercase(lexrc.getString());
582 if (size == "usletter")
585 else if (size == "legal")
588 else if (size == "executive")
591 else if (size == "a3")
594 else if (size == "a4")
597 else if (size == "a5")
600 else if (size == "b5")
603 else if (size == "default")
609 case RC_VIEWDVI_PAPEROPTION:
611 view_dvi_paper_option = lexrc.getString();
613 view_dvi_paper_option.erase();
617 case RC_CHKTEX_COMMAND:
619 chktex_command = lexrc.getString();
623 case RC_BIBTEX_COMMAND:
625 bibtex_command = lexrc.getString();
629 case RC_INDEX_COMMAND:
631 index_command = lexrc.getString();
637 dpi = lexrc.getInteger();
643 zoom = lexrc.getInteger();
647 case RC_SCREEN_GEOMETRY_HEIGHT:
649 geometry_height = lexrc.getInteger();
653 case RC_SCREEN_GEOMETRY_WIDTH:
655 geometry_width = lexrc.getInteger();
659 case RC_SCREEN_GEOMETRY_XYSAVED:
661 geometry_xysaved = lexrc.getBool();
665 case RC_SCREEN_FONT_SIZES:
667 font_sizes[LyXFont::SIZE_TINY] =
671 font_sizes[LyXFont::SIZE_SCRIPT] =
675 font_sizes[LyXFont::SIZE_FOOTNOTE] =
679 font_sizes[LyXFont::SIZE_SMALL] =
683 font_sizes[LyXFont::SIZE_NORMAL] =
687 font_sizes[LyXFont::SIZE_LARGE] =
691 font_sizes[LyXFont::SIZE_LARGER] =
695 font_sizes[LyXFont::SIZE_LARGEST] =
699 font_sizes[LyXFont::SIZE_HUGE] =
703 font_sizes[LyXFont::SIZE_HUGER] =
708 case RC_SCREEN_FONT_SCALABLE:
710 use_scalable_fonts = lexrc.getBool();
716 autosave = lexrc.getInteger();
720 case RC_DOCUMENTPATH:
722 document_path = os::internal_path(lexrc.getString());
723 document_path = expandPath(document_path);
727 case RC_TEMPLATEPATH:
729 template_path = os::internal_path(lexrc.getString());
730 template_path = expandPath(template_path);
736 tempdir_path = os::internal_path(lexrc.getString());
737 tempdir_path = expandPath(tempdir_path);
743 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
747 case RC_USELASTFILEPOS:
749 use_lastfilepos = lexrc.getBool();
755 load_session = lexrc.getBool();
759 case RC_NUMLASTFILES:
761 num_lastfiles = lexrc.getInteger();
765 case RC_CHECKLASTFILES:
767 check_lastfiles = lexrc.getBool();
771 case RC_SCREEN_FONT_ROMAN:
773 roman_font_name = lexrc.getString();
774 oldFontFormat(roman_font_name,
779 case RC_SCREEN_FONT_SANS:
781 sans_font_name = lexrc.getString();
782 oldFontFormat(sans_font_name, sans_font_foundry);
786 case RC_SCREEN_FONT_TYPEWRITER:
788 typewriter_font_name = lexrc.getString();
789 oldFontFormat(typewriter_font_name,
790 typewriter_font_foundry);
794 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
796 roman_font_foundry = lexrc.getString();
800 case RC_SCREEN_FONT_SANS_FOUNDRY:
802 sans_font_foundry = lexrc.getString();
806 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
808 typewriter_font_foundry = lexrc.getString();
812 case RC_SCREEN_FONT_ENCODING:
814 font_norm = lexrc.getString();
815 set_font_norm_type();
819 case RC_POPUP_BOLD_FONT:
821 popup_bold_font = lexrc.getString();
825 case RC_POPUP_NORMAL_FONT:
827 popup_normal_font = lexrc.getString();
831 case RC_POPUP_FONT_ENCODING:
833 popup_font_encoding = lexrc.getString();
839 string lyx_name, x11_name;
842 lyx_name = lexrc.getString();
844 lexrc.printError("Missing color tag.");
849 x11_name = lexrc.getString();
851 lexrc.printError("Missing color name for color: `$$Token'");
855 LColor::color const col =
856 lcolor.getFromLyXName(lyx_name);
857 if (col == LColor::none ||
858 col == LColor::inherit ||
859 col == LColor::ignore)
862 if (!lcolor.setColor(col, x11_name)) {
863 lyxerr << "Bad lyxrc set_color for "
869 case RC_AUTOREGIONDELETE:
870 // Auto region delete defaults to true
872 auto_region_delete = lexrc.getBool();
878 lyxpipes = os::internal_path(lexrc.getString());
879 lyxpipes = expandPath(lyxpipes);
883 case RC_CURSOR_FOLLOWS_SCROLLBAR:
885 cursor_follows_scrollbar = lexrc.getBool();
889 case RC_DIALOGS_ICONIFY_WITH_MAIN:
891 dialogs_iconify_with_main = lexrc.getBool();
895 case RC_ASCIIROFF_COMMAND:
897 ascii_roff_command = lexrc.getString();
900 case RC_ASCII_LINELEN:
902 ascii_linelen = lexrc.getInteger();
905 // Spellchecker settings:
906 case RC_USE_SPELL_LIB:
908 use_spell_lib = lexrc.getBool();
911 case RC_SPELL_COMMAND:
913 isp_command = lexrc.getString();
916 case RC_ACCEPT_COMPOUND:
918 isp_accept_compound = lexrc.getBool();
923 isp_use_input_encoding = lexrc.getBool();
926 case RC_USE_ALT_LANG:
928 isp_use_alt_lang = lexrc.getBool();
931 case RC_USE_PERS_DICT:
933 isp_use_pers_dict = lexrc.getBool();
936 case RC_USE_ESC_CHARS:
938 isp_use_esc_chars = lexrc.getBool();
943 isp_alt_lang = lexrc.getString();
948 isp_pers_dict = os::internal_path(lexrc.getString());
953 isp_esc_chars = lexrc.getString();
958 make_backup = lexrc.getBool();
961 case RC_BACKUPDIR_PATH:
963 backupdir_path = os::internal_path(lexrc.getString());
964 backupdir_path = expandPath(backupdir_path);
967 case RC_DATE_INSERT_FORMAT:
969 date_insert_format = lexrc.getString();
972 case RC_LANGUAGE_PACKAGE:
974 language_package = lexrc.getString();
977 case RC_LANGUAGE_AUTO_BEGIN:
979 language_auto_begin = lexrc.getBool();
982 case RC_LANGUAGE_AUTO_END:
984 language_auto_end = lexrc.getBool();
987 case RC_LANGUAGE_GLOBAL_OPTIONS:
989 language_global_options = lexrc.getBool();
992 case RC_LANGUAGE_USE_BABEL:
994 language_use_babel = lexrc.getBool();
997 case RC_LANGUAGE_COMMAND_BEGIN:
999 language_command_begin = lexrc.getString();
1002 case RC_LANGUAGE_COMMAND_END:
1004 language_command_end = lexrc.getString();
1007 case RC_LANGUAGE_COMMAND_LOCAL:
1009 language_command_local = lexrc.getString();
1012 case RC_RTL_SUPPORT:
1014 rtl_support = lexrc.getBool();
1017 case RC_AUTO_NUMBER:
1019 auto_number = lexrc.getBool();
1022 case RC_MARK_FOREIGN_LANGUAGE:
1024 mark_foreign_language = lexrc.getBool();
1029 string fmt, command;
1031 fmt = lexrc.getString();
1034 command = lexrc.getString();
1036 movers.set(fmt, command);
1040 case RC_CONVERTER: {
1041 string from, to, command, flags;
1043 from = lexrc.getString();
1046 to = lexrc.getString();
1049 command = lexrc.getString();
1052 flags = lexrc.getString();
1054 if (command.empty()) {
1055 converters.erase(from, to);
1057 converters.add(from, to, command, flags);
1061 // compatibility with versions older than 1.4.0 only
1063 string format, command;
1065 format = lexrc.getString();
1068 command = lexrc.getString();
1070 formats.setViewer(format, command);
1074 string format, extension, prettyname, shortcut;
1076 format = lexrc.getString();
1079 extension = lexrc.getString();
1082 prettyname = lexrc.getString();
1085 shortcut = lexrc.getString();
1087 string viewer, editor;
1089 viewer = lexrc.getString();
1091 editor = lexrc.getString();
1093 // Hack to ensure compatibility with versions older
1095 int le = lexrc.lex();
1096 if (le != LyXLex::LEX_FEOF && le != LyXLex::LEX_UNDEF) {
1097 flags = lexrc.getString();
1098 if (le != LyXLex::LEX_DATA) {
1099 // We have got a known token.
1100 // Therefore this is an old style
1101 // format definition without
1103 lexrc.pushToken(flags);
1107 int flgs = Format::none;
1108 while (!flags.empty()) {
1110 flags = support::split(flags, flag, ',');
1111 if (flag == "document")
1112 flgs |= Format::document;
1113 else if (flag == "vector")
1114 flgs |= Format::vector;
1116 lyxerr << "Ignoring unknown flag `"
1117 << flag << "' for format `"
1118 << format << "'." << endl;
1120 if (prettyname.empty()) {
1121 if (converters.formatIsUsed(format)) {
1122 lyxerr << "Can't delete format "
1125 formats.erase(format);
1128 formats.add(format, extension, prettyname,
1129 shortcut, viewer, editor, flgs);
1133 case RC_DEFAULT_LANGUAGE:
1135 default_language = lexrc.getString();
1139 case RC_LABEL_INIT_LENGTH:
1141 label_init_length = lexrc.getInteger();
1145 case RC_SHOW_BANNER:
1147 show_banner = lexrc.getBool();
1153 string const tmp = lexrc.getString();
1154 if (tmp == "true" || tmp == "on")
1155 preview = PREVIEW_ON;
1156 else if (tmp == "no_math")
1157 preview = PREVIEW_NO_MATH;
1159 preview = PREVIEW_OFF;
1160 if (tmp != "false" && tmp != "off")
1161 lyxerr << "Unrecognized "
1163 << tmp << '\n' << endl;
1168 case RC_PREVIEW_HASHED_LABELS:
1170 preview_hashed_labels = lexrc.getBool();
1174 case RC_PREVIEW_SCALE_FACTOR:
1176 preview_scale_factor = lexrc.getString();
1182 user_name = lexrc.getString();
1187 user_email = lexrc.getString();
1190 case RC_PATH_PREFIX:
1192 path_prefix = lexrc.getString();
1195 case RC_USE_CONVERTER_CACHE:
1197 use_converter_cache = lexrc.getBool();
1200 case RC_CONVERTER_CACHE_MAXAGE:
1202 converter_cache_maxage =
1203 convert<unsigned int>(lexrc.getString());
1206 case RC_LAST: break; // this is just a dummy
1210 /// Update converters data-structures
1211 converters.update(formats);
1212 converters.buildGraph();
1218 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1220 ofstream ofs(filename.toFilesystemEncoding().c_str());
1222 write(ofs, ignore_system_lyxrc);
1226 void LyXRC::print() const
1228 if (lyxerr.debugging())
1229 write(lyxerr, false);
1237 typedef std::pair<std::string, SpecialisedMover> Data;
1239 SameMover(Data const & comparison)
1240 : comparison_(comparison) {}
1242 bool operator()(Data const & data) const
1244 return data.first == comparison_.first &&
1245 data.second.command() == comparison_.second.command();
1253 void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const
1255 os << "### This file is part of\n"
1256 << "### ========================================================\n"
1257 << "### LyX, The Document Processor\n"
1259 << "### Copyright 1995 Matthias Ettrich\n"
1260 << "### Copyright 1995-2001 The LyX Team.\n"
1262 << "### ========================================================\n"
1264 << "# This file is written by LyX, if you want to make your own\n"
1265 << "# modifications you should do them from inside LyX and save\n"
1268 // Why the switch you might ask. It is a trick to ensure that all
1269 // the elements in the LyXRCTags enum is handled. As you can see
1270 // there are no breaks at all. So it is just a huge fall-through.
1271 // The nice thing is that we will get a warning from the compiler
1272 // if we forget an element.
1273 LyXRCTags tag = RC_LAST;
1277 // input/include files are not done here
1279 if (ignore_system_lyxrc ||
1280 bind_file != system_lyxrc.bind_file) {
1281 string const path = os::external_path(bind_file);
1282 os << "\\bind_file \"" << path << "\"\n";
1288 << "# MISC SECTION ######################################\n"
1291 // bind files are not done here.
1293 case RC_PATH_PREFIX:
1294 if (ignore_system_lyxrc ||
1295 path_prefix != system_lyxrc.path_prefix) {
1296 os << "\\path_prefix \"" << path_prefix << "\"\n";
1300 if (ignore_system_lyxrc ||
1301 ui_file != system_lyxrc.ui_file) {
1302 string const path = os::external_path(ui_file);
1303 os << "\\ui_file \"" << path << "\"\n";
1305 case RC_AUTOREGIONDELETE:
1306 if (ignore_system_lyxrc ||
1307 auto_region_delete != system_lyxrc.auto_region_delete) {
1308 os << "# Set to false to inhibit automatic replacement of\n"
1309 << "# the current selection.\n"
1310 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1313 case RC_AUTORESET_OPTIONS:
1314 if (ignore_system_lyxrc ||
1315 auto_reset_options != system_lyxrc.auto_reset_options) {
1316 os << "# Set to false to inhibit automatic reset of\n"
1317 << "# the class options to defaults on class change.\n"
1318 << "\\auto_reset_options "
1319 << convert<string>(auto_reset_options)
1323 if (ignore_system_lyxrc ||
1324 autosave != system_lyxrc.autosave) {
1325 os << "# The time interval between auto-saves in seconds.\n"
1326 << "\\autosave " << autosave << '\n';
1328 case RC_DISPLAY_GRAPHICS:
1329 if (ignore_system_lyxrc ||
1330 display_graphics != system_lyxrc.display_graphics) {
1331 os << "# Display graphics within LyX\n"
1332 << "# monochrome|grayscale|color|none\n"
1333 << "\\display_graphics "
1334 << graphics::displayTranslator().find(display_graphics)
1338 case RC_VIEWDVI_PAPEROPTION:
1339 if (ignore_system_lyxrc ||
1340 view_dvi_paper_option
1341 != system_lyxrc.view_dvi_paper_option) {
1342 os << "# Options used to specify paper size to the\n"
1343 << "# view_dvi_command (e.g. -paper)\n"
1344 << "\\view_dvi_paper_option \""
1345 << view_dvi_paper_option << "\"\n";
1347 case RC_DEFAULT_PAPERSIZE:
1348 if (ignore_system_lyxrc ||
1349 default_papersize != system_lyxrc.default_papersize) {
1350 os << "# The default papersize to use.\n"
1351 << "\\default_papersize \"";
1352 switch (default_papersize) {
1354 os << "default"; break;
1355 case PAPER_USLETTER:
1356 os << "usletter"; break;
1358 os << "legal"; break;
1359 case PAPER_USEXECUTIVE:
1360 os << "executive"; break;
1371 case PAPER_B4: break;
1375 case RC_CHKTEX_COMMAND:
1376 if (ignore_system_lyxrc ||
1377 chktex_command != system_lyxrc.chktex_command) {
1378 os << "\\chktex_command \"" << chktex_command << "\"\n";
1380 case RC_BIBTEX_COMMAND:
1381 if (ignore_system_lyxrc ||
1382 bibtex_command != system_lyxrc.bibtex_command) {
1383 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1385 case RC_INDEX_COMMAND:
1386 if (ignore_system_lyxrc ||
1387 index_command != system_lyxrc.index_command) {
1388 os << "\\index_command \"" << index_command << "\"\n";
1390 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1391 if (ignore_system_lyxrc ||
1392 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1393 os << "\\tex_expects_windows_paths "
1394 << convert<string>(windows_style_tex_paths) << '\n';
1396 case RC_TEX_ALLOWS_SPACES:
1397 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1398 os << "\\tex_allows_spaces "
1399 << convert<string>(tex_allows_spaces) << '\n';
1402 if (ignore_system_lyxrc ||
1403 use_kbmap != system_lyxrc.use_kbmap) {
1404 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1406 case RC_KBMAP_PRIMARY:
1407 if (ignore_system_lyxrc ||
1408 primary_kbmap != system_lyxrc.primary_kbmap) {
1409 string const path = os::external_path(primary_kbmap);
1410 os << "\\kbmap_primary \"" << path << "\"\n";
1412 case RC_KBMAP_SECONDARY:
1413 if (ignore_system_lyxrc ||
1414 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1415 string const path = os::external_path(secondary_kbmap);
1416 os << "\\kbmap_secondary \"" << path << "\"\n";
1419 if (ignore_system_lyxrc ||
1420 lyxpipes != system_lyxrc.lyxpipes) {
1421 string const path = os::external_path(lyxpipes);
1422 os << "\\serverpipe \"" << path << "\"\n";
1424 case RC_DATE_INSERT_FORMAT:
1425 if (ignore_system_lyxrc ||
1426 date_insert_format != system_lyxrc.date_insert_format) {
1427 os << "\\date_insert_format \"" << date_insert_format
1430 case RC_LABEL_INIT_LENGTH:
1431 if (ignore_system_lyxrc ||
1432 label_init_length != system_lyxrc.label_init_length) {
1433 os << "\\label_init_length " << label_init_length
1438 os << "\\user_name \"" << user_name << "\"\n";
1441 os << "\\user_email \"" << user_email << "\"\n";
1443 case RC_SHOW_BANNER:
1444 if (ignore_system_lyxrc ||
1445 show_banner != system_lyxrc.show_banner) {
1446 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1450 if (ignore_system_lyxrc ||
1451 preview != system_lyxrc.preview) {
1457 case PREVIEW_NO_MATH:
1464 os << "\\preview " << status << '\n';
1467 case RC_PREVIEW_HASHED_LABELS:
1468 if (ignore_system_lyxrc ||
1469 preview_hashed_labels !=
1470 system_lyxrc.preview_hashed_labels) {
1471 os << "\\preview_hashed_labels "
1472 << convert<string>(preview_hashed_labels) << '\n';
1475 case RC_PREVIEW_SCALE_FACTOR:
1476 if (ignore_system_lyxrc ||
1477 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1478 os << "\\preview_scale_factor "
1479 << preview_scale_factor << '\n';
1482 case RC_USE_CONVERTER_CACHE:
1483 if (ignore_system_lyxrc ||
1484 use_converter_cache != system_lyxrc.use_converter_cache) {
1485 os << "\\use_converter_cache "
1486 << convert<string>(use_converter_cache) << '\n';
1489 case RC_CONVERTER_CACHE_MAXAGE:
1490 if (ignore_system_lyxrc ||
1491 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1492 os << "\\converter_cache_maxage "
1493 << converter_cache_maxage << '\n';
1497 << "# SCREEN & FONTS SECTION ############################\n"
1500 case RC_POPUP_NORMAL_FONT:
1501 if (ignore_system_lyxrc ||
1502 popup_normal_font != system_lyxrc.popup_normal_font) {
1503 os << "\\popup_normal_font \"" << popup_normal_font
1506 case RC_POPUP_BOLD_FONT:
1507 if (ignore_system_lyxrc ||
1508 popup_bold_font != system_lyxrc.popup_bold_font) {
1509 os << "\\popup_bold_font \"" << popup_bold_font
1512 case RC_POPUP_FONT_ENCODING:
1513 if (ignore_system_lyxrc ||
1514 popup_font_encoding != system_lyxrc.popup_font_encoding) {
1515 os << "\\popup_font_encoding \"" << popup_font_encoding
1519 if (ignore_system_lyxrc ||
1520 dpi != system_lyxrc.dpi) {
1521 os << "\\screen_dpi " << dpi << '\n';
1523 case RC_SCREEN_ZOOM:
1524 if (ignore_system_lyxrc ||
1525 zoom != system_lyxrc.zoom) {
1526 os << "\\screen_zoom " << zoom << '\n';
1528 case RC_SCREEN_GEOMETRY_HEIGHT:
1529 if (ignore_system_lyxrc ||
1530 geometry_height != system_lyxrc.geometry_height) {
1531 os << "\\screen_geometry_height " << geometry_height
1534 case RC_SCREEN_GEOMETRY_WIDTH:
1535 if (ignore_system_lyxrc ||
1536 geometry_width != system_lyxrc.geometry_width) {
1537 os << "\\screen_geometry_width " << geometry_width
1540 case RC_SCREEN_GEOMETRY_XYSAVED:
1541 if (ignore_system_lyxrc ||
1542 geometry_xysaved != system_lyxrc.geometry_xysaved) {
1543 os << "\\screen_geometry_xysaved " << convert<string>(geometry_xysaved)
1546 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1547 if (ignore_system_lyxrc ||
1548 cursor_follows_scrollbar
1549 != system_lyxrc.cursor_follows_scrollbar) {
1550 os << "\\cursor_follows_scrollbar "
1551 << convert<string>(cursor_follows_scrollbar) << '\n';
1553 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1554 if (ignore_system_lyxrc ||
1555 dialogs_iconify_with_main
1556 != system_lyxrc.dialogs_iconify_with_main) {
1557 os << "\\dialogs_iconify_with_main "
1558 << convert<string>(dialogs_iconify_with_main) << '\n';
1560 case RC_SCREEN_FONT_ROMAN:
1561 if (ignore_system_lyxrc ||
1562 roman_font_name != system_lyxrc.roman_font_name) {
1563 os << "\\screen_font_roman \"" << roman_font_name
1566 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1567 if (ignore_system_lyxrc ||
1568 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1569 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1572 case RC_SCREEN_FONT_SANS:
1573 if (ignore_system_lyxrc ||
1574 sans_font_name != system_lyxrc.sans_font_name) {
1575 os << "\\screen_font_sans \"" << sans_font_name
1578 case RC_SCREEN_FONT_SANS_FOUNDRY:
1579 if (ignore_system_lyxrc ||
1580 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1581 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1584 case RC_SCREEN_FONT_TYPEWRITER:
1585 if (ignore_system_lyxrc ||
1586 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1587 os << "\\screen_font_typewriter \""
1588 << typewriter_font_name << "\"\n";
1590 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1591 if (ignore_system_lyxrc ||
1592 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1593 os << "\\screen_font_typewriter_foundry \""
1594 << typewriter_font_foundry << "\"\n";
1597 case RC_SCREEN_FONT_SCALABLE:
1598 if (ignore_system_lyxrc ||
1599 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1600 os << "\\screen_font_scalable "
1601 << convert<string>(use_scalable_fonts)
1604 case RC_SCREEN_FONT_ENCODING:
1605 if (ignore_system_lyxrc ||
1606 font_norm != system_lyxrc.font_norm) {
1607 os << "\\screen_font_encoding \"" << font_norm
1610 case RC_SCREEN_FONT_SIZES:
1611 if (ignore_system_lyxrc ||
1612 font_sizes[LyXFont::SIZE_TINY]
1613 != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1614 font_sizes[LyXFont::SIZE_SCRIPT]
1615 != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1616 font_sizes[LyXFont::SIZE_FOOTNOTE]
1617 != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1618 font_sizes[LyXFont::SIZE_SMALL]
1619 != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1620 font_sizes[LyXFont::SIZE_NORMAL]
1621 != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1622 font_sizes[LyXFont::SIZE_LARGE]
1623 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1624 font_sizes[LyXFont::SIZE_LARGER]
1625 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1626 font_sizes[LyXFont::SIZE_LARGEST]
1627 != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1628 font_sizes[LyXFont::SIZE_HUGE]
1629 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1630 font_sizes[LyXFont::SIZE_HUGER]
1631 != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1632 os.setf(ios::fixed);
1634 os << "\\screen_font_sizes"
1635 << ' ' << font_sizes[LyXFont::SIZE_TINY]
1636 << ' ' << font_sizes[LyXFont::SIZE_SCRIPT]
1637 << ' ' << font_sizes[LyXFont::SIZE_FOOTNOTE]
1638 << ' ' << font_sizes[LyXFont::SIZE_SMALL]
1639 << ' ' << font_sizes[LyXFont::SIZE_NORMAL]
1640 << ' ' << font_sizes[LyXFont::SIZE_LARGE]
1641 << ' ' << font_sizes[LyXFont::SIZE_LARGER]
1642 << ' ' << font_sizes[LyXFont::SIZE_LARGEST]
1643 << ' ' << font_sizes[LyXFont::SIZE_HUGE]
1644 << ' ' << font_sizes[LyXFont::SIZE_HUGER]
1649 << "# COLOR SECTION ###################################\n"
1653 for (int i = 0; i < LColor::ignore; ++i) {
1654 LColor::color lc = static_cast<LColor::color>(i);
1656 string const col(lcolor.getX11Name(lc));
1657 if (ignore_system_lyxrc ||
1658 col != system_lcolor.getX11Name(lc)) {
1659 os << "\\set_color \""
1660 << lcolor.getLyXName(lc) << "\" \""
1666 << "# PRINTER SECTION ###################################\n"
1670 if (ignore_system_lyxrc ||
1671 printer != system_lyxrc.printer) {
1672 os << "\\printer \"" << printer << "\"\n";
1674 case RC_PRINT_ADAPTOUTPUT:
1675 if (ignore_system_lyxrc ||
1676 print_adapt_output != system_lyxrc.print_adapt_output) {
1677 os << "\\print_adapt_output "
1678 << convert<string>(print_adapt_output)
1681 case RC_PRINT_COMMAND:
1682 if (ignore_system_lyxrc ||
1683 print_command != system_lyxrc.print_command) {
1684 os << "\\print_command \"" << print_command << "\"\n";
1686 case RC_PRINTEXSTRAOPTIONS:
1687 if (ignore_system_lyxrc ||
1688 print_extra_options != system_lyxrc.print_extra_options) {
1689 os << "\\print_extra_options \"" << print_extra_options
1692 case RC_PRINTSPOOL_COMMAND:
1693 if (ignore_system_lyxrc ||
1694 print_spool_command != system_lyxrc.print_spool_command) {
1695 os << "\\print_spool_command \"" << print_spool_command
1698 case RC_PRINTSPOOL_PRINTERPREFIX:
1699 if (ignore_system_lyxrc ||
1700 print_spool_printerprefix
1701 != system_lyxrc.print_spool_printerprefix) {
1702 os << "\\print_spool_printerprefix \""
1703 << print_spool_printerprefix << "\"\n";
1705 case RC_PRINTEVENPAGEFLAG:
1706 if (ignore_system_lyxrc ||
1707 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1708 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1711 case RC_PRINTODDPAGEFLAG:
1712 if (ignore_system_lyxrc ||
1713 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1714 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1717 case RC_PRINTREVERSEFLAG:
1718 if (ignore_system_lyxrc ||
1719 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1720 os << "\\print_reverse_flag \"" << print_reverse_flag
1723 case RC_PRINTLANDSCAPEFLAG:
1724 if (ignore_system_lyxrc ||
1725 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1726 os << "\\print_landscape_flag \"" << print_landscape_flag
1729 case RC_PRINTPAGERANGEFLAG:
1730 if (ignore_system_lyxrc ||
1731 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1732 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1735 case RC_PRINTCOPIESFLAG:
1736 if (ignore_system_lyxrc ||
1737 print_copies_flag != system_lyxrc.print_copies_flag) {
1738 os << "\\print_copies_flag \"" << print_copies_flag
1741 case RC_PRINTCOLLCOPIESFLAG:
1742 if (ignore_system_lyxrc ||
1743 print_collcopies_flag
1744 != system_lyxrc.print_collcopies_flag) {
1745 os << "\\print_collcopies_flag \""
1746 << print_collcopies_flag
1749 case RC_PRINTPAPERFLAG:
1750 if (ignore_system_lyxrc ||
1751 print_paper_flag != system_lyxrc.print_paper_flag) {
1752 os << "\\print_paper_flag \"" << print_paper_flag
1755 case RC_PRINTPAPERDIMENSIONFLAG:
1756 if (ignore_system_lyxrc ||
1757 print_paper_dimension_flag
1758 != system_lyxrc.print_paper_dimension_flag) {
1759 os << "\\print_paper_dimension_flag \""
1760 << print_paper_dimension_flag << "\"\n";
1762 case RC_PRINTTOPRINTER:
1763 if (ignore_system_lyxrc ||
1764 print_to_printer != system_lyxrc.print_to_printer) {
1765 os << "\\print_to_printer \"" << print_to_printer
1768 case RC_PRINTTOFILE:
1769 if (ignore_system_lyxrc ||
1770 print_to_file != system_lyxrc.print_to_file) {
1771 string const path = os::external_path(print_to_file);
1772 os << "\\print_to_file \"" << path << "\"\n";
1774 case RC_PRINTFILEEXTENSION:
1775 if (ignore_system_lyxrc ||
1776 print_file_extension != system_lyxrc.print_file_extension) {
1777 os << "\\print_file_extension \""
1778 << print_file_extension
1783 << "# EXPORT SECTION ####################################\n"
1786 case RC_CUSTOM_EXPORT_COMMAND:
1787 if (ignore_system_lyxrc ||
1788 custom_export_command
1789 != system_lyxrc.custom_export_command) {
1790 os << "\\custom_export_command \""
1791 << custom_export_command
1794 case RC_CUSTOM_EXPORT_FORMAT:
1795 if (ignore_system_lyxrc ||
1796 custom_export_format
1797 != system_lyxrc.custom_export_format) {
1798 os << "\\custom_export_format \"" << custom_export_format
1803 << "# TEX SECTION #######################################\n"
1806 case RC_FONT_ENCODING:
1807 if (ignore_system_lyxrc ||
1808 fontenc != system_lyxrc.fontenc) {
1809 os << "\\font_encoding \"" << fontenc << "\"\n";
1813 << "# FILE SECTION ######################################\n"
1816 case RC_DOCUMENTPATH:
1817 if (ignore_system_lyxrc ||
1818 document_path != system_lyxrc.document_path) {
1819 string const path = os::external_path(document_path);
1820 os << "\\document_path \"" << path << "\"\n";
1822 case RC_USELASTFILEPOS:
1823 if (ignore_system_lyxrc ||
1824 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1825 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1828 case RC_LOADSESSION:
1829 if (ignore_system_lyxrc ||
1830 load_session != system_lyxrc.load_session) {
1831 os << "\\load_session " << convert<string>(load_session)
1834 case RC_NUMLASTFILES:
1835 if (ignore_system_lyxrc ||
1836 num_lastfiles != system_lyxrc.num_lastfiles) {
1837 os << "\\num_lastfiles " << num_lastfiles << '\n';
1839 case RC_CHECKLASTFILES:
1840 if (ignore_system_lyxrc ||
1841 check_lastfiles != system_lyxrc.check_lastfiles) {
1842 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
1845 case RC_TEMPLATEPATH:
1846 if (ignore_system_lyxrc ||
1847 template_path != system_lyxrc.template_path) {
1848 string const path = os::external_path(template_path);
1849 os << "\\template_path \"" << path << "\"\n";
1851 case RC_TEMPDIRPATH:
1852 if (ignore_system_lyxrc ||
1853 tempdir_path != system_lyxrc.tempdir_path) {
1854 string const path = os::external_path(tempdir_path);
1855 os << "\\tempdir_path \"" << path << "\"\n";
1859 case RC_ASCII_LINELEN:
1860 if (ignore_system_lyxrc ||
1861 ascii_linelen != system_lyxrc.ascii_linelen) {
1862 os << "\\ascii_linelen " << ascii_linelen << '\n';
1864 case RC_MAKE_BACKUP:
1865 if (ignore_system_lyxrc ||
1866 make_backup != system_lyxrc.make_backup) {
1867 os << "\\make_backup " << convert<string>(make_backup) << '\n';
1869 case RC_BACKUPDIR_PATH:
1870 if (ignore_system_lyxrc ||
1871 backupdir_path != system_lyxrc.backupdir_path) {
1872 string const path = os::external_path(backupdir_path);
1873 os << "\\backupdir_path \"" << path << "\"\n";
1877 << "# ASCII EXPORT SECTION ##############################\n"
1880 case RC_ASCIIROFF_COMMAND:
1881 if (ignore_system_lyxrc ||
1882 ascii_roff_command != system_lyxrc.ascii_roff_command) {
1883 os << "\\ascii_roff_command \"" << ascii_roff_command
1888 << "# SPELLCHECKER SECTION ##############################\n"
1890 case RC_USE_SPELL_LIB:
1891 if (ignore_system_lyxrc ||
1892 use_spell_lib != system_lyxrc.use_spell_lib) {
1893 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
1895 case RC_SPELL_COMMAND:
1896 if (ignore_system_lyxrc ||
1897 isp_command != system_lyxrc.isp_command) {
1898 os << "\\spell_command \"" << isp_command << "\"\n";
1900 case RC_ACCEPT_COMPOUND:
1901 if (ignore_system_lyxrc ||
1902 isp_accept_compound != system_lyxrc.isp_accept_compound) {
1903 os << "\\accept_compound " << convert<string>(isp_accept_compound)
1906 case RC_USE_ALT_LANG:
1907 if (ignore_system_lyxrc ||
1908 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1909 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
1913 if (ignore_system_lyxrc ||
1914 isp_alt_lang != system_lyxrc.isp_alt_lang) {
1915 os << "\\alternate_language \"" << isp_alt_lang
1918 case RC_USE_ESC_CHARS:
1919 if (ignore_system_lyxrc ||
1920 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1921 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
1925 if (ignore_system_lyxrc ||
1926 isp_esc_chars != system_lyxrc.isp_esc_chars) {
1927 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1929 case RC_USE_PERS_DICT:
1930 if (ignore_system_lyxrc ||
1931 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1932 os << "\\use_personal_dictionary "
1933 << convert<string>(isp_use_pers_dict)
1937 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1938 string const path = os::external_path(isp_pers_dict);
1939 os << "\\personal_dictionary \"" << path << "\"\n";
1941 case RC_USE_INP_ENC:
1942 if (ignore_system_lyxrc ||
1943 isp_use_input_encoding
1944 != system_lyxrc.isp_use_input_encoding) {
1945 os << "\\use_input_encoding "
1946 << convert<string>(isp_use_input_encoding)
1951 << "# LANGUAGE SUPPORT SECTION ##########################\n"
1954 case RC_RTL_SUPPORT:
1955 if (ignore_system_lyxrc ||
1956 rtl_support != system_lyxrc.rtl_support) {
1957 os << "\\rtl " << convert<string>(rtl_support) << '\n';
1959 case RC_LANGUAGE_PACKAGE:
1960 if (ignore_system_lyxrc ||
1961 language_package != system_lyxrc.language_package) {
1962 os << "\\language_package \"" << language_package
1965 case RC_LANGUAGE_GLOBAL_OPTIONS:
1966 if (ignore_system_lyxrc ||
1967 language_global_options
1968 != system_lyxrc.language_global_options) {
1969 os << "\\language_global_options \""
1970 << convert<string>(language_global_options)
1973 case RC_LANGUAGE_USE_BABEL:
1974 if (ignore_system_lyxrc ||
1975 language_use_babel != system_lyxrc.language_use_babel) {
1976 os << "\\language_use_babel \""
1977 << convert<string>(language_use_babel)
1980 case RC_LANGUAGE_COMMAND_BEGIN:
1981 if (ignore_system_lyxrc ||
1982 language_command_begin
1983 != system_lyxrc.language_command_begin) {
1984 os << "\\language_command_begin \""
1985 << language_command_begin
1988 case RC_LANGUAGE_COMMAND_END:
1989 if (ignore_system_lyxrc ||
1990 language_command_end
1991 != system_lyxrc.language_command_end) {
1992 os << "\\language_command_end \"" << language_command_end
1995 case RC_LANGUAGE_COMMAND_LOCAL:
1996 if (ignore_system_lyxrc ||
1997 language_command_local
1998 != system_lyxrc.language_command_local) {
1999 os << "\\language_command_local \""
2000 << language_command_local
2003 case RC_LANGUAGE_AUTO_BEGIN:
2004 if (ignore_system_lyxrc ||
2005 language_auto_begin != system_lyxrc.language_auto_begin) {
2006 os << "\\language_auto_begin "
2007 << convert<string>(language_auto_begin) << '\n';
2009 case RC_LANGUAGE_AUTO_END:
2010 if (ignore_system_lyxrc ||
2011 language_auto_end != system_lyxrc.language_auto_end) {
2012 os << "\\language_auto_end "
2013 << convert<string>(language_auto_end) << '\n';
2015 case RC_MARK_FOREIGN_LANGUAGE:
2016 if (ignore_system_lyxrc ||
2017 mark_foreign_language
2018 != system_lyxrc.mark_foreign_language) {
2019 os << "\\mark_foreign_language " <<
2020 convert<string>(mark_foreign_language) << '\n';
2024 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2027 case RC_AUTO_NUMBER:
2028 if (ignore_system_lyxrc ||
2029 auto_number != system_lyxrc.auto_number) {
2030 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2032 case RC_DEFAULT_LANGUAGE:
2033 if (ignore_system_lyxrc ||
2034 default_language != system_lyxrc.default_language) {
2035 os << "\\default_language " << default_language << '\n';
2039 << "# FORMATS SECTION ##########################\n"
2043 // New/modified formats
2044 for (Formats::const_iterator cit = formats.begin();
2045 cit != formats.end(); ++cit) {
2046 Format const * format =
2047 system_formats.getFormat(cit->name());
2049 format->extension() != cit->extension() ||
2050 format->prettyname() != cit->prettyname() ||
2051 format->shortcut() != cit->shortcut() ||
2052 format->viewer() != cit->viewer() ||
2053 format->editor() != cit->editor() ||
2054 format->documentFormat() != cit->documentFormat() ||
2055 format->vectorFormat() != cit->vectorFormat()) {
2056 os << "\\format \"" << cit->name() << "\" \""
2057 << cit->extension() << "\" \""
2058 << cit->prettyname() << "\" \""
2059 << cit->shortcut() << "\" \""
2060 << cit->viewer() << "\" \""
2061 << cit->editor() << "\" \"";
2062 std::vector<string> flags;
2063 if (cit->documentFormat())
2064 flags.push_back("document");
2065 if (cit->vectorFormat())
2066 flags.push_back("vector");
2067 os << support::getStringFromVector(flags);
2072 // Look for deleted formats
2073 for (Formats::const_iterator cit = system_formats.begin();
2074 cit != system_formats.end(); ++cit)
2075 if (!formats.getFormat(cit->name()))
2076 os << "\\format \"" << cit->name()
2077 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2082 << "# CONVERTERS SECTION ##########################\n"
2086 // Look for new converters
2087 for (Converters::const_iterator cit = converters.begin();
2088 cit != converters.end(); ++cit) {
2089 Converter const * converter =
2090 system_converters.getConverter(cit->from,
2093 converter->command != cit->command ||
2094 converter->flags != cit->flags)
2095 os << "\\converter \"" << cit->from << "\" \""
2096 << cit->to << "\" \""
2097 << cit->command << "\" \""
2098 << cit->flags << "\"\n";
2101 // New/modifed converters
2102 for (Converters::const_iterator cit = system_converters.begin();
2103 cit != system_converters.end(); ++cit)
2104 if (!converters.getConverter(cit->from, cit->to))
2105 os << "\\converter \"" << cit->from
2106 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2110 << "# COPIERS SECTION ##########################\n"
2113 // Look for new movers
2114 Movers::iterator const sysbegin = system_movers.begin();
2115 Movers::iterator const sysend = system_movers.end();
2117 for (Movers::iterator it = movers.begin(), end = movers.end();
2119 Movers::iterator const sysit =
2120 std::find_if(sysbegin, sysend, SameMover(*it));
2121 if (sysit == sysend) {
2122 std::string const & fmt = it->first;
2123 std::string const & command =
2124 it->second.command();
2126 os << "\\copier " << fmt
2127 << " \"" << command << "\"\n";
2131 // We don't actually delete SpecialisedMover(s) from the
2132 // map, just clear their 'command', so there's no need
2133 // to test for anything else.
2139 void LyXRC::set_font_norm_type()
2141 if (font_norm == "iso10646-1")
2142 font_norm_type = ISO_10646_1;
2143 else if (font_norm == "iso8859-1")
2144 font_norm_type = ISO_8859_1;
2145 else if (font_norm == "iso8859-3")
2146 font_norm_type = ISO_8859_3;
2147 else if (font_norm == "iso8859-4")
2148 font_norm_type = ISO_8859_4;
2149 else if (font_norm == "iso8859-6.8x")
2150 font_norm_type = ISO_8859_6_8;
2151 else if (font_norm == "iso8859-9")
2152 font_norm_type = ISO_8859_9;
2153 else if (font_norm == "iso8859-15")
2154 font_norm_type = ISO_8859_15;
2156 font_norm_type = OTHER_ENCODING;
2161 string const LyXRC::getDescription(LyXRCTags tag)
2166 case RC_ACCEPT_COMPOUND:
2167 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2171 case RC_USE_ALT_LANG:
2172 str = _("Specify an alternate language. The default is to use the language of the document.");
2175 case RC_ASCIIROFF_COMMAND:
2176 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.");
2179 case RC_ASCII_LINELEN:
2180 str = _("This is the maximum line length of an exported text file (LaTeX, SGML or plain text).");
2183 case RC_AUTOREGIONDELETE:
2184 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2187 case RC_AUTORESET_OPTIONS:
2188 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2192 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2195 case RC_AUTO_NUMBER:
2198 case RC_BACKUPDIR_PATH:
2199 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.");
2202 case RC_BIBTEX_COMMAND:
2203 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2207 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2210 case RC_CHECKLASTFILES:
2211 str = _("Select to check whether the lastfiles still exist.");
2214 case RC_CHKTEX_COMMAND:
2215 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2224 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2225 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.");
2228 case RC_CUSTOM_EXPORT_COMMAND:
2231 case RC_CUSTOM_EXPORT_FORMAT:
2234 case RC_DATE_INSERT_FORMAT:
2235 //xgettext:no-c-format
2236 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2239 case RC_DEFAULT_LANGUAGE:
2240 str = _("New documents will be assigned this language.");
2243 case RC_DEFAULT_PAPERSIZE:
2244 str = _("Specify the default paper size.");
2247 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2248 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2251 case RC_DISPLAY_GRAPHICS:
2252 str = _("Select how LyX will display any graphics.");
2255 case RC_DOCUMENTPATH:
2256 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2260 case RC_USE_ESC_CHARS:
2261 str = _("Specify additional chars that can be part of a word.");
2264 case RC_FONT_ENCODING:
2265 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2271 case RC_INDEX_COMMAND:
2272 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\".");
2279 case RC_KBMAP_PRIMARY:
2280 case RC_KBMAP_SECONDARY:
2281 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.");
2284 case RC_LABEL_INIT_LENGTH:
2285 str = _("Maximum number of words in the initialization string for a new label");
2288 case RC_LANGUAGE_AUTO_BEGIN:
2289 str = _("Select if a language switching command is needed at the beginning of the document.");
2292 case RC_LANGUAGE_AUTO_END:
2293 str = _("Select if a language switching command is needed at the end of the document.");
2296 case RC_LANGUAGE_COMMAND_BEGIN:
2297 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.");
2300 case RC_LANGUAGE_COMMAND_END:
2301 str = _("The LaTeX command for changing back to the language of the document.");
2304 case RC_LANGUAGE_COMMAND_LOCAL:
2305 str = _("The LaTeX command for local changing of the language.");
2308 case RC_LANGUAGE_GLOBAL_OPTIONS:
2309 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2312 case RC_LANGUAGE_PACKAGE:
2313 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2316 case RC_LANGUAGE_USE_BABEL:
2317 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2320 case RC_USELASTFILEPOS:
2321 str = _("De-select if you do not want LyX to scroll to saved position.");
2324 case RC_LOADSESSION:
2325 str = _("De-select to prevent loading files opened from the last lyx session.");
2328 case RC_MAKE_BACKUP:
2329 str = _("De-select if you don't want LyX to create backup files.");
2332 case RC_MARK_FOREIGN_LANGUAGE:
2333 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2336 case RC_NUMLASTFILES:
2337 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2341 case RC_PATH_PREFIX:
2342 str = _("Specify those directories which should be "
2343 "prepended to the PATH environment variable. "
2344 "Use the OS native format.");
2348 case RC_USE_PERS_DICT:
2349 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2352 case RC_POPUP_BOLD_FONT:
2353 str = _("The bold font in the dialogs.");
2356 case RC_POPUP_FONT_ENCODING:
2357 str = _("The encoding for the menu/popups fonts.");
2360 case RC_POPUP_NORMAL_FONT:
2361 str = _("The normal font in the dialogs.");
2365 str = _("Shows a typeset preview of things such as math");
2368 case RC_PREVIEW_HASHED_LABELS:
2369 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2372 case RC_PREVIEW_SCALE_FACTOR:
2373 str = _("Scale the preview size to suit.");
2376 case RC_PRINTCOLLCOPIESFLAG:
2377 str = _("The option for specifying whether the copies should be collated.");
2380 case RC_PRINTCOPIESFLAG:
2381 str = _("The option for specifying the number of copies to print.");
2385 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2388 case RC_PRINTEVENPAGEFLAG:
2389 str = _("The option to print only even pages.");
2392 case RC_PRINTEXSTRAOPTIONS:
2393 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2396 case RC_PRINTFILEEXTENSION:
2397 str = _("Extension of printer program output file. Usually \".ps\".");
2400 case RC_PRINTLANDSCAPEFLAG:
2401 str = _("The option to print out in landscape.");
2404 case RC_PRINTODDPAGEFLAG:
2405 str = _("The option to print only odd pages.");
2408 case RC_PRINTPAGERANGEFLAG:
2409 str = _("The option for specifying a comma-separated list of pages to print.");
2412 case RC_PRINTPAPERDIMENSIONFLAG:
2413 str = _("Option to specify the dimensions of the print paper.");
2416 case RC_PRINTPAPERFLAG:
2417 str = _("The option to specify paper type.");
2420 case RC_PRINTREVERSEFLAG:
2421 str = _("The option to reverse the order of the pages printed.");
2424 case RC_PRINTSPOOL_COMMAND:
2425 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.");
2428 case RC_PRINTSPOOL_PRINTERPREFIX:
2429 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.");
2432 case RC_PRINTTOFILE:
2433 str = _("Option to pass to the print program to print to a file.");
2436 case RC_PRINTTOPRINTER:
2437 str = _("Option to pass to the print program to print on a specific printer.");
2440 case RC_PRINT_ADAPTOUTPUT:
2441 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2444 case RC_PRINT_COMMAND:
2445 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2448 case RC_RTL_SUPPORT:
2449 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2453 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2456 case RC_SCREEN_FONT_ENCODING:
2457 str = _("The encoding for the screen fonts.");
2460 case RC_SCREEN_FONT_ROMAN:
2461 case RC_SCREEN_FONT_SANS:
2462 case RC_SCREEN_FONT_TYPEWRITER:
2463 str = _("The screen fonts used to display the text while editing.");
2466 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2467 case RC_SCREEN_FONT_SANS_FOUNDRY:
2468 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2471 case RC_SCREEN_FONT_SCALABLE:
2472 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.");
2475 case RC_SCREEN_FONT_SIZES:
2476 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2479 case RC_SCREEN_ZOOM:
2480 //xgettext:no-c-format
2481 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2484 case RC_SCREEN_GEOMETRY_HEIGHT:
2485 case RC_SCREEN_GEOMETRY_WIDTH:
2486 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).");
2489 case RC_SCREEN_GEOMETRY_XYSAVED:
2490 str = _("Allow session manager to save and restore windows position.");
2494 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2500 case RC_SHOW_BANNER:
2501 str = _("De-select if you don't want the startup banner.");
2504 case RC_SPELL_COMMAND:
2505 str = _("What command runs the spellchecker?");
2508 case RC_TEMPDIRPATH:
2509 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2512 case RC_TEMPLATEPATH:
2513 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2516 case RC_TEX_ALLOWS_SPACES:
2519 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2523 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2535 case RC_USE_INP_ENC:
2536 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.");
2539 case RC_USE_SPELL_LIB:
2542 case RC_VIEWDVI_PAPEROPTION:
2543 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2558 // The global instance
2561 // The global copy of the system lyxrc entries (everything except preferences)