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.
22 #include "Converter.h"
23 #include "FontEnums.h"
31 #include "graphics/GraphicsTypes.h"
33 #include "support/convert.h"
34 #include "support/debug.h"
35 #include "support/environment.h"
36 #include "support/FileName.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/Package.h"
42 #include "support/userinfo.h"
49 using namespace lyx::support;
53 namespace os = support::os;
57 // when adding something to this array keep it sorted!
58 LexerKeyword lyxrcTags[] = {
59 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
60 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
61 { "\\alternate_language", LyXRC::RC_ALT_LANG },
62 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
63 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
64 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
65 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
66 { "\\autosave", LyXRC::RC_AUTOSAVE },
67 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
68 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
69 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
70 { "\\bind_file", LyXRC::RC_BINDFILE },
71 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
72 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
73 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
74 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
75 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
76 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
77 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
78 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
79 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
80 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
81 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
82 { "\\converter", LyXRC::RC_CONVERTER },
83 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
84 { "\\copier", LyXRC::RC_COPIER },
85 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
86 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
87 { "\\def_file", LyXRC::RC_DEFFILE },
88 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
89 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
90 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
91 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
92 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
93 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
94 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
95 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
96 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
97 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
98 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
99 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
100 { "\\format", LyXRC::RC_FORMAT },
101 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
102 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
103 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
104 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
105 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
106 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
107 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
108 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
109 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
110 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
111 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
112 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
113 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
114 { "\\input", LyXRC::RC_INPUT },
115 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
116 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
117 { "\\kbmap", LyXRC::RC_KBMAP },
118 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
119 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
120 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
121 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
122 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
123 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
124 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
125 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
126 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
127 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
128 { "\\load_session", LyXRC::RC_LOADSESSION },
129 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
130 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
131 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
132 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
133 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
134 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
135 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
136 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
137 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
138 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
139 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
140 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
141 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
142 { "\\preview", LyXRC::RC_PREVIEW },
143 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
144 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
145 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
146 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
147 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
148 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
149 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
150 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
151 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
152 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
153 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
154 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
155 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
156 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
157 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
158 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
159 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
160 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
161 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
162 { "\\printer", LyXRC::RC_PRINTER },
163 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
164 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
165 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
166 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
167 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
168 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
169 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
170 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
171 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
172 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
173 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
174 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
175 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
176 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
177 { "\\set_color", LyXRC::RC_SET_COLOR },
178 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
179 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
180 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
181 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
182 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
183 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
184 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
185 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
186 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
187 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
188 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
189 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
190 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
191 { "\\ui_file", LyXRC::RC_UIFILE },
192 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
193 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
194 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
195 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
196 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
197 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
198 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
199 // compatibility with versions older than 1.4.0 only
200 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
201 // compatibility with versions older than 1.4.0 only
202 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
203 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
204 { "\\user_email", LyXRC::RC_USER_EMAIL },
205 { "\\user_name", LyXRC::RC_USER_NAME },
206 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
207 // compatibility with versions older than 1.4.0 only
208 { "\\viewer", LyXRC::RC_VIEWER},
209 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
210 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
213 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
224 void LyXRC::setDefaults()
227 def_file = "default";
229 // Get printer from the environment. If fail, use default "",
230 // assuming that everything is set up correctly.
231 printer = getEnv("PRINTER");
232 print_adapt_output = false;
233 print_command = "dvips";
234 print_evenpage_flag = "-B";
235 print_oddpage_flag = "-A";
236 print_pagerange_flag = "-pp";
237 print_copies_flag = "-c";
238 print_collcopies_flag = "-C";
239 print_reverse_flag = "-r";
240 print_landscape_flag = "-t landscape";
241 print_to_printer = "-P";
242 print_to_file = "-o ";
243 print_file_extension = ".ps";
244 print_paper_flag = "-t";
245 print_paper_dimension_flag = "-T";
246 document_path.erase();
247 view_dvi_paper_option.erase();
248 default_papersize = PAPER_DEFAULT;
249 default_view_format = "pdf2";
250 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
251 bibtex_command = "bibtex";
253 index_command = "makeindex -c -q";
254 nomencl_command = "makeindex -s nomencl.ist";
256 // Because a screen is typically wider than a piece of paper:
258 allow_geometry_session = true;
259 // Default LaTeX font size:
260 font_sizes[FONT_SIZE_TINY] = "5.0";
261 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
262 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
263 font_sizes[FONT_SIZE_SMALL] = "9.0";
264 font_sizes[FONT_SIZE_NORMAL] = "10.0";
265 font_sizes[FONT_SIZE_LARGE] = "12.0";
266 font_sizes[FONT_SIZE_LARGER] = "14.4";
267 font_sizes[FONT_SIZE_LARGEST] = "17.26";
268 font_sizes[FONT_SIZE_HUGE] = "20.74";
269 font_sizes[FONT_SIZE_HUGER] = "24.88";
270 use_scalable_fonts = true;
271 roman_font_name = "";
273 typewriter_font_name = "";
275 auto_region_delete = true;
276 auto_reset_options = false;
277 plaintext_linelen = 65;
278 mouse_wheel_speed = 1.0;
279 num_lastfiles = maxlastfiles;
280 check_lastfiles = true;
281 use_lastfilepos = true;
282 load_session = false;
284 save_compressed = false;
285 backupdir_path.erase();
286 display_graphics = true;
287 // Spellchecker settings:
288 // FIXME: this check should test the target platform (darwin)
289 #if defined(USE_MACOSX_PACKAGING)
290 spellchecker = "native";
291 #elif defined(USE_ASPELL)
292 spellchecker = "aspell";
293 #elif defined(USE_HUNSPELL)
294 spellchecker = "hunspell";
296 spellchecker = "aspell";
298 spellchecker_accept_compound = false;
299 spellcheck_continuously = false;
300 spellcheck_notes = true;
303 visual_cursor = false;
305 mark_foreign_language = true;
306 language_auto_begin = true;
307 language_auto_end = true;
308 language_global_options = true;
309 language_use_babel = true;
310 language_package = "\\usepackage{babel}";
311 language_command_begin = "\\selectlanguage{$$lang}";
312 language_command_local = "\\foreignlanguage{$$lang}{";
313 sort_layouts = false;
314 group_layouts = true;
315 default_language = "english";
316 gui_language = "auto";
318 windows_style_tex_paths = false;
319 tex_allows_spaces = false;
320 date_insert_format = "%x";
321 cursor_follows_scrollbar = false;
322 scroll_below_document = false;
323 paragraph_markers = false;
324 mac_like_word_movement = false;
325 macro_edit_style = MACRO_EDIT_INLINE_BOX;
326 dialogs_iconify_with_main = false;
327 preview = PREVIEW_OFF;
328 preview_hashed_labels = false;
329 preview_scale_factor = 1.0;
330 use_converter_cache = true;
332 use_pixmap_cache = false;
333 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
334 user_name = to_utf8(support::user_name());
335 user_email = to_utf8(support::user_email());
336 open_buffers_in_tabs = true;
337 single_close_tab_button = false;
338 forward_search_dvi = string();
339 forward_search_pdf = string();
340 export_overwrite = NO_FILES;
342 // Fullscreen settings
343 full_screen_limit = false;
344 full_screen_toolbars = true;
345 full_screen_tabbar = true;
346 full_screen_menubar = true;
347 full_screen_scrollbar = true;
348 full_screen_width = 700;
350 completion_cursor_text = true;
351 completion_popup_math = true;
352 completion_popup_text = false;
353 completion_popup_delay = 2.0;
354 completion_popup_after_complete = true;
355 autocorrection_math = false;
356 completion_inline_math = true;
357 completion_inline_text = false;
358 completion_inline_dots = -1;
359 completion_inline_delay = 0.2;
360 default_decimal_point = ".";
366 void oldFontFormat(string & family, string & foundry)
368 if (family.empty() || family[0] != '-')
370 foundry = token(family, '-', 1);
371 family = token(family, '-', 2);
379 int LyXRC::read(FileName const & filename)
381 Lexer lexrc(lyxrcTags);
382 if (lyxerr.debugging(Debug::PARSER))
383 lexrc.printTable(lyxerr);
385 lexrc.setFile(filename);
389 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
395 int LyXRC::read(istream & is)
397 Lexer lexrc(lyxrcTags);
398 if (lyxerr.debugging(Debug::PARSER))
399 lexrc.printTable(lyxerr);
405 LYXERR(Debug::LYXRC, "Reading istream...");
411 int LyXRC::read(Lexer & lexrc)
416 while (lexrc.isOK()) {
417 // By using two switches we take advantage of the compiler
418 // telling us if we have missed a LyXRCTags element in
419 // the second switch.
420 // Note that this also shows a problem with Lexer since it
421 // helps us avoid taking advantage of the strictness of the
424 int le = lexrc.lex();
426 case Lexer::LEX_UNDEF:
427 lexrc.printError("Unknown tag `$$Token'");
429 case Lexer::LEX_FEOF:
434 switch (static_cast<LyXRCTags>(le)) {
435 case RC_INPUT: // Include file
438 libFileSearch(string(),
441 lexrc.printError("Error reading "
442 "included file: " + tmp.absFileName());
448 bind_file = os::internal_path(lexrc.getString());
453 def_file = os::internal_path(lexrc.getString());
458 ui_file = os::internal_path(lexrc.getString());
461 case RC_AUTORESET_OPTIONS:
462 lexrc >> auto_reset_options;
465 case RC_DISPLAY_GRAPHICS:
467 display_graphics = lexrc.getString() == "true";
470 case RC_TEX_EXPECTS_WINDOWS_PATHS:
471 lexrc >> windows_style_tex_paths;
474 case RC_TEX_ALLOWS_SPACES:
475 lexrc >> tex_allows_spaces;
482 case RC_KBMAP_PRIMARY:
484 string const kmap(os::internal_path(lexrc.getString()));
485 if (!libFileSearch("kbd", kmap, "kmap").empty()
487 primary_kbmap = kmap;
489 lexrc.printError("LyX: Keymap `$$Token' not found");
494 case RC_KBMAP_SECONDARY:
496 string const kmap(os::internal_path(lexrc.getString()));
497 if (!libFileSearch("kbd", kmap, "kmap").empty()
499 secondary_kbmap = kmap;
501 lexrc.printError("LyX: Keymap `$$Token' not found");
506 case RC_FONT_ENCODING:
514 case RC_PRINT_COMMAND:
515 if (lexrc.next(true)) {
516 print_command = lexrc.getString();
520 case RC_PRINTEVENPAGEFLAG:
521 lexrc >> print_evenpage_flag;
524 case RC_PRINTODDPAGEFLAG:
525 lexrc >> print_oddpage_flag;
528 case RC_PRINTPAGERANGEFLAG:
529 lexrc >> print_pagerange_flag;
532 case RC_PRINTCOPIESFLAG:
533 lexrc >> print_copies_flag;
536 case RC_PRINTCOLLCOPIESFLAG:
537 lexrc >> print_collcopies_flag;
540 case RC_PRINTREVERSEFLAG:
541 lexrc >> print_reverse_flag;
544 case RC_PRINTLANDSCAPEFLAG:
545 lexrc >> print_landscape_flag;
548 case RC_PRINTTOPRINTER:
549 lexrc >> print_to_printer;
552 case RC_PRINT_ADAPTOUTPUT:
553 lexrc >> print_adapt_output;
558 print_to_file = os::internal_path(lexrc.getString());
562 case RC_PRINTFILEEXTENSION:
563 lexrc >> print_file_extension;
566 case RC_PRINTEXSTRAOPTIONS:
567 lexrc >> print_extra_options;
570 case RC_PRINTSPOOL_COMMAND:
571 if (lexrc.next(true)) {
572 print_spool_command = lexrc.getString();
576 case RC_PRINTSPOOL_PRINTERPREFIX:
577 lexrc >> print_spool_printerprefix;
580 case RC_PRINTPAPERDIMENSIONFLAG:
581 lexrc >> print_paper_dimension_flag;
584 case RC_PRINTPAPERFLAG:
585 lexrc >> print_paper_flag;
588 case RC_DEFAULT_PAPERSIZE:
590 string const size = ascii_lowercase(lexrc.getString());
591 if (size == "usletter")
592 default_papersize = PAPER_USLETTER;
593 else if (size == "legal")
594 default_papersize = PAPER_USLEGAL;
595 else if (size == "executive")
596 default_papersize = PAPER_USEXECUTIVE;
597 else if (size == "a3")
598 default_papersize = PAPER_A3;
599 else if (size == "a4")
600 default_papersize = PAPER_A4;
601 else if (size == "a5")
602 default_papersize = PAPER_A5;
603 else if (size == "b5")
604 default_papersize = PAPER_B5;
605 else if (size == "default")
606 default_papersize = PAPER_DEFAULT;
610 case RC_VIEWDVI_PAPEROPTION:
612 view_dvi_paper_option = lexrc.getString();
614 view_dvi_paper_option.erase();
617 case RC_CHKTEX_COMMAND:
618 if (lexrc.next(true)) {
619 chktex_command = lexrc.getString();
623 case RC_BIBTEX_ALTERNATIVES:
624 if (lexrc.next(true)) {
625 bibtex_alternatives.insert(lexrc.getString());
629 case RC_BIBTEX_COMMAND:
630 if (lexrc.next(true)) {
631 bibtex_command = lexrc.getString();
635 case RC_JBIBTEX_COMMAND:
636 if (lexrc.next(true)) {
637 jbibtex_command = lexrc.getString();
641 case RC_INDEX_ALTERNATIVES:
642 if (lexrc.next(true)) {
643 index_alternatives.insert(lexrc.getString());
647 case RC_INDEX_COMMAND:
648 if (lexrc.next(true)) {
649 index_command = lexrc.getString();
653 case RC_JINDEX_COMMAND:
654 if (lexrc.next(true)) {
655 jindex_command = lexrc.getString();
659 case RC_SPLITINDEX_COMMAND:
660 if (lexrc.next(true)) {
661 splitindex_command = lexrc.getString();
665 case RC_NOMENCL_COMMAND:
666 if (lexrc.next(true)) {
667 nomencl_command = lexrc.getString();
679 case RC_GEOMETRY_SESSION:
680 lexrc >> allow_geometry_session;
683 case RC_SCREEN_FONT_SIZES:
684 lexrc >> font_sizes[FONT_SIZE_TINY];
685 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
686 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
687 lexrc >> font_sizes[FONT_SIZE_SMALL];
688 lexrc >> font_sizes[FONT_SIZE_NORMAL];
689 lexrc >> font_sizes[FONT_SIZE_LARGE];
690 lexrc >> font_sizes[FONT_SIZE_LARGER];
691 lexrc >> font_sizes[FONT_SIZE_LARGEST];
692 lexrc >> font_sizes[FONT_SIZE_HUGE];
693 lexrc >> font_sizes[FONT_SIZE_HUGER];
696 case RC_SCREEN_FONT_SCALABLE:
697 lexrc >> use_scalable_fonts;
704 case RC_DOCUMENTPATH:
706 document_path = os::internal_path(lexrc.getString());
707 document_path = expandPath(document_path);
713 example_path = os::internal_path(lexrc.getString());
714 example_path = expandPath(example_path);
718 case RC_TEMPLATEPATH:
720 template_path = os::internal_path(lexrc.getString());
721 template_path = expandPath(template_path);
727 tempdir_path = os::internal_path(lexrc.getString());
728 tempdir_path = expandPath(tempdir_path);
732 case RC_THESAURUSDIRPATH:
734 thesaurusdir_path = os::internal_path(lexrc.getString());
735 thesaurusdir_path = expandPath(thesaurusdir_path);
739 case RC_HUNSPELLDIR_PATH:
741 hunspelldir_path = os::internal_path(lexrc.getString());
742 hunspelldir_path = expandPath(hunspelldir_path);
746 case RC_USELASTFILEPOS:
747 lexrc >> use_lastfilepos;
751 lexrc >> load_session;
754 case RC_MOUSE_WHEEL_SPEED:
755 lexrc >> mouse_wheel_speed;
758 case RC_COMPLETION_INLINE_DELAY:
759 lexrc >> completion_inline_delay;
762 case RC_COMPLETION_INLINE_MATH:
763 lexrc >> completion_inline_math;
766 case RC_COMPLETION_INLINE_TEXT:
767 lexrc >> completion_inline_text;
770 case RC_COMPLETION_INLINE_DOTS:
771 lexrc >> completion_inline_dots;
774 case RC_AUTOCORRECTION_MATH:
775 lexrc >> autocorrection_math;
778 case RC_COMPLETION_POPUP_DELAY:
779 lexrc >> completion_popup_delay;
782 case RC_COMPLETION_POPUP_MATH:
783 lexrc >> completion_popup_math;
786 case RC_COMPLETION_POPUP_TEXT:
787 lexrc >> completion_popup_text;
790 case RC_COMPLETION_CURSOR_TEXT:
791 lexrc >> completion_cursor_text;
794 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
795 lexrc >> completion_popup_after_complete;
798 case RC_NUMLASTFILES:
799 lexrc >> num_lastfiles;
802 case RC_CHECKLASTFILES:
803 lexrc >> check_lastfiles;
806 case RC_SCREEN_FONT_ROMAN:
808 roman_font_name = lexrc.getString();
809 oldFontFormat(roman_font_name,
814 case RC_SCREEN_FONT_SANS:
816 sans_font_name = lexrc.getString();
817 oldFontFormat(sans_font_name, sans_font_foundry);
821 case RC_SCREEN_FONT_TYPEWRITER:
823 typewriter_font_name = lexrc.getString();
824 oldFontFormat(typewriter_font_name,
825 typewriter_font_foundry);
829 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
830 lexrc >> roman_font_foundry;
833 case RC_SCREEN_FONT_SANS_FOUNDRY:
834 lexrc >> sans_font_foundry;
837 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
838 lexrc >> typewriter_font_foundry;
843 lexrc.printError("Missing color tag.");
846 string lyx_name = lexrc.getString();
849 lexrc.printError("Missing color name for color: `$$Token'");
852 string x11_name = lexrc.getString();
854 ColorCode const col =
855 lcolor.getFromLyXName(lyx_name);
856 if (col == Color_none ||
857 col == Color_inherit ||
861 if (!lcolor.setColor(col, x11_name))
862 LYXERR0("Bad lyxrc set_color for " << lyx_name);
866 case RC_AUTOREGIONDELETE:
867 // Auto region delete defaults to true
868 lexrc >> auto_region_delete;
873 lyxpipes = os::internal_path(lexrc.getString());
874 lyxpipes = expandPath(lyxpipes);
878 case RC_CURSOR_FOLLOWS_SCROLLBAR:
879 lexrc >> cursor_follows_scrollbar;
882 case RC_SCROLL_BELOW_DOCUMENT:
883 lexrc >> scroll_below_document;
886 case RC_PARAGRAPH_MARKERS:
887 lexrc >> paragraph_markers;
890 case RC_MAC_LIKE_WORD_MOVEMENT:
891 lexrc >> mac_like_word_movement;
894 case RC_MACRO_EDIT_STYLE:
896 switch (lexrc.getInteger()) {
897 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
898 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
899 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
904 case RC_DIALOGS_ICONIFY_WITH_MAIN:
905 lexrc >> dialogs_iconify_with_main;
908 case RC_PLAINTEXT_LINELEN:
909 lexrc >> plaintext_linelen;
911 // Spellchecker settings:
912 case RC_ACCEPT_COMPOUND:
913 lexrc >> spellchecker_accept_compound;
916 lexrc >> use_tooltip;
918 case RC_USE_PIXMAP_CACHE:
919 lexrc >> use_pixmap_cache;
921 case RC_SPELLCHECKER:
922 lexrc >> spellchecker;
925 lexrc >> spellchecker_alt_lang;
928 lexrc >> spellchecker_esc_chars;
930 case RC_SPELLCHECK_CONTINUOUSLY:
931 lexrc >> spellcheck_continuously;
933 case RC_SPELLCHECK_NOTES:
934 lexrc >> spellcheck_notes;
937 lexrc >> make_backup;
939 case RC_SAVE_COMPRESSED:
940 lexrc >> save_compressed;
942 case RC_BACKUPDIR_PATH:
944 backupdir_path = os::internal_path(lexrc.getString());
945 backupdir_path = expandPath(backupdir_path);
948 case RC_DEFAULT_DECIMAL_POINT:
949 lexrc >> default_decimal_point;
951 case RC_DATE_INSERT_FORMAT:
952 lexrc >> date_insert_format;
954 case RC_LANGUAGE_PACKAGE:
955 lexrc >> language_package;
957 case RC_LANGUAGE_AUTO_BEGIN:
958 lexrc >> language_auto_begin;
960 case RC_LANGUAGE_AUTO_END:
961 lexrc >> language_auto_end;
963 case RC_LANGUAGE_GLOBAL_OPTIONS:
964 lexrc >> language_global_options;
966 case RC_LANGUAGE_USE_BABEL:
967 lexrc >> language_use_babel;
969 case RC_LANGUAGE_COMMAND_BEGIN:
970 lexrc >> language_command_begin;
972 case RC_LANGUAGE_COMMAND_END:
973 lexrc >> language_command_end;
975 case RC_LANGUAGE_COMMAND_LOCAL:
976 lexrc >> language_command_local;
979 lexrc >> rtl_support;
981 case RC_VISUAL_CURSOR:
982 lexrc >> visual_cursor;
985 lexrc >> auto_number;
987 case RC_MARK_FOREIGN_LANGUAGE:
988 lexrc >> mark_foreign_language;
994 fmt = lexrc.getString();
995 if (lexrc.next(true))
996 command = lexrc.getString();
997 setMover(fmt, command);
1001 case RC_CONVERTER: {
1002 string from, to, command, flags;
1004 from = lexrc.getString();
1006 to = lexrc.getString();
1007 if (lexrc.next(true))
1008 command = lexrc.getString();
1010 flags = lexrc.getString();
1011 if (command.empty())
1012 theConverters().erase(from, to);
1014 theConverters().add(from, to, command, flags);
1017 // compatibility with versions older than 1.4.0 only
1019 string format, command;
1020 lexrc >> format >> command;
1021 formats.setViewer(format, command);
1025 string format, extension, prettyname, shortcut;
1026 lexrc >> format >> extension >> prettyname >> shortcut;
1027 string viewer, editor;
1028 if (lexrc.next(true))
1029 viewer = lexrc.getString();
1030 if (lexrc.next(true))
1031 editor = lexrc.getString();
1033 // Hack to ensure compatibility with versions older
1035 int le = lexrc.lex();
1036 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1037 flags = lexrc.getString();
1038 if (le != Lexer::LEX_DATA) {
1039 // We have got a known token.
1040 // Therefore this is an old style
1041 // format definition without
1043 lexrc.pushToken(flags);
1047 int flgs = Format::none;
1048 while (!flags.empty()) {
1050 flags = split(flags, flag, ',');
1051 if (flag == "document")
1052 flgs |= Format::document;
1053 else if (flag == "vector")
1054 flgs |= Format::vector;
1056 LYXERR0("Ignoring unknown flag `"
1057 << flag << "' for format `"
1060 if (prettyname.empty()) {
1061 if (theConverters().formatIsUsed(format))
1062 LYXERR0("Can't delete format " << format);
1064 formats.erase(format);
1066 formats.add(format, extension, prettyname,
1067 shortcut, viewer, editor, flgs);
1071 case RC_VIEWER_ALTERNATIVES: {
1072 string format, command;
1074 format = lexrc.getString();
1075 if (lexrc.eatLine())
1076 command = lexrc.getString();
1077 viewer_alternatives[format].insert(command);
1080 case RC_EDITOR_ALTERNATIVES: {
1081 string format, command;
1082 lexrc >> format >> command;
1083 editor_alternatives[format].insert(command);
1087 case RC_DEFAULT_VIEW_FORMAT:
1088 lexrc >> default_view_format;
1091 case RC_DEFAULT_LANGUAGE:
1092 lexrc >> default_language;
1095 case RC_GUI_LANGUAGE:
1096 lexrc >> gui_language;
1099 case RC_SHOW_BANNER:
1100 lexrc >> show_banner;
1105 string const tmp = lexrc.getString();
1106 if (tmp == "true" || tmp == "on")
1107 preview = PREVIEW_ON;
1108 else if (tmp == "no_math")
1109 preview = PREVIEW_NO_MATH;
1111 preview = PREVIEW_OFF;
1112 if (tmp != "false" && tmp != "off")
1113 LYXERR0("Unrecognized preview status \""
1119 case RC_PREVIEW_HASHED_LABELS:
1120 lexrc >> preview_hashed_labels;
1123 case RC_PREVIEW_SCALE_FACTOR:
1124 lexrc >> preview_scale_factor;
1131 lexrc >> user_email;
1134 case RC_PATH_PREFIX:
1135 lexrc >> path_prefix;
1138 case RC_USE_CONVERTER_CACHE:
1139 lexrc >> use_converter_cache;
1141 case RC_CONVERTER_CACHE_MAXAGE:
1142 lexrc >> converter_cache_maxage;
1145 case RC_SORT_LAYOUTS:
1146 lexrc >> sort_layouts;
1148 case RC_GROUP_LAYOUTS:
1149 lexrc >> group_layouts;
1151 case RC_FULL_SCREEN_LIMIT:
1152 lexrc >> full_screen_limit;
1154 case RC_FULL_SCREEN_TOOLBARS:
1155 lexrc >> full_screen_toolbars;
1157 case RC_FULL_SCREEN_SCROLLBAR:
1158 lexrc >> full_screen_scrollbar;
1160 case RC_FULL_SCREEN_TABBAR:
1161 lexrc >> full_screen_tabbar;
1163 case RC_FULL_SCREEN_MENUBAR:
1164 lexrc >> full_screen_menubar;
1166 case RC_FULL_SCREEN_WIDTH:
1167 lexrc >> full_screen_width;
1169 case RC_OPEN_BUFFERS_IN_TABS:
1170 lexrc >> open_buffers_in_tabs;
1172 case RC_SINGLE_CLOSE_TAB_BUTTON:
1173 lexrc >> single_close_tab_button;
1175 case RC_FORWARD_SEARCH_DVI:
1176 if (lexrc.next(true))
1177 forward_search_dvi = lexrc.getString();
1179 case RC_FORWARD_SEARCH_PDF:
1180 if (lexrc.next(true))
1181 forward_search_pdf = lexrc.getString();
1183 case RC_EXPORT_OVERWRITE:
1185 string const tmp = lexrc.getString();
1186 if (tmp == "all" || tmp == "true")
1187 export_overwrite = ALL_FILES;
1188 else if (tmp == "main")
1189 export_overwrite = MAIN_FILE;
1191 export_overwrite = NO_FILES;
1192 if (tmp != "ask" && tmp != "false")
1193 LYXERR0("Unrecognized export_overwrite status \""
1199 // Obsoteted in 1.4.0
1202 case RC_SPELL_COMMAND:
1204 case RC_PLAINTEXT_ROFF_COMMAND:
1205 case RC_USE_ALT_LANG:
1206 case RC_USE_ESC_CHARS:
1207 case RC_USE_INP_ENC:
1208 case RC_USE_PERS_DICT:
1209 case RC_USE_SPELL_LIB:
1210 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1211 << lexrc.getString() << "'.");
1216 break; // this is just a dummy
1220 /// Update converters data-structures
1221 theConverters().update(formats);
1222 theConverters().buildGraph();
1228 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1230 ofstream ofs(filename.toFilesystemEncoding().c_str());
1232 write(ofs, ignore_system_lyxrc);
1236 void LyXRC::print() const
1238 if (lyxerr.debugging())
1239 write(lyxerr, false);
1247 typedef pair<string, SpecialisedMover> Data;
1249 SameMover(Data const & comparison)
1250 : comparison_(comparison) {}
1252 bool operator()(Data const & data) const
1254 return data.first == comparison_.first &&
1255 data.second.command() == comparison_.second.command();
1265 // Escape \ and " so that LyXLex can read the string later
1266 string escapeCommand(string const & str) {
1267 return subst(subst(str , "\\", "\\\\"),
1274 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1276 LyXRCTags tag = RC_LAST;
1278 if (!name.empty()) {
1279 for (int i = 0; i != lyxrcCount; ++i)
1280 if ("\\" + name == lyxrcTags[i].tag)
1281 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1285 os << "# LyX " << lyx_version
1286 << " generated this file. If you want to make your own\n"
1287 << "# modifications you should do them from inside LyX and save.\n"
1290 // Why the switch you might ask. It is a trick to ensure that all
1291 // the elements in the LyXRCTags enum are handled. As you can see
1292 // there are no breaks at all. So it is just a huge fall-through.
1293 // The nice thing is that we will get a warning from the compiler
1294 // if we forget an element.
1298 // input/include files are not done here
1300 if (ignore_system_lyxrc ||
1301 bind_file != system_lyxrc.bind_file) {
1302 string const path = os::external_path(bind_file);
1303 os << "\\bind_file \"" << path << "\"\n";
1309 if (ignore_system_lyxrc ||
1310 def_file != system_lyxrc.def_file) {
1311 string const path = os::external_path(def_file);
1312 os << "\\def_file \"" << path << "\"\n";
1321 << "# MISC SECTION ######################################\n"
1323 // bind files are not done here.
1325 case RC_PATH_PREFIX:
1326 if (ignore_system_lyxrc ||
1327 path_prefix != system_lyxrc.path_prefix) {
1328 os << "\\path_prefix \"" << path_prefix << "\"\n";
1333 if (ignore_system_lyxrc ||
1334 ui_file != system_lyxrc.ui_file) {
1335 string const path = os::external_path(ui_file);
1336 os << "\\ui_file \"" << path << "\"\n";
1340 case RC_AUTOREGIONDELETE:
1341 if (ignore_system_lyxrc ||
1342 auto_region_delete != system_lyxrc.auto_region_delete) {
1343 os << "# Set to false to inhibit automatic replacement of\n"
1344 << "# the current selection.\n"
1345 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1350 case RC_AUTORESET_OPTIONS:
1351 if (ignore_system_lyxrc ||
1352 auto_reset_options != system_lyxrc.auto_reset_options) {
1353 os << "# Set to false to inhibit automatic reset of\n"
1354 << "# the class options to defaults on class change.\n"
1355 << "\\auto_reset_options "
1356 << convert<string>(auto_reset_options)
1362 if (ignore_system_lyxrc ||
1363 autosave != system_lyxrc.autosave) {
1364 os << "# The time interval between auto-saves in seconds.\n"
1365 << "\\autosave " << autosave << '\n';
1369 case RC_DISPLAY_GRAPHICS:
1370 if (ignore_system_lyxrc ||
1371 display_graphics != system_lyxrc.display_graphics) {
1372 os << "# Display graphics within LyX\n"
1374 << "\\display_graphics "
1375 << (display_graphics ? "true" : "false")
1380 case RC_SORT_LAYOUTS:
1381 if (ignore_system_lyxrc ||
1382 sort_layouts != system_lyxrc.sort_layouts) {
1383 os << "# Sort layouts alphabetically.\n"
1384 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1388 case RC_GROUP_LAYOUTS:
1389 if (ignore_system_lyxrc ||
1390 group_layouts != system_lyxrc.group_layouts) {
1391 os << "# Group layouts by their category.\n"
1392 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1396 case RC_VIEWDVI_PAPEROPTION:
1397 if (ignore_system_lyxrc ||
1398 view_dvi_paper_option
1399 != system_lyxrc.view_dvi_paper_option) {
1400 os << "# Options used to specify paper size to the\n"
1401 << "# view_dvi_command (e.g. -paper)\n"
1402 << "\\view_dvi_paper_option \""
1403 << view_dvi_paper_option << "\"\n";
1407 case RC_DEFAULT_PAPERSIZE:
1408 if (ignore_system_lyxrc ||
1409 default_papersize != system_lyxrc.default_papersize) {
1410 os << "# The default papersize to use.\n"
1411 << "\\default_papersize \"";
1412 switch (default_papersize) {
1414 os << "default"; break;
1415 case PAPER_USLETTER:
1416 os << "usletter"; break;
1418 os << "legal"; break;
1419 case PAPER_USEXECUTIVE:
1420 os << "executive"; break;
1446 case PAPER_JISB6: break;
1452 case RC_CHKTEX_COMMAND:
1453 if (ignore_system_lyxrc ||
1454 chktex_command != system_lyxrc.chktex_command) {
1455 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1459 case RC_BIBTEX_ALTERNATIVES: {
1460 CommandSet::const_iterator it = bibtex_alternatives.begin();
1461 CommandSet::const_iterator end = bibtex_alternatives.end();
1462 for ( ; it != end; ++it) {
1463 if (ignore_system_lyxrc
1464 || !system_lyxrc.bibtex_alternatives.count(*it))
1465 os << "\\bibtex_alternatives \""
1471 case RC_BIBTEX_COMMAND:
1472 if (ignore_system_lyxrc ||
1473 bibtex_command != system_lyxrc.bibtex_command) {
1474 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1478 case RC_JBIBTEX_COMMAND:
1479 if (ignore_system_lyxrc ||
1480 jbibtex_command != system_lyxrc.jbibtex_command) {
1481 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1485 case RC_INDEX_ALTERNATIVES: {
1486 CommandSet::const_iterator it = index_alternatives.begin();
1487 CommandSet::const_iterator end = index_alternatives.end();
1488 for ( ; it != end; ++it) {
1489 if (ignore_system_lyxrc
1490 || !system_lyxrc.index_alternatives.count(*it))
1491 os << "\\index_alternatives \""
1497 case RC_INDEX_COMMAND:
1498 if (ignore_system_lyxrc ||
1499 index_command != system_lyxrc.index_command) {
1500 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1504 case RC_JINDEX_COMMAND:
1505 if (ignore_system_lyxrc ||
1506 jindex_command != system_lyxrc.jindex_command) {
1507 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1511 case RC_SPLITINDEX_COMMAND:
1512 if (ignore_system_lyxrc ||
1513 splitindex_command != system_lyxrc.splitindex_command) {
1514 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1518 case RC_NOMENCL_COMMAND:
1519 if (ignore_system_lyxrc ||
1520 nomencl_command != system_lyxrc.nomencl_command) {
1521 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1525 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1526 if (ignore_system_lyxrc ||
1527 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1528 os << "\\tex_expects_windows_paths "
1529 << convert<string>(windows_style_tex_paths) << '\n';
1533 case RC_TEX_ALLOWS_SPACES:
1534 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1535 os << "\\tex_allows_spaces "
1536 << convert<string>(tex_allows_spaces) << '\n';
1541 if (ignore_system_lyxrc ||
1542 use_kbmap != system_lyxrc.use_kbmap) {
1543 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1547 case RC_KBMAP_PRIMARY:
1548 if (ignore_system_lyxrc ||
1549 primary_kbmap != system_lyxrc.primary_kbmap) {
1550 string const path = os::external_path(primary_kbmap);
1551 os << "\\kbmap_primary \"" << path << "\"\n";
1555 case RC_KBMAP_SECONDARY:
1556 if (ignore_system_lyxrc ||
1557 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1558 string const path = os::external_path(secondary_kbmap);
1559 os << "\\kbmap_secondary \"" << path << "\"\n";
1564 if (ignore_system_lyxrc ||
1565 lyxpipes != system_lyxrc.lyxpipes) {
1566 string const path = os::external_path(lyxpipes);
1567 os << "\\serverpipe \"" << path << "\"\n";
1571 case RC_DATE_INSERT_FORMAT:
1572 if (ignore_system_lyxrc ||
1573 date_insert_format != system_lyxrc.date_insert_format) {
1574 os << "\\date_insert_format \"" << date_insert_format
1581 os << "\\user_name \"" << user_name << "\"\n";
1586 os << "\\user_email \"" << user_email << "\"\n";
1590 case RC_SHOW_BANNER:
1591 if (ignore_system_lyxrc ||
1592 show_banner != system_lyxrc.show_banner) {
1593 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1599 if (ignore_system_lyxrc ||
1600 preview != system_lyxrc.preview) {
1606 case PREVIEW_NO_MATH:
1613 os << "\\preview " << status << '\n';
1618 case RC_PREVIEW_HASHED_LABELS:
1619 if (ignore_system_lyxrc ||
1620 preview_hashed_labels !=
1621 system_lyxrc.preview_hashed_labels) {
1622 os << "\\preview_hashed_labels "
1623 << convert<string>(preview_hashed_labels) << '\n';
1628 case RC_PREVIEW_SCALE_FACTOR:
1629 if (ignore_system_lyxrc ||
1630 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1631 os << "\\preview_scale_factor "
1632 << preview_scale_factor << '\n';
1637 case RC_USE_CONVERTER_CACHE:
1638 if (ignore_system_lyxrc ||
1639 use_converter_cache != system_lyxrc.use_converter_cache) {
1640 os << "\\use_converter_cache "
1641 << convert<string>(use_converter_cache) << '\n';
1646 case RC_CONVERTER_CACHE_MAXAGE:
1647 if (ignore_system_lyxrc ||
1648 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1649 os << "\\converter_cache_maxage "
1650 << converter_cache_maxage << '\n';
1656 << "# SCREEN & FONTS SECTION ############################\n"
1660 if (ignore_system_lyxrc ||
1661 dpi != system_lyxrc.dpi) {
1662 os << "\\screen_dpi " << dpi << '\n';
1666 case RC_SCREEN_ZOOM:
1667 if (ignore_system_lyxrc ||
1668 zoom != system_lyxrc.zoom) {
1669 os << "\\screen_zoom " << zoom << '\n';
1673 case RC_GEOMETRY_SESSION:
1674 if (ignore_system_lyxrc ||
1675 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1676 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1681 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1682 if (ignore_system_lyxrc ||
1683 cursor_follows_scrollbar
1684 != system_lyxrc.cursor_follows_scrollbar) {
1685 os << "\\cursor_follows_scrollbar "
1686 << convert<string>(cursor_follows_scrollbar) << '\n';
1690 case RC_SCROLL_BELOW_DOCUMENT:
1691 if (ignore_system_lyxrc ||
1692 scroll_below_document
1693 != system_lyxrc.scroll_below_document) {
1694 os << "\\scroll_below_document "
1695 << convert<string>(scroll_below_document) << '\n';
1699 case RC_PARAGRAPH_MARKERS:
1700 if (ignore_system_lyxrc ||
1702 != system_lyxrc.paragraph_markers) {
1703 os << "\\paragraph_markers "
1704 << convert<string>(paragraph_markers) << '\n';
1708 case RC_MAC_LIKE_WORD_MOVEMENT:
1709 if (ignore_system_lyxrc ||
1710 mac_like_word_movement
1711 != system_lyxrc.mac_like_word_movement) {
1712 os << "\\mac_like_word_movement "
1713 << convert<string>(mac_like_word_movement) << '\n';
1717 case RC_MACRO_EDIT_STYLE:
1718 if (ignore_system_lyxrc ||
1720 != system_lyxrc.macro_edit_style) {
1721 os << "\\macro_edit_style ";
1722 switch (macro_edit_style) {
1723 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1724 case MACRO_EDIT_INLINE: os << "1\n"; break;
1725 case MACRO_EDIT_LIST: os << "2\n"; break;
1730 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1731 if (ignore_system_lyxrc ||
1732 dialogs_iconify_with_main
1733 != system_lyxrc.dialogs_iconify_with_main) {
1734 os << "\\dialogs_iconify_with_main "
1735 << convert<string>(dialogs_iconify_with_main) << '\n';
1739 case RC_SCREEN_FONT_ROMAN:
1740 if (ignore_system_lyxrc ||
1741 roman_font_name != system_lyxrc.roman_font_name) {
1742 os << "\\screen_font_roman \"" << roman_font_name
1747 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1748 if (ignore_system_lyxrc ||
1749 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1750 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1755 case RC_SCREEN_FONT_SANS:
1756 if (ignore_system_lyxrc ||
1757 sans_font_name != system_lyxrc.sans_font_name) {
1758 os << "\\screen_font_sans \"" << sans_font_name
1763 case RC_SCREEN_FONT_SANS_FOUNDRY:
1764 if (ignore_system_lyxrc ||
1765 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1766 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1771 case RC_SCREEN_FONT_TYPEWRITER:
1772 if (ignore_system_lyxrc ||
1773 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1774 os << "\\screen_font_typewriter \""
1775 << typewriter_font_name << "\"\n";
1779 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1780 if (ignore_system_lyxrc ||
1781 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1782 os << "\\screen_font_typewriter_foundry \""
1783 << typewriter_font_foundry << "\"\n";
1788 case RC_SCREEN_FONT_SCALABLE:
1789 if (ignore_system_lyxrc ||
1790 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1791 os << "\\screen_font_scalable "
1792 << convert<string>(use_scalable_fonts)
1797 case RC_SCREEN_FONT_SIZES:
1798 if (ignore_system_lyxrc ||
1799 font_sizes[FONT_SIZE_TINY]
1800 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1801 font_sizes[FONT_SIZE_SCRIPT]
1802 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1803 font_sizes[FONT_SIZE_FOOTNOTE]
1804 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1805 font_sizes[FONT_SIZE_SMALL]
1806 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1807 font_sizes[FONT_SIZE_NORMAL]
1808 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1809 font_sizes[FONT_SIZE_LARGE]
1810 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1811 font_sizes[FONT_SIZE_LARGER]
1812 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1813 font_sizes[FONT_SIZE_LARGEST]
1814 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1815 font_sizes[FONT_SIZE_HUGE]
1816 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1817 font_sizes[FONT_SIZE_HUGER]
1818 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1819 os.setf(ios::fixed);
1821 os << "\\screen_font_sizes"
1822 << ' ' << font_sizes[FONT_SIZE_TINY]
1823 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1824 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1825 << ' ' << font_sizes[FONT_SIZE_SMALL]
1826 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1827 << ' ' << font_sizes[FONT_SIZE_LARGE]
1828 << ' ' << font_sizes[FONT_SIZE_LARGER]
1829 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1830 << ' ' << font_sizes[FONT_SIZE_HUGE]
1831 << ' ' << font_sizes[FONT_SIZE_HUGER]
1836 case RC_FULL_SCREEN_LIMIT:
1837 if (ignore_system_lyxrc ||
1838 full_screen_limit != system_lyxrc.full_screen_limit) {
1839 os << "\\fullscreen_limit "
1840 << convert<string>(full_screen_limit)
1845 case RC_FULL_SCREEN_TOOLBARS:
1846 if (ignore_system_lyxrc ||
1847 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1848 os << "\\fullscreen_toolbars "
1849 << convert<string>(full_screen_toolbars)
1854 case RC_FULL_SCREEN_SCROLLBAR:
1855 if (ignore_system_lyxrc ||
1856 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1857 os << "\\fullscreen_scrollbar "
1858 << convert<string>(full_screen_scrollbar)
1863 case RC_FULL_SCREEN_TABBAR:
1864 if (ignore_system_lyxrc ||
1865 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1866 os << "\\fullscreen_tabbar "
1867 << convert<string>(full_screen_tabbar)
1872 case RC_FULL_SCREEN_MENUBAR:
1873 if (ignore_system_lyxrc ||
1874 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1875 os << "\\fullscreen_menubar "
1876 << convert<string>(full_screen_menubar)
1881 case RC_FULL_SCREEN_WIDTH:
1882 if (ignore_system_lyxrc ||
1883 full_screen_width != system_lyxrc.full_screen_width) {
1884 os << "\\fullscreen_width "
1885 << convert<string>(full_screen_width)
1890 case RC_OPEN_BUFFERS_IN_TABS:
1891 if (ignore_system_lyxrc ||
1892 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1893 os << "\\open_buffers_in_tabs "
1894 << convert<string>(open_buffers_in_tabs)
1899 case RC_SINGLE_CLOSE_TAB_BUTTON:
1900 if (ignore_system_lyxrc ||
1901 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1902 os << "\\single_close_tab_button "
1903 << convert<string>(single_close_tab_button)
1908 case RC_FORWARD_SEARCH_DVI:
1909 if (ignore_system_lyxrc ||
1910 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1911 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1915 case RC_FORWARD_SEARCH_PDF:
1916 if (ignore_system_lyxrc ||
1917 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1918 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1924 << "# COLOR SECTION ###################################\n"
1928 for (int i = 0; i < Color_ignore; ++i) {
1929 ColorCode lc = static_cast<ColorCode>(i);
1930 string const col = lcolor.getX11Name(lc);
1931 if (ignore_system_lyxrc
1932 || col != system_lcolor.getX11Name(lc)) {
1933 os << "\\set_color \""
1934 << lcolor.getLyXName(lc) << "\" \""
1942 << "# PRINTER SECTION ###################################\n"
1946 if (ignore_system_lyxrc ||
1947 printer != system_lyxrc.printer) {
1948 os << "\\printer \"" << printer << "\"\n";
1952 case RC_PRINT_ADAPTOUTPUT:
1953 if (ignore_system_lyxrc ||
1954 print_adapt_output != system_lyxrc.print_adapt_output) {
1955 os << "\\print_adapt_output "
1956 << convert<string>(print_adapt_output)
1961 case RC_PRINT_COMMAND:
1962 if (ignore_system_lyxrc ||
1963 print_command != system_lyxrc.print_command) {
1964 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1968 case RC_PRINTEXSTRAOPTIONS:
1969 if (ignore_system_lyxrc ||
1970 print_extra_options != system_lyxrc.print_extra_options) {
1971 os << "\\print_extra_options \"" << print_extra_options
1976 case RC_PRINTSPOOL_COMMAND:
1977 if (ignore_system_lyxrc ||
1978 print_spool_command != system_lyxrc.print_spool_command) {
1979 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1984 case RC_PRINTSPOOL_PRINTERPREFIX:
1985 if (ignore_system_lyxrc ||
1986 print_spool_printerprefix
1987 != system_lyxrc.print_spool_printerprefix) {
1988 os << "\\print_spool_printerprefix \""
1989 << print_spool_printerprefix << "\"\n";
1993 case RC_PRINTEVENPAGEFLAG:
1994 if (ignore_system_lyxrc ||
1995 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1996 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2001 case RC_PRINTODDPAGEFLAG:
2002 if (ignore_system_lyxrc ||
2003 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2004 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2009 case RC_PRINTREVERSEFLAG:
2010 if (ignore_system_lyxrc ||
2011 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2012 os << "\\print_reverse_flag \"" << print_reverse_flag
2017 case RC_PRINTLANDSCAPEFLAG:
2018 if (ignore_system_lyxrc ||
2019 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2020 os << "\\print_landscape_flag \"" << print_landscape_flag
2025 case RC_PRINTPAGERANGEFLAG:
2026 if (ignore_system_lyxrc ||
2027 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2028 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2033 case RC_PRINTCOPIESFLAG:
2034 if (ignore_system_lyxrc ||
2035 print_copies_flag != system_lyxrc.print_copies_flag) {
2036 os << "\\print_copies_flag \"" << print_copies_flag
2041 case RC_PRINTCOLLCOPIESFLAG:
2042 if (ignore_system_lyxrc ||
2043 print_collcopies_flag
2044 != system_lyxrc.print_collcopies_flag) {
2045 os << "\\print_collcopies_flag \""
2046 << print_collcopies_flag
2051 case RC_PRINTPAPERFLAG:
2052 if (ignore_system_lyxrc ||
2053 print_paper_flag != system_lyxrc.print_paper_flag) {
2054 os << "\\print_paper_flag \"" << print_paper_flag
2059 case RC_PRINTPAPERDIMENSIONFLAG:
2060 if (ignore_system_lyxrc ||
2061 print_paper_dimension_flag
2062 != system_lyxrc.print_paper_dimension_flag) {
2063 os << "\\print_paper_dimension_flag \""
2064 << print_paper_dimension_flag << "\"\n";
2068 case RC_PRINTTOPRINTER:
2069 if (ignore_system_lyxrc ||
2070 print_to_printer != system_lyxrc.print_to_printer) {
2071 os << "\\print_to_printer \"" << print_to_printer
2076 case RC_PRINTTOFILE:
2077 if (ignore_system_lyxrc ||
2078 print_to_file != system_lyxrc.print_to_file) {
2079 string const path = os::external_path(print_to_file);
2080 os << "\\print_to_file \"" << path << "\"\n";
2084 case RC_PRINTFILEEXTENSION:
2085 if (ignore_system_lyxrc ||
2086 print_file_extension != system_lyxrc.print_file_extension) {
2087 os << "\\print_file_extension \""
2088 << print_file_extension
2095 << "# TEX SECTION #######################################\n"
2098 case RC_FONT_ENCODING:
2099 if (ignore_system_lyxrc ||
2100 fontenc != system_lyxrc.fontenc) {
2101 os << "\\font_encoding \"" << fontenc << "\"\n";
2107 << "# FILE SECTION ######################################\n"
2110 case RC_DOCUMENTPATH:
2111 if (ignore_system_lyxrc ||
2112 document_path != system_lyxrc.document_path) {
2113 string const path = os::external_path(document_path);
2114 os << "\\document_path \"" << path << "\"\n";
2118 case RC_USELASTFILEPOS:
2119 if (ignore_system_lyxrc ||
2120 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2121 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2126 case RC_LOADSESSION:
2127 if (ignore_system_lyxrc ||
2128 load_session != system_lyxrc.load_session) {
2129 os << "\\load_session " << convert<string>(load_session)
2134 case RC_MOUSE_WHEEL_SPEED:
2135 if (ignore_system_lyxrc ||
2136 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2137 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2141 case RC_COMPLETION_INLINE_DELAY:
2142 if (ignore_system_lyxrc ||
2143 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2144 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2148 case RC_COMPLETION_INLINE_MATH:
2149 if (ignore_system_lyxrc ||
2150 completion_inline_math != system_lyxrc.completion_inline_math) {
2151 os << "\\completion_inline_math "
2152 << convert<string>(completion_inline_math) << '\n';
2156 case RC_COMPLETION_INLINE_TEXT:
2157 if (ignore_system_lyxrc ||
2158 completion_inline_text != system_lyxrc.completion_inline_text) {
2159 os << "\\completion_inline_text "
2160 << convert<string>(completion_inline_text) << '\n';
2164 case RC_COMPLETION_INLINE_DOTS:
2165 if (ignore_system_lyxrc ||
2166 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2167 os << "\\completion_inline_dots "
2168 << convert<string>(completion_inline_dots) << '\n';
2172 case RC_AUTOCORRECTION_MATH:
2173 if (ignore_system_lyxrc ||
2174 autocorrection_math != system_lyxrc.autocorrection_math) {
2175 os << "\\autocorrection_math "
2176 << convert<string>(autocorrection_math) << '\n';
2180 case RC_COMPLETION_POPUP_DELAY:
2181 if (ignore_system_lyxrc ||
2182 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2183 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2187 case RC_COMPLETION_POPUP_MATH:
2188 if (ignore_system_lyxrc ||
2189 completion_popup_math != system_lyxrc.completion_popup_math) {
2190 os << "\\completion_popup_math "
2191 << convert<string>(completion_popup_math) << '\n';
2195 case RC_COMPLETION_POPUP_TEXT:
2196 if (ignore_system_lyxrc ||
2197 completion_popup_text != system_lyxrc.completion_popup_text) {
2198 os << "\\completion_popup_text "
2199 << convert<string>(completion_popup_text) << '\n';
2203 case RC_COMPLETION_CURSOR_TEXT:
2204 if (ignore_system_lyxrc ||
2205 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2206 os << "\\completion_cursor_text "
2207 << convert<string>(completion_cursor_text) << '\n';
2211 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2212 if (ignore_system_lyxrc ||
2213 completion_popup_after_complete
2214 != system_lyxrc.completion_popup_after_complete) {
2215 os << "\\completion_popup_after_complete "
2216 << convert<string>(completion_popup_after_complete) << '\n';
2220 case RC_NUMLASTFILES:
2221 if (ignore_system_lyxrc ||
2222 num_lastfiles != system_lyxrc.num_lastfiles) {
2223 os << "\\num_lastfiles " << num_lastfiles << '\n';
2227 case RC_CHECKLASTFILES:
2228 if (ignore_system_lyxrc ||
2229 check_lastfiles != system_lyxrc.check_lastfiles) {
2230 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2235 case RC_EXAMPLEPATH:
2236 if (ignore_system_lyxrc ||
2237 example_path != system_lyxrc.example_path) {
2238 string const path = os::external_path(example_path);
2239 os << "\\example_path \"" << path << "\"\n";
2243 case RC_TEMPLATEPATH:
2244 if (ignore_system_lyxrc ||
2245 template_path != system_lyxrc.template_path) {
2246 string const path = os::external_path(template_path);
2247 os << "\\template_path \"" << path << "\"\n";
2251 case RC_TEMPDIRPATH:
2252 if (ignore_system_lyxrc ||
2253 tempdir_path != system_lyxrc.tempdir_path) {
2254 string const path = os::external_path(tempdir_path);
2255 os << "\\tempdir_path \"" << path << "\"\n";
2259 case RC_THESAURUSDIRPATH:
2260 if (ignore_system_lyxrc ||
2261 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2262 string const path = os::external_path(thesaurusdir_path);
2263 os << "\\thesaurusdir_path \"" << path << "\"\n";
2267 case RC_HUNSPELLDIR_PATH:
2268 if (ignore_system_lyxrc ||
2269 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2270 string const path = os::external_path(hunspelldir_path);
2271 os << "\\hunspelldir_path \"" << path << "\"\n";
2279 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2282 case RC_PLAINTEXT_LINELEN:
2283 if (ignore_system_lyxrc ||
2284 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2285 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2289 case RC_MAKE_BACKUP:
2290 if (ignore_system_lyxrc ||
2291 make_backup != system_lyxrc.make_backup) {
2292 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2296 case RC_SAVE_COMPRESSED:
2297 if (ignore_system_lyxrc ||
2298 save_compressed != system_lyxrc.save_compressed) {
2299 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2303 case RC_BACKUPDIR_PATH:
2304 if (ignore_system_lyxrc ||
2305 backupdir_path != system_lyxrc.backupdir_path) {
2306 string const path = os::external_path(backupdir_path);
2307 os << "\\backupdir_path \"" << path << "\"\n";
2313 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2317 << "# SPELLCHECKER SECTION ##############################\n"
2320 case RC_SPELL_COMMAND:
2321 case RC_USE_SPELL_LIB:
2325 case RC_ACCEPT_COMPOUND:
2326 if (ignore_system_lyxrc ||
2327 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2328 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2333 case RC_USE_ALT_LANG:
2338 if (ignore_system_lyxrc ||
2339 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2340 os << "\\alternate_language \"" << spellchecker_alt_lang
2345 case RC_USE_ESC_CHARS:
2349 if (ignore_system_lyxrc ||
2350 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2351 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2355 case RC_USE_PERS_DICT:
2359 case RC_USE_TOOLTIP:
2360 if (ignore_system_lyxrc ||
2361 use_tooltip != system_lyxrc.use_tooltip) {
2362 os << "\\use_tooltip "
2363 << convert<string>(use_tooltip)
2368 case RC_USE_PIXMAP_CACHE:
2369 if (ignore_system_lyxrc ||
2370 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2371 os << "\\use_pixmap_cache "
2372 << convert<string>(use_pixmap_cache)
2381 case RC_USE_INP_ENC:
2387 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2392 case RC_DEFAULT_DECIMAL_POINT:
2393 if (ignore_system_lyxrc ||
2394 default_decimal_point != system_lyxrc.default_decimal_point) {
2395 os << "\\default_decimal_point " << default_decimal_point << '\n';
2400 case RC_SPELLCHECKER:
2401 if (ignore_system_lyxrc ||
2402 spellchecker != system_lyxrc.spellchecker) {
2403 os << "\\spellchecker " << spellchecker << '\n';
2408 case RC_SPELLCHECK_CONTINUOUSLY:
2409 if (ignore_system_lyxrc ||
2410 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2411 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2417 case RC_SPELLCHECK_NOTES:
2418 if (ignore_system_lyxrc ||
2419 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2420 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2426 case RC_RTL_SUPPORT:
2427 if (ignore_system_lyxrc ||
2428 rtl_support != system_lyxrc.rtl_support) {
2429 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2433 case RC_VISUAL_CURSOR:
2434 if (ignore_system_lyxrc ||
2435 visual_cursor != system_lyxrc.visual_cursor) {
2436 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2440 case RC_LANGUAGE_PACKAGE:
2441 if (ignore_system_lyxrc ||
2442 language_package != system_lyxrc.language_package) {
2443 os << "\\language_package \"" << language_package
2448 case RC_LANGUAGE_GLOBAL_OPTIONS:
2449 if (ignore_system_lyxrc ||
2450 language_global_options
2451 != system_lyxrc.language_global_options) {
2452 os << "\\language_global_options \""
2453 << convert<string>(language_global_options)
2458 case RC_LANGUAGE_USE_BABEL:
2459 if (ignore_system_lyxrc ||
2460 language_use_babel != system_lyxrc.language_use_babel) {
2461 os << "\\language_use_babel \""
2462 << convert<string>(language_use_babel)
2467 case RC_LANGUAGE_COMMAND_BEGIN:
2468 if (ignore_system_lyxrc ||
2469 language_command_begin
2470 != system_lyxrc.language_command_begin) {
2471 os << "\\language_command_begin \""
2472 << language_command_begin
2477 case RC_LANGUAGE_COMMAND_END:
2478 if (ignore_system_lyxrc ||
2479 language_command_end
2480 != system_lyxrc.language_command_end) {
2481 os << "\\language_command_end \"" << language_command_end
2486 case RC_LANGUAGE_COMMAND_LOCAL:
2487 if (ignore_system_lyxrc ||
2488 language_command_local
2489 != system_lyxrc.language_command_local) {
2490 os << "\\language_command_local \""
2491 << language_command_local
2496 case RC_LANGUAGE_AUTO_BEGIN:
2497 if (ignore_system_lyxrc ||
2498 language_auto_begin != system_lyxrc.language_auto_begin) {
2499 os << "\\language_auto_begin "
2500 << convert<string>(language_auto_begin) << '\n';
2504 case RC_LANGUAGE_AUTO_END:
2505 if (ignore_system_lyxrc ||
2506 language_auto_end != system_lyxrc.language_auto_end) {
2507 os << "\\language_auto_end "
2508 << convert<string>(language_auto_end) << '\n';
2512 case RC_MARK_FOREIGN_LANGUAGE:
2513 if (ignore_system_lyxrc ||
2514 mark_foreign_language
2515 != system_lyxrc.mark_foreign_language) {
2516 os << "\\mark_foreign_language " <<
2517 convert<string>(mark_foreign_language) << '\n';
2523 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2526 case RC_AUTO_NUMBER:
2527 if (ignore_system_lyxrc ||
2528 auto_number != system_lyxrc.auto_number) {
2529 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2533 case RC_DEFAULT_LANGUAGE:
2534 if (ignore_system_lyxrc ||
2535 default_language != system_lyxrc.default_language) {
2536 os << "\\default_language " << default_language << '\n';
2540 case RC_GUI_LANGUAGE:
2541 if (ignore_system_lyxrc ||
2542 gui_language != system_lyxrc.gui_language) {
2543 os << "\\gui_language " << gui_language << '\n';
2547 case RC_EXPORT_OVERWRITE:
2548 if (ignore_system_lyxrc ||
2549 export_overwrite != system_lyxrc.export_overwrite) {
2551 switch (export_overwrite) {
2562 os << "\\export_overwrite " << status << '\n';
2568 << "# FORMATS SECTION ##########################\n"
2572 // New/modified formats
2573 for (Formats::const_iterator cit = formats.begin();
2574 cit != formats.end(); ++cit) {
2575 Format const * format =
2576 system_formats.getFormat(cit->name());
2578 format->extension() != cit->extension() ||
2579 format->prettyname() != cit->prettyname() ||
2580 format->shortcut() != cit->shortcut() ||
2581 format->viewer() != cit->viewer() ||
2582 format->editor() != cit->editor() ||
2583 format->documentFormat() != cit->documentFormat() ||
2584 format->vectorFormat() != cit->vectorFormat()) {
2585 os << "\\format \"" << cit->name() << "\" \""
2586 << cit->extension() << "\" \""
2587 << cit->prettyname() << "\" \""
2588 << cit->shortcut() << "\" \""
2589 << escapeCommand(cit->viewer()) << "\" \""
2590 << escapeCommand(cit->editor()) << "\" \"";
2591 vector<string> flags;
2592 if (cit->documentFormat())
2593 flags.push_back("document");
2594 if (cit->vectorFormat())
2595 flags.push_back("vector");
2596 os << getStringFromVector(flags);
2601 // Look for deleted formats
2602 for (Formats::const_iterator cit = system_formats.begin();
2603 cit != system_formats.end(); ++cit)
2604 if (!formats.getFormat(cit->name()))
2605 os << "\\format \"" << cit->name()
2606 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2609 case RC_VIEWER_ALTERNATIVES: {
2610 Alternatives::const_iterator it = viewer_alternatives.begin();
2611 Alternatives::const_iterator const en = viewer_alternatives.end();
2612 Alternatives::const_iterator const sysend =
2613 system_lyxrc.viewer_alternatives.end();
2614 for (; it != en; ++it) {
2615 string const & fmt = it->first;
2616 CommandSet const & cmd = it->second;
2617 CommandSet::const_iterator sit = cmd.begin();
2618 CommandSet::const_iterator const sen = cmd.end();
2619 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2620 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2621 system_lyxrc.viewer_alternatives.find(fmt);
2622 for (; sit != sen; ++sit) {
2623 string const & cmd = *sit;
2624 if (ignore_system_lyxrc
2625 || sysfmt == sysend // format not found
2626 || sysfmt->second.count(cmd) == 0 // this command not found
2628 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2634 case RC_EDITOR_ALTERNATIVES: {
2635 Alternatives::const_iterator it = editor_alternatives.begin();
2636 Alternatives::const_iterator const en = editor_alternatives.end();
2637 Alternatives::const_iterator const sysend =
2638 system_lyxrc.editor_alternatives.end();
2639 for (; it != en; ++it) {
2640 string const & fmt = it->first;
2641 CommandSet const & cmd = it->second;
2642 CommandSet::const_iterator sit = cmd.begin();
2643 CommandSet::const_iterator const sen = cmd.end();
2644 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2645 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2646 system_lyxrc.editor_alternatives.find(fmt);
2647 for (; sit != sen; ++sit) {
2648 string const & cmd = *sit;
2649 if (ignore_system_lyxrc
2650 || sysfmt == sysend // format not found
2651 || sysfmt->second.count(cmd) == 0 // this command not found
2653 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2659 case RC_DEFAULT_VIEW_FORMAT:
2660 if (ignore_system_lyxrc ||
2661 default_view_format != system_lyxrc.default_view_format) {
2662 os << "\\default_view_format " << default_view_format << '\n';
2672 << "# CONVERTERS SECTION ##########################\n"
2676 // Look for new converters
2677 for (Converters::const_iterator cit = theConverters().begin();
2678 cit != theConverters().end(); ++cit) {
2679 Converter const * converter =
2680 theSystemConverters().getConverter(cit->from,
2683 converter->command != cit->command ||
2684 converter->flags != cit->flags)
2685 os << "\\converter \"" << cit->from << "\" \""
2686 << cit->to << "\" \""
2687 << escapeCommand(cit->command) << "\" \""
2688 << cit->flags << "\"\n";
2691 // New/modifed converters
2692 for (Converters::const_iterator cit = theSystemConverters().begin();
2693 cit != theSystemConverters().end(); ++cit)
2694 if (!theConverters().getConverter(cit->from, cit->to))
2695 os << "\\converter \"" << cit->from
2696 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2703 << "# COPIERS SECTION ##########################\n"
2706 // Look for new movers
2707 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2708 Movers::const_iterator const sysend = theSystemMovers().end();
2709 Movers::const_iterator it = theMovers().begin();
2710 Movers::const_iterator end = theMovers().end();
2712 for (; it != end; ++it) {
2713 Movers::const_iterator const sysit =
2714 find_if(sysbegin, sysend, SameMover(*it));
2715 if (sysit == sysend) {
2716 string const & fmt = it->first;
2717 string const & command =
2718 it->second.command();
2720 os << "\\copier " << fmt
2721 << " \"" << escapeCommand(command) << "\"\n";
2727 // We don't actually delete SpecialisedMover(s) from the
2728 // map, just clear their 'command', so there's no need
2729 // to test for anything else.
2736 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2738 // Why the switch you might ask. It is a trick to ensure that all
2739 // the elements in the LyXRCTags enum is handled. As you can see
2740 // there are no breaks at all. So it is just a huge fall-through.
2741 // The nice thing is that we will get a warning from the compiler
2742 // if we forget an element.
2743 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2745 case LyXRC::RC_ACCEPT_COMPOUND:
2746 case LyXRC::RC_ALT_LANG:
2747 case LyXRC::RC_PLAINTEXT_LINELEN:
2748 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2749 case LyXRC::RC_AUTOCORRECTION_MATH:
2750 case LyXRC::RC_AUTOREGIONDELETE:
2751 case LyXRC::RC_AUTORESET_OPTIONS:
2752 case LyXRC::RC_AUTOSAVE:
2753 case LyXRC::RC_AUTO_NUMBER:
2754 case LyXRC::RC_BACKUPDIR_PATH:
2755 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2756 case LyXRC::RC_BIBTEX_COMMAND:
2757 case LyXRC::RC_BINDFILE:
2758 case LyXRC::RC_CHECKLASTFILES:
2759 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2760 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2761 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2762 case LyXRC::RC_COMPLETION_INLINE_MATH:
2763 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2764 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2765 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2766 case LyXRC::RC_COMPLETION_POPUP_MATH:
2767 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2768 case LyXRC::RC_USELASTFILEPOS:
2769 case LyXRC::RC_LOADSESSION:
2770 case LyXRC::RC_CHKTEX_COMMAND:
2771 case LyXRC::RC_CONVERTER:
2772 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2773 case LyXRC::RC_COPIER:
2774 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2775 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2776 case LyXRC::RC_DATE_INSERT_FORMAT:
2777 case LyXRC::RC_DEFAULT_LANGUAGE:
2778 case LyXRC::RC_GUI_LANGUAGE:
2779 case LyXRC::RC_DEFAULT_PAPERSIZE:
2780 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2781 case LyXRC::RC_DEFFILE:
2782 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2783 case LyXRC::RC_DISPLAY_GRAPHICS:
2784 case LyXRC::RC_DOCUMENTPATH:
2785 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2786 FileName path(lyxrc_new.document_path);
2787 if (path.exists() && path.isDirectory())
2788 package().document_dir() = FileName(lyxrc.document_path);
2790 case LyXRC::RC_EDITOR_ALTERNATIVES:
2791 case LyXRC::RC_ESC_CHARS:
2792 case LyXRC::RC_EXAMPLEPATH:
2793 case LyXRC::RC_FONT_ENCODING:
2794 case LyXRC::RC_FORMAT:
2795 case LyXRC::RC_GROUP_LAYOUTS:
2796 case LyXRC::RC_HUNSPELLDIR_PATH:
2797 case LyXRC::RC_INDEX_ALTERNATIVES:
2798 case LyXRC::RC_INDEX_COMMAND:
2799 case LyXRC::RC_JBIBTEX_COMMAND:
2800 case LyXRC::RC_JINDEX_COMMAND:
2801 case LyXRC::RC_NOMENCL_COMMAND:
2802 case LyXRC::RC_INPUT:
2803 case LyXRC::RC_KBMAP:
2804 case LyXRC::RC_KBMAP_PRIMARY:
2805 case LyXRC::RC_KBMAP_SECONDARY:
2806 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2807 case LyXRC::RC_LANGUAGE_AUTO_END:
2808 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2809 case LyXRC::RC_LANGUAGE_COMMAND_END:
2810 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2811 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2812 case LyXRC::RC_LANGUAGE_PACKAGE:
2813 case LyXRC::RC_LANGUAGE_USE_BABEL:
2814 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2815 case LyXRC::RC_MACRO_EDIT_STYLE:
2816 case LyXRC::RC_MAKE_BACKUP:
2817 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2818 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2819 case LyXRC::RC_NUMLASTFILES:
2820 case LyXRC::RC_PARAGRAPH_MARKERS:
2821 case LyXRC::RC_PATH_PREFIX:
2822 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2823 prependEnvPath("PATH", lyxrc.path_prefix);
2825 case LyXRC::RC_PERS_DICT:
2826 case LyXRC::RC_PREVIEW:
2827 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2828 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2829 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2830 case LyXRC::RC_PRINTCOPIESFLAG:
2831 case LyXRC::RC_PRINTER:
2832 case LyXRC::RC_PRINTEVENPAGEFLAG:
2833 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2834 case LyXRC::RC_PRINTFILEEXTENSION:
2835 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2836 case LyXRC::RC_PRINTODDPAGEFLAG:
2837 case LyXRC::RC_PRINTPAGERANGEFLAG:
2838 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2839 case LyXRC::RC_PRINTPAPERFLAG:
2840 case LyXRC::RC_PRINTREVERSEFLAG:
2841 case LyXRC::RC_PRINTSPOOL_COMMAND:
2842 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2843 case LyXRC::RC_PRINTTOFILE:
2844 case LyXRC::RC_PRINTTOPRINTER:
2845 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2846 case LyXRC::RC_PRINT_COMMAND:
2847 case LyXRC::RC_RTL_SUPPORT:
2848 case LyXRC::RC_SAVE_COMPRESSED:
2849 case LyXRC::RC_SCREEN_DPI:
2850 case LyXRC::RC_SCREEN_FONT_ROMAN:
2851 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2852 case LyXRC::RC_SCREEN_FONT_SANS:
2853 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2854 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2855 case LyXRC::RC_SCREEN_FONT_SIZES:
2856 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2857 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2858 case LyXRC::RC_GEOMETRY_SESSION:
2859 case LyXRC::RC_SCREEN_ZOOM:
2860 case LyXRC::RC_SERVERPIPE:
2861 case LyXRC::RC_SET_COLOR:
2862 case LyXRC::RC_SHOW_BANNER:
2863 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2864 case LyXRC::RC_SPELL_COMMAND:
2865 case LyXRC::RC_SPELLCHECKER:
2866 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2867 case LyXRC::RC_SPELLCHECK_NOTES:
2868 case LyXRC::RC_SPLITINDEX_COMMAND:
2869 case LyXRC::RC_TEMPDIRPATH:
2870 case LyXRC::RC_TEMPLATEPATH:
2871 case LyXRC::RC_TEX_ALLOWS_SPACES:
2872 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2873 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2874 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2876 case LyXRC::RC_THESAURUSDIRPATH:
2877 case LyXRC::RC_UIFILE:
2878 case LyXRC::RC_USER_EMAIL:
2879 case LyXRC::RC_USER_NAME:
2880 case LyXRC::RC_USETEMPDIR:
2881 case LyXRC::RC_USE_ALT_LANG:
2882 case LyXRC::RC_USE_CONVERTER_CACHE:
2883 case LyXRC::RC_USE_ESC_CHARS:
2884 case LyXRC::RC_USE_INP_ENC:
2885 case LyXRC::RC_USE_PERS_DICT:
2886 case LyXRC::RC_USE_TOOLTIP:
2887 case LyXRC::RC_USE_PIXMAP_CACHE:
2888 case LyXRC::RC_USE_SPELL_LIB:
2889 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2890 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2891 case LyXRC::RC_SORT_LAYOUTS:
2892 case LyXRC::RC_FULL_SCREEN_LIMIT:
2893 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2894 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2895 case LyXRC::RC_FULL_SCREEN_TABBAR:
2896 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2897 case LyXRC::RC_FULL_SCREEN_WIDTH:
2898 case LyXRC::RC_VISUAL_CURSOR:
2899 case LyXRC::RC_VIEWER:
2900 case LyXRC::RC_VIEWER_ALTERNATIVES:
2901 case LyXRC::RC_FORWARD_SEARCH_DVI:
2902 case LyXRC::RC_FORWARD_SEARCH_PDF:
2903 case LyXRC::RC_EXPORT_OVERWRITE:
2904 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2905 case LyXRC::RC_LAST:
2912 string const LyXRC::getDescription(LyXRCTags tag)
2917 case RC_ACCEPT_COMPOUND:
2918 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2922 case RC_USE_ALT_LANG:
2923 str = _("Specify an alternate language. The default is to use the language of the document.");
2926 case RC_PLAINTEXT_ROFF_COMMAND:
2927 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.");
2930 case RC_PLAINTEXT_LINELEN:
2931 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.");
2934 case RC_AUTOREGIONDELETE:
2935 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2938 case RC_AUTORESET_OPTIONS:
2939 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2943 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2946 case RC_AUTO_NUMBER:
2949 case RC_BACKUPDIR_PATH:
2950 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.");
2953 case RC_BIBTEX_COMMAND:
2954 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2957 case RC_JBIBTEX_COMMAND:
2958 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2962 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2965 case RC_CHECKLASTFILES:
2966 str = _("Select to check whether the lastfiles still exist.");
2969 case RC_CHKTEX_COMMAND:
2970 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2979 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2980 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.");
2983 case RC_SCROLL_BELOW_DOCUMENT:
2984 str = _("LyX normally doesn't allow the user to scroll further than the bottom of the document. Set to true if you prefer to scroll the bottom of the document to the top of the screen");
2987 case RC_MAC_LIKE_WORD_MOVEMENT:
2988 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2991 case RC_SHOW_MACRO_LABEL:
2992 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2995 case RC_DATE_INSERT_FORMAT:
2996 //xgettext:no-c-format
2997 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3001 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3004 case RC_DEFAULT_VIEW_FORMAT:
3005 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3008 case RC_DEFAULT_LANGUAGE:
3009 str = _("New documents will be assigned this language.");
3012 case RC_DEFAULT_PAPERSIZE:
3013 str = _("Specify the default paper size.");
3016 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3017 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3020 case RC_DISPLAY_GRAPHICS:
3021 str = _("Select how LyX will display any graphics.");
3024 case RC_DOCUMENTPATH:
3025 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3029 case RC_USE_ESC_CHARS:
3030 str = _("Specify additional chars that can be part of a word.");
3033 case RC_EXAMPLEPATH:
3034 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3037 case RC_FONT_ENCODING:
3038 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3044 case RC_INDEX_COMMAND:
3045 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\".");
3048 case RC_JINDEX_COMMAND:
3049 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3052 case RC_NOMENCL_COMMAND:
3053 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3060 case RC_KBMAP_PRIMARY:
3061 case RC_KBMAP_SECONDARY:
3062 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.");
3065 case RC_LANGUAGE_AUTO_BEGIN:
3066 str = _("Select if a language switching command is needed at the beginning of the document.");
3069 case RC_LANGUAGE_AUTO_END:
3070 str = _("Select if a language switching command is needed at the end of the document.");
3073 case RC_LANGUAGE_COMMAND_BEGIN:
3074 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.");
3077 case RC_LANGUAGE_COMMAND_END:
3078 str = _("The LaTeX command for changing back to the language of the document.");
3081 case RC_LANGUAGE_COMMAND_LOCAL:
3082 str = _("The LaTeX command for local changing of the language.");
3085 case RC_LANGUAGE_GLOBAL_OPTIONS:
3086 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3089 case RC_LANGUAGE_PACKAGE:
3090 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3093 case RC_LANGUAGE_USE_BABEL:
3094 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3097 case RC_USELASTFILEPOS:
3098 str = _("De-select if you do not want LyX to scroll to saved position.");
3101 case RC_LOADSESSION:
3102 str = _("De-select to prevent loading files opened from the last LyX session.");
3105 case RC_MAKE_BACKUP:
3106 str = _("De-select if you don't want LyX to create backup files.");
3109 case RC_MARK_FOREIGN_LANGUAGE:
3110 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3113 case RC_MOUSE_WHEEL_SPEED:
3114 str = bformat(_("The scrolling speed of the mouse wheel."),
3118 case RC_COMPLETION_POPUP_DELAY:
3119 str = _("The completion popup delay.");
3122 case RC_COMPLETION_POPUP_MATH:
3123 str = _("Select to display the completion popup in math mode.");
3126 case RC_COMPLETION_POPUP_TEXT:
3127 str = _("Select to display the completion popup in text mode.");
3130 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3131 str = _("Show the completion popup without delay after non-unique completion attempt.");
3134 case RC_COMPLETION_POPUP_TEXT:
3135 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3138 case RC_COMPLETION_POPUP_DELAY:
3139 str = _("The inline completion delay.");
3142 case RC_COMPLETION_INLINE_MATH:
3143 str = _("Select to display the inline completion in math mode.");
3146 case RC_COMPLETION_INLINE_TEXT:
3147 str = _("Select to display the inline completion in text mode.");
3150 case RC_COMPLETION_INLINE_DOTS:
3151 str = _("Use \"...\" to shorten long completions.");
3154 case RC_AUTOCORRECTION_MATH:
3155 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3158 case RC_NUMLASTFILES:
3159 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3163 case RC_PATH_PREFIX:
3164 str = _("Specify those directories which should be "
3165 "prepended to the PATH environment variable. "
3166 "Use the OS native format.");
3170 str = _("Shows a typeset preview of things such as math");
3173 case RC_PREVIEW_HASHED_LABELS:
3174 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3177 case RC_PREVIEW_SCALE_FACTOR:
3178 str = _("Scale the preview size to suit.");
3181 case RC_PRINTCOLLCOPIESFLAG:
3182 str = _("The option for specifying whether the copies should be collated.");
3185 case RC_PRINTCOPIESFLAG:
3186 str = _("The option for specifying the number of copies to print.");
3190 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3193 case RC_PRINTEVENPAGEFLAG:
3194 str = _("The option to print only even pages.");
3197 case RC_PRINTEXSTRAOPTIONS:
3198 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3201 case RC_PRINTFILEEXTENSION:
3202 str = _("Extension of printer program output file. Usually \".ps\".");
3205 case RC_PRINTLANDSCAPEFLAG:
3206 str = _("The option to print out in landscape.");
3209 case RC_PRINTODDPAGEFLAG:
3210 str = _("The option to print only odd pages.");
3213 case RC_PRINTPAGERANGEFLAG:
3214 str = _("The option for specifying a comma-separated list of pages to print.");
3217 case RC_PRINTPAPERDIMENSIONFLAG:
3218 str = _("Option to specify the dimensions of the print paper.");
3221 case RC_PRINTPAPERFLAG:
3222 str = _("The option to specify paper type.");
3225 case RC_PRINTREVERSEFLAG:
3226 str = _("The option to reverse the order of the pages printed.");
3229 case RC_PRINTSPOOL_COMMAND:
3230 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.");
3233 case RC_PRINTSPOOL_PRINTERPREFIX:
3234 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.");
3237 case RC_PRINTTOFILE:
3238 str = _("Option to pass to the print program to print to a file.");
3241 case RC_PRINTTOPRINTER:
3242 str = _("Option to pass to the print program to print on a specific printer.");
3245 case RC_PRINT_ADAPTOUTPUT:
3246 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3249 case RC_PRINT_COMMAND:
3250 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3253 case RC_RTL_SUPPORT:
3254 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3257 case RC_VISUAL_CURSOR:
3258 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3262 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3265 case RC_SCREEN_FONT_ROMAN:
3266 case RC_SCREEN_FONT_SANS:
3267 case RC_SCREEN_FONT_TYPEWRITER:
3268 str = _("The screen fonts used to display the text while editing.");
3271 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3272 case RC_SCREEN_FONT_SANS_FOUNDRY:
3273 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3276 case RC_SCREEN_FONT_SCALABLE:
3277 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.");
3280 case RC_SCREEN_FONT_SIZES:
3281 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3284 case RC_SCREEN_ZOOM:
3285 //xgettext:no-c-format
3286 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3289 case RC_GEOMETRY_SESSION:
3290 str = _("Allow session manager to save and restore windows geometry.");
3294 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3300 case RC_SHOW_BANNER:
3301 str = _("De-select if you don't want the startup banner.");
3304 case RC_TEMPDIRPATH:
3305 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3308 case RC_THESAURUSDIRPATH:
3309 str = _("This is the place where the files of the thesaurus library reside.");
3312 case RC_TEMPLATEPATH:
3313 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3316 case RC_TEX_ALLOWS_SPACES:
3319 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3323 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3335 case RC_USE_TOOLTIP:
3336 str = _("Enable the automatic appearance of tool tips in the work area.");
3339 case RC_USE_PIXMAP_CACHE:
3340 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3343 case RC_USE_SPELL_LIB:
3346 case RC_VIEWDVI_PAPEROPTION:
3347 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3362 // The global instance
3365 // The global copy of the system lyxrc entries (everything except preferences)