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"
30 #include "graphics/GraphicsTypes.h"
32 #include "support/convert.h"
33 #include "support/debug.h"
34 #include "support/environment.h"
35 #include "support/FileName.h"
36 #include "support/filetools.h"
37 #include "support/gettext.h"
38 #include "support/lstrings.h"
39 #include "support/os.h"
40 #include "support/Package.h"
41 #include "support/userinfo.h"
47 using namespace lyx::support;
51 namespace os = support::os;
55 // when adding something to this array keep it sorted!
56 LexerKeyword lyxrcTags[] = {
57 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
58 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
59 { "\\alternate_language", LyXRC::RC_ALT_LANG },
60 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
61 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
62 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
63 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
64 { "\\autosave", LyXRC::RC_AUTOSAVE },
65 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
66 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
67 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
68 { "\\bind_file", LyXRC::RC_BINDFILE },
69 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
70 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
71 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
72 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
73 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
74 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
75 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
76 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
77 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
78 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
79 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
80 { "\\converter", LyXRC::RC_CONVERTER },
81 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
82 { "\\copier", LyXRC::RC_COPIER },
83 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
84 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
85 { "\\def_file", LyXRC::RC_DEFFILE },
86 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
87 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
88 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
89 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
90 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
91 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
92 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
93 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
94 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
95 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
96 { "\\format", LyXRC::RC_FORMAT },
97 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
98 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
99 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
100 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
101 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
102 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
103 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
104 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
105 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
106 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
107 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
108 { "\\input", LyXRC::RC_INPUT },
109 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
110 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
111 { "\\kbmap", LyXRC::RC_KBMAP },
112 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
113 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
114 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
115 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
116 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
117 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
118 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
119 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
120 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
121 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
122 { "\\load_session", LyXRC::RC_LOADSESSION },
123 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
124 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
125 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
126 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
127 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
128 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
129 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
130 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
131 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
132 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
133 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
134 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
135 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
136 { "\\preview", LyXRC::RC_PREVIEW },
137 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
138 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
139 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
140 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
141 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
142 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
143 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
144 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
145 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
146 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
147 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
148 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
149 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
150 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
151 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
152 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
153 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
154 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
155 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
156 { "\\printer", LyXRC::RC_PRINTER },
157 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
158 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
159 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
160 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
161 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
162 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
163 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
164 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
165 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
166 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
167 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
168 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
169 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
170 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
171 { "\\set_color", LyXRC::RC_SET_COLOR },
172 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
173 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
174 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
175 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
176 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
177 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
178 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
179 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
180 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
181 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
182 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
183 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
184 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
185 { "\\ui_file", LyXRC::RC_UIFILE },
186 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
187 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
188 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
189 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
190 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
191 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
192 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
193 // compatibility with versions older than 1.4.0 only
194 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
195 // compatibility with versions older than 1.4.0 only
196 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
197 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
198 { "\\user_email", LyXRC::RC_USER_EMAIL },
199 { "\\user_name", LyXRC::RC_USER_NAME },
200 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
201 // compatibility with versions older than 1.4.0 only
202 { "\\viewer", LyXRC::RC_VIEWER},
203 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
204 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
207 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
218 void LyXRC::setDefaults()
221 def_file = "default";
223 // Get printer from the environment. If fail, use default "",
224 // assuming that everything is set up correctly.
225 printer = getEnv("PRINTER");
226 print_adapt_output = false;
227 print_command = "dvips";
228 print_evenpage_flag = "-B";
229 print_oddpage_flag = "-A";
230 print_pagerange_flag = "-pp";
231 print_copies_flag = "-c";
232 print_collcopies_flag = "-C";
233 print_reverse_flag = "-r";
234 print_landscape_flag = "-t landscape";
235 print_to_printer = "-P";
236 print_to_file = "-o ";
237 print_file_extension = ".ps";
238 print_paper_flag = "-t";
239 print_paper_dimension_flag = "-T";
240 document_path.erase();
241 view_dvi_paper_option.erase();
242 default_papersize = PAPER_DEFAULT;
243 default_view_format = "pdf2";
244 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
245 bibtex_command = "bibtex";
247 index_command = "makeindex -c -q";
248 nomencl_command = "makeindex -s nomencl.ist";
250 // Because a screen is typically wider than a piece of paper:
252 allow_geometry_session = true;
253 // Default LaTeX font size:
254 font_sizes[FONT_SIZE_TINY] = "5.0";
255 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
256 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
257 font_sizes[FONT_SIZE_SMALL] = "9.0";
258 font_sizes[FONT_SIZE_NORMAL] = "10.0";
259 font_sizes[FONT_SIZE_LARGE] = "12.0";
260 font_sizes[FONT_SIZE_LARGER] = "14.4";
261 font_sizes[FONT_SIZE_LARGEST] = "17.26";
262 font_sizes[FONT_SIZE_HUGE] = "20.74";
263 font_sizes[FONT_SIZE_HUGER] = "24.88";
264 use_scalable_fonts = true;
265 roman_font_name = "";
267 typewriter_font_name = "";
269 auto_region_delete = true;
270 auto_reset_options = false;
271 plaintext_linelen = 65;
272 mouse_wheel_speed = 1.0;
273 num_lastfiles = maxlastfiles;
274 check_lastfiles = true;
275 use_lastfilepos = true;
276 load_session = false;
278 save_compressed = false;
279 backupdir_path.erase();
280 display_graphics = true;
281 // Spellchecker settings:
282 #if defined(USE_ASPELL)
283 spellchecker = "aspell";
284 #elif defined(USE_HUNSPELL)
285 spellchecker = "hunspell";
287 spellchecker = "aspell";
289 spellchecker_accept_compound = false;
290 spellcheck_continuously = false;
291 spellcheck_notes = true;
294 visual_cursor = false;
296 mark_foreign_language = true;
297 language_auto_begin = true;
298 language_auto_end = true;
299 language_global_options = true;
300 language_use_babel = true;
301 language_package = "\\usepackage{babel}";
302 language_command_begin = "\\selectlanguage{$$lang}";
303 language_command_local = "\\foreignlanguage{$$lang}{";
304 sort_layouts = false;
305 group_layouts = true;
306 default_language = "english";
307 gui_language = "auto";
309 windows_style_tex_paths = false;
310 tex_allows_spaces = false;
311 date_insert_format = "%x";
312 cursor_follows_scrollbar = false;
313 scroll_below_document = false;
314 paragraph_markers = false;
315 mac_like_word_movement = false;
316 macro_edit_style = MACRO_EDIT_INLINE_BOX;
317 dialogs_iconify_with_main = false;
318 preview = PREVIEW_OFF;
319 preview_hashed_labels = false;
320 preview_scale_factor = 1.0;
321 use_converter_cache = true;
323 use_pixmap_cache = false;
324 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
325 user_name = to_utf8(support::user_name());
326 user_email = to_utf8(support::user_email());
327 open_buffers_in_tabs = true;
328 single_close_tab_button = false;
330 // Fullscreen settings
331 full_screen_limit = false;
332 full_screen_toolbars = true;
333 full_screen_tabbar = true;
334 full_screen_menubar = true;
335 full_screen_scrollbar = true;
336 full_screen_width = 700;
338 completion_cursor_text = true;
339 completion_popup_math = true;
340 completion_popup_text = false;
341 completion_popup_delay = 2.0;
342 completion_popup_after_complete = true;
343 autocorrection_math = false;
344 completion_inline_math = true;
345 completion_inline_text = false;
346 completion_inline_dots = -1;
347 completion_inline_delay = 0.2;
353 void oldFontFormat(string & family, string & foundry)
355 if (family.empty() || family[0] != '-')
357 foundry = token(family, '-', 1);
358 family = token(family, '-', 2);
366 int LyXRC::read(FileName const & filename)
368 Lexer lexrc(lyxrcTags);
369 if (lyxerr.debugging(Debug::PARSER))
370 lexrc.printTable(lyxerr);
372 lexrc.setFile(filename);
376 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
382 int LyXRC::read(istream & is)
384 Lexer lexrc(lyxrcTags);
385 if (lyxerr.debugging(Debug::PARSER))
386 lexrc.printTable(lyxerr);
392 LYXERR(Debug::LYXRC, "Reading istream...");
398 int LyXRC::read(Lexer & lexrc)
403 while (lexrc.isOK()) {
404 // By using two switches we take advantage of the compiler
405 // telling us if we have missed a LyXRCTags element in
406 // the second switch.
407 // Note that this also shows a problem with Lexer since it
408 // helps us avoid taking advantage of the strictness of the
411 int le = lexrc.lex();
413 case Lexer::LEX_UNDEF:
414 lexrc.printError("Unknown tag `$$Token'");
416 case Lexer::LEX_FEOF:
421 switch (static_cast<LyXRCTags>(le)) {
422 case RC_INPUT: // Include file
425 libFileSearch(string(),
428 lexrc.printError("Error reading "
429 "included file: " + tmp.absFilename());
435 bind_file = os::internal_path(lexrc.getString());
440 def_file = os::internal_path(lexrc.getString());
445 ui_file = os::internal_path(lexrc.getString());
448 case RC_AUTORESET_OPTIONS:
449 lexrc >> auto_reset_options;
452 case RC_DISPLAY_GRAPHICS:
454 display_graphics = lexrc.getString() == "true";
457 case RC_TEX_EXPECTS_WINDOWS_PATHS:
458 lexrc >> windows_style_tex_paths;
461 case RC_TEX_ALLOWS_SPACES:
462 lexrc >> tex_allows_spaces;
469 case RC_KBMAP_PRIMARY:
471 string const kmap(os::internal_path(lexrc.getString()));
472 if (!libFileSearch("kbd", kmap, "kmap").empty()
474 primary_kbmap = kmap;
476 lexrc.printError("LyX: Keymap `$$Token' not found");
481 case RC_KBMAP_SECONDARY:
483 string const kmap(os::internal_path(lexrc.getString()));
484 if (!libFileSearch("kbd", kmap, "kmap").empty()
486 secondary_kbmap = kmap;
488 lexrc.printError("LyX: Keymap `$$Token' not found");
493 case RC_FONT_ENCODING:
501 case RC_PRINT_COMMAND:
502 if (lexrc.next(true)) {
503 print_command = lexrc.getString();
507 case RC_PRINTEVENPAGEFLAG:
508 lexrc >> print_evenpage_flag;
511 case RC_PRINTODDPAGEFLAG:
512 lexrc >> print_oddpage_flag;
515 case RC_PRINTPAGERANGEFLAG:
516 lexrc >> print_pagerange_flag;
519 case RC_PRINTCOPIESFLAG:
520 lexrc >> print_copies_flag;
523 case RC_PRINTCOLLCOPIESFLAG:
524 lexrc >> print_collcopies_flag;
527 case RC_PRINTREVERSEFLAG:
528 lexrc >> print_reverse_flag;
531 case RC_PRINTLANDSCAPEFLAG:
532 lexrc >> print_landscape_flag;
535 case RC_PRINTTOPRINTER:
536 lexrc >> print_to_printer;
539 case RC_PRINT_ADAPTOUTPUT:
540 lexrc >> print_adapt_output;
545 print_to_file = os::internal_path(lexrc.getString());
549 case RC_PRINTFILEEXTENSION:
550 lexrc >> print_file_extension;
553 case RC_PRINTEXSTRAOPTIONS:
554 lexrc >> print_extra_options;
557 case RC_PRINTSPOOL_COMMAND:
558 if (lexrc.next(true)) {
559 print_spool_command = lexrc.getString();
563 case RC_PRINTSPOOL_PRINTERPREFIX:
564 lexrc >> print_spool_printerprefix;
567 case RC_PRINTPAPERDIMENSIONFLAG:
568 lexrc >> print_paper_dimension_flag;
571 case RC_PRINTPAPERFLAG:
572 lexrc >> print_paper_flag;
575 case RC_DEFAULT_PAPERSIZE:
577 string const size = ascii_lowercase(lexrc.getString());
578 if (size == "usletter")
579 default_papersize = PAPER_USLETTER;
580 else if (size == "legal")
581 default_papersize = PAPER_USLEGAL;
582 else if (size == "executive")
583 default_papersize = PAPER_USEXECUTIVE;
584 else if (size == "a3")
585 default_papersize = PAPER_A3;
586 else if (size == "a4")
587 default_papersize = PAPER_A4;
588 else if (size == "a5")
589 default_papersize = PAPER_A5;
590 else if (size == "b5")
591 default_papersize = PAPER_B5;
592 else if (size == "default")
593 default_papersize = PAPER_DEFAULT;
597 case RC_VIEWDVI_PAPEROPTION:
599 view_dvi_paper_option = lexrc.getString();
601 view_dvi_paper_option.erase();
604 case RC_CHKTEX_COMMAND:
605 if (lexrc.next(true)) {
606 chktex_command = lexrc.getString();
610 case RC_BIBTEX_ALTERNATIVES:
611 if (lexrc.next(true)) {
612 bibtex_alternatives.insert(lexrc.getString());
616 case RC_BIBTEX_COMMAND:
617 if (lexrc.next(true)) {
618 bibtex_command = lexrc.getString();
622 case RC_JBIBTEX_COMMAND:
623 if (lexrc.next(true)) {
624 jbibtex_command = lexrc.getString();
628 case RC_INDEX_ALTERNATIVES:
629 if (lexrc.next(true)) {
630 index_alternatives.insert(lexrc.getString());
634 case RC_INDEX_COMMAND:
635 if (lexrc.next(true)) {
636 index_command = lexrc.getString();
640 case RC_JINDEX_COMMAND:
641 if (lexrc.next(true)) {
642 jindex_command = lexrc.getString();
646 case RC_SPLITINDEX_COMMAND:
647 if (lexrc.next(true)) {
648 splitindex_command = lexrc.getString();
652 case RC_NOMENCL_COMMAND:
653 if (lexrc.next(true)) {
654 nomencl_command = lexrc.getString();
666 case RC_GEOMETRY_SESSION:
667 lexrc >> allow_geometry_session;
670 case RC_SCREEN_FONT_SIZES:
671 lexrc >> font_sizes[FONT_SIZE_TINY];
672 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
673 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
674 lexrc >> font_sizes[FONT_SIZE_SMALL];
675 lexrc >> font_sizes[FONT_SIZE_NORMAL];
676 lexrc >> font_sizes[FONT_SIZE_LARGE];
677 lexrc >> font_sizes[FONT_SIZE_LARGER];
678 lexrc >> font_sizes[FONT_SIZE_LARGEST];
679 lexrc >> font_sizes[FONT_SIZE_HUGE];
680 lexrc >> font_sizes[FONT_SIZE_HUGER];
683 case RC_SCREEN_FONT_SCALABLE:
684 lexrc >> use_scalable_fonts;
691 case RC_DOCUMENTPATH:
693 document_path = os::internal_path(lexrc.getString());
694 document_path = expandPath(document_path);
700 example_path = os::internal_path(lexrc.getString());
701 example_path = expandPath(example_path);
705 case RC_TEMPLATEPATH:
707 template_path = os::internal_path(lexrc.getString());
708 template_path = expandPath(template_path);
714 tempdir_path = os::internal_path(lexrc.getString());
715 tempdir_path = expandPath(tempdir_path);
719 case RC_THESAURUSDIRPATH:
721 thesaurusdir_path = os::internal_path(lexrc.getString());
722 thesaurusdir_path = expandPath(thesaurusdir_path);
726 case RC_HUNSPELLDIR_PATH:
728 hunspelldir_path = os::internal_path(lexrc.getString());
729 hunspelldir_path = expandPath(hunspelldir_path);
733 case RC_USELASTFILEPOS:
734 lexrc >> use_lastfilepos;
738 lexrc >> load_session;
741 case RC_MOUSE_WHEEL_SPEED:
742 lexrc >> mouse_wheel_speed;
745 case RC_COMPLETION_INLINE_DELAY:
746 lexrc >> completion_inline_delay;
749 case RC_COMPLETION_INLINE_MATH:
750 lexrc >> completion_inline_math;
753 case RC_COMPLETION_INLINE_TEXT:
754 lexrc >> completion_inline_text;
757 case RC_COMPLETION_INLINE_DOTS:
758 lexrc >> completion_inline_dots;
761 case RC_AUTOCORRECTION_MATH:
762 lexrc >> autocorrection_math;
765 case RC_COMPLETION_POPUP_DELAY:
766 lexrc >> completion_popup_delay;
769 case RC_COMPLETION_POPUP_MATH:
770 lexrc >> completion_popup_math;
773 case RC_COMPLETION_POPUP_TEXT:
774 lexrc >> completion_popup_text;
777 case RC_COMPLETION_CURSOR_TEXT:
778 lexrc >> completion_cursor_text;
781 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
782 lexrc >> completion_popup_after_complete;
785 case RC_NUMLASTFILES:
786 lexrc >> num_lastfiles;
789 case RC_CHECKLASTFILES:
790 lexrc >> check_lastfiles;
793 case RC_SCREEN_FONT_ROMAN:
795 roman_font_name = lexrc.getString();
796 oldFontFormat(roman_font_name,
801 case RC_SCREEN_FONT_SANS:
803 sans_font_name = lexrc.getString();
804 oldFontFormat(sans_font_name, sans_font_foundry);
808 case RC_SCREEN_FONT_TYPEWRITER:
810 typewriter_font_name = lexrc.getString();
811 oldFontFormat(typewriter_font_name,
812 typewriter_font_foundry);
816 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
817 lexrc >> roman_font_foundry;
820 case RC_SCREEN_FONT_SANS_FOUNDRY:
821 lexrc >> sans_font_foundry;
824 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
825 lexrc >> typewriter_font_foundry;
830 lexrc.printError("Missing color tag.");
833 string lyx_name = lexrc.getString();
836 lexrc.printError("Missing color name for color: `$$Token'");
839 string x11_name = lexrc.getString();
841 ColorCode const col =
842 lcolor.getFromLyXName(lyx_name);
843 if (col == Color_none ||
844 col == Color_inherit ||
848 if (!lcolor.setColor(col, x11_name))
849 LYXERR0("Bad lyxrc set_color for " << lyx_name);
853 case RC_AUTOREGIONDELETE:
854 // Auto region delete defaults to true
855 lexrc >> auto_region_delete;
860 lyxpipes = os::internal_path(lexrc.getString());
861 lyxpipes = expandPath(lyxpipes);
865 case RC_CURSOR_FOLLOWS_SCROLLBAR:
866 lexrc >> cursor_follows_scrollbar;
869 case RC_SCROLL_BELOW_DOCUMENT:
870 lexrc >> scroll_below_document;
873 case RC_PARAGRAPH_MARKERS:
874 lexrc >> paragraph_markers;
877 case RC_MAC_LIKE_WORD_MOVEMENT:
878 lexrc >> mac_like_word_movement;
881 case RC_MACRO_EDIT_STYLE:
883 switch (lexrc.getInteger()) {
884 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
885 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
886 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
891 case RC_DIALOGS_ICONIFY_WITH_MAIN:
892 lexrc >> dialogs_iconify_with_main;
895 case RC_PLAINTEXT_LINELEN:
896 lexrc >> plaintext_linelen;
898 // Spellchecker settings:
899 case RC_ACCEPT_COMPOUND:
900 lexrc >> spellchecker_accept_compound;
903 lexrc >> use_tooltip;
905 case RC_USE_PIXMAP_CACHE:
906 lexrc >> use_pixmap_cache;
908 case RC_SPELLCHECKER:
909 lexrc >> spellchecker;
912 lexrc >> spellchecker_alt_lang;
915 lexrc >> spellchecker_esc_chars;
917 case RC_SPELLCHECK_CONTINUOUSLY:
918 lexrc >> spellcheck_continuously;
920 case RC_SPELLCHECK_NOTES:
921 lexrc >> spellcheck_notes;
924 lexrc >> make_backup;
926 case RC_SAVE_COMPRESSED:
927 lexrc >> save_compressed;
929 case RC_BACKUPDIR_PATH:
931 backupdir_path = os::internal_path(lexrc.getString());
932 backupdir_path = expandPath(backupdir_path);
935 case RC_DATE_INSERT_FORMAT:
936 lexrc >> date_insert_format;
938 case RC_LANGUAGE_PACKAGE:
939 lexrc >> language_package;
941 case RC_LANGUAGE_AUTO_BEGIN:
942 lexrc >> language_auto_begin;
944 case RC_LANGUAGE_AUTO_END:
945 lexrc >> language_auto_end;
947 case RC_LANGUAGE_GLOBAL_OPTIONS:
948 lexrc >> language_global_options;
950 case RC_LANGUAGE_USE_BABEL:
951 lexrc >> language_use_babel;
953 case RC_LANGUAGE_COMMAND_BEGIN:
954 lexrc >> language_command_begin;
956 case RC_LANGUAGE_COMMAND_END:
957 lexrc >> language_command_end;
959 case RC_LANGUAGE_COMMAND_LOCAL:
960 lexrc >> language_command_local;
963 lexrc >> rtl_support;
965 case RC_VISUAL_CURSOR:
966 lexrc >> visual_cursor;
969 lexrc >> auto_number;
971 case RC_MARK_FOREIGN_LANGUAGE:
972 lexrc >> mark_foreign_language;
978 fmt = lexrc.getString();
979 if (lexrc.next(true))
980 command = lexrc.getString();
981 setMover(fmt, command);
986 string from, to, command, flags;
988 from = lexrc.getString();
990 to = lexrc.getString();
991 if (lexrc.next(true))
992 command = lexrc.getString();
994 flags = lexrc.getString();
996 theConverters().erase(from, to);
998 theConverters().add(from, to, command, flags);
1001 // compatibility with versions older than 1.4.0 only
1003 string format, command;
1004 lexrc >> format >> command;
1005 formats.setViewer(format, command);
1009 string format, extension, prettyname, shortcut;
1010 lexrc >> format >> extension >> prettyname >> shortcut;
1011 string viewer, editor;
1012 if (lexrc.next(true))
1013 viewer = lexrc.getString();
1014 if (lexrc.next(true))
1015 editor = lexrc.getString();
1017 // Hack to ensure compatibility with versions older
1019 int le = lexrc.lex();
1020 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1021 flags = lexrc.getString();
1022 if (le != Lexer::LEX_DATA) {
1023 // We have got a known token.
1024 // Therefore this is an old style
1025 // format definition without
1027 lexrc.pushToken(flags);
1031 int flgs = Format::none;
1032 while (!flags.empty()) {
1034 flags = split(flags, flag, ',');
1035 if (flag == "document")
1036 flgs |= Format::document;
1037 else if (flag == "vector")
1038 flgs |= Format::vector;
1040 LYXERR0("Ignoring unknown flag `"
1041 << flag << "' for format `"
1044 if (prettyname.empty()) {
1045 if (theConverters().formatIsUsed(format))
1046 LYXERR0("Can't delete format " << format);
1048 formats.erase(format);
1050 formats.add(format, extension, prettyname,
1051 shortcut, viewer, editor, flgs);
1055 case RC_VIEWER_ALTERNATIVES: {
1056 string format, command;
1058 format = lexrc.getString();
1059 if (lexrc.eatLine())
1060 command = lexrc.getString();
1061 viewer_alternatives[format].insert(command);
1064 case RC_EDITOR_ALTERNATIVES: {
1065 string format, command;
1066 lexrc >> format >> command;
1067 editor_alternatives[format].insert(command);
1071 case RC_DEFAULT_VIEW_FORMAT:
1072 lexrc >> default_view_format;
1075 case RC_DEFAULT_LANGUAGE:
1076 lexrc >> default_language;
1079 case RC_GUI_LANGUAGE:
1080 lexrc >> gui_language;
1083 case RC_SHOW_BANNER:
1084 lexrc >> show_banner;
1089 string const tmp = lexrc.getString();
1090 if (tmp == "true" || tmp == "on")
1091 preview = PREVIEW_ON;
1092 else if (tmp == "no_math")
1093 preview = PREVIEW_NO_MATH;
1095 preview = PREVIEW_OFF;
1096 if (tmp != "false" && tmp != "off")
1097 LYXERR0("Unrecognized preview status \""
1103 case RC_PREVIEW_HASHED_LABELS:
1104 lexrc >> preview_hashed_labels;
1107 case RC_PREVIEW_SCALE_FACTOR:
1108 lexrc >> preview_scale_factor;
1115 lexrc >> user_email;
1118 case RC_PATH_PREFIX:
1119 lexrc >> path_prefix;
1122 case RC_USE_CONVERTER_CACHE:
1123 lexrc >> use_converter_cache;
1125 case RC_CONVERTER_CACHE_MAXAGE:
1126 lexrc >> converter_cache_maxage;
1129 case RC_SORT_LAYOUTS:
1130 lexrc >> sort_layouts;
1132 case RC_GROUP_LAYOUTS:
1133 lexrc >> group_layouts;
1135 case RC_FULL_SCREEN_LIMIT:
1136 lexrc >> full_screen_limit;
1138 case RC_FULL_SCREEN_TOOLBARS:
1139 lexrc >> full_screen_toolbars;
1141 case RC_FULL_SCREEN_SCROLLBAR:
1142 lexrc >> full_screen_scrollbar;
1144 case RC_FULL_SCREEN_TABBAR:
1145 lexrc >> full_screen_tabbar;
1147 case RC_FULL_SCREEN_MENUBAR:
1148 lexrc >> full_screen_menubar;
1150 case RC_FULL_SCREEN_WIDTH:
1151 lexrc >> full_screen_width;
1153 case RC_OPEN_BUFFERS_IN_TABS:
1154 lexrc >> open_buffers_in_tabs;
1156 case RC_SINGLE_CLOSE_TAB_BUTTON:
1157 lexrc >> single_close_tab_button;
1160 // Obsoteted in 1.4.0
1163 case RC_SPELL_COMMAND:
1165 case RC_PLAINTEXT_ROFF_COMMAND:
1166 case RC_USE_ALT_LANG:
1167 case RC_USE_ESC_CHARS:
1168 case RC_USE_INP_ENC:
1169 case RC_USE_PERS_DICT:
1170 case RC_USE_SPELL_LIB:
1171 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1172 << lexrc.getString() << "'.");
1177 break; // this is just a dummy
1181 /// Update converters data-structures
1182 theConverters().update(formats);
1183 theConverters().buildGraph();
1189 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1191 ofstream ofs(filename.toFilesystemEncoding().c_str());
1193 write(ofs, ignore_system_lyxrc);
1197 void LyXRC::print() const
1199 if (lyxerr.debugging())
1200 write(lyxerr, false);
1208 typedef pair<string, SpecialisedMover> Data;
1210 SameMover(Data const & comparison)
1211 : comparison_(comparison) {}
1213 bool operator()(Data const & data) const
1215 return data.first == comparison_.first &&
1216 data.second.command() == comparison_.second.command();
1226 // Escape \ and " so that LyXLex can read the string later
1227 string escapeCommand(string const & str) {
1228 return subst(subst(str , "\\", "\\\\"),
1235 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1237 LyXRCTags tag = RC_LAST;
1239 if (!name.empty()) {
1240 for (int i = 0; i != lyxrcCount; ++i)
1241 if ("\\" + name == lyxrcTags[i].tag)
1242 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1246 os << "# LyX " << lyx_version
1247 << " generated this file. If you want to make your own\n"
1248 << "# modifications you should do them from inside LyX and save.\n"
1251 // Why the switch you might ask. It is a trick to ensure that all
1252 // the elements in the LyXRCTags enum are handled. As you can see
1253 // there are no breaks at all. So it is just a huge fall-through.
1254 // The nice thing is that we will get a warning from the compiler
1255 // if we forget an element.
1259 // input/include files are not done here
1261 if (ignore_system_lyxrc ||
1262 bind_file != system_lyxrc.bind_file) {
1263 string const path = os::external_path(bind_file);
1264 os << "\\bind_file \"" << path << "\"\n";
1270 if (ignore_system_lyxrc ||
1271 def_file != system_lyxrc.def_file) {
1272 string const path = os::external_path(def_file);
1273 os << "\\def_file \"" << path << "\"\n";
1282 << "# MISC SECTION ######################################\n"
1284 // bind files are not done here.
1286 case RC_PATH_PREFIX:
1287 if (ignore_system_lyxrc ||
1288 path_prefix != system_lyxrc.path_prefix) {
1289 os << "\\path_prefix \"" << path_prefix << "\"\n";
1294 if (ignore_system_lyxrc ||
1295 ui_file != system_lyxrc.ui_file) {
1296 string const path = os::external_path(ui_file);
1297 os << "\\ui_file \"" << path << "\"\n";
1301 case RC_AUTOREGIONDELETE:
1302 if (ignore_system_lyxrc ||
1303 auto_region_delete != system_lyxrc.auto_region_delete) {
1304 os << "# Set to false to inhibit automatic replacement of\n"
1305 << "# the current selection.\n"
1306 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1311 case RC_AUTORESET_OPTIONS:
1312 if (ignore_system_lyxrc ||
1313 auto_reset_options != system_lyxrc.auto_reset_options) {
1314 os << "# Set to false to inhibit automatic reset of\n"
1315 << "# the class options to defaults on class change.\n"
1316 << "\\auto_reset_options "
1317 << convert<string>(auto_reset_options)
1323 if (ignore_system_lyxrc ||
1324 autosave != system_lyxrc.autosave) {
1325 os << "# The time interval between auto-saves in seconds.\n"
1326 << "\\autosave " << autosave << '\n';
1330 case RC_DISPLAY_GRAPHICS:
1331 if (ignore_system_lyxrc ||
1332 display_graphics != system_lyxrc.display_graphics) {
1333 os << "# Display graphics within LyX\n"
1335 << "\\display_graphics "
1336 << (display_graphics ? "true" : "false")
1341 case RC_SORT_LAYOUTS:
1342 if (ignore_system_lyxrc ||
1343 sort_layouts != system_lyxrc.sort_layouts) {
1344 os << "# Sort layouts alphabetically.\n"
1345 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1349 case RC_GROUP_LAYOUTS:
1350 if (ignore_system_lyxrc ||
1351 group_layouts != system_lyxrc.group_layouts) {
1352 os << "# Group layouts by their category.\n"
1353 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1357 case RC_VIEWDVI_PAPEROPTION:
1358 if (ignore_system_lyxrc ||
1359 view_dvi_paper_option
1360 != system_lyxrc.view_dvi_paper_option) {
1361 os << "# Options used to specify paper size to the\n"
1362 << "# view_dvi_command (e.g. -paper)\n"
1363 << "\\view_dvi_paper_option \""
1364 << view_dvi_paper_option << "\"\n";
1368 case RC_DEFAULT_PAPERSIZE:
1369 if (ignore_system_lyxrc ||
1370 default_papersize != system_lyxrc.default_papersize) {
1371 os << "# The default papersize to use.\n"
1372 << "\\default_papersize \"";
1373 switch (default_papersize) {
1375 os << "default"; break;
1376 case PAPER_USLETTER:
1377 os << "usletter"; break;
1379 os << "legal"; break;
1380 case PAPER_USEXECUTIVE:
1381 os << "executive"; break;
1392 case PAPER_B4: break;
1398 case RC_CHKTEX_COMMAND:
1399 if (ignore_system_lyxrc ||
1400 chktex_command != system_lyxrc.chktex_command) {
1401 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1405 case RC_BIBTEX_ALTERNATIVES: {
1406 CommandSet::const_iterator it = bibtex_alternatives.begin();
1407 CommandSet::const_iterator end = bibtex_alternatives.end();
1408 for ( ; it != end; ++it) {
1409 if (ignore_system_lyxrc
1410 || !system_lyxrc.bibtex_alternatives.count(*it))
1411 os << "\\bibtex_alternatives \""
1417 case RC_BIBTEX_COMMAND:
1418 if (ignore_system_lyxrc ||
1419 bibtex_command != system_lyxrc.bibtex_command) {
1420 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1424 case RC_JBIBTEX_COMMAND:
1425 if (ignore_system_lyxrc ||
1426 jbibtex_command != system_lyxrc.jbibtex_command) {
1427 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1431 case RC_INDEX_ALTERNATIVES: {
1432 CommandSet::const_iterator it = index_alternatives.begin();
1433 CommandSet::const_iterator end = index_alternatives.end();
1434 for ( ; it != end; ++it) {
1435 if (ignore_system_lyxrc
1436 || !system_lyxrc.index_alternatives.count(*it))
1437 os << "\\index_alternatives \""
1443 case RC_INDEX_COMMAND:
1444 if (ignore_system_lyxrc ||
1445 index_command != system_lyxrc.index_command) {
1446 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1450 case RC_JINDEX_COMMAND:
1451 if (ignore_system_lyxrc ||
1452 jindex_command != system_lyxrc.jindex_command) {
1453 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1457 case RC_SPLITINDEX_COMMAND:
1458 if (ignore_system_lyxrc ||
1459 splitindex_command != system_lyxrc.splitindex_command) {
1460 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1464 case RC_NOMENCL_COMMAND:
1465 if (ignore_system_lyxrc ||
1466 nomencl_command != system_lyxrc.nomencl_command) {
1467 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1471 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1472 if (ignore_system_lyxrc ||
1473 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1474 os << "\\tex_expects_windows_paths "
1475 << convert<string>(windows_style_tex_paths) << '\n';
1479 case RC_TEX_ALLOWS_SPACES:
1480 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1481 os << "\\tex_allows_spaces "
1482 << convert<string>(tex_allows_spaces) << '\n';
1487 if (ignore_system_lyxrc ||
1488 use_kbmap != system_lyxrc.use_kbmap) {
1489 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1493 case RC_KBMAP_PRIMARY:
1494 if (ignore_system_lyxrc ||
1495 primary_kbmap != system_lyxrc.primary_kbmap) {
1496 string const path = os::external_path(primary_kbmap);
1497 os << "\\kbmap_primary \"" << path << "\"\n";
1501 case RC_KBMAP_SECONDARY:
1502 if (ignore_system_lyxrc ||
1503 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1504 string const path = os::external_path(secondary_kbmap);
1505 os << "\\kbmap_secondary \"" << path << "\"\n";
1510 if (ignore_system_lyxrc ||
1511 lyxpipes != system_lyxrc.lyxpipes) {
1512 string const path = os::external_path(lyxpipes);
1513 os << "\\serverpipe \"" << path << "\"\n";
1517 case RC_DATE_INSERT_FORMAT:
1518 if (ignore_system_lyxrc ||
1519 date_insert_format != system_lyxrc.date_insert_format) {
1520 os << "\\date_insert_format \"" << date_insert_format
1527 os << "\\user_name \"" << user_name << "\"\n";
1532 os << "\\user_email \"" << user_email << "\"\n";
1536 case RC_SHOW_BANNER:
1537 if (ignore_system_lyxrc ||
1538 show_banner != system_lyxrc.show_banner) {
1539 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1545 if (ignore_system_lyxrc ||
1546 preview != system_lyxrc.preview) {
1552 case PREVIEW_NO_MATH:
1559 os << "\\preview " << status << '\n';
1564 case RC_PREVIEW_HASHED_LABELS:
1565 if (ignore_system_lyxrc ||
1566 preview_hashed_labels !=
1567 system_lyxrc.preview_hashed_labels) {
1568 os << "\\preview_hashed_labels "
1569 << convert<string>(preview_hashed_labels) << '\n';
1574 case RC_PREVIEW_SCALE_FACTOR:
1575 if (ignore_system_lyxrc ||
1576 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1577 os << "\\preview_scale_factor "
1578 << preview_scale_factor << '\n';
1583 case RC_USE_CONVERTER_CACHE:
1584 if (ignore_system_lyxrc ||
1585 use_converter_cache != system_lyxrc.use_converter_cache) {
1586 os << "\\use_converter_cache "
1587 << convert<string>(use_converter_cache) << '\n';
1592 case RC_CONVERTER_CACHE_MAXAGE:
1593 if (ignore_system_lyxrc ||
1594 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1595 os << "\\converter_cache_maxage "
1596 << converter_cache_maxage << '\n';
1602 << "# SCREEN & FONTS SECTION ############################\n"
1606 if (ignore_system_lyxrc ||
1607 dpi != system_lyxrc.dpi) {
1608 os << "\\screen_dpi " << dpi << '\n';
1612 case RC_SCREEN_ZOOM:
1613 if (ignore_system_lyxrc ||
1614 zoom != system_lyxrc.zoom) {
1615 os << "\\screen_zoom " << zoom << '\n';
1619 case RC_GEOMETRY_SESSION:
1620 if (ignore_system_lyxrc ||
1621 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1622 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1627 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1628 if (ignore_system_lyxrc ||
1629 cursor_follows_scrollbar
1630 != system_lyxrc.cursor_follows_scrollbar) {
1631 os << "\\cursor_follows_scrollbar "
1632 << convert<string>(cursor_follows_scrollbar) << '\n';
1636 case RC_SCROLL_BELOW_DOCUMENT:
1637 if (ignore_system_lyxrc ||
1638 scroll_below_document
1639 != system_lyxrc.scroll_below_document) {
1640 os << "\\scroll_below_document "
1641 << convert<string>(scroll_below_document) << '\n';
1645 case RC_PARAGRAPH_MARKERS:
1646 if (ignore_system_lyxrc ||
1648 != system_lyxrc.paragraph_markers) {
1649 os << "\\paragraph_markers "
1650 << convert<string>(paragraph_markers) << '\n';
1654 case RC_MAC_LIKE_WORD_MOVEMENT:
1655 if (ignore_system_lyxrc ||
1656 mac_like_word_movement
1657 != system_lyxrc.mac_like_word_movement) {
1658 os << "\\mac_like_word_movement "
1659 << convert<string>(mac_like_word_movement) << '\n';
1663 case RC_MACRO_EDIT_STYLE:
1664 if (ignore_system_lyxrc ||
1666 != system_lyxrc.macro_edit_style) {
1667 os << "\\macro_edit_style ";
1668 switch (macro_edit_style) {
1669 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1670 case MACRO_EDIT_INLINE: os << "1\n"; break;
1671 case MACRO_EDIT_LIST: os << "2\n"; break;
1676 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1677 if (ignore_system_lyxrc ||
1678 dialogs_iconify_with_main
1679 != system_lyxrc.dialogs_iconify_with_main) {
1680 os << "\\dialogs_iconify_with_main "
1681 << convert<string>(dialogs_iconify_with_main) << '\n';
1685 case RC_SCREEN_FONT_ROMAN:
1686 if (ignore_system_lyxrc ||
1687 roman_font_name != system_lyxrc.roman_font_name) {
1688 os << "\\screen_font_roman \"" << roman_font_name
1693 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1694 if (ignore_system_lyxrc ||
1695 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1696 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1701 case RC_SCREEN_FONT_SANS:
1702 if (ignore_system_lyxrc ||
1703 sans_font_name != system_lyxrc.sans_font_name) {
1704 os << "\\screen_font_sans \"" << sans_font_name
1709 case RC_SCREEN_FONT_SANS_FOUNDRY:
1710 if (ignore_system_lyxrc ||
1711 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1712 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1717 case RC_SCREEN_FONT_TYPEWRITER:
1718 if (ignore_system_lyxrc ||
1719 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1720 os << "\\screen_font_typewriter \""
1721 << typewriter_font_name << "\"\n";
1725 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1726 if (ignore_system_lyxrc ||
1727 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1728 os << "\\screen_font_typewriter_foundry \""
1729 << typewriter_font_foundry << "\"\n";
1734 case RC_SCREEN_FONT_SCALABLE:
1735 if (ignore_system_lyxrc ||
1736 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1737 os << "\\screen_font_scalable "
1738 << convert<string>(use_scalable_fonts)
1743 case RC_SCREEN_FONT_SIZES:
1744 if (ignore_system_lyxrc ||
1745 font_sizes[FONT_SIZE_TINY]
1746 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1747 font_sizes[FONT_SIZE_SCRIPT]
1748 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1749 font_sizes[FONT_SIZE_FOOTNOTE]
1750 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1751 font_sizes[FONT_SIZE_SMALL]
1752 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1753 font_sizes[FONT_SIZE_NORMAL]
1754 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1755 font_sizes[FONT_SIZE_LARGE]
1756 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1757 font_sizes[FONT_SIZE_LARGER]
1758 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1759 font_sizes[FONT_SIZE_LARGEST]
1760 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1761 font_sizes[FONT_SIZE_HUGE]
1762 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1763 font_sizes[FONT_SIZE_HUGER]
1764 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1765 os.setf(ios::fixed);
1767 os << "\\screen_font_sizes"
1768 << ' ' << font_sizes[FONT_SIZE_TINY]
1769 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1770 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1771 << ' ' << font_sizes[FONT_SIZE_SMALL]
1772 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1773 << ' ' << font_sizes[FONT_SIZE_LARGE]
1774 << ' ' << font_sizes[FONT_SIZE_LARGER]
1775 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1776 << ' ' << font_sizes[FONT_SIZE_HUGE]
1777 << ' ' << font_sizes[FONT_SIZE_HUGER]
1782 case RC_FULL_SCREEN_LIMIT:
1783 if (ignore_system_lyxrc ||
1784 full_screen_limit != system_lyxrc.full_screen_limit) {
1785 os << "\\fullscreen_limit "
1786 << convert<string>(full_screen_limit)
1791 case RC_FULL_SCREEN_TOOLBARS:
1792 if (ignore_system_lyxrc ||
1793 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1794 os << "\\fullscreen_toolbars "
1795 << convert<string>(full_screen_toolbars)
1800 case RC_FULL_SCREEN_SCROLLBAR:
1801 if (ignore_system_lyxrc ||
1802 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1803 os << "\\fullscreen_scrollbar "
1804 << convert<string>(full_screen_scrollbar)
1809 case RC_FULL_SCREEN_TABBAR:
1810 if (ignore_system_lyxrc ||
1811 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1812 os << "\\fullscreen_tabbar "
1813 << convert<string>(full_screen_tabbar)
1818 case RC_FULL_SCREEN_MENUBAR:
1819 if (ignore_system_lyxrc ||
1820 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1821 os << "\\fullscreen_menubar "
1822 << convert<string>(full_screen_menubar)
1827 case RC_FULL_SCREEN_WIDTH:
1828 if (ignore_system_lyxrc ||
1829 full_screen_width != system_lyxrc.full_screen_width) {
1830 os << "\\fullscreen_width "
1831 << convert<string>(full_screen_width)
1836 case RC_OPEN_BUFFERS_IN_TABS:
1837 if (ignore_system_lyxrc ||
1838 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1839 os << "\\open_buffers_in_tabs "
1840 << convert<string>(open_buffers_in_tabs)
1843 case RC_SINGLE_CLOSE_TAB_BUTTON:
1844 if (ignore_system_lyxrc ||
1845 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1846 os << "\\single_close_tab_button "
1847 << convert<string>(single_close_tab_button)
1854 << "# COLOR SECTION ###################################\n"
1858 for (int i = 0; i < Color_ignore; ++i) {
1859 ColorCode lc = static_cast<ColorCode>(i);
1860 string const col = lcolor.getX11Name(lc);
1861 if (ignore_system_lyxrc
1862 || col != system_lcolor.getX11Name(lc)) {
1863 os << "\\set_color \""
1864 << lcolor.getLyXName(lc) << "\" \""
1872 << "# PRINTER SECTION ###################################\n"
1876 if (ignore_system_lyxrc ||
1877 printer != system_lyxrc.printer) {
1878 os << "\\printer \"" << printer << "\"\n";
1882 case RC_PRINT_ADAPTOUTPUT:
1883 if (ignore_system_lyxrc ||
1884 print_adapt_output != system_lyxrc.print_adapt_output) {
1885 os << "\\print_adapt_output "
1886 << convert<string>(print_adapt_output)
1891 case RC_PRINT_COMMAND:
1892 if (ignore_system_lyxrc ||
1893 print_command != system_lyxrc.print_command) {
1894 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1898 case RC_PRINTEXSTRAOPTIONS:
1899 if (ignore_system_lyxrc ||
1900 print_extra_options != system_lyxrc.print_extra_options) {
1901 os << "\\print_extra_options \"" << print_extra_options
1906 case RC_PRINTSPOOL_COMMAND:
1907 if (ignore_system_lyxrc ||
1908 print_spool_command != system_lyxrc.print_spool_command) {
1909 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1914 case RC_PRINTSPOOL_PRINTERPREFIX:
1915 if (ignore_system_lyxrc ||
1916 print_spool_printerprefix
1917 != system_lyxrc.print_spool_printerprefix) {
1918 os << "\\print_spool_printerprefix \""
1919 << print_spool_printerprefix << "\"\n";
1923 case RC_PRINTEVENPAGEFLAG:
1924 if (ignore_system_lyxrc ||
1925 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1926 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1931 case RC_PRINTODDPAGEFLAG:
1932 if (ignore_system_lyxrc ||
1933 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1934 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1939 case RC_PRINTREVERSEFLAG:
1940 if (ignore_system_lyxrc ||
1941 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1942 os << "\\print_reverse_flag \"" << print_reverse_flag
1947 case RC_PRINTLANDSCAPEFLAG:
1948 if (ignore_system_lyxrc ||
1949 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1950 os << "\\print_landscape_flag \"" << print_landscape_flag
1955 case RC_PRINTPAGERANGEFLAG:
1956 if (ignore_system_lyxrc ||
1957 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1958 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1963 case RC_PRINTCOPIESFLAG:
1964 if (ignore_system_lyxrc ||
1965 print_copies_flag != system_lyxrc.print_copies_flag) {
1966 os << "\\print_copies_flag \"" << print_copies_flag
1971 case RC_PRINTCOLLCOPIESFLAG:
1972 if (ignore_system_lyxrc ||
1973 print_collcopies_flag
1974 != system_lyxrc.print_collcopies_flag) {
1975 os << "\\print_collcopies_flag \""
1976 << print_collcopies_flag
1981 case RC_PRINTPAPERFLAG:
1982 if (ignore_system_lyxrc ||
1983 print_paper_flag != system_lyxrc.print_paper_flag) {
1984 os << "\\print_paper_flag \"" << print_paper_flag
1989 case RC_PRINTPAPERDIMENSIONFLAG:
1990 if (ignore_system_lyxrc ||
1991 print_paper_dimension_flag
1992 != system_lyxrc.print_paper_dimension_flag) {
1993 os << "\\print_paper_dimension_flag \""
1994 << print_paper_dimension_flag << "\"\n";
1998 case RC_PRINTTOPRINTER:
1999 if (ignore_system_lyxrc ||
2000 print_to_printer != system_lyxrc.print_to_printer) {
2001 os << "\\print_to_printer \"" << print_to_printer
2006 case RC_PRINTTOFILE:
2007 if (ignore_system_lyxrc ||
2008 print_to_file != system_lyxrc.print_to_file) {
2009 string const path = os::external_path(print_to_file);
2010 os << "\\print_to_file \"" << path << "\"\n";
2014 case RC_PRINTFILEEXTENSION:
2015 if (ignore_system_lyxrc ||
2016 print_file_extension != system_lyxrc.print_file_extension) {
2017 os << "\\print_file_extension \""
2018 << print_file_extension
2025 << "# TEX SECTION #######################################\n"
2028 case RC_FONT_ENCODING:
2029 if (ignore_system_lyxrc ||
2030 fontenc != system_lyxrc.fontenc) {
2031 os << "\\font_encoding \"" << fontenc << "\"\n";
2037 << "# FILE SECTION ######################################\n"
2040 case RC_DOCUMENTPATH:
2041 if (ignore_system_lyxrc ||
2042 document_path != system_lyxrc.document_path) {
2043 string const path = os::external_path(document_path);
2044 os << "\\document_path \"" << path << "\"\n";
2048 case RC_USELASTFILEPOS:
2049 if (ignore_system_lyxrc ||
2050 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2051 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2056 case RC_LOADSESSION:
2057 if (ignore_system_lyxrc ||
2058 load_session != system_lyxrc.load_session) {
2059 os << "\\load_session " << convert<string>(load_session)
2064 case RC_MOUSE_WHEEL_SPEED:
2065 if (ignore_system_lyxrc ||
2066 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2067 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2071 case RC_COMPLETION_INLINE_DELAY:
2072 if (ignore_system_lyxrc ||
2073 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2074 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2078 case RC_COMPLETION_INLINE_MATH:
2079 if (ignore_system_lyxrc ||
2080 completion_inline_math != system_lyxrc.completion_inline_math) {
2081 os << "\\completion_inline_math "
2082 << convert<string>(completion_inline_math) << '\n';
2086 case RC_COMPLETION_INLINE_TEXT:
2087 if (ignore_system_lyxrc ||
2088 completion_inline_text != system_lyxrc.completion_inline_text) {
2089 os << "\\completion_inline_text "
2090 << convert<string>(completion_inline_text) << '\n';
2094 case RC_COMPLETION_INLINE_DOTS:
2095 if (ignore_system_lyxrc ||
2096 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2097 os << "\\completion_inline_dots "
2098 << convert<string>(completion_inline_dots) << '\n';
2102 case RC_AUTOCORRECTION_MATH:
2103 if (ignore_system_lyxrc ||
2104 autocorrection_math != system_lyxrc.autocorrection_math) {
2105 os << "\\autocorrection_math "
2106 << convert<string>(autocorrection_math) << '\n';
2110 case RC_COMPLETION_POPUP_DELAY:
2111 if (ignore_system_lyxrc ||
2112 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2113 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2117 case RC_COMPLETION_POPUP_MATH:
2118 if (ignore_system_lyxrc ||
2119 completion_popup_math != system_lyxrc.completion_popup_math) {
2120 os << "\\completion_popup_math "
2121 << convert<string>(completion_popup_math) << '\n';
2125 case RC_COMPLETION_POPUP_TEXT:
2126 if (ignore_system_lyxrc ||
2127 completion_popup_text != system_lyxrc.completion_popup_text) {
2128 os << "\\completion_popup_text "
2129 << convert<string>(completion_popup_text) << '\n';
2133 case RC_COMPLETION_CURSOR_TEXT:
2134 if (ignore_system_lyxrc ||
2135 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2136 os << "\\completion_cursor_text "
2137 << convert<string>(completion_cursor_text) << '\n';
2141 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2142 if (ignore_system_lyxrc ||
2143 completion_popup_after_complete
2144 != system_lyxrc.completion_popup_after_complete) {
2145 os << "\\completion_popup_after_complete "
2146 << convert<string>(completion_popup_after_complete) << '\n';
2150 case RC_NUMLASTFILES:
2151 if (ignore_system_lyxrc ||
2152 num_lastfiles != system_lyxrc.num_lastfiles) {
2153 os << "\\num_lastfiles " << num_lastfiles << '\n';
2157 case RC_CHECKLASTFILES:
2158 if (ignore_system_lyxrc ||
2159 check_lastfiles != system_lyxrc.check_lastfiles) {
2160 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2165 case RC_EXAMPLEPATH:
2166 if (ignore_system_lyxrc ||
2167 example_path != system_lyxrc.example_path) {
2168 string const path = os::external_path(example_path);
2169 os << "\\example_path \"" << path << "\"\n";
2173 case RC_TEMPLATEPATH:
2174 if (ignore_system_lyxrc ||
2175 template_path != system_lyxrc.template_path) {
2176 string const path = os::external_path(template_path);
2177 os << "\\template_path \"" << path << "\"\n";
2181 case RC_TEMPDIRPATH:
2182 if (ignore_system_lyxrc ||
2183 tempdir_path != system_lyxrc.tempdir_path) {
2184 string const path = os::external_path(tempdir_path);
2185 os << "\\tempdir_path \"" << path << "\"\n";
2189 case RC_THESAURUSDIRPATH:
2190 if (ignore_system_lyxrc ||
2191 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2192 string const path = os::external_path(thesaurusdir_path);
2193 os << "\\thesaurusdir_path \"" << path << "\"\n";
2197 case RC_HUNSPELLDIR_PATH:
2198 if (ignore_system_lyxrc ||
2199 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2200 string const path = os::external_path(hunspelldir_path);
2201 os << "\\hunspelldir_path \"" << path << "\"\n";
2209 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2212 case RC_PLAINTEXT_LINELEN:
2213 if (ignore_system_lyxrc ||
2214 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2215 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2219 case RC_MAKE_BACKUP:
2220 if (ignore_system_lyxrc ||
2221 make_backup != system_lyxrc.make_backup) {
2222 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2226 case RC_SAVE_COMPRESSED:
2227 if (ignore_system_lyxrc ||
2228 save_compressed != system_lyxrc.save_compressed) {
2229 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2233 case RC_BACKUPDIR_PATH:
2234 if (ignore_system_lyxrc ||
2235 backupdir_path != system_lyxrc.backupdir_path) {
2236 string const path = os::external_path(backupdir_path);
2237 os << "\\backupdir_path \"" << path << "\"\n";
2243 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2247 << "# SPELLCHECKER SECTION ##############################\n"
2250 case RC_SPELL_COMMAND:
2251 case RC_USE_SPELL_LIB:
2255 case RC_ACCEPT_COMPOUND:
2256 if (ignore_system_lyxrc ||
2257 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2258 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2263 case RC_USE_ALT_LANG:
2268 if (ignore_system_lyxrc ||
2269 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2270 os << "\\alternate_language \"" << spellchecker_alt_lang
2275 case RC_USE_ESC_CHARS:
2279 if (ignore_system_lyxrc ||
2280 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2281 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2285 case RC_USE_PERS_DICT:
2289 case RC_USE_TOOLTIP:
2290 if (ignore_system_lyxrc ||
2291 use_tooltip != system_lyxrc.use_tooltip) {
2292 os << "\\use_tooltip "
2293 << convert<string>(use_tooltip)
2298 case RC_USE_PIXMAP_CACHE:
2299 if (ignore_system_lyxrc ||
2300 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2301 os << "\\use_pixmap_cache "
2302 << convert<string>(use_pixmap_cache)
2311 case RC_USE_INP_ENC:
2317 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2322 case RC_SPELLCHECKER:
2323 if (ignore_system_lyxrc ||
2324 spellchecker != system_lyxrc.spellchecker) {
2325 os << "\\spellchecker " << spellchecker << '\n';
2330 case RC_SPELLCHECK_CONTINUOUSLY:
2331 if (ignore_system_lyxrc ||
2332 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2333 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2339 case RC_SPELLCHECK_NOTES:
2340 if (ignore_system_lyxrc ||
2341 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2342 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2348 case RC_RTL_SUPPORT:
2349 if (ignore_system_lyxrc ||
2350 rtl_support != system_lyxrc.rtl_support) {
2351 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2355 case RC_VISUAL_CURSOR:
2356 if (ignore_system_lyxrc ||
2357 visual_cursor != system_lyxrc.visual_cursor) {
2358 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2362 case RC_LANGUAGE_PACKAGE:
2363 if (ignore_system_lyxrc ||
2364 language_package != system_lyxrc.language_package) {
2365 os << "\\language_package \"" << language_package
2370 case RC_LANGUAGE_GLOBAL_OPTIONS:
2371 if (ignore_system_lyxrc ||
2372 language_global_options
2373 != system_lyxrc.language_global_options) {
2374 os << "\\language_global_options \""
2375 << convert<string>(language_global_options)
2380 case RC_LANGUAGE_USE_BABEL:
2381 if (ignore_system_lyxrc ||
2382 language_use_babel != system_lyxrc.language_use_babel) {
2383 os << "\\language_use_babel \""
2384 << convert<string>(language_use_babel)
2389 case RC_LANGUAGE_COMMAND_BEGIN:
2390 if (ignore_system_lyxrc ||
2391 language_command_begin
2392 != system_lyxrc.language_command_begin) {
2393 os << "\\language_command_begin \""
2394 << language_command_begin
2399 case RC_LANGUAGE_COMMAND_END:
2400 if (ignore_system_lyxrc ||
2401 language_command_end
2402 != system_lyxrc.language_command_end) {
2403 os << "\\language_command_end \"" << language_command_end
2408 case RC_LANGUAGE_COMMAND_LOCAL:
2409 if (ignore_system_lyxrc ||
2410 language_command_local
2411 != system_lyxrc.language_command_local) {
2412 os << "\\language_command_local \""
2413 << language_command_local
2418 case RC_LANGUAGE_AUTO_BEGIN:
2419 if (ignore_system_lyxrc ||
2420 language_auto_begin != system_lyxrc.language_auto_begin) {
2421 os << "\\language_auto_begin "
2422 << convert<string>(language_auto_begin) << '\n';
2426 case RC_LANGUAGE_AUTO_END:
2427 if (ignore_system_lyxrc ||
2428 language_auto_end != system_lyxrc.language_auto_end) {
2429 os << "\\language_auto_end "
2430 << convert<string>(language_auto_end) << '\n';
2434 case RC_MARK_FOREIGN_LANGUAGE:
2435 if (ignore_system_lyxrc ||
2436 mark_foreign_language
2437 != system_lyxrc.mark_foreign_language) {
2438 os << "\\mark_foreign_language " <<
2439 convert<string>(mark_foreign_language) << '\n';
2445 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2448 case RC_AUTO_NUMBER:
2449 if (ignore_system_lyxrc ||
2450 auto_number != system_lyxrc.auto_number) {
2451 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2455 case RC_DEFAULT_LANGUAGE:
2456 if (ignore_system_lyxrc ||
2457 default_language != system_lyxrc.default_language) {
2458 os << "\\default_language " << default_language << '\n';
2462 case RC_GUI_LANGUAGE:
2463 if (ignore_system_lyxrc ||
2464 gui_language != system_lyxrc.gui_language) {
2465 os << "\\gui_language " << gui_language << '\n';
2471 << "# FORMATS SECTION ##########################\n"
2475 // New/modified formats
2476 for (Formats::const_iterator cit = formats.begin();
2477 cit != formats.end(); ++cit) {
2478 Format const * format =
2479 system_formats.getFormat(cit->name());
2481 format->extension() != cit->extension() ||
2482 format->prettyname() != cit->prettyname() ||
2483 format->shortcut() != cit->shortcut() ||
2484 format->viewer() != cit->viewer() ||
2485 format->editor() != cit->editor() ||
2486 format->documentFormat() != cit->documentFormat() ||
2487 format->vectorFormat() != cit->vectorFormat()) {
2488 os << "\\format \"" << cit->name() << "\" \""
2489 << cit->extension() << "\" \""
2490 << cit->prettyname() << "\" \""
2491 << cit->shortcut() << "\" \""
2492 << escapeCommand(cit->viewer()) << "\" \""
2493 << escapeCommand(cit->editor()) << "\" \"";
2494 vector<string> flags;
2495 if (cit->documentFormat())
2496 flags.push_back("document");
2497 if (cit->vectorFormat())
2498 flags.push_back("vector");
2499 os << getStringFromVector(flags);
2504 // Look for deleted formats
2505 for (Formats::const_iterator cit = system_formats.begin();
2506 cit != system_formats.end(); ++cit)
2507 if (!formats.getFormat(cit->name()))
2508 os << "\\format \"" << cit->name()
2509 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2512 case RC_VIEWER_ALTERNATIVES: {
2513 Alternatives::const_iterator it = viewer_alternatives.begin();
2514 Alternatives::const_iterator const en = viewer_alternatives.end();
2515 Alternatives::const_iterator const sysend =
2516 system_lyxrc.viewer_alternatives.end();
2517 for (; it != en; ++it) {
2518 string const & fmt = it->first;
2519 CommandSet const & cmd = it->second;
2520 CommandSet::const_iterator sit = cmd.begin();
2521 CommandSet::const_iterator const sen = cmd.end();
2522 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2523 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2524 system_lyxrc.viewer_alternatives.find(fmt);
2525 for (; sit != sen; ++sit) {
2526 string const & cmd = *sit;
2527 if (ignore_system_lyxrc
2528 || sysfmt == sysend // format not found
2529 || sysfmt->second.count(cmd) == 0 // this command not found
2531 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2537 case RC_EDITOR_ALTERNATIVES: {
2538 Alternatives::const_iterator it = editor_alternatives.begin();
2539 Alternatives::const_iterator const en = editor_alternatives.end();
2540 Alternatives::const_iterator const sysend =
2541 system_lyxrc.editor_alternatives.end();
2542 for (; it != en; ++it) {
2543 string const & fmt = it->first;
2544 CommandSet const & cmd = it->second;
2545 CommandSet::const_iterator sit = cmd.begin();
2546 CommandSet::const_iterator const sen = cmd.end();
2547 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2548 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2549 system_lyxrc.editor_alternatives.find(fmt);
2550 for (; sit != sen; ++sit) {
2551 string const & cmd = *sit;
2552 if (ignore_system_lyxrc
2553 || sysfmt == sysend // format not found
2554 || sysfmt->second.count(cmd) == 0 // this command not found
2556 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2562 case RC_DEFAULT_VIEW_FORMAT:
2563 if (ignore_system_lyxrc ||
2564 default_view_format != system_lyxrc.default_view_format) {
2565 os << "\\default_view_format " << default_view_format << '\n';
2575 << "# CONVERTERS SECTION ##########################\n"
2579 // Look for new converters
2580 for (Converters::const_iterator cit = theConverters().begin();
2581 cit != theConverters().end(); ++cit) {
2582 Converter const * converter =
2583 theSystemConverters().getConverter(cit->from,
2586 converter->command != cit->command ||
2587 converter->flags != cit->flags)
2588 os << "\\converter \"" << cit->from << "\" \""
2589 << cit->to << "\" \""
2590 << escapeCommand(cit->command) << "\" \""
2591 << cit->flags << "\"\n";
2594 // New/modifed converters
2595 for (Converters::const_iterator cit = theSystemConverters().begin();
2596 cit != theSystemConverters().end(); ++cit)
2597 if (!theConverters().getConverter(cit->from, cit->to))
2598 os << "\\converter \"" << cit->from
2599 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2606 << "# COPIERS SECTION ##########################\n"
2609 // Look for new movers
2610 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2611 Movers::const_iterator const sysend = theSystemMovers().end();
2612 Movers::const_iterator it = theMovers().begin();
2613 Movers::const_iterator end = theMovers().end();
2615 for (; it != end; ++it) {
2616 Movers::const_iterator const sysit =
2617 find_if(sysbegin, sysend, SameMover(*it));
2618 if (sysit == sysend) {
2619 string const & fmt = it->first;
2620 string const & command =
2621 it->second.command();
2623 os << "\\copier " << fmt
2624 << " \"" << escapeCommand(command) << "\"\n";
2630 // We don't actually delete SpecialisedMover(s) from the
2631 // map, just clear their 'command', so there's no need
2632 // to test for anything else.
2639 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2641 // Why the switch you might ask. It is a trick to ensure that all
2642 // the elements in the LyXRCTags enum is handled. As you can see
2643 // there are no breaks at all. So it is just a huge fall-through.
2644 // The nice thing is that we will get a warning from the compiler
2645 // if we forget an element.
2646 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2648 case LyXRC::RC_ACCEPT_COMPOUND:
2649 case LyXRC::RC_ALT_LANG:
2650 case LyXRC::RC_PLAINTEXT_LINELEN:
2651 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2652 case LyXRC::RC_AUTOCORRECTION_MATH:
2653 case LyXRC::RC_AUTOREGIONDELETE:
2654 case LyXRC::RC_AUTORESET_OPTIONS:
2655 case LyXRC::RC_AUTOSAVE:
2656 case LyXRC::RC_AUTO_NUMBER:
2657 case LyXRC::RC_BACKUPDIR_PATH:
2658 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2659 case LyXRC::RC_BIBTEX_COMMAND:
2660 case LyXRC::RC_BINDFILE:
2661 case LyXRC::RC_CHECKLASTFILES:
2662 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2663 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2664 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2665 case LyXRC::RC_COMPLETION_INLINE_MATH:
2666 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2667 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2668 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2669 case LyXRC::RC_COMPLETION_POPUP_MATH:
2670 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2671 case LyXRC::RC_USELASTFILEPOS:
2672 case LyXRC::RC_LOADSESSION:
2673 case LyXRC::RC_CHKTEX_COMMAND:
2674 case LyXRC::RC_CONVERTER:
2675 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2676 case LyXRC::RC_COPIER:
2677 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2678 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2679 case LyXRC::RC_DATE_INSERT_FORMAT:
2680 case LyXRC::RC_DEFAULT_LANGUAGE:
2681 case LyXRC::RC_GUI_LANGUAGE:
2682 case LyXRC::RC_DEFAULT_PAPERSIZE:
2683 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2684 case LyXRC::RC_DEFFILE:
2685 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2686 case LyXRC::RC_DISPLAY_GRAPHICS:
2687 case LyXRC::RC_DOCUMENTPATH:
2688 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2689 FileName path(lyxrc_new.document_path);
2690 if (path.exists() && path.isDirectory())
2691 package().document_dir() = FileName(lyxrc.document_path);
2693 case LyXRC::RC_EDITOR_ALTERNATIVES:
2694 case LyXRC::RC_ESC_CHARS:
2695 case LyXRC::RC_EXAMPLEPATH:
2696 case LyXRC::RC_FONT_ENCODING:
2697 case LyXRC::RC_FORMAT:
2698 case LyXRC::RC_GROUP_LAYOUTS:
2699 case LyXRC::RC_HUNSPELLDIR_PATH:
2700 case LyXRC::RC_INDEX_ALTERNATIVES:
2701 case LyXRC::RC_INDEX_COMMAND:
2702 case LyXRC::RC_JBIBTEX_COMMAND:
2703 case LyXRC::RC_JINDEX_COMMAND:
2704 case LyXRC::RC_NOMENCL_COMMAND:
2705 case LyXRC::RC_INPUT:
2706 case LyXRC::RC_KBMAP:
2707 case LyXRC::RC_KBMAP_PRIMARY:
2708 case LyXRC::RC_KBMAP_SECONDARY:
2709 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2710 case LyXRC::RC_LANGUAGE_AUTO_END:
2711 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2712 case LyXRC::RC_LANGUAGE_COMMAND_END:
2713 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2714 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2715 case LyXRC::RC_LANGUAGE_PACKAGE:
2716 case LyXRC::RC_LANGUAGE_USE_BABEL:
2717 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2718 case LyXRC::RC_MACRO_EDIT_STYLE:
2719 case LyXRC::RC_MAKE_BACKUP:
2720 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2721 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2722 case LyXRC::RC_NUMLASTFILES:
2723 case LyXRC::RC_PARAGRAPH_MARKERS:
2724 case LyXRC::RC_PATH_PREFIX:
2725 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2726 prependEnvPath("PATH", lyxrc.path_prefix);
2728 case LyXRC::RC_PERS_DICT:
2729 case LyXRC::RC_PREVIEW:
2730 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2731 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2732 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2733 case LyXRC::RC_PRINTCOPIESFLAG:
2734 case LyXRC::RC_PRINTER:
2735 case LyXRC::RC_PRINTEVENPAGEFLAG:
2736 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2737 case LyXRC::RC_PRINTFILEEXTENSION:
2738 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2739 case LyXRC::RC_PRINTODDPAGEFLAG:
2740 case LyXRC::RC_PRINTPAGERANGEFLAG:
2741 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2742 case LyXRC::RC_PRINTPAPERFLAG:
2743 case LyXRC::RC_PRINTREVERSEFLAG:
2744 case LyXRC::RC_PRINTSPOOL_COMMAND:
2745 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2746 case LyXRC::RC_PRINTTOFILE:
2747 case LyXRC::RC_PRINTTOPRINTER:
2748 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2749 case LyXRC::RC_PRINT_COMMAND:
2750 case LyXRC::RC_RTL_SUPPORT:
2751 case LyXRC::RC_SAVE_COMPRESSED:
2752 case LyXRC::RC_SCREEN_DPI:
2753 case LyXRC::RC_SCREEN_FONT_ROMAN:
2754 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2755 case LyXRC::RC_SCREEN_FONT_SANS:
2756 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2757 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2758 case LyXRC::RC_SCREEN_FONT_SIZES:
2759 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2760 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2761 case LyXRC::RC_GEOMETRY_SESSION:
2762 case LyXRC::RC_SCREEN_ZOOM:
2763 case LyXRC::RC_SERVERPIPE:
2764 case LyXRC::RC_SET_COLOR:
2765 case LyXRC::RC_SHOW_BANNER:
2766 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2767 case LyXRC::RC_SPELL_COMMAND:
2768 case LyXRC::RC_SPELLCHECKER:
2769 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2770 case LyXRC::RC_SPELLCHECK_NOTES:
2771 case LyXRC::RC_SPLITINDEX_COMMAND:
2772 case LyXRC::RC_TEMPDIRPATH:
2773 case LyXRC::RC_TEMPLATEPATH:
2774 case LyXRC::RC_TEX_ALLOWS_SPACES:
2775 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2776 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2777 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2779 case LyXRC::RC_THESAURUSDIRPATH:
2780 case LyXRC::RC_UIFILE:
2781 case LyXRC::RC_USER_EMAIL:
2782 case LyXRC::RC_USER_NAME:
2783 case LyXRC::RC_USETEMPDIR:
2784 case LyXRC::RC_USE_ALT_LANG:
2785 case LyXRC::RC_USE_CONVERTER_CACHE:
2786 case LyXRC::RC_USE_ESC_CHARS:
2787 case LyXRC::RC_USE_INP_ENC:
2788 case LyXRC::RC_USE_PERS_DICT:
2789 case LyXRC::RC_USE_TOOLTIP:
2790 case LyXRC::RC_USE_PIXMAP_CACHE:
2791 case LyXRC::RC_USE_SPELL_LIB:
2792 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2793 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2794 case LyXRC::RC_SORT_LAYOUTS:
2795 case LyXRC::RC_FULL_SCREEN_LIMIT:
2796 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2797 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2798 case LyXRC::RC_FULL_SCREEN_TABBAR:
2799 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2800 case LyXRC::RC_FULL_SCREEN_WIDTH:
2801 case LyXRC::RC_VISUAL_CURSOR:
2802 case LyXRC::RC_VIEWER:
2803 case LyXRC::RC_VIEWER_ALTERNATIVES:
2804 case LyXRC::RC_LAST:
2811 string const LyXRC::getDescription(LyXRCTags tag)
2816 case RC_ACCEPT_COMPOUND:
2817 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2821 case RC_USE_ALT_LANG:
2822 str = _("Specify an alternate language. The default is to use the language of the document.");
2825 case RC_PLAINTEXT_ROFF_COMMAND:
2826 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.");
2829 case RC_PLAINTEXT_LINELEN:
2830 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.");
2833 case RC_AUTOREGIONDELETE:
2834 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2837 case RC_AUTORESET_OPTIONS:
2838 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2842 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2845 case RC_AUTO_NUMBER:
2848 case RC_BACKUPDIR_PATH:
2849 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.");
2852 case RC_BIBTEX_COMMAND:
2853 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2856 case RC_JBIBTEX_COMMAND:
2857 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2861 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2864 case RC_CHECKLASTFILES:
2865 str = _("Select to check whether the lastfiles still exist.");
2868 case RC_CHKTEX_COMMAND:
2869 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2878 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2879 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.");
2882 case RC_SCROLL_BELOW_DOCUMENT:
2883 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");
2886 case RC_MAC_LIKE_WORD_MOVEMENT:
2887 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2890 case RC_SHOW_MACRO_LABEL:
2891 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2894 case RC_DATE_INSERT_FORMAT:
2895 //xgettext:no-c-format
2896 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2900 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2903 case RC_DEFAULT_VIEW_FORMAT:
2904 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2907 case RC_DEFAULT_LANGUAGE:
2908 str = _("New documents will be assigned this language.");
2911 case RC_DEFAULT_PAPERSIZE:
2912 str = _("Specify the default paper size.");
2915 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2916 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2919 case RC_DISPLAY_GRAPHICS:
2920 str = _("Select how LyX will display any graphics.");
2923 case RC_DOCUMENTPATH:
2924 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2928 case RC_USE_ESC_CHARS:
2929 str = _("Specify additional chars that can be part of a word.");
2932 case RC_EXAMPLEPATH:
2933 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2936 case RC_FONT_ENCODING:
2937 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2943 case RC_INDEX_COMMAND:
2944 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\".");
2947 case RC_JINDEX_COMMAND:
2948 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2951 case RC_NOMENCL_COMMAND:
2952 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2959 case RC_KBMAP_PRIMARY:
2960 case RC_KBMAP_SECONDARY:
2961 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.");
2964 case RC_LANGUAGE_AUTO_BEGIN:
2965 str = _("Select if a language switching command is needed at the beginning of the document.");
2968 case RC_LANGUAGE_AUTO_END:
2969 str = _("Select if a language switching command is needed at the end of the document.");
2972 case RC_LANGUAGE_COMMAND_BEGIN:
2973 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.");
2976 case RC_LANGUAGE_COMMAND_END:
2977 str = _("The LaTeX command for changing back to the language of the document.");
2980 case RC_LANGUAGE_COMMAND_LOCAL:
2981 str = _("The LaTeX command for local changing of the language.");
2984 case RC_LANGUAGE_GLOBAL_OPTIONS:
2985 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2988 case RC_LANGUAGE_PACKAGE:
2989 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2992 case RC_LANGUAGE_USE_BABEL:
2993 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2996 case RC_USELASTFILEPOS:
2997 str = _("De-select if you do not want LyX to scroll to saved position.");
3000 case RC_LOADSESSION:
3001 str = _("De-select to prevent loading files opened from the last LyX session.");
3004 case RC_MAKE_BACKUP:
3005 str = _("De-select if you don't want LyX to create backup files.");
3008 case RC_MARK_FOREIGN_LANGUAGE:
3009 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3012 case RC_MOUSE_WHEEL_SPEED:
3013 str = bformat(_("The scrolling speed of the mouse wheel."),
3017 case RC_COMPLETION_POPUP_DELAY:
3018 str = _("The completion popup delay.");
3021 case RC_COMPLETION_POPUP_MATH:
3022 str = _("Select to display the completion popup in math mode.");
3025 case RC_COMPLETION_POPUP_TEXT:
3026 str = _("Select to display the completion popup in text mode.");
3029 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3030 str = _("Show the completion popup without delay after non-unique completion attempt.");
3033 case RC_COMPLETION_POPUP_TEXT:
3034 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3037 case RC_COMPLETION_POPUP_DELAY:
3038 str = _("The inline completion delay.");
3041 case RC_COMPLETION_INLINE_MATH:
3042 str = _("Select to display the inline completion in math mode.");
3045 case RC_COMPLETION_INLINE_TEXT:
3046 str = _("Select to display the inline completion in text mode.");
3049 case RC_COMPLETION_INLINE_DOTS:
3050 str = _("Use \"...\" to shorten long completions.");
3053 case RC_AUTOCORRECTION_MATH:
3054 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3057 case RC_NUMLASTFILES:
3058 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3062 case RC_PATH_PREFIX:
3063 str = _("Specify those directories which should be "
3064 "prepended to the PATH environment variable. "
3065 "Use the OS native format.");
3069 str = _("Shows a typeset preview of things such as math");
3072 case RC_PREVIEW_HASHED_LABELS:
3073 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3076 case RC_PREVIEW_SCALE_FACTOR:
3077 str = _("Scale the preview size to suit.");
3080 case RC_PRINTCOLLCOPIESFLAG:
3081 str = _("The option for specifying whether the copies should be collated.");
3084 case RC_PRINTCOPIESFLAG:
3085 str = _("The option for specifying the number of copies to print.");
3089 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3092 case RC_PRINTEVENPAGEFLAG:
3093 str = _("The option to print only even pages.");
3096 case RC_PRINTEXSTRAOPTIONS:
3097 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3100 case RC_PRINTFILEEXTENSION:
3101 str = _("Extension of printer program output file. Usually \".ps\".");
3104 case RC_PRINTLANDSCAPEFLAG:
3105 str = _("The option to print out in landscape.");
3108 case RC_PRINTODDPAGEFLAG:
3109 str = _("The option to print only odd pages.");
3112 case RC_PRINTPAGERANGEFLAG:
3113 str = _("The option for specifying a comma-separated list of pages to print.");
3116 case RC_PRINTPAPERDIMENSIONFLAG:
3117 str = _("Option to specify the dimensions of the print paper.");
3120 case RC_PRINTPAPERFLAG:
3121 str = _("The option to specify paper type.");
3124 case RC_PRINTREVERSEFLAG:
3125 str = _("The option to reverse the order of the pages printed.");
3128 case RC_PRINTSPOOL_COMMAND:
3129 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.");
3132 case RC_PRINTSPOOL_PRINTERPREFIX:
3133 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.");
3136 case RC_PRINTTOFILE:
3137 str = _("Option to pass to the print program to print to a file.");
3140 case RC_PRINTTOPRINTER:
3141 str = _("Option to pass to the print program to print on a specific printer.");
3144 case RC_PRINT_ADAPTOUTPUT:
3145 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3148 case RC_PRINT_COMMAND:
3149 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3152 case RC_RTL_SUPPORT:
3153 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3156 case RC_VISUAL_CURSOR:
3157 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3161 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3164 case RC_SCREEN_FONT_ROMAN:
3165 case RC_SCREEN_FONT_SANS:
3166 case RC_SCREEN_FONT_TYPEWRITER:
3167 str = _("The screen fonts used to display the text while editing.");
3170 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3171 case RC_SCREEN_FONT_SANS_FOUNDRY:
3172 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3175 case RC_SCREEN_FONT_SCALABLE:
3176 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.");
3179 case RC_SCREEN_FONT_SIZES:
3180 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3183 case RC_SCREEN_ZOOM:
3184 //xgettext:no-c-format
3185 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3188 case RC_GEOMETRY_SESSION:
3189 str = _("Allow session manager to save and restore windows geometry.");
3193 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3199 case RC_SHOW_BANNER:
3200 str = _("De-select if you don't want the startup banner.");
3203 case RC_TEMPDIRPATH:
3204 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3207 case RC_THESAURUSDIRPATH:
3208 str = _("This is the place where the files of the thesaurus library reside.");
3211 case RC_TEMPLATEPATH:
3212 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3215 case RC_TEX_ALLOWS_SPACES:
3218 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3222 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3234 case RC_USE_TOOLTIP:
3235 str = _("Enable the automatic appearance of tool tips in the work area.");
3238 case RC_USE_PIXMAP_CACHE:
3239 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3242 case RC_USE_SPELL_LIB:
3245 case RC_VIEWDVI_PAPEROPTION:
3246 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3261 // The global instance
3264 // The global copy of the system lyxrc entries (everything except preferences)