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"
48 using namespace lyx::support;
52 namespace os = support::os;
56 // when adding something to this array keep it sorted!
57 LexerKeyword lyxrcTags[] = {
58 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
59 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
60 { "\\alternate_language", LyXRC::RC_ALT_LANG },
61 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
62 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
63 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
64 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
65 { "\\autosave", LyXRC::RC_AUTOSAVE },
66 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
67 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
68 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
69 { "\\bind_file", LyXRC::RC_BINDFILE },
70 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
71 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
72 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
73 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
74 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
75 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
76 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
77 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
78 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
79 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
80 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
81 { "\\converter", LyXRC::RC_CONVERTER },
82 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
83 { "\\copier", LyXRC::RC_COPIER },
84 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
85 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
86 { "\\def_file", LyXRC::RC_DEFFILE },
87 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
88 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
89 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
90 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
91 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
92 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
93 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
94 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
95 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
96 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
97 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
98 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
99 { "\\format", LyXRC::RC_FORMAT },
100 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
101 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
102 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
103 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
104 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
105 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
106 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
107 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
108 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
109 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
110 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
111 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
112 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
113 { "\\input", LyXRC::RC_INPUT },
114 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
115 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
116 { "\\kbmap", LyXRC::RC_KBMAP },
117 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
118 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
119 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
120 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
121 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
122 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
123 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
124 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
125 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
126 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
127 { "\\load_session", LyXRC::RC_LOADSESSION },
128 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
129 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
130 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
131 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
132 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
133 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
134 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
135 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
136 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
137 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
138 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
139 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
140 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
141 { "\\preview", LyXRC::RC_PREVIEW },
142 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
143 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
144 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
145 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
146 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
147 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
148 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
149 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
150 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
151 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
152 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
153 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
154 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
155 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
156 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
157 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
158 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
159 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
160 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
161 { "\\printer", LyXRC::RC_PRINTER },
162 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
163 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
164 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
165 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
166 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
167 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
168 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
169 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
170 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
171 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
172 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
173 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
174 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
175 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
176 { "\\set_color", LyXRC::RC_SET_COLOR },
177 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
178 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
179 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
180 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
181 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
182 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
183 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
184 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
185 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
186 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
187 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
188 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
189 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
190 { "\\ui_file", LyXRC::RC_UIFILE },
191 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
192 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
193 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
194 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
195 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
196 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
197 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
198 // compatibility with versions older than 1.4.0 only
199 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
200 // compatibility with versions older than 1.4.0 only
201 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
202 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
203 { "\\user_email", LyXRC::RC_USER_EMAIL },
204 { "\\user_name", LyXRC::RC_USER_NAME },
205 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
206 // compatibility with versions older than 1.4.0 only
207 { "\\viewer", LyXRC::RC_VIEWER},
208 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
209 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
212 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
223 void LyXRC::setDefaults()
226 def_file = "default";
228 // Get printer from the environment. If fail, use default "",
229 // assuming that everything is set up correctly.
230 printer = getEnv("PRINTER");
231 print_adapt_output = false;
232 print_command = "dvips";
233 print_evenpage_flag = "-B";
234 print_oddpage_flag = "-A";
235 print_pagerange_flag = "-pp";
236 print_copies_flag = "-c";
237 print_collcopies_flag = "-C";
238 print_reverse_flag = "-r";
239 print_landscape_flag = "-t landscape";
240 print_to_printer = "-P";
241 print_to_file = "-o ";
242 print_file_extension = ".ps";
243 print_paper_flag = "-t";
244 print_paper_dimension_flag = "-T";
245 document_path.erase();
246 view_dvi_paper_option.erase();
247 default_papersize = PAPER_DEFAULT;
248 default_view_format = "pdf2";
249 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
250 bibtex_command = "bibtex";
252 index_command = "makeindex -c -q";
253 nomencl_command = "makeindex -s nomencl.ist";
255 // Because a screen is typically wider than a piece of paper:
257 allow_geometry_session = true;
258 // Default LaTeX font size:
259 font_sizes[FONT_SIZE_TINY] = "5.0";
260 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
261 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
262 font_sizes[FONT_SIZE_SMALL] = "9.0";
263 font_sizes[FONT_SIZE_NORMAL] = "10.0";
264 font_sizes[FONT_SIZE_LARGE] = "12.0";
265 font_sizes[FONT_SIZE_LARGER] = "14.4";
266 font_sizes[FONT_SIZE_LARGEST] = "17.26";
267 font_sizes[FONT_SIZE_HUGE] = "20.74";
268 font_sizes[FONT_SIZE_HUGER] = "24.88";
269 use_scalable_fonts = true;
270 roman_font_name = "";
272 typewriter_font_name = "";
274 auto_region_delete = true;
275 auto_reset_options = false;
276 plaintext_linelen = 65;
277 mouse_wheel_speed = 1.0;
278 num_lastfiles = maxlastfiles;
279 check_lastfiles = true;
280 use_lastfilepos = true;
281 load_session = false;
283 save_compressed = false;
284 backupdir_path.erase();
285 display_graphics = true;
286 // Spellchecker settings:
287 #if defined(USE_ASPELL)
288 spellchecker = "aspell";
289 #elif defined(USE_HUNSPELL)
290 spellchecker = "hunspell";
292 spellchecker = "aspell";
294 spellchecker_accept_compound = false;
295 spellcheck_continuously = false;
296 spellcheck_notes = true;
299 visual_cursor = false;
301 mark_foreign_language = true;
302 language_auto_begin = true;
303 language_auto_end = true;
304 language_global_options = true;
305 language_use_babel = true;
306 language_package = "\\usepackage{babel}";
307 language_command_begin = "\\selectlanguage{$$lang}";
308 language_command_local = "\\foreignlanguage{$$lang}{";
309 sort_layouts = false;
310 group_layouts = true;
311 default_language = "english";
312 gui_language = "auto";
314 windows_style_tex_paths = false;
315 tex_allows_spaces = false;
316 date_insert_format = "%x";
317 cursor_follows_scrollbar = false;
318 scroll_below_document = false;
319 paragraph_markers = false;
320 mac_like_word_movement = false;
321 macro_edit_style = MACRO_EDIT_INLINE_BOX;
322 dialogs_iconify_with_main = false;
323 preview = PREVIEW_OFF;
324 preview_hashed_labels = false;
325 preview_scale_factor = 1.0;
326 use_converter_cache = true;
328 use_pixmap_cache = false;
329 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
330 user_name = to_utf8(support::user_name());
331 user_email = to_utf8(support::user_email());
332 open_buffers_in_tabs = true;
333 single_close_tab_button = false;
334 forward_search_dvi = string();
335 forward_search_pdf = string();
336 export_overwrite = NO_FILES;
338 // Fullscreen settings
339 full_screen_limit = false;
340 full_screen_toolbars = true;
341 full_screen_tabbar = true;
342 full_screen_menubar = true;
343 full_screen_scrollbar = true;
344 full_screen_width = 700;
346 completion_cursor_text = true;
347 completion_popup_math = true;
348 completion_popup_text = false;
349 completion_popup_delay = 2.0;
350 completion_popup_after_complete = true;
351 autocorrection_math = false;
352 completion_inline_math = true;
353 completion_inline_text = false;
354 completion_inline_dots = -1;
355 completion_inline_delay = 0.2;
356 default_decimal_point = ".";
362 void oldFontFormat(string & family, string & foundry)
364 if (family.empty() || family[0] != '-')
366 foundry = token(family, '-', 1);
367 family = token(family, '-', 2);
375 int LyXRC::read(FileName const & filename)
377 Lexer lexrc(lyxrcTags);
378 if (lyxerr.debugging(Debug::PARSER))
379 lexrc.printTable(lyxerr);
381 lexrc.setFile(filename);
385 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
391 int LyXRC::read(istream & is)
393 Lexer lexrc(lyxrcTags);
394 if (lyxerr.debugging(Debug::PARSER))
395 lexrc.printTable(lyxerr);
401 LYXERR(Debug::LYXRC, "Reading istream...");
407 int LyXRC::read(Lexer & lexrc)
412 while (lexrc.isOK()) {
413 // By using two switches we take advantage of the compiler
414 // telling us if we have missed a LyXRCTags element in
415 // the second switch.
416 // Note that this also shows a problem with Lexer since it
417 // helps us avoid taking advantage of the strictness of the
420 int le = lexrc.lex();
422 case Lexer::LEX_UNDEF:
423 lexrc.printError("Unknown tag `$$Token'");
425 case Lexer::LEX_FEOF:
430 switch (static_cast<LyXRCTags>(le)) {
431 case RC_INPUT: // Include file
434 libFileSearch(string(),
437 lexrc.printError("Error reading "
438 "included file: " + tmp.absFileName());
444 bind_file = os::internal_path(lexrc.getString());
449 def_file = os::internal_path(lexrc.getString());
454 ui_file = os::internal_path(lexrc.getString());
457 case RC_AUTORESET_OPTIONS:
458 lexrc >> auto_reset_options;
461 case RC_DISPLAY_GRAPHICS:
463 display_graphics = lexrc.getString() == "true";
466 case RC_TEX_EXPECTS_WINDOWS_PATHS:
467 lexrc >> windows_style_tex_paths;
470 case RC_TEX_ALLOWS_SPACES:
471 lexrc >> tex_allows_spaces;
478 case RC_KBMAP_PRIMARY:
480 string const kmap(os::internal_path(lexrc.getString()));
481 if (!libFileSearch("kbd", kmap, "kmap").empty()
483 primary_kbmap = kmap;
485 lexrc.printError("LyX: Keymap `$$Token' not found");
490 case RC_KBMAP_SECONDARY:
492 string const kmap(os::internal_path(lexrc.getString()));
493 if (!libFileSearch("kbd", kmap, "kmap").empty()
495 secondary_kbmap = kmap;
497 lexrc.printError("LyX: Keymap `$$Token' not found");
502 case RC_FONT_ENCODING:
510 case RC_PRINT_COMMAND:
511 if (lexrc.next(true)) {
512 print_command = lexrc.getString();
516 case RC_PRINTEVENPAGEFLAG:
517 lexrc >> print_evenpage_flag;
520 case RC_PRINTODDPAGEFLAG:
521 lexrc >> print_oddpage_flag;
524 case RC_PRINTPAGERANGEFLAG:
525 lexrc >> print_pagerange_flag;
528 case RC_PRINTCOPIESFLAG:
529 lexrc >> print_copies_flag;
532 case RC_PRINTCOLLCOPIESFLAG:
533 lexrc >> print_collcopies_flag;
536 case RC_PRINTREVERSEFLAG:
537 lexrc >> print_reverse_flag;
540 case RC_PRINTLANDSCAPEFLAG:
541 lexrc >> print_landscape_flag;
544 case RC_PRINTTOPRINTER:
545 lexrc >> print_to_printer;
548 case RC_PRINT_ADAPTOUTPUT:
549 lexrc >> print_adapt_output;
554 print_to_file = os::internal_path(lexrc.getString());
558 case RC_PRINTFILEEXTENSION:
559 lexrc >> print_file_extension;
562 case RC_PRINTEXSTRAOPTIONS:
563 lexrc >> print_extra_options;
566 case RC_PRINTSPOOL_COMMAND:
567 if (lexrc.next(true)) {
568 print_spool_command = lexrc.getString();
572 case RC_PRINTSPOOL_PRINTERPREFIX:
573 lexrc >> print_spool_printerprefix;
576 case RC_PRINTPAPERDIMENSIONFLAG:
577 lexrc >> print_paper_dimension_flag;
580 case RC_PRINTPAPERFLAG:
581 lexrc >> print_paper_flag;
584 case RC_DEFAULT_PAPERSIZE:
586 string const size = ascii_lowercase(lexrc.getString());
587 if (size == "usletter")
588 default_papersize = PAPER_USLETTER;
589 else if (size == "legal")
590 default_papersize = PAPER_USLEGAL;
591 else if (size == "executive")
592 default_papersize = PAPER_USEXECUTIVE;
593 else if (size == "a3")
594 default_papersize = PAPER_A3;
595 else if (size == "a4")
596 default_papersize = PAPER_A4;
597 else if (size == "a5")
598 default_papersize = PAPER_A5;
599 else if (size == "b5")
600 default_papersize = PAPER_B5;
601 else if (size == "default")
602 default_papersize = PAPER_DEFAULT;
606 case RC_VIEWDVI_PAPEROPTION:
608 view_dvi_paper_option = lexrc.getString();
610 view_dvi_paper_option.erase();
613 case RC_CHKTEX_COMMAND:
614 if (lexrc.next(true)) {
615 chktex_command = lexrc.getString();
619 case RC_BIBTEX_ALTERNATIVES:
620 if (lexrc.next(true)) {
621 bibtex_alternatives.insert(lexrc.getString());
625 case RC_BIBTEX_COMMAND:
626 if (lexrc.next(true)) {
627 bibtex_command = lexrc.getString();
631 case RC_JBIBTEX_COMMAND:
632 if (lexrc.next(true)) {
633 jbibtex_command = lexrc.getString();
637 case RC_INDEX_ALTERNATIVES:
638 if (lexrc.next(true)) {
639 index_alternatives.insert(lexrc.getString());
643 case RC_INDEX_COMMAND:
644 if (lexrc.next(true)) {
645 index_command = lexrc.getString();
649 case RC_JINDEX_COMMAND:
650 if (lexrc.next(true)) {
651 jindex_command = lexrc.getString();
655 case RC_SPLITINDEX_COMMAND:
656 if (lexrc.next(true)) {
657 splitindex_command = lexrc.getString();
661 case RC_NOMENCL_COMMAND:
662 if (lexrc.next(true)) {
663 nomencl_command = lexrc.getString();
675 case RC_GEOMETRY_SESSION:
676 lexrc >> allow_geometry_session;
679 case RC_SCREEN_FONT_SIZES:
680 lexrc >> font_sizes[FONT_SIZE_TINY];
681 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
682 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
683 lexrc >> font_sizes[FONT_SIZE_SMALL];
684 lexrc >> font_sizes[FONT_SIZE_NORMAL];
685 lexrc >> font_sizes[FONT_SIZE_LARGE];
686 lexrc >> font_sizes[FONT_SIZE_LARGER];
687 lexrc >> font_sizes[FONT_SIZE_LARGEST];
688 lexrc >> font_sizes[FONT_SIZE_HUGE];
689 lexrc >> font_sizes[FONT_SIZE_HUGER];
692 case RC_SCREEN_FONT_SCALABLE:
693 lexrc >> use_scalable_fonts;
700 case RC_DOCUMENTPATH:
702 document_path = os::internal_path(lexrc.getString());
703 document_path = expandPath(document_path);
709 example_path = os::internal_path(lexrc.getString());
710 example_path = expandPath(example_path);
714 case RC_TEMPLATEPATH:
716 template_path = os::internal_path(lexrc.getString());
717 template_path = expandPath(template_path);
723 tempdir_path = os::internal_path(lexrc.getString());
724 tempdir_path = expandPath(tempdir_path);
728 case RC_THESAURUSDIRPATH:
730 thesaurusdir_path = os::internal_path(lexrc.getString());
731 thesaurusdir_path = expandPath(thesaurusdir_path);
735 case RC_HUNSPELLDIR_PATH:
737 hunspelldir_path = os::internal_path(lexrc.getString());
738 hunspelldir_path = expandPath(hunspelldir_path);
742 case RC_USELASTFILEPOS:
743 lexrc >> use_lastfilepos;
747 lexrc >> load_session;
750 case RC_MOUSE_WHEEL_SPEED:
751 lexrc >> mouse_wheel_speed;
754 case RC_COMPLETION_INLINE_DELAY:
755 lexrc >> completion_inline_delay;
758 case RC_COMPLETION_INLINE_MATH:
759 lexrc >> completion_inline_math;
762 case RC_COMPLETION_INLINE_TEXT:
763 lexrc >> completion_inline_text;
766 case RC_COMPLETION_INLINE_DOTS:
767 lexrc >> completion_inline_dots;
770 case RC_AUTOCORRECTION_MATH:
771 lexrc >> autocorrection_math;
774 case RC_COMPLETION_POPUP_DELAY:
775 lexrc >> completion_popup_delay;
778 case RC_COMPLETION_POPUP_MATH:
779 lexrc >> completion_popup_math;
782 case RC_COMPLETION_POPUP_TEXT:
783 lexrc >> completion_popup_text;
786 case RC_COMPLETION_CURSOR_TEXT:
787 lexrc >> completion_cursor_text;
790 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
791 lexrc >> completion_popup_after_complete;
794 case RC_NUMLASTFILES:
795 lexrc >> num_lastfiles;
798 case RC_CHECKLASTFILES:
799 lexrc >> check_lastfiles;
802 case RC_SCREEN_FONT_ROMAN:
804 roman_font_name = lexrc.getString();
805 oldFontFormat(roman_font_name,
810 case RC_SCREEN_FONT_SANS:
812 sans_font_name = lexrc.getString();
813 oldFontFormat(sans_font_name, sans_font_foundry);
817 case RC_SCREEN_FONT_TYPEWRITER:
819 typewriter_font_name = lexrc.getString();
820 oldFontFormat(typewriter_font_name,
821 typewriter_font_foundry);
825 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
826 lexrc >> roman_font_foundry;
829 case RC_SCREEN_FONT_SANS_FOUNDRY:
830 lexrc >> sans_font_foundry;
833 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
834 lexrc >> typewriter_font_foundry;
839 lexrc.printError("Missing color tag.");
842 string lyx_name = lexrc.getString();
845 lexrc.printError("Missing color name for color: `$$Token'");
848 string x11_name = lexrc.getString();
850 ColorCode const col =
851 lcolor.getFromLyXName(lyx_name);
852 if (col == Color_none ||
853 col == Color_inherit ||
857 if (!lcolor.setColor(col, x11_name))
858 LYXERR0("Bad lyxrc set_color for " << lyx_name);
862 case RC_AUTOREGIONDELETE:
863 // Auto region delete defaults to true
864 lexrc >> auto_region_delete;
869 lyxpipes = os::internal_path(lexrc.getString());
870 lyxpipes = expandPath(lyxpipes);
874 case RC_CURSOR_FOLLOWS_SCROLLBAR:
875 lexrc >> cursor_follows_scrollbar;
878 case RC_SCROLL_BELOW_DOCUMENT:
879 lexrc >> scroll_below_document;
882 case RC_PARAGRAPH_MARKERS:
883 lexrc >> paragraph_markers;
886 case RC_MAC_LIKE_WORD_MOVEMENT:
887 lexrc >> mac_like_word_movement;
890 case RC_MACRO_EDIT_STYLE:
892 switch (lexrc.getInteger()) {
893 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
894 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
895 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
900 case RC_DIALOGS_ICONIFY_WITH_MAIN:
901 lexrc >> dialogs_iconify_with_main;
904 case RC_PLAINTEXT_LINELEN:
905 lexrc >> plaintext_linelen;
907 // Spellchecker settings:
908 case RC_ACCEPT_COMPOUND:
909 lexrc >> spellchecker_accept_compound;
912 lexrc >> use_tooltip;
914 case RC_USE_PIXMAP_CACHE:
915 lexrc >> use_pixmap_cache;
917 case RC_SPELLCHECKER:
918 lexrc >> spellchecker;
921 lexrc >> spellchecker_alt_lang;
924 lexrc >> spellchecker_esc_chars;
926 case RC_SPELLCHECK_CONTINUOUSLY:
927 lexrc >> spellcheck_continuously;
929 case RC_SPELLCHECK_NOTES:
930 lexrc >> spellcheck_notes;
933 lexrc >> make_backup;
935 case RC_SAVE_COMPRESSED:
936 lexrc >> save_compressed;
938 case RC_BACKUPDIR_PATH:
940 backupdir_path = os::internal_path(lexrc.getString());
941 backupdir_path = expandPath(backupdir_path);
944 case RC_DEFAULT_DECIMAL_POINT:
945 lexrc >> default_decimal_point;
947 case RC_DATE_INSERT_FORMAT:
948 lexrc >> date_insert_format;
950 case RC_LANGUAGE_PACKAGE:
951 lexrc >> language_package;
953 case RC_LANGUAGE_AUTO_BEGIN:
954 lexrc >> language_auto_begin;
956 case RC_LANGUAGE_AUTO_END:
957 lexrc >> language_auto_end;
959 case RC_LANGUAGE_GLOBAL_OPTIONS:
960 lexrc >> language_global_options;
962 case RC_LANGUAGE_USE_BABEL:
963 lexrc >> language_use_babel;
965 case RC_LANGUAGE_COMMAND_BEGIN:
966 lexrc >> language_command_begin;
968 case RC_LANGUAGE_COMMAND_END:
969 lexrc >> language_command_end;
971 case RC_LANGUAGE_COMMAND_LOCAL:
972 lexrc >> language_command_local;
975 lexrc >> rtl_support;
977 case RC_VISUAL_CURSOR:
978 lexrc >> visual_cursor;
981 lexrc >> auto_number;
983 case RC_MARK_FOREIGN_LANGUAGE:
984 lexrc >> mark_foreign_language;
990 fmt = lexrc.getString();
991 if (lexrc.next(true))
992 command = lexrc.getString();
993 setMover(fmt, command);
998 string from, to, command, flags;
1000 from = lexrc.getString();
1002 to = lexrc.getString();
1003 if (lexrc.next(true))
1004 command = lexrc.getString();
1006 flags = lexrc.getString();
1007 if (command.empty())
1008 theConverters().erase(from, to);
1010 theConverters().add(from, to, command, flags);
1013 // compatibility with versions older than 1.4.0 only
1015 string format, command;
1016 lexrc >> format >> command;
1017 formats.setViewer(format, command);
1021 string format, extension, prettyname, shortcut;
1022 lexrc >> format >> extension >> prettyname >> shortcut;
1023 string viewer, editor;
1024 if (lexrc.next(true))
1025 viewer = lexrc.getString();
1026 if (lexrc.next(true))
1027 editor = lexrc.getString();
1029 // Hack to ensure compatibility with versions older
1031 int le = lexrc.lex();
1032 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1033 flags = lexrc.getString();
1034 if (le != Lexer::LEX_DATA) {
1035 // We have got a known token.
1036 // Therefore this is an old style
1037 // format definition without
1039 lexrc.pushToken(flags);
1043 int flgs = Format::none;
1044 while (!flags.empty()) {
1046 flags = split(flags, flag, ',');
1047 if (flag == "document")
1048 flgs |= Format::document;
1049 else if (flag == "vector")
1050 flgs |= Format::vector;
1052 LYXERR0("Ignoring unknown flag `"
1053 << flag << "' for format `"
1056 if (prettyname.empty()) {
1057 if (theConverters().formatIsUsed(format))
1058 LYXERR0("Can't delete format " << format);
1060 formats.erase(format);
1062 formats.add(format, extension, prettyname,
1063 shortcut, viewer, editor, flgs);
1067 case RC_VIEWER_ALTERNATIVES: {
1068 string format, command;
1070 format = lexrc.getString();
1071 if (lexrc.eatLine())
1072 command = lexrc.getString();
1073 viewer_alternatives[format].insert(command);
1076 case RC_EDITOR_ALTERNATIVES: {
1077 string format, command;
1078 lexrc >> format >> command;
1079 editor_alternatives[format].insert(command);
1083 case RC_DEFAULT_VIEW_FORMAT:
1084 lexrc >> default_view_format;
1087 case RC_DEFAULT_LANGUAGE:
1088 lexrc >> default_language;
1091 case RC_GUI_LANGUAGE:
1092 lexrc >> gui_language;
1095 case RC_SHOW_BANNER:
1096 lexrc >> show_banner;
1101 string const tmp = lexrc.getString();
1102 if (tmp == "true" || tmp == "on")
1103 preview = PREVIEW_ON;
1104 else if (tmp == "no_math")
1105 preview = PREVIEW_NO_MATH;
1107 preview = PREVIEW_OFF;
1108 if (tmp != "false" && tmp != "off")
1109 LYXERR0("Unrecognized preview status \""
1115 case RC_PREVIEW_HASHED_LABELS:
1116 lexrc >> preview_hashed_labels;
1119 case RC_PREVIEW_SCALE_FACTOR:
1120 lexrc >> preview_scale_factor;
1127 lexrc >> user_email;
1130 case RC_PATH_PREFIX:
1131 lexrc >> path_prefix;
1134 case RC_USE_CONVERTER_CACHE:
1135 lexrc >> use_converter_cache;
1137 case RC_CONVERTER_CACHE_MAXAGE:
1138 lexrc >> converter_cache_maxage;
1141 case RC_SORT_LAYOUTS:
1142 lexrc >> sort_layouts;
1144 case RC_GROUP_LAYOUTS:
1145 lexrc >> group_layouts;
1147 case RC_FULL_SCREEN_LIMIT:
1148 lexrc >> full_screen_limit;
1150 case RC_FULL_SCREEN_TOOLBARS:
1151 lexrc >> full_screen_toolbars;
1153 case RC_FULL_SCREEN_SCROLLBAR:
1154 lexrc >> full_screen_scrollbar;
1156 case RC_FULL_SCREEN_TABBAR:
1157 lexrc >> full_screen_tabbar;
1159 case RC_FULL_SCREEN_MENUBAR:
1160 lexrc >> full_screen_menubar;
1162 case RC_FULL_SCREEN_WIDTH:
1163 lexrc >> full_screen_width;
1165 case RC_OPEN_BUFFERS_IN_TABS:
1166 lexrc >> open_buffers_in_tabs;
1168 case RC_SINGLE_CLOSE_TAB_BUTTON:
1169 lexrc >> single_close_tab_button;
1171 case RC_FORWARD_SEARCH_DVI:
1172 if (lexrc.next(true))
1173 forward_search_dvi = lexrc.getString();
1175 case RC_FORWARD_SEARCH_PDF:
1176 if (lexrc.next(true))
1177 forward_search_pdf = lexrc.getString();
1179 case RC_EXPORT_OVERWRITE:
1181 string const tmp = lexrc.getString();
1182 if (tmp == "all" || tmp == "true")
1183 export_overwrite = ALL_FILES;
1184 else if (tmp == "main")
1185 export_overwrite = MAIN_FILE;
1187 export_overwrite = NO_FILES;
1188 if (tmp != "ask" && tmp != "false")
1189 LYXERR0("Unrecognized export_overwrite status \""
1195 // Obsoteted in 1.4.0
1198 case RC_SPELL_COMMAND:
1200 case RC_PLAINTEXT_ROFF_COMMAND:
1201 case RC_USE_ALT_LANG:
1202 case RC_USE_ESC_CHARS:
1203 case RC_USE_INP_ENC:
1204 case RC_USE_PERS_DICT:
1205 case RC_USE_SPELL_LIB:
1206 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1207 << lexrc.getString() << "'.");
1212 break; // this is just a dummy
1216 /// Update converters data-structures
1217 theConverters().update(formats);
1218 theConverters().buildGraph();
1224 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1226 ofstream ofs(filename.toFilesystemEncoding().c_str());
1228 write(ofs, ignore_system_lyxrc);
1232 void LyXRC::print() const
1234 if (lyxerr.debugging())
1235 write(lyxerr, false);
1243 typedef pair<string, SpecialisedMover> Data;
1245 SameMover(Data const & comparison)
1246 : comparison_(comparison) {}
1248 bool operator()(Data const & data) const
1250 return data.first == comparison_.first &&
1251 data.second.command() == comparison_.second.command();
1261 // Escape \ and " so that LyXLex can read the string later
1262 string escapeCommand(string const & str) {
1263 return subst(subst(str , "\\", "\\\\"),
1270 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1272 LyXRCTags tag = RC_LAST;
1274 if (!name.empty()) {
1275 for (int i = 0; i != lyxrcCount; ++i)
1276 if ("\\" + name == lyxrcTags[i].tag)
1277 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1281 os << "# LyX " << lyx_version
1282 << " generated this file. If you want to make your own\n"
1283 << "# modifications you should do them from inside LyX and save.\n"
1286 // Why the switch you might ask. It is a trick to ensure that all
1287 // the elements in the LyXRCTags enum are handled. As you can see
1288 // there are no breaks at all. So it is just a huge fall-through.
1289 // The nice thing is that we will get a warning from the compiler
1290 // if we forget an element.
1294 // input/include files are not done here
1296 if (ignore_system_lyxrc ||
1297 bind_file != system_lyxrc.bind_file) {
1298 string const path = os::external_path(bind_file);
1299 os << "\\bind_file \"" << path << "\"\n";
1305 if (ignore_system_lyxrc ||
1306 def_file != system_lyxrc.def_file) {
1307 string const path = os::external_path(def_file);
1308 os << "\\def_file \"" << path << "\"\n";
1317 << "# MISC SECTION ######################################\n"
1319 // bind files are not done here.
1321 case RC_PATH_PREFIX:
1322 if (ignore_system_lyxrc ||
1323 path_prefix != system_lyxrc.path_prefix) {
1324 os << "\\path_prefix \"" << path_prefix << "\"\n";
1329 if (ignore_system_lyxrc ||
1330 ui_file != system_lyxrc.ui_file) {
1331 string const path = os::external_path(ui_file);
1332 os << "\\ui_file \"" << path << "\"\n";
1336 case RC_AUTOREGIONDELETE:
1337 if (ignore_system_lyxrc ||
1338 auto_region_delete != system_lyxrc.auto_region_delete) {
1339 os << "# Set to false to inhibit automatic replacement of\n"
1340 << "# the current selection.\n"
1341 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1346 case RC_AUTORESET_OPTIONS:
1347 if (ignore_system_lyxrc ||
1348 auto_reset_options != system_lyxrc.auto_reset_options) {
1349 os << "# Set to false to inhibit automatic reset of\n"
1350 << "# the class options to defaults on class change.\n"
1351 << "\\auto_reset_options "
1352 << convert<string>(auto_reset_options)
1358 if (ignore_system_lyxrc ||
1359 autosave != system_lyxrc.autosave) {
1360 os << "# The time interval between auto-saves in seconds.\n"
1361 << "\\autosave " << autosave << '\n';
1365 case RC_DISPLAY_GRAPHICS:
1366 if (ignore_system_lyxrc ||
1367 display_graphics != system_lyxrc.display_graphics) {
1368 os << "# Display graphics within LyX\n"
1370 << "\\display_graphics "
1371 << (display_graphics ? "true" : "false")
1376 case RC_SORT_LAYOUTS:
1377 if (ignore_system_lyxrc ||
1378 sort_layouts != system_lyxrc.sort_layouts) {
1379 os << "# Sort layouts alphabetically.\n"
1380 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1384 case RC_GROUP_LAYOUTS:
1385 if (ignore_system_lyxrc ||
1386 group_layouts != system_lyxrc.group_layouts) {
1387 os << "# Group layouts by their category.\n"
1388 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1392 case RC_VIEWDVI_PAPEROPTION:
1393 if (ignore_system_lyxrc ||
1394 view_dvi_paper_option
1395 != system_lyxrc.view_dvi_paper_option) {
1396 os << "# Options used to specify paper size to the\n"
1397 << "# view_dvi_command (e.g. -paper)\n"
1398 << "\\view_dvi_paper_option \""
1399 << view_dvi_paper_option << "\"\n";
1403 case RC_DEFAULT_PAPERSIZE:
1404 if (ignore_system_lyxrc ||
1405 default_papersize != system_lyxrc.default_papersize) {
1406 os << "# The default papersize to use.\n"
1407 << "\\default_papersize \"";
1408 switch (default_papersize) {
1410 os << "default"; break;
1411 case PAPER_USLETTER:
1412 os << "usletter"; break;
1414 os << "legal"; break;
1415 case PAPER_USEXECUTIVE:
1416 os << "executive"; break;
1442 case PAPER_JISB6: break;
1448 case RC_CHKTEX_COMMAND:
1449 if (ignore_system_lyxrc ||
1450 chktex_command != system_lyxrc.chktex_command) {
1451 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1455 case RC_BIBTEX_ALTERNATIVES: {
1456 CommandSet::const_iterator it = bibtex_alternatives.begin();
1457 CommandSet::const_iterator end = bibtex_alternatives.end();
1458 for ( ; it != end; ++it) {
1459 if (ignore_system_lyxrc
1460 || !system_lyxrc.bibtex_alternatives.count(*it))
1461 os << "\\bibtex_alternatives \""
1467 case RC_BIBTEX_COMMAND:
1468 if (ignore_system_lyxrc ||
1469 bibtex_command != system_lyxrc.bibtex_command) {
1470 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1474 case RC_JBIBTEX_COMMAND:
1475 if (ignore_system_lyxrc ||
1476 jbibtex_command != system_lyxrc.jbibtex_command) {
1477 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1481 case RC_INDEX_ALTERNATIVES: {
1482 CommandSet::const_iterator it = index_alternatives.begin();
1483 CommandSet::const_iterator end = index_alternatives.end();
1484 for ( ; it != end; ++it) {
1485 if (ignore_system_lyxrc
1486 || !system_lyxrc.index_alternatives.count(*it))
1487 os << "\\index_alternatives \""
1493 case RC_INDEX_COMMAND:
1494 if (ignore_system_lyxrc ||
1495 index_command != system_lyxrc.index_command) {
1496 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1500 case RC_JINDEX_COMMAND:
1501 if (ignore_system_lyxrc ||
1502 jindex_command != system_lyxrc.jindex_command) {
1503 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1507 case RC_SPLITINDEX_COMMAND:
1508 if (ignore_system_lyxrc ||
1509 splitindex_command != system_lyxrc.splitindex_command) {
1510 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1514 case RC_NOMENCL_COMMAND:
1515 if (ignore_system_lyxrc ||
1516 nomencl_command != system_lyxrc.nomencl_command) {
1517 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1521 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1522 if (ignore_system_lyxrc ||
1523 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1524 os << "\\tex_expects_windows_paths "
1525 << convert<string>(windows_style_tex_paths) << '\n';
1529 case RC_TEX_ALLOWS_SPACES:
1530 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1531 os << "\\tex_allows_spaces "
1532 << convert<string>(tex_allows_spaces) << '\n';
1537 if (ignore_system_lyxrc ||
1538 use_kbmap != system_lyxrc.use_kbmap) {
1539 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1543 case RC_KBMAP_PRIMARY:
1544 if (ignore_system_lyxrc ||
1545 primary_kbmap != system_lyxrc.primary_kbmap) {
1546 string const path = os::external_path(primary_kbmap);
1547 os << "\\kbmap_primary \"" << path << "\"\n";
1551 case RC_KBMAP_SECONDARY:
1552 if (ignore_system_lyxrc ||
1553 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1554 string const path = os::external_path(secondary_kbmap);
1555 os << "\\kbmap_secondary \"" << path << "\"\n";
1560 if (ignore_system_lyxrc ||
1561 lyxpipes != system_lyxrc.lyxpipes) {
1562 string const path = os::external_path(lyxpipes);
1563 os << "\\serverpipe \"" << path << "\"\n";
1567 case RC_DATE_INSERT_FORMAT:
1568 if (ignore_system_lyxrc ||
1569 date_insert_format != system_lyxrc.date_insert_format) {
1570 os << "\\date_insert_format \"" << date_insert_format
1577 os << "\\user_name \"" << user_name << "\"\n";
1582 os << "\\user_email \"" << user_email << "\"\n";
1586 case RC_SHOW_BANNER:
1587 if (ignore_system_lyxrc ||
1588 show_banner != system_lyxrc.show_banner) {
1589 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1595 if (ignore_system_lyxrc ||
1596 preview != system_lyxrc.preview) {
1602 case PREVIEW_NO_MATH:
1609 os << "\\preview " << status << '\n';
1614 case RC_PREVIEW_HASHED_LABELS:
1615 if (ignore_system_lyxrc ||
1616 preview_hashed_labels !=
1617 system_lyxrc.preview_hashed_labels) {
1618 os << "\\preview_hashed_labels "
1619 << convert<string>(preview_hashed_labels) << '\n';
1624 case RC_PREVIEW_SCALE_FACTOR:
1625 if (ignore_system_lyxrc ||
1626 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1627 os << "\\preview_scale_factor "
1628 << preview_scale_factor << '\n';
1633 case RC_USE_CONVERTER_CACHE:
1634 if (ignore_system_lyxrc ||
1635 use_converter_cache != system_lyxrc.use_converter_cache) {
1636 os << "\\use_converter_cache "
1637 << convert<string>(use_converter_cache) << '\n';
1642 case RC_CONVERTER_CACHE_MAXAGE:
1643 if (ignore_system_lyxrc ||
1644 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1645 os << "\\converter_cache_maxage "
1646 << converter_cache_maxage << '\n';
1652 << "# SCREEN & FONTS SECTION ############################\n"
1656 if (ignore_system_lyxrc ||
1657 dpi != system_lyxrc.dpi) {
1658 os << "\\screen_dpi " << dpi << '\n';
1662 case RC_SCREEN_ZOOM:
1663 if (ignore_system_lyxrc ||
1664 zoom != system_lyxrc.zoom) {
1665 os << "\\screen_zoom " << zoom << '\n';
1669 case RC_GEOMETRY_SESSION:
1670 if (ignore_system_lyxrc ||
1671 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1672 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1677 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1678 if (ignore_system_lyxrc ||
1679 cursor_follows_scrollbar
1680 != system_lyxrc.cursor_follows_scrollbar) {
1681 os << "\\cursor_follows_scrollbar "
1682 << convert<string>(cursor_follows_scrollbar) << '\n';
1686 case RC_SCROLL_BELOW_DOCUMENT:
1687 if (ignore_system_lyxrc ||
1688 scroll_below_document
1689 != system_lyxrc.scroll_below_document) {
1690 os << "\\scroll_below_document "
1691 << convert<string>(scroll_below_document) << '\n';
1695 case RC_PARAGRAPH_MARKERS:
1696 if (ignore_system_lyxrc ||
1698 != system_lyxrc.paragraph_markers) {
1699 os << "\\paragraph_markers "
1700 << convert<string>(paragraph_markers) << '\n';
1704 case RC_MAC_LIKE_WORD_MOVEMENT:
1705 if (ignore_system_lyxrc ||
1706 mac_like_word_movement
1707 != system_lyxrc.mac_like_word_movement) {
1708 os << "\\mac_like_word_movement "
1709 << convert<string>(mac_like_word_movement) << '\n';
1713 case RC_MACRO_EDIT_STYLE:
1714 if (ignore_system_lyxrc ||
1716 != system_lyxrc.macro_edit_style) {
1717 os << "\\macro_edit_style ";
1718 switch (macro_edit_style) {
1719 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1720 case MACRO_EDIT_INLINE: os << "1\n"; break;
1721 case MACRO_EDIT_LIST: os << "2\n"; break;
1726 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1727 if (ignore_system_lyxrc ||
1728 dialogs_iconify_with_main
1729 != system_lyxrc.dialogs_iconify_with_main) {
1730 os << "\\dialogs_iconify_with_main "
1731 << convert<string>(dialogs_iconify_with_main) << '\n';
1735 case RC_SCREEN_FONT_ROMAN:
1736 if (ignore_system_lyxrc ||
1737 roman_font_name != system_lyxrc.roman_font_name) {
1738 os << "\\screen_font_roman \"" << roman_font_name
1743 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1744 if (ignore_system_lyxrc ||
1745 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1746 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1751 case RC_SCREEN_FONT_SANS:
1752 if (ignore_system_lyxrc ||
1753 sans_font_name != system_lyxrc.sans_font_name) {
1754 os << "\\screen_font_sans \"" << sans_font_name
1759 case RC_SCREEN_FONT_SANS_FOUNDRY:
1760 if (ignore_system_lyxrc ||
1761 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1762 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1767 case RC_SCREEN_FONT_TYPEWRITER:
1768 if (ignore_system_lyxrc ||
1769 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1770 os << "\\screen_font_typewriter \""
1771 << typewriter_font_name << "\"\n";
1775 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1776 if (ignore_system_lyxrc ||
1777 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1778 os << "\\screen_font_typewriter_foundry \""
1779 << typewriter_font_foundry << "\"\n";
1784 case RC_SCREEN_FONT_SCALABLE:
1785 if (ignore_system_lyxrc ||
1786 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1787 os << "\\screen_font_scalable "
1788 << convert<string>(use_scalable_fonts)
1793 case RC_SCREEN_FONT_SIZES:
1794 if (ignore_system_lyxrc ||
1795 font_sizes[FONT_SIZE_TINY]
1796 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1797 font_sizes[FONT_SIZE_SCRIPT]
1798 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1799 font_sizes[FONT_SIZE_FOOTNOTE]
1800 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1801 font_sizes[FONT_SIZE_SMALL]
1802 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1803 font_sizes[FONT_SIZE_NORMAL]
1804 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1805 font_sizes[FONT_SIZE_LARGE]
1806 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1807 font_sizes[FONT_SIZE_LARGER]
1808 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1809 font_sizes[FONT_SIZE_LARGEST]
1810 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1811 font_sizes[FONT_SIZE_HUGE]
1812 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1813 font_sizes[FONT_SIZE_HUGER]
1814 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1815 os.setf(ios::fixed);
1817 os << "\\screen_font_sizes"
1818 << ' ' << font_sizes[FONT_SIZE_TINY]
1819 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1820 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1821 << ' ' << font_sizes[FONT_SIZE_SMALL]
1822 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1823 << ' ' << font_sizes[FONT_SIZE_LARGE]
1824 << ' ' << font_sizes[FONT_SIZE_LARGER]
1825 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1826 << ' ' << font_sizes[FONT_SIZE_HUGE]
1827 << ' ' << font_sizes[FONT_SIZE_HUGER]
1832 case RC_FULL_SCREEN_LIMIT:
1833 if (ignore_system_lyxrc ||
1834 full_screen_limit != system_lyxrc.full_screen_limit) {
1835 os << "\\fullscreen_limit "
1836 << convert<string>(full_screen_limit)
1841 case RC_FULL_SCREEN_TOOLBARS:
1842 if (ignore_system_lyxrc ||
1843 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1844 os << "\\fullscreen_toolbars "
1845 << convert<string>(full_screen_toolbars)
1850 case RC_FULL_SCREEN_SCROLLBAR:
1851 if (ignore_system_lyxrc ||
1852 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1853 os << "\\fullscreen_scrollbar "
1854 << convert<string>(full_screen_scrollbar)
1859 case RC_FULL_SCREEN_TABBAR:
1860 if (ignore_system_lyxrc ||
1861 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1862 os << "\\fullscreen_tabbar "
1863 << convert<string>(full_screen_tabbar)
1868 case RC_FULL_SCREEN_MENUBAR:
1869 if (ignore_system_lyxrc ||
1870 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1871 os << "\\fullscreen_menubar "
1872 << convert<string>(full_screen_menubar)
1877 case RC_FULL_SCREEN_WIDTH:
1878 if (ignore_system_lyxrc ||
1879 full_screen_width != system_lyxrc.full_screen_width) {
1880 os << "\\fullscreen_width "
1881 << convert<string>(full_screen_width)
1886 case RC_OPEN_BUFFERS_IN_TABS:
1887 if (ignore_system_lyxrc ||
1888 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1889 os << "\\open_buffers_in_tabs "
1890 << convert<string>(open_buffers_in_tabs)
1895 case RC_SINGLE_CLOSE_TAB_BUTTON:
1896 if (ignore_system_lyxrc ||
1897 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1898 os << "\\single_close_tab_button "
1899 << convert<string>(single_close_tab_button)
1904 case RC_FORWARD_SEARCH_DVI:
1905 if (ignore_system_lyxrc ||
1906 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1907 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1911 case RC_FORWARD_SEARCH_PDF:
1912 if (ignore_system_lyxrc ||
1913 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1914 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1920 << "# COLOR SECTION ###################################\n"
1924 for (int i = 0; i < Color_ignore; ++i) {
1925 ColorCode lc = static_cast<ColorCode>(i);
1926 string const col = lcolor.getX11Name(lc);
1927 if (ignore_system_lyxrc
1928 || col != system_lcolor.getX11Name(lc)) {
1929 os << "\\set_color \""
1930 << lcolor.getLyXName(lc) << "\" \""
1938 << "# PRINTER SECTION ###################################\n"
1942 if (ignore_system_lyxrc ||
1943 printer != system_lyxrc.printer) {
1944 os << "\\printer \"" << printer << "\"\n";
1948 case RC_PRINT_ADAPTOUTPUT:
1949 if (ignore_system_lyxrc ||
1950 print_adapt_output != system_lyxrc.print_adapt_output) {
1951 os << "\\print_adapt_output "
1952 << convert<string>(print_adapt_output)
1957 case RC_PRINT_COMMAND:
1958 if (ignore_system_lyxrc ||
1959 print_command != system_lyxrc.print_command) {
1960 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1964 case RC_PRINTEXSTRAOPTIONS:
1965 if (ignore_system_lyxrc ||
1966 print_extra_options != system_lyxrc.print_extra_options) {
1967 os << "\\print_extra_options \"" << print_extra_options
1972 case RC_PRINTSPOOL_COMMAND:
1973 if (ignore_system_lyxrc ||
1974 print_spool_command != system_lyxrc.print_spool_command) {
1975 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1980 case RC_PRINTSPOOL_PRINTERPREFIX:
1981 if (ignore_system_lyxrc ||
1982 print_spool_printerprefix
1983 != system_lyxrc.print_spool_printerprefix) {
1984 os << "\\print_spool_printerprefix \""
1985 << print_spool_printerprefix << "\"\n";
1989 case RC_PRINTEVENPAGEFLAG:
1990 if (ignore_system_lyxrc ||
1991 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1992 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1997 case RC_PRINTODDPAGEFLAG:
1998 if (ignore_system_lyxrc ||
1999 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2000 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2005 case RC_PRINTREVERSEFLAG:
2006 if (ignore_system_lyxrc ||
2007 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2008 os << "\\print_reverse_flag \"" << print_reverse_flag
2013 case RC_PRINTLANDSCAPEFLAG:
2014 if (ignore_system_lyxrc ||
2015 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2016 os << "\\print_landscape_flag \"" << print_landscape_flag
2021 case RC_PRINTPAGERANGEFLAG:
2022 if (ignore_system_lyxrc ||
2023 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2024 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2029 case RC_PRINTCOPIESFLAG:
2030 if (ignore_system_lyxrc ||
2031 print_copies_flag != system_lyxrc.print_copies_flag) {
2032 os << "\\print_copies_flag \"" << print_copies_flag
2037 case RC_PRINTCOLLCOPIESFLAG:
2038 if (ignore_system_lyxrc ||
2039 print_collcopies_flag
2040 != system_lyxrc.print_collcopies_flag) {
2041 os << "\\print_collcopies_flag \""
2042 << print_collcopies_flag
2047 case RC_PRINTPAPERFLAG:
2048 if (ignore_system_lyxrc ||
2049 print_paper_flag != system_lyxrc.print_paper_flag) {
2050 os << "\\print_paper_flag \"" << print_paper_flag
2055 case RC_PRINTPAPERDIMENSIONFLAG:
2056 if (ignore_system_lyxrc ||
2057 print_paper_dimension_flag
2058 != system_lyxrc.print_paper_dimension_flag) {
2059 os << "\\print_paper_dimension_flag \""
2060 << print_paper_dimension_flag << "\"\n";
2064 case RC_PRINTTOPRINTER:
2065 if (ignore_system_lyxrc ||
2066 print_to_printer != system_lyxrc.print_to_printer) {
2067 os << "\\print_to_printer \"" << print_to_printer
2072 case RC_PRINTTOFILE:
2073 if (ignore_system_lyxrc ||
2074 print_to_file != system_lyxrc.print_to_file) {
2075 string const path = os::external_path(print_to_file);
2076 os << "\\print_to_file \"" << path << "\"\n";
2080 case RC_PRINTFILEEXTENSION:
2081 if (ignore_system_lyxrc ||
2082 print_file_extension != system_lyxrc.print_file_extension) {
2083 os << "\\print_file_extension \""
2084 << print_file_extension
2091 << "# TEX SECTION #######################################\n"
2094 case RC_FONT_ENCODING:
2095 if (ignore_system_lyxrc ||
2096 fontenc != system_lyxrc.fontenc) {
2097 os << "\\font_encoding \"" << fontenc << "\"\n";
2103 << "# FILE SECTION ######################################\n"
2106 case RC_DOCUMENTPATH:
2107 if (ignore_system_lyxrc ||
2108 document_path != system_lyxrc.document_path) {
2109 string const path = os::external_path(document_path);
2110 os << "\\document_path \"" << path << "\"\n";
2114 case RC_USELASTFILEPOS:
2115 if (ignore_system_lyxrc ||
2116 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2117 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2122 case RC_LOADSESSION:
2123 if (ignore_system_lyxrc ||
2124 load_session != system_lyxrc.load_session) {
2125 os << "\\load_session " << convert<string>(load_session)
2130 case RC_MOUSE_WHEEL_SPEED:
2131 if (ignore_system_lyxrc ||
2132 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2133 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2137 case RC_COMPLETION_INLINE_DELAY:
2138 if (ignore_system_lyxrc ||
2139 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2140 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2144 case RC_COMPLETION_INLINE_MATH:
2145 if (ignore_system_lyxrc ||
2146 completion_inline_math != system_lyxrc.completion_inline_math) {
2147 os << "\\completion_inline_math "
2148 << convert<string>(completion_inline_math) << '\n';
2152 case RC_COMPLETION_INLINE_TEXT:
2153 if (ignore_system_lyxrc ||
2154 completion_inline_text != system_lyxrc.completion_inline_text) {
2155 os << "\\completion_inline_text "
2156 << convert<string>(completion_inline_text) << '\n';
2160 case RC_COMPLETION_INLINE_DOTS:
2161 if (ignore_system_lyxrc ||
2162 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2163 os << "\\completion_inline_dots "
2164 << convert<string>(completion_inline_dots) << '\n';
2168 case RC_AUTOCORRECTION_MATH:
2169 if (ignore_system_lyxrc ||
2170 autocorrection_math != system_lyxrc.autocorrection_math) {
2171 os << "\\autocorrection_math "
2172 << convert<string>(autocorrection_math) << '\n';
2176 case RC_COMPLETION_POPUP_DELAY:
2177 if (ignore_system_lyxrc ||
2178 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2179 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2183 case RC_COMPLETION_POPUP_MATH:
2184 if (ignore_system_lyxrc ||
2185 completion_popup_math != system_lyxrc.completion_popup_math) {
2186 os << "\\completion_popup_math "
2187 << convert<string>(completion_popup_math) << '\n';
2191 case RC_COMPLETION_POPUP_TEXT:
2192 if (ignore_system_lyxrc ||
2193 completion_popup_text != system_lyxrc.completion_popup_text) {
2194 os << "\\completion_popup_text "
2195 << convert<string>(completion_popup_text) << '\n';
2199 case RC_COMPLETION_CURSOR_TEXT:
2200 if (ignore_system_lyxrc ||
2201 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2202 os << "\\completion_cursor_text "
2203 << convert<string>(completion_cursor_text) << '\n';
2207 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2208 if (ignore_system_lyxrc ||
2209 completion_popup_after_complete
2210 != system_lyxrc.completion_popup_after_complete) {
2211 os << "\\completion_popup_after_complete "
2212 << convert<string>(completion_popup_after_complete) << '\n';
2216 case RC_NUMLASTFILES:
2217 if (ignore_system_lyxrc ||
2218 num_lastfiles != system_lyxrc.num_lastfiles) {
2219 os << "\\num_lastfiles " << num_lastfiles << '\n';
2223 case RC_CHECKLASTFILES:
2224 if (ignore_system_lyxrc ||
2225 check_lastfiles != system_lyxrc.check_lastfiles) {
2226 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2231 case RC_EXAMPLEPATH:
2232 if (ignore_system_lyxrc ||
2233 example_path != system_lyxrc.example_path) {
2234 string const path = os::external_path(example_path);
2235 os << "\\example_path \"" << path << "\"\n";
2239 case RC_TEMPLATEPATH:
2240 if (ignore_system_lyxrc ||
2241 template_path != system_lyxrc.template_path) {
2242 string const path = os::external_path(template_path);
2243 os << "\\template_path \"" << path << "\"\n";
2247 case RC_TEMPDIRPATH:
2248 if (ignore_system_lyxrc ||
2249 tempdir_path != system_lyxrc.tempdir_path) {
2250 string const path = os::external_path(tempdir_path);
2251 os << "\\tempdir_path \"" << path << "\"\n";
2255 case RC_THESAURUSDIRPATH:
2256 if (ignore_system_lyxrc ||
2257 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2258 string const path = os::external_path(thesaurusdir_path);
2259 os << "\\thesaurusdir_path \"" << path << "\"\n";
2263 case RC_HUNSPELLDIR_PATH:
2264 if (ignore_system_lyxrc ||
2265 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2266 string const path = os::external_path(hunspelldir_path);
2267 os << "\\hunspelldir_path \"" << path << "\"\n";
2275 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2278 case RC_PLAINTEXT_LINELEN:
2279 if (ignore_system_lyxrc ||
2280 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2281 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2285 case RC_MAKE_BACKUP:
2286 if (ignore_system_lyxrc ||
2287 make_backup != system_lyxrc.make_backup) {
2288 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2292 case RC_SAVE_COMPRESSED:
2293 if (ignore_system_lyxrc ||
2294 save_compressed != system_lyxrc.save_compressed) {
2295 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2299 case RC_BACKUPDIR_PATH:
2300 if (ignore_system_lyxrc ||
2301 backupdir_path != system_lyxrc.backupdir_path) {
2302 string const path = os::external_path(backupdir_path);
2303 os << "\\backupdir_path \"" << path << "\"\n";
2309 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2313 << "# SPELLCHECKER SECTION ##############################\n"
2316 case RC_SPELL_COMMAND:
2317 case RC_USE_SPELL_LIB:
2321 case RC_ACCEPT_COMPOUND:
2322 if (ignore_system_lyxrc ||
2323 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2324 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2329 case RC_USE_ALT_LANG:
2334 if (ignore_system_lyxrc ||
2335 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2336 os << "\\alternate_language \"" << spellchecker_alt_lang
2341 case RC_USE_ESC_CHARS:
2345 if (ignore_system_lyxrc ||
2346 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2347 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2351 case RC_USE_PERS_DICT:
2355 case RC_USE_TOOLTIP:
2356 if (ignore_system_lyxrc ||
2357 use_tooltip != system_lyxrc.use_tooltip) {
2358 os << "\\use_tooltip "
2359 << convert<string>(use_tooltip)
2364 case RC_USE_PIXMAP_CACHE:
2365 if (ignore_system_lyxrc ||
2366 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2367 os << "\\use_pixmap_cache "
2368 << convert<string>(use_pixmap_cache)
2377 case RC_USE_INP_ENC:
2383 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2388 case RC_DEFAULT_DECIMAL_POINT:
2389 if (ignore_system_lyxrc ||
2390 default_decimal_point != system_lyxrc.default_decimal_point) {
2391 os << "\\default_decimal_point " << default_decimal_point << '\n';
2396 case RC_SPELLCHECKER:
2397 if (ignore_system_lyxrc ||
2398 spellchecker != system_lyxrc.spellchecker) {
2399 os << "\\spellchecker " << spellchecker << '\n';
2404 case RC_SPELLCHECK_CONTINUOUSLY:
2405 if (ignore_system_lyxrc ||
2406 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2407 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2413 case RC_SPELLCHECK_NOTES:
2414 if (ignore_system_lyxrc ||
2415 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2416 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2422 case RC_RTL_SUPPORT:
2423 if (ignore_system_lyxrc ||
2424 rtl_support != system_lyxrc.rtl_support) {
2425 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2429 case RC_VISUAL_CURSOR:
2430 if (ignore_system_lyxrc ||
2431 visual_cursor != system_lyxrc.visual_cursor) {
2432 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2436 case RC_LANGUAGE_PACKAGE:
2437 if (ignore_system_lyxrc ||
2438 language_package != system_lyxrc.language_package) {
2439 os << "\\language_package \"" << language_package
2444 case RC_LANGUAGE_GLOBAL_OPTIONS:
2445 if (ignore_system_lyxrc ||
2446 language_global_options
2447 != system_lyxrc.language_global_options) {
2448 os << "\\language_global_options \""
2449 << convert<string>(language_global_options)
2454 case RC_LANGUAGE_USE_BABEL:
2455 if (ignore_system_lyxrc ||
2456 language_use_babel != system_lyxrc.language_use_babel) {
2457 os << "\\language_use_babel \""
2458 << convert<string>(language_use_babel)
2463 case RC_LANGUAGE_COMMAND_BEGIN:
2464 if (ignore_system_lyxrc ||
2465 language_command_begin
2466 != system_lyxrc.language_command_begin) {
2467 os << "\\language_command_begin \""
2468 << language_command_begin
2473 case RC_LANGUAGE_COMMAND_END:
2474 if (ignore_system_lyxrc ||
2475 language_command_end
2476 != system_lyxrc.language_command_end) {
2477 os << "\\language_command_end \"" << language_command_end
2482 case RC_LANGUAGE_COMMAND_LOCAL:
2483 if (ignore_system_lyxrc ||
2484 language_command_local
2485 != system_lyxrc.language_command_local) {
2486 os << "\\language_command_local \""
2487 << language_command_local
2492 case RC_LANGUAGE_AUTO_BEGIN:
2493 if (ignore_system_lyxrc ||
2494 language_auto_begin != system_lyxrc.language_auto_begin) {
2495 os << "\\language_auto_begin "
2496 << convert<string>(language_auto_begin) << '\n';
2500 case RC_LANGUAGE_AUTO_END:
2501 if (ignore_system_lyxrc ||
2502 language_auto_end != system_lyxrc.language_auto_end) {
2503 os << "\\language_auto_end "
2504 << convert<string>(language_auto_end) << '\n';
2508 case RC_MARK_FOREIGN_LANGUAGE:
2509 if (ignore_system_lyxrc ||
2510 mark_foreign_language
2511 != system_lyxrc.mark_foreign_language) {
2512 os << "\\mark_foreign_language " <<
2513 convert<string>(mark_foreign_language) << '\n';
2519 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2522 case RC_AUTO_NUMBER:
2523 if (ignore_system_lyxrc ||
2524 auto_number != system_lyxrc.auto_number) {
2525 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2529 case RC_DEFAULT_LANGUAGE:
2530 if (ignore_system_lyxrc ||
2531 default_language != system_lyxrc.default_language) {
2532 os << "\\default_language " << default_language << '\n';
2536 case RC_GUI_LANGUAGE:
2537 if (ignore_system_lyxrc ||
2538 gui_language != system_lyxrc.gui_language) {
2539 os << "\\gui_language " << gui_language << '\n';
2543 case RC_EXPORT_OVERWRITE:
2544 if (ignore_system_lyxrc ||
2545 export_overwrite != system_lyxrc.export_overwrite) {
2547 switch (export_overwrite) {
2558 os << "\\export_overwrite " << status << '\n';
2564 << "# FORMATS SECTION ##########################\n"
2568 // New/modified formats
2569 for (Formats::const_iterator cit = formats.begin();
2570 cit != formats.end(); ++cit) {
2571 Format const * format =
2572 system_formats.getFormat(cit->name());
2574 format->extension() != cit->extension() ||
2575 format->prettyname() != cit->prettyname() ||
2576 format->shortcut() != cit->shortcut() ||
2577 format->viewer() != cit->viewer() ||
2578 format->editor() != cit->editor() ||
2579 format->documentFormat() != cit->documentFormat() ||
2580 format->vectorFormat() != cit->vectorFormat()) {
2581 os << "\\format \"" << cit->name() << "\" \""
2582 << cit->extension() << "\" \""
2583 << cit->prettyname() << "\" \""
2584 << cit->shortcut() << "\" \""
2585 << escapeCommand(cit->viewer()) << "\" \""
2586 << escapeCommand(cit->editor()) << "\" \"";
2587 vector<string> flags;
2588 if (cit->documentFormat())
2589 flags.push_back("document");
2590 if (cit->vectorFormat())
2591 flags.push_back("vector");
2592 os << getStringFromVector(flags);
2597 // Look for deleted formats
2598 for (Formats::const_iterator cit = system_formats.begin();
2599 cit != system_formats.end(); ++cit)
2600 if (!formats.getFormat(cit->name()))
2601 os << "\\format \"" << cit->name()
2602 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2605 case RC_VIEWER_ALTERNATIVES: {
2606 Alternatives::const_iterator it = viewer_alternatives.begin();
2607 Alternatives::const_iterator const en = viewer_alternatives.end();
2608 Alternatives::const_iterator const sysend =
2609 system_lyxrc.viewer_alternatives.end();
2610 for (; it != en; ++it) {
2611 string const & fmt = it->first;
2612 CommandSet const & cmd = it->second;
2613 CommandSet::const_iterator sit = cmd.begin();
2614 CommandSet::const_iterator const sen = cmd.end();
2615 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2616 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2617 system_lyxrc.viewer_alternatives.find(fmt);
2618 for (; sit != sen; ++sit) {
2619 string const & cmd = *sit;
2620 if (ignore_system_lyxrc
2621 || sysfmt == sysend // format not found
2622 || sysfmt->second.count(cmd) == 0 // this command not found
2624 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2630 case RC_EDITOR_ALTERNATIVES: {
2631 Alternatives::const_iterator it = editor_alternatives.begin();
2632 Alternatives::const_iterator const en = editor_alternatives.end();
2633 Alternatives::const_iterator const sysend =
2634 system_lyxrc.editor_alternatives.end();
2635 for (; it != en; ++it) {
2636 string const & fmt = it->first;
2637 CommandSet const & cmd = it->second;
2638 CommandSet::const_iterator sit = cmd.begin();
2639 CommandSet::const_iterator const sen = cmd.end();
2640 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2641 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2642 system_lyxrc.editor_alternatives.find(fmt);
2643 for (; sit != sen; ++sit) {
2644 string const & cmd = *sit;
2645 if (ignore_system_lyxrc
2646 || sysfmt == sysend // format not found
2647 || sysfmt->second.count(cmd) == 0 // this command not found
2649 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2655 case RC_DEFAULT_VIEW_FORMAT:
2656 if (ignore_system_lyxrc ||
2657 default_view_format != system_lyxrc.default_view_format) {
2658 os << "\\default_view_format " << default_view_format << '\n';
2668 << "# CONVERTERS SECTION ##########################\n"
2672 // Look for new converters
2673 for (Converters::const_iterator cit = theConverters().begin();
2674 cit != theConverters().end(); ++cit) {
2675 Converter const * converter =
2676 theSystemConverters().getConverter(cit->from,
2679 converter->command != cit->command ||
2680 converter->flags != cit->flags)
2681 os << "\\converter \"" << cit->from << "\" \""
2682 << cit->to << "\" \""
2683 << escapeCommand(cit->command) << "\" \""
2684 << cit->flags << "\"\n";
2687 // New/modifed converters
2688 for (Converters::const_iterator cit = theSystemConverters().begin();
2689 cit != theSystemConverters().end(); ++cit)
2690 if (!theConverters().getConverter(cit->from, cit->to))
2691 os << "\\converter \"" << cit->from
2692 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2699 << "# COPIERS SECTION ##########################\n"
2702 // Look for new movers
2703 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2704 Movers::const_iterator const sysend = theSystemMovers().end();
2705 Movers::const_iterator it = theMovers().begin();
2706 Movers::const_iterator end = theMovers().end();
2708 for (; it != end; ++it) {
2709 Movers::const_iterator const sysit =
2710 find_if(sysbegin, sysend, SameMover(*it));
2711 if (sysit == sysend) {
2712 string const & fmt = it->first;
2713 string const & command =
2714 it->second.command();
2716 os << "\\copier " << fmt
2717 << " \"" << escapeCommand(command) << "\"\n";
2723 // We don't actually delete SpecialisedMover(s) from the
2724 // map, just clear their 'command', so there's no need
2725 // to test for anything else.
2732 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2734 // Why the switch you might ask. It is a trick to ensure that all
2735 // the elements in the LyXRCTags enum is handled. As you can see
2736 // there are no breaks at all. So it is just a huge fall-through.
2737 // The nice thing is that we will get a warning from the compiler
2738 // if we forget an element.
2739 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2741 case LyXRC::RC_ACCEPT_COMPOUND:
2742 case LyXRC::RC_ALT_LANG:
2743 case LyXRC::RC_PLAINTEXT_LINELEN:
2744 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2745 case LyXRC::RC_AUTOCORRECTION_MATH:
2746 case LyXRC::RC_AUTOREGIONDELETE:
2747 case LyXRC::RC_AUTORESET_OPTIONS:
2748 case LyXRC::RC_AUTOSAVE:
2749 case LyXRC::RC_AUTO_NUMBER:
2750 case LyXRC::RC_BACKUPDIR_PATH:
2751 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2752 case LyXRC::RC_BIBTEX_COMMAND:
2753 case LyXRC::RC_BINDFILE:
2754 case LyXRC::RC_CHECKLASTFILES:
2755 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2756 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2757 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2758 case LyXRC::RC_COMPLETION_INLINE_MATH:
2759 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2760 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2761 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2762 case LyXRC::RC_COMPLETION_POPUP_MATH:
2763 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2764 case LyXRC::RC_USELASTFILEPOS:
2765 case LyXRC::RC_LOADSESSION:
2766 case LyXRC::RC_CHKTEX_COMMAND:
2767 case LyXRC::RC_CONVERTER:
2768 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2769 case LyXRC::RC_COPIER:
2770 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2771 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2772 case LyXRC::RC_DATE_INSERT_FORMAT:
2773 case LyXRC::RC_DEFAULT_LANGUAGE:
2774 case LyXRC::RC_GUI_LANGUAGE:
2775 case LyXRC::RC_DEFAULT_PAPERSIZE:
2776 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2777 case LyXRC::RC_DEFFILE:
2778 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2779 case LyXRC::RC_DISPLAY_GRAPHICS:
2780 case LyXRC::RC_DOCUMENTPATH:
2781 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2782 FileName path(lyxrc_new.document_path);
2783 if (path.exists() && path.isDirectory())
2784 package().document_dir() = FileName(lyxrc.document_path);
2786 case LyXRC::RC_EDITOR_ALTERNATIVES:
2787 case LyXRC::RC_ESC_CHARS:
2788 case LyXRC::RC_EXAMPLEPATH:
2789 case LyXRC::RC_FONT_ENCODING:
2790 case LyXRC::RC_FORMAT:
2791 case LyXRC::RC_GROUP_LAYOUTS:
2792 case LyXRC::RC_HUNSPELLDIR_PATH:
2793 case LyXRC::RC_INDEX_ALTERNATIVES:
2794 case LyXRC::RC_INDEX_COMMAND:
2795 case LyXRC::RC_JBIBTEX_COMMAND:
2796 case LyXRC::RC_JINDEX_COMMAND:
2797 case LyXRC::RC_NOMENCL_COMMAND:
2798 case LyXRC::RC_INPUT:
2799 case LyXRC::RC_KBMAP:
2800 case LyXRC::RC_KBMAP_PRIMARY:
2801 case LyXRC::RC_KBMAP_SECONDARY:
2802 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2803 case LyXRC::RC_LANGUAGE_AUTO_END:
2804 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2805 case LyXRC::RC_LANGUAGE_COMMAND_END:
2806 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2807 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2808 case LyXRC::RC_LANGUAGE_PACKAGE:
2809 case LyXRC::RC_LANGUAGE_USE_BABEL:
2810 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2811 case LyXRC::RC_MACRO_EDIT_STYLE:
2812 case LyXRC::RC_MAKE_BACKUP:
2813 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2814 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2815 case LyXRC::RC_NUMLASTFILES:
2816 case LyXRC::RC_PARAGRAPH_MARKERS:
2817 case LyXRC::RC_PATH_PREFIX:
2818 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2819 prependEnvPath("PATH", lyxrc.path_prefix);
2821 case LyXRC::RC_PERS_DICT:
2822 case LyXRC::RC_PREVIEW:
2823 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2824 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2825 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2826 case LyXRC::RC_PRINTCOPIESFLAG:
2827 case LyXRC::RC_PRINTER:
2828 case LyXRC::RC_PRINTEVENPAGEFLAG:
2829 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2830 case LyXRC::RC_PRINTFILEEXTENSION:
2831 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2832 case LyXRC::RC_PRINTODDPAGEFLAG:
2833 case LyXRC::RC_PRINTPAGERANGEFLAG:
2834 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2835 case LyXRC::RC_PRINTPAPERFLAG:
2836 case LyXRC::RC_PRINTREVERSEFLAG:
2837 case LyXRC::RC_PRINTSPOOL_COMMAND:
2838 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2839 case LyXRC::RC_PRINTTOFILE:
2840 case LyXRC::RC_PRINTTOPRINTER:
2841 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2842 case LyXRC::RC_PRINT_COMMAND:
2843 case LyXRC::RC_RTL_SUPPORT:
2844 case LyXRC::RC_SAVE_COMPRESSED:
2845 case LyXRC::RC_SCREEN_DPI:
2846 case LyXRC::RC_SCREEN_FONT_ROMAN:
2847 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2848 case LyXRC::RC_SCREEN_FONT_SANS:
2849 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2850 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2851 case LyXRC::RC_SCREEN_FONT_SIZES:
2852 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2853 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2854 case LyXRC::RC_GEOMETRY_SESSION:
2855 case LyXRC::RC_SCREEN_ZOOM:
2856 case LyXRC::RC_SERVERPIPE:
2857 case LyXRC::RC_SET_COLOR:
2858 case LyXRC::RC_SHOW_BANNER:
2859 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2860 case LyXRC::RC_SPELL_COMMAND:
2861 case LyXRC::RC_SPELLCHECKER:
2862 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2863 case LyXRC::RC_SPELLCHECK_NOTES:
2864 case LyXRC::RC_SPLITINDEX_COMMAND:
2865 case LyXRC::RC_TEMPDIRPATH:
2866 case LyXRC::RC_TEMPLATEPATH:
2867 case LyXRC::RC_TEX_ALLOWS_SPACES:
2868 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2869 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2870 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2872 case LyXRC::RC_THESAURUSDIRPATH:
2873 case LyXRC::RC_UIFILE:
2874 case LyXRC::RC_USER_EMAIL:
2875 case LyXRC::RC_USER_NAME:
2876 case LyXRC::RC_USETEMPDIR:
2877 case LyXRC::RC_USE_ALT_LANG:
2878 case LyXRC::RC_USE_CONVERTER_CACHE:
2879 case LyXRC::RC_USE_ESC_CHARS:
2880 case LyXRC::RC_USE_INP_ENC:
2881 case LyXRC::RC_USE_PERS_DICT:
2882 case LyXRC::RC_USE_TOOLTIP:
2883 case LyXRC::RC_USE_PIXMAP_CACHE:
2884 case LyXRC::RC_USE_SPELL_LIB:
2885 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2886 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2887 case LyXRC::RC_SORT_LAYOUTS:
2888 case LyXRC::RC_FULL_SCREEN_LIMIT:
2889 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2890 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2891 case LyXRC::RC_FULL_SCREEN_TABBAR:
2892 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2893 case LyXRC::RC_FULL_SCREEN_WIDTH:
2894 case LyXRC::RC_VISUAL_CURSOR:
2895 case LyXRC::RC_VIEWER:
2896 case LyXRC::RC_VIEWER_ALTERNATIVES:
2897 case LyXRC::RC_FORWARD_SEARCH_DVI:
2898 case LyXRC::RC_FORWARD_SEARCH_PDF:
2899 case LyXRC::RC_EXPORT_OVERWRITE:
2900 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2901 case LyXRC::RC_LAST:
2908 string const LyXRC::getDescription(LyXRCTags tag)
2913 case RC_ACCEPT_COMPOUND:
2914 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2918 case RC_USE_ALT_LANG:
2919 str = _("Specify an alternate language. The default is to use the language of the document.");
2922 case RC_PLAINTEXT_ROFF_COMMAND:
2923 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.");
2926 case RC_PLAINTEXT_LINELEN:
2927 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.");
2930 case RC_AUTOREGIONDELETE:
2931 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2934 case RC_AUTORESET_OPTIONS:
2935 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2939 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2942 case RC_AUTO_NUMBER:
2945 case RC_BACKUPDIR_PATH:
2946 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.");
2949 case RC_BIBTEX_COMMAND:
2950 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2953 case RC_JBIBTEX_COMMAND:
2954 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2958 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2961 case RC_CHECKLASTFILES:
2962 str = _("Select to check whether the lastfiles still exist.");
2965 case RC_CHKTEX_COMMAND:
2966 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2975 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2976 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.");
2979 case RC_SCROLL_BELOW_DOCUMENT:
2980 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");
2983 case RC_MAC_LIKE_WORD_MOVEMENT:
2984 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2987 case RC_SHOW_MACRO_LABEL:
2988 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2991 case RC_DATE_INSERT_FORMAT:
2992 //xgettext:no-c-format
2993 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2997 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3000 case RC_DEFAULT_VIEW_FORMAT:
3001 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3004 case RC_DEFAULT_LANGUAGE:
3005 str = _("New documents will be assigned this language.");
3008 case RC_DEFAULT_PAPERSIZE:
3009 str = _("Specify the default paper size.");
3012 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3013 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3016 case RC_DISPLAY_GRAPHICS:
3017 str = _("Select how LyX will display any graphics.");
3020 case RC_DOCUMENTPATH:
3021 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3025 case RC_USE_ESC_CHARS:
3026 str = _("Specify additional chars that can be part of a word.");
3029 case RC_EXAMPLEPATH:
3030 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3033 case RC_FONT_ENCODING:
3034 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3040 case RC_INDEX_COMMAND:
3041 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\".");
3044 case RC_JINDEX_COMMAND:
3045 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3048 case RC_NOMENCL_COMMAND:
3049 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3056 case RC_KBMAP_PRIMARY:
3057 case RC_KBMAP_SECONDARY:
3058 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.");
3061 case RC_LANGUAGE_AUTO_BEGIN:
3062 str = _("Select if a language switching command is needed at the beginning of the document.");
3065 case RC_LANGUAGE_AUTO_END:
3066 str = _("Select if a language switching command is needed at the end of the document.");
3069 case RC_LANGUAGE_COMMAND_BEGIN:
3070 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.");
3073 case RC_LANGUAGE_COMMAND_END:
3074 str = _("The LaTeX command for changing back to the language of the document.");
3077 case RC_LANGUAGE_COMMAND_LOCAL:
3078 str = _("The LaTeX command for local changing of the language.");
3081 case RC_LANGUAGE_GLOBAL_OPTIONS:
3082 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3085 case RC_LANGUAGE_PACKAGE:
3086 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3089 case RC_LANGUAGE_USE_BABEL:
3090 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3093 case RC_USELASTFILEPOS:
3094 str = _("De-select if you do not want LyX to scroll to saved position.");
3097 case RC_LOADSESSION:
3098 str = _("De-select to prevent loading files opened from the last LyX session.");
3101 case RC_MAKE_BACKUP:
3102 str = _("De-select if you don't want LyX to create backup files.");
3105 case RC_MARK_FOREIGN_LANGUAGE:
3106 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3109 case RC_MOUSE_WHEEL_SPEED:
3110 str = bformat(_("The scrolling speed of the mouse wheel."),
3114 case RC_COMPLETION_POPUP_DELAY:
3115 str = _("The completion popup delay.");
3118 case RC_COMPLETION_POPUP_MATH:
3119 str = _("Select to display the completion popup in math mode.");
3122 case RC_COMPLETION_POPUP_TEXT:
3123 str = _("Select to display the completion popup in text mode.");
3126 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3127 str = _("Show the completion popup without delay after non-unique completion attempt.");
3130 case RC_COMPLETION_POPUP_TEXT:
3131 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3134 case RC_COMPLETION_POPUP_DELAY:
3135 str = _("The inline completion delay.");
3138 case RC_COMPLETION_INLINE_MATH:
3139 str = _("Select to display the inline completion in math mode.");
3142 case RC_COMPLETION_INLINE_TEXT:
3143 str = _("Select to display the inline completion in text mode.");
3146 case RC_COMPLETION_INLINE_DOTS:
3147 str = _("Use \"...\" to shorten long completions.");
3150 case RC_AUTOCORRECTION_MATH:
3151 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3154 case RC_NUMLASTFILES:
3155 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3159 case RC_PATH_PREFIX:
3160 str = _("Specify those directories which should be "
3161 "prepended to the PATH environment variable. "
3162 "Use the OS native format.");
3166 str = _("Shows a typeset preview of things such as math");
3169 case RC_PREVIEW_HASHED_LABELS:
3170 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3173 case RC_PREVIEW_SCALE_FACTOR:
3174 str = _("Scale the preview size to suit.");
3177 case RC_PRINTCOLLCOPIESFLAG:
3178 str = _("The option for specifying whether the copies should be collated.");
3181 case RC_PRINTCOPIESFLAG:
3182 str = _("The option for specifying the number of copies to print.");
3186 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3189 case RC_PRINTEVENPAGEFLAG:
3190 str = _("The option to print only even pages.");
3193 case RC_PRINTEXSTRAOPTIONS:
3194 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3197 case RC_PRINTFILEEXTENSION:
3198 str = _("Extension of printer program output file. Usually \".ps\".");
3201 case RC_PRINTLANDSCAPEFLAG:
3202 str = _("The option to print out in landscape.");
3205 case RC_PRINTODDPAGEFLAG:
3206 str = _("The option to print only odd pages.");
3209 case RC_PRINTPAGERANGEFLAG:
3210 str = _("The option for specifying a comma-separated list of pages to print.");
3213 case RC_PRINTPAPERDIMENSIONFLAG:
3214 str = _("Option to specify the dimensions of the print paper.");
3217 case RC_PRINTPAPERFLAG:
3218 str = _("The option to specify paper type.");
3221 case RC_PRINTREVERSEFLAG:
3222 str = _("The option to reverse the order of the pages printed.");
3225 case RC_PRINTSPOOL_COMMAND:
3226 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.");
3229 case RC_PRINTSPOOL_PRINTERPREFIX:
3230 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.");
3233 case RC_PRINTTOFILE:
3234 str = _("Option to pass to the print program to print to a file.");
3237 case RC_PRINTTOPRINTER:
3238 str = _("Option to pass to the print program to print on a specific printer.");
3241 case RC_PRINT_ADAPTOUTPUT:
3242 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3245 case RC_PRINT_COMMAND:
3246 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3249 case RC_RTL_SUPPORT:
3250 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3253 case RC_VISUAL_CURSOR:
3254 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3258 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3261 case RC_SCREEN_FONT_ROMAN:
3262 case RC_SCREEN_FONT_SANS:
3263 case RC_SCREEN_FONT_TYPEWRITER:
3264 str = _("The screen fonts used to display the text while editing.");
3267 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3268 case RC_SCREEN_FONT_SANS_FOUNDRY:
3269 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3272 case RC_SCREEN_FONT_SCALABLE:
3273 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.");
3276 case RC_SCREEN_FONT_SIZES:
3277 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3280 case RC_SCREEN_ZOOM:
3281 //xgettext:no-c-format
3282 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3285 case RC_GEOMETRY_SESSION:
3286 str = _("Allow session manager to save and restore windows geometry.");
3290 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3296 case RC_SHOW_BANNER:
3297 str = _("De-select if you don't want the startup banner.");
3300 case RC_TEMPDIRPATH:
3301 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3304 case RC_THESAURUSDIRPATH:
3305 str = _("This is the place where the files of the thesaurus library reside.");
3308 case RC_TEMPLATEPATH:
3309 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3312 case RC_TEX_ALLOWS_SPACES:
3315 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3319 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3331 case RC_USE_TOOLTIP:
3332 str = _("Enable the automatic appearance of tool tips in the work area.");
3335 case RC_USE_PIXMAP_CACHE:
3336 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3339 case RC_USE_SPELL_LIB:
3342 case RC_VIEWDVI_PAPEROPTION:
3343 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3358 // The global instance
3361 // The global copy of the system lyxrc entries (everything except preferences)