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 #if defined(USE_ASPELL)
289 spellchecker = "aspell";
290 #elif defined(USE_HUNSPELL)
291 spellchecker = "hunspell";
293 spellchecker = "aspell";
295 spellchecker_accept_compound = false;
296 spellcheck_continuously = false;
297 spellcheck_notes = true;
300 visual_cursor = false;
302 mark_foreign_language = true;
303 language_auto_begin = true;
304 language_auto_end = true;
305 language_global_options = true;
306 language_use_babel = true;
307 language_package = "\\usepackage{babel}";
308 language_command_begin = "\\selectlanguage{$$lang}";
309 language_command_local = "\\foreignlanguage{$$lang}{";
310 sort_layouts = false;
311 group_layouts = true;
312 default_language = "english";
313 gui_language = "auto";
315 windows_style_tex_paths = false;
316 tex_allows_spaces = false;
317 date_insert_format = "%x";
318 cursor_follows_scrollbar = false;
319 scroll_below_document = false;
320 paragraph_markers = false;
321 mac_like_word_movement = false;
322 macro_edit_style = MACRO_EDIT_INLINE_BOX;
323 dialogs_iconify_with_main = false;
324 preview = PREVIEW_OFF;
325 preview_hashed_labels = false;
326 preview_scale_factor = 1.0;
327 use_converter_cache = true;
329 use_pixmap_cache = false;
330 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
331 user_name = to_utf8(support::user_name());
332 user_email = to_utf8(support::user_email());
333 open_buffers_in_tabs = true;
334 single_close_tab_button = false;
335 forward_search_dvi = string();
336 forward_search_pdf = string();
337 export_overwrite = NO_FILES;
339 // Fullscreen settings
340 full_screen_limit = false;
341 full_screen_toolbars = true;
342 full_screen_tabbar = true;
343 full_screen_menubar = true;
344 full_screen_scrollbar = true;
345 full_screen_width = 700;
347 completion_cursor_text = true;
348 completion_popup_math = true;
349 completion_popup_text = false;
350 completion_popup_delay = 2.0;
351 completion_popup_after_complete = true;
352 autocorrection_math = false;
353 completion_inline_math = true;
354 completion_inline_text = false;
355 completion_inline_dots = -1;
356 completion_inline_delay = 0.2;
357 default_decimal_point = ".";
363 void oldFontFormat(string & family, string & foundry)
365 if (family.empty() || family[0] != '-')
367 foundry = token(family, '-', 1);
368 family = token(family, '-', 2);
376 int LyXRC::read(FileName const & filename)
378 Lexer lexrc(lyxrcTags);
379 if (lyxerr.debugging(Debug::PARSER))
380 lexrc.printTable(lyxerr);
382 lexrc.setFile(filename);
386 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
392 int LyXRC::read(istream & is)
394 Lexer lexrc(lyxrcTags);
395 if (lyxerr.debugging(Debug::PARSER))
396 lexrc.printTable(lyxerr);
402 LYXERR(Debug::LYXRC, "Reading istream...");
408 int LyXRC::read(Lexer & lexrc)
413 while (lexrc.isOK()) {
414 // By using two switches we take advantage of the compiler
415 // telling us if we have missed a LyXRCTags element in
416 // the second switch.
417 // Note that this also shows a problem with Lexer since it
418 // helps us avoid taking advantage of the strictness of the
421 int le = lexrc.lex();
423 case Lexer::LEX_UNDEF:
424 lexrc.printError("Unknown tag `$$Token'");
426 case Lexer::LEX_FEOF:
431 switch (static_cast<LyXRCTags>(le)) {
432 case RC_INPUT: // Include file
435 libFileSearch(string(),
438 lexrc.printError("Error reading "
439 "included file: " + tmp.absFileName());
445 bind_file = os::internal_path(lexrc.getString());
450 def_file = os::internal_path(lexrc.getString());
455 ui_file = os::internal_path(lexrc.getString());
458 case RC_AUTORESET_OPTIONS:
459 lexrc >> auto_reset_options;
462 case RC_DISPLAY_GRAPHICS:
464 display_graphics = lexrc.getString() == "true";
467 case RC_TEX_EXPECTS_WINDOWS_PATHS:
468 lexrc >> windows_style_tex_paths;
471 case RC_TEX_ALLOWS_SPACES:
472 lexrc >> tex_allows_spaces;
479 case RC_KBMAP_PRIMARY:
481 string const kmap(os::internal_path(lexrc.getString()));
482 if (!libFileSearch("kbd", kmap, "kmap").empty()
484 primary_kbmap = kmap;
486 lexrc.printError("LyX: Keymap `$$Token' not found");
491 case RC_KBMAP_SECONDARY:
493 string const kmap(os::internal_path(lexrc.getString()));
494 if (!libFileSearch("kbd", kmap, "kmap").empty()
496 secondary_kbmap = kmap;
498 lexrc.printError("LyX: Keymap `$$Token' not found");
503 case RC_FONT_ENCODING:
511 case RC_PRINT_COMMAND:
512 if (lexrc.next(true)) {
513 print_command = lexrc.getString();
517 case RC_PRINTEVENPAGEFLAG:
518 lexrc >> print_evenpage_flag;
521 case RC_PRINTODDPAGEFLAG:
522 lexrc >> print_oddpage_flag;
525 case RC_PRINTPAGERANGEFLAG:
526 lexrc >> print_pagerange_flag;
529 case RC_PRINTCOPIESFLAG:
530 lexrc >> print_copies_flag;
533 case RC_PRINTCOLLCOPIESFLAG:
534 lexrc >> print_collcopies_flag;
537 case RC_PRINTREVERSEFLAG:
538 lexrc >> print_reverse_flag;
541 case RC_PRINTLANDSCAPEFLAG:
542 lexrc >> print_landscape_flag;
545 case RC_PRINTTOPRINTER:
546 lexrc >> print_to_printer;
549 case RC_PRINT_ADAPTOUTPUT:
550 lexrc >> print_adapt_output;
555 print_to_file = os::internal_path(lexrc.getString());
559 case RC_PRINTFILEEXTENSION:
560 lexrc >> print_file_extension;
563 case RC_PRINTEXSTRAOPTIONS:
564 lexrc >> print_extra_options;
567 case RC_PRINTSPOOL_COMMAND:
568 if (lexrc.next(true)) {
569 print_spool_command = lexrc.getString();
573 case RC_PRINTSPOOL_PRINTERPREFIX:
574 lexrc >> print_spool_printerprefix;
577 case RC_PRINTPAPERDIMENSIONFLAG:
578 lexrc >> print_paper_dimension_flag;
581 case RC_PRINTPAPERFLAG:
582 lexrc >> print_paper_flag;
585 case RC_DEFAULT_PAPERSIZE:
587 string const size = ascii_lowercase(lexrc.getString());
588 if (size == "usletter")
589 default_papersize = PAPER_USLETTER;
590 else if (size == "legal")
591 default_papersize = PAPER_USLEGAL;
592 else if (size == "executive")
593 default_papersize = PAPER_USEXECUTIVE;
594 else if (size == "a3")
595 default_papersize = PAPER_A3;
596 else if (size == "a4")
597 default_papersize = PAPER_A4;
598 else if (size == "a5")
599 default_papersize = PAPER_A5;
600 else if (size == "b5")
601 default_papersize = PAPER_B5;
602 else if (size == "default")
603 default_papersize = PAPER_DEFAULT;
607 case RC_VIEWDVI_PAPEROPTION:
609 view_dvi_paper_option = lexrc.getString();
611 view_dvi_paper_option.erase();
614 case RC_CHKTEX_COMMAND:
615 if (lexrc.next(true)) {
616 chktex_command = lexrc.getString();
620 case RC_BIBTEX_ALTERNATIVES:
621 if (lexrc.next(true)) {
622 bibtex_alternatives.insert(lexrc.getString());
626 case RC_BIBTEX_COMMAND:
627 if (lexrc.next(true)) {
628 bibtex_command = lexrc.getString();
632 case RC_JBIBTEX_COMMAND:
633 if (lexrc.next(true)) {
634 jbibtex_command = lexrc.getString();
638 case RC_INDEX_ALTERNATIVES:
639 if (lexrc.next(true)) {
640 index_alternatives.insert(lexrc.getString());
644 case RC_INDEX_COMMAND:
645 if (lexrc.next(true)) {
646 index_command = lexrc.getString();
650 case RC_JINDEX_COMMAND:
651 if (lexrc.next(true)) {
652 jindex_command = lexrc.getString();
656 case RC_SPLITINDEX_COMMAND:
657 if (lexrc.next(true)) {
658 splitindex_command = lexrc.getString();
662 case RC_NOMENCL_COMMAND:
663 if (lexrc.next(true)) {
664 nomencl_command = lexrc.getString();
676 case RC_GEOMETRY_SESSION:
677 lexrc >> allow_geometry_session;
680 case RC_SCREEN_FONT_SIZES:
681 lexrc >> font_sizes[FONT_SIZE_TINY];
682 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
683 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
684 lexrc >> font_sizes[FONT_SIZE_SMALL];
685 lexrc >> font_sizes[FONT_SIZE_NORMAL];
686 lexrc >> font_sizes[FONT_SIZE_LARGE];
687 lexrc >> font_sizes[FONT_SIZE_LARGER];
688 lexrc >> font_sizes[FONT_SIZE_LARGEST];
689 lexrc >> font_sizes[FONT_SIZE_HUGE];
690 lexrc >> font_sizes[FONT_SIZE_HUGER];
693 case RC_SCREEN_FONT_SCALABLE:
694 lexrc >> use_scalable_fonts;
701 case RC_DOCUMENTPATH:
703 document_path = os::internal_path(lexrc.getString());
704 document_path = expandPath(document_path);
710 example_path = os::internal_path(lexrc.getString());
711 example_path = expandPath(example_path);
715 case RC_TEMPLATEPATH:
717 template_path = os::internal_path(lexrc.getString());
718 template_path = expandPath(template_path);
724 tempdir_path = os::internal_path(lexrc.getString());
725 tempdir_path = expandPath(tempdir_path);
729 case RC_THESAURUSDIRPATH:
731 thesaurusdir_path = os::internal_path(lexrc.getString());
732 thesaurusdir_path = expandPath(thesaurusdir_path);
736 case RC_HUNSPELLDIR_PATH:
738 hunspelldir_path = os::internal_path(lexrc.getString());
739 hunspelldir_path = expandPath(hunspelldir_path);
743 case RC_USELASTFILEPOS:
744 lexrc >> use_lastfilepos;
748 lexrc >> load_session;
751 case RC_MOUSE_WHEEL_SPEED:
752 lexrc >> mouse_wheel_speed;
755 case RC_COMPLETION_INLINE_DELAY:
756 lexrc >> completion_inline_delay;
759 case RC_COMPLETION_INLINE_MATH:
760 lexrc >> completion_inline_math;
763 case RC_COMPLETION_INLINE_TEXT:
764 lexrc >> completion_inline_text;
767 case RC_COMPLETION_INLINE_DOTS:
768 lexrc >> completion_inline_dots;
771 case RC_AUTOCORRECTION_MATH:
772 lexrc >> autocorrection_math;
775 case RC_COMPLETION_POPUP_DELAY:
776 lexrc >> completion_popup_delay;
779 case RC_COMPLETION_POPUP_MATH:
780 lexrc >> completion_popup_math;
783 case RC_COMPLETION_POPUP_TEXT:
784 lexrc >> completion_popup_text;
787 case RC_COMPLETION_CURSOR_TEXT:
788 lexrc >> completion_cursor_text;
791 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
792 lexrc >> completion_popup_after_complete;
795 case RC_NUMLASTFILES:
796 lexrc >> num_lastfiles;
799 case RC_CHECKLASTFILES:
800 lexrc >> check_lastfiles;
803 case RC_SCREEN_FONT_ROMAN:
805 roman_font_name = lexrc.getString();
806 oldFontFormat(roman_font_name,
811 case RC_SCREEN_FONT_SANS:
813 sans_font_name = lexrc.getString();
814 oldFontFormat(sans_font_name, sans_font_foundry);
818 case RC_SCREEN_FONT_TYPEWRITER:
820 typewriter_font_name = lexrc.getString();
821 oldFontFormat(typewriter_font_name,
822 typewriter_font_foundry);
826 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
827 lexrc >> roman_font_foundry;
830 case RC_SCREEN_FONT_SANS_FOUNDRY:
831 lexrc >> sans_font_foundry;
834 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
835 lexrc >> typewriter_font_foundry;
840 lexrc.printError("Missing color tag.");
843 string lyx_name = lexrc.getString();
846 lexrc.printError("Missing color name for color: `$$Token'");
849 string x11_name = lexrc.getString();
851 ColorCode const col =
852 lcolor.getFromLyXName(lyx_name);
853 if (col == Color_none ||
854 col == Color_inherit ||
858 if (!lcolor.setColor(col, x11_name))
859 LYXERR0("Bad lyxrc set_color for " << lyx_name);
863 case RC_AUTOREGIONDELETE:
864 // Auto region delete defaults to true
865 lexrc >> auto_region_delete;
870 lyxpipes = os::internal_path(lexrc.getString());
871 lyxpipes = expandPath(lyxpipes);
875 case RC_CURSOR_FOLLOWS_SCROLLBAR:
876 lexrc >> cursor_follows_scrollbar;
879 case RC_SCROLL_BELOW_DOCUMENT:
880 lexrc >> scroll_below_document;
883 case RC_PARAGRAPH_MARKERS:
884 lexrc >> paragraph_markers;
887 case RC_MAC_LIKE_WORD_MOVEMENT:
888 lexrc >> mac_like_word_movement;
891 case RC_MACRO_EDIT_STYLE:
893 switch (lexrc.getInteger()) {
894 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
895 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
896 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
901 case RC_DIALOGS_ICONIFY_WITH_MAIN:
902 lexrc >> dialogs_iconify_with_main;
905 case RC_PLAINTEXT_LINELEN:
906 lexrc >> plaintext_linelen;
908 // Spellchecker settings:
909 case RC_ACCEPT_COMPOUND:
910 lexrc >> spellchecker_accept_compound;
913 lexrc >> use_tooltip;
915 case RC_USE_PIXMAP_CACHE:
916 lexrc >> use_pixmap_cache;
918 case RC_SPELLCHECKER:
919 lexrc >> spellchecker;
922 lexrc >> spellchecker_alt_lang;
925 lexrc >> spellchecker_esc_chars;
927 case RC_SPELLCHECK_CONTINUOUSLY:
928 lexrc >> spellcheck_continuously;
930 case RC_SPELLCHECK_NOTES:
931 lexrc >> spellcheck_notes;
934 lexrc >> make_backup;
936 case RC_SAVE_COMPRESSED:
937 lexrc >> save_compressed;
939 case RC_BACKUPDIR_PATH:
941 backupdir_path = os::internal_path(lexrc.getString());
942 backupdir_path = expandPath(backupdir_path);
945 case RC_DEFAULT_DECIMAL_POINT:
946 lexrc >> default_decimal_point;
948 case RC_DATE_INSERT_FORMAT:
949 lexrc >> date_insert_format;
951 case RC_LANGUAGE_PACKAGE:
952 lexrc >> language_package;
954 case RC_LANGUAGE_AUTO_BEGIN:
955 lexrc >> language_auto_begin;
957 case RC_LANGUAGE_AUTO_END:
958 lexrc >> language_auto_end;
960 case RC_LANGUAGE_GLOBAL_OPTIONS:
961 lexrc >> language_global_options;
963 case RC_LANGUAGE_USE_BABEL:
964 lexrc >> language_use_babel;
966 case RC_LANGUAGE_COMMAND_BEGIN:
967 lexrc >> language_command_begin;
969 case RC_LANGUAGE_COMMAND_END:
970 lexrc >> language_command_end;
972 case RC_LANGUAGE_COMMAND_LOCAL:
973 lexrc >> language_command_local;
976 lexrc >> rtl_support;
978 case RC_VISUAL_CURSOR:
979 lexrc >> visual_cursor;
982 lexrc >> auto_number;
984 case RC_MARK_FOREIGN_LANGUAGE:
985 lexrc >> mark_foreign_language;
991 fmt = lexrc.getString();
992 if (lexrc.next(true))
993 command = lexrc.getString();
994 setMover(fmt, command);
999 string from, to, command, flags;
1001 from = lexrc.getString();
1003 to = lexrc.getString();
1004 if (lexrc.next(true))
1005 command = lexrc.getString();
1007 flags = lexrc.getString();
1008 if (command.empty())
1009 theConverters().erase(from, to);
1011 theConverters().add(from, to, command, flags);
1014 // compatibility with versions older than 1.4.0 only
1016 string format, command;
1017 lexrc >> format >> command;
1018 formats.setViewer(format, command);
1022 string format, extension, prettyname, shortcut;
1023 lexrc >> format >> extension >> prettyname >> shortcut;
1024 string viewer, editor;
1025 if (lexrc.next(true))
1026 viewer = lexrc.getString();
1027 if (lexrc.next(true))
1028 editor = lexrc.getString();
1030 // Hack to ensure compatibility with versions older
1032 int le = lexrc.lex();
1033 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1034 flags = lexrc.getString();
1035 if (le != Lexer::LEX_DATA) {
1036 // We have got a known token.
1037 // Therefore this is an old style
1038 // format definition without
1040 lexrc.pushToken(flags);
1044 int flgs = Format::none;
1045 while (!flags.empty()) {
1047 flags = split(flags, flag, ',');
1048 if (flag == "document")
1049 flgs |= Format::document;
1050 else if (flag == "vector")
1051 flgs |= Format::vector;
1053 LYXERR0("Ignoring unknown flag `"
1054 << flag << "' for format `"
1057 if (prettyname.empty()) {
1058 if (theConverters().formatIsUsed(format))
1059 LYXERR0("Can't delete format " << format);
1061 formats.erase(format);
1063 formats.add(format, extension, prettyname,
1064 shortcut, viewer, editor, flgs);
1068 case RC_VIEWER_ALTERNATIVES: {
1069 string format, command;
1071 format = lexrc.getString();
1072 if (lexrc.eatLine())
1073 command = lexrc.getString();
1074 viewer_alternatives[format].insert(command);
1077 case RC_EDITOR_ALTERNATIVES: {
1078 string format, command;
1079 lexrc >> format >> command;
1080 editor_alternatives[format].insert(command);
1084 case RC_DEFAULT_VIEW_FORMAT:
1085 lexrc >> default_view_format;
1088 case RC_DEFAULT_LANGUAGE:
1089 lexrc >> default_language;
1092 case RC_GUI_LANGUAGE:
1093 lexrc >> gui_language;
1096 case RC_SHOW_BANNER:
1097 lexrc >> show_banner;
1102 string const tmp = lexrc.getString();
1103 if (tmp == "true" || tmp == "on")
1104 preview = PREVIEW_ON;
1105 else if (tmp == "no_math")
1106 preview = PREVIEW_NO_MATH;
1108 preview = PREVIEW_OFF;
1109 if (tmp != "false" && tmp != "off")
1110 LYXERR0("Unrecognized preview status \""
1116 case RC_PREVIEW_HASHED_LABELS:
1117 lexrc >> preview_hashed_labels;
1120 case RC_PREVIEW_SCALE_FACTOR:
1121 lexrc >> preview_scale_factor;
1128 lexrc >> user_email;
1131 case RC_PATH_PREFIX:
1132 lexrc >> path_prefix;
1135 case RC_USE_CONVERTER_CACHE:
1136 lexrc >> use_converter_cache;
1138 case RC_CONVERTER_CACHE_MAXAGE:
1139 lexrc >> converter_cache_maxage;
1142 case RC_SORT_LAYOUTS:
1143 lexrc >> sort_layouts;
1145 case RC_GROUP_LAYOUTS:
1146 lexrc >> group_layouts;
1148 case RC_FULL_SCREEN_LIMIT:
1149 lexrc >> full_screen_limit;
1151 case RC_FULL_SCREEN_TOOLBARS:
1152 lexrc >> full_screen_toolbars;
1154 case RC_FULL_SCREEN_SCROLLBAR:
1155 lexrc >> full_screen_scrollbar;
1157 case RC_FULL_SCREEN_TABBAR:
1158 lexrc >> full_screen_tabbar;
1160 case RC_FULL_SCREEN_MENUBAR:
1161 lexrc >> full_screen_menubar;
1163 case RC_FULL_SCREEN_WIDTH:
1164 lexrc >> full_screen_width;
1166 case RC_OPEN_BUFFERS_IN_TABS:
1167 lexrc >> open_buffers_in_tabs;
1169 case RC_SINGLE_CLOSE_TAB_BUTTON:
1170 lexrc >> single_close_tab_button;
1172 case RC_FORWARD_SEARCH_DVI:
1173 if (lexrc.next(true))
1174 forward_search_dvi = lexrc.getString();
1176 case RC_FORWARD_SEARCH_PDF:
1177 if (lexrc.next(true))
1178 forward_search_pdf = lexrc.getString();
1180 case RC_EXPORT_OVERWRITE:
1182 string const tmp = lexrc.getString();
1183 if (tmp == "all" || tmp == "true")
1184 export_overwrite = ALL_FILES;
1185 else if (tmp == "main")
1186 export_overwrite = MAIN_FILE;
1188 export_overwrite = NO_FILES;
1189 if (tmp != "ask" && tmp != "false")
1190 LYXERR0("Unrecognized export_overwrite status \""
1196 // Obsoteted in 1.4.0
1199 case RC_SPELL_COMMAND:
1201 case RC_PLAINTEXT_ROFF_COMMAND:
1202 case RC_USE_ALT_LANG:
1203 case RC_USE_ESC_CHARS:
1204 case RC_USE_INP_ENC:
1205 case RC_USE_PERS_DICT:
1206 case RC_USE_SPELL_LIB:
1207 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1208 << lexrc.getString() << "'.");
1213 break; // this is just a dummy
1217 /// Update converters data-structures
1218 theConverters().update(formats);
1219 theConverters().buildGraph();
1225 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1227 ofstream ofs(filename.toFilesystemEncoding().c_str());
1229 write(ofs, ignore_system_lyxrc);
1233 void LyXRC::print() const
1235 if (lyxerr.debugging())
1236 write(lyxerr, false);
1244 typedef pair<string, SpecialisedMover> Data;
1246 SameMover(Data const & comparison)
1247 : comparison_(comparison) {}
1249 bool operator()(Data const & data) const
1251 return data.first == comparison_.first &&
1252 data.second.command() == comparison_.second.command();
1262 // Escape \ and " so that LyXLex can read the string later
1263 string escapeCommand(string const & str) {
1264 return subst(subst(str , "\\", "\\\\"),
1271 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1273 LyXRCTags tag = RC_LAST;
1275 if (!name.empty()) {
1276 for (int i = 0; i != lyxrcCount; ++i)
1277 if ("\\" + name == lyxrcTags[i].tag)
1278 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1282 os << "# LyX " << lyx_version
1283 << " generated this file. If you want to make your own\n"
1284 << "# modifications you should do them from inside LyX and save.\n"
1287 // Why the switch you might ask. It is a trick to ensure that all
1288 // the elements in the LyXRCTags enum are handled. As you can see
1289 // there are no breaks at all. So it is just a huge fall-through.
1290 // The nice thing is that we will get a warning from the compiler
1291 // if we forget an element.
1295 // input/include files are not done here
1297 if (ignore_system_lyxrc ||
1298 bind_file != system_lyxrc.bind_file) {
1299 string const path = os::external_path(bind_file);
1300 os << "\\bind_file \"" << path << "\"\n";
1306 if (ignore_system_lyxrc ||
1307 def_file != system_lyxrc.def_file) {
1308 string const path = os::external_path(def_file);
1309 os << "\\def_file \"" << path << "\"\n";
1318 << "# MISC SECTION ######################################\n"
1320 // bind files are not done here.
1322 case RC_PATH_PREFIX:
1323 if (ignore_system_lyxrc ||
1324 path_prefix != system_lyxrc.path_prefix) {
1325 os << "\\path_prefix \"" << path_prefix << "\"\n";
1330 if (ignore_system_lyxrc ||
1331 ui_file != system_lyxrc.ui_file) {
1332 string const path = os::external_path(ui_file);
1333 os << "\\ui_file \"" << path << "\"\n";
1337 case RC_AUTOREGIONDELETE:
1338 if (ignore_system_lyxrc ||
1339 auto_region_delete != system_lyxrc.auto_region_delete) {
1340 os << "# Set to false to inhibit automatic replacement of\n"
1341 << "# the current selection.\n"
1342 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1347 case RC_AUTORESET_OPTIONS:
1348 if (ignore_system_lyxrc ||
1349 auto_reset_options != system_lyxrc.auto_reset_options) {
1350 os << "# Set to false to inhibit automatic reset of\n"
1351 << "# the class options to defaults on class change.\n"
1352 << "\\auto_reset_options "
1353 << convert<string>(auto_reset_options)
1359 if (ignore_system_lyxrc ||
1360 autosave != system_lyxrc.autosave) {
1361 os << "# The time interval between auto-saves in seconds.\n"
1362 << "\\autosave " << autosave << '\n';
1366 case RC_DISPLAY_GRAPHICS:
1367 if (ignore_system_lyxrc ||
1368 display_graphics != system_lyxrc.display_graphics) {
1369 os << "# Display graphics within LyX\n"
1371 << "\\display_graphics "
1372 << (display_graphics ? "true" : "false")
1377 case RC_SORT_LAYOUTS:
1378 if (ignore_system_lyxrc ||
1379 sort_layouts != system_lyxrc.sort_layouts) {
1380 os << "# Sort layouts alphabetically.\n"
1381 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1385 case RC_GROUP_LAYOUTS:
1386 if (ignore_system_lyxrc ||
1387 group_layouts != system_lyxrc.group_layouts) {
1388 os << "# Group layouts by their category.\n"
1389 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1393 case RC_VIEWDVI_PAPEROPTION:
1394 if (ignore_system_lyxrc ||
1395 view_dvi_paper_option
1396 != system_lyxrc.view_dvi_paper_option) {
1397 os << "# Options used to specify paper size to the\n"
1398 << "# view_dvi_command (e.g. -paper)\n"
1399 << "\\view_dvi_paper_option \""
1400 << view_dvi_paper_option << "\"\n";
1404 case RC_DEFAULT_PAPERSIZE:
1405 if (ignore_system_lyxrc ||
1406 default_papersize != system_lyxrc.default_papersize) {
1407 os << "# The default papersize to use.\n"
1408 << "\\default_papersize \"";
1409 switch (default_papersize) {
1411 os << "default"; break;
1412 case PAPER_USLETTER:
1413 os << "usletter"; break;
1415 os << "legal"; break;
1416 case PAPER_USEXECUTIVE:
1417 os << "executive"; break;
1443 case PAPER_JISB6: break;
1449 case RC_CHKTEX_COMMAND:
1450 if (ignore_system_lyxrc ||
1451 chktex_command != system_lyxrc.chktex_command) {
1452 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1456 case RC_BIBTEX_ALTERNATIVES: {
1457 CommandSet::const_iterator it = bibtex_alternatives.begin();
1458 CommandSet::const_iterator end = bibtex_alternatives.end();
1459 for ( ; it != end; ++it) {
1460 if (ignore_system_lyxrc
1461 || !system_lyxrc.bibtex_alternatives.count(*it))
1462 os << "\\bibtex_alternatives \""
1468 case RC_BIBTEX_COMMAND:
1469 if (ignore_system_lyxrc ||
1470 bibtex_command != system_lyxrc.bibtex_command) {
1471 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1475 case RC_JBIBTEX_COMMAND:
1476 if (ignore_system_lyxrc ||
1477 jbibtex_command != system_lyxrc.jbibtex_command) {
1478 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1482 case RC_INDEX_ALTERNATIVES: {
1483 CommandSet::const_iterator it = index_alternatives.begin();
1484 CommandSet::const_iterator end = index_alternatives.end();
1485 for ( ; it != end; ++it) {
1486 if (ignore_system_lyxrc
1487 || !system_lyxrc.index_alternatives.count(*it))
1488 os << "\\index_alternatives \""
1494 case RC_INDEX_COMMAND:
1495 if (ignore_system_lyxrc ||
1496 index_command != system_lyxrc.index_command) {
1497 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1501 case RC_JINDEX_COMMAND:
1502 if (ignore_system_lyxrc ||
1503 jindex_command != system_lyxrc.jindex_command) {
1504 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1508 case RC_SPLITINDEX_COMMAND:
1509 if (ignore_system_lyxrc ||
1510 splitindex_command != system_lyxrc.splitindex_command) {
1511 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1515 case RC_NOMENCL_COMMAND:
1516 if (ignore_system_lyxrc ||
1517 nomencl_command != system_lyxrc.nomencl_command) {
1518 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1522 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1523 if (ignore_system_lyxrc ||
1524 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1525 os << "\\tex_expects_windows_paths "
1526 << convert<string>(windows_style_tex_paths) << '\n';
1530 case RC_TEX_ALLOWS_SPACES:
1531 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1532 os << "\\tex_allows_spaces "
1533 << convert<string>(tex_allows_spaces) << '\n';
1538 if (ignore_system_lyxrc ||
1539 use_kbmap != system_lyxrc.use_kbmap) {
1540 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1544 case RC_KBMAP_PRIMARY:
1545 if (ignore_system_lyxrc ||
1546 primary_kbmap != system_lyxrc.primary_kbmap) {
1547 string const path = os::external_path(primary_kbmap);
1548 os << "\\kbmap_primary \"" << path << "\"\n";
1552 case RC_KBMAP_SECONDARY:
1553 if (ignore_system_lyxrc ||
1554 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1555 string const path = os::external_path(secondary_kbmap);
1556 os << "\\kbmap_secondary \"" << path << "\"\n";
1561 if (ignore_system_lyxrc ||
1562 lyxpipes != system_lyxrc.lyxpipes) {
1563 string const path = os::external_path(lyxpipes);
1564 os << "\\serverpipe \"" << path << "\"\n";
1568 case RC_DATE_INSERT_FORMAT:
1569 if (ignore_system_lyxrc ||
1570 date_insert_format != system_lyxrc.date_insert_format) {
1571 os << "\\date_insert_format \"" << date_insert_format
1578 os << "\\user_name \"" << user_name << "\"\n";
1583 os << "\\user_email \"" << user_email << "\"\n";
1587 case RC_SHOW_BANNER:
1588 if (ignore_system_lyxrc ||
1589 show_banner != system_lyxrc.show_banner) {
1590 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1596 if (ignore_system_lyxrc ||
1597 preview != system_lyxrc.preview) {
1603 case PREVIEW_NO_MATH:
1610 os << "\\preview " << status << '\n';
1615 case RC_PREVIEW_HASHED_LABELS:
1616 if (ignore_system_lyxrc ||
1617 preview_hashed_labels !=
1618 system_lyxrc.preview_hashed_labels) {
1619 os << "\\preview_hashed_labels "
1620 << convert<string>(preview_hashed_labels) << '\n';
1625 case RC_PREVIEW_SCALE_FACTOR:
1626 if (ignore_system_lyxrc ||
1627 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1628 os << "\\preview_scale_factor "
1629 << preview_scale_factor << '\n';
1634 case RC_USE_CONVERTER_CACHE:
1635 if (ignore_system_lyxrc ||
1636 use_converter_cache != system_lyxrc.use_converter_cache) {
1637 os << "\\use_converter_cache "
1638 << convert<string>(use_converter_cache) << '\n';
1643 case RC_CONVERTER_CACHE_MAXAGE:
1644 if (ignore_system_lyxrc ||
1645 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1646 os << "\\converter_cache_maxage "
1647 << converter_cache_maxage << '\n';
1653 << "# SCREEN & FONTS SECTION ############################\n"
1657 if (ignore_system_lyxrc ||
1658 dpi != system_lyxrc.dpi) {
1659 os << "\\screen_dpi " << dpi << '\n';
1663 case RC_SCREEN_ZOOM:
1664 if (ignore_system_lyxrc ||
1665 zoom != system_lyxrc.zoom) {
1666 os << "\\screen_zoom " << zoom << '\n';
1670 case RC_GEOMETRY_SESSION:
1671 if (ignore_system_lyxrc ||
1672 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1673 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1678 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1679 if (ignore_system_lyxrc ||
1680 cursor_follows_scrollbar
1681 != system_lyxrc.cursor_follows_scrollbar) {
1682 os << "\\cursor_follows_scrollbar "
1683 << convert<string>(cursor_follows_scrollbar) << '\n';
1687 case RC_SCROLL_BELOW_DOCUMENT:
1688 if (ignore_system_lyxrc ||
1689 scroll_below_document
1690 != system_lyxrc.scroll_below_document) {
1691 os << "\\scroll_below_document "
1692 << convert<string>(scroll_below_document) << '\n';
1696 case RC_PARAGRAPH_MARKERS:
1697 if (ignore_system_lyxrc ||
1699 != system_lyxrc.paragraph_markers) {
1700 os << "\\paragraph_markers "
1701 << convert<string>(paragraph_markers) << '\n';
1705 case RC_MAC_LIKE_WORD_MOVEMENT:
1706 if (ignore_system_lyxrc ||
1707 mac_like_word_movement
1708 != system_lyxrc.mac_like_word_movement) {
1709 os << "\\mac_like_word_movement "
1710 << convert<string>(mac_like_word_movement) << '\n';
1714 case RC_MACRO_EDIT_STYLE:
1715 if (ignore_system_lyxrc ||
1717 != system_lyxrc.macro_edit_style) {
1718 os << "\\macro_edit_style ";
1719 switch (macro_edit_style) {
1720 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1721 case MACRO_EDIT_INLINE: os << "1\n"; break;
1722 case MACRO_EDIT_LIST: os << "2\n"; break;
1727 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1728 if (ignore_system_lyxrc ||
1729 dialogs_iconify_with_main
1730 != system_lyxrc.dialogs_iconify_with_main) {
1731 os << "\\dialogs_iconify_with_main "
1732 << convert<string>(dialogs_iconify_with_main) << '\n';
1736 case RC_SCREEN_FONT_ROMAN:
1737 if (ignore_system_lyxrc ||
1738 roman_font_name != system_lyxrc.roman_font_name) {
1739 os << "\\screen_font_roman \"" << roman_font_name
1744 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1745 if (ignore_system_lyxrc ||
1746 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1747 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1752 case RC_SCREEN_FONT_SANS:
1753 if (ignore_system_lyxrc ||
1754 sans_font_name != system_lyxrc.sans_font_name) {
1755 os << "\\screen_font_sans \"" << sans_font_name
1760 case RC_SCREEN_FONT_SANS_FOUNDRY:
1761 if (ignore_system_lyxrc ||
1762 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1763 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1768 case RC_SCREEN_FONT_TYPEWRITER:
1769 if (ignore_system_lyxrc ||
1770 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1771 os << "\\screen_font_typewriter \""
1772 << typewriter_font_name << "\"\n";
1776 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1777 if (ignore_system_lyxrc ||
1778 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1779 os << "\\screen_font_typewriter_foundry \""
1780 << typewriter_font_foundry << "\"\n";
1785 case RC_SCREEN_FONT_SCALABLE:
1786 if (ignore_system_lyxrc ||
1787 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1788 os << "\\screen_font_scalable "
1789 << convert<string>(use_scalable_fonts)
1794 case RC_SCREEN_FONT_SIZES:
1795 if (ignore_system_lyxrc ||
1796 font_sizes[FONT_SIZE_TINY]
1797 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1798 font_sizes[FONT_SIZE_SCRIPT]
1799 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1800 font_sizes[FONT_SIZE_FOOTNOTE]
1801 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1802 font_sizes[FONT_SIZE_SMALL]
1803 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1804 font_sizes[FONT_SIZE_NORMAL]
1805 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1806 font_sizes[FONT_SIZE_LARGE]
1807 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1808 font_sizes[FONT_SIZE_LARGER]
1809 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1810 font_sizes[FONT_SIZE_LARGEST]
1811 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1812 font_sizes[FONT_SIZE_HUGE]
1813 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1814 font_sizes[FONT_SIZE_HUGER]
1815 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1816 os.setf(ios::fixed);
1818 os << "\\screen_font_sizes"
1819 << ' ' << font_sizes[FONT_SIZE_TINY]
1820 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1821 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1822 << ' ' << font_sizes[FONT_SIZE_SMALL]
1823 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1824 << ' ' << font_sizes[FONT_SIZE_LARGE]
1825 << ' ' << font_sizes[FONT_SIZE_LARGER]
1826 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1827 << ' ' << font_sizes[FONT_SIZE_HUGE]
1828 << ' ' << font_sizes[FONT_SIZE_HUGER]
1833 case RC_FULL_SCREEN_LIMIT:
1834 if (ignore_system_lyxrc ||
1835 full_screen_limit != system_lyxrc.full_screen_limit) {
1836 os << "\\fullscreen_limit "
1837 << convert<string>(full_screen_limit)
1842 case RC_FULL_SCREEN_TOOLBARS:
1843 if (ignore_system_lyxrc ||
1844 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1845 os << "\\fullscreen_toolbars "
1846 << convert<string>(full_screen_toolbars)
1851 case RC_FULL_SCREEN_SCROLLBAR:
1852 if (ignore_system_lyxrc ||
1853 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1854 os << "\\fullscreen_scrollbar "
1855 << convert<string>(full_screen_scrollbar)
1860 case RC_FULL_SCREEN_TABBAR:
1861 if (ignore_system_lyxrc ||
1862 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1863 os << "\\fullscreen_tabbar "
1864 << convert<string>(full_screen_tabbar)
1869 case RC_FULL_SCREEN_MENUBAR:
1870 if (ignore_system_lyxrc ||
1871 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1872 os << "\\fullscreen_menubar "
1873 << convert<string>(full_screen_menubar)
1878 case RC_FULL_SCREEN_WIDTH:
1879 if (ignore_system_lyxrc ||
1880 full_screen_width != system_lyxrc.full_screen_width) {
1881 os << "\\fullscreen_width "
1882 << convert<string>(full_screen_width)
1887 case RC_OPEN_BUFFERS_IN_TABS:
1888 if (ignore_system_lyxrc ||
1889 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1890 os << "\\open_buffers_in_tabs "
1891 << convert<string>(open_buffers_in_tabs)
1896 case RC_SINGLE_CLOSE_TAB_BUTTON:
1897 if (ignore_system_lyxrc ||
1898 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1899 os << "\\single_close_tab_button "
1900 << convert<string>(single_close_tab_button)
1905 case RC_FORWARD_SEARCH_DVI:
1906 if (ignore_system_lyxrc ||
1907 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1908 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1912 case RC_FORWARD_SEARCH_PDF:
1913 if (ignore_system_lyxrc ||
1914 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1915 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1921 << "# COLOR SECTION ###################################\n"
1925 for (int i = 0; i < Color_ignore; ++i) {
1926 ColorCode lc = static_cast<ColorCode>(i);
1927 string const col = lcolor.getX11Name(lc);
1928 if (ignore_system_lyxrc
1929 || col != system_lcolor.getX11Name(lc)) {
1930 os << "\\set_color \""
1931 << lcolor.getLyXName(lc) << "\" \""
1939 << "# PRINTER SECTION ###################################\n"
1943 if (ignore_system_lyxrc ||
1944 printer != system_lyxrc.printer) {
1945 os << "\\printer \"" << printer << "\"\n";
1949 case RC_PRINT_ADAPTOUTPUT:
1950 if (ignore_system_lyxrc ||
1951 print_adapt_output != system_lyxrc.print_adapt_output) {
1952 os << "\\print_adapt_output "
1953 << convert<string>(print_adapt_output)
1958 case RC_PRINT_COMMAND:
1959 if (ignore_system_lyxrc ||
1960 print_command != system_lyxrc.print_command) {
1961 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1965 case RC_PRINTEXSTRAOPTIONS:
1966 if (ignore_system_lyxrc ||
1967 print_extra_options != system_lyxrc.print_extra_options) {
1968 os << "\\print_extra_options \"" << print_extra_options
1973 case RC_PRINTSPOOL_COMMAND:
1974 if (ignore_system_lyxrc ||
1975 print_spool_command != system_lyxrc.print_spool_command) {
1976 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1981 case RC_PRINTSPOOL_PRINTERPREFIX:
1982 if (ignore_system_lyxrc ||
1983 print_spool_printerprefix
1984 != system_lyxrc.print_spool_printerprefix) {
1985 os << "\\print_spool_printerprefix \""
1986 << print_spool_printerprefix << "\"\n";
1990 case RC_PRINTEVENPAGEFLAG:
1991 if (ignore_system_lyxrc ||
1992 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1993 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1998 case RC_PRINTODDPAGEFLAG:
1999 if (ignore_system_lyxrc ||
2000 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2001 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2006 case RC_PRINTREVERSEFLAG:
2007 if (ignore_system_lyxrc ||
2008 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2009 os << "\\print_reverse_flag \"" << print_reverse_flag
2014 case RC_PRINTLANDSCAPEFLAG:
2015 if (ignore_system_lyxrc ||
2016 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2017 os << "\\print_landscape_flag \"" << print_landscape_flag
2022 case RC_PRINTPAGERANGEFLAG:
2023 if (ignore_system_lyxrc ||
2024 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2025 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2030 case RC_PRINTCOPIESFLAG:
2031 if (ignore_system_lyxrc ||
2032 print_copies_flag != system_lyxrc.print_copies_flag) {
2033 os << "\\print_copies_flag \"" << print_copies_flag
2038 case RC_PRINTCOLLCOPIESFLAG:
2039 if (ignore_system_lyxrc ||
2040 print_collcopies_flag
2041 != system_lyxrc.print_collcopies_flag) {
2042 os << "\\print_collcopies_flag \""
2043 << print_collcopies_flag
2048 case RC_PRINTPAPERFLAG:
2049 if (ignore_system_lyxrc ||
2050 print_paper_flag != system_lyxrc.print_paper_flag) {
2051 os << "\\print_paper_flag \"" << print_paper_flag
2056 case RC_PRINTPAPERDIMENSIONFLAG:
2057 if (ignore_system_lyxrc ||
2058 print_paper_dimension_flag
2059 != system_lyxrc.print_paper_dimension_flag) {
2060 os << "\\print_paper_dimension_flag \""
2061 << print_paper_dimension_flag << "\"\n";
2065 case RC_PRINTTOPRINTER:
2066 if (ignore_system_lyxrc ||
2067 print_to_printer != system_lyxrc.print_to_printer) {
2068 os << "\\print_to_printer \"" << print_to_printer
2073 case RC_PRINTTOFILE:
2074 if (ignore_system_lyxrc ||
2075 print_to_file != system_lyxrc.print_to_file) {
2076 string const path = os::external_path(print_to_file);
2077 os << "\\print_to_file \"" << path << "\"\n";
2081 case RC_PRINTFILEEXTENSION:
2082 if (ignore_system_lyxrc ||
2083 print_file_extension != system_lyxrc.print_file_extension) {
2084 os << "\\print_file_extension \""
2085 << print_file_extension
2092 << "# TEX SECTION #######################################\n"
2095 case RC_FONT_ENCODING:
2096 if (ignore_system_lyxrc ||
2097 fontenc != system_lyxrc.fontenc) {
2098 os << "\\font_encoding \"" << fontenc << "\"\n";
2104 << "# FILE SECTION ######################################\n"
2107 case RC_DOCUMENTPATH:
2108 if (ignore_system_lyxrc ||
2109 document_path != system_lyxrc.document_path) {
2110 string const path = os::external_path(document_path);
2111 os << "\\document_path \"" << path << "\"\n";
2115 case RC_USELASTFILEPOS:
2116 if (ignore_system_lyxrc ||
2117 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2118 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2123 case RC_LOADSESSION:
2124 if (ignore_system_lyxrc ||
2125 load_session != system_lyxrc.load_session) {
2126 os << "\\load_session " << convert<string>(load_session)
2131 case RC_MOUSE_WHEEL_SPEED:
2132 if (ignore_system_lyxrc ||
2133 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2134 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2138 case RC_COMPLETION_INLINE_DELAY:
2139 if (ignore_system_lyxrc ||
2140 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2141 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2145 case RC_COMPLETION_INLINE_MATH:
2146 if (ignore_system_lyxrc ||
2147 completion_inline_math != system_lyxrc.completion_inline_math) {
2148 os << "\\completion_inline_math "
2149 << convert<string>(completion_inline_math) << '\n';
2153 case RC_COMPLETION_INLINE_TEXT:
2154 if (ignore_system_lyxrc ||
2155 completion_inline_text != system_lyxrc.completion_inline_text) {
2156 os << "\\completion_inline_text "
2157 << convert<string>(completion_inline_text) << '\n';
2161 case RC_COMPLETION_INLINE_DOTS:
2162 if (ignore_system_lyxrc ||
2163 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2164 os << "\\completion_inline_dots "
2165 << convert<string>(completion_inline_dots) << '\n';
2169 case RC_AUTOCORRECTION_MATH:
2170 if (ignore_system_lyxrc ||
2171 autocorrection_math != system_lyxrc.autocorrection_math) {
2172 os << "\\autocorrection_math "
2173 << convert<string>(autocorrection_math) << '\n';
2177 case RC_COMPLETION_POPUP_DELAY:
2178 if (ignore_system_lyxrc ||
2179 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2180 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2184 case RC_COMPLETION_POPUP_MATH:
2185 if (ignore_system_lyxrc ||
2186 completion_popup_math != system_lyxrc.completion_popup_math) {
2187 os << "\\completion_popup_math "
2188 << convert<string>(completion_popup_math) << '\n';
2192 case RC_COMPLETION_POPUP_TEXT:
2193 if (ignore_system_lyxrc ||
2194 completion_popup_text != system_lyxrc.completion_popup_text) {
2195 os << "\\completion_popup_text "
2196 << convert<string>(completion_popup_text) << '\n';
2200 case RC_COMPLETION_CURSOR_TEXT:
2201 if (ignore_system_lyxrc ||
2202 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2203 os << "\\completion_cursor_text "
2204 << convert<string>(completion_cursor_text) << '\n';
2208 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2209 if (ignore_system_lyxrc ||
2210 completion_popup_after_complete
2211 != system_lyxrc.completion_popup_after_complete) {
2212 os << "\\completion_popup_after_complete "
2213 << convert<string>(completion_popup_after_complete) << '\n';
2217 case RC_NUMLASTFILES:
2218 if (ignore_system_lyxrc ||
2219 num_lastfiles != system_lyxrc.num_lastfiles) {
2220 os << "\\num_lastfiles " << num_lastfiles << '\n';
2224 case RC_CHECKLASTFILES:
2225 if (ignore_system_lyxrc ||
2226 check_lastfiles != system_lyxrc.check_lastfiles) {
2227 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2232 case RC_EXAMPLEPATH:
2233 if (ignore_system_lyxrc ||
2234 example_path != system_lyxrc.example_path) {
2235 string const path = os::external_path(example_path);
2236 os << "\\example_path \"" << path << "\"\n";
2240 case RC_TEMPLATEPATH:
2241 if (ignore_system_lyxrc ||
2242 template_path != system_lyxrc.template_path) {
2243 string const path = os::external_path(template_path);
2244 os << "\\template_path \"" << path << "\"\n";
2248 case RC_TEMPDIRPATH:
2249 if (ignore_system_lyxrc ||
2250 tempdir_path != system_lyxrc.tempdir_path) {
2251 string const path = os::external_path(tempdir_path);
2252 os << "\\tempdir_path \"" << path << "\"\n";
2256 case RC_THESAURUSDIRPATH:
2257 if (ignore_system_lyxrc ||
2258 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2259 string const path = os::external_path(thesaurusdir_path);
2260 os << "\\thesaurusdir_path \"" << path << "\"\n";
2264 case RC_HUNSPELLDIR_PATH:
2265 if (ignore_system_lyxrc ||
2266 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2267 string const path = os::external_path(hunspelldir_path);
2268 os << "\\hunspelldir_path \"" << path << "\"\n";
2276 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2279 case RC_PLAINTEXT_LINELEN:
2280 if (ignore_system_lyxrc ||
2281 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2282 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2286 case RC_MAKE_BACKUP:
2287 if (ignore_system_lyxrc ||
2288 make_backup != system_lyxrc.make_backup) {
2289 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2293 case RC_SAVE_COMPRESSED:
2294 if (ignore_system_lyxrc ||
2295 save_compressed != system_lyxrc.save_compressed) {
2296 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2300 case RC_BACKUPDIR_PATH:
2301 if (ignore_system_lyxrc ||
2302 backupdir_path != system_lyxrc.backupdir_path) {
2303 string const path = os::external_path(backupdir_path);
2304 os << "\\backupdir_path \"" << path << "\"\n";
2310 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2314 << "# SPELLCHECKER SECTION ##############################\n"
2317 case RC_SPELL_COMMAND:
2318 case RC_USE_SPELL_LIB:
2322 case RC_ACCEPT_COMPOUND:
2323 if (ignore_system_lyxrc ||
2324 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2325 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2330 case RC_USE_ALT_LANG:
2335 if (ignore_system_lyxrc ||
2336 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2337 os << "\\alternate_language \"" << spellchecker_alt_lang
2342 case RC_USE_ESC_CHARS:
2346 if (ignore_system_lyxrc ||
2347 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2348 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2352 case RC_USE_PERS_DICT:
2356 case RC_USE_TOOLTIP:
2357 if (ignore_system_lyxrc ||
2358 use_tooltip != system_lyxrc.use_tooltip) {
2359 os << "\\use_tooltip "
2360 << convert<string>(use_tooltip)
2365 case RC_USE_PIXMAP_CACHE:
2366 if (ignore_system_lyxrc ||
2367 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2368 os << "\\use_pixmap_cache "
2369 << convert<string>(use_pixmap_cache)
2378 case RC_USE_INP_ENC:
2384 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2389 case RC_DEFAULT_DECIMAL_POINT:
2390 if (ignore_system_lyxrc ||
2391 default_decimal_point != system_lyxrc.default_decimal_point) {
2392 os << "\\default_decimal_point " << default_decimal_point << '\n';
2397 case RC_SPELLCHECKER:
2398 if (ignore_system_lyxrc ||
2399 spellchecker != system_lyxrc.spellchecker) {
2400 os << "\\spellchecker " << spellchecker << '\n';
2405 case RC_SPELLCHECK_CONTINUOUSLY:
2406 if (ignore_system_lyxrc ||
2407 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2408 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2414 case RC_SPELLCHECK_NOTES:
2415 if (ignore_system_lyxrc ||
2416 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2417 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2423 case RC_RTL_SUPPORT:
2424 if (ignore_system_lyxrc ||
2425 rtl_support != system_lyxrc.rtl_support) {
2426 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2430 case RC_VISUAL_CURSOR:
2431 if (ignore_system_lyxrc ||
2432 visual_cursor != system_lyxrc.visual_cursor) {
2433 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2437 case RC_LANGUAGE_PACKAGE:
2438 if (ignore_system_lyxrc ||
2439 language_package != system_lyxrc.language_package) {
2440 os << "\\language_package \"" << language_package
2445 case RC_LANGUAGE_GLOBAL_OPTIONS:
2446 if (ignore_system_lyxrc ||
2447 language_global_options
2448 != system_lyxrc.language_global_options) {
2449 os << "\\language_global_options \""
2450 << convert<string>(language_global_options)
2455 case RC_LANGUAGE_USE_BABEL:
2456 if (ignore_system_lyxrc ||
2457 language_use_babel != system_lyxrc.language_use_babel) {
2458 os << "\\language_use_babel \""
2459 << convert<string>(language_use_babel)
2464 case RC_LANGUAGE_COMMAND_BEGIN:
2465 if (ignore_system_lyxrc ||
2466 language_command_begin
2467 != system_lyxrc.language_command_begin) {
2468 os << "\\language_command_begin \""
2469 << language_command_begin
2474 case RC_LANGUAGE_COMMAND_END:
2475 if (ignore_system_lyxrc ||
2476 language_command_end
2477 != system_lyxrc.language_command_end) {
2478 os << "\\language_command_end \"" << language_command_end
2483 case RC_LANGUAGE_COMMAND_LOCAL:
2484 if (ignore_system_lyxrc ||
2485 language_command_local
2486 != system_lyxrc.language_command_local) {
2487 os << "\\language_command_local \""
2488 << language_command_local
2493 case RC_LANGUAGE_AUTO_BEGIN:
2494 if (ignore_system_lyxrc ||
2495 language_auto_begin != system_lyxrc.language_auto_begin) {
2496 os << "\\language_auto_begin "
2497 << convert<string>(language_auto_begin) << '\n';
2501 case RC_LANGUAGE_AUTO_END:
2502 if (ignore_system_lyxrc ||
2503 language_auto_end != system_lyxrc.language_auto_end) {
2504 os << "\\language_auto_end "
2505 << convert<string>(language_auto_end) << '\n';
2509 case RC_MARK_FOREIGN_LANGUAGE:
2510 if (ignore_system_lyxrc ||
2511 mark_foreign_language
2512 != system_lyxrc.mark_foreign_language) {
2513 os << "\\mark_foreign_language " <<
2514 convert<string>(mark_foreign_language) << '\n';
2520 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2523 case RC_AUTO_NUMBER:
2524 if (ignore_system_lyxrc ||
2525 auto_number != system_lyxrc.auto_number) {
2526 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2530 case RC_DEFAULT_LANGUAGE:
2531 if (ignore_system_lyxrc ||
2532 default_language != system_lyxrc.default_language) {
2533 os << "\\default_language " << default_language << '\n';
2537 case RC_GUI_LANGUAGE:
2538 if (ignore_system_lyxrc ||
2539 gui_language != system_lyxrc.gui_language) {
2540 os << "\\gui_language " << gui_language << '\n';
2544 case RC_EXPORT_OVERWRITE:
2545 if (ignore_system_lyxrc ||
2546 export_overwrite != system_lyxrc.export_overwrite) {
2548 switch (export_overwrite) {
2559 os << "\\export_overwrite " << status << '\n';
2565 << "# FORMATS SECTION ##########################\n"
2569 // New/modified formats
2570 for (Formats::const_iterator cit = formats.begin();
2571 cit != formats.end(); ++cit) {
2572 Format const * format =
2573 system_formats.getFormat(cit->name());
2575 format->extension() != cit->extension() ||
2576 format->prettyname() != cit->prettyname() ||
2577 format->shortcut() != cit->shortcut() ||
2578 format->viewer() != cit->viewer() ||
2579 format->editor() != cit->editor() ||
2580 format->documentFormat() != cit->documentFormat() ||
2581 format->vectorFormat() != cit->vectorFormat()) {
2582 os << "\\format \"" << cit->name() << "\" \""
2583 << cit->extension() << "\" \""
2584 << cit->prettyname() << "\" \""
2585 << cit->shortcut() << "\" \""
2586 << escapeCommand(cit->viewer()) << "\" \""
2587 << escapeCommand(cit->editor()) << "\" \"";
2588 vector<string> flags;
2589 if (cit->documentFormat())
2590 flags.push_back("document");
2591 if (cit->vectorFormat())
2592 flags.push_back("vector");
2593 os << getStringFromVector(flags);
2598 // Look for deleted formats
2599 for (Formats::const_iterator cit = system_formats.begin();
2600 cit != system_formats.end(); ++cit)
2601 if (!formats.getFormat(cit->name()))
2602 os << "\\format \"" << cit->name()
2603 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2606 case RC_VIEWER_ALTERNATIVES: {
2607 Alternatives::const_iterator it = viewer_alternatives.begin();
2608 Alternatives::const_iterator const en = viewer_alternatives.end();
2609 Alternatives::const_iterator const sysend =
2610 system_lyxrc.viewer_alternatives.end();
2611 for (; it != en; ++it) {
2612 string const & fmt = it->first;
2613 CommandSet const & cmd = it->second;
2614 CommandSet::const_iterator sit = cmd.begin();
2615 CommandSet::const_iterator const sen = cmd.end();
2616 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2617 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2618 system_lyxrc.viewer_alternatives.find(fmt);
2619 for (; sit != sen; ++sit) {
2620 string const & cmd = *sit;
2621 if (ignore_system_lyxrc
2622 || sysfmt == sysend // format not found
2623 || sysfmt->second.count(cmd) == 0 // this command not found
2625 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2631 case RC_EDITOR_ALTERNATIVES: {
2632 Alternatives::const_iterator it = editor_alternatives.begin();
2633 Alternatives::const_iterator const en = editor_alternatives.end();
2634 Alternatives::const_iterator const sysend =
2635 system_lyxrc.editor_alternatives.end();
2636 for (; it != en; ++it) {
2637 string const & fmt = it->first;
2638 CommandSet const & cmd = it->second;
2639 CommandSet::const_iterator sit = cmd.begin();
2640 CommandSet::const_iterator const sen = cmd.end();
2641 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2642 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2643 system_lyxrc.editor_alternatives.find(fmt);
2644 for (; sit != sen; ++sit) {
2645 string const & cmd = *sit;
2646 if (ignore_system_lyxrc
2647 || sysfmt == sysend // format not found
2648 || sysfmt->second.count(cmd) == 0 // this command not found
2650 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2656 case RC_DEFAULT_VIEW_FORMAT:
2657 if (ignore_system_lyxrc ||
2658 default_view_format != system_lyxrc.default_view_format) {
2659 os << "\\default_view_format " << default_view_format << '\n';
2669 << "# CONVERTERS SECTION ##########################\n"
2673 // Look for new converters
2674 for (Converters::const_iterator cit = theConverters().begin();
2675 cit != theConverters().end(); ++cit) {
2676 Converter const * converter =
2677 theSystemConverters().getConverter(cit->from,
2680 converter->command != cit->command ||
2681 converter->flags != cit->flags)
2682 os << "\\converter \"" << cit->from << "\" \""
2683 << cit->to << "\" \""
2684 << escapeCommand(cit->command) << "\" \""
2685 << cit->flags << "\"\n";
2688 // New/modifed converters
2689 for (Converters::const_iterator cit = theSystemConverters().begin();
2690 cit != theSystemConverters().end(); ++cit)
2691 if (!theConverters().getConverter(cit->from, cit->to))
2692 os << "\\converter \"" << cit->from
2693 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2700 << "# COPIERS SECTION ##########################\n"
2703 // Look for new movers
2704 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2705 Movers::const_iterator const sysend = theSystemMovers().end();
2706 Movers::const_iterator it = theMovers().begin();
2707 Movers::const_iterator end = theMovers().end();
2709 for (; it != end; ++it) {
2710 Movers::const_iterator const sysit =
2711 find_if(sysbegin, sysend, SameMover(*it));
2712 if (sysit == sysend) {
2713 string const & fmt = it->first;
2714 string const & command =
2715 it->second.command();
2717 os << "\\copier " << fmt
2718 << " \"" << escapeCommand(command) << "\"\n";
2724 // We don't actually delete SpecialisedMover(s) from the
2725 // map, just clear their 'command', so there's no need
2726 // to test for anything else.
2733 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2735 // Why the switch you might ask. It is a trick to ensure that all
2736 // the elements in the LyXRCTags enum is handled. As you can see
2737 // there are no breaks at all. So it is just a huge fall-through.
2738 // The nice thing is that we will get a warning from the compiler
2739 // if we forget an element.
2740 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2742 case LyXRC::RC_ACCEPT_COMPOUND:
2743 case LyXRC::RC_ALT_LANG:
2744 case LyXRC::RC_PLAINTEXT_LINELEN:
2745 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2746 case LyXRC::RC_AUTOCORRECTION_MATH:
2747 case LyXRC::RC_AUTOREGIONDELETE:
2748 case LyXRC::RC_AUTORESET_OPTIONS:
2749 case LyXRC::RC_AUTOSAVE:
2750 case LyXRC::RC_AUTO_NUMBER:
2751 case LyXRC::RC_BACKUPDIR_PATH:
2752 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2753 case LyXRC::RC_BIBTEX_COMMAND:
2754 case LyXRC::RC_BINDFILE:
2755 case LyXRC::RC_CHECKLASTFILES:
2756 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2757 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2758 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2759 case LyXRC::RC_COMPLETION_INLINE_MATH:
2760 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2761 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2762 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2763 case LyXRC::RC_COMPLETION_POPUP_MATH:
2764 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2765 case LyXRC::RC_USELASTFILEPOS:
2766 case LyXRC::RC_LOADSESSION:
2767 case LyXRC::RC_CHKTEX_COMMAND:
2768 case LyXRC::RC_CONVERTER:
2769 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2770 case LyXRC::RC_COPIER:
2771 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2772 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2773 case LyXRC::RC_DATE_INSERT_FORMAT:
2774 case LyXRC::RC_DEFAULT_LANGUAGE:
2775 case LyXRC::RC_GUI_LANGUAGE:
2776 case LyXRC::RC_DEFAULT_PAPERSIZE:
2777 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2778 case LyXRC::RC_DEFFILE:
2779 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2780 case LyXRC::RC_DISPLAY_GRAPHICS:
2781 case LyXRC::RC_DOCUMENTPATH:
2782 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2783 FileName path(lyxrc_new.document_path);
2784 if (path.exists() && path.isDirectory())
2785 package().document_dir() = FileName(lyxrc.document_path);
2787 case LyXRC::RC_EDITOR_ALTERNATIVES:
2788 case LyXRC::RC_ESC_CHARS:
2789 case LyXRC::RC_EXAMPLEPATH:
2790 case LyXRC::RC_FONT_ENCODING:
2791 case LyXRC::RC_FORMAT:
2792 case LyXRC::RC_GROUP_LAYOUTS:
2793 case LyXRC::RC_HUNSPELLDIR_PATH:
2794 case LyXRC::RC_INDEX_ALTERNATIVES:
2795 case LyXRC::RC_INDEX_COMMAND:
2796 case LyXRC::RC_JBIBTEX_COMMAND:
2797 case LyXRC::RC_JINDEX_COMMAND:
2798 case LyXRC::RC_NOMENCL_COMMAND:
2799 case LyXRC::RC_INPUT:
2800 case LyXRC::RC_KBMAP:
2801 case LyXRC::RC_KBMAP_PRIMARY:
2802 case LyXRC::RC_KBMAP_SECONDARY:
2803 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2804 case LyXRC::RC_LANGUAGE_AUTO_END:
2805 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2806 case LyXRC::RC_LANGUAGE_COMMAND_END:
2807 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2808 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2809 case LyXRC::RC_LANGUAGE_PACKAGE:
2810 case LyXRC::RC_LANGUAGE_USE_BABEL:
2811 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2812 case LyXRC::RC_MACRO_EDIT_STYLE:
2813 case LyXRC::RC_MAKE_BACKUP:
2814 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2815 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2816 case LyXRC::RC_NUMLASTFILES:
2817 case LyXRC::RC_PARAGRAPH_MARKERS:
2818 case LyXRC::RC_PATH_PREFIX:
2819 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2820 prependEnvPath("PATH", lyxrc.path_prefix);
2822 case LyXRC::RC_PERS_DICT:
2823 case LyXRC::RC_PREVIEW:
2824 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2825 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2826 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2827 case LyXRC::RC_PRINTCOPIESFLAG:
2828 case LyXRC::RC_PRINTER:
2829 case LyXRC::RC_PRINTEVENPAGEFLAG:
2830 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2831 case LyXRC::RC_PRINTFILEEXTENSION:
2832 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2833 case LyXRC::RC_PRINTODDPAGEFLAG:
2834 case LyXRC::RC_PRINTPAGERANGEFLAG:
2835 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2836 case LyXRC::RC_PRINTPAPERFLAG:
2837 case LyXRC::RC_PRINTREVERSEFLAG:
2838 case LyXRC::RC_PRINTSPOOL_COMMAND:
2839 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2840 case LyXRC::RC_PRINTTOFILE:
2841 case LyXRC::RC_PRINTTOPRINTER:
2842 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2843 case LyXRC::RC_PRINT_COMMAND:
2844 case LyXRC::RC_RTL_SUPPORT:
2845 case LyXRC::RC_SAVE_COMPRESSED:
2846 case LyXRC::RC_SCREEN_DPI:
2847 case LyXRC::RC_SCREEN_FONT_ROMAN:
2848 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2849 case LyXRC::RC_SCREEN_FONT_SANS:
2850 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2851 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2852 case LyXRC::RC_SCREEN_FONT_SIZES:
2853 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2854 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2855 case LyXRC::RC_GEOMETRY_SESSION:
2856 case LyXRC::RC_SCREEN_ZOOM:
2857 case LyXRC::RC_SERVERPIPE:
2858 case LyXRC::RC_SET_COLOR:
2859 case LyXRC::RC_SHOW_BANNER:
2860 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2861 case LyXRC::RC_SPELL_COMMAND:
2862 case LyXRC::RC_SPELLCHECKER:
2863 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2864 case LyXRC::RC_SPELLCHECK_NOTES:
2865 case LyXRC::RC_SPLITINDEX_COMMAND:
2866 case LyXRC::RC_TEMPDIRPATH:
2867 case LyXRC::RC_TEMPLATEPATH:
2868 case LyXRC::RC_TEX_ALLOWS_SPACES:
2869 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2870 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2871 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2873 case LyXRC::RC_THESAURUSDIRPATH:
2874 case LyXRC::RC_UIFILE:
2875 case LyXRC::RC_USER_EMAIL:
2876 case LyXRC::RC_USER_NAME:
2877 case LyXRC::RC_USETEMPDIR:
2878 case LyXRC::RC_USE_ALT_LANG:
2879 case LyXRC::RC_USE_CONVERTER_CACHE:
2880 case LyXRC::RC_USE_ESC_CHARS:
2881 case LyXRC::RC_USE_INP_ENC:
2882 case LyXRC::RC_USE_PERS_DICT:
2883 case LyXRC::RC_USE_TOOLTIP:
2884 case LyXRC::RC_USE_PIXMAP_CACHE:
2885 case LyXRC::RC_USE_SPELL_LIB:
2886 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2887 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2888 case LyXRC::RC_SORT_LAYOUTS:
2889 case LyXRC::RC_FULL_SCREEN_LIMIT:
2890 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2891 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2892 case LyXRC::RC_FULL_SCREEN_TABBAR:
2893 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2894 case LyXRC::RC_FULL_SCREEN_WIDTH:
2895 case LyXRC::RC_VISUAL_CURSOR:
2896 case LyXRC::RC_VIEWER:
2897 case LyXRC::RC_VIEWER_ALTERNATIVES:
2898 case LyXRC::RC_FORWARD_SEARCH_DVI:
2899 case LyXRC::RC_FORWARD_SEARCH_PDF:
2900 case LyXRC::RC_EXPORT_OVERWRITE:
2901 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2902 case LyXRC::RC_LAST:
2909 string const LyXRC::getDescription(LyXRCTags tag)
2914 case RC_ACCEPT_COMPOUND:
2915 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2919 case RC_USE_ALT_LANG:
2920 str = _("Specify an alternate language. The default is to use the language of the document.");
2923 case RC_PLAINTEXT_ROFF_COMMAND:
2924 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.");
2927 case RC_PLAINTEXT_LINELEN:
2928 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.");
2931 case RC_AUTOREGIONDELETE:
2932 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2935 case RC_AUTORESET_OPTIONS:
2936 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2940 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2943 case RC_AUTO_NUMBER:
2946 case RC_BACKUPDIR_PATH:
2947 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.");
2950 case RC_BIBTEX_COMMAND:
2951 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2954 case RC_JBIBTEX_COMMAND:
2955 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2959 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2962 case RC_CHECKLASTFILES:
2963 str = _("Select to check whether the lastfiles still exist.");
2966 case RC_CHKTEX_COMMAND:
2967 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2976 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2977 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.");
2980 case RC_SCROLL_BELOW_DOCUMENT:
2981 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");
2984 case RC_MAC_LIKE_WORD_MOVEMENT:
2985 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2988 case RC_SHOW_MACRO_LABEL:
2989 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2992 case RC_DATE_INSERT_FORMAT:
2993 //xgettext:no-c-format
2994 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2998 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3001 case RC_DEFAULT_VIEW_FORMAT:
3002 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3005 case RC_DEFAULT_LANGUAGE:
3006 str = _("New documents will be assigned this language.");
3009 case RC_DEFAULT_PAPERSIZE:
3010 str = _("Specify the default paper size.");
3013 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3014 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3017 case RC_DISPLAY_GRAPHICS:
3018 str = _("Select how LyX will display any graphics.");
3021 case RC_DOCUMENTPATH:
3022 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3026 case RC_USE_ESC_CHARS:
3027 str = _("Specify additional chars that can be part of a word.");
3030 case RC_EXAMPLEPATH:
3031 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3034 case RC_FONT_ENCODING:
3035 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3041 case RC_INDEX_COMMAND:
3042 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\".");
3045 case RC_JINDEX_COMMAND:
3046 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3049 case RC_NOMENCL_COMMAND:
3050 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3057 case RC_KBMAP_PRIMARY:
3058 case RC_KBMAP_SECONDARY:
3059 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.");
3062 case RC_LANGUAGE_AUTO_BEGIN:
3063 str = _("Select if a language switching command is needed at the beginning of the document.");
3066 case RC_LANGUAGE_AUTO_END:
3067 str = _("Select if a language switching command is needed at the end of the document.");
3070 case RC_LANGUAGE_COMMAND_BEGIN:
3071 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.");
3074 case RC_LANGUAGE_COMMAND_END:
3075 str = _("The LaTeX command for changing back to the language of the document.");
3078 case RC_LANGUAGE_COMMAND_LOCAL:
3079 str = _("The LaTeX command for local changing of the language.");
3082 case RC_LANGUAGE_GLOBAL_OPTIONS:
3083 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3086 case RC_LANGUAGE_PACKAGE:
3087 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3090 case RC_LANGUAGE_USE_BABEL:
3091 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3094 case RC_USELASTFILEPOS:
3095 str = _("De-select if you do not want LyX to scroll to saved position.");
3098 case RC_LOADSESSION:
3099 str = _("De-select to prevent loading files opened from the last LyX session.");
3102 case RC_MAKE_BACKUP:
3103 str = _("De-select if you don't want LyX to create backup files.");
3106 case RC_MARK_FOREIGN_LANGUAGE:
3107 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3110 case RC_MOUSE_WHEEL_SPEED:
3111 str = bformat(_("The scrolling speed of the mouse wheel."),
3115 case RC_COMPLETION_POPUP_DELAY:
3116 str = _("The completion popup delay.");
3119 case RC_COMPLETION_POPUP_MATH:
3120 str = _("Select to display the completion popup in math mode.");
3123 case RC_COMPLETION_POPUP_TEXT:
3124 str = _("Select to display the completion popup in text mode.");
3127 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3128 str = _("Show the completion popup without delay after non-unique completion attempt.");
3131 case RC_COMPLETION_POPUP_TEXT:
3132 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3135 case RC_COMPLETION_POPUP_DELAY:
3136 str = _("The inline completion delay.");
3139 case RC_COMPLETION_INLINE_MATH:
3140 str = _("Select to display the inline completion in math mode.");
3143 case RC_COMPLETION_INLINE_TEXT:
3144 str = _("Select to display the inline completion in text mode.");
3147 case RC_COMPLETION_INLINE_DOTS:
3148 str = _("Use \"...\" to shorten long completions.");
3151 case RC_AUTOCORRECTION_MATH:
3152 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3155 case RC_NUMLASTFILES:
3156 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3160 case RC_PATH_PREFIX:
3161 str = _("Specify those directories which should be "
3162 "prepended to the PATH environment variable. "
3163 "Use the OS native format.");
3167 str = _("Shows a typeset preview of things such as math");
3170 case RC_PREVIEW_HASHED_LABELS:
3171 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3174 case RC_PREVIEW_SCALE_FACTOR:
3175 str = _("Scale the preview size to suit.");
3178 case RC_PRINTCOLLCOPIESFLAG:
3179 str = _("The option for specifying whether the copies should be collated.");
3182 case RC_PRINTCOPIESFLAG:
3183 str = _("The option for specifying the number of copies to print.");
3187 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3190 case RC_PRINTEVENPAGEFLAG:
3191 str = _("The option to print only even pages.");
3194 case RC_PRINTEXSTRAOPTIONS:
3195 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3198 case RC_PRINTFILEEXTENSION:
3199 str = _("Extension of printer program output file. Usually \".ps\".");
3202 case RC_PRINTLANDSCAPEFLAG:
3203 str = _("The option to print out in landscape.");
3206 case RC_PRINTODDPAGEFLAG:
3207 str = _("The option to print only odd pages.");
3210 case RC_PRINTPAGERANGEFLAG:
3211 str = _("The option for specifying a comma-separated list of pages to print.");
3214 case RC_PRINTPAPERDIMENSIONFLAG:
3215 str = _("Option to specify the dimensions of the print paper.");
3218 case RC_PRINTPAPERFLAG:
3219 str = _("The option to specify paper type.");
3222 case RC_PRINTREVERSEFLAG:
3223 str = _("The option to reverse the order of the pages printed.");
3226 case RC_PRINTSPOOL_COMMAND:
3227 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.");
3230 case RC_PRINTSPOOL_PRINTERPREFIX:
3231 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.");
3234 case RC_PRINTTOFILE:
3235 str = _("Option to pass to the print program to print to a file.");
3238 case RC_PRINTTOPRINTER:
3239 str = _("Option to pass to the print program to print on a specific printer.");
3242 case RC_PRINT_ADAPTOUTPUT:
3243 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3246 case RC_PRINT_COMMAND:
3247 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3250 case RC_RTL_SUPPORT:
3251 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3254 case RC_VISUAL_CURSOR:
3255 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3259 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3262 case RC_SCREEN_FONT_ROMAN:
3263 case RC_SCREEN_FONT_SANS:
3264 case RC_SCREEN_FONT_TYPEWRITER:
3265 str = _("The screen fonts used to display the text while editing.");
3268 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3269 case RC_SCREEN_FONT_SANS_FOUNDRY:
3270 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3273 case RC_SCREEN_FONT_SCALABLE:
3274 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.");
3277 case RC_SCREEN_FONT_SIZES:
3278 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3281 case RC_SCREEN_ZOOM:
3282 //xgettext:no-c-format
3283 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3286 case RC_GEOMETRY_SESSION:
3287 str = _("Allow session manager to save and restore windows geometry.");
3291 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3297 case RC_SHOW_BANNER:
3298 str = _("De-select if you don't want the startup banner.");
3301 case RC_TEMPDIRPATH:
3302 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3305 case RC_THESAURUSDIRPATH:
3306 str = _("This is the place where the files of the thesaurus library reside.");
3309 case RC_TEMPLATEPATH:
3310 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3313 case RC_TEX_ALLOWS_SPACES:
3316 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3320 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3332 case RC_USE_TOOLTIP:
3333 str = _("Enable the automatic appearance of tool tips in the work area.");
3336 case RC_USE_PIXMAP_CACHE:
3337 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3340 case RC_USE_SPELL_LIB:
3343 case RC_VIEWDVI_PAPEROPTION:
3344 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3359 // The global instance
3362 // The global copy of the system lyxrc entries (everything except preferences)