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 LexerKeyword 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(lyxrcTags[0]);
198 void LyXRC::setDefaults()
201 def_file = "default";
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:
231 allow_geometry_session = true;
232 // Default LaTeX font size:
233 font_sizes[FONT_SIZE_TINY] = "5.0";
234 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
235 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
236 font_sizes[FONT_SIZE_SMALL] = "9.0";
237 font_sizes[FONT_SIZE_NORMAL] = "10.0";
238 font_sizes[FONT_SIZE_LARGE] = "12.0";
239 font_sizes[FONT_SIZE_LARGER] = "14.4";
240 font_sizes[FONT_SIZE_LARGEST] = "17.26";
241 font_sizes[FONT_SIZE_HUGE] = "20.74";
242 font_sizes[FONT_SIZE_HUGER] = "24.88";
243 use_scalable_fonts = true;
244 roman_font_name = "";
246 typewriter_font_name = "";
248 auto_region_delete = true;
249 auto_reset_options = false;
250 plaintext_linelen = 65;
251 mouse_wheel_speed = 1.0;
252 num_lastfiles = maxlastfiles;
253 check_lastfiles = true;
254 use_lastfilepos = true;
255 load_session = false;
257 backupdir_path.erase();
258 display_graphics = graphics::ColorDisplay;
259 // Spellchecker settings:
260 use_spell_lib = true;
261 isp_command = "ispell";
262 isp_accept_compound = false;
263 isp_use_input_encoding = false;
264 isp_use_alt_lang = false;
265 isp_use_pers_dict = false;
266 isp_use_esc_chars = false;
269 visual_cursor = false;
271 mark_foreign_language = true;
272 language_auto_begin = true;
273 language_auto_end = true;
274 language_global_options = true;
275 language_use_babel = true;
276 language_package = "\\usepackage{babel}";
277 language_command_begin = "\\selectlanguage{$$lang}";
278 language_command_local = "\\foreignlanguage{$$lang}{";
279 sort_layouts = false;
280 group_layouts = true;
281 default_language = "english";
283 windows_style_tex_paths = false;
284 tex_allows_spaces = false;
285 date_insert_format = "%x";
286 cursor_follows_scrollbar = false;
287 macro_edit_style = MACRO_EDIT_INLINE_BOX;
288 dialogs_iconify_with_main = false;
289 label_init_length = 3;
290 preview = PREVIEW_OFF;
291 preview_hashed_labels = false;
292 preview_scale_factor = "0.9";
293 use_converter_cache = true;
295 use_pixmap_cache = false;
296 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
297 user_name = to_utf8(support::user_name());
298 user_email = to_utf8(support::user_email());
299 open_buffers_in_tabs = true;
300 use_bundled_format = false;
302 // Fullscreen settings
303 full_screen_limit = false;
304 full_screen_toolbars = true;
305 full_screen_tabbar = true;
306 full_screen_scrollbar = true;
307 full_screen_width = 700;
309 completion_cursor_text = true;
310 completion_popup_math = true;
311 completion_popup_text = false;
312 completion_popup_delay = 2.0;
313 completion_popup_after_complete = true;
314 completion_inline_math = true;
315 completion_inline_text = false;
316 completion_inline_dots = -1;
317 completion_inline_delay = 0.2;
323 void oldFontFormat(string & family, string & foundry)
325 if (family.empty() || family[0] != '-')
327 foundry = token(family, '-', 1);
328 family = token(family, '-', 2);
336 int LyXRC::read(FileName const & filename)
338 Lexer lexrc(lyxrcTags);
339 if (lyxerr.debugging(Debug::PARSER))
340 lexrc.printTable(lyxerr);
342 lexrc.setFile(filename);
343 if (!lexrc.isOK()) return -2;
345 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
351 int LyXRC::read(istream & is)
353 Lexer lexrc(lyxrcTags);
354 if (lyxerr.debugging(Debug::PARSER))
355 lexrc.printTable(lyxerr);
361 LYXERR(Debug::LYXRC, "Reading istream...");
367 int LyXRC::read(Lexer & lexrc)
369 if (!lexrc.isOK()) return -2;
371 while (lexrc.isOK()) {
372 // By using two switches we take advantage of the compiler
373 // telling us if we have missed a LyXRCTags element in
374 // the second switch.
375 // Note that this also shows a problem with Lexer since it
376 // helps us avoid taking advantage of the strictness of the
379 int le = lexrc.lex();
381 case Lexer::LEX_UNDEF:
382 lexrc.printError("Unknown tag `$$Token'");
384 case Lexer::LEX_FEOF:
388 switch (static_cast<LyXRCTags>(le)) {
389 case RC_INPUT: // Include file
392 libFileSearch(string(),
395 lexrc.printError("Error reading "
396 "included file: " + tmp.absFilename());
402 bind_file = os::internal_path(lexrc.getString());
408 def_file = os::internal_path(lexrc.getString());
414 ui_file = os::internal_path(lexrc.getString());
418 case RC_AUTORESET_OPTIONS:
420 auto_reset_options = lexrc.getBool();
424 case RC_DISPLAY_GRAPHICS:
426 display_graphics = graphics::displayTranslator().find(lexrc.getString());
430 case RC_TEX_EXPECTS_WINDOWS_PATHS:
432 windows_style_tex_paths = lexrc.getBool();
436 case RC_TEX_ALLOWS_SPACES:
438 tex_allows_spaces = lexrc.getBool();
444 use_kbmap = lexrc.getBool();
448 case RC_KBMAP_PRIMARY:
450 string const kmap(os::internal_path(lexrc.getString()));
453 } else if (!libFileSearch("kbd", kmap,
455 primary_kbmap = kmap;
457 lexrc.printError("LyX: Keymap `$$Token' not found");
462 case RC_KBMAP_SECONDARY:
464 string const kmap(os::internal_path(lexrc.getString()));
467 } else if (!libFileSearch("kbd", kmap,
469 secondary_kbmap = kmap;
471 lexrc.printError("LyX: Keymap `$$Token' not found");
476 case RC_FONT_ENCODING:
478 fontenc = lexrc.getString();
484 printer = lexrc.getString();
488 case RC_PRINT_COMMAND:
490 print_command = lexrc.getString();
494 case RC_PRINTEVENPAGEFLAG:
496 print_evenpage_flag = lexrc.getString();
500 case RC_PRINTODDPAGEFLAG:
502 print_oddpage_flag = lexrc.getString();
506 case RC_PRINTPAGERANGEFLAG:
508 print_pagerange_flag = lexrc.getString();
512 case RC_PRINTCOPIESFLAG:
514 print_copies_flag = lexrc.getString();
518 case RC_PRINTCOLLCOPIESFLAG:
520 print_collcopies_flag = lexrc.getString();
524 case RC_PRINTREVERSEFLAG:
526 print_reverse_flag = lexrc.getString();
530 case RC_PRINTLANDSCAPEFLAG:
532 print_landscape_flag = lexrc.getString();
536 case RC_PRINTTOPRINTER:
538 print_to_printer = lexrc.getString();
542 case RC_PRINT_ADAPTOUTPUT:
544 print_adapt_output = lexrc.getBool();
550 print_to_file = os::internal_path(lexrc.getString());
554 case RC_PRINTFILEEXTENSION:
556 print_file_extension = lexrc.getString();
560 case RC_PRINTEXSTRAOPTIONS:
562 print_extra_options = lexrc.getString();
566 case RC_PRINTSPOOL_COMMAND:
568 print_spool_command = lexrc.getString();
572 case RC_PRINTSPOOL_PRINTERPREFIX:
574 print_spool_printerprefix = lexrc.getString();
578 case RC_PRINTPAPERDIMENSIONFLAG:
580 print_paper_dimension_flag = lexrc.getString();
584 case RC_PRINTPAPERFLAG:
586 print_paper_flag = lexrc.getString();
590 case RC_CUSTOM_EXPORT_COMMAND:
592 custom_export_command = lexrc.getString();
596 case RC_CUSTOM_EXPORT_FORMAT:
598 custom_export_format = lexrc.getString();
602 case RC_DEFAULT_PAPERSIZE:
605 ascii_lowercase(lexrc.getString());
606 if (size == "usletter")
609 else if (size == "legal")
612 else if (size == "executive")
615 else if (size == "a3")
618 else if (size == "a4")
621 else if (size == "a5")
624 else if (size == "b5")
627 else if (size == "default")
633 case RC_VIEWDVI_PAPEROPTION:
635 view_dvi_paper_option = lexrc.getString();
637 view_dvi_paper_option.erase();
641 case RC_CHKTEX_COMMAND:
643 chktex_command = lexrc.getString();
647 case RC_BIBTEX_COMMAND:
649 bibtex_command = lexrc.getString();
653 case RC_INDEX_COMMAND:
655 index_command = lexrc.getString();
661 dpi = lexrc.getInteger();
667 zoom = lexrc.getInteger();
671 case RC_GEOMETRY_SESSION:
673 allow_geometry_session = lexrc.getBool();
677 case RC_SCREEN_FONT_SIZES:
679 font_sizes[FONT_SIZE_TINY] =
683 font_sizes[FONT_SIZE_SCRIPT] =
687 font_sizes[FONT_SIZE_FOOTNOTE] =
691 font_sizes[FONT_SIZE_SMALL] =
695 font_sizes[FONT_SIZE_NORMAL] =
699 font_sizes[FONT_SIZE_LARGE] =
703 font_sizes[FONT_SIZE_LARGER] =
707 font_sizes[FONT_SIZE_LARGEST] =
711 font_sizes[FONT_SIZE_HUGE] =
715 font_sizes[FONT_SIZE_HUGER] =
720 case RC_SCREEN_FONT_SCALABLE:
722 use_scalable_fonts = lexrc.getBool();
728 autosave = lexrc.getInteger();
732 case RC_DOCUMENTPATH:
734 document_path = os::internal_path(lexrc.getString());
735 document_path = expandPath(document_path);
741 example_path = os::internal_path(lexrc.getString());
742 example_path = expandPath(example_path);
746 case RC_TEMPLATEPATH:
748 template_path = os::internal_path(lexrc.getString());
749 template_path = expandPath(template_path);
755 tempdir_path = os::internal_path(lexrc.getString());
756 tempdir_path = expandPath(tempdir_path);
762 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
766 case RC_USELASTFILEPOS:
768 use_lastfilepos = lexrc.getBool();
774 load_session = lexrc.getBool();
778 case RC_MOUSE_WHEEL_SPEED:
780 mouse_wheel_speed = lexrc.getFloat();
784 case RC_COMPLETION_INLINE_DELAY:
786 completion_inline_delay = lexrc.getFloat();
790 case RC_COMPLETION_INLINE_MATH:
792 completion_inline_math = lexrc.getBool();
796 case RC_COMPLETION_INLINE_TEXT:
798 completion_inline_text = lexrc.getBool();
802 case RC_COMPLETION_INLINE_DOTS:
804 completion_inline_dots = lexrc.getInteger();
808 case RC_COMPLETION_POPUP_DELAY:
810 completion_popup_delay = lexrc.getFloat();
814 case RC_COMPLETION_POPUP_MATH:
816 completion_popup_math = lexrc.getBool();
820 case RC_COMPLETION_POPUP_TEXT:
822 completion_popup_text = lexrc.getBool();
826 case RC_COMPLETION_CURSOR_TEXT:
828 completion_cursor_text = lexrc.getBool();
832 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
834 completion_popup_after_complete = lexrc.getBool();
838 case RC_NUMLASTFILES:
840 num_lastfiles = lexrc.getInteger();
844 case RC_CHECKLASTFILES:
846 check_lastfiles = lexrc.getBool();
850 case RC_SCREEN_FONT_ROMAN:
852 roman_font_name = lexrc.getString();
853 oldFontFormat(roman_font_name,
858 case RC_SCREEN_FONT_SANS:
860 sans_font_name = lexrc.getString();
861 oldFontFormat(sans_font_name, sans_font_foundry);
865 case RC_SCREEN_FONT_TYPEWRITER:
867 typewriter_font_name = lexrc.getString();
868 oldFontFormat(typewriter_font_name,
869 typewriter_font_foundry);
873 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
875 roman_font_foundry = lexrc.getString();
879 case RC_SCREEN_FONT_SANS_FOUNDRY:
881 sans_font_foundry = lexrc.getString();
885 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
887 typewriter_font_foundry = lexrc.getString();
893 string lyx_name, x11_name;
896 lyx_name = lexrc.getString();
898 lexrc.printError("Missing color tag.");
903 x11_name = lexrc.getString();
905 lexrc.printError("Missing color name for color: `$$Token'");
909 ColorCode const col =
910 lcolor.getFromLyXName(lyx_name);
911 if (col == Color_none ||
912 col == Color_inherit ||
916 if (!lcolor.setColor(col, x11_name)) {
917 lyxerr << "Bad lyxrc set_color for "
923 case RC_AUTOREGIONDELETE:
924 // Auto region delete defaults to true
926 auto_region_delete = lexrc.getBool();
932 lyxpipes = os::internal_path(lexrc.getString());
933 lyxpipes = expandPath(lyxpipes);
937 case RC_CURSOR_FOLLOWS_SCROLLBAR:
939 cursor_follows_scrollbar = lexrc.getBool();
943 case RC_MACRO_EDIT_STYLE:
945 switch (lexrc.getInteger()) {
946 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
947 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
948 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
953 case RC_DIALOGS_ICONIFY_WITH_MAIN:
955 dialogs_iconify_with_main = lexrc.getBool();
959 case RC_PLAINTEXT_ROFF_COMMAND:
961 plaintext_roff_command = lexrc.getString();
964 case RC_PLAINTEXT_LINELEN:
966 plaintext_linelen = lexrc.getInteger();
969 // Spellchecker settings:
970 case RC_USE_SPELL_LIB:
972 use_spell_lib = lexrc.getBool();
975 case RC_SPELL_COMMAND:
977 isp_command = lexrc.getString();
980 case RC_ACCEPT_COMPOUND:
982 isp_accept_compound = lexrc.getBool();
987 isp_use_input_encoding = lexrc.getBool();
990 case RC_USE_ALT_LANG:
992 isp_use_alt_lang = lexrc.getBool();
995 case RC_USE_PERS_DICT:
997 isp_use_pers_dict = lexrc.getBool();
1000 case RC_USE_TOOLTIP:
1002 use_tooltip = lexrc.getBool();
1005 case RC_USE_PIXMAP_CACHE:
1007 use_pixmap_cache = lexrc.getBool();
1010 case RC_USE_ESC_CHARS:
1012 isp_use_esc_chars = lexrc.getBool();
1017 isp_alt_lang = lexrc.getString();
1022 isp_pers_dict = os::internal_path(lexrc.getString());
1027 isp_esc_chars = lexrc.getString();
1030 case RC_MAKE_BACKUP:
1032 make_backup = lexrc.getBool();
1035 case RC_BACKUPDIR_PATH:
1037 backupdir_path = os::internal_path(lexrc.getString());
1038 backupdir_path = expandPath(backupdir_path);
1041 case RC_DATE_INSERT_FORMAT:
1043 date_insert_format = lexrc.getString();
1046 case RC_LANGUAGE_PACKAGE:
1048 language_package = lexrc.getString();
1051 case RC_LANGUAGE_AUTO_BEGIN:
1053 language_auto_begin = lexrc.getBool();
1056 case RC_LANGUAGE_AUTO_END:
1058 language_auto_end = lexrc.getBool();
1061 case RC_LANGUAGE_GLOBAL_OPTIONS:
1063 language_global_options = lexrc.getBool();
1066 case RC_LANGUAGE_USE_BABEL:
1068 language_use_babel = lexrc.getBool();
1071 case RC_LANGUAGE_COMMAND_BEGIN:
1073 language_command_begin = lexrc.getString();
1076 case RC_LANGUAGE_COMMAND_END:
1078 language_command_end = lexrc.getString();
1081 case RC_LANGUAGE_COMMAND_LOCAL:
1083 language_command_local = lexrc.getString();
1086 case RC_RTL_SUPPORT:
1088 rtl_support = lexrc.getBool();
1091 case RC_VISUAL_CURSOR:
1093 visual_cursor = lexrc.getBool();
1096 case RC_AUTO_NUMBER:
1098 auto_number = lexrc.getBool();
1101 case RC_MARK_FOREIGN_LANGUAGE:
1103 mark_foreign_language = lexrc.getBool();
1108 string fmt, command;
1110 fmt = lexrc.getString();
1113 command = lexrc.getString();
1115 setMover(fmt, command);
1119 case RC_CONVERTER: {
1120 string from, to, command, flags;
1122 from = lexrc.getString();
1125 to = lexrc.getString();
1128 command = lexrc.getString();
1131 flags = lexrc.getString();
1133 if (command.empty()) {
1134 theConverters().erase(from, to);
1136 theConverters().add(from, to, command, flags);
1140 // compatibility with versions older than 1.4.0 only
1142 string format, command;
1144 format = lexrc.getString();
1147 command = lexrc.getString();
1149 formats.setViewer(format, command);
1153 string format, extension, prettyname, shortcut;
1155 format = lexrc.getString();
1158 extension = lexrc.getString();
1161 prettyname = lexrc.getString();
1164 shortcut = lexrc.getString();
1166 string viewer, editor;
1168 viewer = lexrc.getString();
1170 editor = lexrc.getString();
1172 // Hack to ensure compatibility with versions older
1174 int le = lexrc.lex();
1175 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1176 flags = lexrc.getString();
1177 if (le != Lexer::LEX_DATA) {
1178 // We have got a known token.
1179 // Therefore this is an old style
1180 // format definition without
1182 lexrc.pushToken(flags);
1186 int flgs = Format::none;
1187 while (!flags.empty()) {
1189 flags = split(flags, flag, ',');
1190 if (flag == "document")
1191 flgs |= Format::document;
1192 else if (flag == "vector")
1193 flgs |= Format::vector;
1195 lyxerr << "Ignoring unknown flag `"
1196 << flag << "' for format `"
1197 << format << "'." << endl;
1199 if (prettyname.empty()) {
1200 if (theConverters().formatIsUsed(format)) {
1201 lyxerr << "Can't delete format "
1204 formats.erase(format);
1207 formats.add(format, extension, prettyname,
1208 shortcut, viewer, editor, flgs);
1212 case RC_DEFAULT_LANGUAGE:
1214 default_language = lexrc.getString();
1218 case RC_LABEL_INIT_LENGTH:
1220 label_init_length = lexrc.getInteger();
1224 case RC_SHOW_BANNER:
1226 show_banner = lexrc.getBool();
1232 string const tmp = lexrc.getString();
1233 if (tmp == "true" || tmp == "on")
1234 preview = PREVIEW_ON;
1235 else if (tmp == "no_math")
1236 preview = PREVIEW_NO_MATH;
1238 preview = PREVIEW_OFF;
1239 if (tmp != "false" && tmp != "off")
1240 lyxerr << "Unrecognized "
1242 << tmp << '\n' << endl;
1247 case RC_PREVIEW_HASHED_LABELS:
1249 preview_hashed_labels = lexrc.getBool();
1253 case RC_PREVIEW_SCALE_FACTOR:
1255 preview_scale_factor = lexrc.getString();
1261 user_name = lexrc.getString();
1266 user_email = lexrc.getString();
1269 case RC_PATH_PREFIX:
1271 path_prefix = lexrc.getString();
1274 case RC_USE_CONVERTER_CACHE:
1276 use_converter_cache = lexrc.getBool();
1279 case RC_CONVERTER_CACHE_MAXAGE:
1281 converter_cache_maxage =
1282 convert<unsigned int>(lexrc.getString());
1285 case RC_SORT_LAYOUTS:
1287 sort_layouts = lexrc.getBool();
1289 case RC_GROUP_LAYOUTS:
1291 group_layouts = lexrc.getBool();
1293 case RC_FULL_SCREEN_LIMIT:
1295 full_screen_limit = lexrc.getBool();
1297 case RC_FULL_SCREEN_TOOLBARS:
1299 full_screen_toolbars = lexrc.getBool();
1301 case RC_FULL_SCREEN_SCROLLBAR:
1303 full_screen_scrollbar = lexrc.getBool();
1305 case RC_FULL_SCREEN_TABBAR:
1307 full_screen_tabbar = lexrc.getBool();
1309 case RC_FULL_SCREEN_WIDTH:
1311 full_screen_width = lexrc.getInteger();
1313 case RC_OPEN_BUFFERS_IN_TABS:
1315 open_buffers_in_tabs = lexrc.getBool();
1317 case RC_USE_BUNDLED_FORMAT:
1319 use_bundled_format = lexrc.getBool();
1322 case RC_LAST: break; // this is just a dummy
1326 /// Update converters data-structures
1327 theConverters().update(formats);
1328 theConverters().buildGraph();
1334 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1336 ofstream ofs(filename.toFilesystemEncoding().c_str());
1338 write(ofs, ignore_system_lyxrc);
1342 void LyXRC::print() const
1344 if (lyxerr.debugging())
1345 write(lyxerr, false);
1353 typedef pair<string, SpecialisedMover> Data;
1355 SameMover(Data const & comparison)
1356 : comparison_(comparison) {}
1358 bool operator()(Data const & data) const
1360 return data.first == comparison_.first &&
1361 data.second.command() == comparison_.second.command();
1369 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1371 LyXRCTags tag = RC_LAST;
1373 if (!name.empty()) {
1374 for (int i = 0; i != lyxrcCount; ++i)
1375 if ("\\" + name == lyxrcTags[i].tag)
1376 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1380 os << "### This file is part of\n"
1381 << "### ========================================================\n"
1382 << "### LyX, The Document Processor\n"
1384 << "### Copyright 1995 Matthias Ettrich\n"
1385 << "### Copyright 1995-2007 The LyX Team.\n"
1387 << "### ========================================================\n"
1389 << "# This file is written by LyX, if you want to make your own\n"
1390 << "# modifications you should do them from inside LyX and save\n"
1393 // Why the switch you might ask. It is a trick to ensure that all
1394 // the elements in the LyXRCTags enum is handled. As you can see
1395 // there are no breaks at all. So it is just a huge fall-through.
1396 // The nice thing is that we will get a warning from the compiler
1397 // if we forget an element.
1401 // input/include files are not done here
1403 if (ignore_system_lyxrc ||
1404 bind_file != system_lyxrc.bind_file) {
1405 string const path = os::external_path(bind_file);
1406 os << "\\bind_file \"" << path << "\"\n";
1412 if (ignore_system_lyxrc ||
1413 def_file != system_lyxrc.def_file) {
1414 string const path = os::external_path(def_file);
1415 os << "\\def_file \"" << path << "\"\n";
1424 << "# MISC SECTION ######################################\n"
1426 // bind files are not done here.
1428 case RC_PATH_PREFIX:
1429 if (ignore_system_lyxrc ||
1430 path_prefix != system_lyxrc.path_prefix) {
1431 os << "\\path_prefix \"" << path_prefix << "\"\n";
1436 if (ignore_system_lyxrc ||
1437 ui_file != system_lyxrc.ui_file) {
1438 string const path = os::external_path(ui_file);
1439 os << "\\ui_file \"" << path << "\"\n";
1443 case RC_AUTOREGIONDELETE:
1444 if (ignore_system_lyxrc ||
1445 auto_region_delete != system_lyxrc.auto_region_delete) {
1446 os << "# Set to false to inhibit automatic replacement of\n"
1447 << "# the current selection.\n"
1448 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1453 case RC_AUTORESET_OPTIONS:
1454 if (ignore_system_lyxrc ||
1455 auto_reset_options != system_lyxrc.auto_reset_options) {
1456 os << "# Set to false to inhibit automatic reset of\n"
1457 << "# the class options to defaults on class change.\n"
1458 << "\\auto_reset_options "
1459 << convert<string>(auto_reset_options)
1465 if (ignore_system_lyxrc ||
1466 autosave != system_lyxrc.autosave) {
1467 os << "# The time interval between auto-saves in seconds.\n"
1468 << "\\autosave " << autosave << '\n';
1472 case RC_DISPLAY_GRAPHICS:
1473 if (ignore_system_lyxrc ||
1474 display_graphics != system_lyxrc.display_graphics) {
1475 os << "# Display graphics within LyX\n"
1476 << "# monochrome|grayscale|color|none\n"
1477 << "\\display_graphics "
1478 << graphics::displayTranslator().find(
1479 graphics::DisplayType(display_graphics))
1484 case RC_SORT_LAYOUTS:
1485 if (ignore_system_lyxrc ||
1486 sort_layouts != system_lyxrc.sort_layouts) {
1487 os << "# Sort layouts alphabetically.\n"
1488 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1492 case RC_GROUP_LAYOUTS:
1493 if (ignore_system_lyxrc ||
1494 group_layouts != system_lyxrc.group_layouts) {
1495 os << "# Group layouts by their category.\n"
1496 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1500 case RC_VIEWDVI_PAPEROPTION:
1501 if (ignore_system_lyxrc ||
1502 view_dvi_paper_option
1503 != system_lyxrc.view_dvi_paper_option) {
1504 os << "# Options used to specify paper size to the\n"
1505 << "# view_dvi_command (e.g. -paper)\n"
1506 << "\\view_dvi_paper_option \""
1507 << view_dvi_paper_option << "\"\n";
1511 case RC_DEFAULT_PAPERSIZE:
1512 if (ignore_system_lyxrc ||
1513 default_papersize != system_lyxrc.default_papersize) {
1514 os << "# The default papersize to use.\n"
1515 << "\\default_papersize \"";
1516 switch (default_papersize) {
1518 os << "default"; break;
1519 case PAPER_USLETTER:
1520 os << "usletter"; break;
1522 os << "legal"; break;
1523 case PAPER_USEXECUTIVE:
1524 os << "executive"; break;
1535 case PAPER_B4: break;
1541 case RC_CHKTEX_COMMAND:
1542 if (ignore_system_lyxrc ||
1543 chktex_command != system_lyxrc.chktex_command) {
1544 os << "\\chktex_command \"" << chktex_command << "\"\n";
1548 case RC_BIBTEX_COMMAND:
1549 if (ignore_system_lyxrc ||
1550 bibtex_command != system_lyxrc.bibtex_command) {
1551 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1555 case RC_INDEX_COMMAND:
1556 if (ignore_system_lyxrc ||
1557 index_command != system_lyxrc.index_command) {
1558 os << "\\index_command \"" << index_command << "\"\n";
1562 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1563 if (ignore_system_lyxrc ||
1564 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1565 os << "\\tex_expects_windows_paths "
1566 << convert<string>(windows_style_tex_paths) << '\n';
1570 case RC_TEX_ALLOWS_SPACES:
1571 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1572 os << "\\tex_allows_spaces "
1573 << convert<string>(tex_allows_spaces) << '\n';
1578 if (ignore_system_lyxrc ||
1579 use_kbmap != system_lyxrc.use_kbmap) {
1580 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1584 case RC_KBMAP_PRIMARY:
1585 if (ignore_system_lyxrc ||
1586 primary_kbmap != system_lyxrc.primary_kbmap) {
1587 string const path = os::external_path(primary_kbmap);
1588 os << "\\kbmap_primary \"" << path << "\"\n";
1592 case RC_KBMAP_SECONDARY:
1593 if (ignore_system_lyxrc ||
1594 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1595 string const path = os::external_path(secondary_kbmap);
1596 os << "\\kbmap_secondary \"" << path << "\"\n";
1601 if (ignore_system_lyxrc ||
1602 lyxpipes != system_lyxrc.lyxpipes) {
1603 string const path = os::external_path(lyxpipes);
1604 os << "\\serverpipe \"" << path << "\"\n";
1608 case RC_DATE_INSERT_FORMAT:
1609 if (ignore_system_lyxrc ||
1610 date_insert_format != system_lyxrc.date_insert_format) {
1611 os << "\\date_insert_format \"" << date_insert_format
1616 case RC_LABEL_INIT_LENGTH:
1617 if (ignore_system_lyxrc ||
1618 label_init_length != system_lyxrc.label_init_length) {
1619 os << "\\label_init_length " << label_init_length
1626 os << "\\user_name \"" << user_name << "\"\n";
1631 os << "\\user_email \"" << user_email << "\"\n";
1635 case RC_SHOW_BANNER:
1636 if (ignore_system_lyxrc ||
1637 show_banner != system_lyxrc.show_banner) {
1638 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1644 if (ignore_system_lyxrc ||
1645 preview != system_lyxrc.preview) {
1651 case PREVIEW_NO_MATH:
1658 os << "\\preview " << status << '\n';
1663 case RC_PREVIEW_HASHED_LABELS:
1664 if (ignore_system_lyxrc ||
1665 preview_hashed_labels !=
1666 system_lyxrc.preview_hashed_labels) {
1667 os << "\\preview_hashed_labels "
1668 << convert<string>(preview_hashed_labels) << '\n';
1673 case RC_PREVIEW_SCALE_FACTOR:
1674 if (ignore_system_lyxrc ||
1675 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1676 os << "\\preview_scale_factor "
1677 << preview_scale_factor << '\n';
1682 case RC_USE_CONVERTER_CACHE:
1683 if (ignore_system_lyxrc ||
1684 use_converter_cache != system_lyxrc.use_converter_cache) {
1685 os << "\\use_converter_cache "
1686 << convert<string>(use_converter_cache) << '\n';
1691 case RC_CONVERTER_CACHE_MAXAGE:
1692 if (ignore_system_lyxrc ||
1693 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1694 os << "\\converter_cache_maxage "
1695 << converter_cache_maxage << '\n';
1701 << "# SCREEN & FONTS SECTION ############################\n"
1705 if (ignore_system_lyxrc ||
1706 dpi != system_lyxrc.dpi) {
1707 os << "\\screen_dpi " << dpi << '\n';
1711 case RC_SCREEN_ZOOM:
1712 if (ignore_system_lyxrc ||
1713 zoom != system_lyxrc.zoom) {
1714 os << "\\screen_zoom " << zoom << '\n';
1718 case RC_GEOMETRY_SESSION:
1719 if (ignore_system_lyxrc ||
1720 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1721 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1726 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1727 if (ignore_system_lyxrc ||
1728 cursor_follows_scrollbar
1729 != system_lyxrc.cursor_follows_scrollbar) {
1730 os << "\\cursor_follows_scrollbar "
1731 << convert<string>(cursor_follows_scrollbar) << '\n';
1735 case RC_MACRO_EDIT_STYLE:
1736 if (ignore_system_lyxrc ||
1738 != system_lyxrc.macro_edit_style) {
1739 os << "\\macro_edit_style ";
1740 switch (macro_edit_style) {
1741 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1742 case MACRO_EDIT_INLINE: os << "1\n"; break;
1743 case MACRO_EDIT_LIST: os << "2\n"; break;
1748 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1749 if (ignore_system_lyxrc ||
1750 dialogs_iconify_with_main
1751 != system_lyxrc.dialogs_iconify_with_main) {
1752 os << "\\dialogs_iconify_with_main "
1753 << convert<string>(dialogs_iconify_with_main) << '\n';
1757 case RC_SCREEN_FONT_ROMAN:
1758 if (ignore_system_lyxrc ||
1759 roman_font_name != system_lyxrc.roman_font_name) {
1760 os << "\\screen_font_roman \"" << roman_font_name
1765 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1766 if (ignore_system_lyxrc ||
1767 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1768 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1773 case RC_SCREEN_FONT_SANS:
1774 if (ignore_system_lyxrc ||
1775 sans_font_name != system_lyxrc.sans_font_name) {
1776 os << "\\screen_font_sans \"" << sans_font_name
1781 case RC_SCREEN_FONT_SANS_FOUNDRY:
1782 if (ignore_system_lyxrc ||
1783 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1784 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1789 case RC_SCREEN_FONT_TYPEWRITER:
1790 if (ignore_system_lyxrc ||
1791 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1792 os << "\\screen_font_typewriter \""
1793 << typewriter_font_name << "\"\n";
1797 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1798 if (ignore_system_lyxrc ||
1799 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1800 os << "\\screen_font_typewriter_foundry \""
1801 << typewriter_font_foundry << "\"\n";
1806 case RC_SCREEN_FONT_SCALABLE:
1807 if (ignore_system_lyxrc ||
1808 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1809 os << "\\screen_font_scalable "
1810 << convert<string>(use_scalable_fonts)
1815 case RC_SCREEN_FONT_SIZES:
1816 if (ignore_system_lyxrc ||
1817 font_sizes[FONT_SIZE_TINY]
1818 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1819 font_sizes[FONT_SIZE_SCRIPT]
1820 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1821 font_sizes[FONT_SIZE_FOOTNOTE]
1822 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1823 font_sizes[FONT_SIZE_SMALL]
1824 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1825 font_sizes[FONT_SIZE_NORMAL]
1826 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1827 font_sizes[FONT_SIZE_LARGE]
1828 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1829 font_sizes[FONT_SIZE_LARGER]
1830 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1831 font_sizes[FONT_SIZE_LARGEST]
1832 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1833 font_sizes[FONT_SIZE_HUGE]
1834 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1835 font_sizes[FONT_SIZE_HUGER]
1836 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1837 os.setf(ios::fixed);
1839 os << "\\screen_font_sizes"
1840 << ' ' << font_sizes[FONT_SIZE_TINY]
1841 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1842 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1843 << ' ' << font_sizes[FONT_SIZE_SMALL]
1844 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1845 << ' ' << font_sizes[FONT_SIZE_LARGE]
1846 << ' ' << font_sizes[FONT_SIZE_LARGER]
1847 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1848 << ' ' << font_sizes[FONT_SIZE_HUGE]
1849 << ' ' << font_sizes[FONT_SIZE_HUGER]
1854 case RC_FULL_SCREEN_LIMIT:
1855 if (ignore_system_lyxrc ||
1856 full_screen_limit != system_lyxrc.full_screen_limit) {
1857 os << "\\fullscreen_limit "
1858 << convert<string>(full_screen_limit)
1863 case RC_FULL_SCREEN_TOOLBARS:
1864 if (ignore_system_lyxrc ||
1865 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1866 os << "\\fullscreen_toolbars "
1867 << convert<string>(full_screen_toolbars)
1872 case RC_FULL_SCREEN_SCROLLBAR:
1873 if (ignore_system_lyxrc ||
1874 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1875 os << "\\fullscreen_scrollbar "
1876 << convert<string>(full_screen_scrollbar)
1881 case RC_FULL_SCREEN_TABBAR:
1882 if (ignore_system_lyxrc ||
1883 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1884 os << "\\fullscreen_tabbar "
1885 << convert<string>(full_screen_tabbar)
1890 case RC_FULL_SCREEN_WIDTH:
1891 if (ignore_system_lyxrc ||
1892 full_screen_width != system_lyxrc.full_screen_width) {
1893 os << "\\fullscreen_width "
1894 << convert<string>(full_screen_width)
1899 case RC_OPEN_BUFFERS_IN_TABS:
1900 if (ignore_system_lyxrc ||
1901 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1902 os << "\\open_buffers_in_tabs "
1903 << convert<string>(open_buffers_in_tabs)
1908 case RC_USE_BUNDLED_FORMAT:
1909 if (ignore_system_lyxrc ||
1910 use_bundled_format != system_lyxrc.use_bundled_format) {
1911 os << "\\use_bundled_format "
1912 << convert<string>(use_bundled_format)
1919 << "# COLOR SECTION ###################################\n"
1923 for (int i = 0; i < Color_ignore; ++i) {
1924 ColorCode lc = static_cast<ColorCode>(i);
1926 string const col(lcolor.getX11Name(lc));
1927 if (ignore_system_lyxrc ||
1928 col != system_lcolor.getX11Name(lc)) {
1929 os << "\\set_color \""
1930 << lcolor.getLyXName(lc) << "\" \""
1938 << "# PRINTER SECTION ###################################\n"
1942 if (ignore_system_lyxrc ||
1943 printer != system_lyxrc.printer) {
1944 os << "\\printer \"" << printer << "\"\n";
1948 case RC_PRINT_ADAPTOUTPUT:
1949 if (ignore_system_lyxrc ||
1950 print_adapt_output != system_lyxrc.print_adapt_output) {
1951 os << "\\print_adapt_output "
1952 << convert<string>(print_adapt_output)
1957 case RC_PRINT_COMMAND:
1958 if (ignore_system_lyxrc ||
1959 print_command != system_lyxrc.print_command) {
1960 os << "\\print_command \"" << print_command << "\"\n";
1964 case RC_PRINTEXSTRAOPTIONS:
1965 if (ignore_system_lyxrc ||
1966 print_extra_options != system_lyxrc.print_extra_options) {
1967 os << "\\print_extra_options \"" << print_extra_options
1972 case RC_PRINTSPOOL_COMMAND:
1973 if (ignore_system_lyxrc ||
1974 print_spool_command != system_lyxrc.print_spool_command) {
1975 os << "\\print_spool_command \"" << print_spool_command
1980 case RC_PRINTSPOOL_PRINTERPREFIX:
1981 if (ignore_system_lyxrc ||
1982 print_spool_printerprefix
1983 != system_lyxrc.print_spool_printerprefix) {
1984 os << "\\print_spool_printerprefix \""
1985 << print_spool_printerprefix << "\"\n";
1989 case RC_PRINTEVENPAGEFLAG:
1990 if (ignore_system_lyxrc ||
1991 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1992 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1997 case RC_PRINTODDPAGEFLAG:
1998 if (ignore_system_lyxrc ||
1999 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2000 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2005 case RC_PRINTREVERSEFLAG:
2006 if (ignore_system_lyxrc ||
2007 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2008 os << "\\print_reverse_flag \"" << print_reverse_flag
2013 case RC_PRINTLANDSCAPEFLAG:
2014 if (ignore_system_lyxrc ||
2015 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2016 os << "\\print_landscape_flag \"" << print_landscape_flag
2021 case RC_PRINTPAGERANGEFLAG:
2022 if (ignore_system_lyxrc ||
2023 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2024 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2029 case RC_PRINTCOPIESFLAG:
2030 if (ignore_system_lyxrc ||
2031 print_copies_flag != system_lyxrc.print_copies_flag) {
2032 os << "\\print_copies_flag \"" << print_copies_flag
2037 case RC_PRINTCOLLCOPIESFLAG:
2038 if (ignore_system_lyxrc ||
2039 print_collcopies_flag
2040 != system_lyxrc.print_collcopies_flag) {
2041 os << "\\print_collcopies_flag \""
2042 << print_collcopies_flag
2047 case RC_PRINTPAPERFLAG:
2048 if (ignore_system_lyxrc ||
2049 print_paper_flag != system_lyxrc.print_paper_flag) {
2050 os << "\\print_paper_flag \"" << print_paper_flag
2055 case RC_PRINTPAPERDIMENSIONFLAG:
2056 if (ignore_system_lyxrc ||
2057 print_paper_dimension_flag
2058 != system_lyxrc.print_paper_dimension_flag) {
2059 os << "\\print_paper_dimension_flag \""
2060 << print_paper_dimension_flag << "\"\n";
2064 case RC_PRINTTOPRINTER:
2065 if (ignore_system_lyxrc ||
2066 print_to_printer != system_lyxrc.print_to_printer) {
2067 os << "\\print_to_printer \"" << print_to_printer
2072 case RC_PRINTTOFILE:
2073 if (ignore_system_lyxrc ||
2074 print_to_file != system_lyxrc.print_to_file) {
2075 string const path = os::external_path(print_to_file);
2076 os << "\\print_to_file \"" << path << "\"\n";
2080 case RC_PRINTFILEEXTENSION:
2081 if (ignore_system_lyxrc ||
2082 print_file_extension != system_lyxrc.print_file_extension) {
2083 os << "\\print_file_extension \""
2084 << print_file_extension
2091 << "# EXPORT SECTION ####################################\n"
2094 case RC_CUSTOM_EXPORT_COMMAND:
2095 if (ignore_system_lyxrc ||
2096 custom_export_command
2097 != system_lyxrc.custom_export_command) {
2098 os << "\\custom_export_command \""
2099 << custom_export_command
2104 case RC_CUSTOM_EXPORT_FORMAT:
2105 if (ignore_system_lyxrc ||
2106 custom_export_format
2107 != system_lyxrc.custom_export_format) {
2108 os << "\\custom_export_format \"" << custom_export_format
2115 << "# TEX SECTION #######################################\n"
2118 case RC_FONT_ENCODING:
2119 if (ignore_system_lyxrc ||
2120 fontenc != system_lyxrc.fontenc) {
2121 os << "\\font_encoding \"" << fontenc << "\"\n";
2127 << "# FILE SECTION ######################################\n"
2130 case RC_DOCUMENTPATH:
2131 if (ignore_system_lyxrc ||
2132 document_path != system_lyxrc.document_path) {
2133 string const path = os::external_path(document_path);
2134 os << "\\document_path \"" << path << "\"\n";
2138 case RC_USELASTFILEPOS:
2139 if (ignore_system_lyxrc ||
2140 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2141 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2146 case RC_LOADSESSION:
2147 if (ignore_system_lyxrc ||
2148 load_session != system_lyxrc.load_session) {
2149 os << "\\load_session " << convert<string>(load_session)
2154 case RC_MOUSE_WHEEL_SPEED:
2155 if (ignore_system_lyxrc ||
2156 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2157 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2161 case RC_COMPLETION_INLINE_DELAY:
2162 if (ignore_system_lyxrc ||
2163 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2164 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2168 case RC_COMPLETION_INLINE_MATH:
2169 if (ignore_system_lyxrc ||
2170 completion_inline_math != system_lyxrc.completion_inline_math) {
2171 os << "\\completion_inline_math "
2172 << convert<string>(completion_inline_math) << '\n';
2176 case RC_COMPLETION_INLINE_TEXT:
2177 if (ignore_system_lyxrc ||
2178 completion_inline_text != system_lyxrc.completion_inline_text) {
2179 os << "\\completion_inline_text "
2180 << convert<string>(completion_inline_text) << '\n';
2184 case RC_COMPLETION_INLINE_DOTS:
2185 if (ignore_system_lyxrc ||
2186 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2187 os << "\\completion_inline_dots "
2188 << convert<string>(completion_inline_dots) << '\n';
2192 case RC_COMPLETION_POPUP_DELAY:
2193 if (ignore_system_lyxrc ||
2194 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2195 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2199 case RC_COMPLETION_POPUP_MATH:
2200 if (ignore_system_lyxrc ||
2201 completion_popup_math != system_lyxrc.completion_popup_math) {
2202 os << "\\completion_popup_math "
2203 << convert<string>(completion_popup_math) << '\n';
2207 case RC_COMPLETION_POPUP_TEXT:
2208 if (ignore_system_lyxrc ||
2209 completion_popup_text != system_lyxrc.completion_popup_text) {
2210 os << "\\completion_popup_text "
2211 << convert<string>(completion_popup_text) << '\n';
2215 case RC_COMPLETION_CURSOR_TEXT:
2216 if (ignore_system_lyxrc ||
2217 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2218 os << "\\completion_cursor_text "
2219 << convert<string>(completion_cursor_text) << '\n';
2223 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2224 if (ignore_system_lyxrc ||
2225 completion_popup_after_complete
2226 != system_lyxrc.completion_popup_after_complete) {
2227 os << "\\completion_popup_after_complete "
2228 << convert<string>(completion_popup_after_complete) << '\n';
2232 case RC_NUMLASTFILES:
2233 if (ignore_system_lyxrc ||
2234 num_lastfiles != system_lyxrc.num_lastfiles) {
2235 os << "\\num_lastfiles " << num_lastfiles << '\n';
2239 case RC_CHECKLASTFILES:
2240 if (ignore_system_lyxrc ||
2241 check_lastfiles != system_lyxrc.check_lastfiles) {
2242 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2247 case RC_EXAMPLEPATH:
2248 if (ignore_system_lyxrc ||
2249 example_path != system_lyxrc.example_path) {
2250 string const path = os::external_path(example_path);
2251 os << "\\example_path \"" << path << "\"\n";
2255 case RC_TEMPLATEPATH:
2256 if (ignore_system_lyxrc ||
2257 template_path != system_lyxrc.template_path) {
2258 string const path = os::external_path(template_path);
2259 os << "\\template_path \"" << path << "\"\n";
2263 case RC_TEMPDIRPATH:
2264 if (ignore_system_lyxrc ||
2265 tempdir_path != system_lyxrc.tempdir_path) {
2266 string const path = os::external_path(tempdir_path);
2267 os << "\\tempdir_path \"" << path << "\"\n";
2275 case RC_PLAINTEXT_LINELEN:
2276 if (ignore_system_lyxrc ||
2277 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2278 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2282 case RC_MAKE_BACKUP:
2283 if (ignore_system_lyxrc ||
2284 make_backup != system_lyxrc.make_backup) {
2285 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2289 case RC_BACKUPDIR_PATH:
2290 if (ignore_system_lyxrc ||
2291 backupdir_path != system_lyxrc.backupdir_path) {
2292 string const path = os::external_path(backupdir_path);
2293 os << "\\backupdir_path \"" << path << "\"\n";
2299 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2302 case RC_PLAINTEXT_ROFF_COMMAND:
2303 if (ignore_system_lyxrc ||
2304 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2305 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2312 << "# SPELLCHECKER SECTION ##############################\n"
2314 case RC_USE_SPELL_LIB:
2315 if (ignore_system_lyxrc ||
2316 use_spell_lib != system_lyxrc.use_spell_lib) {
2317 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2321 case RC_SPELL_COMMAND:
2322 if (ignore_system_lyxrc ||
2323 isp_command != system_lyxrc.isp_command) {
2324 os << "\\spell_command \"" << isp_command << "\"\n";
2328 case RC_ACCEPT_COMPOUND:
2329 if (ignore_system_lyxrc ||
2330 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2331 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2336 case RC_USE_ALT_LANG:
2337 if (ignore_system_lyxrc ||
2338 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2339 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2345 if (ignore_system_lyxrc ||
2346 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2347 os << "\\alternate_language \"" << isp_alt_lang
2352 case RC_USE_ESC_CHARS:
2353 if (ignore_system_lyxrc ||
2354 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2355 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2361 if (ignore_system_lyxrc ||
2362 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2363 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2367 case RC_USE_PERS_DICT:
2368 if (ignore_system_lyxrc ||
2369 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2370 os << "\\use_personal_dictionary "
2371 << convert<string>(isp_use_pers_dict)
2376 case RC_USE_TOOLTIP:
2377 if (ignore_system_lyxrc ||
2378 use_tooltip != system_lyxrc.use_tooltip) {
2379 os << "\\use_tooltip "
2380 << convert<string>(use_tooltip)
2383 case RC_USE_PIXMAP_CACHE:
2384 if (ignore_system_lyxrc ||
2385 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2386 os << "\\use_pixmap_cache "
2387 << convert<string>(use_pixmap_cache)
2391 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2392 string const path = os::external_path(isp_pers_dict);
2393 os << "\\personal_dictionary \"" << path << "\"\n";
2397 case RC_USE_INP_ENC:
2398 if (ignore_system_lyxrc ||
2399 isp_use_input_encoding
2400 != system_lyxrc.isp_use_input_encoding) {
2401 os << "\\use_input_encoding "
2402 << convert<string>(isp_use_input_encoding)
2409 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2412 case RC_RTL_SUPPORT:
2413 if (ignore_system_lyxrc ||
2414 rtl_support != system_lyxrc.rtl_support) {
2415 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2419 case RC_VISUAL_CURSOR:
2420 if (ignore_system_lyxrc ||
2421 visual_cursor != system_lyxrc.visual_cursor) {
2422 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2426 case RC_LANGUAGE_PACKAGE:
2427 if (ignore_system_lyxrc ||
2428 language_package != system_lyxrc.language_package) {
2429 os << "\\language_package \"" << language_package
2434 case RC_LANGUAGE_GLOBAL_OPTIONS:
2435 if (ignore_system_lyxrc ||
2436 language_global_options
2437 != system_lyxrc.language_global_options) {
2438 os << "\\language_global_options \""
2439 << convert<string>(language_global_options)
2444 case RC_LANGUAGE_USE_BABEL:
2445 if (ignore_system_lyxrc ||
2446 language_use_babel != system_lyxrc.language_use_babel) {
2447 os << "\\language_use_babel \""
2448 << convert<string>(language_use_babel)
2453 case RC_LANGUAGE_COMMAND_BEGIN:
2454 if (ignore_system_lyxrc ||
2455 language_command_begin
2456 != system_lyxrc.language_command_begin) {
2457 os << "\\language_command_begin \""
2458 << language_command_begin
2463 case RC_LANGUAGE_COMMAND_END:
2464 if (ignore_system_lyxrc ||
2465 language_command_end
2466 != system_lyxrc.language_command_end) {
2467 os << "\\language_command_end \"" << language_command_end
2472 case RC_LANGUAGE_COMMAND_LOCAL:
2473 if (ignore_system_lyxrc ||
2474 language_command_local
2475 != system_lyxrc.language_command_local) {
2476 os << "\\language_command_local \""
2477 << language_command_local
2482 case RC_LANGUAGE_AUTO_BEGIN:
2483 if (ignore_system_lyxrc ||
2484 language_auto_begin != system_lyxrc.language_auto_begin) {
2485 os << "\\language_auto_begin "
2486 << convert<string>(language_auto_begin) << '\n';
2490 case RC_LANGUAGE_AUTO_END:
2491 if (ignore_system_lyxrc ||
2492 language_auto_end != system_lyxrc.language_auto_end) {
2493 os << "\\language_auto_end "
2494 << convert<string>(language_auto_end) << '\n';
2498 case RC_MARK_FOREIGN_LANGUAGE:
2499 if (ignore_system_lyxrc ||
2500 mark_foreign_language
2501 != system_lyxrc.mark_foreign_language) {
2502 os << "\\mark_foreign_language " <<
2503 convert<string>(mark_foreign_language) << '\n';
2509 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2512 case RC_AUTO_NUMBER:
2513 if (ignore_system_lyxrc ||
2514 auto_number != system_lyxrc.auto_number) {
2515 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2519 case RC_DEFAULT_LANGUAGE:
2520 if (ignore_system_lyxrc ||
2521 default_language != system_lyxrc.default_language) {
2522 os << "\\default_language " << default_language << '\n';
2528 << "# FORMATS SECTION ##########################\n"
2532 // New/modified formats
2533 for (Formats::const_iterator cit = formats.begin();
2534 cit != formats.end(); ++cit) {
2535 Format const * format =
2536 system_formats.getFormat(cit->name());
2538 format->extension() != cit->extension() ||
2539 format->prettyname() != cit->prettyname() ||
2540 format->shortcut() != cit->shortcut() ||
2541 format->viewer() != cit->viewer() ||
2542 format->editor() != cit->editor() ||
2543 format->documentFormat() != cit->documentFormat() ||
2544 format->vectorFormat() != cit->vectorFormat()) {
2545 os << "\\format \"" << cit->name() << "\" \""
2546 << cit->extension() << "\" \""
2547 << cit->prettyname() << "\" \""
2548 << cit->shortcut() << "\" \""
2549 << cit->viewer() << "\" \""
2550 << cit->editor() << "\" \"";
2551 vector<string> flags;
2552 if (cit->documentFormat())
2553 flags.push_back("document");
2554 if (cit->vectorFormat())
2555 flags.push_back("vector");
2556 os << getStringFromVector(flags);
2561 // Look for deleted formats
2562 for (Formats::const_iterator cit = system_formats.begin();
2563 cit != system_formats.end(); ++cit)
2564 if (!formats.getFormat(cit->name()))
2565 os << "\\format \"" << cit->name()
2566 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2575 << "# CONVERTERS SECTION ##########################\n"
2579 // Look for new converters
2580 for (Converters::const_iterator cit = theConverters().begin();
2581 cit != theConverters().end(); ++cit) {
2582 Converter const * converter =
2583 theSystemConverters().getConverter(cit->from,
2586 converter->command != cit->command ||
2587 converter->flags != cit->flags)
2588 os << "\\converter \"" << cit->from << "\" \""
2589 << cit->to << "\" \""
2590 << cit->command << "\" \""
2591 << cit->flags << "\"\n";
2594 // New/modifed converters
2595 for (Converters::const_iterator cit = theSystemConverters().begin();
2596 cit != theSystemConverters().end(); ++cit)
2597 if (!theConverters().getConverter(cit->from, cit->to))
2598 os << "\\converter \"" << cit->from
2599 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2606 << "# COPIERS SECTION ##########################\n"
2609 // Look for new movers
2610 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2611 Movers::const_iterator const sysend = theSystemMovers().end();
2612 Movers::const_iterator it = theMovers().begin();
2613 Movers::const_iterator end = theMovers().end();
2615 for (; it != end; ++it) {
2616 Movers::const_iterator const sysit =
2617 find_if(sysbegin, sysend, SameMover(*it));
2618 if (sysit == sysend) {
2619 string const & fmt = it->first;
2620 string const & command =
2621 it->second.command();
2623 os << "\\copier " << fmt
2624 << " \"" << command << "\"\n";
2630 // We don't actually delete SpecialisedMover(s) from the
2631 // map, just clear their 'command', so there's no need
2632 // to test for anything else.
2640 string const LyXRC::getDescription(LyXRCTags tag)
2645 case RC_ACCEPT_COMPOUND:
2646 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2650 case RC_USE_ALT_LANG:
2651 str = _("Specify an alternate language. The default is to use the language of the document.");
2654 case RC_PLAINTEXT_ROFF_COMMAND:
2655 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.");
2658 case RC_PLAINTEXT_LINELEN:
2659 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.");
2662 case RC_AUTOREGIONDELETE:
2663 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2666 case RC_AUTORESET_OPTIONS:
2667 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2671 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2674 case RC_AUTO_NUMBER:
2677 case RC_BACKUPDIR_PATH:
2678 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.");
2681 case RC_BIBTEX_COMMAND:
2682 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2686 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2689 case RC_CHECKLASTFILES:
2690 str = _("Select to check whether the lastfiles still exist.");
2693 case RC_CHKTEX_COMMAND:
2694 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2703 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2704 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.");
2707 case RC_SHOW_MACRO_LABEL:
2708 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2711 case RC_CUSTOM_EXPORT_COMMAND:
2714 case RC_CUSTOM_EXPORT_FORMAT:
2717 case RC_DATE_INSERT_FORMAT:
2718 //xgettext:no-c-format
2719 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2723 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2726 case RC_DEFAULT_LANGUAGE:
2727 str = _("New documents will be assigned this language.");
2730 case RC_DEFAULT_PAPERSIZE:
2731 str = _("Specify the default paper size.");
2734 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2735 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2738 case RC_DISPLAY_GRAPHICS:
2739 str = _("Select how LyX will display any graphics.");
2742 case RC_DOCUMENTPATH:
2743 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2747 case RC_USE_ESC_CHARS:
2748 str = _("Specify additional chars that can be part of a word.");
2751 case RC_EXAMPLEPATH:
2752 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2755 case RC_FONT_ENCODING:
2756 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2762 case RC_INDEX_COMMAND:
2763 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\".");
2770 case RC_KBMAP_PRIMARY:
2771 case RC_KBMAP_SECONDARY:
2772 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.");
2775 case RC_LABEL_INIT_LENGTH:
2776 str = _("Maximum number of words in the initialization string for a new label");
2779 case RC_LANGUAGE_AUTO_BEGIN:
2780 str = _("Select if a language switching command is needed at the beginning of the document.");
2783 case RC_LANGUAGE_AUTO_END:
2784 str = _("Select if a language switching command is needed at the end of the document.");
2787 case RC_LANGUAGE_COMMAND_BEGIN:
2788 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.");
2791 case RC_LANGUAGE_COMMAND_END:
2792 str = _("The LaTeX command for changing back to the language of the document.");
2795 case RC_LANGUAGE_COMMAND_LOCAL:
2796 str = _("The LaTeX command for local changing of the language.");
2799 case RC_LANGUAGE_GLOBAL_OPTIONS:
2800 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2803 case RC_LANGUAGE_PACKAGE:
2804 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2807 case RC_LANGUAGE_USE_BABEL:
2808 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2811 case RC_USELASTFILEPOS:
2812 str = _("De-select if you do not want LyX to scroll to saved position.");
2815 case RC_LOADSESSION:
2816 str = _("De-select to prevent loading files opened from the last LyX session.");
2819 case RC_MAKE_BACKUP:
2820 str = _("De-select if you don't want LyX to create backup files.");
2823 case RC_MARK_FOREIGN_LANGUAGE:
2824 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2827 case RC_MOUSE_WHEEL_SPEED:
2828 str = bformat(_("The scrolling speed of the mouse wheel."),
2832 case RC_COMPLETION_POPUP_DELAY:
2833 str = _("The completion popup delay.");
2836 case RC_COMPLETION_POPUP_MATH:
2837 str = _("Select to display the completion popup in math mode.");
2840 case RC_COMPLETION_POPUP_TEXT:
2841 str = _("Select to display the completion popup in text mode.");
2844 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2845 str = _("Show the completion popup without delay after non-unique completion attempt.");
2848 case RC_COMPLETION_POPUP_TEXT:
2849 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2852 case RC_COMPLETION_POPUP_DELAY:
2853 str = _("The inline completion delay.");
2856 case RC_COMPLETION_INLINE_MATH:
2857 str = _("Select to display the inline completion in math mode.");
2860 case RC_COMPLETION_INLINE_TEXT:
2861 str = _("Select to display the inline completion in text mode.");
2864 case RC_COMPLETION_INLINE_DOTS:
2865 str = _("Use \"...\" to shorten long completions.");
2868 case RC_NUMLASTFILES:
2869 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2873 case RC_PATH_PREFIX:
2874 str = _("Specify those directories which should be "
2875 "prepended to the PATH environment variable. "
2876 "Use the OS native format.");
2880 case RC_USE_PERS_DICT:
2881 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2885 str = _("Shows a typeset preview of things such as math");
2888 case RC_PREVIEW_HASHED_LABELS:
2889 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2892 case RC_PREVIEW_SCALE_FACTOR:
2893 str = _("Scale the preview size to suit.");
2896 case RC_PRINTCOLLCOPIESFLAG:
2897 str = _("The option for specifying whether the copies should be collated.");
2900 case RC_PRINTCOPIESFLAG:
2901 str = _("The option for specifying the number of copies to print.");
2905 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2908 case RC_PRINTEVENPAGEFLAG:
2909 str = _("The option to print only even pages.");
2912 case RC_PRINTEXSTRAOPTIONS:
2913 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2916 case RC_PRINTFILEEXTENSION:
2917 str = _("Extension of printer program output file. Usually \".ps\".");
2920 case RC_PRINTLANDSCAPEFLAG:
2921 str = _("The option to print out in landscape.");
2924 case RC_PRINTODDPAGEFLAG:
2925 str = _("The option to print only odd pages.");
2928 case RC_PRINTPAGERANGEFLAG:
2929 str = _("The option for specifying a comma-separated list of pages to print.");
2932 case RC_PRINTPAPERDIMENSIONFLAG:
2933 str = _("Option to specify the dimensions of the print paper.");
2936 case RC_PRINTPAPERFLAG:
2937 str = _("The option to specify paper type.");
2940 case RC_PRINTREVERSEFLAG:
2941 str = _("The option to reverse the order of the pages printed.");
2944 case RC_PRINTSPOOL_COMMAND:
2945 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.");
2948 case RC_PRINTSPOOL_PRINTERPREFIX:
2949 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.");
2952 case RC_PRINTTOFILE:
2953 str = _("Option to pass to the print program to print to a file.");
2956 case RC_PRINTTOPRINTER:
2957 str = _("Option to pass to the print program to print on a specific printer.");
2960 case RC_PRINT_ADAPTOUTPUT:
2961 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2964 case RC_PRINT_COMMAND:
2965 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2968 case RC_RTL_SUPPORT:
2969 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2972 case RC_VISUAL_CURSOR:
2973 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2977 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2980 case RC_SCREEN_FONT_ROMAN:
2981 case RC_SCREEN_FONT_SANS:
2982 case RC_SCREEN_FONT_TYPEWRITER:
2983 str = _("The screen fonts used to display the text while editing.");
2986 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2987 case RC_SCREEN_FONT_SANS_FOUNDRY:
2988 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2991 case RC_SCREEN_FONT_SCALABLE:
2992 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.");
2995 case RC_SCREEN_FONT_SIZES:
2996 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2999 case RC_SCREEN_ZOOM:
3000 //xgettext:no-c-format
3001 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3004 case RC_GEOMETRY_SESSION:
3005 str = _("Allow session manager to save and restore windows geometry.");
3009 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3015 case RC_SHOW_BANNER:
3016 str = _("De-select if you don't want the startup banner.");
3019 case RC_SPELL_COMMAND:
3020 str = _("What command runs the spellchecker?");
3023 case RC_TEMPDIRPATH:
3024 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3027 case RC_TEMPLATEPATH:
3028 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3031 case RC_TEX_ALLOWS_SPACES:
3034 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3038 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3050 case RC_USE_INP_ENC:
3051 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.");
3054 case RC_USE_TOOLTIP:
3055 str = _("Enable the automatic appearance of tool tips in the work area.");
3058 case RC_USE_PIXMAP_CACHE:
3059 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3062 case RC_USE_SPELL_LIB:
3065 case RC_VIEWDVI_PAPEROPTION:
3066 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3081 // The global instance
3084 // The global copy of the system lyxrc entries (everything except preferences)