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"
29 #include "FontEnums.h"
32 #include "graphics/GraphicsTypes.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/userinfo.h"
44 using namespace lyx::support;
48 namespace os = support::os;
52 // when adding something to this array keep it sorted!
53 keyword_item lyxrcTags[] = {
54 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
55 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
56 { "\\alternate_language", LyXRC::RC_ALT_LANG },
57 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
58 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
59 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
60 { "\\autosave", LyXRC::RC_AUTOSAVE },
61 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
62 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
63 { "\\bind_file", LyXRC::RC_BINDFILE },
64 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
65 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
66 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
67 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
68 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
69 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
70 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
71 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
72 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
73 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
74 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
75 { "\\converter", LyXRC::RC_CONVERTER },
76 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
77 { "\\copier", LyXRC::RC_COPIER },
78 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
79 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
80 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
81 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
82 { "\\def_file", LyXRC::RC_DEFFILE },
83 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
84 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
85 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
86 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
87 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
88 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
89 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
90 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
91 { "\\format", LyXRC::RC_FORMAT },
92 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
93 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
94 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
95 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
96 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
97 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
98 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
99 { "\\input", LyXRC::RC_INPUT },
100 { "\\kbmap", LyXRC::RC_KBMAP },
101 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
102 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
103 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
104 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
105 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
106 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
107 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
108 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
109 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
110 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
111 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
112 { "\\load_session", LyXRC::RC_LOADSESSION },
113 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
114 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
115 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
116 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
117 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
118 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
119 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
120 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
121 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
122 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
123 { "\\preview", LyXRC::RC_PREVIEW },
124 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
125 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
126 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
127 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
128 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
129 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
130 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
131 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
132 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
133 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
134 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
135 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
136 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
137 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
138 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
139 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
140 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
141 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
142 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
143 { "\\printer", LyXRC::RC_PRINTER },
144 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
145 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
146 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
147 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
148 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
149 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
150 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
151 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
152 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
153 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
154 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
155 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
156 { "\\set_color", LyXRC::RC_SET_COLOR },
157 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
158 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
159 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
160 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
161 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
162 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
163 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
164 { "\\ui_file", LyXRC::RC_UIFILE },
165 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
166 { "\\use_bundled_format", LyXRC::RC_USE_BUNDLED_FORMAT },
167 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
168 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
169 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
170 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
171 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
172 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
173 // compatibility with versions older than 1.4.0 only
174 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
175 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
176 // compatibility with versions older than 1.4.0 only
177 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
178 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
179 { "\\user_email", LyXRC::RC_USER_EMAIL },
180 { "\\user_name", LyXRC::RC_USER_NAME },
181 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
182 // compatibility with versions older than 1.4.0 only
183 { "\\viewer", LyXRC::RC_VIEWER},
184 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
187 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
198 void LyXRC::setDefaults() {
200 def_file = "default";
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:
230 allow_geometry_session = true;
231 // Default LaTeX font size:
232 font_sizes[FONT_SIZE_TINY] = "5.0";
233 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
234 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
235 font_sizes[FONT_SIZE_SMALL] = "9.0";
236 font_sizes[FONT_SIZE_NORMAL] = "10.0";
237 font_sizes[FONT_SIZE_LARGE] = "12.0";
238 font_sizes[FONT_SIZE_LARGER] = "14.4";
239 font_sizes[FONT_SIZE_LARGEST] = "17.26";
240 font_sizes[FONT_SIZE_HUGE] = "20.74";
241 font_sizes[FONT_SIZE_HUGER] = "24.88";
242 use_scalable_fonts = true;
243 roman_font_name = "";
245 typewriter_font_name = "";
247 auto_region_delete = true;
248 auto_reset_options = false;
249 plaintext_linelen = 65;
250 mouse_wheel_speed = 1.0;
251 num_lastfiles = maxlastfiles;
252 check_lastfiles = true;
253 use_lastfilepos = true;
254 load_session = false;
256 backupdir_path.erase();
257 display_graphics = graphics::ColorDisplay;
258 // Spellchecker settings:
259 use_spell_lib = true;
260 isp_command = "ispell";
261 isp_accept_compound = false;
262 isp_use_input_encoding = false;
263 isp_use_alt_lang = false;
264 isp_use_pers_dict = false;
265 isp_use_esc_chars = false;
268 visual_cursor = false;
270 mark_foreign_language = true;
271 language_auto_begin = true;
272 language_auto_end = true;
273 language_global_options = true;
274 language_use_babel = true;
275 language_package = "\\usepackage{babel}";
276 language_command_begin = "\\selectlanguage{$$lang}";
277 language_command_local = "\\foreignlanguage{$$lang}{";
278 sort_layouts = false;
279 group_layouts = true;
280 default_language = "english";
282 windows_style_tex_paths = false;
283 tex_allows_spaces = false;
284 date_insert_format = "%x";
285 cursor_follows_scrollbar = false;
286 macro_edit_style = MACRO_EDIT_INLINE_BOX;
287 dialogs_iconify_with_main = false;
288 label_init_length = 3;
289 preview = PREVIEW_OFF;
290 preview_hashed_labels = false;
291 preview_scale_factor = "0.9";
292 use_converter_cache = true;
294 use_pixmap_cache = false;
295 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
296 user_name = to_utf8(support::user_name());
297 user_email = to_utf8(support::user_email());
298 open_buffers_in_tabs = true;
299 use_bundled_format = false;
301 // Fullscreen settings
302 full_screen_limit = false;
303 full_screen_toolbars = true;
304 full_screen_tabbar = true;
305 full_screen_scrollbar = true;
306 full_screen_width = 700;
308 completion_cursor_text = true;
309 completion_popup_math = true;
310 completion_popup_text = false;
311 completion_popup_delay = 2.0;
312 completion_popup_after_complete = true;
313 completion_inline_math = true;
314 completion_inline_text = false;
315 completion_inline_dots = -1;
316 completion_inline_delay = 0.2;
322 void oldFontFormat(string & family, string & foundry)
324 if (family.empty() || family[0] != '-')
326 foundry = token(family, '-', 1);
327 family = token(family, '-', 2);
335 int LyXRC::read(FileName const & filename)
337 Lexer lexrc(lyxrcTags, lyxrcCount);
338 if (lyxerr.debugging(Debug::PARSER))
339 lexrc.printTable(lyxerr);
341 lexrc.setFile(filename);
342 if (!lexrc.isOK()) return -2;
344 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
350 int LyXRC::read(istream & is)
352 Lexer lexrc(lyxrcTags, lyxrcCount);
353 if (lyxerr.debugging(Debug::PARSER))
354 lexrc.printTable(lyxerr);
360 LYXERR(Debug::LYXRC, "Reading istream...");
366 int LyXRC::read(Lexer & lexrc)
368 if (!lexrc.isOK()) return -2;
370 while (lexrc.isOK()) {
371 // By using two switches we take advantage of the compiler
372 // telling us if we have missed a LyXRCTags element in
373 // the second switch.
374 // Note that this also shows a problem with Lexer since it
375 // helps us avoid taking advantage of the strictness of the
378 int le = lexrc.lex();
380 case Lexer::LEX_UNDEF:
381 lexrc.printError("Unknown tag `$$Token'");
383 case Lexer::LEX_FEOF:
387 switch (static_cast<LyXRCTags>(le)) {
388 case RC_INPUT: // Include file
391 libFileSearch(string(),
394 lexrc.printError("Error reading "
395 "included file: " + tmp.absFilename());
401 bind_file = os::internal_path(lexrc.getString());
407 def_file = os::internal_path(lexrc.getString());
413 ui_file = os::internal_path(lexrc.getString());
417 case RC_AUTORESET_OPTIONS:
419 auto_reset_options = lexrc.getBool();
423 case RC_DISPLAY_GRAPHICS:
425 display_graphics = graphics::displayTranslator().find(lexrc.getString());
429 case RC_TEX_EXPECTS_WINDOWS_PATHS:
431 windows_style_tex_paths = lexrc.getBool();
435 case RC_TEX_ALLOWS_SPACES:
437 tex_allows_spaces = lexrc.getBool();
443 use_kbmap = lexrc.getBool();
447 case RC_KBMAP_PRIMARY:
449 string const kmap(os::internal_path(lexrc.getString()));
452 } else if (!libFileSearch("kbd", kmap,
454 primary_kbmap = kmap;
456 lexrc.printError("LyX: Keymap `$$Token' not found");
461 case RC_KBMAP_SECONDARY:
463 string const kmap(os::internal_path(lexrc.getString()));
466 } else if (!libFileSearch("kbd", kmap,
468 secondary_kbmap = kmap;
470 lexrc.printError("LyX: Keymap `$$Token' not found");
475 case RC_FONT_ENCODING:
477 fontenc = lexrc.getString();
483 printer = lexrc.getString();
487 case RC_PRINT_COMMAND:
489 print_command = lexrc.getString();
493 case RC_PRINTEVENPAGEFLAG:
495 print_evenpage_flag = lexrc.getString();
499 case RC_PRINTODDPAGEFLAG:
501 print_oddpage_flag = lexrc.getString();
505 case RC_PRINTPAGERANGEFLAG:
507 print_pagerange_flag = lexrc.getString();
511 case RC_PRINTCOPIESFLAG:
513 print_copies_flag = lexrc.getString();
517 case RC_PRINTCOLLCOPIESFLAG:
519 print_collcopies_flag = lexrc.getString();
523 case RC_PRINTREVERSEFLAG:
525 print_reverse_flag = lexrc.getString();
529 case RC_PRINTLANDSCAPEFLAG:
531 print_landscape_flag = lexrc.getString();
535 case RC_PRINTTOPRINTER:
537 print_to_printer = lexrc.getString();
541 case RC_PRINT_ADAPTOUTPUT:
543 print_adapt_output = lexrc.getBool();
549 print_to_file = os::internal_path(lexrc.getString());
553 case RC_PRINTFILEEXTENSION:
555 print_file_extension = lexrc.getString();
559 case RC_PRINTEXSTRAOPTIONS:
561 print_extra_options = lexrc.getString();
565 case RC_PRINTSPOOL_COMMAND:
567 print_spool_command = lexrc.getString();
571 case RC_PRINTSPOOL_PRINTERPREFIX:
573 print_spool_printerprefix = lexrc.getString();
577 case RC_PRINTPAPERDIMENSIONFLAG:
579 print_paper_dimension_flag = lexrc.getString();
583 case RC_PRINTPAPERFLAG:
585 print_paper_flag = lexrc.getString();
589 case RC_CUSTOM_EXPORT_COMMAND:
591 custom_export_command = lexrc.getString();
595 case RC_CUSTOM_EXPORT_FORMAT:
597 custom_export_format = lexrc.getString();
601 case RC_DEFAULT_PAPERSIZE:
604 ascii_lowercase(lexrc.getString());
605 if (size == "usletter")
608 else if (size == "legal")
611 else if (size == "executive")
614 else if (size == "a3")
617 else if (size == "a4")
620 else if (size == "a5")
623 else if (size == "b5")
626 else if (size == "default")
632 case RC_VIEWDVI_PAPEROPTION:
634 view_dvi_paper_option = lexrc.getString();
636 view_dvi_paper_option.erase();
640 case RC_CHKTEX_COMMAND:
642 chktex_command = lexrc.getString();
646 case RC_BIBTEX_COMMAND:
648 bibtex_command = lexrc.getString();
652 case RC_INDEX_COMMAND:
654 index_command = lexrc.getString();
660 dpi = lexrc.getInteger();
666 zoom = lexrc.getInteger();
670 case RC_GEOMETRY_SESSION:
672 allow_geometry_session = lexrc.getBool();
676 case RC_SCREEN_FONT_SIZES:
678 font_sizes[FONT_SIZE_TINY] =
682 font_sizes[FONT_SIZE_SCRIPT] =
686 font_sizes[FONT_SIZE_FOOTNOTE] =
690 font_sizes[FONT_SIZE_SMALL] =
694 font_sizes[FONT_SIZE_NORMAL] =
698 font_sizes[FONT_SIZE_LARGE] =
702 font_sizes[FONT_SIZE_LARGER] =
706 font_sizes[FONT_SIZE_LARGEST] =
710 font_sizes[FONT_SIZE_HUGE] =
714 font_sizes[FONT_SIZE_HUGER] =
719 case RC_SCREEN_FONT_SCALABLE:
721 use_scalable_fonts = lexrc.getBool();
727 autosave = lexrc.getInteger();
731 case RC_DOCUMENTPATH:
733 document_path = os::internal_path(lexrc.getString());
734 document_path = expandPath(document_path);
740 example_path = os::internal_path(lexrc.getString());
741 example_path = expandPath(example_path);
745 case RC_TEMPLATEPATH:
747 template_path = os::internal_path(lexrc.getString());
748 template_path = expandPath(template_path);
754 tempdir_path = os::internal_path(lexrc.getString());
755 tempdir_path = expandPath(tempdir_path);
761 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
765 case RC_USELASTFILEPOS:
767 use_lastfilepos = lexrc.getBool();
773 load_session = lexrc.getBool();
777 case RC_MOUSE_WHEEL_SPEED:
779 mouse_wheel_speed = lexrc.getFloat();
783 case RC_COMPLETION_INLINE_DELAY:
785 completion_inline_delay = lexrc.getFloat();
789 case RC_COMPLETION_INLINE_MATH:
791 completion_inline_math = lexrc.getBool();
795 case RC_COMPLETION_INLINE_TEXT:
797 completion_inline_text = lexrc.getBool();
801 case RC_COMPLETION_INLINE_DOTS:
803 completion_inline_dots = lexrc.getInteger();
807 case RC_COMPLETION_POPUP_DELAY:
809 completion_popup_delay = lexrc.getFloat();
813 case RC_COMPLETION_POPUP_MATH:
815 completion_popup_math = lexrc.getBool();
819 case RC_COMPLETION_POPUP_TEXT:
821 completion_popup_text = lexrc.getBool();
825 case RC_COMPLETION_CURSOR_TEXT:
827 completion_cursor_text = lexrc.getBool();
831 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
833 completion_popup_after_complete = lexrc.getBool();
837 case RC_NUMLASTFILES:
839 num_lastfiles = lexrc.getInteger();
843 case RC_CHECKLASTFILES:
845 check_lastfiles = lexrc.getBool();
849 case RC_SCREEN_FONT_ROMAN:
851 roman_font_name = lexrc.getString();
852 oldFontFormat(roman_font_name,
857 case RC_SCREEN_FONT_SANS:
859 sans_font_name = lexrc.getString();
860 oldFontFormat(sans_font_name, sans_font_foundry);
864 case RC_SCREEN_FONT_TYPEWRITER:
866 typewriter_font_name = lexrc.getString();
867 oldFontFormat(typewriter_font_name,
868 typewriter_font_foundry);
872 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
874 roman_font_foundry = lexrc.getString();
878 case RC_SCREEN_FONT_SANS_FOUNDRY:
880 sans_font_foundry = lexrc.getString();
884 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
886 typewriter_font_foundry = lexrc.getString();
892 string lyx_name, x11_name;
895 lyx_name = lexrc.getString();
897 lexrc.printError("Missing color tag.");
902 x11_name = lexrc.getString();
904 lexrc.printError("Missing color name for color: `$$Token'");
908 ColorCode const col =
909 lcolor.getFromLyXName(lyx_name);
910 if (col == Color_none ||
911 col == Color_inherit ||
915 if (!lcolor.setColor(col, x11_name)) {
916 lyxerr << "Bad lyxrc set_color for "
922 case RC_AUTOREGIONDELETE:
923 // Auto region delete defaults to true
925 auto_region_delete = lexrc.getBool();
931 lyxpipes = os::internal_path(lexrc.getString());
932 lyxpipes = expandPath(lyxpipes);
936 case RC_CURSOR_FOLLOWS_SCROLLBAR:
938 cursor_follows_scrollbar = lexrc.getBool();
942 case RC_MACRO_EDIT_STYLE:
944 switch (lexrc.getInteger()) {
945 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
946 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
947 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
952 case RC_DIALOGS_ICONIFY_WITH_MAIN:
954 dialogs_iconify_with_main = lexrc.getBool();
958 case RC_PLAINTEXT_ROFF_COMMAND:
960 plaintext_roff_command = lexrc.getString();
963 case RC_PLAINTEXT_LINELEN:
965 plaintext_linelen = lexrc.getInteger();
968 // Spellchecker settings:
969 case RC_USE_SPELL_LIB:
971 use_spell_lib = lexrc.getBool();
974 case RC_SPELL_COMMAND:
976 isp_command = lexrc.getString();
979 case RC_ACCEPT_COMPOUND:
981 isp_accept_compound = lexrc.getBool();
986 isp_use_input_encoding = lexrc.getBool();
989 case RC_USE_ALT_LANG:
991 isp_use_alt_lang = lexrc.getBool();
994 case RC_USE_PERS_DICT:
996 isp_use_pers_dict = lexrc.getBool();
1001 use_tooltip = lexrc.getBool();
1004 case RC_USE_PIXMAP_CACHE:
1006 use_pixmap_cache = lexrc.getBool();
1009 case RC_USE_ESC_CHARS:
1011 isp_use_esc_chars = lexrc.getBool();
1016 isp_alt_lang = lexrc.getString();
1021 isp_pers_dict = os::internal_path(lexrc.getString());
1026 isp_esc_chars = lexrc.getString();
1029 case RC_MAKE_BACKUP:
1031 make_backup = lexrc.getBool();
1034 case RC_BACKUPDIR_PATH:
1036 backupdir_path = os::internal_path(lexrc.getString());
1037 backupdir_path = expandPath(backupdir_path);
1040 case RC_DATE_INSERT_FORMAT:
1042 date_insert_format = lexrc.getString();
1045 case RC_LANGUAGE_PACKAGE:
1047 language_package = lexrc.getString();
1050 case RC_LANGUAGE_AUTO_BEGIN:
1052 language_auto_begin = lexrc.getBool();
1055 case RC_LANGUAGE_AUTO_END:
1057 language_auto_end = lexrc.getBool();
1060 case RC_LANGUAGE_GLOBAL_OPTIONS:
1062 language_global_options = lexrc.getBool();
1065 case RC_LANGUAGE_USE_BABEL:
1067 language_use_babel = lexrc.getBool();
1070 case RC_LANGUAGE_COMMAND_BEGIN:
1072 language_command_begin = lexrc.getString();
1075 case RC_LANGUAGE_COMMAND_END:
1077 language_command_end = lexrc.getString();
1080 case RC_LANGUAGE_COMMAND_LOCAL:
1082 language_command_local = lexrc.getString();
1085 case RC_RTL_SUPPORT:
1087 rtl_support = lexrc.getBool();
1090 case RC_VISUAL_CURSOR:
1092 visual_cursor = lexrc.getBool();
1095 case RC_AUTO_NUMBER:
1097 auto_number = lexrc.getBool();
1100 case RC_MARK_FOREIGN_LANGUAGE:
1102 mark_foreign_language = lexrc.getBool();
1107 string fmt, command;
1109 fmt = lexrc.getString();
1112 command = lexrc.getString();
1114 setMover(fmt, command);
1118 case RC_CONVERTER: {
1119 string from, to, command, flags;
1121 from = lexrc.getString();
1124 to = lexrc.getString();
1127 command = lexrc.getString();
1130 flags = lexrc.getString();
1132 if (command.empty()) {
1133 theConverters().erase(from, to);
1135 theConverters().add(from, to, command, flags);
1139 // compatibility with versions older than 1.4.0 only
1141 string format, command;
1143 format = lexrc.getString();
1146 command = lexrc.getString();
1148 formats.setViewer(format, command);
1152 string format, extension, prettyname, shortcut;
1154 format = lexrc.getString();
1157 extension = lexrc.getString();
1160 prettyname = lexrc.getString();
1163 shortcut = lexrc.getString();
1165 string viewer, editor;
1167 viewer = lexrc.getString();
1169 editor = lexrc.getString();
1171 // Hack to ensure compatibility with versions older
1173 int le = lexrc.lex();
1174 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1175 flags = lexrc.getString();
1176 if (le != Lexer::LEX_DATA) {
1177 // We have got a known token.
1178 // Therefore this is an old style
1179 // format definition without
1181 lexrc.pushToken(flags);
1185 int flgs = Format::none;
1186 while (!flags.empty()) {
1188 flags = split(flags, flag, ',');
1189 if (flag == "document")
1190 flgs |= Format::document;
1191 else if (flag == "vector")
1192 flgs |= Format::vector;
1194 lyxerr << "Ignoring unknown flag `"
1195 << flag << "' for format `"
1196 << format << "'." << endl;
1198 if (prettyname.empty()) {
1199 if (theConverters().formatIsUsed(format)) {
1200 lyxerr << "Can't delete format "
1203 formats.erase(format);
1206 formats.add(format, extension, prettyname,
1207 shortcut, viewer, editor, flgs);
1211 case RC_DEFAULT_LANGUAGE:
1213 default_language = lexrc.getString();
1217 case RC_LABEL_INIT_LENGTH:
1219 label_init_length = lexrc.getInteger();
1223 case RC_SHOW_BANNER:
1225 show_banner = lexrc.getBool();
1231 string const tmp = lexrc.getString();
1232 if (tmp == "true" || tmp == "on")
1233 preview = PREVIEW_ON;
1234 else if (tmp == "no_math")
1235 preview = PREVIEW_NO_MATH;
1237 preview = PREVIEW_OFF;
1238 if (tmp != "false" && tmp != "off")
1239 lyxerr << "Unrecognized "
1241 << tmp << '\n' << endl;
1246 case RC_PREVIEW_HASHED_LABELS:
1248 preview_hashed_labels = lexrc.getBool();
1252 case RC_PREVIEW_SCALE_FACTOR:
1254 preview_scale_factor = lexrc.getString();
1260 user_name = lexrc.getString();
1265 user_email = lexrc.getString();
1268 case RC_PATH_PREFIX:
1270 path_prefix = lexrc.getString();
1273 case RC_USE_CONVERTER_CACHE:
1275 use_converter_cache = lexrc.getBool();
1278 case RC_CONVERTER_CACHE_MAXAGE:
1280 converter_cache_maxage =
1281 convert<unsigned int>(lexrc.getString());
1284 case RC_SORT_LAYOUTS:
1286 sort_layouts = lexrc.getBool();
1288 case RC_GROUP_LAYOUTS:
1290 group_layouts = lexrc.getBool();
1292 case RC_FULL_SCREEN_LIMIT:
1294 full_screen_limit = lexrc.getBool();
1296 case RC_FULL_SCREEN_TOOLBARS:
1298 full_screen_toolbars = lexrc.getBool();
1300 case RC_FULL_SCREEN_SCROLLBAR:
1302 full_screen_scrollbar = lexrc.getBool();
1304 case RC_FULL_SCREEN_TABBAR:
1306 full_screen_tabbar = lexrc.getBool();
1308 case RC_FULL_SCREEN_WIDTH:
1310 full_screen_width = lexrc.getInteger();
1312 case RC_OPEN_BUFFERS_IN_TABS:
1314 open_buffers_in_tabs = lexrc.getBool();
1316 case RC_USE_BUNDLED_FORMAT:
1318 use_bundled_format = lexrc.getBool();
1321 case RC_LAST: break; // this is just a dummy
1325 /// Update converters data-structures
1326 theConverters().update(formats);
1327 theConverters().buildGraph();
1333 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1335 ofstream ofs(filename.toFilesystemEncoding().c_str());
1337 write(ofs, ignore_system_lyxrc);
1341 void LyXRC::print() const
1343 if (lyxerr.debugging())
1344 write(lyxerr, false);
1352 typedef pair<string, SpecialisedMover> Data;
1354 SameMover(Data const & comparison)
1355 : comparison_(comparison) {}
1357 bool operator()(Data const & data) const
1359 return data.first == comparison_.first &&
1360 data.second.command() == comparison_.second.command();
1368 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1370 LyXRCTags tag = RC_LAST;
1372 if (!name.empty()) {
1373 for (int i = 0; i != lyxrcCount; ++i)
1374 if ("\\" + name == lyxrcTags[i].tag)
1375 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1379 os << "### This file is part of\n"
1380 << "### ========================================================\n"
1381 << "### LyX, The Document Processor\n"
1383 << "### Copyright 1995 Matthias Ettrich\n"
1384 << "### Copyright 1995-2007 The LyX Team.\n"
1386 << "### ========================================================\n"
1388 << "# This file is written by LyX, if you want to make your own\n"
1389 << "# modifications you should do them from inside LyX and save\n"
1392 // Why the switch you might ask. It is a trick to ensure that all
1393 // the elements in the LyXRCTags enum is handled. As you can see
1394 // there are no breaks at all. So it is just a huge fall-through.
1395 // The nice thing is that we will get a warning from the compiler
1396 // if we forget an element.
1400 // input/include files are not done here
1402 if (ignore_system_lyxrc ||
1403 bind_file != system_lyxrc.bind_file) {
1404 string const path = os::external_path(bind_file);
1405 os << "\\bind_file \"" << path << "\"\n";
1411 if (ignore_system_lyxrc ||
1412 def_file != system_lyxrc.def_file) {
1413 string const path = os::external_path(def_file);
1414 os << "\\def_file \"" << path << "\"\n";
1423 << "# MISC SECTION ######################################\n"
1425 // bind files are not done here.
1427 case RC_PATH_PREFIX:
1428 if (ignore_system_lyxrc ||
1429 path_prefix != system_lyxrc.path_prefix) {
1430 os << "\\path_prefix \"" << path_prefix << "\"\n";
1435 if (ignore_system_lyxrc ||
1436 ui_file != system_lyxrc.ui_file) {
1437 string const path = os::external_path(ui_file);
1438 os << "\\ui_file \"" << path << "\"\n";
1442 case RC_AUTOREGIONDELETE:
1443 if (ignore_system_lyxrc ||
1444 auto_region_delete != system_lyxrc.auto_region_delete) {
1445 os << "# Set to false to inhibit automatic replacement of\n"
1446 << "# the current selection.\n"
1447 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1452 case RC_AUTORESET_OPTIONS:
1453 if (ignore_system_lyxrc ||
1454 auto_reset_options != system_lyxrc.auto_reset_options) {
1455 os << "# Set to false to inhibit automatic reset of\n"
1456 << "# the class options to defaults on class change.\n"
1457 << "\\auto_reset_options "
1458 << convert<string>(auto_reset_options)
1464 if (ignore_system_lyxrc ||
1465 autosave != system_lyxrc.autosave) {
1466 os << "# The time interval between auto-saves in seconds.\n"
1467 << "\\autosave " << autosave << '\n';
1471 case RC_DISPLAY_GRAPHICS:
1472 if (ignore_system_lyxrc ||
1473 display_graphics != system_lyxrc.display_graphics) {
1474 os << "# Display graphics within LyX\n"
1475 << "# monochrome|grayscale|color|none\n"
1476 << "\\display_graphics "
1477 << graphics::displayTranslator().find(
1478 graphics::DisplayType(display_graphics))
1483 case RC_SORT_LAYOUTS:
1484 if (ignore_system_lyxrc ||
1485 sort_layouts != system_lyxrc.sort_layouts) {
1486 os << "# Sort layouts alphabetically.\n"
1487 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1491 case RC_GROUP_LAYOUTS:
1492 if (ignore_system_lyxrc ||
1493 group_layouts != system_lyxrc.group_layouts) {
1494 os << "# Group layouts by their category.\n"
1495 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1499 case RC_VIEWDVI_PAPEROPTION:
1500 if (ignore_system_lyxrc ||
1501 view_dvi_paper_option
1502 != system_lyxrc.view_dvi_paper_option) {
1503 os << "# Options used to specify paper size to the\n"
1504 << "# view_dvi_command (e.g. -paper)\n"
1505 << "\\view_dvi_paper_option \""
1506 << view_dvi_paper_option << "\"\n";
1510 case RC_DEFAULT_PAPERSIZE:
1511 if (ignore_system_lyxrc ||
1512 default_papersize != system_lyxrc.default_papersize) {
1513 os << "# The default papersize to use.\n"
1514 << "\\default_papersize \"";
1515 switch (default_papersize) {
1517 os << "default"; break;
1518 case PAPER_USLETTER:
1519 os << "usletter"; break;
1521 os << "legal"; break;
1522 case PAPER_USEXECUTIVE:
1523 os << "executive"; break;
1534 case PAPER_B4: break;
1540 case RC_CHKTEX_COMMAND:
1541 if (ignore_system_lyxrc ||
1542 chktex_command != system_lyxrc.chktex_command) {
1543 os << "\\chktex_command \"" << chktex_command << "\"\n";
1547 case RC_BIBTEX_COMMAND:
1548 if (ignore_system_lyxrc ||
1549 bibtex_command != system_lyxrc.bibtex_command) {
1550 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1554 case RC_INDEX_COMMAND:
1555 if (ignore_system_lyxrc ||
1556 index_command != system_lyxrc.index_command) {
1557 os << "\\index_command \"" << index_command << "\"\n";
1561 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1562 if (ignore_system_lyxrc ||
1563 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1564 os << "\\tex_expects_windows_paths "
1565 << convert<string>(windows_style_tex_paths) << '\n';
1569 case RC_TEX_ALLOWS_SPACES:
1570 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1571 os << "\\tex_allows_spaces "
1572 << convert<string>(tex_allows_spaces) << '\n';
1577 if (ignore_system_lyxrc ||
1578 use_kbmap != system_lyxrc.use_kbmap) {
1579 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1583 case RC_KBMAP_PRIMARY:
1584 if (ignore_system_lyxrc ||
1585 primary_kbmap != system_lyxrc.primary_kbmap) {
1586 string const path = os::external_path(primary_kbmap);
1587 os << "\\kbmap_primary \"" << path << "\"\n";
1591 case RC_KBMAP_SECONDARY:
1592 if (ignore_system_lyxrc ||
1593 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1594 string const path = os::external_path(secondary_kbmap);
1595 os << "\\kbmap_secondary \"" << path << "\"\n";
1600 if (ignore_system_lyxrc ||
1601 lyxpipes != system_lyxrc.lyxpipes) {
1602 string const path = os::external_path(lyxpipes);
1603 os << "\\serverpipe \"" << path << "\"\n";
1607 case RC_DATE_INSERT_FORMAT:
1608 if (ignore_system_lyxrc ||
1609 date_insert_format != system_lyxrc.date_insert_format) {
1610 os << "\\date_insert_format \"" << date_insert_format
1615 case RC_LABEL_INIT_LENGTH:
1616 if (ignore_system_lyxrc ||
1617 label_init_length != system_lyxrc.label_init_length) {
1618 os << "\\label_init_length " << label_init_length
1625 os << "\\user_name \"" << user_name << "\"\n";
1630 os << "\\user_email \"" << user_email << "\"\n";
1634 case RC_SHOW_BANNER:
1635 if (ignore_system_lyxrc ||
1636 show_banner != system_lyxrc.show_banner) {
1637 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1643 if (ignore_system_lyxrc ||
1644 preview != system_lyxrc.preview) {
1650 case PREVIEW_NO_MATH:
1657 os << "\\preview " << status << '\n';
1662 case RC_PREVIEW_HASHED_LABELS:
1663 if (ignore_system_lyxrc ||
1664 preview_hashed_labels !=
1665 system_lyxrc.preview_hashed_labels) {
1666 os << "\\preview_hashed_labels "
1667 << convert<string>(preview_hashed_labels) << '\n';
1672 case RC_PREVIEW_SCALE_FACTOR:
1673 if (ignore_system_lyxrc ||
1674 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1675 os << "\\preview_scale_factor "
1676 << preview_scale_factor << '\n';
1681 case RC_USE_CONVERTER_CACHE:
1682 if (ignore_system_lyxrc ||
1683 use_converter_cache != system_lyxrc.use_converter_cache) {
1684 os << "\\use_converter_cache "
1685 << convert<string>(use_converter_cache) << '\n';
1690 case RC_CONVERTER_CACHE_MAXAGE:
1691 if (ignore_system_lyxrc ||
1692 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1693 os << "\\converter_cache_maxage "
1694 << converter_cache_maxage << '\n';
1700 << "# SCREEN & FONTS SECTION ############################\n"
1704 if (ignore_system_lyxrc ||
1705 dpi != system_lyxrc.dpi) {
1706 os << "\\screen_dpi " << dpi << '\n';
1710 case RC_SCREEN_ZOOM:
1711 if (ignore_system_lyxrc ||
1712 zoom != system_lyxrc.zoom) {
1713 os << "\\screen_zoom " << zoom << '\n';
1717 case RC_GEOMETRY_SESSION:
1718 if (ignore_system_lyxrc ||
1719 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1720 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1725 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1726 if (ignore_system_lyxrc ||
1727 cursor_follows_scrollbar
1728 != system_lyxrc.cursor_follows_scrollbar) {
1729 os << "\\cursor_follows_scrollbar "
1730 << convert<string>(cursor_follows_scrollbar) << '\n';
1734 case RC_MACRO_EDIT_STYLE:
1735 if (ignore_system_lyxrc ||
1737 != system_lyxrc.macro_edit_style) {
1738 os << "\\macro_edit_style ";
1739 switch (macro_edit_style) {
1740 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1741 case MACRO_EDIT_INLINE: os << "1\n"; break;
1742 case MACRO_EDIT_LIST: os << "2\n"; break;
1747 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1748 if (ignore_system_lyxrc ||
1749 dialogs_iconify_with_main
1750 != system_lyxrc.dialogs_iconify_with_main) {
1751 os << "\\dialogs_iconify_with_main "
1752 << convert<string>(dialogs_iconify_with_main) << '\n';
1756 case RC_SCREEN_FONT_ROMAN:
1757 if (ignore_system_lyxrc ||
1758 roman_font_name != system_lyxrc.roman_font_name) {
1759 os << "\\screen_font_roman \"" << roman_font_name
1764 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1765 if (ignore_system_lyxrc ||
1766 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1767 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1772 case RC_SCREEN_FONT_SANS:
1773 if (ignore_system_lyxrc ||
1774 sans_font_name != system_lyxrc.sans_font_name) {
1775 os << "\\screen_font_sans \"" << sans_font_name
1780 case RC_SCREEN_FONT_SANS_FOUNDRY:
1781 if (ignore_system_lyxrc ||
1782 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1783 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1788 case RC_SCREEN_FONT_TYPEWRITER:
1789 if (ignore_system_lyxrc ||
1790 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1791 os << "\\screen_font_typewriter \""
1792 << typewriter_font_name << "\"\n";
1796 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1797 if (ignore_system_lyxrc ||
1798 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1799 os << "\\screen_font_typewriter_foundry \""
1800 << typewriter_font_foundry << "\"\n";
1805 case RC_SCREEN_FONT_SCALABLE:
1806 if (ignore_system_lyxrc ||
1807 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1808 os << "\\screen_font_scalable "
1809 << convert<string>(use_scalable_fonts)
1814 case RC_SCREEN_FONT_SIZES:
1815 if (ignore_system_lyxrc ||
1816 font_sizes[FONT_SIZE_TINY]
1817 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1818 font_sizes[FONT_SIZE_SCRIPT]
1819 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1820 font_sizes[FONT_SIZE_FOOTNOTE]
1821 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1822 font_sizes[FONT_SIZE_SMALL]
1823 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1824 font_sizes[FONT_SIZE_NORMAL]
1825 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1826 font_sizes[FONT_SIZE_LARGE]
1827 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1828 font_sizes[FONT_SIZE_LARGER]
1829 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1830 font_sizes[FONT_SIZE_LARGEST]
1831 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1832 font_sizes[FONT_SIZE_HUGE]
1833 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1834 font_sizes[FONT_SIZE_HUGER]
1835 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1836 os.setf(ios::fixed);
1838 os << "\\screen_font_sizes"
1839 << ' ' << font_sizes[FONT_SIZE_TINY]
1840 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1841 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1842 << ' ' << font_sizes[FONT_SIZE_SMALL]
1843 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1844 << ' ' << font_sizes[FONT_SIZE_LARGE]
1845 << ' ' << font_sizes[FONT_SIZE_LARGER]
1846 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1847 << ' ' << font_sizes[FONT_SIZE_HUGE]
1848 << ' ' << font_sizes[FONT_SIZE_HUGER]
1853 case RC_FULL_SCREEN_LIMIT:
1854 if (ignore_system_lyxrc ||
1855 full_screen_limit != system_lyxrc.full_screen_limit) {
1856 os << "\\fullscreen_limit "
1857 << convert<string>(full_screen_limit)
1862 case RC_FULL_SCREEN_TOOLBARS:
1863 if (ignore_system_lyxrc ||
1864 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1865 os << "\\fullscreen_toolbars "
1866 << convert<string>(full_screen_toolbars)
1871 case RC_FULL_SCREEN_SCROLLBAR:
1872 if (ignore_system_lyxrc ||
1873 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1874 os << "\\fullscreen_scrollbar "
1875 << convert<string>(full_screen_scrollbar)
1880 case RC_FULL_SCREEN_TABBAR:
1881 if (ignore_system_lyxrc ||
1882 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1883 os << "\\fullscreen_tabbar "
1884 << convert<string>(full_screen_tabbar)
1889 case RC_FULL_SCREEN_WIDTH:
1890 if (ignore_system_lyxrc ||
1891 full_screen_width != system_lyxrc.full_screen_width) {
1892 os << "\\fullscreen_width "
1893 << convert<string>(full_screen_width)
1898 case RC_OPEN_BUFFERS_IN_TABS:
1899 if (ignore_system_lyxrc ||
1900 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1901 os << "\\open_buffers_in_tabs "
1902 << convert<string>(open_buffers_in_tabs)
1907 case RC_USE_BUNDLED_FORMAT:
1908 if (ignore_system_lyxrc ||
1909 use_bundled_format != system_lyxrc.use_bundled_format) {
1910 os << "\\use_bundled_format "
1911 << convert<string>(use_bundled_format)
1918 << "# COLOR SECTION ###################################\n"
1922 for (int i = 0; i < Color_ignore; ++i) {
1923 ColorCode lc = static_cast<ColorCode>(i);
1925 string const col(lcolor.getX11Name(lc));
1926 if (ignore_system_lyxrc ||
1927 col != system_lcolor.getX11Name(lc)) {
1928 os << "\\set_color \""
1929 << lcolor.getLyXName(lc) << "\" \""
1937 << "# PRINTER SECTION ###################################\n"
1941 if (ignore_system_lyxrc ||
1942 printer != system_lyxrc.printer) {
1943 os << "\\printer \"" << printer << "\"\n";
1947 case RC_PRINT_ADAPTOUTPUT:
1948 if (ignore_system_lyxrc ||
1949 print_adapt_output != system_lyxrc.print_adapt_output) {
1950 os << "\\print_adapt_output "
1951 << convert<string>(print_adapt_output)
1956 case RC_PRINT_COMMAND:
1957 if (ignore_system_lyxrc ||
1958 print_command != system_lyxrc.print_command) {
1959 os << "\\print_command \"" << print_command << "\"\n";
1963 case RC_PRINTEXSTRAOPTIONS:
1964 if (ignore_system_lyxrc ||
1965 print_extra_options != system_lyxrc.print_extra_options) {
1966 os << "\\print_extra_options \"" << print_extra_options
1971 case RC_PRINTSPOOL_COMMAND:
1972 if (ignore_system_lyxrc ||
1973 print_spool_command != system_lyxrc.print_spool_command) {
1974 os << "\\print_spool_command \"" << print_spool_command
1979 case RC_PRINTSPOOL_PRINTERPREFIX:
1980 if (ignore_system_lyxrc ||
1981 print_spool_printerprefix
1982 != system_lyxrc.print_spool_printerprefix) {
1983 os << "\\print_spool_printerprefix \""
1984 << print_spool_printerprefix << "\"\n";
1988 case RC_PRINTEVENPAGEFLAG:
1989 if (ignore_system_lyxrc ||
1990 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1991 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1996 case RC_PRINTODDPAGEFLAG:
1997 if (ignore_system_lyxrc ||
1998 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1999 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2004 case RC_PRINTREVERSEFLAG:
2005 if (ignore_system_lyxrc ||
2006 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2007 os << "\\print_reverse_flag \"" << print_reverse_flag
2012 case RC_PRINTLANDSCAPEFLAG:
2013 if (ignore_system_lyxrc ||
2014 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2015 os << "\\print_landscape_flag \"" << print_landscape_flag
2020 case RC_PRINTPAGERANGEFLAG:
2021 if (ignore_system_lyxrc ||
2022 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2023 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2028 case RC_PRINTCOPIESFLAG:
2029 if (ignore_system_lyxrc ||
2030 print_copies_flag != system_lyxrc.print_copies_flag) {
2031 os << "\\print_copies_flag \"" << print_copies_flag
2036 case RC_PRINTCOLLCOPIESFLAG:
2037 if (ignore_system_lyxrc ||
2038 print_collcopies_flag
2039 != system_lyxrc.print_collcopies_flag) {
2040 os << "\\print_collcopies_flag \""
2041 << print_collcopies_flag
2046 case RC_PRINTPAPERFLAG:
2047 if (ignore_system_lyxrc ||
2048 print_paper_flag != system_lyxrc.print_paper_flag) {
2049 os << "\\print_paper_flag \"" << print_paper_flag
2054 case RC_PRINTPAPERDIMENSIONFLAG:
2055 if (ignore_system_lyxrc ||
2056 print_paper_dimension_flag
2057 != system_lyxrc.print_paper_dimension_flag) {
2058 os << "\\print_paper_dimension_flag \""
2059 << print_paper_dimension_flag << "\"\n";
2063 case RC_PRINTTOPRINTER:
2064 if (ignore_system_lyxrc ||
2065 print_to_printer != system_lyxrc.print_to_printer) {
2066 os << "\\print_to_printer \"" << print_to_printer
2071 case RC_PRINTTOFILE:
2072 if (ignore_system_lyxrc ||
2073 print_to_file != system_lyxrc.print_to_file) {
2074 string const path = os::external_path(print_to_file);
2075 os << "\\print_to_file \"" << path << "\"\n";
2079 case RC_PRINTFILEEXTENSION:
2080 if (ignore_system_lyxrc ||
2081 print_file_extension != system_lyxrc.print_file_extension) {
2082 os << "\\print_file_extension \""
2083 << print_file_extension
2090 << "# EXPORT SECTION ####################################\n"
2093 case RC_CUSTOM_EXPORT_COMMAND:
2094 if (ignore_system_lyxrc ||
2095 custom_export_command
2096 != system_lyxrc.custom_export_command) {
2097 os << "\\custom_export_command \""
2098 << custom_export_command
2103 case RC_CUSTOM_EXPORT_FORMAT:
2104 if (ignore_system_lyxrc ||
2105 custom_export_format
2106 != system_lyxrc.custom_export_format) {
2107 os << "\\custom_export_format \"" << custom_export_format
2114 << "# TEX SECTION #######################################\n"
2117 case RC_FONT_ENCODING:
2118 if (ignore_system_lyxrc ||
2119 fontenc != system_lyxrc.fontenc) {
2120 os << "\\font_encoding \"" << fontenc << "\"\n";
2126 << "# FILE SECTION ######################################\n"
2129 case RC_DOCUMENTPATH:
2130 if (ignore_system_lyxrc ||
2131 document_path != system_lyxrc.document_path) {
2132 string const path = os::external_path(document_path);
2133 os << "\\document_path \"" << path << "\"\n";
2137 case RC_USELASTFILEPOS:
2138 if (ignore_system_lyxrc ||
2139 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2140 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2145 case RC_LOADSESSION:
2146 if (ignore_system_lyxrc ||
2147 load_session != system_lyxrc.load_session) {
2148 os << "\\load_session " << convert<string>(load_session)
2153 case RC_MOUSE_WHEEL_SPEED:
2154 if (ignore_system_lyxrc ||
2155 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2156 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2160 case RC_COMPLETION_INLINE_DELAY:
2161 if (ignore_system_lyxrc ||
2162 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2163 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2167 case RC_COMPLETION_INLINE_MATH:
2168 if (ignore_system_lyxrc ||
2169 completion_inline_math != system_lyxrc.completion_inline_math) {
2170 os << "\\completion_inline_math "
2171 << convert<string>(completion_inline_math) << '\n';
2175 case RC_COMPLETION_INLINE_TEXT:
2176 if (ignore_system_lyxrc ||
2177 completion_inline_text != system_lyxrc.completion_inline_text) {
2178 os << "\\completion_inline_text "
2179 << convert<string>(completion_inline_text) << '\n';
2183 case RC_COMPLETION_INLINE_DOTS:
2184 if (ignore_system_lyxrc ||
2185 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2186 os << "\\completion_inline_dots "
2187 << convert<string>(completion_inline_dots) << '\n';
2191 case RC_COMPLETION_POPUP_DELAY:
2192 if (ignore_system_lyxrc ||
2193 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2194 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2198 case RC_COMPLETION_POPUP_MATH:
2199 if (ignore_system_lyxrc ||
2200 completion_popup_math != system_lyxrc.completion_popup_math) {
2201 os << "\\completion_popup_math "
2202 << convert<string>(completion_popup_math) << '\n';
2206 case RC_COMPLETION_POPUP_TEXT:
2207 if (ignore_system_lyxrc ||
2208 completion_popup_text != system_lyxrc.completion_popup_text) {
2209 os << "\\completion_popup_text "
2210 << convert<string>(completion_popup_text) << '\n';
2214 case RC_COMPLETION_CURSOR_TEXT:
2215 if (ignore_system_lyxrc ||
2216 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2217 os << "\\completion_cursor_text "
2218 << convert<string>(completion_cursor_text) << '\n';
2222 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2223 if (ignore_system_lyxrc ||
2224 completion_popup_after_complete
2225 != system_lyxrc.completion_popup_after_complete) {
2226 os << "\\completion_popup_after_complete "
2227 << convert<string>(completion_popup_after_complete) << '\n';
2231 case RC_NUMLASTFILES:
2232 if (ignore_system_lyxrc ||
2233 num_lastfiles != system_lyxrc.num_lastfiles) {
2234 os << "\\num_lastfiles " << num_lastfiles << '\n';
2238 case RC_CHECKLASTFILES:
2239 if (ignore_system_lyxrc ||
2240 check_lastfiles != system_lyxrc.check_lastfiles) {
2241 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2246 case RC_EXAMPLEPATH:
2247 if (ignore_system_lyxrc ||
2248 example_path != system_lyxrc.example_path) {
2249 string const path = os::external_path(example_path);
2250 os << "\\example_path \"" << path << "\"\n";
2254 case RC_TEMPLATEPATH:
2255 if (ignore_system_lyxrc ||
2256 template_path != system_lyxrc.template_path) {
2257 string const path = os::external_path(template_path);
2258 os << "\\template_path \"" << path << "\"\n";
2262 case RC_TEMPDIRPATH:
2263 if (ignore_system_lyxrc ||
2264 tempdir_path != system_lyxrc.tempdir_path) {
2265 string const path = os::external_path(tempdir_path);
2266 os << "\\tempdir_path \"" << path << "\"\n";
2274 case RC_PLAINTEXT_LINELEN:
2275 if (ignore_system_lyxrc ||
2276 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2277 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2281 case RC_MAKE_BACKUP:
2282 if (ignore_system_lyxrc ||
2283 make_backup != system_lyxrc.make_backup) {
2284 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2288 case RC_BACKUPDIR_PATH:
2289 if (ignore_system_lyxrc ||
2290 backupdir_path != system_lyxrc.backupdir_path) {
2291 string const path = os::external_path(backupdir_path);
2292 os << "\\backupdir_path \"" << path << "\"\n";
2298 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2301 case RC_PLAINTEXT_ROFF_COMMAND:
2302 if (ignore_system_lyxrc ||
2303 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2304 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2311 << "# SPELLCHECKER SECTION ##############################\n"
2313 case RC_USE_SPELL_LIB:
2314 if (ignore_system_lyxrc ||
2315 use_spell_lib != system_lyxrc.use_spell_lib) {
2316 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2320 case RC_SPELL_COMMAND:
2321 if (ignore_system_lyxrc ||
2322 isp_command != system_lyxrc.isp_command) {
2323 os << "\\spell_command \"" << isp_command << "\"\n";
2327 case RC_ACCEPT_COMPOUND:
2328 if (ignore_system_lyxrc ||
2329 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2330 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2335 case RC_USE_ALT_LANG:
2336 if (ignore_system_lyxrc ||
2337 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2338 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2344 if (ignore_system_lyxrc ||
2345 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2346 os << "\\alternate_language \"" << isp_alt_lang
2351 case RC_USE_ESC_CHARS:
2352 if (ignore_system_lyxrc ||
2353 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2354 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2360 if (ignore_system_lyxrc ||
2361 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2362 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2366 case RC_USE_PERS_DICT:
2367 if (ignore_system_lyxrc ||
2368 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2369 os << "\\use_personal_dictionary "
2370 << convert<string>(isp_use_pers_dict)
2375 case RC_USE_TOOLTIP:
2376 if (ignore_system_lyxrc ||
2377 use_tooltip != system_lyxrc.use_tooltip) {
2378 os << "\\use_tooltip "
2379 << convert<string>(use_tooltip)
2382 case RC_USE_PIXMAP_CACHE:
2383 if (ignore_system_lyxrc ||
2384 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2385 os << "\\use_pixmap_cache "
2386 << convert<string>(use_pixmap_cache)
2390 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2391 string const path = os::external_path(isp_pers_dict);
2392 os << "\\personal_dictionary \"" << path << "\"\n";
2396 case RC_USE_INP_ENC:
2397 if (ignore_system_lyxrc ||
2398 isp_use_input_encoding
2399 != system_lyxrc.isp_use_input_encoding) {
2400 os << "\\use_input_encoding "
2401 << convert<string>(isp_use_input_encoding)
2408 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2411 case RC_RTL_SUPPORT:
2412 if (ignore_system_lyxrc ||
2413 rtl_support != system_lyxrc.rtl_support) {
2414 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2418 case RC_VISUAL_CURSOR:
2419 if (ignore_system_lyxrc ||
2420 visual_cursor != system_lyxrc.visual_cursor) {
2421 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2425 case RC_LANGUAGE_PACKAGE:
2426 if (ignore_system_lyxrc ||
2427 language_package != system_lyxrc.language_package) {
2428 os << "\\language_package \"" << language_package
2433 case RC_LANGUAGE_GLOBAL_OPTIONS:
2434 if (ignore_system_lyxrc ||
2435 language_global_options
2436 != system_lyxrc.language_global_options) {
2437 os << "\\language_global_options \""
2438 << convert<string>(language_global_options)
2443 case RC_LANGUAGE_USE_BABEL:
2444 if (ignore_system_lyxrc ||
2445 language_use_babel != system_lyxrc.language_use_babel) {
2446 os << "\\language_use_babel \""
2447 << convert<string>(language_use_babel)
2452 case RC_LANGUAGE_COMMAND_BEGIN:
2453 if (ignore_system_lyxrc ||
2454 language_command_begin
2455 != system_lyxrc.language_command_begin) {
2456 os << "\\language_command_begin \""
2457 << language_command_begin
2462 case RC_LANGUAGE_COMMAND_END:
2463 if (ignore_system_lyxrc ||
2464 language_command_end
2465 != system_lyxrc.language_command_end) {
2466 os << "\\language_command_end \"" << language_command_end
2471 case RC_LANGUAGE_COMMAND_LOCAL:
2472 if (ignore_system_lyxrc ||
2473 language_command_local
2474 != system_lyxrc.language_command_local) {
2475 os << "\\language_command_local \""
2476 << language_command_local
2481 case RC_LANGUAGE_AUTO_BEGIN:
2482 if (ignore_system_lyxrc ||
2483 language_auto_begin != system_lyxrc.language_auto_begin) {
2484 os << "\\language_auto_begin "
2485 << convert<string>(language_auto_begin) << '\n';
2489 case RC_LANGUAGE_AUTO_END:
2490 if (ignore_system_lyxrc ||
2491 language_auto_end != system_lyxrc.language_auto_end) {
2492 os << "\\language_auto_end "
2493 << convert<string>(language_auto_end) << '\n';
2497 case RC_MARK_FOREIGN_LANGUAGE:
2498 if (ignore_system_lyxrc ||
2499 mark_foreign_language
2500 != system_lyxrc.mark_foreign_language) {
2501 os << "\\mark_foreign_language " <<
2502 convert<string>(mark_foreign_language) << '\n';
2508 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2511 case RC_AUTO_NUMBER:
2512 if (ignore_system_lyxrc ||
2513 auto_number != system_lyxrc.auto_number) {
2514 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2518 case RC_DEFAULT_LANGUAGE:
2519 if (ignore_system_lyxrc ||
2520 default_language != system_lyxrc.default_language) {
2521 os << "\\default_language " << default_language << '\n';
2527 << "# FORMATS SECTION ##########################\n"
2531 // New/modified formats
2532 for (Formats::const_iterator cit = formats.begin();
2533 cit != formats.end(); ++cit) {
2534 Format const * format =
2535 system_formats.getFormat(cit->name());
2537 format->extension() != cit->extension() ||
2538 format->prettyname() != cit->prettyname() ||
2539 format->shortcut() != cit->shortcut() ||
2540 format->viewer() != cit->viewer() ||
2541 format->editor() != cit->editor() ||
2542 format->documentFormat() != cit->documentFormat() ||
2543 format->vectorFormat() != cit->vectorFormat()) {
2544 os << "\\format \"" << cit->name() << "\" \""
2545 << cit->extension() << "\" \""
2546 << cit->prettyname() << "\" \""
2547 << cit->shortcut() << "\" \""
2548 << cit->viewer() << "\" \""
2549 << cit->editor() << "\" \"";
2550 vector<string> flags;
2551 if (cit->documentFormat())
2552 flags.push_back("document");
2553 if (cit->vectorFormat())
2554 flags.push_back("vector");
2555 os << getStringFromVector(flags);
2560 // Look for deleted formats
2561 for (Formats::const_iterator cit = system_formats.begin();
2562 cit != system_formats.end(); ++cit)
2563 if (!formats.getFormat(cit->name()))
2564 os << "\\format \"" << cit->name()
2565 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2574 << "# CONVERTERS SECTION ##########################\n"
2578 // Look for new converters
2579 for (Converters::const_iterator cit = theConverters().begin();
2580 cit != theConverters().end(); ++cit) {
2581 Converter const * converter =
2582 theSystemConverters().getConverter(cit->from,
2585 converter->command != cit->command ||
2586 converter->flags != cit->flags)
2587 os << "\\converter \"" << cit->from << "\" \""
2588 << cit->to << "\" \""
2589 << cit->command << "\" \""
2590 << cit->flags << "\"\n";
2593 // New/modifed converters
2594 for (Converters::const_iterator cit = theSystemConverters().begin();
2595 cit != theSystemConverters().end(); ++cit)
2596 if (!theConverters().getConverter(cit->from, cit->to))
2597 os << "\\converter \"" << cit->from
2598 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2605 << "# COPIERS SECTION ##########################\n"
2608 // Look for new movers
2609 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2610 Movers::const_iterator const sysend = theSystemMovers().end();
2611 Movers::const_iterator it = theMovers().begin();
2612 Movers::const_iterator end = theMovers().end();
2614 for (; it != end; ++it) {
2615 Movers::const_iterator const sysit =
2616 find_if(sysbegin, sysend, SameMover(*it));
2617 if (sysit == sysend) {
2618 string const & fmt = it->first;
2619 string const & command =
2620 it->second.command();
2622 os << "\\copier " << fmt
2623 << " \"" << command << "\"\n";
2629 // We don't actually delete SpecialisedMover(s) from the
2630 // map, just clear their 'command', so there's no need
2631 // to test for anything else.
2639 string const LyXRC::getDescription(LyXRCTags tag)
2644 case RC_ACCEPT_COMPOUND:
2645 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2649 case RC_USE_ALT_LANG:
2650 str = _("Specify an alternate language. The default is to use the language of the document.");
2653 case RC_PLAINTEXT_ROFF_COMMAND:
2654 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.");
2657 case RC_PLAINTEXT_LINELEN:
2658 str = _("The maximum line length of exported plain text/LaTeX/SGML files. If set to 0, paragraphs are output in a single line; if the line length is > 0, paragraphs are separated by a blank line.");
2661 case RC_AUTOREGIONDELETE:
2662 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2665 case RC_AUTORESET_OPTIONS:
2666 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2670 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2673 case RC_AUTO_NUMBER:
2676 case RC_BACKUPDIR_PATH:
2677 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.");
2680 case RC_BIBTEX_COMMAND:
2681 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2685 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2688 case RC_CHECKLASTFILES:
2689 str = _("Select to check whether the lastfiles still exist.");
2692 case RC_CHKTEX_COMMAND:
2693 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2702 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2703 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.");
2706 case RC_SHOW_MACRO_LABEL:
2707 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2710 case RC_CUSTOM_EXPORT_COMMAND:
2713 case RC_CUSTOM_EXPORT_FORMAT:
2716 case RC_DATE_INSERT_FORMAT:
2717 //xgettext:no-c-format
2718 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2722 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2725 case RC_DEFAULT_LANGUAGE:
2726 str = _("New documents will be assigned this language.");
2729 case RC_DEFAULT_PAPERSIZE:
2730 str = _("Specify the default paper size.");
2733 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2734 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2737 case RC_DISPLAY_GRAPHICS:
2738 str = _("Select how LyX will display any graphics.");
2741 case RC_DOCUMENTPATH:
2742 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2746 case RC_USE_ESC_CHARS:
2747 str = _("Specify additional chars that can be part of a word.");
2750 case RC_EXAMPLEPATH:
2751 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2754 case RC_FONT_ENCODING:
2755 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2761 case RC_INDEX_COMMAND:
2762 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\".");
2769 case RC_KBMAP_PRIMARY:
2770 case RC_KBMAP_SECONDARY:
2771 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.");
2774 case RC_LABEL_INIT_LENGTH:
2775 str = _("Maximum number of words in the initialization string for a new label");
2778 case RC_LANGUAGE_AUTO_BEGIN:
2779 str = _("Select if a language switching command is needed at the beginning of the document.");
2782 case RC_LANGUAGE_AUTO_END:
2783 str = _("Select if a language switching command is needed at the end of the document.");
2786 case RC_LANGUAGE_COMMAND_BEGIN:
2787 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.");
2790 case RC_LANGUAGE_COMMAND_END:
2791 str = _("The LaTeX command for changing back to the language of the document.");
2794 case RC_LANGUAGE_COMMAND_LOCAL:
2795 str = _("The LaTeX command for local changing of the language.");
2798 case RC_LANGUAGE_GLOBAL_OPTIONS:
2799 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2802 case RC_LANGUAGE_PACKAGE:
2803 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2806 case RC_LANGUAGE_USE_BABEL:
2807 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2810 case RC_USELASTFILEPOS:
2811 str = _("De-select if you do not want LyX to scroll to saved position.");
2814 case RC_LOADSESSION:
2815 str = _("De-select to prevent loading files opened from the last LyX session.");
2818 case RC_MAKE_BACKUP:
2819 str = _("De-select if you don't want LyX to create backup files.");
2822 case RC_MARK_FOREIGN_LANGUAGE:
2823 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2826 case RC_MOUSE_WHEEL_SPEED:
2827 str = bformat(_("The scrolling speed of the mouse wheel."),
2831 case RC_COMPLETION_POPUP_DELAY:
2832 str = _("The completion popup delay.");
2835 case RC_COMPLETION_POPUP_MATH:
2836 str = _("Select to display the completion popup in math mode.");
2839 case RC_COMPLETION_POPUP_TEXT:
2840 str = _("Select to display the completion popup in text mode.");
2843 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2844 str = _("Show the completion popup without delay after non-unique completion attempt.");
2847 case RC_COMPLETION_POPUP_TEXT:
2848 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2851 case RC_COMPLETION_POPUP_DELAY:
2852 str = _("The inline completion delay.");
2855 case RC_COMPLETION_INLINE_MATH:
2856 str = _("Select to display the inline completion in math mode.");
2859 case RC_COMPLETION_INLINE_TEXT:
2860 str = _("Select to display the inline completion in text mode.");
2863 case RC_COMPLETION_INLINE_DOTS:
2864 str = _("Use \"...\" to shorten long completions.");
2867 case RC_NUMLASTFILES:
2868 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2872 case RC_PATH_PREFIX:
2873 str = _("Specify those directories which should be "
2874 "prepended to the PATH environment variable. "
2875 "Use the OS native format.");
2879 case RC_USE_PERS_DICT:
2880 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2884 str = _("Shows a typeset preview of things such as math");
2887 case RC_PREVIEW_HASHED_LABELS:
2888 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2891 case RC_PREVIEW_SCALE_FACTOR:
2892 str = _("Scale the preview size to suit.");
2895 case RC_PRINTCOLLCOPIESFLAG:
2896 str = _("The option for specifying whether the copies should be collated.");
2899 case RC_PRINTCOPIESFLAG:
2900 str = _("The option for specifying the number of copies to print.");
2904 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2907 case RC_PRINTEVENPAGEFLAG:
2908 str = _("The option to print only even pages.");
2911 case RC_PRINTEXSTRAOPTIONS:
2912 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2915 case RC_PRINTFILEEXTENSION:
2916 str = _("Extension of printer program output file. Usually \".ps\".");
2919 case RC_PRINTLANDSCAPEFLAG:
2920 str = _("The option to print out in landscape.");
2923 case RC_PRINTODDPAGEFLAG:
2924 str = _("The option to print only odd pages.");
2927 case RC_PRINTPAGERANGEFLAG:
2928 str = _("The option for specifying a comma-separated list of pages to print.");
2931 case RC_PRINTPAPERDIMENSIONFLAG:
2932 str = _("Option to specify the dimensions of the print paper.");
2935 case RC_PRINTPAPERFLAG:
2936 str = _("The option to specify paper type.");
2939 case RC_PRINTREVERSEFLAG:
2940 str = _("The option to reverse the order of the pages printed.");
2943 case RC_PRINTSPOOL_COMMAND:
2944 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.");
2947 case RC_PRINTSPOOL_PRINTERPREFIX:
2948 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.");
2951 case RC_PRINTTOFILE:
2952 str = _("Option to pass to the print program to print to a file.");
2955 case RC_PRINTTOPRINTER:
2956 str = _("Option to pass to the print program to print on a specific printer.");
2959 case RC_PRINT_ADAPTOUTPUT:
2960 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2963 case RC_PRINT_COMMAND:
2964 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2967 case RC_RTL_SUPPORT:
2968 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2971 case RC_VISUAL_CURSOR:
2972 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2976 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2979 case RC_SCREEN_FONT_ROMAN:
2980 case RC_SCREEN_FONT_SANS:
2981 case RC_SCREEN_FONT_TYPEWRITER:
2982 str = _("The screen fonts used to display the text while editing.");
2985 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2986 case RC_SCREEN_FONT_SANS_FOUNDRY:
2987 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2990 case RC_SCREEN_FONT_SCALABLE:
2991 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.");
2994 case RC_SCREEN_FONT_SIZES:
2995 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2998 case RC_SCREEN_ZOOM:
2999 //xgettext:no-c-format
3000 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3003 case RC_GEOMETRY_SESSION:
3004 str = _("Allow session manager to save and restore windows geometry.");
3008 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3014 case RC_SHOW_BANNER:
3015 str = _("De-select if you don't want the startup banner.");
3018 case RC_SPELL_COMMAND:
3019 str = _("What command runs the spellchecker?");
3022 case RC_TEMPDIRPATH:
3023 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3026 case RC_TEMPLATEPATH:
3027 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3030 case RC_TEX_ALLOWS_SPACES:
3033 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3037 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3049 case RC_USE_INP_ENC:
3050 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.");
3053 case RC_USE_TOOLTIP:
3054 str = _("Enable the automatic appearance of tool tips in the work area.");
3057 case RC_USE_PIXMAP_CACHE:
3058 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3061 case RC_USE_SPELL_LIB:
3064 case RC_VIEWDVI_PAPEROPTION:
3065 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3080 // The global instance
3083 // The global copy of the system lyxrc entries (everything except preferences)