3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
25 #include "Converter.h"
29 #include "FontEnums.h"
32 #include "graphics/GraphicsTypes.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/userinfo.h"
44 using namespace lyx::support;
48 namespace os = support::os;
52 // when adding something to this array keep it sorted!
53 keyword_item lyxrcTags[] = {
54 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
55 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
56 { "\\alternate_language", LyXRC::RC_ALT_LANG },
57 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
58 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
59 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
60 { "\\autosave", LyXRC::RC_AUTOSAVE },
61 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
62 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
63 { "\\bind_file", LyXRC::RC_BINDFILE },
64 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
65 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
66 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
67 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
68 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
69 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
70 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
71 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
72 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
73 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
74 { "\\converter", LyXRC::RC_CONVERTER },
75 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
76 { "\\copier", LyXRC::RC_COPIER },
77 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
78 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
79 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
80 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
81 { "\\def_file", LyXRC::RC_DEFFILE },
82 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
83 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
84 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
85 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
86 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
87 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
88 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
89 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
90 { "\\format", LyXRC::RC_FORMAT },
91 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
92 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
93 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
94 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
95 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
96 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
97 { "\\input", LyXRC::RC_INPUT },
98 { "\\kbmap", LyXRC::RC_KBMAP },
99 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
100 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
101 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
102 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
103 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
104 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
105 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
106 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
107 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
108 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
109 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
110 { "\\load_session", LyXRC::RC_LOADSESSION },
111 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
112 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
113 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
114 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
115 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
116 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
117 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
118 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
119 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
120 { "\\preview", LyXRC::RC_PREVIEW },
121 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
122 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
123 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
124 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
125 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
126 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
127 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
128 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
129 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
130 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
131 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
132 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
133 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
134 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
135 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
136 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
137 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
138 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
139 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
140 { "\\printer", LyXRC::RC_PRINTER },
141 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
142 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
143 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
144 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
145 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
146 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
147 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
148 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
149 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
150 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
151 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
152 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
153 { "\\set_color", LyXRC::RC_SET_COLOR },
154 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
155 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
156 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
157 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
158 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
159 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
160 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
161 { "\\ui_file", LyXRC::RC_UIFILE },
162 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
163 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
164 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
165 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
166 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
167 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
168 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
169 // compatibility with versions older than 1.4.0 only
170 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
171 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
172 // compatibility with versions older than 1.4.0 only
173 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
174 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
175 { "\\user_email", LyXRC::RC_USER_EMAIL },
176 { "\\user_name", LyXRC::RC_USER_NAME },
177 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
178 // compatibility with versions older than 1.4.0 only
179 { "\\viewer", LyXRC::RC_VIEWER},
180 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
183 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
194 void LyXRC::setDefaults() {
196 def_file = "default";
198 // Get printer from the environment. If fail, use default "",
199 // assuming that everything is set up correctly.
200 printer = getEnv("PRINTER");
201 print_adapt_output = false;
202 print_command = "dvips";
203 print_evenpage_flag = "-B";
204 print_oddpage_flag = "-A";
205 print_pagerange_flag = "-pp";
206 print_copies_flag = "-c";
207 print_collcopies_flag = "-C";
208 print_reverse_flag = "-r";
209 print_landscape_flag = "-t landscape";
210 print_to_printer = "-P";
211 print_to_file = "-o ";
212 print_file_extension = ".ps";
213 print_paper_flag = "-t";
214 print_paper_dimension_flag = "-T";
215 document_path.erase();
216 view_dvi_paper_option.erase();
217 default_papersize = PAPER_DEFAULT;
218 custom_export_format = "ps";
219 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
220 bibtex_command = "bibtex";
222 index_command = "makeindex -c -q";
224 // Because a screen typically is wider than a piece of paper:
226 allow_geometry_session = true;
227 // Default LaTeX font size:
228 font_sizes[FONT_SIZE_TINY] = "5.0";
229 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
230 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
231 font_sizes[FONT_SIZE_SMALL] = "9.0";
232 font_sizes[FONT_SIZE_NORMAL] = "10.0";
233 font_sizes[FONT_SIZE_LARGE] = "12.0";
234 font_sizes[FONT_SIZE_LARGER] = "14.4";
235 font_sizes[FONT_SIZE_LARGEST] = "17.26";
236 font_sizes[FONT_SIZE_HUGE] = "20.74";
237 font_sizes[FONT_SIZE_HUGER] = "24.88";
238 use_scalable_fonts = true;
239 roman_font_name = "";
241 typewriter_font_name = "";
243 auto_region_delete = true;
244 auto_reset_options = false;
245 plaintext_linelen = 65;
246 mouse_wheel_speed = 1.0;
247 num_lastfiles = maxlastfiles;
248 check_lastfiles = true;
249 use_lastfilepos = true;
250 load_session = false;
252 backupdir_path.erase();
253 display_graphics = graphics::ColorDisplay;
254 // Spellchecker settings:
255 use_spell_lib = true;
256 isp_command = "ispell";
257 isp_accept_compound = false;
258 isp_use_input_encoding = false;
259 isp_use_alt_lang = false;
260 isp_use_pers_dict = false;
261 isp_use_esc_chars = false;
264 visual_cursor = false;
266 mark_foreign_language = true;
267 language_auto_begin = true;
268 language_auto_end = true;
269 language_global_options = true;
270 language_use_babel = true;
271 language_package = "\\usepackage{babel}";
272 language_command_begin = "\\selectlanguage{$$lang}";
273 language_command_local = "\\foreignlanguage{$$lang}{";
274 sort_layouts = false;
275 default_language = "english";
277 windows_style_tex_paths = false;
278 tex_allows_spaces = false;
279 date_insert_format = "%x";
280 cursor_follows_scrollbar = false;
281 macro_edit_style = MACRO_EDIT_INLINE_BOX;
282 dialogs_iconify_with_main = false;
283 label_init_length = 3;
284 preview = PREVIEW_OFF;
285 preview_hashed_labels = false;
286 preview_scale_factor = "0.9";
287 use_converter_cache = true;
289 use_pixmap_cache = false;
290 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
291 user_name = to_utf8(support::user_name());
292 user_email = to_utf8(support::user_email());
294 // Fullscreen settings
295 full_screen_limit = false;
296 full_screen_toolbars = true;
297 full_screen_tabbar = true;
298 full_screen_scrollbar = true;
299 full_screen_width = 700;
301 completion_popup_math = true;
302 completion_popup_text = false;
303 completion_popup_delay = 2.0;
304 completion_popup_after_complete = true;
305 completion_inline_math = true;
306 completion_inline_text = false;
307 completion_inline_dots = -1;
308 completion_inline_delay = 0.2;
314 void oldFontFormat(string & family, string & foundry)
316 if (family.empty() || family[0] != '-')
318 foundry = token(family, '-', 1);
319 family = token(family, '-', 2);
327 int LyXRC::read(FileName const & filename)
329 Lexer lexrc(lyxrcTags, lyxrcCount);
330 if (lyxerr.debugging(Debug::PARSER))
331 lexrc.printTable(lyxerr);
333 lexrc.setFile(filename);
334 if (!lexrc.isOK()) return -2;
336 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
342 int LyXRC::read(istream & is)
344 Lexer lexrc(lyxrcTags, lyxrcCount);
345 if (lyxerr.debugging(Debug::PARSER))
346 lexrc.printTable(lyxerr);
349 if (!lexrc.isOK()) return -2;
351 LYXERR(Debug::LYXRC, "Reading istream...");
357 int LyXRC::read(Lexer & lexrc)
359 if (!lexrc.isOK()) return -2;
361 while (lexrc.isOK()) {
362 // By using two switches we take advantage of the compiler
363 // telling us if we have missed a LyXRCTags element in
364 // the second switch.
365 // Note that this also shows a problem with Lexer since it
366 // helps us avoid taking advantage of the strictness of the
369 int le = lexrc.lex();
371 case Lexer::LEX_UNDEF:
372 lexrc.printError("Unknown tag `$$Token'");
374 case Lexer::LEX_FEOF:
378 switch (static_cast<LyXRCTags>(le)) {
379 case RC_INPUT: // Include file
382 libFileSearch(string(),
385 lexrc.printError("Error reading "
386 "included file: " + tmp.absFilename());
392 bind_file = os::internal_path(lexrc.getString());
398 def_file = os::internal_path(lexrc.getString());
404 ui_file = os::internal_path(lexrc.getString());
408 case RC_AUTORESET_OPTIONS:
410 auto_reset_options = lexrc.getBool();
414 case RC_DISPLAY_GRAPHICS:
416 display_graphics = graphics::displayTranslator().find(lexrc.getString());
420 case RC_TEX_EXPECTS_WINDOWS_PATHS:
422 windows_style_tex_paths = lexrc.getBool();
426 case RC_TEX_ALLOWS_SPACES:
428 tex_allows_spaces = lexrc.getBool();
434 use_kbmap = lexrc.getBool();
438 case RC_KBMAP_PRIMARY:
440 string const kmap(os::internal_path(lexrc.getString()));
443 } else if (!libFileSearch("kbd", kmap,
445 primary_kbmap = kmap;
447 lexrc.printError("LyX: Keymap `$$Token' not found");
452 case RC_KBMAP_SECONDARY:
454 string const kmap(os::internal_path(lexrc.getString()));
457 } else if (!libFileSearch("kbd", kmap,
459 secondary_kbmap = kmap;
461 lexrc.printError("LyX: Keymap `$$Token' not found");
466 case RC_FONT_ENCODING:
468 fontenc = lexrc.getString();
474 printer = lexrc.getString();
478 case RC_PRINT_COMMAND:
480 print_command = lexrc.getString();
484 case RC_PRINTEVENPAGEFLAG:
486 print_evenpage_flag = lexrc.getString();
490 case RC_PRINTODDPAGEFLAG:
492 print_oddpage_flag = lexrc.getString();
496 case RC_PRINTPAGERANGEFLAG:
498 print_pagerange_flag = lexrc.getString();
502 case RC_PRINTCOPIESFLAG:
504 print_copies_flag = lexrc.getString();
508 case RC_PRINTCOLLCOPIESFLAG:
510 print_collcopies_flag = lexrc.getString();
514 case RC_PRINTREVERSEFLAG:
516 print_reverse_flag = lexrc.getString();
520 case RC_PRINTLANDSCAPEFLAG:
522 print_landscape_flag = lexrc.getString();
526 case RC_PRINTTOPRINTER:
528 print_to_printer = lexrc.getString();
532 case RC_PRINT_ADAPTOUTPUT:
534 print_adapt_output = lexrc.getBool();
540 print_to_file = os::internal_path(lexrc.getString());
544 case RC_PRINTFILEEXTENSION:
546 print_file_extension = lexrc.getString();
550 case RC_PRINTEXSTRAOPTIONS:
552 print_extra_options = lexrc.getString();
556 case RC_PRINTSPOOL_COMMAND:
558 print_spool_command = lexrc.getString();
562 case RC_PRINTSPOOL_PRINTERPREFIX:
564 print_spool_printerprefix = lexrc.getString();
568 case RC_PRINTPAPERDIMENSIONFLAG:
570 print_paper_dimension_flag = lexrc.getString();
574 case RC_PRINTPAPERFLAG:
576 print_paper_flag = lexrc.getString();
580 case RC_CUSTOM_EXPORT_COMMAND:
582 custom_export_command = lexrc.getString();
586 case RC_CUSTOM_EXPORT_FORMAT:
588 custom_export_format = lexrc.getString();
592 case RC_DEFAULT_PAPERSIZE:
595 ascii_lowercase(lexrc.getString());
596 if (size == "usletter")
599 else if (size == "legal")
602 else if (size == "executive")
605 else if (size == "a3")
608 else if (size == "a4")
611 else if (size == "a5")
614 else if (size == "b5")
617 else if (size == "default")
623 case RC_VIEWDVI_PAPEROPTION:
625 view_dvi_paper_option = lexrc.getString();
627 view_dvi_paper_option.erase();
631 case RC_CHKTEX_COMMAND:
633 chktex_command = lexrc.getString();
637 case RC_BIBTEX_COMMAND:
639 bibtex_command = lexrc.getString();
643 case RC_INDEX_COMMAND:
645 index_command = lexrc.getString();
651 dpi = lexrc.getInteger();
657 zoom = lexrc.getInteger();
661 case RC_GEOMETRY_SESSION:
663 allow_geometry_session = lexrc.getBool();
667 case RC_SCREEN_FONT_SIZES:
669 font_sizes[FONT_SIZE_TINY] =
673 font_sizes[FONT_SIZE_SCRIPT] =
677 font_sizes[FONT_SIZE_FOOTNOTE] =
681 font_sizes[FONT_SIZE_SMALL] =
685 font_sizes[FONT_SIZE_NORMAL] =
689 font_sizes[FONT_SIZE_LARGE] =
693 font_sizes[FONT_SIZE_LARGER] =
697 font_sizes[FONT_SIZE_LARGEST] =
701 font_sizes[FONT_SIZE_HUGE] =
705 font_sizes[FONT_SIZE_HUGER] =
710 case RC_SCREEN_FONT_SCALABLE:
712 use_scalable_fonts = lexrc.getBool();
718 autosave = lexrc.getInteger();
722 case RC_DOCUMENTPATH:
724 document_path = os::internal_path(lexrc.getString());
725 document_path = expandPath(document_path);
731 example_path = os::internal_path(lexrc.getString());
732 example_path = expandPath(example_path);
736 case RC_TEMPLATEPATH:
738 template_path = os::internal_path(lexrc.getString());
739 template_path = expandPath(template_path);
745 tempdir_path = os::internal_path(lexrc.getString());
746 tempdir_path = expandPath(tempdir_path);
752 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
756 case RC_USELASTFILEPOS:
758 use_lastfilepos = lexrc.getBool();
764 load_session = lexrc.getBool();
768 case RC_MOUSE_WHEEL_SPEED:
770 mouse_wheel_speed = lexrc.getFloat();
774 case RC_COMPLETION_INLINE_DELAY:
776 completion_inline_delay = lexrc.getFloat();
780 case RC_COMPLETION_INLINE_MATH:
782 completion_inline_math = lexrc.getBool();
786 case RC_COMPLETION_INLINE_TEXT:
788 completion_inline_text = lexrc.getBool();
792 case RC_COMPLETION_INLINE_DOTS:
794 completion_inline_dots = lexrc.getInteger();
798 case RC_COMPLETION_POPUP_DELAY:
800 completion_popup_delay = lexrc.getFloat();
804 case RC_COMPLETION_POPUP_MATH:
806 completion_popup_math = lexrc.getBool();
810 case RC_COMPLETION_POPUP_TEXT:
812 completion_popup_text = lexrc.getBool();
816 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
818 completion_popup_after_complete = lexrc.getBool();
822 case RC_NUMLASTFILES:
824 num_lastfiles = lexrc.getInteger();
828 case RC_CHECKLASTFILES:
830 check_lastfiles = lexrc.getBool();
834 case RC_SCREEN_FONT_ROMAN:
836 roman_font_name = lexrc.getString();
837 oldFontFormat(roman_font_name,
842 case RC_SCREEN_FONT_SANS:
844 sans_font_name = lexrc.getString();
845 oldFontFormat(sans_font_name, sans_font_foundry);
849 case RC_SCREEN_FONT_TYPEWRITER:
851 typewriter_font_name = lexrc.getString();
852 oldFontFormat(typewriter_font_name,
853 typewriter_font_foundry);
857 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
859 roman_font_foundry = lexrc.getString();
863 case RC_SCREEN_FONT_SANS_FOUNDRY:
865 sans_font_foundry = lexrc.getString();
869 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
871 typewriter_font_foundry = lexrc.getString();
877 string lyx_name, x11_name;
880 lyx_name = lexrc.getString();
882 lexrc.printError("Missing color tag.");
887 x11_name = lexrc.getString();
889 lexrc.printError("Missing color name for color: `$$Token'");
893 ColorCode const col =
894 lcolor.getFromLyXName(lyx_name);
895 if (col == Color_none ||
896 col == Color_inherit ||
900 if (!lcolor.setColor(col, x11_name)) {
901 lyxerr << "Bad lyxrc set_color for "
907 case RC_AUTOREGIONDELETE:
908 // Auto region delete defaults to true
910 auto_region_delete = lexrc.getBool();
916 lyxpipes = os::internal_path(lexrc.getString());
917 lyxpipes = expandPath(lyxpipes);
921 case RC_CURSOR_FOLLOWS_SCROLLBAR:
923 cursor_follows_scrollbar = lexrc.getBool();
927 case RC_MACRO_EDIT_STYLE:
929 switch (lexrc.getInteger()) {
930 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
931 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
932 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
937 case RC_DIALOGS_ICONIFY_WITH_MAIN:
939 dialogs_iconify_with_main = lexrc.getBool();
943 case RC_PLAINTEXT_ROFF_COMMAND:
945 plaintext_roff_command = lexrc.getString();
948 case RC_PLAINTEXT_LINELEN:
950 plaintext_linelen = lexrc.getInteger();
953 // Spellchecker settings:
954 case RC_USE_SPELL_LIB:
956 use_spell_lib = lexrc.getBool();
959 case RC_SPELL_COMMAND:
961 isp_command = lexrc.getString();
964 case RC_ACCEPT_COMPOUND:
966 isp_accept_compound = lexrc.getBool();
971 isp_use_input_encoding = lexrc.getBool();
974 case RC_USE_ALT_LANG:
976 isp_use_alt_lang = lexrc.getBool();
979 case RC_USE_PERS_DICT:
981 isp_use_pers_dict = lexrc.getBool();
986 use_tooltip = lexrc.getBool();
989 case RC_USE_PIXMAP_CACHE:
991 use_pixmap_cache = lexrc.getBool();
994 case RC_USE_ESC_CHARS:
996 isp_use_esc_chars = lexrc.getBool();
1001 isp_alt_lang = lexrc.getString();
1006 isp_pers_dict = os::internal_path(lexrc.getString());
1011 isp_esc_chars = lexrc.getString();
1014 case RC_MAKE_BACKUP:
1016 make_backup = lexrc.getBool();
1019 case RC_BACKUPDIR_PATH:
1021 backupdir_path = os::internal_path(lexrc.getString());
1022 backupdir_path = expandPath(backupdir_path);
1025 case RC_DATE_INSERT_FORMAT:
1027 date_insert_format = lexrc.getString();
1030 case RC_LANGUAGE_PACKAGE:
1032 language_package = lexrc.getString();
1035 case RC_LANGUAGE_AUTO_BEGIN:
1037 language_auto_begin = lexrc.getBool();
1040 case RC_LANGUAGE_AUTO_END:
1042 language_auto_end = lexrc.getBool();
1045 case RC_LANGUAGE_GLOBAL_OPTIONS:
1047 language_global_options = lexrc.getBool();
1050 case RC_LANGUAGE_USE_BABEL:
1052 language_use_babel = lexrc.getBool();
1055 case RC_LANGUAGE_COMMAND_BEGIN:
1057 language_command_begin = lexrc.getString();
1060 case RC_LANGUAGE_COMMAND_END:
1062 language_command_end = lexrc.getString();
1065 case RC_LANGUAGE_COMMAND_LOCAL:
1067 language_command_local = lexrc.getString();
1070 case RC_RTL_SUPPORT:
1072 rtl_support = lexrc.getBool();
1075 case RC_VISUAL_CURSOR:
1077 visual_cursor = lexrc.getBool();
1080 case RC_AUTO_NUMBER:
1082 auto_number = lexrc.getBool();
1085 case RC_MARK_FOREIGN_LANGUAGE:
1087 mark_foreign_language = lexrc.getBool();
1092 string fmt, command;
1094 fmt = lexrc.getString();
1097 command = lexrc.getString();
1099 setMover(fmt, command);
1103 case RC_CONVERTER: {
1104 string from, to, command, flags;
1106 from = lexrc.getString();
1109 to = lexrc.getString();
1112 command = lexrc.getString();
1115 flags = lexrc.getString();
1117 if (command.empty()) {
1118 theConverters().erase(from, to);
1120 theConverters().add(from, to, command, flags);
1124 // compatibility with versions older than 1.4.0 only
1126 string format, command;
1128 format = lexrc.getString();
1131 command = lexrc.getString();
1133 formats.setViewer(format, command);
1137 string format, extension, prettyname, shortcut;
1139 format = lexrc.getString();
1142 extension = lexrc.getString();
1145 prettyname = lexrc.getString();
1148 shortcut = lexrc.getString();
1150 string viewer, editor;
1152 viewer = lexrc.getString();
1154 editor = lexrc.getString();
1156 // Hack to ensure compatibility with versions older
1158 int le = lexrc.lex();
1159 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1160 flags = lexrc.getString();
1161 if (le != Lexer::LEX_DATA) {
1162 // We have got a known token.
1163 // Therefore this is an old style
1164 // format definition without
1166 lexrc.pushToken(flags);
1170 int flgs = Format::none;
1171 while (!flags.empty()) {
1173 flags = split(flags, flag, ',');
1174 if (flag == "document")
1175 flgs |= Format::document;
1176 else if (flag == "vector")
1177 flgs |= Format::vector;
1179 lyxerr << "Ignoring unknown flag `"
1180 << flag << "' for format `"
1181 << format << "'." << endl;
1183 if (prettyname.empty()) {
1184 if (theConverters().formatIsUsed(format)) {
1185 lyxerr << "Can't delete format "
1188 formats.erase(format);
1191 formats.add(format, extension, prettyname,
1192 shortcut, viewer, editor, flgs);
1196 case RC_DEFAULT_LANGUAGE:
1198 default_language = lexrc.getString();
1202 case RC_LABEL_INIT_LENGTH:
1204 label_init_length = lexrc.getInteger();
1208 case RC_SHOW_BANNER:
1210 show_banner = lexrc.getBool();
1216 string const tmp = lexrc.getString();
1217 if (tmp == "true" || tmp == "on")
1218 preview = PREVIEW_ON;
1219 else if (tmp == "no_math")
1220 preview = PREVIEW_NO_MATH;
1222 preview = PREVIEW_OFF;
1223 if (tmp != "false" && tmp != "off")
1224 lyxerr << "Unrecognized "
1226 << tmp << '\n' << endl;
1231 case RC_PREVIEW_HASHED_LABELS:
1233 preview_hashed_labels = lexrc.getBool();
1237 case RC_PREVIEW_SCALE_FACTOR:
1239 preview_scale_factor = lexrc.getString();
1245 user_name = lexrc.getString();
1250 user_email = lexrc.getString();
1253 case RC_PATH_PREFIX:
1255 path_prefix = lexrc.getString();
1258 case RC_USE_CONVERTER_CACHE:
1260 use_converter_cache = lexrc.getBool();
1263 case RC_CONVERTER_CACHE_MAXAGE:
1265 converter_cache_maxage =
1266 convert<unsigned int>(lexrc.getString());
1269 case RC_SORT_LAYOUTS:
1271 sort_layouts = lexrc.getBool();
1273 case RC_FULL_SCREEN_LIMIT:
1275 full_screen_limit = lexrc.getBool();
1277 case RC_FULL_SCREEN_TOOLBARS:
1279 full_screen_toolbars = lexrc.getBool();
1281 case RC_FULL_SCREEN_SCROLLBAR:
1283 full_screen_scrollbar = lexrc.getBool();
1285 case RC_FULL_SCREEN_TABBAR:
1287 full_screen_tabbar = lexrc.getBool();
1289 case RC_FULL_SCREEN_WIDTH:
1291 full_screen_width = lexrc.getInteger();
1294 case RC_LAST: break; // this is just a dummy
1298 /// Update converters data-structures
1299 theConverters().update(formats);
1300 theConverters().buildGraph();
1306 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1308 ofstream ofs(filename.toFilesystemEncoding().c_str());
1310 write(ofs, ignore_system_lyxrc);
1314 void LyXRC::print() const
1316 if (lyxerr.debugging())
1317 write(lyxerr, false);
1325 typedef pair<string, SpecialisedMover> Data;
1327 SameMover(Data const & comparison)
1328 : comparison_(comparison) {}
1330 bool operator()(Data const & data) const
1332 return data.first == comparison_.first &&
1333 data.second.command() == comparison_.second.command();
1341 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1343 LyXRCTags tag = RC_LAST;
1345 if (!name.empty()) {
1346 for (int i = 0; i != lyxrcCount; ++i)
1347 if ("\\" + name == lyxrcTags[i].tag)
1348 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1352 os << "### This file is part of\n"
1353 << "### ========================================================\n"
1354 << "### LyX, The Document Processor\n"
1356 << "### Copyright 1995 Matthias Ettrich\n"
1357 << "### Copyright 1995-2007 The LyX Team.\n"
1359 << "### ========================================================\n"
1361 << "# This file is written by LyX, if you want to make your own\n"
1362 << "# modifications you should do them from inside LyX and save\n"
1365 // Why the switch you might ask. It is a trick to ensure that all
1366 // the elements in the LyXRCTags enum is handled. As you can see
1367 // there are no breaks at all. So it is just a huge fall-through.
1368 // The nice thing is that we will get a warning from the compiler
1369 // if we forget an element.
1373 // input/include files are not done here
1375 if (ignore_system_lyxrc ||
1376 bind_file != system_lyxrc.bind_file) {
1377 string const path = os::external_path(bind_file);
1378 os << "\\bind_file \"" << path << "\"\n";
1384 if (ignore_system_lyxrc ||
1385 def_file != system_lyxrc.def_file) {
1386 string const path = os::external_path(def_file);
1387 os << "\\def_file \"" << path << "\"\n";
1396 << "# MISC SECTION ######################################\n"
1398 // bind files are not done here.
1400 case RC_PATH_PREFIX:
1401 if (ignore_system_lyxrc ||
1402 path_prefix != system_lyxrc.path_prefix) {
1403 os << "\\path_prefix \"" << path_prefix << "\"\n";
1408 if (ignore_system_lyxrc ||
1409 ui_file != system_lyxrc.ui_file) {
1410 string const path = os::external_path(ui_file);
1411 os << "\\ui_file \"" << path << "\"\n";
1415 case RC_AUTOREGIONDELETE:
1416 if (ignore_system_lyxrc ||
1417 auto_region_delete != system_lyxrc.auto_region_delete) {
1418 os << "# Set to false to inhibit automatic replacement of\n"
1419 << "# the current selection.\n"
1420 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1425 case RC_AUTORESET_OPTIONS:
1426 if (ignore_system_lyxrc ||
1427 auto_reset_options != system_lyxrc.auto_reset_options) {
1428 os << "# Set to false to inhibit automatic reset of\n"
1429 << "# the class options to defaults on class change.\n"
1430 << "\\auto_reset_options "
1431 << convert<string>(auto_reset_options)
1437 if (ignore_system_lyxrc ||
1438 autosave != system_lyxrc.autosave) {
1439 os << "# The time interval between auto-saves in seconds.\n"
1440 << "\\autosave " << autosave << '\n';
1444 case RC_DISPLAY_GRAPHICS:
1445 if (ignore_system_lyxrc ||
1446 display_graphics != system_lyxrc.display_graphics) {
1447 os << "# Display graphics within LyX\n"
1448 << "# monochrome|grayscale|color|none\n"
1449 << "\\display_graphics "
1450 << graphics::displayTranslator().find(
1451 graphics::DisplayType(display_graphics))
1456 case RC_SORT_LAYOUTS:
1457 if (ignore_system_lyxrc ||
1458 sort_layouts != system_lyxrc.sort_layouts) {
1459 os << "# Sort layouts alphabetically.\n"
1460 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1464 case RC_VIEWDVI_PAPEROPTION:
1465 if (ignore_system_lyxrc ||
1466 view_dvi_paper_option
1467 != system_lyxrc.view_dvi_paper_option) {
1468 os << "# Options used to specify paper size to the\n"
1469 << "# view_dvi_command (e.g. -paper)\n"
1470 << "\\view_dvi_paper_option \""
1471 << view_dvi_paper_option << "\"\n";
1475 case RC_DEFAULT_PAPERSIZE:
1476 if (ignore_system_lyxrc ||
1477 default_papersize != system_lyxrc.default_papersize) {
1478 os << "# The default papersize to use.\n"
1479 << "\\default_papersize \"";
1480 switch (default_papersize) {
1482 os << "default"; break;
1483 case PAPER_USLETTER:
1484 os << "usletter"; break;
1486 os << "legal"; break;
1487 case PAPER_USEXECUTIVE:
1488 os << "executive"; break;
1499 case PAPER_B4: break;
1505 case RC_CHKTEX_COMMAND:
1506 if (ignore_system_lyxrc ||
1507 chktex_command != system_lyxrc.chktex_command) {
1508 os << "\\chktex_command \"" << chktex_command << "\"\n";
1512 case RC_BIBTEX_COMMAND:
1513 if (ignore_system_lyxrc ||
1514 bibtex_command != system_lyxrc.bibtex_command) {
1515 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1519 case RC_INDEX_COMMAND:
1520 if (ignore_system_lyxrc ||
1521 index_command != system_lyxrc.index_command) {
1522 os << "\\index_command \"" << index_command << "\"\n";
1526 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1527 if (ignore_system_lyxrc ||
1528 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1529 os << "\\tex_expects_windows_paths "
1530 << convert<string>(windows_style_tex_paths) << '\n';
1534 case RC_TEX_ALLOWS_SPACES:
1535 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1536 os << "\\tex_allows_spaces "
1537 << convert<string>(tex_allows_spaces) << '\n';
1542 if (ignore_system_lyxrc ||
1543 use_kbmap != system_lyxrc.use_kbmap) {
1544 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1548 case RC_KBMAP_PRIMARY:
1549 if (ignore_system_lyxrc ||
1550 primary_kbmap != system_lyxrc.primary_kbmap) {
1551 string const path = os::external_path(primary_kbmap);
1552 os << "\\kbmap_primary \"" << path << "\"\n";
1556 case RC_KBMAP_SECONDARY:
1557 if (ignore_system_lyxrc ||
1558 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1559 string const path = os::external_path(secondary_kbmap);
1560 os << "\\kbmap_secondary \"" << path << "\"\n";
1565 if (ignore_system_lyxrc ||
1566 lyxpipes != system_lyxrc.lyxpipes) {
1567 string const path = os::external_path(lyxpipes);
1568 os << "\\serverpipe \"" << path << "\"\n";
1572 case RC_DATE_INSERT_FORMAT:
1573 if (ignore_system_lyxrc ||
1574 date_insert_format != system_lyxrc.date_insert_format) {
1575 os << "\\date_insert_format \"" << date_insert_format
1580 case RC_LABEL_INIT_LENGTH:
1581 if (ignore_system_lyxrc ||
1582 label_init_length != system_lyxrc.label_init_length) {
1583 os << "\\label_init_length " << label_init_length
1590 os << "\\user_name \"" << user_name << "\"\n";
1595 os << "\\user_email \"" << user_email << "\"\n";
1599 case RC_SHOW_BANNER:
1600 if (ignore_system_lyxrc ||
1601 show_banner != system_lyxrc.show_banner) {
1602 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1608 if (ignore_system_lyxrc ||
1609 preview != system_lyxrc.preview) {
1615 case PREVIEW_NO_MATH:
1622 os << "\\preview " << status << '\n';
1627 case RC_PREVIEW_HASHED_LABELS:
1628 if (ignore_system_lyxrc ||
1629 preview_hashed_labels !=
1630 system_lyxrc.preview_hashed_labels) {
1631 os << "\\preview_hashed_labels "
1632 << convert<string>(preview_hashed_labels) << '\n';
1637 case RC_PREVIEW_SCALE_FACTOR:
1638 if (ignore_system_lyxrc ||
1639 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1640 os << "\\preview_scale_factor "
1641 << preview_scale_factor << '\n';
1646 case RC_USE_CONVERTER_CACHE:
1647 if (ignore_system_lyxrc ||
1648 use_converter_cache != system_lyxrc.use_converter_cache) {
1649 os << "\\use_converter_cache "
1650 << convert<string>(use_converter_cache) << '\n';
1655 case RC_CONVERTER_CACHE_MAXAGE:
1656 if (ignore_system_lyxrc ||
1657 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1658 os << "\\converter_cache_maxage "
1659 << converter_cache_maxage << '\n';
1665 << "# SCREEN & FONTS SECTION ############################\n"
1669 if (ignore_system_lyxrc ||
1670 dpi != system_lyxrc.dpi) {
1671 os << "\\screen_dpi " << dpi << '\n';
1675 case RC_SCREEN_ZOOM:
1676 if (ignore_system_lyxrc ||
1677 zoom != system_lyxrc.zoom) {
1678 os << "\\screen_zoom " << zoom << '\n';
1682 case RC_GEOMETRY_SESSION:
1683 if (ignore_system_lyxrc ||
1684 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1685 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1690 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1691 if (ignore_system_lyxrc ||
1692 cursor_follows_scrollbar
1693 != system_lyxrc.cursor_follows_scrollbar) {
1694 os << "\\cursor_follows_scrollbar "
1695 << convert<string>(cursor_follows_scrollbar) << '\n';
1699 case RC_MACRO_EDIT_STYLE:
1700 if (ignore_system_lyxrc ||
1702 != system_lyxrc.macro_edit_style) {
1703 os << "\\macro_edit_style ";
1704 switch (macro_edit_style) {
1705 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1706 case MACRO_EDIT_INLINE: os << "1\n"; break;
1707 case MACRO_EDIT_LIST: os << "2\n"; break;
1712 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1713 if (ignore_system_lyxrc ||
1714 dialogs_iconify_with_main
1715 != system_lyxrc.dialogs_iconify_with_main) {
1716 os << "\\dialogs_iconify_with_main "
1717 << convert<string>(dialogs_iconify_with_main) << '\n';
1721 case RC_SCREEN_FONT_ROMAN:
1722 if (ignore_system_lyxrc ||
1723 roman_font_name != system_lyxrc.roman_font_name) {
1724 os << "\\screen_font_roman \"" << roman_font_name
1729 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1730 if (ignore_system_lyxrc ||
1731 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1732 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1737 case RC_SCREEN_FONT_SANS:
1738 if (ignore_system_lyxrc ||
1739 sans_font_name != system_lyxrc.sans_font_name) {
1740 os << "\\screen_font_sans \"" << sans_font_name
1745 case RC_SCREEN_FONT_SANS_FOUNDRY:
1746 if (ignore_system_lyxrc ||
1747 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1748 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1753 case RC_SCREEN_FONT_TYPEWRITER:
1754 if (ignore_system_lyxrc ||
1755 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1756 os << "\\screen_font_typewriter \""
1757 << typewriter_font_name << "\"\n";
1761 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1762 if (ignore_system_lyxrc ||
1763 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1764 os << "\\screen_font_typewriter_foundry \""
1765 << typewriter_font_foundry << "\"\n";
1770 case RC_SCREEN_FONT_SCALABLE:
1771 if (ignore_system_lyxrc ||
1772 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1773 os << "\\screen_font_scalable "
1774 << convert<string>(use_scalable_fonts)
1779 case RC_SCREEN_FONT_SIZES:
1780 if (ignore_system_lyxrc ||
1781 font_sizes[FONT_SIZE_TINY]
1782 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1783 font_sizes[FONT_SIZE_SCRIPT]
1784 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1785 font_sizes[FONT_SIZE_FOOTNOTE]
1786 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1787 font_sizes[FONT_SIZE_SMALL]
1788 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1789 font_sizes[FONT_SIZE_NORMAL]
1790 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1791 font_sizes[FONT_SIZE_LARGE]
1792 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1793 font_sizes[FONT_SIZE_LARGER]
1794 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1795 font_sizes[FONT_SIZE_LARGEST]
1796 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1797 font_sizes[FONT_SIZE_HUGE]
1798 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1799 font_sizes[FONT_SIZE_HUGER]
1800 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1801 os.setf(ios::fixed);
1803 os << "\\screen_font_sizes"
1804 << ' ' << font_sizes[FONT_SIZE_TINY]
1805 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1806 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1807 << ' ' << font_sizes[FONT_SIZE_SMALL]
1808 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1809 << ' ' << font_sizes[FONT_SIZE_LARGE]
1810 << ' ' << font_sizes[FONT_SIZE_LARGER]
1811 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1812 << ' ' << font_sizes[FONT_SIZE_HUGE]
1813 << ' ' << font_sizes[FONT_SIZE_HUGER]
1818 case RC_FULL_SCREEN_LIMIT:
1819 if (ignore_system_lyxrc ||
1820 full_screen_limit != system_lyxrc.full_screen_limit) {
1821 os << "\\fullscreen_limit "
1822 << convert<string>(full_screen_limit)
1827 case RC_FULL_SCREEN_TOOLBARS:
1828 if (ignore_system_lyxrc ||
1829 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1830 os << "\\fullscreen_toolbars "
1831 << convert<string>(full_screen_toolbars)
1836 case RC_FULL_SCREEN_SCROLLBAR:
1837 if (ignore_system_lyxrc ||
1838 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1839 os << "\\fullscreen_scrollbar "
1840 << convert<string>(full_screen_scrollbar)
1845 case RC_FULL_SCREEN_TABBAR:
1846 if (ignore_system_lyxrc ||
1847 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1848 os << "\\fullscreen_tabbar "
1849 << convert<string>(full_screen_tabbar)
1854 case RC_FULL_SCREEN_WIDTH:
1855 if (ignore_system_lyxrc ||
1856 full_screen_width != system_lyxrc.full_screen_width) {
1857 os << "\\fullscreen_width "
1858 << convert<string>(full_screen_width)
1866 << "# COLOR SECTION ###################################\n"
1870 for (int i = 0; i < Color_ignore; ++i) {
1871 ColorCode lc = static_cast<ColorCode>(i);
1873 string const col(lcolor.getX11Name(lc));
1874 if (ignore_system_lyxrc ||
1875 col != system_lcolor.getX11Name(lc)) {
1876 os << "\\set_color \""
1877 << lcolor.getLyXName(lc) << "\" \""
1885 << "# PRINTER SECTION ###################################\n"
1889 if (ignore_system_lyxrc ||
1890 printer != system_lyxrc.printer) {
1891 os << "\\printer \"" << printer << "\"\n";
1895 case RC_PRINT_ADAPTOUTPUT:
1896 if (ignore_system_lyxrc ||
1897 print_adapt_output != system_lyxrc.print_adapt_output) {
1898 os << "\\print_adapt_output "
1899 << convert<string>(print_adapt_output)
1904 case RC_PRINT_COMMAND:
1905 if (ignore_system_lyxrc ||
1906 print_command != system_lyxrc.print_command) {
1907 os << "\\print_command \"" << print_command << "\"\n";
1911 case RC_PRINTEXSTRAOPTIONS:
1912 if (ignore_system_lyxrc ||
1913 print_extra_options != system_lyxrc.print_extra_options) {
1914 os << "\\print_extra_options \"" << print_extra_options
1919 case RC_PRINTSPOOL_COMMAND:
1920 if (ignore_system_lyxrc ||
1921 print_spool_command != system_lyxrc.print_spool_command) {
1922 os << "\\print_spool_command \"" << print_spool_command
1927 case RC_PRINTSPOOL_PRINTERPREFIX:
1928 if (ignore_system_lyxrc ||
1929 print_spool_printerprefix
1930 != system_lyxrc.print_spool_printerprefix) {
1931 os << "\\print_spool_printerprefix \""
1932 << print_spool_printerprefix << "\"\n";
1936 case RC_PRINTEVENPAGEFLAG:
1937 if (ignore_system_lyxrc ||
1938 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1939 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1944 case RC_PRINTODDPAGEFLAG:
1945 if (ignore_system_lyxrc ||
1946 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1947 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1952 case RC_PRINTREVERSEFLAG:
1953 if (ignore_system_lyxrc ||
1954 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1955 os << "\\print_reverse_flag \"" << print_reverse_flag
1960 case RC_PRINTLANDSCAPEFLAG:
1961 if (ignore_system_lyxrc ||
1962 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1963 os << "\\print_landscape_flag \"" << print_landscape_flag
1968 case RC_PRINTPAGERANGEFLAG:
1969 if (ignore_system_lyxrc ||
1970 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1971 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1976 case RC_PRINTCOPIESFLAG:
1977 if (ignore_system_lyxrc ||
1978 print_copies_flag != system_lyxrc.print_copies_flag) {
1979 os << "\\print_copies_flag \"" << print_copies_flag
1984 case RC_PRINTCOLLCOPIESFLAG:
1985 if (ignore_system_lyxrc ||
1986 print_collcopies_flag
1987 != system_lyxrc.print_collcopies_flag) {
1988 os << "\\print_collcopies_flag \""
1989 << print_collcopies_flag
1994 case RC_PRINTPAPERFLAG:
1995 if (ignore_system_lyxrc ||
1996 print_paper_flag != system_lyxrc.print_paper_flag) {
1997 os << "\\print_paper_flag \"" << print_paper_flag
2002 case RC_PRINTPAPERDIMENSIONFLAG:
2003 if (ignore_system_lyxrc ||
2004 print_paper_dimension_flag
2005 != system_lyxrc.print_paper_dimension_flag) {
2006 os << "\\print_paper_dimension_flag \""
2007 << print_paper_dimension_flag << "\"\n";
2011 case RC_PRINTTOPRINTER:
2012 if (ignore_system_lyxrc ||
2013 print_to_printer != system_lyxrc.print_to_printer) {
2014 os << "\\print_to_printer \"" << print_to_printer
2019 case RC_PRINTTOFILE:
2020 if (ignore_system_lyxrc ||
2021 print_to_file != system_lyxrc.print_to_file) {
2022 string const path = os::external_path(print_to_file);
2023 os << "\\print_to_file \"" << path << "\"\n";
2027 case RC_PRINTFILEEXTENSION:
2028 if (ignore_system_lyxrc ||
2029 print_file_extension != system_lyxrc.print_file_extension) {
2030 os << "\\print_file_extension \""
2031 << print_file_extension
2038 << "# EXPORT SECTION ####################################\n"
2041 case RC_CUSTOM_EXPORT_COMMAND:
2042 if (ignore_system_lyxrc ||
2043 custom_export_command
2044 != system_lyxrc.custom_export_command) {
2045 os << "\\custom_export_command \""
2046 << custom_export_command
2051 case RC_CUSTOM_EXPORT_FORMAT:
2052 if (ignore_system_lyxrc ||
2053 custom_export_format
2054 != system_lyxrc.custom_export_format) {
2055 os << "\\custom_export_format \"" << custom_export_format
2062 << "# TEX SECTION #######################################\n"
2065 case RC_FONT_ENCODING:
2066 if (ignore_system_lyxrc ||
2067 fontenc != system_lyxrc.fontenc) {
2068 os << "\\font_encoding \"" << fontenc << "\"\n";
2074 << "# FILE SECTION ######################################\n"
2077 case RC_DOCUMENTPATH:
2078 if (ignore_system_lyxrc ||
2079 document_path != system_lyxrc.document_path) {
2080 string const path = os::external_path(document_path);
2081 os << "\\document_path \"" << path << "\"\n";
2085 case RC_USELASTFILEPOS:
2086 if (ignore_system_lyxrc ||
2087 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2088 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2093 case RC_LOADSESSION:
2094 if (ignore_system_lyxrc ||
2095 load_session != system_lyxrc.load_session) {
2096 os << "\\load_session " << convert<string>(load_session)
2101 case RC_MOUSE_WHEEL_SPEED:
2102 if (ignore_system_lyxrc ||
2103 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2104 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2108 case RC_COMPLETION_INLINE_DELAY:
2109 if (ignore_system_lyxrc ||
2110 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2111 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2115 case RC_COMPLETION_INLINE_MATH:
2116 if (ignore_system_lyxrc ||
2117 completion_inline_math != system_lyxrc.completion_inline_math) {
2118 os << "\\completion_inline_math "
2119 << convert<string>(completion_inline_math) << '\n';
2123 case RC_COMPLETION_INLINE_TEXT:
2124 if (ignore_system_lyxrc ||
2125 completion_inline_text != system_lyxrc.completion_inline_text) {
2126 os << "\\completion_inline_text "
2127 << convert<string>(completion_inline_text) << '\n';
2131 case RC_COMPLETION_INLINE_DOTS:
2132 if (ignore_system_lyxrc ||
2133 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2134 os << "\\completion_inline_dots "
2135 << convert<string>(completion_inline_dots) << '\n';
2139 case RC_COMPLETION_POPUP_DELAY:
2140 if (ignore_system_lyxrc ||
2141 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2142 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2146 case RC_COMPLETION_POPUP_MATH:
2147 if (ignore_system_lyxrc ||
2148 completion_popup_math != system_lyxrc.completion_popup_math) {
2149 os << "\\completion_popup_math "
2150 << convert<string>(completion_popup_math) << '\n';
2154 case RC_COMPLETION_POPUP_TEXT:
2155 if (ignore_system_lyxrc ||
2156 completion_popup_text != system_lyxrc.completion_popup_text) {
2157 os << "\\completion_popup_text "
2158 << convert<string>(completion_popup_text) << '\n';
2162 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2163 if (ignore_system_lyxrc ||
2164 completion_popup_after_complete
2165 != system_lyxrc.completion_popup_after_complete) {
2166 os << "\\completion_popup_after_complete "
2167 << convert<string>(completion_popup_after_complete) << '\n';
2171 case RC_NUMLASTFILES:
2172 if (ignore_system_lyxrc ||
2173 num_lastfiles != system_lyxrc.num_lastfiles) {
2174 os << "\\num_lastfiles " << num_lastfiles << '\n';
2178 case RC_CHECKLASTFILES:
2179 if (ignore_system_lyxrc ||
2180 check_lastfiles != system_lyxrc.check_lastfiles) {
2181 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2186 case RC_EXAMPLEPATH:
2187 if (ignore_system_lyxrc ||
2188 example_path != system_lyxrc.example_path) {
2189 string const path = os::external_path(example_path);
2190 os << "\\example_path \"" << path << "\"\n";
2194 case RC_TEMPLATEPATH:
2195 if (ignore_system_lyxrc ||
2196 template_path != system_lyxrc.template_path) {
2197 string const path = os::external_path(template_path);
2198 os << "\\template_path \"" << path << "\"\n";
2202 case RC_TEMPDIRPATH:
2203 if (ignore_system_lyxrc ||
2204 tempdir_path != system_lyxrc.tempdir_path) {
2205 string const path = os::external_path(tempdir_path);
2206 os << "\\tempdir_path \"" << path << "\"\n";
2214 case RC_PLAINTEXT_LINELEN:
2215 if (ignore_system_lyxrc ||
2216 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2217 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2221 case RC_MAKE_BACKUP:
2222 if (ignore_system_lyxrc ||
2223 make_backup != system_lyxrc.make_backup) {
2224 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2228 case RC_BACKUPDIR_PATH:
2229 if (ignore_system_lyxrc ||
2230 backupdir_path != system_lyxrc.backupdir_path) {
2231 string const path = os::external_path(backupdir_path);
2232 os << "\\backupdir_path \"" << path << "\"\n";
2238 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2241 case RC_PLAINTEXT_ROFF_COMMAND:
2242 if (ignore_system_lyxrc ||
2243 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2244 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2251 << "# SPELLCHECKER SECTION ##############################\n"
2253 case RC_USE_SPELL_LIB:
2254 if (ignore_system_lyxrc ||
2255 use_spell_lib != system_lyxrc.use_spell_lib) {
2256 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2260 case RC_SPELL_COMMAND:
2261 if (ignore_system_lyxrc ||
2262 isp_command != system_lyxrc.isp_command) {
2263 os << "\\spell_command \"" << isp_command << "\"\n";
2267 case RC_ACCEPT_COMPOUND:
2268 if (ignore_system_lyxrc ||
2269 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2270 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2275 case RC_USE_ALT_LANG:
2276 if (ignore_system_lyxrc ||
2277 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2278 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2284 if (ignore_system_lyxrc ||
2285 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2286 os << "\\alternate_language \"" << isp_alt_lang
2291 case RC_USE_ESC_CHARS:
2292 if (ignore_system_lyxrc ||
2293 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2294 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2300 if (ignore_system_lyxrc ||
2301 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2302 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2306 case RC_USE_PERS_DICT:
2307 if (ignore_system_lyxrc ||
2308 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2309 os << "\\use_personal_dictionary "
2310 << convert<string>(isp_use_pers_dict)
2315 case RC_USE_TOOLTIP:
2316 if (ignore_system_lyxrc ||
2317 use_tooltip != system_lyxrc.use_tooltip) {
2318 os << "\\use_tooltip "
2319 << convert<string>(use_tooltip)
2322 case RC_USE_PIXMAP_CACHE:
2323 if (ignore_system_lyxrc ||
2324 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2325 os << "\\use_pixmap_cache "
2326 << convert<string>(use_pixmap_cache)
2330 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2331 string const path = os::external_path(isp_pers_dict);
2332 os << "\\personal_dictionary \"" << path << "\"\n";
2336 case RC_USE_INP_ENC:
2337 if (ignore_system_lyxrc ||
2338 isp_use_input_encoding
2339 != system_lyxrc.isp_use_input_encoding) {
2340 os << "\\use_input_encoding "
2341 << convert<string>(isp_use_input_encoding)
2348 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2351 case RC_RTL_SUPPORT:
2352 if (ignore_system_lyxrc ||
2353 rtl_support != system_lyxrc.rtl_support) {
2354 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2358 case RC_VISUAL_CURSOR:
2359 if (ignore_system_lyxrc ||
2360 visual_cursor != system_lyxrc.visual_cursor) {
2361 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2365 case RC_LANGUAGE_PACKAGE:
2366 if (ignore_system_lyxrc ||
2367 language_package != system_lyxrc.language_package) {
2368 os << "\\language_package \"" << language_package
2373 case RC_LANGUAGE_GLOBAL_OPTIONS:
2374 if (ignore_system_lyxrc ||
2375 language_global_options
2376 != system_lyxrc.language_global_options) {
2377 os << "\\language_global_options \""
2378 << convert<string>(language_global_options)
2383 case RC_LANGUAGE_USE_BABEL:
2384 if (ignore_system_lyxrc ||
2385 language_use_babel != system_lyxrc.language_use_babel) {
2386 os << "\\language_use_babel \""
2387 << convert<string>(language_use_babel)
2392 case RC_LANGUAGE_COMMAND_BEGIN:
2393 if (ignore_system_lyxrc ||
2394 language_command_begin
2395 != system_lyxrc.language_command_begin) {
2396 os << "\\language_command_begin \""
2397 << language_command_begin
2402 case RC_LANGUAGE_COMMAND_END:
2403 if (ignore_system_lyxrc ||
2404 language_command_end
2405 != system_lyxrc.language_command_end) {
2406 os << "\\language_command_end \"" << language_command_end
2411 case RC_LANGUAGE_COMMAND_LOCAL:
2412 if (ignore_system_lyxrc ||
2413 language_command_local
2414 != system_lyxrc.language_command_local) {
2415 os << "\\language_command_local \""
2416 << language_command_local
2421 case RC_LANGUAGE_AUTO_BEGIN:
2422 if (ignore_system_lyxrc ||
2423 language_auto_begin != system_lyxrc.language_auto_begin) {
2424 os << "\\language_auto_begin "
2425 << convert<string>(language_auto_begin) << '\n';
2429 case RC_LANGUAGE_AUTO_END:
2430 if (ignore_system_lyxrc ||
2431 language_auto_end != system_lyxrc.language_auto_end) {
2432 os << "\\language_auto_end "
2433 << convert<string>(language_auto_end) << '\n';
2437 case RC_MARK_FOREIGN_LANGUAGE:
2438 if (ignore_system_lyxrc ||
2439 mark_foreign_language
2440 != system_lyxrc.mark_foreign_language) {
2441 os << "\\mark_foreign_language " <<
2442 convert<string>(mark_foreign_language) << '\n';
2448 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2451 case RC_AUTO_NUMBER:
2452 if (ignore_system_lyxrc ||
2453 auto_number != system_lyxrc.auto_number) {
2454 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2458 case RC_DEFAULT_LANGUAGE:
2459 if (ignore_system_lyxrc ||
2460 default_language != system_lyxrc.default_language) {
2461 os << "\\default_language " << default_language << '\n';
2467 << "# FORMATS SECTION ##########################\n"
2471 // New/modified formats
2472 for (Formats::const_iterator cit = formats.begin();
2473 cit != formats.end(); ++cit) {
2474 Format const * format =
2475 system_formats.getFormat(cit->name());
2477 format->extension() != cit->extension() ||
2478 format->prettyname() != cit->prettyname() ||
2479 format->shortcut() != cit->shortcut() ||
2480 format->viewer() != cit->viewer() ||
2481 format->editor() != cit->editor() ||
2482 format->documentFormat() != cit->documentFormat() ||
2483 format->vectorFormat() != cit->vectorFormat()) {
2484 os << "\\format \"" << cit->name() << "\" \""
2485 << cit->extension() << "\" \""
2486 << cit->prettyname() << "\" \""
2487 << cit->shortcut() << "\" \""
2488 << cit->viewer() << "\" \""
2489 << cit->editor() << "\" \"";
2490 vector<string> flags;
2491 if (cit->documentFormat())
2492 flags.push_back("document");
2493 if (cit->vectorFormat())
2494 flags.push_back("vector");
2495 os << getStringFromVector(flags);
2500 // Look for deleted formats
2501 for (Formats::const_iterator cit = system_formats.begin();
2502 cit != system_formats.end(); ++cit)
2503 if (!formats.getFormat(cit->name()))
2504 os << "\\format \"" << cit->name()
2505 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2514 << "# CONVERTERS SECTION ##########################\n"
2518 // Look for new converters
2519 for (Converters::const_iterator cit = theConverters().begin();
2520 cit != theConverters().end(); ++cit) {
2521 Converter const * converter =
2522 theSystemConverters().getConverter(cit->from,
2525 converter->command != cit->command ||
2526 converter->flags != cit->flags)
2527 os << "\\converter \"" << cit->from << "\" \""
2528 << cit->to << "\" \""
2529 << cit->command << "\" \""
2530 << cit->flags << "\"\n";
2533 // New/modifed converters
2534 for (Converters::const_iterator cit = theSystemConverters().begin();
2535 cit != theSystemConverters().end(); ++cit)
2536 if (!theConverters().getConverter(cit->from, cit->to))
2537 os << "\\converter \"" << cit->from
2538 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2545 << "# COPIERS SECTION ##########################\n"
2548 // Look for new movers
2549 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2550 Movers::const_iterator const sysend = theSystemMovers().end();
2551 Movers::const_iterator it = theMovers().begin();
2552 Movers::const_iterator end = theMovers().end();
2554 for (; it != end; ++it) {
2555 Movers::const_iterator const sysit =
2556 find_if(sysbegin, sysend, SameMover(*it));
2557 if (sysit == sysend) {
2558 string const & fmt = it->first;
2559 string const & command =
2560 it->second.command();
2562 os << "\\copier " << fmt
2563 << " \"" << command << "\"\n";
2569 // We don't actually delete SpecialisedMover(s) from the
2570 // map, just clear their 'command', so there's no need
2571 // to test for anything else.
2579 string const LyXRC::getDescription(LyXRCTags tag)
2584 case RC_ACCEPT_COMPOUND:
2585 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2589 case RC_USE_ALT_LANG:
2590 str = _("Specify an alternate language. The default is to use the language of the document.");
2593 case RC_PLAINTEXT_ROFF_COMMAND:
2594 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.");
2597 case RC_PLAINTEXT_LINELEN:
2598 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.");
2601 case RC_AUTOREGIONDELETE:
2602 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2605 case RC_AUTORESET_OPTIONS:
2606 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2610 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2613 case RC_AUTO_NUMBER:
2616 case RC_BACKUPDIR_PATH:
2617 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.");
2620 case RC_BIBTEX_COMMAND:
2621 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2625 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2628 case RC_CHECKLASTFILES:
2629 str = _("Select to check whether the lastfiles still exist.");
2632 case RC_CHKTEX_COMMAND:
2633 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2642 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2643 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.");
2646 case RC_SHOW_MACRO_LABEL:
2647 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2650 case RC_CUSTOM_EXPORT_COMMAND:
2653 case RC_CUSTOM_EXPORT_FORMAT:
2656 case RC_DATE_INSERT_FORMAT:
2657 //xgettext:no-c-format
2658 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2662 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2665 case RC_DEFAULT_LANGUAGE:
2666 str = _("New documents will be assigned this language.");
2669 case RC_DEFAULT_PAPERSIZE:
2670 str = _("Specify the default paper size.");
2673 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2674 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2677 case RC_DISPLAY_GRAPHICS:
2678 str = _("Select how LyX will display any graphics.");
2681 case RC_DOCUMENTPATH:
2682 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2686 case RC_USE_ESC_CHARS:
2687 str = _("Specify additional chars that can be part of a word.");
2690 case RC_EXAMPLEPATH:
2691 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2694 case RC_FONT_ENCODING:
2695 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2701 case RC_INDEX_COMMAND:
2702 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\".");
2709 case RC_KBMAP_PRIMARY:
2710 case RC_KBMAP_SECONDARY:
2711 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.");
2714 case RC_LABEL_INIT_LENGTH:
2715 str = _("Maximum number of words in the initialization string for a new label");
2718 case RC_LANGUAGE_AUTO_BEGIN:
2719 str = _("Select if a language switching command is needed at the beginning of the document.");
2722 case RC_LANGUAGE_AUTO_END:
2723 str = _("Select if a language switching command is needed at the end of the document.");
2726 case RC_LANGUAGE_COMMAND_BEGIN:
2727 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.");
2730 case RC_LANGUAGE_COMMAND_END:
2731 str = _("The LaTeX command for changing back to the language of the document.");
2734 case RC_LANGUAGE_COMMAND_LOCAL:
2735 str = _("The LaTeX command for local changing of the language.");
2738 case RC_LANGUAGE_GLOBAL_OPTIONS:
2739 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2742 case RC_LANGUAGE_PACKAGE:
2743 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2746 case RC_LANGUAGE_USE_BABEL:
2747 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2750 case RC_USELASTFILEPOS:
2751 str = _("De-select if you do not want LyX to scroll to saved position.");
2754 case RC_LOADSESSION:
2755 str = _("De-select to prevent loading files opened from the last LyX session.");
2758 case RC_MAKE_BACKUP:
2759 str = _("De-select if you don't want LyX to create backup files.");
2762 case RC_MARK_FOREIGN_LANGUAGE:
2763 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2766 case RC_MOUSE_WHEEL_SPEED:
2767 str = bformat(_("The scrolling speed of the mouse wheel."),
2771 case RC_COMPLETION_POPUP_DELAY:
2772 str = _("The completion popup delay.");
2775 case RC_COMPLETION_POPUP_MATH:
2776 str = _("Select to display the completion popup in math mode.");
2779 case RC_COMPLETION_POPUP_TEXT:
2780 str = _("Select to display the completion popup in text mode.");
2783 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2784 str = _("Show the completion popup without delay after non-unique completion attempt.");
2787 case RC_COMPLETION_POPUP_DELAY:
2788 str = _("The inline completion delay.");
2791 case RC_COMPLETION_INLINE_MATH:
2792 str = _("Select to display the inline completion in math mode.");
2795 case RC_COMPLETION_INLINE_TEXT:
2796 str = _("Select to display the inline completion in text mode.");
2799 case RC_COMPLETION_INLINE_DOTS:
2800 str = _("Use \"...\" to shorten long completions.");
2803 case RC_NUMLASTFILES:
2804 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2808 case RC_PATH_PREFIX:
2809 str = _("Specify those directories which should be "
2810 "prepended to the PATH environment variable. "
2811 "Use the OS native format.");
2815 case RC_USE_PERS_DICT:
2816 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2820 str = _("Shows a typeset preview of things such as math");
2823 case RC_PREVIEW_HASHED_LABELS:
2824 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2827 case RC_PREVIEW_SCALE_FACTOR:
2828 str = _("Scale the preview size to suit.");
2831 case RC_PRINTCOLLCOPIESFLAG:
2832 str = _("The option for specifying whether the copies should be collated.");
2835 case RC_PRINTCOPIESFLAG:
2836 str = _("The option for specifying the number of copies to print.");
2840 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2843 case RC_PRINTEVENPAGEFLAG:
2844 str = _("The option to print only even pages.");
2847 case RC_PRINTEXSTRAOPTIONS:
2848 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2851 case RC_PRINTFILEEXTENSION:
2852 str = _("Extension of printer program output file. Usually \".ps\".");
2855 case RC_PRINTLANDSCAPEFLAG:
2856 str = _("The option to print out in landscape.");
2859 case RC_PRINTODDPAGEFLAG:
2860 str = _("The option to print only odd pages.");
2863 case RC_PRINTPAGERANGEFLAG:
2864 str = _("The option for specifying a comma-separated list of pages to print.");
2867 case RC_PRINTPAPERDIMENSIONFLAG:
2868 str = _("Option to specify the dimensions of the print paper.");
2871 case RC_PRINTPAPERFLAG:
2872 str = _("The option to specify paper type.");
2875 case RC_PRINTREVERSEFLAG:
2876 str = _("The option to reverse the order of the pages printed.");
2879 case RC_PRINTSPOOL_COMMAND:
2880 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.");
2883 case RC_PRINTSPOOL_PRINTERPREFIX:
2884 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.");
2887 case RC_PRINTTOFILE:
2888 str = _("Option to pass to the print program to print to a file.");
2891 case RC_PRINTTOPRINTER:
2892 str = _("Option to pass to the print program to print on a specific printer.");
2895 case RC_PRINT_ADAPTOUTPUT:
2896 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2899 case RC_PRINT_COMMAND:
2900 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2903 case RC_RTL_SUPPORT:
2904 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2907 case RC_VISUAL_CURSOR:
2908 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2912 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2915 case RC_SCREEN_FONT_ROMAN:
2916 case RC_SCREEN_FONT_SANS:
2917 case RC_SCREEN_FONT_TYPEWRITER:
2918 str = _("The screen fonts used to display the text while editing.");
2921 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2922 case RC_SCREEN_FONT_SANS_FOUNDRY:
2923 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2926 case RC_SCREEN_FONT_SCALABLE:
2927 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.");
2930 case RC_SCREEN_FONT_SIZES:
2931 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2934 case RC_SCREEN_ZOOM:
2935 //xgettext:no-c-format
2936 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2939 case RC_GEOMETRY_SESSION:
2940 str = _("Allow session manager to save and restore windows geometry.");
2944 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2950 case RC_SHOW_BANNER:
2951 str = _("De-select if you don't want the startup banner.");
2954 case RC_SPELL_COMMAND:
2955 str = _("What command runs the spellchecker?");
2958 case RC_TEMPDIRPATH:
2959 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2962 case RC_TEMPLATEPATH:
2963 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2966 case RC_TEX_ALLOWS_SPACES:
2969 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2973 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2985 case RC_USE_INP_ENC:
2986 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.");
2989 case RC_USE_TOOLTIP:
2990 str = _("Enable the automatic appearance of tool tips in the work area.");
2993 case RC_USE_PIXMAP_CACHE:
2994 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2997 case RC_USE_SPELL_LIB:
3000 case RC_VIEWDVI_PAPEROPTION:
3001 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3016 // The global instance
3019 // The global copy of the system lyxrc entries (everything except preferences)