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 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
97 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
98 { "\\input", LyXRC::RC_INPUT },
99 { "\\kbmap", LyXRC::RC_KBMAP },
100 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
101 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
102 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
103 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
104 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
105 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
106 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
107 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
108 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
109 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
110 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
111 { "\\load_session", LyXRC::RC_LOADSESSION },
112 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
113 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
114 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
115 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
116 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
117 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
118 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
119 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
120 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
121 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
122 { "\\preview", LyXRC::RC_PREVIEW },
123 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
124 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
125 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
126 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
127 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
128 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
129 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
130 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
131 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
132 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
133 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
134 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
135 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
136 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
137 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
138 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
139 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
140 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
141 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
142 { "\\printer", LyXRC::RC_PRINTER },
143 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
144 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
145 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
146 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
147 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
148 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
149 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
150 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
151 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
152 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
153 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
154 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
155 { "\\set_color", LyXRC::RC_SET_COLOR },
156 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
157 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
158 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
159 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
160 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
161 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
162 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
163 { "\\ui_file", LyXRC::RC_UIFILE },
164 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
165 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
166 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
167 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
168 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
169 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
170 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
171 // compatibility with versions older than 1.4.0 only
172 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
173 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
174 // compatibility with versions older than 1.4.0 only
175 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
176 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
177 { "\\user_email", LyXRC::RC_USER_EMAIL },
178 { "\\user_name", LyXRC::RC_USER_NAME },
179 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
180 // compatibility with versions older than 1.4.0 only
181 { "\\viewer", LyXRC::RC_VIEWER},
182 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
185 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
196 void LyXRC::setDefaults() {
198 def_file = "default";
200 // Get printer from the environment. If fail, use default "",
201 // assuming that everything is set up correctly.
202 printer = getEnv("PRINTER");
203 print_adapt_output = false;
204 print_command = "dvips";
205 print_evenpage_flag = "-B";
206 print_oddpage_flag = "-A";
207 print_pagerange_flag = "-pp";
208 print_copies_flag = "-c";
209 print_collcopies_flag = "-C";
210 print_reverse_flag = "-r";
211 print_landscape_flag = "-t landscape";
212 print_to_printer = "-P";
213 print_to_file = "-o ";
214 print_file_extension = ".ps";
215 print_paper_flag = "-t";
216 print_paper_dimension_flag = "-T";
217 document_path.erase();
218 view_dvi_paper_option.erase();
219 default_papersize = PAPER_DEFAULT;
220 custom_export_format = "ps";
221 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
222 bibtex_command = "bibtex";
224 index_command = "makeindex -c -q";
226 // Because a screen typically is wider than a piece of paper:
228 allow_geometry_session = true;
229 // Default LaTeX font size:
230 font_sizes[FONT_SIZE_TINY] = "5.0";
231 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
232 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
233 font_sizes[FONT_SIZE_SMALL] = "9.0";
234 font_sizes[FONT_SIZE_NORMAL] = "10.0";
235 font_sizes[FONT_SIZE_LARGE] = "12.0";
236 font_sizes[FONT_SIZE_LARGER] = "14.4";
237 font_sizes[FONT_SIZE_LARGEST] = "17.26";
238 font_sizes[FONT_SIZE_HUGE] = "20.74";
239 font_sizes[FONT_SIZE_HUGER] = "24.88";
240 use_scalable_fonts = true;
241 roman_font_name = "";
243 typewriter_font_name = "";
245 auto_region_delete = true;
246 auto_reset_options = false;
247 plaintext_linelen = 65;
248 mouse_wheel_speed = 1.0;
249 num_lastfiles = maxlastfiles;
250 check_lastfiles = true;
251 use_lastfilepos = true;
252 load_session = false;
254 backupdir_path.erase();
255 display_graphics = graphics::ColorDisplay;
256 // Spellchecker settings:
257 use_spell_lib = true;
258 isp_command = "ispell";
259 isp_accept_compound = false;
260 isp_use_input_encoding = false;
261 isp_use_alt_lang = false;
262 isp_use_pers_dict = false;
263 isp_use_esc_chars = false;
266 visual_cursor = false;
268 mark_foreign_language = true;
269 language_auto_begin = true;
270 language_auto_end = true;
271 language_global_options = true;
272 language_use_babel = true;
273 language_package = "\\usepackage{babel}";
274 language_command_begin = "\\selectlanguage{$$lang}";
275 language_command_local = "\\foreignlanguage{$$lang}{";
276 sort_layouts = false;
277 group_layouts = true;
278 default_language = "english";
280 windows_style_tex_paths = false;
281 tex_allows_spaces = false;
282 date_insert_format = "%x";
283 cursor_follows_scrollbar = false;
284 macro_edit_style = MACRO_EDIT_INLINE_BOX;
285 dialogs_iconify_with_main = false;
286 label_init_length = 3;
287 preview = PREVIEW_OFF;
288 preview_hashed_labels = false;
289 preview_scale_factor = "0.9";
290 use_converter_cache = true;
292 use_pixmap_cache = false;
293 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
294 user_name = to_utf8(support::user_name());
295 user_email = to_utf8(support::user_email());
297 open_buffers_in_tabs = false;
299 open_buffers_in_tabs = true;
302 // Fullscreen settings
303 full_screen_limit = false;
304 full_screen_toolbars = true;
305 full_screen_tabbar = true;
306 full_screen_scrollbar = true;
307 full_screen_width = 700;
309 completion_popup_math = true;
310 completion_popup_text = false;
311 completion_popup_delay = 2.0;
312 completion_popup_after_complete = true;
313 completion_inline_math = true;
314 completion_inline_text = false;
315 completion_inline_dots = -1;
316 completion_inline_delay = 0.2;
322 void oldFontFormat(string & family, string & foundry)
324 if (family.empty() || family[0] != '-')
326 foundry = token(family, '-', 1);
327 family = token(family, '-', 2);
335 int LyXRC::read(FileName const & filename)
337 Lexer lexrc(lyxrcTags, lyxrcCount);
338 if (lyxerr.debugging(Debug::PARSER))
339 lexrc.printTable(lyxerr);
341 lexrc.setFile(filename);
342 if (!lexrc.isOK()) return -2;
344 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
350 int LyXRC::read(istream & is)
352 Lexer lexrc(lyxrcTags, lyxrcCount);
353 if (lyxerr.debugging(Debug::PARSER))
354 lexrc.printTable(lyxerr);
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_POPUP_AFTER_COMPLETE:
826 completion_popup_after_complete = lexrc.getBool();
830 case RC_NUMLASTFILES:
832 num_lastfiles = lexrc.getInteger();
836 case RC_CHECKLASTFILES:
838 check_lastfiles = lexrc.getBool();
842 case RC_SCREEN_FONT_ROMAN:
844 roman_font_name = lexrc.getString();
845 oldFontFormat(roman_font_name,
850 case RC_SCREEN_FONT_SANS:
852 sans_font_name = lexrc.getString();
853 oldFontFormat(sans_font_name, sans_font_foundry);
857 case RC_SCREEN_FONT_TYPEWRITER:
859 typewriter_font_name = lexrc.getString();
860 oldFontFormat(typewriter_font_name,
861 typewriter_font_foundry);
865 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
867 roman_font_foundry = lexrc.getString();
871 case RC_SCREEN_FONT_SANS_FOUNDRY:
873 sans_font_foundry = lexrc.getString();
877 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
879 typewriter_font_foundry = lexrc.getString();
885 string lyx_name, x11_name;
888 lyx_name = lexrc.getString();
890 lexrc.printError("Missing color tag.");
895 x11_name = lexrc.getString();
897 lexrc.printError("Missing color name for color: `$$Token'");
901 ColorCode const col =
902 lcolor.getFromLyXName(lyx_name);
903 if (col == Color_none ||
904 col == Color_inherit ||
908 if (!lcolor.setColor(col, x11_name)) {
909 lyxerr << "Bad lyxrc set_color for "
915 case RC_AUTOREGIONDELETE:
916 // Auto region delete defaults to true
918 auto_region_delete = lexrc.getBool();
924 lyxpipes = os::internal_path(lexrc.getString());
925 lyxpipes = expandPath(lyxpipes);
929 case RC_CURSOR_FOLLOWS_SCROLLBAR:
931 cursor_follows_scrollbar = lexrc.getBool();
935 case RC_MACRO_EDIT_STYLE:
937 switch (lexrc.getInteger()) {
938 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
939 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
940 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
945 case RC_DIALOGS_ICONIFY_WITH_MAIN:
947 dialogs_iconify_with_main = lexrc.getBool();
951 case RC_PLAINTEXT_ROFF_COMMAND:
953 plaintext_roff_command = lexrc.getString();
956 case RC_PLAINTEXT_LINELEN:
958 plaintext_linelen = lexrc.getInteger();
961 // Spellchecker settings:
962 case RC_USE_SPELL_LIB:
964 use_spell_lib = lexrc.getBool();
967 case RC_SPELL_COMMAND:
969 isp_command = lexrc.getString();
972 case RC_ACCEPT_COMPOUND:
974 isp_accept_compound = lexrc.getBool();
979 isp_use_input_encoding = lexrc.getBool();
982 case RC_USE_ALT_LANG:
984 isp_use_alt_lang = lexrc.getBool();
987 case RC_USE_PERS_DICT:
989 isp_use_pers_dict = lexrc.getBool();
994 use_tooltip = lexrc.getBool();
997 case RC_USE_PIXMAP_CACHE:
999 use_pixmap_cache = lexrc.getBool();
1002 case RC_USE_ESC_CHARS:
1004 isp_use_esc_chars = lexrc.getBool();
1009 isp_alt_lang = lexrc.getString();
1014 isp_pers_dict = os::internal_path(lexrc.getString());
1019 isp_esc_chars = lexrc.getString();
1022 case RC_MAKE_BACKUP:
1024 make_backup = lexrc.getBool();
1027 case RC_BACKUPDIR_PATH:
1029 backupdir_path = os::internal_path(lexrc.getString());
1030 backupdir_path = expandPath(backupdir_path);
1033 case RC_DATE_INSERT_FORMAT:
1035 date_insert_format = lexrc.getString();
1038 case RC_LANGUAGE_PACKAGE:
1040 language_package = lexrc.getString();
1043 case RC_LANGUAGE_AUTO_BEGIN:
1045 language_auto_begin = lexrc.getBool();
1048 case RC_LANGUAGE_AUTO_END:
1050 language_auto_end = lexrc.getBool();
1053 case RC_LANGUAGE_GLOBAL_OPTIONS:
1055 language_global_options = lexrc.getBool();
1058 case RC_LANGUAGE_USE_BABEL:
1060 language_use_babel = lexrc.getBool();
1063 case RC_LANGUAGE_COMMAND_BEGIN:
1065 language_command_begin = lexrc.getString();
1068 case RC_LANGUAGE_COMMAND_END:
1070 language_command_end = lexrc.getString();
1073 case RC_LANGUAGE_COMMAND_LOCAL:
1075 language_command_local = lexrc.getString();
1078 case RC_RTL_SUPPORT:
1080 rtl_support = lexrc.getBool();
1083 case RC_VISUAL_CURSOR:
1085 visual_cursor = lexrc.getBool();
1088 case RC_AUTO_NUMBER:
1090 auto_number = lexrc.getBool();
1093 case RC_MARK_FOREIGN_LANGUAGE:
1095 mark_foreign_language = lexrc.getBool();
1100 string fmt, command;
1102 fmt = lexrc.getString();
1105 command = lexrc.getString();
1107 setMover(fmt, command);
1111 case RC_CONVERTER: {
1112 string from, to, command, flags;
1114 from = lexrc.getString();
1117 to = lexrc.getString();
1120 command = lexrc.getString();
1123 flags = lexrc.getString();
1125 if (command.empty()) {
1126 theConverters().erase(from, to);
1128 theConverters().add(from, to, command, flags);
1132 // compatibility with versions older than 1.4.0 only
1134 string format, command;
1136 format = lexrc.getString();
1139 command = lexrc.getString();
1141 formats.setViewer(format, command);
1145 string format, extension, prettyname, shortcut;
1147 format = lexrc.getString();
1150 extension = lexrc.getString();
1153 prettyname = lexrc.getString();
1156 shortcut = lexrc.getString();
1158 string viewer, editor;
1160 viewer = lexrc.getString();
1162 editor = lexrc.getString();
1164 // Hack to ensure compatibility with versions older
1166 int le = lexrc.lex();
1167 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1168 flags = lexrc.getString();
1169 if (le != Lexer::LEX_DATA) {
1170 // We have got a known token.
1171 // Therefore this is an old style
1172 // format definition without
1174 lexrc.pushToken(flags);
1178 int flgs = Format::none;
1179 while (!flags.empty()) {
1181 flags = split(flags, flag, ',');
1182 if (flag == "document")
1183 flgs |= Format::document;
1184 else if (flag == "vector")
1185 flgs |= Format::vector;
1187 lyxerr << "Ignoring unknown flag `"
1188 << flag << "' for format `"
1189 << format << "'." << endl;
1191 if (prettyname.empty()) {
1192 if (theConverters().formatIsUsed(format)) {
1193 lyxerr << "Can't delete format "
1196 formats.erase(format);
1199 formats.add(format, extension, prettyname,
1200 shortcut, viewer, editor, flgs);
1204 case RC_DEFAULT_LANGUAGE:
1206 default_language = lexrc.getString();
1210 case RC_LABEL_INIT_LENGTH:
1212 label_init_length = lexrc.getInteger();
1216 case RC_SHOW_BANNER:
1218 show_banner = lexrc.getBool();
1224 string const tmp = lexrc.getString();
1225 if (tmp == "true" || tmp == "on")
1226 preview = PREVIEW_ON;
1227 else if (tmp == "no_math")
1228 preview = PREVIEW_NO_MATH;
1230 preview = PREVIEW_OFF;
1231 if (tmp != "false" && tmp != "off")
1232 lyxerr << "Unrecognized "
1234 << tmp << '\n' << endl;
1239 case RC_PREVIEW_HASHED_LABELS:
1241 preview_hashed_labels = lexrc.getBool();
1245 case RC_PREVIEW_SCALE_FACTOR:
1247 preview_scale_factor = lexrc.getString();
1253 user_name = lexrc.getString();
1258 user_email = lexrc.getString();
1261 case RC_PATH_PREFIX:
1263 path_prefix = lexrc.getString();
1266 case RC_USE_CONVERTER_CACHE:
1268 use_converter_cache = lexrc.getBool();
1271 case RC_CONVERTER_CACHE_MAXAGE:
1273 converter_cache_maxage =
1274 convert<unsigned int>(lexrc.getString());
1277 case RC_SORT_LAYOUTS:
1279 sort_layouts = lexrc.getBool();
1281 case RC_GROUP_LAYOUTS:
1283 group_layouts = lexrc.getBool();
1285 case RC_FULL_SCREEN_LIMIT:
1287 full_screen_limit = lexrc.getBool();
1289 case RC_FULL_SCREEN_TOOLBARS:
1291 full_screen_toolbars = lexrc.getBool();
1293 case RC_FULL_SCREEN_SCROLLBAR:
1295 full_screen_scrollbar = lexrc.getBool();
1297 case RC_FULL_SCREEN_TABBAR:
1299 full_screen_tabbar = lexrc.getBool();
1301 case RC_FULL_SCREEN_WIDTH:
1303 full_screen_width = lexrc.getInteger();
1305 case RC_OPEN_BUFFERS_IN_TABS:
1307 open_buffers_in_tabs = lexrc.getBool();
1310 case RC_LAST: break; // this is just a dummy
1314 /// Update converters data-structures
1315 theConverters().update(formats);
1316 theConverters().buildGraph();
1322 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1324 ofstream ofs(filename.toFilesystemEncoding().c_str());
1326 write(ofs, ignore_system_lyxrc);
1330 void LyXRC::print() const
1332 if (lyxerr.debugging())
1333 write(lyxerr, false);
1341 typedef pair<string, SpecialisedMover> Data;
1343 SameMover(Data const & comparison)
1344 : comparison_(comparison) {}
1346 bool operator()(Data const & data) const
1348 return data.first == comparison_.first &&
1349 data.second.command() == comparison_.second.command();
1357 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1359 LyXRCTags tag = RC_LAST;
1361 if (!name.empty()) {
1362 for (int i = 0; i != lyxrcCount; ++i)
1363 if ("\\" + name == lyxrcTags[i].tag)
1364 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1368 os << "### This file is part of\n"
1369 << "### ========================================================\n"
1370 << "### LyX, The Document Processor\n"
1372 << "### Copyright 1995 Matthias Ettrich\n"
1373 << "### Copyright 1995-2007 The LyX Team.\n"
1375 << "### ========================================================\n"
1377 << "# This file is written by LyX, if you want to make your own\n"
1378 << "# modifications you should do them from inside LyX and save\n"
1381 // Why the switch you might ask. It is a trick to ensure that all
1382 // the elements in the LyXRCTags enum is handled. As you can see
1383 // there are no breaks at all. So it is just a huge fall-through.
1384 // The nice thing is that we will get a warning from the compiler
1385 // if we forget an element.
1389 // input/include files are not done here
1391 if (ignore_system_lyxrc ||
1392 bind_file != system_lyxrc.bind_file) {
1393 string const path = os::external_path(bind_file);
1394 os << "\\bind_file \"" << path << "\"\n";
1400 if (ignore_system_lyxrc ||
1401 def_file != system_lyxrc.def_file) {
1402 string const path = os::external_path(def_file);
1403 os << "\\def_file \"" << path << "\"\n";
1412 << "# MISC SECTION ######################################\n"
1414 // bind files are not done here.
1416 case RC_PATH_PREFIX:
1417 if (ignore_system_lyxrc ||
1418 path_prefix != system_lyxrc.path_prefix) {
1419 os << "\\path_prefix \"" << path_prefix << "\"\n";
1424 if (ignore_system_lyxrc ||
1425 ui_file != system_lyxrc.ui_file) {
1426 string const path = os::external_path(ui_file);
1427 os << "\\ui_file \"" << path << "\"\n";
1431 case RC_AUTOREGIONDELETE:
1432 if (ignore_system_lyxrc ||
1433 auto_region_delete != system_lyxrc.auto_region_delete) {
1434 os << "# Set to false to inhibit automatic replacement of\n"
1435 << "# the current selection.\n"
1436 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1441 case RC_AUTORESET_OPTIONS:
1442 if (ignore_system_lyxrc ||
1443 auto_reset_options != system_lyxrc.auto_reset_options) {
1444 os << "# Set to false to inhibit automatic reset of\n"
1445 << "# the class options to defaults on class change.\n"
1446 << "\\auto_reset_options "
1447 << convert<string>(auto_reset_options)
1453 if (ignore_system_lyxrc ||
1454 autosave != system_lyxrc.autosave) {
1455 os << "# The time interval between auto-saves in seconds.\n"
1456 << "\\autosave " << autosave << '\n';
1460 case RC_DISPLAY_GRAPHICS:
1461 if (ignore_system_lyxrc ||
1462 display_graphics != system_lyxrc.display_graphics) {
1463 os << "# Display graphics within LyX\n"
1464 << "# monochrome|grayscale|color|none\n"
1465 << "\\display_graphics "
1466 << graphics::displayTranslator().find(
1467 graphics::DisplayType(display_graphics))
1472 case RC_SORT_LAYOUTS:
1473 if (ignore_system_lyxrc ||
1474 sort_layouts != system_lyxrc.sort_layouts) {
1475 os << "# Sort layouts alphabetically.\n"
1476 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1480 case RC_GROUP_LAYOUTS:
1481 if (ignore_system_lyxrc ||
1482 group_layouts != system_lyxrc.group_layouts) {
1483 os << "# Group layouts by their category.\n"
1484 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1488 case RC_VIEWDVI_PAPEROPTION:
1489 if (ignore_system_lyxrc ||
1490 view_dvi_paper_option
1491 != system_lyxrc.view_dvi_paper_option) {
1492 os << "# Options used to specify paper size to the\n"
1493 << "# view_dvi_command (e.g. -paper)\n"
1494 << "\\view_dvi_paper_option \""
1495 << view_dvi_paper_option << "\"\n";
1499 case RC_DEFAULT_PAPERSIZE:
1500 if (ignore_system_lyxrc ||
1501 default_papersize != system_lyxrc.default_papersize) {
1502 os << "# The default papersize to use.\n"
1503 << "\\default_papersize \"";
1504 switch (default_papersize) {
1506 os << "default"; break;
1507 case PAPER_USLETTER:
1508 os << "usletter"; break;
1510 os << "legal"; break;
1511 case PAPER_USEXECUTIVE:
1512 os << "executive"; break;
1523 case PAPER_B4: break;
1529 case RC_CHKTEX_COMMAND:
1530 if (ignore_system_lyxrc ||
1531 chktex_command != system_lyxrc.chktex_command) {
1532 os << "\\chktex_command \"" << chktex_command << "\"\n";
1536 case RC_BIBTEX_COMMAND:
1537 if (ignore_system_lyxrc ||
1538 bibtex_command != system_lyxrc.bibtex_command) {
1539 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1543 case RC_INDEX_COMMAND:
1544 if (ignore_system_lyxrc ||
1545 index_command != system_lyxrc.index_command) {
1546 os << "\\index_command \"" << index_command << "\"\n";
1550 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1551 if (ignore_system_lyxrc ||
1552 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1553 os << "\\tex_expects_windows_paths "
1554 << convert<string>(windows_style_tex_paths) << '\n';
1558 case RC_TEX_ALLOWS_SPACES:
1559 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1560 os << "\\tex_allows_spaces "
1561 << convert<string>(tex_allows_spaces) << '\n';
1566 if (ignore_system_lyxrc ||
1567 use_kbmap != system_lyxrc.use_kbmap) {
1568 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1572 case RC_KBMAP_PRIMARY:
1573 if (ignore_system_lyxrc ||
1574 primary_kbmap != system_lyxrc.primary_kbmap) {
1575 string const path = os::external_path(primary_kbmap);
1576 os << "\\kbmap_primary \"" << path << "\"\n";
1580 case RC_KBMAP_SECONDARY:
1581 if (ignore_system_lyxrc ||
1582 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1583 string const path = os::external_path(secondary_kbmap);
1584 os << "\\kbmap_secondary \"" << path << "\"\n";
1589 if (ignore_system_lyxrc ||
1590 lyxpipes != system_lyxrc.lyxpipes) {
1591 string const path = os::external_path(lyxpipes);
1592 os << "\\serverpipe \"" << path << "\"\n";
1596 case RC_DATE_INSERT_FORMAT:
1597 if (ignore_system_lyxrc ||
1598 date_insert_format != system_lyxrc.date_insert_format) {
1599 os << "\\date_insert_format \"" << date_insert_format
1604 case RC_LABEL_INIT_LENGTH:
1605 if (ignore_system_lyxrc ||
1606 label_init_length != system_lyxrc.label_init_length) {
1607 os << "\\label_init_length " << label_init_length
1614 os << "\\user_name \"" << user_name << "\"\n";
1619 os << "\\user_email \"" << user_email << "\"\n";
1623 case RC_SHOW_BANNER:
1624 if (ignore_system_lyxrc ||
1625 show_banner != system_lyxrc.show_banner) {
1626 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1632 if (ignore_system_lyxrc ||
1633 preview != system_lyxrc.preview) {
1639 case PREVIEW_NO_MATH:
1646 os << "\\preview " << status << '\n';
1651 case RC_PREVIEW_HASHED_LABELS:
1652 if (ignore_system_lyxrc ||
1653 preview_hashed_labels !=
1654 system_lyxrc.preview_hashed_labels) {
1655 os << "\\preview_hashed_labels "
1656 << convert<string>(preview_hashed_labels) << '\n';
1661 case RC_PREVIEW_SCALE_FACTOR:
1662 if (ignore_system_lyxrc ||
1663 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1664 os << "\\preview_scale_factor "
1665 << preview_scale_factor << '\n';
1670 case RC_USE_CONVERTER_CACHE:
1671 if (ignore_system_lyxrc ||
1672 use_converter_cache != system_lyxrc.use_converter_cache) {
1673 os << "\\use_converter_cache "
1674 << convert<string>(use_converter_cache) << '\n';
1679 case RC_CONVERTER_CACHE_MAXAGE:
1680 if (ignore_system_lyxrc ||
1681 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1682 os << "\\converter_cache_maxage "
1683 << converter_cache_maxage << '\n';
1689 << "# SCREEN & FONTS SECTION ############################\n"
1693 if (ignore_system_lyxrc ||
1694 dpi != system_lyxrc.dpi) {
1695 os << "\\screen_dpi " << dpi << '\n';
1699 case RC_SCREEN_ZOOM:
1700 if (ignore_system_lyxrc ||
1701 zoom != system_lyxrc.zoom) {
1702 os << "\\screen_zoom " << zoom << '\n';
1706 case RC_GEOMETRY_SESSION:
1707 if (ignore_system_lyxrc ||
1708 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1709 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1714 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1715 if (ignore_system_lyxrc ||
1716 cursor_follows_scrollbar
1717 != system_lyxrc.cursor_follows_scrollbar) {
1718 os << "\\cursor_follows_scrollbar "
1719 << convert<string>(cursor_follows_scrollbar) << '\n';
1723 case RC_MACRO_EDIT_STYLE:
1724 if (ignore_system_lyxrc ||
1726 != system_lyxrc.macro_edit_style) {
1727 os << "\\macro_edit_style ";
1728 switch (macro_edit_style) {
1729 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1730 case MACRO_EDIT_INLINE: os << "1\n"; break;
1731 case MACRO_EDIT_LIST: os << "2\n"; break;
1736 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1737 if (ignore_system_lyxrc ||
1738 dialogs_iconify_with_main
1739 != system_lyxrc.dialogs_iconify_with_main) {
1740 os << "\\dialogs_iconify_with_main "
1741 << convert<string>(dialogs_iconify_with_main) << '\n';
1745 case RC_SCREEN_FONT_ROMAN:
1746 if (ignore_system_lyxrc ||
1747 roman_font_name != system_lyxrc.roman_font_name) {
1748 os << "\\screen_font_roman \"" << roman_font_name
1753 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1754 if (ignore_system_lyxrc ||
1755 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1756 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1761 case RC_SCREEN_FONT_SANS:
1762 if (ignore_system_lyxrc ||
1763 sans_font_name != system_lyxrc.sans_font_name) {
1764 os << "\\screen_font_sans \"" << sans_font_name
1769 case RC_SCREEN_FONT_SANS_FOUNDRY:
1770 if (ignore_system_lyxrc ||
1771 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1772 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1777 case RC_SCREEN_FONT_TYPEWRITER:
1778 if (ignore_system_lyxrc ||
1779 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1780 os << "\\screen_font_typewriter \""
1781 << typewriter_font_name << "\"\n";
1785 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1786 if (ignore_system_lyxrc ||
1787 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1788 os << "\\screen_font_typewriter_foundry \""
1789 << typewriter_font_foundry << "\"\n";
1794 case RC_SCREEN_FONT_SCALABLE:
1795 if (ignore_system_lyxrc ||
1796 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1797 os << "\\screen_font_scalable "
1798 << convert<string>(use_scalable_fonts)
1803 case RC_SCREEN_FONT_SIZES:
1804 if (ignore_system_lyxrc ||
1805 font_sizes[FONT_SIZE_TINY]
1806 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1807 font_sizes[FONT_SIZE_SCRIPT]
1808 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1809 font_sizes[FONT_SIZE_FOOTNOTE]
1810 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1811 font_sizes[FONT_SIZE_SMALL]
1812 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1813 font_sizes[FONT_SIZE_NORMAL]
1814 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1815 font_sizes[FONT_SIZE_LARGE]
1816 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1817 font_sizes[FONT_SIZE_LARGER]
1818 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1819 font_sizes[FONT_SIZE_LARGEST]
1820 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1821 font_sizes[FONT_SIZE_HUGE]
1822 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1823 font_sizes[FONT_SIZE_HUGER]
1824 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1825 os.setf(ios::fixed);
1827 os << "\\screen_font_sizes"
1828 << ' ' << font_sizes[FONT_SIZE_TINY]
1829 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1830 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1831 << ' ' << font_sizes[FONT_SIZE_SMALL]
1832 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1833 << ' ' << font_sizes[FONT_SIZE_LARGE]
1834 << ' ' << font_sizes[FONT_SIZE_LARGER]
1835 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1836 << ' ' << font_sizes[FONT_SIZE_HUGE]
1837 << ' ' << font_sizes[FONT_SIZE_HUGER]
1842 case RC_FULL_SCREEN_LIMIT:
1843 if (ignore_system_lyxrc ||
1844 full_screen_limit != system_lyxrc.full_screen_limit) {
1845 os << "\\fullscreen_limit "
1846 << convert<string>(full_screen_limit)
1851 case RC_FULL_SCREEN_TOOLBARS:
1852 if (ignore_system_lyxrc ||
1853 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1854 os << "\\fullscreen_toolbars "
1855 << convert<string>(full_screen_toolbars)
1860 case RC_FULL_SCREEN_SCROLLBAR:
1861 if (ignore_system_lyxrc ||
1862 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1863 os << "\\fullscreen_scrollbar "
1864 << convert<string>(full_screen_scrollbar)
1869 case RC_FULL_SCREEN_TABBAR:
1870 if (ignore_system_lyxrc ||
1871 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1872 os << "\\fullscreen_tabbar "
1873 << convert<string>(full_screen_tabbar)
1878 case RC_FULL_SCREEN_WIDTH:
1879 if (ignore_system_lyxrc ||
1880 full_screen_width != system_lyxrc.full_screen_width) {
1881 os << "\\fullscreen_width "
1882 << convert<string>(full_screen_width)
1887 case RC_OPEN_BUFFERS_IN_TABS:
1888 if (ignore_system_lyxrc ||
1889 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1890 os << "\\open_buffers_in_tabs "
1891 << convert<string>(open_buffers_in_tabs)
1898 << "# COLOR SECTION ###################################\n"
1902 for (int i = 0; i < Color_ignore; ++i) {
1903 ColorCode lc = static_cast<ColorCode>(i);
1905 string const col(lcolor.getX11Name(lc));
1906 if (ignore_system_lyxrc ||
1907 col != system_lcolor.getX11Name(lc)) {
1908 os << "\\set_color \""
1909 << lcolor.getLyXName(lc) << "\" \""
1917 << "# PRINTER SECTION ###################################\n"
1921 if (ignore_system_lyxrc ||
1922 printer != system_lyxrc.printer) {
1923 os << "\\printer \"" << printer << "\"\n";
1927 case RC_PRINT_ADAPTOUTPUT:
1928 if (ignore_system_lyxrc ||
1929 print_adapt_output != system_lyxrc.print_adapt_output) {
1930 os << "\\print_adapt_output "
1931 << convert<string>(print_adapt_output)
1936 case RC_PRINT_COMMAND:
1937 if (ignore_system_lyxrc ||
1938 print_command != system_lyxrc.print_command) {
1939 os << "\\print_command \"" << print_command << "\"\n";
1943 case RC_PRINTEXSTRAOPTIONS:
1944 if (ignore_system_lyxrc ||
1945 print_extra_options != system_lyxrc.print_extra_options) {
1946 os << "\\print_extra_options \"" << print_extra_options
1951 case RC_PRINTSPOOL_COMMAND:
1952 if (ignore_system_lyxrc ||
1953 print_spool_command != system_lyxrc.print_spool_command) {
1954 os << "\\print_spool_command \"" << print_spool_command
1959 case RC_PRINTSPOOL_PRINTERPREFIX:
1960 if (ignore_system_lyxrc ||
1961 print_spool_printerprefix
1962 != system_lyxrc.print_spool_printerprefix) {
1963 os << "\\print_spool_printerprefix \""
1964 << print_spool_printerprefix << "\"\n";
1968 case RC_PRINTEVENPAGEFLAG:
1969 if (ignore_system_lyxrc ||
1970 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1971 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1976 case RC_PRINTODDPAGEFLAG:
1977 if (ignore_system_lyxrc ||
1978 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1979 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1984 case RC_PRINTREVERSEFLAG:
1985 if (ignore_system_lyxrc ||
1986 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1987 os << "\\print_reverse_flag \"" << print_reverse_flag
1992 case RC_PRINTLANDSCAPEFLAG:
1993 if (ignore_system_lyxrc ||
1994 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1995 os << "\\print_landscape_flag \"" << print_landscape_flag
2000 case RC_PRINTPAGERANGEFLAG:
2001 if (ignore_system_lyxrc ||
2002 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2003 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2008 case RC_PRINTCOPIESFLAG:
2009 if (ignore_system_lyxrc ||
2010 print_copies_flag != system_lyxrc.print_copies_flag) {
2011 os << "\\print_copies_flag \"" << print_copies_flag
2016 case RC_PRINTCOLLCOPIESFLAG:
2017 if (ignore_system_lyxrc ||
2018 print_collcopies_flag
2019 != system_lyxrc.print_collcopies_flag) {
2020 os << "\\print_collcopies_flag \""
2021 << print_collcopies_flag
2026 case RC_PRINTPAPERFLAG:
2027 if (ignore_system_lyxrc ||
2028 print_paper_flag != system_lyxrc.print_paper_flag) {
2029 os << "\\print_paper_flag \"" << print_paper_flag
2034 case RC_PRINTPAPERDIMENSIONFLAG:
2035 if (ignore_system_lyxrc ||
2036 print_paper_dimension_flag
2037 != system_lyxrc.print_paper_dimension_flag) {
2038 os << "\\print_paper_dimension_flag \""
2039 << print_paper_dimension_flag << "\"\n";
2043 case RC_PRINTTOPRINTER:
2044 if (ignore_system_lyxrc ||
2045 print_to_printer != system_lyxrc.print_to_printer) {
2046 os << "\\print_to_printer \"" << print_to_printer
2051 case RC_PRINTTOFILE:
2052 if (ignore_system_lyxrc ||
2053 print_to_file != system_lyxrc.print_to_file) {
2054 string const path = os::external_path(print_to_file);
2055 os << "\\print_to_file \"" << path << "\"\n";
2059 case RC_PRINTFILEEXTENSION:
2060 if (ignore_system_lyxrc ||
2061 print_file_extension != system_lyxrc.print_file_extension) {
2062 os << "\\print_file_extension \""
2063 << print_file_extension
2070 << "# EXPORT SECTION ####################################\n"
2073 case RC_CUSTOM_EXPORT_COMMAND:
2074 if (ignore_system_lyxrc ||
2075 custom_export_command
2076 != system_lyxrc.custom_export_command) {
2077 os << "\\custom_export_command \""
2078 << custom_export_command
2083 case RC_CUSTOM_EXPORT_FORMAT:
2084 if (ignore_system_lyxrc ||
2085 custom_export_format
2086 != system_lyxrc.custom_export_format) {
2087 os << "\\custom_export_format \"" << custom_export_format
2094 << "# TEX SECTION #######################################\n"
2097 case RC_FONT_ENCODING:
2098 if (ignore_system_lyxrc ||
2099 fontenc != system_lyxrc.fontenc) {
2100 os << "\\font_encoding \"" << fontenc << "\"\n";
2106 << "# FILE SECTION ######################################\n"
2109 case RC_DOCUMENTPATH:
2110 if (ignore_system_lyxrc ||
2111 document_path != system_lyxrc.document_path) {
2112 string const path = os::external_path(document_path);
2113 os << "\\document_path \"" << path << "\"\n";
2117 case RC_USELASTFILEPOS:
2118 if (ignore_system_lyxrc ||
2119 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2120 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2125 case RC_LOADSESSION:
2126 if (ignore_system_lyxrc ||
2127 load_session != system_lyxrc.load_session) {
2128 os << "\\load_session " << convert<string>(load_session)
2133 case RC_MOUSE_WHEEL_SPEED:
2134 if (ignore_system_lyxrc ||
2135 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2136 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2140 case RC_COMPLETION_INLINE_DELAY:
2141 if (ignore_system_lyxrc ||
2142 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2143 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2147 case RC_COMPLETION_INLINE_MATH:
2148 if (ignore_system_lyxrc ||
2149 completion_inline_math != system_lyxrc.completion_inline_math) {
2150 os << "\\completion_inline_math "
2151 << convert<string>(completion_inline_math) << '\n';
2155 case RC_COMPLETION_INLINE_TEXT:
2156 if (ignore_system_lyxrc ||
2157 completion_inline_text != system_lyxrc.completion_inline_text) {
2158 os << "\\completion_inline_text "
2159 << convert<string>(completion_inline_text) << '\n';
2163 case RC_COMPLETION_INLINE_DOTS:
2164 if (ignore_system_lyxrc ||
2165 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2166 os << "\\completion_inline_dots "
2167 << convert<string>(completion_inline_dots) << '\n';
2171 case RC_COMPLETION_POPUP_DELAY:
2172 if (ignore_system_lyxrc ||
2173 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2174 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2178 case RC_COMPLETION_POPUP_MATH:
2179 if (ignore_system_lyxrc ||
2180 completion_popup_math != system_lyxrc.completion_popup_math) {
2181 os << "\\completion_popup_math "
2182 << convert<string>(completion_popup_math) << '\n';
2186 case RC_COMPLETION_POPUP_TEXT:
2187 if (ignore_system_lyxrc ||
2188 completion_popup_text != system_lyxrc.completion_popup_text) {
2189 os << "\\completion_popup_text "
2190 << convert<string>(completion_popup_text) << '\n';
2194 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2195 if (ignore_system_lyxrc ||
2196 completion_popup_after_complete
2197 != system_lyxrc.completion_popup_after_complete) {
2198 os << "\\completion_popup_after_complete "
2199 << convert<string>(completion_popup_after_complete) << '\n';
2203 case RC_NUMLASTFILES:
2204 if (ignore_system_lyxrc ||
2205 num_lastfiles != system_lyxrc.num_lastfiles) {
2206 os << "\\num_lastfiles " << num_lastfiles << '\n';
2210 case RC_CHECKLASTFILES:
2211 if (ignore_system_lyxrc ||
2212 check_lastfiles != system_lyxrc.check_lastfiles) {
2213 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2218 case RC_EXAMPLEPATH:
2219 if (ignore_system_lyxrc ||
2220 example_path != system_lyxrc.example_path) {
2221 string const path = os::external_path(example_path);
2222 os << "\\example_path \"" << path << "\"\n";
2226 case RC_TEMPLATEPATH:
2227 if (ignore_system_lyxrc ||
2228 template_path != system_lyxrc.template_path) {
2229 string const path = os::external_path(template_path);
2230 os << "\\template_path \"" << path << "\"\n";
2234 case RC_TEMPDIRPATH:
2235 if (ignore_system_lyxrc ||
2236 tempdir_path != system_lyxrc.tempdir_path) {
2237 string const path = os::external_path(tempdir_path);
2238 os << "\\tempdir_path \"" << path << "\"\n";
2246 case RC_PLAINTEXT_LINELEN:
2247 if (ignore_system_lyxrc ||
2248 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2249 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2253 case RC_MAKE_BACKUP:
2254 if (ignore_system_lyxrc ||
2255 make_backup != system_lyxrc.make_backup) {
2256 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2260 case RC_BACKUPDIR_PATH:
2261 if (ignore_system_lyxrc ||
2262 backupdir_path != system_lyxrc.backupdir_path) {
2263 string const path = os::external_path(backupdir_path);
2264 os << "\\backupdir_path \"" << path << "\"\n";
2270 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2273 case RC_PLAINTEXT_ROFF_COMMAND:
2274 if (ignore_system_lyxrc ||
2275 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2276 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2283 << "# SPELLCHECKER SECTION ##############################\n"
2285 case RC_USE_SPELL_LIB:
2286 if (ignore_system_lyxrc ||
2287 use_spell_lib != system_lyxrc.use_spell_lib) {
2288 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2292 case RC_SPELL_COMMAND:
2293 if (ignore_system_lyxrc ||
2294 isp_command != system_lyxrc.isp_command) {
2295 os << "\\spell_command \"" << isp_command << "\"\n";
2299 case RC_ACCEPT_COMPOUND:
2300 if (ignore_system_lyxrc ||
2301 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2302 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2307 case RC_USE_ALT_LANG:
2308 if (ignore_system_lyxrc ||
2309 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2310 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2316 if (ignore_system_lyxrc ||
2317 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2318 os << "\\alternate_language \"" << isp_alt_lang
2323 case RC_USE_ESC_CHARS:
2324 if (ignore_system_lyxrc ||
2325 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2326 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2332 if (ignore_system_lyxrc ||
2333 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2334 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2338 case RC_USE_PERS_DICT:
2339 if (ignore_system_lyxrc ||
2340 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2341 os << "\\use_personal_dictionary "
2342 << convert<string>(isp_use_pers_dict)
2347 case RC_USE_TOOLTIP:
2348 if (ignore_system_lyxrc ||
2349 use_tooltip != system_lyxrc.use_tooltip) {
2350 os << "\\use_tooltip "
2351 << convert<string>(use_tooltip)
2354 case RC_USE_PIXMAP_CACHE:
2355 if (ignore_system_lyxrc ||
2356 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2357 os << "\\use_pixmap_cache "
2358 << convert<string>(use_pixmap_cache)
2362 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2363 string const path = os::external_path(isp_pers_dict);
2364 os << "\\personal_dictionary \"" << path << "\"\n";
2368 case RC_USE_INP_ENC:
2369 if (ignore_system_lyxrc ||
2370 isp_use_input_encoding
2371 != system_lyxrc.isp_use_input_encoding) {
2372 os << "\\use_input_encoding "
2373 << convert<string>(isp_use_input_encoding)
2380 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2383 case RC_RTL_SUPPORT:
2384 if (ignore_system_lyxrc ||
2385 rtl_support != system_lyxrc.rtl_support) {
2386 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2390 case RC_VISUAL_CURSOR:
2391 if (ignore_system_lyxrc ||
2392 visual_cursor != system_lyxrc.visual_cursor) {
2393 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2397 case RC_LANGUAGE_PACKAGE:
2398 if (ignore_system_lyxrc ||
2399 language_package != system_lyxrc.language_package) {
2400 os << "\\language_package \"" << language_package
2405 case RC_LANGUAGE_GLOBAL_OPTIONS:
2406 if (ignore_system_lyxrc ||
2407 language_global_options
2408 != system_lyxrc.language_global_options) {
2409 os << "\\language_global_options \""
2410 << convert<string>(language_global_options)
2415 case RC_LANGUAGE_USE_BABEL:
2416 if (ignore_system_lyxrc ||
2417 language_use_babel != system_lyxrc.language_use_babel) {
2418 os << "\\language_use_babel \""
2419 << convert<string>(language_use_babel)
2424 case RC_LANGUAGE_COMMAND_BEGIN:
2425 if (ignore_system_lyxrc ||
2426 language_command_begin
2427 != system_lyxrc.language_command_begin) {
2428 os << "\\language_command_begin \""
2429 << language_command_begin
2434 case RC_LANGUAGE_COMMAND_END:
2435 if (ignore_system_lyxrc ||
2436 language_command_end
2437 != system_lyxrc.language_command_end) {
2438 os << "\\language_command_end \"" << language_command_end
2443 case RC_LANGUAGE_COMMAND_LOCAL:
2444 if (ignore_system_lyxrc ||
2445 language_command_local
2446 != system_lyxrc.language_command_local) {
2447 os << "\\language_command_local \""
2448 << language_command_local
2453 case RC_LANGUAGE_AUTO_BEGIN:
2454 if (ignore_system_lyxrc ||
2455 language_auto_begin != system_lyxrc.language_auto_begin) {
2456 os << "\\language_auto_begin "
2457 << convert<string>(language_auto_begin) << '\n';
2461 case RC_LANGUAGE_AUTO_END:
2462 if (ignore_system_lyxrc ||
2463 language_auto_end != system_lyxrc.language_auto_end) {
2464 os << "\\language_auto_end "
2465 << convert<string>(language_auto_end) << '\n';
2469 case RC_MARK_FOREIGN_LANGUAGE:
2470 if (ignore_system_lyxrc ||
2471 mark_foreign_language
2472 != system_lyxrc.mark_foreign_language) {
2473 os << "\\mark_foreign_language " <<
2474 convert<string>(mark_foreign_language) << '\n';
2480 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2483 case RC_AUTO_NUMBER:
2484 if (ignore_system_lyxrc ||
2485 auto_number != system_lyxrc.auto_number) {
2486 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2490 case RC_DEFAULT_LANGUAGE:
2491 if (ignore_system_lyxrc ||
2492 default_language != system_lyxrc.default_language) {
2493 os << "\\default_language " << default_language << '\n';
2499 << "# FORMATS SECTION ##########################\n"
2503 // New/modified formats
2504 for (Formats::const_iterator cit = formats.begin();
2505 cit != formats.end(); ++cit) {
2506 Format const * format =
2507 system_formats.getFormat(cit->name());
2509 format->extension() != cit->extension() ||
2510 format->prettyname() != cit->prettyname() ||
2511 format->shortcut() != cit->shortcut() ||
2512 format->viewer() != cit->viewer() ||
2513 format->editor() != cit->editor() ||
2514 format->documentFormat() != cit->documentFormat() ||
2515 format->vectorFormat() != cit->vectorFormat()) {
2516 os << "\\format \"" << cit->name() << "\" \""
2517 << cit->extension() << "\" \""
2518 << cit->prettyname() << "\" \""
2519 << cit->shortcut() << "\" \""
2520 << cit->viewer() << "\" \""
2521 << cit->editor() << "\" \"";
2522 vector<string> flags;
2523 if (cit->documentFormat())
2524 flags.push_back("document");
2525 if (cit->vectorFormat())
2526 flags.push_back("vector");
2527 os << getStringFromVector(flags);
2532 // Look for deleted formats
2533 for (Formats::const_iterator cit = system_formats.begin();
2534 cit != system_formats.end(); ++cit)
2535 if (!formats.getFormat(cit->name()))
2536 os << "\\format \"" << cit->name()
2537 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2546 << "# CONVERTERS SECTION ##########################\n"
2550 // Look for new converters
2551 for (Converters::const_iterator cit = theConverters().begin();
2552 cit != theConverters().end(); ++cit) {
2553 Converter const * converter =
2554 theSystemConverters().getConverter(cit->from,
2557 converter->command != cit->command ||
2558 converter->flags != cit->flags)
2559 os << "\\converter \"" << cit->from << "\" \""
2560 << cit->to << "\" \""
2561 << cit->command << "\" \""
2562 << cit->flags << "\"\n";
2565 // New/modifed converters
2566 for (Converters::const_iterator cit = theSystemConverters().begin();
2567 cit != theSystemConverters().end(); ++cit)
2568 if (!theConverters().getConverter(cit->from, cit->to))
2569 os << "\\converter \"" << cit->from
2570 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2577 << "# COPIERS SECTION ##########################\n"
2580 // Look for new movers
2581 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2582 Movers::const_iterator const sysend = theSystemMovers().end();
2583 Movers::const_iterator it = theMovers().begin();
2584 Movers::const_iterator end = theMovers().end();
2586 for (; it != end; ++it) {
2587 Movers::const_iterator const sysit =
2588 find_if(sysbegin, sysend, SameMover(*it));
2589 if (sysit == sysend) {
2590 string const & fmt = it->first;
2591 string const & command =
2592 it->second.command();
2594 os << "\\copier " << fmt
2595 << " \"" << command << "\"\n";
2601 // We don't actually delete SpecialisedMover(s) from the
2602 // map, just clear their 'command', so there's no need
2603 // to test for anything else.
2611 string const LyXRC::getDescription(LyXRCTags tag)
2616 case RC_ACCEPT_COMPOUND:
2617 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2621 case RC_USE_ALT_LANG:
2622 str = _("Specify an alternate language. The default is to use the language of the document.");
2625 case RC_PLAINTEXT_ROFF_COMMAND:
2626 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.");
2629 case RC_PLAINTEXT_LINELEN:
2630 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.");
2633 case RC_AUTOREGIONDELETE:
2634 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2637 case RC_AUTORESET_OPTIONS:
2638 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2642 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2645 case RC_AUTO_NUMBER:
2648 case RC_BACKUPDIR_PATH:
2649 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.");
2652 case RC_BIBTEX_COMMAND:
2653 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2657 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2660 case RC_CHECKLASTFILES:
2661 str = _("Select to check whether the lastfiles still exist.");
2664 case RC_CHKTEX_COMMAND:
2665 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2674 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2675 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.");
2678 case RC_SHOW_MACRO_LABEL:
2679 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2682 case RC_CUSTOM_EXPORT_COMMAND:
2685 case RC_CUSTOM_EXPORT_FORMAT:
2688 case RC_DATE_INSERT_FORMAT:
2689 //xgettext:no-c-format
2690 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2694 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2697 case RC_DEFAULT_LANGUAGE:
2698 str = _("New documents will be assigned this language.");
2701 case RC_DEFAULT_PAPERSIZE:
2702 str = _("Specify the default paper size.");
2705 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2706 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2709 case RC_DISPLAY_GRAPHICS:
2710 str = _("Select how LyX will display any graphics.");
2713 case RC_DOCUMENTPATH:
2714 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2718 case RC_USE_ESC_CHARS:
2719 str = _("Specify additional chars that can be part of a word.");
2722 case RC_EXAMPLEPATH:
2723 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2726 case RC_FONT_ENCODING:
2727 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2733 case RC_INDEX_COMMAND:
2734 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\".");
2741 case RC_KBMAP_PRIMARY:
2742 case RC_KBMAP_SECONDARY:
2743 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.");
2746 case RC_LABEL_INIT_LENGTH:
2747 str = _("Maximum number of words in the initialization string for a new label");
2750 case RC_LANGUAGE_AUTO_BEGIN:
2751 str = _("Select if a language switching command is needed at the beginning of the document.");
2754 case RC_LANGUAGE_AUTO_END:
2755 str = _("Select if a language switching command is needed at the end of the document.");
2758 case RC_LANGUAGE_COMMAND_BEGIN:
2759 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.");
2762 case RC_LANGUAGE_COMMAND_END:
2763 str = _("The LaTeX command for changing back to the language of the document.");
2766 case RC_LANGUAGE_COMMAND_LOCAL:
2767 str = _("The LaTeX command for local changing of the language.");
2770 case RC_LANGUAGE_GLOBAL_OPTIONS:
2771 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2774 case RC_LANGUAGE_PACKAGE:
2775 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2778 case RC_LANGUAGE_USE_BABEL:
2779 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2782 case RC_USELASTFILEPOS:
2783 str = _("De-select if you do not want LyX to scroll to saved position.");
2786 case RC_LOADSESSION:
2787 str = _("De-select to prevent loading files opened from the last LyX session.");
2790 case RC_MAKE_BACKUP:
2791 str = _("De-select if you don't want LyX to create backup files.");
2794 case RC_MARK_FOREIGN_LANGUAGE:
2795 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2798 case RC_MOUSE_WHEEL_SPEED:
2799 str = bformat(_("The scrolling speed of the mouse wheel."),
2803 case RC_COMPLETION_POPUP_DELAY:
2804 str = _("The completion popup delay.");
2807 case RC_COMPLETION_POPUP_MATH:
2808 str = _("Select to display the completion popup in math mode.");
2811 case RC_COMPLETION_POPUP_TEXT:
2812 str = _("Select to display the completion popup in text mode.");
2815 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2816 str = _("Show the completion popup without delay after non-unique completion attempt.");
2819 case RC_COMPLETION_POPUP_DELAY:
2820 str = _("The inline completion delay.");
2823 case RC_COMPLETION_INLINE_MATH:
2824 str = _("Select to display the inline completion in math mode.");
2827 case RC_COMPLETION_INLINE_TEXT:
2828 str = _("Select to display the inline completion in text mode.");
2831 case RC_COMPLETION_INLINE_DOTS:
2832 str = _("Use \"...\" to shorten long completions.");
2835 case RC_NUMLASTFILES:
2836 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2840 case RC_PATH_PREFIX:
2841 str = _("Specify those directories which should be "
2842 "prepended to the PATH environment variable. "
2843 "Use the OS native format.");
2847 case RC_USE_PERS_DICT:
2848 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2852 str = _("Shows a typeset preview of things such as math");
2855 case RC_PREVIEW_HASHED_LABELS:
2856 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2859 case RC_PREVIEW_SCALE_FACTOR:
2860 str = _("Scale the preview size to suit.");
2863 case RC_PRINTCOLLCOPIESFLAG:
2864 str = _("The option for specifying whether the copies should be collated.");
2867 case RC_PRINTCOPIESFLAG:
2868 str = _("The option for specifying the number of copies to print.");
2872 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2875 case RC_PRINTEVENPAGEFLAG:
2876 str = _("The option to print only even pages.");
2879 case RC_PRINTEXSTRAOPTIONS:
2880 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2883 case RC_PRINTFILEEXTENSION:
2884 str = _("Extension of printer program output file. Usually \".ps\".");
2887 case RC_PRINTLANDSCAPEFLAG:
2888 str = _("The option to print out in landscape.");
2891 case RC_PRINTODDPAGEFLAG:
2892 str = _("The option to print only odd pages.");
2895 case RC_PRINTPAGERANGEFLAG:
2896 str = _("The option for specifying a comma-separated list of pages to print.");
2899 case RC_PRINTPAPERDIMENSIONFLAG:
2900 str = _("Option to specify the dimensions of the print paper.");
2903 case RC_PRINTPAPERFLAG:
2904 str = _("The option to specify paper type.");
2907 case RC_PRINTREVERSEFLAG:
2908 str = _("The option to reverse the order of the pages printed.");
2911 case RC_PRINTSPOOL_COMMAND:
2912 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.");
2915 case RC_PRINTSPOOL_PRINTERPREFIX:
2916 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.");
2919 case RC_PRINTTOFILE:
2920 str = _("Option to pass to the print program to print to a file.");
2923 case RC_PRINTTOPRINTER:
2924 str = _("Option to pass to the print program to print on a specific printer.");
2927 case RC_PRINT_ADAPTOUTPUT:
2928 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2931 case RC_PRINT_COMMAND:
2932 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2935 case RC_RTL_SUPPORT:
2936 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2939 case RC_VISUAL_CURSOR:
2940 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2944 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2947 case RC_SCREEN_FONT_ROMAN:
2948 case RC_SCREEN_FONT_SANS:
2949 case RC_SCREEN_FONT_TYPEWRITER:
2950 str = _("The screen fonts used to display the text while editing.");
2953 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2954 case RC_SCREEN_FONT_SANS_FOUNDRY:
2955 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2958 case RC_SCREEN_FONT_SCALABLE:
2959 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.");
2962 case RC_SCREEN_FONT_SIZES:
2963 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2966 case RC_SCREEN_ZOOM:
2967 //xgettext:no-c-format
2968 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2971 case RC_GEOMETRY_SESSION:
2972 str = _("Allow session manager to save and restore windows geometry.");
2976 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2982 case RC_SHOW_BANNER:
2983 str = _("De-select if you don't want the startup banner.");
2986 case RC_SPELL_COMMAND:
2987 str = _("What command runs the spellchecker?");
2990 case RC_TEMPDIRPATH:
2991 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2994 case RC_TEMPLATEPATH:
2995 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2998 case RC_TEX_ALLOWS_SPACES:
3001 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3005 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3017 case RC_USE_INP_ENC:
3018 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.");
3021 case RC_USE_TOOLTIP:
3022 str = _("Enable the automatic appearance of tool tips in the work area.");
3025 case RC_USE_PIXMAP_CACHE:
3026 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3029 case RC_USE_SPELL_LIB:
3032 case RC_VIEWDVI_PAPEROPTION:
3033 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3048 // The global instance
3051 // The global copy of the system lyxrc entries (everything except preferences)