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() {
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);
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);
353 if (lyxerr.debugging(Debug::PARSER))
354 lexrc.printTable(lyxerr);
357 if (!lexrc.isOK()) return -2;
359 LYXERR(Debug::LYXRC, "Reading istream...");
365 int LyXRC::read(Lexer & lexrc)
367 if (!lexrc.isOK()) return -2;
369 while (lexrc.isOK()) {
370 // By using two switches we take advantage of the compiler
371 // telling us if we have missed a LyXRCTags element in
372 // the second switch.
373 // Note that this also shows a problem with Lexer since it
374 // helps us avoid taking advantage of the strictness of the
377 int le = lexrc.lex();
379 case Lexer::LEX_UNDEF:
380 lexrc.printError("Unknown tag `$$Token'");
382 case Lexer::LEX_FEOF:
386 switch (static_cast<LyXRCTags>(le)) {
387 case RC_INPUT: // Include file
390 libFileSearch(string(),
393 lexrc.printError("Error reading "
394 "included file: " + tmp.absFilename());
400 bind_file = os::internal_path(lexrc.getString());
406 def_file = os::internal_path(lexrc.getString());
412 ui_file = os::internal_path(lexrc.getString());
416 case RC_AUTORESET_OPTIONS:
418 auto_reset_options = lexrc.getBool();
422 case RC_DISPLAY_GRAPHICS:
424 display_graphics = graphics::displayTranslator().find(lexrc.getString());
428 case RC_TEX_EXPECTS_WINDOWS_PATHS:
430 windows_style_tex_paths = lexrc.getBool();
434 case RC_TEX_ALLOWS_SPACES:
436 tex_allows_spaces = lexrc.getBool();
442 use_kbmap = lexrc.getBool();
446 case RC_KBMAP_PRIMARY:
448 string const kmap(os::internal_path(lexrc.getString()));
451 } else if (!libFileSearch("kbd", kmap,
453 primary_kbmap = kmap;
455 lexrc.printError("LyX: Keymap `$$Token' not found");
460 case RC_KBMAP_SECONDARY:
462 string const kmap(os::internal_path(lexrc.getString()));
465 } else if (!libFileSearch("kbd", kmap,
467 secondary_kbmap = kmap;
469 lexrc.printError("LyX: Keymap `$$Token' not found");
474 case RC_FONT_ENCODING:
476 fontenc = lexrc.getString();
482 printer = lexrc.getString();
486 case RC_PRINT_COMMAND:
488 print_command = lexrc.getString();
492 case RC_PRINTEVENPAGEFLAG:
494 print_evenpage_flag = lexrc.getString();
498 case RC_PRINTODDPAGEFLAG:
500 print_oddpage_flag = lexrc.getString();
504 case RC_PRINTPAGERANGEFLAG:
506 print_pagerange_flag = lexrc.getString();
510 case RC_PRINTCOPIESFLAG:
512 print_copies_flag = lexrc.getString();
516 case RC_PRINTCOLLCOPIESFLAG:
518 print_collcopies_flag = lexrc.getString();
522 case RC_PRINTREVERSEFLAG:
524 print_reverse_flag = lexrc.getString();
528 case RC_PRINTLANDSCAPEFLAG:
530 print_landscape_flag = lexrc.getString();
534 case RC_PRINTTOPRINTER:
536 print_to_printer = lexrc.getString();
540 case RC_PRINT_ADAPTOUTPUT:
542 print_adapt_output = lexrc.getBool();
548 print_to_file = os::internal_path(lexrc.getString());
552 case RC_PRINTFILEEXTENSION:
554 print_file_extension = lexrc.getString();
558 case RC_PRINTEXSTRAOPTIONS:
560 print_extra_options = lexrc.getString();
564 case RC_PRINTSPOOL_COMMAND:
566 print_spool_command = lexrc.getString();
570 case RC_PRINTSPOOL_PRINTERPREFIX:
572 print_spool_printerprefix = lexrc.getString();
576 case RC_PRINTPAPERDIMENSIONFLAG:
578 print_paper_dimension_flag = lexrc.getString();
582 case RC_PRINTPAPERFLAG:
584 print_paper_flag = lexrc.getString();
588 case RC_CUSTOM_EXPORT_COMMAND:
590 custom_export_command = lexrc.getString();
594 case RC_CUSTOM_EXPORT_FORMAT:
596 custom_export_format = lexrc.getString();
600 case RC_DEFAULT_PAPERSIZE:
603 ascii_lowercase(lexrc.getString());
604 if (size == "usletter")
607 else if (size == "legal")
610 else if (size == "executive")
613 else if (size == "a3")
616 else if (size == "a4")
619 else if (size == "a5")
622 else if (size == "b5")
625 else if (size == "default")
631 case RC_VIEWDVI_PAPEROPTION:
633 view_dvi_paper_option = lexrc.getString();
635 view_dvi_paper_option.erase();
639 case RC_CHKTEX_COMMAND:
641 chktex_command = lexrc.getString();
645 case RC_BIBTEX_COMMAND:
647 bibtex_command = lexrc.getString();
651 case RC_INDEX_COMMAND:
653 index_command = lexrc.getString();
659 dpi = lexrc.getInteger();
665 zoom = lexrc.getInteger();
669 case RC_GEOMETRY_SESSION:
671 allow_geometry_session = lexrc.getBool();
675 case RC_SCREEN_FONT_SIZES:
677 font_sizes[FONT_SIZE_TINY] =
681 font_sizes[FONT_SIZE_SCRIPT] =
685 font_sizes[FONT_SIZE_FOOTNOTE] =
689 font_sizes[FONT_SIZE_SMALL] =
693 font_sizes[FONT_SIZE_NORMAL] =
697 font_sizes[FONT_SIZE_LARGE] =
701 font_sizes[FONT_SIZE_LARGER] =
705 font_sizes[FONT_SIZE_LARGEST] =
709 font_sizes[FONT_SIZE_HUGE] =
713 font_sizes[FONT_SIZE_HUGER] =
718 case RC_SCREEN_FONT_SCALABLE:
720 use_scalable_fonts = lexrc.getBool();
726 autosave = lexrc.getInteger();
730 case RC_DOCUMENTPATH:
732 document_path = os::internal_path(lexrc.getString());
733 document_path = expandPath(document_path);
739 example_path = os::internal_path(lexrc.getString());
740 example_path = expandPath(example_path);
744 case RC_TEMPLATEPATH:
746 template_path = os::internal_path(lexrc.getString());
747 template_path = expandPath(template_path);
753 tempdir_path = os::internal_path(lexrc.getString());
754 tempdir_path = expandPath(tempdir_path);
760 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
764 case RC_USELASTFILEPOS:
766 use_lastfilepos = lexrc.getBool();
772 load_session = lexrc.getBool();
776 case RC_MOUSE_WHEEL_SPEED:
778 mouse_wheel_speed = lexrc.getFloat();
782 case RC_COMPLETION_INLINE_DELAY:
784 completion_inline_delay = lexrc.getFloat();
788 case RC_COMPLETION_INLINE_MATH:
790 completion_inline_math = lexrc.getBool();
794 case RC_COMPLETION_INLINE_TEXT:
796 completion_inline_text = lexrc.getBool();
800 case RC_COMPLETION_INLINE_DOTS:
802 completion_inline_dots = lexrc.getInteger();
806 case RC_COMPLETION_POPUP_DELAY:
808 completion_popup_delay = lexrc.getFloat();
812 case RC_COMPLETION_POPUP_MATH:
814 completion_popup_math = lexrc.getBool();
818 case RC_COMPLETION_POPUP_TEXT:
820 completion_popup_text = lexrc.getBool();
824 case RC_COMPLETION_CURSOR_TEXT:
826 completion_cursor_text = lexrc.getBool();
830 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
832 completion_popup_after_complete = lexrc.getBool();
836 case RC_NUMLASTFILES:
838 num_lastfiles = lexrc.getInteger();
842 case RC_CHECKLASTFILES:
844 check_lastfiles = lexrc.getBool();
848 case RC_SCREEN_FONT_ROMAN:
850 roman_font_name = lexrc.getString();
851 oldFontFormat(roman_font_name,
856 case RC_SCREEN_FONT_SANS:
858 sans_font_name = lexrc.getString();
859 oldFontFormat(sans_font_name, sans_font_foundry);
863 case RC_SCREEN_FONT_TYPEWRITER:
865 typewriter_font_name = lexrc.getString();
866 oldFontFormat(typewriter_font_name,
867 typewriter_font_foundry);
871 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
873 roman_font_foundry = lexrc.getString();
877 case RC_SCREEN_FONT_SANS_FOUNDRY:
879 sans_font_foundry = lexrc.getString();
883 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
885 typewriter_font_foundry = lexrc.getString();
891 string lyx_name, x11_name;
894 lyx_name = lexrc.getString();
896 lexrc.printError("Missing color tag.");
901 x11_name = lexrc.getString();
903 lexrc.printError("Missing color name for color: `$$Token'");
907 ColorCode const col =
908 lcolor.getFromLyXName(lyx_name);
909 if (col == Color_none ||
910 col == Color_inherit ||
914 if (!lcolor.setColor(col, x11_name)) {
915 lyxerr << "Bad lyxrc set_color for "
921 case RC_AUTOREGIONDELETE:
922 // Auto region delete defaults to true
924 auto_region_delete = lexrc.getBool();
930 lyxpipes = os::internal_path(lexrc.getString());
931 lyxpipes = expandPath(lyxpipes);
935 case RC_CURSOR_FOLLOWS_SCROLLBAR:
937 cursor_follows_scrollbar = lexrc.getBool();
941 case RC_MACRO_EDIT_STYLE:
943 switch (lexrc.getInteger()) {
944 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
945 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
946 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
951 case RC_DIALOGS_ICONIFY_WITH_MAIN:
953 dialogs_iconify_with_main = lexrc.getBool();
957 case RC_PLAINTEXT_ROFF_COMMAND:
959 plaintext_roff_command = lexrc.getString();
962 case RC_PLAINTEXT_LINELEN:
964 plaintext_linelen = lexrc.getInteger();
967 // Spellchecker settings:
968 case RC_USE_SPELL_LIB:
970 use_spell_lib = lexrc.getBool();
973 case RC_SPELL_COMMAND:
975 isp_command = lexrc.getString();
978 case RC_ACCEPT_COMPOUND:
980 isp_accept_compound = lexrc.getBool();
985 isp_use_input_encoding = lexrc.getBool();
988 case RC_USE_ALT_LANG:
990 isp_use_alt_lang = lexrc.getBool();
993 case RC_USE_PERS_DICT:
995 isp_use_pers_dict = lexrc.getBool();
1000 use_tooltip = lexrc.getBool();
1003 case RC_USE_PIXMAP_CACHE:
1005 use_pixmap_cache = lexrc.getBool();
1008 case RC_USE_ESC_CHARS:
1010 isp_use_esc_chars = lexrc.getBool();
1015 isp_alt_lang = lexrc.getString();
1020 isp_pers_dict = os::internal_path(lexrc.getString());
1025 isp_esc_chars = lexrc.getString();
1028 case RC_MAKE_BACKUP:
1030 make_backup = lexrc.getBool();
1033 case RC_BACKUPDIR_PATH:
1035 backupdir_path = os::internal_path(lexrc.getString());
1036 backupdir_path = expandPath(backupdir_path);
1039 case RC_DATE_INSERT_FORMAT:
1041 date_insert_format = lexrc.getString();
1044 case RC_LANGUAGE_PACKAGE:
1046 language_package = lexrc.getString();
1049 case RC_LANGUAGE_AUTO_BEGIN:
1051 language_auto_begin = lexrc.getBool();
1054 case RC_LANGUAGE_AUTO_END:
1056 language_auto_end = lexrc.getBool();
1059 case RC_LANGUAGE_GLOBAL_OPTIONS:
1061 language_global_options = lexrc.getBool();
1064 case RC_LANGUAGE_USE_BABEL:
1066 language_use_babel = lexrc.getBool();
1069 case RC_LANGUAGE_COMMAND_BEGIN:
1071 language_command_begin = lexrc.getString();
1074 case RC_LANGUAGE_COMMAND_END:
1076 language_command_end = lexrc.getString();
1079 case RC_LANGUAGE_COMMAND_LOCAL:
1081 language_command_local = lexrc.getString();
1084 case RC_RTL_SUPPORT:
1086 rtl_support = lexrc.getBool();
1089 case RC_VISUAL_CURSOR:
1091 visual_cursor = lexrc.getBool();
1094 case RC_AUTO_NUMBER:
1096 auto_number = lexrc.getBool();
1099 case RC_MARK_FOREIGN_LANGUAGE:
1101 mark_foreign_language = lexrc.getBool();
1106 string fmt, command;
1108 fmt = lexrc.getString();
1111 command = lexrc.getString();
1113 setMover(fmt, command);
1117 case RC_CONVERTER: {
1118 string from, to, command, flags;
1120 from = lexrc.getString();
1123 to = lexrc.getString();
1126 command = lexrc.getString();
1129 flags = lexrc.getString();
1131 if (command.empty()) {
1132 theConverters().erase(from, to);
1134 theConverters().add(from, to, command, flags);
1138 // compatibility with versions older than 1.4.0 only
1140 string format, command;
1142 format = lexrc.getString();
1145 command = lexrc.getString();
1147 formats.setViewer(format, command);
1151 string format, extension, prettyname, shortcut;
1153 format = lexrc.getString();
1156 extension = lexrc.getString();
1159 prettyname = lexrc.getString();
1162 shortcut = lexrc.getString();
1164 string viewer, editor;
1166 viewer = lexrc.getString();
1168 editor = lexrc.getString();
1170 // Hack to ensure compatibility with versions older
1172 int le = lexrc.lex();
1173 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1174 flags = lexrc.getString();
1175 if (le != Lexer::LEX_DATA) {
1176 // We have got a known token.
1177 // Therefore this is an old style
1178 // format definition without
1180 lexrc.pushToken(flags);
1184 int flgs = Format::none;
1185 while (!flags.empty()) {
1187 flags = split(flags, flag, ',');
1188 if (flag == "document")
1189 flgs |= Format::document;
1190 else if (flag == "vector")
1191 flgs |= Format::vector;
1193 lyxerr << "Ignoring unknown flag `"
1194 << flag << "' for format `"
1195 << format << "'." << endl;
1197 if (prettyname.empty()) {
1198 if (theConverters().formatIsUsed(format)) {
1199 lyxerr << "Can't delete format "
1202 formats.erase(format);
1205 formats.add(format, extension, prettyname,
1206 shortcut, viewer, editor, flgs);
1210 case RC_DEFAULT_LANGUAGE:
1212 default_language = lexrc.getString();
1216 case RC_LABEL_INIT_LENGTH:
1218 label_init_length = lexrc.getInteger();
1222 case RC_SHOW_BANNER:
1224 show_banner = lexrc.getBool();
1230 string const tmp = lexrc.getString();
1231 if (tmp == "true" || tmp == "on")
1232 preview = PREVIEW_ON;
1233 else if (tmp == "no_math")
1234 preview = PREVIEW_NO_MATH;
1236 preview = PREVIEW_OFF;
1237 if (tmp != "false" && tmp != "off")
1238 lyxerr << "Unrecognized "
1240 << tmp << '\n' << endl;
1245 case RC_PREVIEW_HASHED_LABELS:
1247 preview_hashed_labels = lexrc.getBool();
1251 case RC_PREVIEW_SCALE_FACTOR:
1253 preview_scale_factor = lexrc.getString();
1259 user_name = lexrc.getString();
1264 user_email = lexrc.getString();
1267 case RC_PATH_PREFIX:
1269 path_prefix = lexrc.getString();
1272 case RC_USE_CONVERTER_CACHE:
1274 use_converter_cache = lexrc.getBool();
1277 case RC_CONVERTER_CACHE_MAXAGE:
1279 converter_cache_maxage =
1280 convert<unsigned int>(lexrc.getString());
1283 case RC_SORT_LAYOUTS:
1285 sort_layouts = lexrc.getBool();
1287 case RC_GROUP_LAYOUTS:
1289 group_layouts = lexrc.getBool();
1291 case RC_FULL_SCREEN_LIMIT:
1293 full_screen_limit = lexrc.getBool();
1295 case RC_FULL_SCREEN_TOOLBARS:
1297 full_screen_toolbars = lexrc.getBool();
1299 case RC_FULL_SCREEN_SCROLLBAR:
1301 full_screen_scrollbar = lexrc.getBool();
1303 case RC_FULL_SCREEN_TABBAR:
1305 full_screen_tabbar = lexrc.getBool();
1307 case RC_FULL_SCREEN_WIDTH:
1309 full_screen_width = lexrc.getInteger();
1311 case RC_OPEN_BUFFERS_IN_TABS:
1313 open_buffers_in_tabs = lexrc.getBool();
1315 case RC_USE_BUNDLED_FORMAT:
1317 use_bundled_format = lexrc.getBool();
1320 case RC_LAST: break; // this is just a dummy
1324 /// Update converters data-structures
1325 theConverters().update(formats);
1326 theConverters().buildGraph();
1332 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1334 ofstream ofs(filename.toFilesystemEncoding().c_str());
1336 write(ofs, ignore_system_lyxrc);
1340 void LyXRC::print() const
1342 if (lyxerr.debugging())
1343 write(lyxerr, false);
1351 typedef pair<string, SpecialisedMover> Data;
1353 SameMover(Data const & comparison)
1354 : comparison_(comparison) {}
1356 bool operator()(Data const & data) const
1358 return data.first == comparison_.first &&
1359 data.second.command() == comparison_.second.command();
1367 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1369 LyXRCTags tag = RC_LAST;
1371 if (!name.empty()) {
1372 for (int i = 0; i != lyxrcCount; ++i)
1373 if ("\\" + name == lyxrcTags[i].tag)
1374 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1378 os << "### This file is part of\n"
1379 << "### ========================================================\n"
1380 << "### LyX, The Document Processor\n"
1382 << "### Copyright 1995 Matthias Ettrich\n"
1383 << "### Copyright 1995-2007 The LyX Team.\n"
1385 << "### ========================================================\n"
1387 << "# This file is written by LyX, if you want to make your own\n"
1388 << "# modifications you should do them from inside LyX and save\n"
1391 // Why the switch you might ask. It is a trick to ensure that all
1392 // the elements in the LyXRCTags enum is handled. As you can see
1393 // there are no breaks at all. So it is just a huge fall-through.
1394 // The nice thing is that we will get a warning from the compiler
1395 // if we forget an element.
1399 // input/include files are not done here
1401 if (ignore_system_lyxrc ||
1402 bind_file != system_lyxrc.bind_file) {
1403 string const path = os::external_path(bind_file);
1404 os << "\\bind_file \"" << path << "\"\n";
1410 if (ignore_system_lyxrc ||
1411 def_file != system_lyxrc.def_file) {
1412 string const path = os::external_path(def_file);
1413 os << "\\def_file \"" << path << "\"\n";
1422 << "# MISC SECTION ######################################\n"
1424 // bind files are not done here.
1426 case RC_PATH_PREFIX:
1427 if (ignore_system_lyxrc ||
1428 path_prefix != system_lyxrc.path_prefix) {
1429 os << "\\path_prefix \"" << path_prefix << "\"\n";
1434 if (ignore_system_lyxrc ||
1435 ui_file != system_lyxrc.ui_file) {
1436 string const path = os::external_path(ui_file);
1437 os << "\\ui_file \"" << path << "\"\n";
1441 case RC_AUTOREGIONDELETE:
1442 if (ignore_system_lyxrc ||
1443 auto_region_delete != system_lyxrc.auto_region_delete) {
1444 os << "# Set to false to inhibit automatic replacement of\n"
1445 << "# the current selection.\n"
1446 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1451 case RC_AUTORESET_OPTIONS:
1452 if (ignore_system_lyxrc ||
1453 auto_reset_options != system_lyxrc.auto_reset_options) {
1454 os << "# Set to false to inhibit automatic reset of\n"
1455 << "# the class options to defaults on class change.\n"
1456 << "\\auto_reset_options "
1457 << convert<string>(auto_reset_options)
1463 if (ignore_system_lyxrc ||
1464 autosave != system_lyxrc.autosave) {
1465 os << "# The time interval between auto-saves in seconds.\n"
1466 << "\\autosave " << autosave << '\n';
1470 case RC_DISPLAY_GRAPHICS:
1471 if (ignore_system_lyxrc ||
1472 display_graphics != system_lyxrc.display_graphics) {
1473 os << "# Display graphics within LyX\n"
1474 << "# monochrome|grayscale|color|none\n"
1475 << "\\display_graphics "
1476 << graphics::displayTranslator().find(
1477 graphics::DisplayType(display_graphics))
1482 case RC_SORT_LAYOUTS:
1483 if (ignore_system_lyxrc ||
1484 sort_layouts != system_lyxrc.sort_layouts) {
1485 os << "# Sort layouts alphabetically.\n"
1486 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1490 case RC_GROUP_LAYOUTS:
1491 if (ignore_system_lyxrc ||
1492 group_layouts != system_lyxrc.group_layouts) {
1493 os << "# Group layouts by their category.\n"
1494 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1498 case RC_VIEWDVI_PAPEROPTION:
1499 if (ignore_system_lyxrc ||
1500 view_dvi_paper_option
1501 != system_lyxrc.view_dvi_paper_option) {
1502 os << "# Options used to specify paper size to the\n"
1503 << "# view_dvi_command (e.g. -paper)\n"
1504 << "\\view_dvi_paper_option \""
1505 << view_dvi_paper_option << "\"\n";
1509 case RC_DEFAULT_PAPERSIZE:
1510 if (ignore_system_lyxrc ||
1511 default_papersize != system_lyxrc.default_papersize) {
1512 os << "# The default papersize to use.\n"
1513 << "\\default_papersize \"";
1514 switch (default_papersize) {
1516 os << "default"; break;
1517 case PAPER_USLETTER:
1518 os << "usletter"; break;
1520 os << "legal"; break;
1521 case PAPER_USEXECUTIVE:
1522 os << "executive"; break;
1533 case PAPER_B4: break;
1539 case RC_CHKTEX_COMMAND:
1540 if (ignore_system_lyxrc ||
1541 chktex_command != system_lyxrc.chktex_command) {
1542 os << "\\chktex_command \"" << chktex_command << "\"\n";
1546 case RC_BIBTEX_COMMAND:
1547 if (ignore_system_lyxrc ||
1548 bibtex_command != system_lyxrc.bibtex_command) {
1549 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1553 case RC_INDEX_COMMAND:
1554 if (ignore_system_lyxrc ||
1555 index_command != system_lyxrc.index_command) {
1556 os << "\\index_command \"" << index_command << "\"\n";
1560 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1561 if (ignore_system_lyxrc ||
1562 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1563 os << "\\tex_expects_windows_paths "
1564 << convert<string>(windows_style_tex_paths) << '\n';
1568 case RC_TEX_ALLOWS_SPACES:
1569 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1570 os << "\\tex_allows_spaces "
1571 << convert<string>(tex_allows_spaces) << '\n';
1576 if (ignore_system_lyxrc ||
1577 use_kbmap != system_lyxrc.use_kbmap) {
1578 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1582 case RC_KBMAP_PRIMARY:
1583 if (ignore_system_lyxrc ||
1584 primary_kbmap != system_lyxrc.primary_kbmap) {
1585 string const path = os::external_path(primary_kbmap);
1586 os << "\\kbmap_primary \"" << path << "\"\n";
1590 case RC_KBMAP_SECONDARY:
1591 if (ignore_system_lyxrc ||
1592 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1593 string const path = os::external_path(secondary_kbmap);
1594 os << "\\kbmap_secondary \"" << path << "\"\n";
1599 if (ignore_system_lyxrc ||
1600 lyxpipes != system_lyxrc.lyxpipes) {
1601 string const path = os::external_path(lyxpipes);
1602 os << "\\serverpipe \"" << path << "\"\n";
1606 case RC_DATE_INSERT_FORMAT:
1607 if (ignore_system_lyxrc ||
1608 date_insert_format != system_lyxrc.date_insert_format) {
1609 os << "\\date_insert_format \"" << date_insert_format
1614 case RC_LABEL_INIT_LENGTH:
1615 if (ignore_system_lyxrc ||
1616 label_init_length != system_lyxrc.label_init_length) {
1617 os << "\\label_init_length " << label_init_length
1624 os << "\\user_name \"" << user_name << "\"\n";
1629 os << "\\user_email \"" << user_email << "\"\n";
1633 case RC_SHOW_BANNER:
1634 if (ignore_system_lyxrc ||
1635 show_banner != system_lyxrc.show_banner) {
1636 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1642 if (ignore_system_lyxrc ||
1643 preview != system_lyxrc.preview) {
1649 case PREVIEW_NO_MATH:
1656 os << "\\preview " << status << '\n';
1661 case RC_PREVIEW_HASHED_LABELS:
1662 if (ignore_system_lyxrc ||
1663 preview_hashed_labels !=
1664 system_lyxrc.preview_hashed_labels) {
1665 os << "\\preview_hashed_labels "
1666 << convert<string>(preview_hashed_labels) << '\n';
1671 case RC_PREVIEW_SCALE_FACTOR:
1672 if (ignore_system_lyxrc ||
1673 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1674 os << "\\preview_scale_factor "
1675 << preview_scale_factor << '\n';
1680 case RC_USE_CONVERTER_CACHE:
1681 if (ignore_system_lyxrc ||
1682 use_converter_cache != system_lyxrc.use_converter_cache) {
1683 os << "\\use_converter_cache "
1684 << convert<string>(use_converter_cache) << '\n';
1689 case RC_CONVERTER_CACHE_MAXAGE:
1690 if (ignore_system_lyxrc ||
1691 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1692 os << "\\converter_cache_maxage "
1693 << converter_cache_maxage << '\n';
1699 << "# SCREEN & FONTS SECTION ############################\n"
1703 if (ignore_system_lyxrc ||
1704 dpi != system_lyxrc.dpi) {
1705 os << "\\screen_dpi " << dpi << '\n';
1709 case RC_SCREEN_ZOOM:
1710 if (ignore_system_lyxrc ||
1711 zoom != system_lyxrc.zoom) {
1712 os << "\\screen_zoom " << zoom << '\n';
1716 case RC_GEOMETRY_SESSION:
1717 if (ignore_system_lyxrc ||
1718 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1719 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1724 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1725 if (ignore_system_lyxrc ||
1726 cursor_follows_scrollbar
1727 != system_lyxrc.cursor_follows_scrollbar) {
1728 os << "\\cursor_follows_scrollbar "
1729 << convert<string>(cursor_follows_scrollbar) << '\n';
1733 case RC_MACRO_EDIT_STYLE:
1734 if (ignore_system_lyxrc ||
1736 != system_lyxrc.macro_edit_style) {
1737 os << "\\macro_edit_style ";
1738 switch (macro_edit_style) {
1739 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1740 case MACRO_EDIT_INLINE: os << "1\n"; break;
1741 case MACRO_EDIT_LIST: os << "2\n"; break;
1746 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1747 if (ignore_system_lyxrc ||
1748 dialogs_iconify_with_main
1749 != system_lyxrc.dialogs_iconify_with_main) {
1750 os << "\\dialogs_iconify_with_main "
1751 << convert<string>(dialogs_iconify_with_main) << '\n';
1755 case RC_SCREEN_FONT_ROMAN:
1756 if (ignore_system_lyxrc ||
1757 roman_font_name != system_lyxrc.roman_font_name) {
1758 os << "\\screen_font_roman \"" << roman_font_name
1763 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1764 if (ignore_system_lyxrc ||
1765 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1766 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1771 case RC_SCREEN_FONT_SANS:
1772 if (ignore_system_lyxrc ||
1773 sans_font_name != system_lyxrc.sans_font_name) {
1774 os << "\\screen_font_sans \"" << sans_font_name
1779 case RC_SCREEN_FONT_SANS_FOUNDRY:
1780 if (ignore_system_lyxrc ||
1781 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1782 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1787 case RC_SCREEN_FONT_TYPEWRITER:
1788 if (ignore_system_lyxrc ||
1789 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1790 os << "\\screen_font_typewriter \""
1791 << typewriter_font_name << "\"\n";
1795 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1796 if (ignore_system_lyxrc ||
1797 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1798 os << "\\screen_font_typewriter_foundry \""
1799 << typewriter_font_foundry << "\"\n";
1804 case RC_SCREEN_FONT_SCALABLE:
1805 if (ignore_system_lyxrc ||
1806 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1807 os << "\\screen_font_scalable "
1808 << convert<string>(use_scalable_fonts)
1813 case RC_SCREEN_FONT_SIZES:
1814 if (ignore_system_lyxrc ||
1815 font_sizes[FONT_SIZE_TINY]
1816 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1817 font_sizes[FONT_SIZE_SCRIPT]
1818 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1819 font_sizes[FONT_SIZE_FOOTNOTE]
1820 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1821 font_sizes[FONT_SIZE_SMALL]
1822 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1823 font_sizes[FONT_SIZE_NORMAL]
1824 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1825 font_sizes[FONT_SIZE_LARGE]
1826 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1827 font_sizes[FONT_SIZE_LARGER]
1828 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1829 font_sizes[FONT_SIZE_LARGEST]
1830 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1831 font_sizes[FONT_SIZE_HUGE]
1832 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1833 font_sizes[FONT_SIZE_HUGER]
1834 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1835 os.setf(ios::fixed);
1837 os << "\\screen_font_sizes"
1838 << ' ' << font_sizes[FONT_SIZE_TINY]
1839 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1840 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1841 << ' ' << font_sizes[FONT_SIZE_SMALL]
1842 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1843 << ' ' << font_sizes[FONT_SIZE_LARGE]
1844 << ' ' << font_sizes[FONT_SIZE_LARGER]
1845 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1846 << ' ' << font_sizes[FONT_SIZE_HUGE]
1847 << ' ' << font_sizes[FONT_SIZE_HUGER]
1852 case RC_FULL_SCREEN_LIMIT:
1853 if (ignore_system_lyxrc ||
1854 full_screen_limit != system_lyxrc.full_screen_limit) {
1855 os << "\\fullscreen_limit "
1856 << convert<string>(full_screen_limit)
1861 case RC_FULL_SCREEN_TOOLBARS:
1862 if (ignore_system_lyxrc ||
1863 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1864 os << "\\fullscreen_toolbars "
1865 << convert<string>(full_screen_toolbars)
1870 case RC_FULL_SCREEN_SCROLLBAR:
1871 if (ignore_system_lyxrc ||
1872 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1873 os << "\\fullscreen_scrollbar "
1874 << convert<string>(full_screen_scrollbar)
1879 case RC_FULL_SCREEN_TABBAR:
1880 if (ignore_system_lyxrc ||
1881 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1882 os << "\\fullscreen_tabbar "
1883 << convert<string>(full_screen_tabbar)
1888 case RC_FULL_SCREEN_WIDTH:
1889 if (ignore_system_lyxrc ||
1890 full_screen_width != system_lyxrc.full_screen_width) {
1891 os << "\\fullscreen_width "
1892 << convert<string>(full_screen_width)
1897 case RC_OPEN_BUFFERS_IN_TABS:
1898 if (ignore_system_lyxrc ||
1899 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1900 os << "\\open_buffers_in_tabs "
1901 << convert<string>(open_buffers_in_tabs)
1906 case RC_USE_BUNDLED_FORMAT:
1907 if (ignore_system_lyxrc ||
1908 use_bundled_format != system_lyxrc.use_bundled_format) {
1909 os << "\\use_bundled_format "
1910 << convert<string>(use_bundled_format)
1917 << "# COLOR SECTION ###################################\n"
1921 for (int i = 0; i < Color_ignore; ++i) {
1922 ColorCode lc = static_cast<ColorCode>(i);
1924 string const col(lcolor.getX11Name(lc));
1925 if (ignore_system_lyxrc ||
1926 col != system_lcolor.getX11Name(lc)) {
1927 os << "\\set_color \""
1928 << lcolor.getLyXName(lc) << "\" \""
1936 << "# PRINTER SECTION ###################################\n"
1940 if (ignore_system_lyxrc ||
1941 printer != system_lyxrc.printer) {
1942 os << "\\printer \"" << printer << "\"\n";
1946 case RC_PRINT_ADAPTOUTPUT:
1947 if (ignore_system_lyxrc ||
1948 print_adapt_output != system_lyxrc.print_adapt_output) {
1949 os << "\\print_adapt_output "
1950 << convert<string>(print_adapt_output)
1955 case RC_PRINT_COMMAND:
1956 if (ignore_system_lyxrc ||
1957 print_command != system_lyxrc.print_command) {
1958 os << "\\print_command \"" << print_command << "\"\n";
1962 case RC_PRINTEXSTRAOPTIONS:
1963 if (ignore_system_lyxrc ||
1964 print_extra_options != system_lyxrc.print_extra_options) {
1965 os << "\\print_extra_options \"" << print_extra_options
1970 case RC_PRINTSPOOL_COMMAND:
1971 if (ignore_system_lyxrc ||
1972 print_spool_command != system_lyxrc.print_spool_command) {
1973 os << "\\print_spool_command \"" << print_spool_command
1978 case RC_PRINTSPOOL_PRINTERPREFIX:
1979 if (ignore_system_lyxrc ||
1980 print_spool_printerprefix
1981 != system_lyxrc.print_spool_printerprefix) {
1982 os << "\\print_spool_printerprefix \""
1983 << print_spool_printerprefix << "\"\n";
1987 case RC_PRINTEVENPAGEFLAG:
1988 if (ignore_system_lyxrc ||
1989 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1990 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1995 case RC_PRINTODDPAGEFLAG:
1996 if (ignore_system_lyxrc ||
1997 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1998 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2003 case RC_PRINTREVERSEFLAG:
2004 if (ignore_system_lyxrc ||
2005 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2006 os << "\\print_reverse_flag \"" << print_reverse_flag
2011 case RC_PRINTLANDSCAPEFLAG:
2012 if (ignore_system_lyxrc ||
2013 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2014 os << "\\print_landscape_flag \"" << print_landscape_flag
2019 case RC_PRINTPAGERANGEFLAG:
2020 if (ignore_system_lyxrc ||
2021 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2022 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2027 case RC_PRINTCOPIESFLAG:
2028 if (ignore_system_lyxrc ||
2029 print_copies_flag != system_lyxrc.print_copies_flag) {
2030 os << "\\print_copies_flag \"" << print_copies_flag
2035 case RC_PRINTCOLLCOPIESFLAG:
2036 if (ignore_system_lyxrc ||
2037 print_collcopies_flag
2038 != system_lyxrc.print_collcopies_flag) {
2039 os << "\\print_collcopies_flag \""
2040 << print_collcopies_flag
2045 case RC_PRINTPAPERFLAG:
2046 if (ignore_system_lyxrc ||
2047 print_paper_flag != system_lyxrc.print_paper_flag) {
2048 os << "\\print_paper_flag \"" << print_paper_flag
2053 case RC_PRINTPAPERDIMENSIONFLAG:
2054 if (ignore_system_lyxrc ||
2055 print_paper_dimension_flag
2056 != system_lyxrc.print_paper_dimension_flag) {
2057 os << "\\print_paper_dimension_flag \""
2058 << print_paper_dimension_flag << "\"\n";
2062 case RC_PRINTTOPRINTER:
2063 if (ignore_system_lyxrc ||
2064 print_to_printer != system_lyxrc.print_to_printer) {
2065 os << "\\print_to_printer \"" << print_to_printer
2070 case RC_PRINTTOFILE:
2071 if (ignore_system_lyxrc ||
2072 print_to_file != system_lyxrc.print_to_file) {
2073 string const path = os::external_path(print_to_file);
2074 os << "\\print_to_file \"" << path << "\"\n";
2078 case RC_PRINTFILEEXTENSION:
2079 if (ignore_system_lyxrc ||
2080 print_file_extension != system_lyxrc.print_file_extension) {
2081 os << "\\print_file_extension \""
2082 << print_file_extension
2089 << "# EXPORT SECTION ####################################\n"
2092 case RC_CUSTOM_EXPORT_COMMAND:
2093 if (ignore_system_lyxrc ||
2094 custom_export_command
2095 != system_lyxrc.custom_export_command) {
2096 os << "\\custom_export_command \""
2097 << custom_export_command
2102 case RC_CUSTOM_EXPORT_FORMAT:
2103 if (ignore_system_lyxrc ||
2104 custom_export_format
2105 != system_lyxrc.custom_export_format) {
2106 os << "\\custom_export_format \"" << custom_export_format
2113 << "# TEX SECTION #######################################\n"
2116 case RC_FONT_ENCODING:
2117 if (ignore_system_lyxrc ||
2118 fontenc != system_lyxrc.fontenc) {
2119 os << "\\font_encoding \"" << fontenc << "\"\n";
2125 << "# FILE SECTION ######################################\n"
2128 case RC_DOCUMENTPATH:
2129 if (ignore_system_lyxrc ||
2130 document_path != system_lyxrc.document_path) {
2131 string const path = os::external_path(document_path);
2132 os << "\\document_path \"" << path << "\"\n";
2136 case RC_USELASTFILEPOS:
2137 if (ignore_system_lyxrc ||
2138 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2139 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2144 case RC_LOADSESSION:
2145 if (ignore_system_lyxrc ||
2146 load_session != system_lyxrc.load_session) {
2147 os << "\\load_session " << convert<string>(load_session)
2152 case RC_MOUSE_WHEEL_SPEED:
2153 if (ignore_system_lyxrc ||
2154 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2155 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2159 case RC_COMPLETION_INLINE_DELAY:
2160 if (ignore_system_lyxrc ||
2161 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2162 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2166 case RC_COMPLETION_INLINE_MATH:
2167 if (ignore_system_lyxrc ||
2168 completion_inline_math != system_lyxrc.completion_inline_math) {
2169 os << "\\completion_inline_math "
2170 << convert<string>(completion_inline_math) << '\n';
2174 case RC_COMPLETION_INLINE_TEXT:
2175 if (ignore_system_lyxrc ||
2176 completion_inline_text != system_lyxrc.completion_inline_text) {
2177 os << "\\completion_inline_text "
2178 << convert<string>(completion_inline_text) << '\n';
2182 case RC_COMPLETION_INLINE_DOTS:
2183 if (ignore_system_lyxrc ||
2184 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2185 os << "\\completion_inline_dots "
2186 << convert<string>(completion_inline_dots) << '\n';
2190 case RC_COMPLETION_POPUP_DELAY:
2191 if (ignore_system_lyxrc ||
2192 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2193 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2197 case RC_COMPLETION_POPUP_MATH:
2198 if (ignore_system_lyxrc ||
2199 completion_popup_math != system_lyxrc.completion_popup_math) {
2200 os << "\\completion_popup_math "
2201 << convert<string>(completion_popup_math) << '\n';
2205 case RC_COMPLETION_POPUP_TEXT:
2206 if (ignore_system_lyxrc ||
2207 completion_popup_text != system_lyxrc.completion_popup_text) {
2208 os << "\\completion_popup_text "
2209 << convert<string>(completion_popup_text) << '\n';
2213 case RC_COMPLETION_CURSOR_TEXT:
2214 if (ignore_system_lyxrc ||
2215 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2216 os << "\\completion_cursor_text "
2217 << convert<string>(completion_cursor_text) << '\n';
2221 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2222 if (ignore_system_lyxrc ||
2223 completion_popup_after_complete
2224 != system_lyxrc.completion_popup_after_complete) {
2225 os << "\\completion_popup_after_complete "
2226 << convert<string>(completion_popup_after_complete) << '\n';
2230 case RC_NUMLASTFILES:
2231 if (ignore_system_lyxrc ||
2232 num_lastfiles != system_lyxrc.num_lastfiles) {
2233 os << "\\num_lastfiles " << num_lastfiles << '\n';
2237 case RC_CHECKLASTFILES:
2238 if (ignore_system_lyxrc ||
2239 check_lastfiles != system_lyxrc.check_lastfiles) {
2240 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2245 case RC_EXAMPLEPATH:
2246 if (ignore_system_lyxrc ||
2247 example_path != system_lyxrc.example_path) {
2248 string const path = os::external_path(example_path);
2249 os << "\\example_path \"" << path << "\"\n";
2253 case RC_TEMPLATEPATH:
2254 if (ignore_system_lyxrc ||
2255 template_path != system_lyxrc.template_path) {
2256 string const path = os::external_path(template_path);
2257 os << "\\template_path \"" << path << "\"\n";
2261 case RC_TEMPDIRPATH:
2262 if (ignore_system_lyxrc ||
2263 tempdir_path != system_lyxrc.tempdir_path) {
2264 string const path = os::external_path(tempdir_path);
2265 os << "\\tempdir_path \"" << path << "\"\n";
2273 case RC_PLAINTEXT_LINELEN:
2274 if (ignore_system_lyxrc ||
2275 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2276 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2280 case RC_MAKE_BACKUP:
2281 if (ignore_system_lyxrc ||
2282 make_backup != system_lyxrc.make_backup) {
2283 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2287 case RC_BACKUPDIR_PATH:
2288 if (ignore_system_lyxrc ||
2289 backupdir_path != system_lyxrc.backupdir_path) {
2290 string const path = os::external_path(backupdir_path);
2291 os << "\\backupdir_path \"" << path << "\"\n";
2297 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2300 case RC_PLAINTEXT_ROFF_COMMAND:
2301 if (ignore_system_lyxrc ||
2302 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2303 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2310 << "# SPELLCHECKER SECTION ##############################\n"
2312 case RC_USE_SPELL_LIB:
2313 if (ignore_system_lyxrc ||
2314 use_spell_lib != system_lyxrc.use_spell_lib) {
2315 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2319 case RC_SPELL_COMMAND:
2320 if (ignore_system_lyxrc ||
2321 isp_command != system_lyxrc.isp_command) {
2322 os << "\\spell_command \"" << isp_command << "\"\n";
2326 case RC_ACCEPT_COMPOUND:
2327 if (ignore_system_lyxrc ||
2328 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2329 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2334 case RC_USE_ALT_LANG:
2335 if (ignore_system_lyxrc ||
2336 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2337 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2343 if (ignore_system_lyxrc ||
2344 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2345 os << "\\alternate_language \"" << isp_alt_lang
2350 case RC_USE_ESC_CHARS:
2351 if (ignore_system_lyxrc ||
2352 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2353 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2359 if (ignore_system_lyxrc ||
2360 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2361 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2365 case RC_USE_PERS_DICT:
2366 if (ignore_system_lyxrc ||
2367 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2368 os << "\\use_personal_dictionary "
2369 << convert<string>(isp_use_pers_dict)
2374 case RC_USE_TOOLTIP:
2375 if (ignore_system_lyxrc ||
2376 use_tooltip != system_lyxrc.use_tooltip) {
2377 os << "\\use_tooltip "
2378 << convert<string>(use_tooltip)
2381 case RC_USE_PIXMAP_CACHE:
2382 if (ignore_system_lyxrc ||
2383 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2384 os << "\\use_pixmap_cache "
2385 << convert<string>(use_pixmap_cache)
2389 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2390 string const path = os::external_path(isp_pers_dict);
2391 os << "\\personal_dictionary \"" << path << "\"\n";
2395 case RC_USE_INP_ENC:
2396 if (ignore_system_lyxrc ||
2397 isp_use_input_encoding
2398 != system_lyxrc.isp_use_input_encoding) {
2399 os << "\\use_input_encoding "
2400 << convert<string>(isp_use_input_encoding)
2407 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2410 case RC_RTL_SUPPORT:
2411 if (ignore_system_lyxrc ||
2412 rtl_support != system_lyxrc.rtl_support) {
2413 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2417 case RC_VISUAL_CURSOR:
2418 if (ignore_system_lyxrc ||
2419 visual_cursor != system_lyxrc.visual_cursor) {
2420 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2424 case RC_LANGUAGE_PACKAGE:
2425 if (ignore_system_lyxrc ||
2426 language_package != system_lyxrc.language_package) {
2427 os << "\\language_package \"" << language_package
2432 case RC_LANGUAGE_GLOBAL_OPTIONS:
2433 if (ignore_system_lyxrc ||
2434 language_global_options
2435 != system_lyxrc.language_global_options) {
2436 os << "\\language_global_options \""
2437 << convert<string>(language_global_options)
2442 case RC_LANGUAGE_USE_BABEL:
2443 if (ignore_system_lyxrc ||
2444 language_use_babel != system_lyxrc.language_use_babel) {
2445 os << "\\language_use_babel \""
2446 << convert<string>(language_use_babel)
2451 case RC_LANGUAGE_COMMAND_BEGIN:
2452 if (ignore_system_lyxrc ||
2453 language_command_begin
2454 != system_lyxrc.language_command_begin) {
2455 os << "\\language_command_begin \""
2456 << language_command_begin
2461 case RC_LANGUAGE_COMMAND_END:
2462 if (ignore_system_lyxrc ||
2463 language_command_end
2464 != system_lyxrc.language_command_end) {
2465 os << "\\language_command_end \"" << language_command_end
2470 case RC_LANGUAGE_COMMAND_LOCAL:
2471 if (ignore_system_lyxrc ||
2472 language_command_local
2473 != system_lyxrc.language_command_local) {
2474 os << "\\language_command_local \""
2475 << language_command_local
2480 case RC_LANGUAGE_AUTO_BEGIN:
2481 if (ignore_system_lyxrc ||
2482 language_auto_begin != system_lyxrc.language_auto_begin) {
2483 os << "\\language_auto_begin "
2484 << convert<string>(language_auto_begin) << '\n';
2488 case RC_LANGUAGE_AUTO_END:
2489 if (ignore_system_lyxrc ||
2490 language_auto_end != system_lyxrc.language_auto_end) {
2491 os << "\\language_auto_end "
2492 << convert<string>(language_auto_end) << '\n';
2496 case RC_MARK_FOREIGN_LANGUAGE:
2497 if (ignore_system_lyxrc ||
2498 mark_foreign_language
2499 != system_lyxrc.mark_foreign_language) {
2500 os << "\\mark_foreign_language " <<
2501 convert<string>(mark_foreign_language) << '\n';
2507 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2510 case RC_AUTO_NUMBER:
2511 if (ignore_system_lyxrc ||
2512 auto_number != system_lyxrc.auto_number) {
2513 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2517 case RC_DEFAULT_LANGUAGE:
2518 if (ignore_system_lyxrc ||
2519 default_language != system_lyxrc.default_language) {
2520 os << "\\default_language " << default_language << '\n';
2526 << "# FORMATS SECTION ##########################\n"
2530 // New/modified formats
2531 for (Formats::const_iterator cit = formats.begin();
2532 cit != formats.end(); ++cit) {
2533 Format const * format =
2534 system_formats.getFormat(cit->name());
2536 format->extension() != cit->extension() ||
2537 format->prettyname() != cit->prettyname() ||
2538 format->shortcut() != cit->shortcut() ||
2539 format->viewer() != cit->viewer() ||
2540 format->editor() != cit->editor() ||
2541 format->documentFormat() != cit->documentFormat() ||
2542 format->vectorFormat() != cit->vectorFormat()) {
2543 os << "\\format \"" << cit->name() << "\" \""
2544 << cit->extension() << "\" \""
2545 << cit->prettyname() << "\" \""
2546 << cit->shortcut() << "\" \""
2547 << cit->viewer() << "\" \""
2548 << cit->editor() << "\" \"";
2549 vector<string> flags;
2550 if (cit->documentFormat())
2551 flags.push_back("document");
2552 if (cit->vectorFormat())
2553 flags.push_back("vector");
2554 os << getStringFromVector(flags);
2559 // Look for deleted formats
2560 for (Formats::const_iterator cit = system_formats.begin();
2561 cit != system_formats.end(); ++cit)
2562 if (!formats.getFormat(cit->name()))
2563 os << "\\format \"" << cit->name()
2564 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2573 << "# CONVERTERS SECTION ##########################\n"
2577 // Look for new converters
2578 for (Converters::const_iterator cit = theConverters().begin();
2579 cit != theConverters().end(); ++cit) {
2580 Converter const * converter =
2581 theSystemConverters().getConverter(cit->from,
2584 converter->command != cit->command ||
2585 converter->flags != cit->flags)
2586 os << "\\converter \"" << cit->from << "\" \""
2587 << cit->to << "\" \""
2588 << cit->command << "\" \""
2589 << cit->flags << "\"\n";
2592 // New/modifed converters
2593 for (Converters::const_iterator cit = theSystemConverters().begin();
2594 cit != theSystemConverters().end(); ++cit)
2595 if (!theConverters().getConverter(cit->from, cit->to))
2596 os << "\\converter \"" << cit->from
2597 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2604 << "# COPIERS SECTION ##########################\n"
2607 // Look for new movers
2608 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2609 Movers::const_iterator const sysend = theSystemMovers().end();
2610 Movers::const_iterator it = theMovers().begin();
2611 Movers::const_iterator end = theMovers().end();
2613 for (; it != end; ++it) {
2614 Movers::const_iterator const sysit =
2615 find_if(sysbegin, sysend, SameMover(*it));
2616 if (sysit == sysend) {
2617 string const & fmt = it->first;
2618 string const & command =
2619 it->second.command();
2621 os << "\\copier " << fmt
2622 << " \"" << command << "\"\n";
2628 // We don't actually delete SpecialisedMover(s) from the
2629 // map, just clear their 'command', so there's no need
2630 // to test for anything else.
2638 string const LyXRC::getDescription(LyXRCTags tag)
2643 case RC_ACCEPT_COMPOUND:
2644 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2648 case RC_USE_ALT_LANG:
2649 str = _("Specify an alternate language. The default is to use the language of the document.");
2652 case RC_PLAINTEXT_ROFF_COMMAND:
2653 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.");
2656 case RC_PLAINTEXT_LINELEN:
2657 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.");
2660 case RC_AUTOREGIONDELETE:
2661 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2664 case RC_AUTORESET_OPTIONS:
2665 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2669 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2672 case RC_AUTO_NUMBER:
2675 case RC_BACKUPDIR_PATH:
2676 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.");
2679 case RC_BIBTEX_COMMAND:
2680 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2684 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2687 case RC_CHECKLASTFILES:
2688 str = _("Select to check whether the lastfiles still exist.");
2691 case RC_CHKTEX_COMMAND:
2692 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2701 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2702 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.");
2705 case RC_SHOW_MACRO_LABEL:
2706 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2709 case RC_CUSTOM_EXPORT_COMMAND:
2712 case RC_CUSTOM_EXPORT_FORMAT:
2715 case RC_DATE_INSERT_FORMAT:
2716 //xgettext:no-c-format
2717 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2721 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2724 case RC_DEFAULT_LANGUAGE:
2725 str = _("New documents will be assigned this language.");
2728 case RC_DEFAULT_PAPERSIZE:
2729 str = _("Specify the default paper size.");
2732 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2733 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2736 case RC_DISPLAY_GRAPHICS:
2737 str = _("Select how LyX will display any graphics.");
2740 case RC_DOCUMENTPATH:
2741 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2745 case RC_USE_ESC_CHARS:
2746 str = _("Specify additional chars that can be part of a word.");
2749 case RC_EXAMPLEPATH:
2750 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2753 case RC_FONT_ENCODING:
2754 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2760 case RC_INDEX_COMMAND:
2761 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\".");
2768 case RC_KBMAP_PRIMARY:
2769 case RC_KBMAP_SECONDARY:
2770 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.");
2773 case RC_LABEL_INIT_LENGTH:
2774 str = _("Maximum number of words in the initialization string for a new label");
2777 case RC_LANGUAGE_AUTO_BEGIN:
2778 str = _("Select if a language switching command is needed at the beginning of the document.");
2781 case RC_LANGUAGE_AUTO_END:
2782 str = _("Select if a language switching command is needed at the end of the document.");
2785 case RC_LANGUAGE_COMMAND_BEGIN:
2786 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.");
2789 case RC_LANGUAGE_COMMAND_END:
2790 str = _("The LaTeX command for changing back to the language of the document.");
2793 case RC_LANGUAGE_COMMAND_LOCAL:
2794 str = _("The LaTeX command for local changing of the language.");
2797 case RC_LANGUAGE_GLOBAL_OPTIONS:
2798 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2801 case RC_LANGUAGE_PACKAGE:
2802 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2805 case RC_LANGUAGE_USE_BABEL:
2806 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2809 case RC_USELASTFILEPOS:
2810 str = _("De-select if you do not want LyX to scroll to saved position.");
2813 case RC_LOADSESSION:
2814 str = _("De-select to prevent loading files opened from the last LyX session.");
2817 case RC_MAKE_BACKUP:
2818 str = _("De-select if you don't want LyX to create backup files.");
2821 case RC_MARK_FOREIGN_LANGUAGE:
2822 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2825 case RC_MOUSE_WHEEL_SPEED:
2826 str = bformat(_("The scrolling speed of the mouse wheel."),
2830 case RC_COMPLETION_POPUP_DELAY:
2831 str = _("The completion popup delay.");
2834 case RC_COMPLETION_POPUP_MATH:
2835 str = _("Select to display the completion popup in math mode.");
2838 case RC_COMPLETION_POPUP_TEXT:
2839 str = _("Select to display the completion popup in text mode.");
2842 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2843 str = _("Show the completion popup without delay after non-unique completion attempt.");
2846 case RC_COMPLETION_POPUP_TEXT:
2847 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2850 case RC_COMPLETION_POPUP_DELAY:
2851 str = _("The inline completion delay.");
2854 case RC_COMPLETION_INLINE_MATH:
2855 str = _("Select to display the inline completion in math mode.");
2858 case RC_COMPLETION_INLINE_TEXT:
2859 str = _("Select to display the inline completion in text mode.");
2862 case RC_COMPLETION_INLINE_DOTS:
2863 str = _("Use \"...\" to shorten long completions.");
2866 case RC_NUMLASTFILES:
2867 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2871 case RC_PATH_PREFIX:
2872 str = _("Specify those directories which should be "
2873 "prepended to the PATH environment variable. "
2874 "Use the OS native format.");
2878 case RC_USE_PERS_DICT:
2879 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2883 str = _("Shows a typeset preview of things such as math");
2886 case RC_PREVIEW_HASHED_LABELS:
2887 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2890 case RC_PREVIEW_SCALE_FACTOR:
2891 str = _("Scale the preview size to suit.");
2894 case RC_PRINTCOLLCOPIESFLAG:
2895 str = _("The option for specifying whether the copies should be collated.");
2898 case RC_PRINTCOPIESFLAG:
2899 str = _("The option for specifying the number of copies to print.");
2903 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2906 case RC_PRINTEVENPAGEFLAG:
2907 str = _("The option to print only even pages.");
2910 case RC_PRINTEXSTRAOPTIONS:
2911 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2914 case RC_PRINTFILEEXTENSION:
2915 str = _("Extension of printer program output file. Usually \".ps\".");
2918 case RC_PRINTLANDSCAPEFLAG:
2919 str = _("The option to print out in landscape.");
2922 case RC_PRINTODDPAGEFLAG:
2923 str = _("The option to print only odd pages.");
2926 case RC_PRINTPAGERANGEFLAG:
2927 str = _("The option for specifying a comma-separated list of pages to print.");
2930 case RC_PRINTPAPERDIMENSIONFLAG:
2931 str = _("Option to specify the dimensions of the print paper.");
2934 case RC_PRINTPAPERFLAG:
2935 str = _("The option to specify paper type.");
2938 case RC_PRINTREVERSEFLAG:
2939 str = _("The option to reverse the order of the pages printed.");
2942 case RC_PRINTSPOOL_COMMAND:
2943 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.");
2946 case RC_PRINTSPOOL_PRINTERPREFIX:
2947 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.");
2950 case RC_PRINTTOFILE:
2951 str = _("Option to pass to the print program to print to a file.");
2954 case RC_PRINTTOPRINTER:
2955 str = _("Option to pass to the print program to print on a specific printer.");
2958 case RC_PRINT_ADAPTOUTPUT:
2959 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2962 case RC_PRINT_COMMAND:
2963 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2966 case RC_RTL_SUPPORT:
2967 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2970 case RC_VISUAL_CURSOR:
2971 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2975 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2978 case RC_SCREEN_FONT_ROMAN:
2979 case RC_SCREEN_FONT_SANS:
2980 case RC_SCREEN_FONT_TYPEWRITER:
2981 str = _("The screen fonts used to display the text while editing.");
2984 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2985 case RC_SCREEN_FONT_SANS_FOUNDRY:
2986 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2989 case RC_SCREEN_FONT_SCALABLE:
2990 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.");
2993 case RC_SCREEN_FONT_SIZES:
2994 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2997 case RC_SCREEN_ZOOM:
2998 //xgettext:no-c-format
2999 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3002 case RC_GEOMETRY_SESSION:
3003 str = _("Allow session manager to save and restore windows geometry.");
3007 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3013 case RC_SHOW_BANNER:
3014 str = _("De-select if you don't want the startup banner.");
3017 case RC_SPELL_COMMAND:
3018 str = _("What command runs the spellchecker?");
3021 case RC_TEMPDIRPATH:
3022 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3025 case RC_TEMPLATEPATH:
3026 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3029 case RC_TEX_ALLOWS_SPACES:
3032 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3036 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3048 case RC_USE_INP_ENC:
3049 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.");
3052 case RC_USE_TOOLTIP:
3053 str = _("Enable the automatic appearance of tool tips in the work area.");
3056 case RC_USE_PIXMAP_CACHE:
3057 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3060 case RC_USE_SPELL_LIB:
3063 case RC_VIEWDVI_PAPEROPTION:
3064 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3079 // The global instance
3082 // The global copy of the system lyxrc entries (everything except preferences)