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_language", LyXRC::RC_DEFAULT_LANGUAGE },
88 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
89 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
90 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
91 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
92 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
93 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
94 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
95 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
96 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
97 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
98 { "\\format", LyXRC::RC_FORMAT },
99 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
100 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
101 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
102 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
103 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
104 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
105 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
106 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
107 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
108 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
109 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
110 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
111 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
112 { "\\input", LyXRC::RC_INPUT },
113 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
114 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
115 { "\\kbmap", LyXRC::RC_KBMAP },
116 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
117 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
118 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
119 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
120 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
121 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
122 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
123 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
124 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
125 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
126 { "\\load_session", LyXRC::RC_LOADSESSION },
127 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
128 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
129 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
130 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
131 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
132 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
133 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
134 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
135 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
136 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
137 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
138 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
139 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
140 { "\\preview", LyXRC::RC_PREVIEW },
141 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
142 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
143 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
144 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
145 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
146 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
147 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
148 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
149 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
150 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
151 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
152 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
153 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
154 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
155 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
156 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
157 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
158 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
159 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
160 { "\\printer", LyXRC::RC_PRINTER },
161 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
162 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
163 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
164 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
165 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
166 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
167 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
168 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
169 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
170 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
171 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
172 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
173 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
174 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
175 { "\\set_color", LyXRC::RC_SET_COLOR },
176 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
177 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
178 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
179 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
180 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
181 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
182 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
183 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
184 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
185 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
186 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
187 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
188 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
189 { "\\ui_file", LyXRC::RC_UIFILE },
190 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
191 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
192 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
193 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
194 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
195 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
196 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
197 // compatibility with versions older than 1.4.0 only
198 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
199 // compatibility with versions older than 1.4.0 only
200 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
201 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
202 { "\\user_email", LyXRC::RC_USER_EMAIL },
203 { "\\user_name", LyXRC::RC_USER_NAME },
204 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
205 // compatibility with versions older than 1.4.0 only
206 { "\\viewer", LyXRC::RC_VIEWER},
207 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
208 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
211 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
222 void LyXRC::setDefaults()
225 def_file = "default";
227 // Get printer from the environment. If fail, use default "",
228 // assuming that everything is set up correctly.
229 printer = getEnv("PRINTER");
230 print_adapt_output = false;
231 print_command = "dvips";
232 print_evenpage_flag = "-B";
233 print_oddpage_flag = "-A";
234 print_pagerange_flag = "-pp";
235 print_copies_flag = "-c";
236 print_collcopies_flag = "-C";
237 print_reverse_flag = "-r";
238 print_landscape_flag = "-t landscape";
239 print_to_printer = "-P";
240 print_to_file = "-o ";
241 print_file_extension = ".ps";
242 print_paper_flag = "-t";
243 print_paper_dimension_flag = "-T";
244 document_path.erase();
245 view_dvi_paper_option.erase();
246 default_papersize = PAPER_DEFAULT;
247 default_view_format = "pdf2";
248 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
249 bibtex_command = "bibtex";
251 index_command = "makeindex -c -q";
252 nomencl_command = "makeindex -s nomencl.ist";
254 // Because a screen is typically wider than a piece of paper:
256 allow_geometry_session = true;
257 // Default LaTeX font size:
258 font_sizes[FONT_SIZE_TINY] = "5.0";
259 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
260 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
261 font_sizes[FONT_SIZE_SMALL] = "9.0";
262 font_sizes[FONT_SIZE_NORMAL] = "10.0";
263 font_sizes[FONT_SIZE_LARGE] = "12.0";
264 font_sizes[FONT_SIZE_LARGER] = "14.4";
265 font_sizes[FONT_SIZE_LARGEST] = "17.26";
266 font_sizes[FONT_SIZE_HUGE] = "20.74";
267 font_sizes[FONT_SIZE_HUGER] = "24.88";
268 use_scalable_fonts = true;
269 roman_font_name = "";
271 typewriter_font_name = "";
273 auto_region_delete = true;
274 auto_reset_options = false;
275 plaintext_linelen = 65;
276 mouse_wheel_speed = 1.0;
277 num_lastfiles = maxlastfiles;
278 check_lastfiles = true;
279 use_lastfilepos = true;
280 load_session = false;
282 save_compressed = false;
283 backupdir_path.erase();
284 display_graphics = true;
285 // Spellchecker settings:
286 #if defined(USE_ASPELL)
287 spellchecker = "aspell";
288 #elif defined(USE_HUNSPELL)
289 spellchecker = "hunspell";
291 spellchecker = "aspell";
293 spellchecker_accept_compound = false;
294 spellcheck_continuously = false;
295 spellcheck_notes = true;
298 visual_cursor = false;
300 mark_foreign_language = true;
301 language_auto_begin = true;
302 language_auto_end = true;
303 language_global_options = true;
304 language_use_babel = true;
305 language_package = "\\usepackage{babel}";
306 language_command_begin = "\\selectlanguage{$$lang}";
307 language_command_local = "\\foreignlanguage{$$lang}{";
308 sort_layouts = false;
309 group_layouts = true;
310 default_language = "english";
311 gui_language = "auto";
313 windows_style_tex_paths = false;
314 tex_allows_spaces = false;
315 date_insert_format = "%x";
316 cursor_follows_scrollbar = false;
317 scroll_below_document = false;
318 paragraph_markers = false;
319 mac_like_word_movement = false;
320 macro_edit_style = MACRO_EDIT_INLINE_BOX;
321 dialogs_iconify_with_main = false;
322 preview = PREVIEW_OFF;
323 preview_hashed_labels = false;
324 preview_scale_factor = 1.0;
325 use_converter_cache = true;
327 use_pixmap_cache = false;
328 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
329 user_name = to_utf8(support::user_name());
330 user_email = to_utf8(support::user_email());
331 open_buffers_in_tabs = true;
332 single_close_tab_button = false;
333 forward_search_dvi = string();
334 forward_search_pdf = string();
335 export_overwrite = NO_FILES;
337 // Fullscreen settings
338 full_screen_limit = false;
339 full_screen_toolbars = true;
340 full_screen_tabbar = true;
341 full_screen_menubar = true;
342 full_screen_scrollbar = true;
343 full_screen_width = 700;
345 completion_cursor_text = true;
346 completion_popup_math = true;
347 completion_popup_text = false;
348 completion_popup_delay = 2.0;
349 completion_popup_after_complete = true;
350 autocorrection_math = false;
351 completion_inline_math = true;
352 completion_inline_text = false;
353 completion_inline_dots = -1;
354 completion_inline_delay = 0.2;
360 void oldFontFormat(string & family, string & foundry)
362 if (family.empty() || family[0] != '-')
364 foundry = token(family, '-', 1);
365 family = token(family, '-', 2);
373 int LyXRC::read(FileName const & filename)
375 Lexer lexrc(lyxrcTags);
376 if (lyxerr.debugging(Debug::PARSER))
377 lexrc.printTable(lyxerr);
379 lexrc.setFile(filename);
383 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
389 int LyXRC::read(istream & is)
391 Lexer lexrc(lyxrcTags);
392 if (lyxerr.debugging(Debug::PARSER))
393 lexrc.printTable(lyxerr);
399 LYXERR(Debug::LYXRC, "Reading istream...");
405 int LyXRC::read(Lexer & lexrc)
410 while (lexrc.isOK()) {
411 // By using two switches we take advantage of the compiler
412 // telling us if we have missed a LyXRCTags element in
413 // the second switch.
414 // Note that this also shows a problem with Lexer since it
415 // helps us avoid taking advantage of the strictness of the
418 int le = lexrc.lex();
420 case Lexer::LEX_UNDEF:
421 lexrc.printError("Unknown tag `$$Token'");
423 case Lexer::LEX_FEOF:
428 switch (static_cast<LyXRCTags>(le)) {
429 case RC_INPUT: // Include file
432 libFileSearch(string(),
435 lexrc.printError("Error reading "
436 "included file: " + tmp.absFileName());
442 bind_file = os::internal_path(lexrc.getString());
447 def_file = os::internal_path(lexrc.getString());
452 ui_file = os::internal_path(lexrc.getString());
455 case RC_AUTORESET_OPTIONS:
456 lexrc >> auto_reset_options;
459 case RC_DISPLAY_GRAPHICS:
461 display_graphics = lexrc.getString() == "true";
464 case RC_TEX_EXPECTS_WINDOWS_PATHS:
465 lexrc >> windows_style_tex_paths;
468 case RC_TEX_ALLOWS_SPACES:
469 lexrc >> tex_allows_spaces;
476 case RC_KBMAP_PRIMARY:
478 string const kmap(os::internal_path(lexrc.getString()));
479 if (!libFileSearch("kbd", kmap, "kmap").empty()
481 primary_kbmap = kmap;
483 lexrc.printError("LyX: Keymap `$$Token' not found");
488 case RC_KBMAP_SECONDARY:
490 string const kmap(os::internal_path(lexrc.getString()));
491 if (!libFileSearch("kbd", kmap, "kmap").empty()
493 secondary_kbmap = kmap;
495 lexrc.printError("LyX: Keymap `$$Token' not found");
500 case RC_FONT_ENCODING:
508 case RC_PRINT_COMMAND:
509 if (lexrc.next(true)) {
510 print_command = lexrc.getString();
514 case RC_PRINTEVENPAGEFLAG:
515 lexrc >> print_evenpage_flag;
518 case RC_PRINTODDPAGEFLAG:
519 lexrc >> print_oddpage_flag;
522 case RC_PRINTPAGERANGEFLAG:
523 lexrc >> print_pagerange_flag;
526 case RC_PRINTCOPIESFLAG:
527 lexrc >> print_copies_flag;
530 case RC_PRINTCOLLCOPIESFLAG:
531 lexrc >> print_collcopies_flag;
534 case RC_PRINTREVERSEFLAG:
535 lexrc >> print_reverse_flag;
538 case RC_PRINTLANDSCAPEFLAG:
539 lexrc >> print_landscape_flag;
542 case RC_PRINTTOPRINTER:
543 lexrc >> print_to_printer;
546 case RC_PRINT_ADAPTOUTPUT:
547 lexrc >> print_adapt_output;
552 print_to_file = os::internal_path(lexrc.getString());
556 case RC_PRINTFILEEXTENSION:
557 lexrc >> print_file_extension;
560 case RC_PRINTEXSTRAOPTIONS:
561 lexrc >> print_extra_options;
564 case RC_PRINTSPOOL_COMMAND:
565 if (lexrc.next(true)) {
566 print_spool_command = lexrc.getString();
570 case RC_PRINTSPOOL_PRINTERPREFIX:
571 lexrc >> print_spool_printerprefix;
574 case RC_PRINTPAPERDIMENSIONFLAG:
575 lexrc >> print_paper_dimension_flag;
578 case RC_PRINTPAPERFLAG:
579 lexrc >> print_paper_flag;
582 case RC_DEFAULT_PAPERSIZE:
584 string const size = ascii_lowercase(lexrc.getString());
585 if (size == "usletter")
586 default_papersize = PAPER_USLETTER;
587 else if (size == "legal")
588 default_papersize = PAPER_USLEGAL;
589 else if (size == "executive")
590 default_papersize = PAPER_USEXECUTIVE;
591 else if (size == "a3")
592 default_papersize = PAPER_A3;
593 else if (size == "a4")
594 default_papersize = PAPER_A4;
595 else if (size == "a5")
596 default_papersize = PAPER_A5;
597 else if (size == "b5")
598 default_papersize = PAPER_B5;
599 else if (size == "default")
600 default_papersize = PAPER_DEFAULT;
604 case RC_VIEWDVI_PAPEROPTION:
606 view_dvi_paper_option = lexrc.getString();
608 view_dvi_paper_option.erase();
611 case RC_CHKTEX_COMMAND:
612 if (lexrc.next(true)) {
613 chktex_command = lexrc.getString();
617 case RC_BIBTEX_ALTERNATIVES:
618 if (lexrc.next(true)) {
619 bibtex_alternatives.insert(lexrc.getString());
623 case RC_BIBTEX_COMMAND:
624 if (lexrc.next(true)) {
625 bibtex_command = lexrc.getString();
629 case RC_JBIBTEX_COMMAND:
630 if (lexrc.next(true)) {
631 jbibtex_command = lexrc.getString();
635 case RC_INDEX_ALTERNATIVES:
636 if (lexrc.next(true)) {
637 index_alternatives.insert(lexrc.getString());
641 case RC_INDEX_COMMAND:
642 if (lexrc.next(true)) {
643 index_command = lexrc.getString();
647 case RC_JINDEX_COMMAND:
648 if (lexrc.next(true)) {
649 jindex_command = lexrc.getString();
653 case RC_SPLITINDEX_COMMAND:
654 if (lexrc.next(true)) {
655 splitindex_command = lexrc.getString();
659 case RC_NOMENCL_COMMAND:
660 if (lexrc.next(true)) {
661 nomencl_command = lexrc.getString();
673 case RC_GEOMETRY_SESSION:
674 lexrc >> allow_geometry_session;
677 case RC_SCREEN_FONT_SIZES:
678 lexrc >> font_sizes[FONT_SIZE_TINY];
679 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
680 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
681 lexrc >> font_sizes[FONT_SIZE_SMALL];
682 lexrc >> font_sizes[FONT_SIZE_NORMAL];
683 lexrc >> font_sizes[FONT_SIZE_LARGE];
684 lexrc >> font_sizes[FONT_SIZE_LARGER];
685 lexrc >> font_sizes[FONT_SIZE_LARGEST];
686 lexrc >> font_sizes[FONT_SIZE_HUGE];
687 lexrc >> font_sizes[FONT_SIZE_HUGER];
690 case RC_SCREEN_FONT_SCALABLE:
691 lexrc >> use_scalable_fonts;
698 case RC_DOCUMENTPATH:
700 document_path = os::internal_path(lexrc.getString());
701 document_path = expandPath(document_path);
707 example_path = os::internal_path(lexrc.getString());
708 example_path = expandPath(example_path);
712 case RC_TEMPLATEPATH:
714 template_path = os::internal_path(lexrc.getString());
715 template_path = expandPath(template_path);
721 tempdir_path = os::internal_path(lexrc.getString());
722 tempdir_path = expandPath(tempdir_path);
726 case RC_THESAURUSDIRPATH:
728 thesaurusdir_path = os::internal_path(lexrc.getString());
729 thesaurusdir_path = expandPath(thesaurusdir_path);
733 case RC_HUNSPELLDIR_PATH:
735 hunspelldir_path = os::internal_path(lexrc.getString());
736 hunspelldir_path = expandPath(hunspelldir_path);
740 case RC_USELASTFILEPOS:
741 lexrc >> use_lastfilepos;
745 lexrc >> load_session;
748 case RC_MOUSE_WHEEL_SPEED:
749 lexrc >> mouse_wheel_speed;
752 case RC_COMPLETION_INLINE_DELAY:
753 lexrc >> completion_inline_delay;
756 case RC_COMPLETION_INLINE_MATH:
757 lexrc >> completion_inline_math;
760 case RC_COMPLETION_INLINE_TEXT:
761 lexrc >> completion_inline_text;
764 case RC_COMPLETION_INLINE_DOTS:
765 lexrc >> completion_inline_dots;
768 case RC_AUTOCORRECTION_MATH:
769 lexrc >> autocorrection_math;
772 case RC_COMPLETION_POPUP_DELAY:
773 lexrc >> completion_popup_delay;
776 case RC_COMPLETION_POPUP_MATH:
777 lexrc >> completion_popup_math;
780 case RC_COMPLETION_POPUP_TEXT:
781 lexrc >> completion_popup_text;
784 case RC_COMPLETION_CURSOR_TEXT:
785 lexrc >> completion_cursor_text;
788 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
789 lexrc >> completion_popup_after_complete;
792 case RC_NUMLASTFILES:
793 lexrc >> num_lastfiles;
796 case RC_CHECKLASTFILES:
797 lexrc >> check_lastfiles;
800 case RC_SCREEN_FONT_ROMAN:
802 roman_font_name = lexrc.getString();
803 oldFontFormat(roman_font_name,
808 case RC_SCREEN_FONT_SANS:
810 sans_font_name = lexrc.getString();
811 oldFontFormat(sans_font_name, sans_font_foundry);
815 case RC_SCREEN_FONT_TYPEWRITER:
817 typewriter_font_name = lexrc.getString();
818 oldFontFormat(typewriter_font_name,
819 typewriter_font_foundry);
823 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
824 lexrc >> roman_font_foundry;
827 case RC_SCREEN_FONT_SANS_FOUNDRY:
828 lexrc >> sans_font_foundry;
831 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
832 lexrc >> typewriter_font_foundry;
837 lexrc.printError("Missing color tag.");
840 string lyx_name = lexrc.getString();
843 lexrc.printError("Missing color name for color: `$$Token'");
846 string x11_name = lexrc.getString();
848 ColorCode const col =
849 lcolor.getFromLyXName(lyx_name);
850 if (col == Color_none ||
851 col == Color_inherit ||
855 if (!lcolor.setColor(col, x11_name))
856 LYXERR0("Bad lyxrc set_color for " << lyx_name);
860 case RC_AUTOREGIONDELETE:
861 // Auto region delete defaults to true
862 lexrc >> auto_region_delete;
867 lyxpipes = os::internal_path(lexrc.getString());
868 lyxpipes = expandPath(lyxpipes);
872 case RC_CURSOR_FOLLOWS_SCROLLBAR:
873 lexrc >> cursor_follows_scrollbar;
876 case RC_SCROLL_BELOW_DOCUMENT:
877 lexrc >> scroll_below_document;
880 case RC_PARAGRAPH_MARKERS:
881 lexrc >> paragraph_markers;
884 case RC_MAC_LIKE_WORD_MOVEMENT:
885 lexrc >> mac_like_word_movement;
888 case RC_MACRO_EDIT_STYLE:
890 switch (lexrc.getInteger()) {
891 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
892 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
893 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
898 case RC_DIALOGS_ICONIFY_WITH_MAIN:
899 lexrc >> dialogs_iconify_with_main;
902 case RC_PLAINTEXT_LINELEN:
903 lexrc >> plaintext_linelen;
905 // Spellchecker settings:
906 case RC_ACCEPT_COMPOUND:
907 lexrc >> spellchecker_accept_compound;
910 lexrc >> use_tooltip;
912 case RC_USE_PIXMAP_CACHE:
913 lexrc >> use_pixmap_cache;
915 case RC_SPELLCHECKER:
916 lexrc >> spellchecker;
919 lexrc >> spellchecker_alt_lang;
922 lexrc >> spellchecker_esc_chars;
924 case RC_SPELLCHECK_CONTINUOUSLY:
925 lexrc >> spellcheck_continuously;
927 case RC_SPELLCHECK_NOTES:
928 lexrc >> spellcheck_notes;
931 lexrc >> make_backup;
933 case RC_SAVE_COMPRESSED:
934 lexrc >> save_compressed;
936 case RC_BACKUPDIR_PATH:
938 backupdir_path = os::internal_path(lexrc.getString());
939 backupdir_path = expandPath(backupdir_path);
942 case RC_DATE_INSERT_FORMAT:
943 lexrc >> date_insert_format;
945 case RC_LANGUAGE_PACKAGE:
946 lexrc >> language_package;
948 case RC_LANGUAGE_AUTO_BEGIN:
949 lexrc >> language_auto_begin;
951 case RC_LANGUAGE_AUTO_END:
952 lexrc >> language_auto_end;
954 case RC_LANGUAGE_GLOBAL_OPTIONS:
955 lexrc >> language_global_options;
957 case RC_LANGUAGE_USE_BABEL:
958 lexrc >> language_use_babel;
960 case RC_LANGUAGE_COMMAND_BEGIN:
961 lexrc >> language_command_begin;
963 case RC_LANGUAGE_COMMAND_END:
964 lexrc >> language_command_end;
966 case RC_LANGUAGE_COMMAND_LOCAL:
967 lexrc >> language_command_local;
970 lexrc >> rtl_support;
972 case RC_VISUAL_CURSOR:
973 lexrc >> visual_cursor;
976 lexrc >> auto_number;
978 case RC_MARK_FOREIGN_LANGUAGE:
979 lexrc >> mark_foreign_language;
985 fmt = lexrc.getString();
986 if (lexrc.next(true))
987 command = lexrc.getString();
988 setMover(fmt, command);
993 string from, to, command, flags;
995 from = lexrc.getString();
997 to = lexrc.getString();
998 if (lexrc.next(true))
999 command = lexrc.getString();
1001 flags = lexrc.getString();
1002 if (command.empty())
1003 theConverters().erase(from, to);
1005 theConverters().add(from, to, command, flags);
1008 // compatibility with versions older than 1.4.0 only
1010 string format, command;
1011 lexrc >> format >> command;
1012 formats.setViewer(format, command);
1016 string format, extension, prettyname, shortcut;
1017 lexrc >> format >> extension >> prettyname >> shortcut;
1018 string viewer, editor;
1019 if (lexrc.next(true))
1020 viewer = lexrc.getString();
1021 if (lexrc.next(true))
1022 editor = lexrc.getString();
1024 // Hack to ensure compatibility with versions older
1026 int le = lexrc.lex();
1027 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1028 flags = lexrc.getString();
1029 if (le != Lexer::LEX_DATA) {
1030 // We have got a known token.
1031 // Therefore this is an old style
1032 // format definition without
1034 lexrc.pushToken(flags);
1038 int flgs = Format::none;
1039 while (!flags.empty()) {
1041 flags = split(flags, flag, ',');
1042 if (flag == "document")
1043 flgs |= Format::document;
1044 else if (flag == "vector")
1045 flgs |= Format::vector;
1047 LYXERR0("Ignoring unknown flag `"
1048 << flag << "' for format `"
1051 if (prettyname.empty()) {
1052 if (theConverters().formatIsUsed(format))
1053 LYXERR0("Can't delete format " << format);
1055 formats.erase(format);
1057 formats.add(format, extension, prettyname,
1058 shortcut, viewer, editor, flgs);
1062 case RC_VIEWER_ALTERNATIVES: {
1063 string format, command;
1065 format = lexrc.getString();
1066 if (lexrc.eatLine())
1067 command = lexrc.getString();
1068 viewer_alternatives[format].insert(command);
1071 case RC_EDITOR_ALTERNATIVES: {
1072 string format, command;
1073 lexrc >> format >> command;
1074 editor_alternatives[format].insert(command);
1078 case RC_DEFAULT_VIEW_FORMAT:
1079 lexrc >> default_view_format;
1082 case RC_DEFAULT_LANGUAGE:
1083 lexrc >> default_language;
1086 case RC_GUI_LANGUAGE:
1087 lexrc >> gui_language;
1090 case RC_SHOW_BANNER:
1091 lexrc >> show_banner;
1096 string const tmp = lexrc.getString();
1097 if (tmp == "true" || tmp == "on")
1098 preview = PREVIEW_ON;
1099 else if (tmp == "no_math")
1100 preview = PREVIEW_NO_MATH;
1102 preview = PREVIEW_OFF;
1103 if (tmp != "false" && tmp != "off")
1104 LYXERR0("Unrecognized preview status \""
1110 case RC_PREVIEW_HASHED_LABELS:
1111 lexrc >> preview_hashed_labels;
1114 case RC_PREVIEW_SCALE_FACTOR:
1115 lexrc >> preview_scale_factor;
1122 lexrc >> user_email;
1125 case RC_PATH_PREFIX:
1126 lexrc >> path_prefix;
1129 case RC_USE_CONVERTER_CACHE:
1130 lexrc >> use_converter_cache;
1132 case RC_CONVERTER_CACHE_MAXAGE:
1133 lexrc >> converter_cache_maxage;
1136 case RC_SORT_LAYOUTS:
1137 lexrc >> sort_layouts;
1139 case RC_GROUP_LAYOUTS:
1140 lexrc >> group_layouts;
1142 case RC_FULL_SCREEN_LIMIT:
1143 lexrc >> full_screen_limit;
1145 case RC_FULL_SCREEN_TOOLBARS:
1146 lexrc >> full_screen_toolbars;
1148 case RC_FULL_SCREEN_SCROLLBAR:
1149 lexrc >> full_screen_scrollbar;
1151 case RC_FULL_SCREEN_TABBAR:
1152 lexrc >> full_screen_tabbar;
1154 case RC_FULL_SCREEN_MENUBAR:
1155 lexrc >> full_screen_menubar;
1157 case RC_FULL_SCREEN_WIDTH:
1158 lexrc >> full_screen_width;
1160 case RC_OPEN_BUFFERS_IN_TABS:
1161 lexrc >> open_buffers_in_tabs;
1163 case RC_SINGLE_CLOSE_TAB_BUTTON:
1164 lexrc >> single_close_tab_button;
1166 case RC_FORWARD_SEARCH_DVI:
1167 if (lexrc.next(true))
1168 forward_search_dvi = lexrc.getString();
1170 case RC_FORWARD_SEARCH_PDF:
1171 if (lexrc.next(true))
1172 forward_search_pdf = lexrc.getString();
1174 case RC_EXPORT_OVERWRITE:
1176 string const tmp = lexrc.getString();
1177 if (tmp == "all" || tmp == "true")
1178 export_overwrite = ALL_FILES;
1179 else if (tmp == "main")
1180 export_overwrite = MAIN_FILE;
1182 export_overwrite = NO_FILES;
1183 if (tmp != "ask" && tmp != "false")
1184 LYXERR0("Unrecognized export_overwrite status \""
1190 // Obsoteted in 1.4.0
1193 case RC_SPELL_COMMAND:
1195 case RC_PLAINTEXT_ROFF_COMMAND:
1196 case RC_USE_ALT_LANG:
1197 case RC_USE_ESC_CHARS:
1198 case RC_USE_INP_ENC:
1199 case RC_USE_PERS_DICT:
1200 case RC_USE_SPELL_LIB:
1201 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1202 << lexrc.getString() << "'.");
1207 break; // this is just a dummy
1211 /// Update converters data-structures
1212 theConverters().update(formats);
1213 theConverters().buildGraph();
1219 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1221 ofstream ofs(filename.toFilesystemEncoding().c_str());
1223 write(ofs, ignore_system_lyxrc);
1227 void LyXRC::print() const
1229 if (lyxerr.debugging())
1230 write(lyxerr, false);
1238 typedef pair<string, SpecialisedMover> Data;
1240 SameMover(Data const & comparison)
1241 : comparison_(comparison) {}
1243 bool operator()(Data const & data) const
1245 return data.first == comparison_.first &&
1246 data.second.command() == comparison_.second.command();
1256 // Escape \ and " so that LyXLex can read the string later
1257 string escapeCommand(string const & str) {
1258 return subst(subst(str , "\\", "\\\\"),
1265 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1267 LyXRCTags tag = RC_LAST;
1269 if (!name.empty()) {
1270 for (int i = 0; i != lyxrcCount; ++i)
1271 if ("\\" + name == lyxrcTags[i].tag)
1272 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1276 os << "# LyX " << lyx_version
1277 << " generated this file. If you want to make your own\n"
1278 << "# modifications you should do them from inside LyX and save.\n"
1281 // Why the switch you might ask. It is a trick to ensure that all
1282 // the elements in the LyXRCTags enum are handled. As you can see
1283 // there are no breaks at all. So it is just a huge fall-through.
1284 // The nice thing is that we will get a warning from the compiler
1285 // if we forget an element.
1289 // input/include files are not done here
1291 if (ignore_system_lyxrc ||
1292 bind_file != system_lyxrc.bind_file) {
1293 string const path = os::external_path(bind_file);
1294 os << "\\bind_file \"" << path << "\"\n";
1300 if (ignore_system_lyxrc ||
1301 def_file != system_lyxrc.def_file) {
1302 string const path = os::external_path(def_file);
1303 os << "\\def_file \"" << path << "\"\n";
1312 << "# MISC SECTION ######################################\n"
1314 // bind files are not done here.
1316 case RC_PATH_PREFIX:
1317 if (ignore_system_lyxrc ||
1318 path_prefix != system_lyxrc.path_prefix) {
1319 os << "\\path_prefix \"" << path_prefix << "\"\n";
1324 if (ignore_system_lyxrc ||
1325 ui_file != system_lyxrc.ui_file) {
1326 string const path = os::external_path(ui_file);
1327 os << "\\ui_file \"" << path << "\"\n";
1331 case RC_AUTOREGIONDELETE:
1332 if (ignore_system_lyxrc ||
1333 auto_region_delete != system_lyxrc.auto_region_delete) {
1334 os << "# Set to false to inhibit automatic replacement of\n"
1335 << "# the current selection.\n"
1336 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1341 case RC_AUTORESET_OPTIONS:
1342 if (ignore_system_lyxrc ||
1343 auto_reset_options != system_lyxrc.auto_reset_options) {
1344 os << "# Set to false to inhibit automatic reset of\n"
1345 << "# the class options to defaults on class change.\n"
1346 << "\\auto_reset_options "
1347 << convert<string>(auto_reset_options)
1353 if (ignore_system_lyxrc ||
1354 autosave != system_lyxrc.autosave) {
1355 os << "# The time interval between auto-saves in seconds.\n"
1356 << "\\autosave " << autosave << '\n';
1360 case RC_DISPLAY_GRAPHICS:
1361 if (ignore_system_lyxrc ||
1362 display_graphics != system_lyxrc.display_graphics) {
1363 os << "# Display graphics within LyX\n"
1365 << "\\display_graphics "
1366 << (display_graphics ? "true" : "false")
1371 case RC_SORT_LAYOUTS:
1372 if (ignore_system_lyxrc ||
1373 sort_layouts != system_lyxrc.sort_layouts) {
1374 os << "# Sort layouts alphabetically.\n"
1375 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1379 case RC_GROUP_LAYOUTS:
1380 if (ignore_system_lyxrc ||
1381 group_layouts != system_lyxrc.group_layouts) {
1382 os << "# Group layouts by their category.\n"
1383 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1387 case RC_VIEWDVI_PAPEROPTION:
1388 if (ignore_system_lyxrc ||
1389 view_dvi_paper_option
1390 != system_lyxrc.view_dvi_paper_option) {
1391 os << "# Options used to specify paper size to the\n"
1392 << "# view_dvi_command (e.g. -paper)\n"
1393 << "\\view_dvi_paper_option \""
1394 << view_dvi_paper_option << "\"\n";
1398 case RC_DEFAULT_PAPERSIZE:
1399 if (ignore_system_lyxrc ||
1400 default_papersize != system_lyxrc.default_papersize) {
1401 os << "# The default papersize to use.\n"
1402 << "\\default_papersize \"";
1403 switch (default_papersize) {
1405 os << "default"; break;
1406 case PAPER_USLETTER:
1407 os << "usletter"; break;
1409 os << "legal"; break;
1410 case PAPER_USEXECUTIVE:
1411 os << "executive"; break;
1422 case PAPER_B4: break;
1428 case RC_CHKTEX_COMMAND:
1429 if (ignore_system_lyxrc ||
1430 chktex_command != system_lyxrc.chktex_command) {
1431 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1435 case RC_BIBTEX_ALTERNATIVES: {
1436 CommandSet::const_iterator it = bibtex_alternatives.begin();
1437 CommandSet::const_iterator end = bibtex_alternatives.end();
1438 for ( ; it != end; ++it) {
1439 if (ignore_system_lyxrc
1440 || !system_lyxrc.bibtex_alternatives.count(*it))
1441 os << "\\bibtex_alternatives \""
1447 case RC_BIBTEX_COMMAND:
1448 if (ignore_system_lyxrc ||
1449 bibtex_command != system_lyxrc.bibtex_command) {
1450 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1454 case RC_JBIBTEX_COMMAND:
1455 if (ignore_system_lyxrc ||
1456 jbibtex_command != system_lyxrc.jbibtex_command) {
1457 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1461 case RC_INDEX_ALTERNATIVES: {
1462 CommandSet::const_iterator it = index_alternatives.begin();
1463 CommandSet::const_iterator end = index_alternatives.end();
1464 for ( ; it != end; ++it) {
1465 if (ignore_system_lyxrc
1466 || !system_lyxrc.index_alternatives.count(*it))
1467 os << "\\index_alternatives \""
1473 case RC_INDEX_COMMAND:
1474 if (ignore_system_lyxrc ||
1475 index_command != system_lyxrc.index_command) {
1476 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1480 case RC_JINDEX_COMMAND:
1481 if (ignore_system_lyxrc ||
1482 jindex_command != system_lyxrc.jindex_command) {
1483 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1487 case RC_SPLITINDEX_COMMAND:
1488 if (ignore_system_lyxrc ||
1489 splitindex_command != system_lyxrc.splitindex_command) {
1490 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1494 case RC_NOMENCL_COMMAND:
1495 if (ignore_system_lyxrc ||
1496 nomencl_command != system_lyxrc.nomencl_command) {
1497 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1501 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1502 if (ignore_system_lyxrc ||
1503 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1504 os << "\\tex_expects_windows_paths "
1505 << convert<string>(windows_style_tex_paths) << '\n';
1509 case RC_TEX_ALLOWS_SPACES:
1510 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1511 os << "\\tex_allows_spaces "
1512 << convert<string>(tex_allows_spaces) << '\n';
1517 if (ignore_system_lyxrc ||
1518 use_kbmap != system_lyxrc.use_kbmap) {
1519 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1523 case RC_KBMAP_PRIMARY:
1524 if (ignore_system_lyxrc ||
1525 primary_kbmap != system_lyxrc.primary_kbmap) {
1526 string const path = os::external_path(primary_kbmap);
1527 os << "\\kbmap_primary \"" << path << "\"\n";
1531 case RC_KBMAP_SECONDARY:
1532 if (ignore_system_lyxrc ||
1533 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1534 string const path = os::external_path(secondary_kbmap);
1535 os << "\\kbmap_secondary \"" << path << "\"\n";
1540 if (ignore_system_lyxrc ||
1541 lyxpipes != system_lyxrc.lyxpipes) {
1542 string const path = os::external_path(lyxpipes);
1543 os << "\\serverpipe \"" << path << "\"\n";
1547 case RC_DATE_INSERT_FORMAT:
1548 if (ignore_system_lyxrc ||
1549 date_insert_format != system_lyxrc.date_insert_format) {
1550 os << "\\date_insert_format \"" << date_insert_format
1557 os << "\\user_name \"" << user_name << "\"\n";
1562 os << "\\user_email \"" << user_email << "\"\n";
1566 case RC_SHOW_BANNER:
1567 if (ignore_system_lyxrc ||
1568 show_banner != system_lyxrc.show_banner) {
1569 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1575 if (ignore_system_lyxrc ||
1576 preview != system_lyxrc.preview) {
1582 case PREVIEW_NO_MATH:
1589 os << "\\preview " << status << '\n';
1594 case RC_PREVIEW_HASHED_LABELS:
1595 if (ignore_system_lyxrc ||
1596 preview_hashed_labels !=
1597 system_lyxrc.preview_hashed_labels) {
1598 os << "\\preview_hashed_labels "
1599 << convert<string>(preview_hashed_labels) << '\n';
1604 case RC_PREVIEW_SCALE_FACTOR:
1605 if (ignore_system_lyxrc ||
1606 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1607 os << "\\preview_scale_factor "
1608 << preview_scale_factor << '\n';
1613 case RC_USE_CONVERTER_CACHE:
1614 if (ignore_system_lyxrc ||
1615 use_converter_cache != system_lyxrc.use_converter_cache) {
1616 os << "\\use_converter_cache "
1617 << convert<string>(use_converter_cache) << '\n';
1622 case RC_CONVERTER_CACHE_MAXAGE:
1623 if (ignore_system_lyxrc ||
1624 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1625 os << "\\converter_cache_maxage "
1626 << converter_cache_maxage << '\n';
1632 << "# SCREEN & FONTS SECTION ############################\n"
1636 if (ignore_system_lyxrc ||
1637 dpi != system_lyxrc.dpi) {
1638 os << "\\screen_dpi " << dpi << '\n';
1642 case RC_SCREEN_ZOOM:
1643 if (ignore_system_lyxrc ||
1644 zoom != system_lyxrc.zoom) {
1645 os << "\\screen_zoom " << zoom << '\n';
1649 case RC_GEOMETRY_SESSION:
1650 if (ignore_system_lyxrc ||
1651 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1652 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1657 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1658 if (ignore_system_lyxrc ||
1659 cursor_follows_scrollbar
1660 != system_lyxrc.cursor_follows_scrollbar) {
1661 os << "\\cursor_follows_scrollbar "
1662 << convert<string>(cursor_follows_scrollbar) << '\n';
1666 case RC_SCROLL_BELOW_DOCUMENT:
1667 if (ignore_system_lyxrc ||
1668 scroll_below_document
1669 != system_lyxrc.scroll_below_document) {
1670 os << "\\scroll_below_document "
1671 << convert<string>(scroll_below_document) << '\n';
1675 case RC_PARAGRAPH_MARKERS:
1676 if (ignore_system_lyxrc ||
1678 != system_lyxrc.paragraph_markers) {
1679 os << "\\paragraph_markers "
1680 << convert<string>(paragraph_markers) << '\n';
1684 case RC_MAC_LIKE_WORD_MOVEMENT:
1685 if (ignore_system_lyxrc ||
1686 mac_like_word_movement
1687 != system_lyxrc.mac_like_word_movement) {
1688 os << "\\mac_like_word_movement "
1689 << convert<string>(mac_like_word_movement) << '\n';
1693 case RC_MACRO_EDIT_STYLE:
1694 if (ignore_system_lyxrc ||
1696 != system_lyxrc.macro_edit_style) {
1697 os << "\\macro_edit_style ";
1698 switch (macro_edit_style) {
1699 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1700 case MACRO_EDIT_INLINE: os << "1\n"; break;
1701 case MACRO_EDIT_LIST: os << "2\n"; break;
1706 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1707 if (ignore_system_lyxrc ||
1708 dialogs_iconify_with_main
1709 != system_lyxrc.dialogs_iconify_with_main) {
1710 os << "\\dialogs_iconify_with_main "
1711 << convert<string>(dialogs_iconify_with_main) << '\n';
1715 case RC_SCREEN_FONT_ROMAN:
1716 if (ignore_system_lyxrc ||
1717 roman_font_name != system_lyxrc.roman_font_name) {
1718 os << "\\screen_font_roman \"" << roman_font_name
1723 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1724 if (ignore_system_lyxrc ||
1725 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1726 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1731 case RC_SCREEN_FONT_SANS:
1732 if (ignore_system_lyxrc ||
1733 sans_font_name != system_lyxrc.sans_font_name) {
1734 os << "\\screen_font_sans \"" << sans_font_name
1739 case RC_SCREEN_FONT_SANS_FOUNDRY:
1740 if (ignore_system_lyxrc ||
1741 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1742 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1747 case RC_SCREEN_FONT_TYPEWRITER:
1748 if (ignore_system_lyxrc ||
1749 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1750 os << "\\screen_font_typewriter \""
1751 << typewriter_font_name << "\"\n";
1755 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1756 if (ignore_system_lyxrc ||
1757 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1758 os << "\\screen_font_typewriter_foundry \""
1759 << typewriter_font_foundry << "\"\n";
1764 case RC_SCREEN_FONT_SCALABLE:
1765 if (ignore_system_lyxrc ||
1766 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1767 os << "\\screen_font_scalable "
1768 << convert<string>(use_scalable_fonts)
1773 case RC_SCREEN_FONT_SIZES:
1774 if (ignore_system_lyxrc ||
1775 font_sizes[FONT_SIZE_TINY]
1776 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1777 font_sizes[FONT_SIZE_SCRIPT]
1778 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1779 font_sizes[FONT_SIZE_FOOTNOTE]
1780 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1781 font_sizes[FONT_SIZE_SMALL]
1782 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1783 font_sizes[FONT_SIZE_NORMAL]
1784 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1785 font_sizes[FONT_SIZE_LARGE]
1786 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1787 font_sizes[FONT_SIZE_LARGER]
1788 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1789 font_sizes[FONT_SIZE_LARGEST]
1790 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1791 font_sizes[FONT_SIZE_HUGE]
1792 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1793 font_sizes[FONT_SIZE_HUGER]
1794 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1795 os.setf(ios::fixed);
1797 os << "\\screen_font_sizes"
1798 << ' ' << font_sizes[FONT_SIZE_TINY]
1799 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1800 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1801 << ' ' << font_sizes[FONT_SIZE_SMALL]
1802 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1803 << ' ' << font_sizes[FONT_SIZE_LARGE]
1804 << ' ' << font_sizes[FONT_SIZE_LARGER]
1805 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1806 << ' ' << font_sizes[FONT_SIZE_HUGE]
1807 << ' ' << font_sizes[FONT_SIZE_HUGER]
1812 case RC_FULL_SCREEN_LIMIT:
1813 if (ignore_system_lyxrc ||
1814 full_screen_limit != system_lyxrc.full_screen_limit) {
1815 os << "\\fullscreen_limit "
1816 << convert<string>(full_screen_limit)
1821 case RC_FULL_SCREEN_TOOLBARS:
1822 if (ignore_system_lyxrc ||
1823 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1824 os << "\\fullscreen_toolbars "
1825 << convert<string>(full_screen_toolbars)
1830 case RC_FULL_SCREEN_SCROLLBAR:
1831 if (ignore_system_lyxrc ||
1832 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1833 os << "\\fullscreen_scrollbar "
1834 << convert<string>(full_screen_scrollbar)
1839 case RC_FULL_SCREEN_TABBAR:
1840 if (ignore_system_lyxrc ||
1841 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1842 os << "\\fullscreen_tabbar "
1843 << convert<string>(full_screen_tabbar)
1848 case RC_FULL_SCREEN_MENUBAR:
1849 if (ignore_system_lyxrc ||
1850 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1851 os << "\\fullscreen_menubar "
1852 << convert<string>(full_screen_menubar)
1857 case RC_FULL_SCREEN_WIDTH:
1858 if (ignore_system_lyxrc ||
1859 full_screen_width != system_lyxrc.full_screen_width) {
1860 os << "\\fullscreen_width "
1861 << convert<string>(full_screen_width)
1866 case RC_OPEN_BUFFERS_IN_TABS:
1867 if (ignore_system_lyxrc ||
1868 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1869 os << "\\open_buffers_in_tabs "
1870 << convert<string>(open_buffers_in_tabs)
1875 case RC_SINGLE_CLOSE_TAB_BUTTON:
1876 if (ignore_system_lyxrc ||
1877 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1878 os << "\\single_close_tab_button "
1879 << convert<string>(single_close_tab_button)
1884 case RC_FORWARD_SEARCH_DVI:
1885 if (ignore_system_lyxrc ||
1886 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1887 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1891 case RC_FORWARD_SEARCH_PDF:
1892 if (ignore_system_lyxrc ||
1893 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1894 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1900 << "# COLOR SECTION ###################################\n"
1904 for (int i = 0; i < Color_ignore; ++i) {
1905 ColorCode lc = static_cast<ColorCode>(i);
1906 string const col = lcolor.getX11Name(lc);
1907 if (ignore_system_lyxrc
1908 || col != system_lcolor.getX11Name(lc)) {
1909 os << "\\set_color \""
1910 << lcolor.getLyXName(lc) << "\" \""
1918 << "# PRINTER SECTION ###################################\n"
1922 if (ignore_system_lyxrc ||
1923 printer != system_lyxrc.printer) {
1924 os << "\\printer \"" << printer << "\"\n";
1928 case RC_PRINT_ADAPTOUTPUT:
1929 if (ignore_system_lyxrc ||
1930 print_adapt_output != system_lyxrc.print_adapt_output) {
1931 os << "\\print_adapt_output "
1932 << convert<string>(print_adapt_output)
1937 case RC_PRINT_COMMAND:
1938 if (ignore_system_lyxrc ||
1939 print_command != system_lyxrc.print_command) {
1940 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1944 case RC_PRINTEXSTRAOPTIONS:
1945 if (ignore_system_lyxrc ||
1946 print_extra_options != system_lyxrc.print_extra_options) {
1947 os << "\\print_extra_options \"" << print_extra_options
1952 case RC_PRINTSPOOL_COMMAND:
1953 if (ignore_system_lyxrc ||
1954 print_spool_command != system_lyxrc.print_spool_command) {
1955 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1960 case RC_PRINTSPOOL_PRINTERPREFIX:
1961 if (ignore_system_lyxrc ||
1962 print_spool_printerprefix
1963 != system_lyxrc.print_spool_printerprefix) {
1964 os << "\\print_spool_printerprefix \""
1965 << print_spool_printerprefix << "\"\n";
1969 case RC_PRINTEVENPAGEFLAG:
1970 if (ignore_system_lyxrc ||
1971 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1972 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1977 case RC_PRINTODDPAGEFLAG:
1978 if (ignore_system_lyxrc ||
1979 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1980 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1985 case RC_PRINTREVERSEFLAG:
1986 if (ignore_system_lyxrc ||
1987 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1988 os << "\\print_reverse_flag \"" << print_reverse_flag
1993 case RC_PRINTLANDSCAPEFLAG:
1994 if (ignore_system_lyxrc ||
1995 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1996 os << "\\print_landscape_flag \"" << print_landscape_flag
2001 case RC_PRINTPAGERANGEFLAG:
2002 if (ignore_system_lyxrc ||
2003 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2004 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2009 case RC_PRINTCOPIESFLAG:
2010 if (ignore_system_lyxrc ||
2011 print_copies_flag != system_lyxrc.print_copies_flag) {
2012 os << "\\print_copies_flag \"" << print_copies_flag
2017 case RC_PRINTCOLLCOPIESFLAG:
2018 if (ignore_system_lyxrc ||
2019 print_collcopies_flag
2020 != system_lyxrc.print_collcopies_flag) {
2021 os << "\\print_collcopies_flag \""
2022 << print_collcopies_flag
2027 case RC_PRINTPAPERFLAG:
2028 if (ignore_system_lyxrc ||
2029 print_paper_flag != system_lyxrc.print_paper_flag) {
2030 os << "\\print_paper_flag \"" << print_paper_flag
2035 case RC_PRINTPAPERDIMENSIONFLAG:
2036 if (ignore_system_lyxrc ||
2037 print_paper_dimension_flag
2038 != system_lyxrc.print_paper_dimension_flag) {
2039 os << "\\print_paper_dimension_flag \""
2040 << print_paper_dimension_flag << "\"\n";
2044 case RC_PRINTTOPRINTER:
2045 if (ignore_system_lyxrc ||
2046 print_to_printer != system_lyxrc.print_to_printer) {
2047 os << "\\print_to_printer \"" << print_to_printer
2052 case RC_PRINTTOFILE:
2053 if (ignore_system_lyxrc ||
2054 print_to_file != system_lyxrc.print_to_file) {
2055 string const path = os::external_path(print_to_file);
2056 os << "\\print_to_file \"" << path << "\"\n";
2060 case RC_PRINTFILEEXTENSION:
2061 if (ignore_system_lyxrc ||
2062 print_file_extension != system_lyxrc.print_file_extension) {
2063 os << "\\print_file_extension \""
2064 << print_file_extension
2071 << "# TEX SECTION #######################################\n"
2074 case RC_FONT_ENCODING:
2075 if (ignore_system_lyxrc ||
2076 fontenc != system_lyxrc.fontenc) {
2077 os << "\\font_encoding \"" << fontenc << "\"\n";
2083 << "# FILE SECTION ######################################\n"
2086 case RC_DOCUMENTPATH:
2087 if (ignore_system_lyxrc ||
2088 document_path != system_lyxrc.document_path) {
2089 string const path = os::external_path(document_path);
2090 os << "\\document_path \"" << path << "\"\n";
2094 case RC_USELASTFILEPOS:
2095 if (ignore_system_lyxrc ||
2096 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2097 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2102 case RC_LOADSESSION:
2103 if (ignore_system_lyxrc ||
2104 load_session != system_lyxrc.load_session) {
2105 os << "\\load_session " << convert<string>(load_session)
2110 case RC_MOUSE_WHEEL_SPEED:
2111 if (ignore_system_lyxrc ||
2112 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2113 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2117 case RC_COMPLETION_INLINE_DELAY:
2118 if (ignore_system_lyxrc ||
2119 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2120 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2124 case RC_COMPLETION_INLINE_MATH:
2125 if (ignore_system_lyxrc ||
2126 completion_inline_math != system_lyxrc.completion_inline_math) {
2127 os << "\\completion_inline_math "
2128 << convert<string>(completion_inline_math) << '\n';
2132 case RC_COMPLETION_INLINE_TEXT:
2133 if (ignore_system_lyxrc ||
2134 completion_inline_text != system_lyxrc.completion_inline_text) {
2135 os << "\\completion_inline_text "
2136 << convert<string>(completion_inline_text) << '\n';
2140 case RC_COMPLETION_INLINE_DOTS:
2141 if (ignore_system_lyxrc ||
2142 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2143 os << "\\completion_inline_dots "
2144 << convert<string>(completion_inline_dots) << '\n';
2148 case RC_AUTOCORRECTION_MATH:
2149 if (ignore_system_lyxrc ||
2150 autocorrection_math != system_lyxrc.autocorrection_math) {
2151 os << "\\autocorrection_math "
2152 << convert<string>(autocorrection_math) << '\n';
2156 case RC_COMPLETION_POPUP_DELAY:
2157 if (ignore_system_lyxrc ||
2158 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2159 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2163 case RC_COMPLETION_POPUP_MATH:
2164 if (ignore_system_lyxrc ||
2165 completion_popup_math != system_lyxrc.completion_popup_math) {
2166 os << "\\completion_popup_math "
2167 << convert<string>(completion_popup_math) << '\n';
2171 case RC_COMPLETION_POPUP_TEXT:
2172 if (ignore_system_lyxrc ||
2173 completion_popup_text != system_lyxrc.completion_popup_text) {
2174 os << "\\completion_popup_text "
2175 << convert<string>(completion_popup_text) << '\n';
2179 case RC_COMPLETION_CURSOR_TEXT:
2180 if (ignore_system_lyxrc ||
2181 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2182 os << "\\completion_cursor_text "
2183 << convert<string>(completion_cursor_text) << '\n';
2187 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2188 if (ignore_system_lyxrc ||
2189 completion_popup_after_complete
2190 != system_lyxrc.completion_popup_after_complete) {
2191 os << "\\completion_popup_after_complete "
2192 << convert<string>(completion_popup_after_complete) << '\n';
2196 case RC_NUMLASTFILES:
2197 if (ignore_system_lyxrc ||
2198 num_lastfiles != system_lyxrc.num_lastfiles) {
2199 os << "\\num_lastfiles " << num_lastfiles << '\n';
2203 case RC_CHECKLASTFILES:
2204 if (ignore_system_lyxrc ||
2205 check_lastfiles != system_lyxrc.check_lastfiles) {
2206 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2211 case RC_EXAMPLEPATH:
2212 if (ignore_system_lyxrc ||
2213 example_path != system_lyxrc.example_path) {
2214 string const path = os::external_path(example_path);
2215 os << "\\example_path \"" << path << "\"\n";
2219 case RC_TEMPLATEPATH:
2220 if (ignore_system_lyxrc ||
2221 template_path != system_lyxrc.template_path) {
2222 string const path = os::external_path(template_path);
2223 os << "\\template_path \"" << path << "\"\n";
2227 case RC_TEMPDIRPATH:
2228 if (ignore_system_lyxrc ||
2229 tempdir_path != system_lyxrc.tempdir_path) {
2230 string const path = os::external_path(tempdir_path);
2231 os << "\\tempdir_path \"" << path << "\"\n";
2235 case RC_THESAURUSDIRPATH:
2236 if (ignore_system_lyxrc ||
2237 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2238 string const path = os::external_path(thesaurusdir_path);
2239 os << "\\thesaurusdir_path \"" << path << "\"\n";
2243 case RC_HUNSPELLDIR_PATH:
2244 if (ignore_system_lyxrc ||
2245 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2246 string const path = os::external_path(hunspelldir_path);
2247 os << "\\hunspelldir_path \"" << path << "\"\n";
2255 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2258 case RC_PLAINTEXT_LINELEN:
2259 if (ignore_system_lyxrc ||
2260 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2261 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2265 case RC_MAKE_BACKUP:
2266 if (ignore_system_lyxrc ||
2267 make_backup != system_lyxrc.make_backup) {
2268 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2272 case RC_SAVE_COMPRESSED:
2273 if (ignore_system_lyxrc ||
2274 save_compressed != system_lyxrc.save_compressed) {
2275 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2279 case RC_BACKUPDIR_PATH:
2280 if (ignore_system_lyxrc ||
2281 backupdir_path != system_lyxrc.backupdir_path) {
2282 string const path = os::external_path(backupdir_path);
2283 os << "\\backupdir_path \"" << path << "\"\n";
2289 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2293 << "# SPELLCHECKER SECTION ##############################\n"
2296 case RC_SPELL_COMMAND:
2297 case RC_USE_SPELL_LIB:
2301 case RC_ACCEPT_COMPOUND:
2302 if (ignore_system_lyxrc ||
2303 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2304 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2309 case RC_USE_ALT_LANG:
2314 if (ignore_system_lyxrc ||
2315 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2316 os << "\\alternate_language \"" << spellchecker_alt_lang
2321 case RC_USE_ESC_CHARS:
2325 if (ignore_system_lyxrc ||
2326 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2327 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2331 case RC_USE_PERS_DICT:
2335 case RC_USE_TOOLTIP:
2336 if (ignore_system_lyxrc ||
2337 use_tooltip != system_lyxrc.use_tooltip) {
2338 os << "\\use_tooltip "
2339 << convert<string>(use_tooltip)
2344 case RC_USE_PIXMAP_CACHE:
2345 if (ignore_system_lyxrc ||
2346 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2347 os << "\\use_pixmap_cache "
2348 << convert<string>(use_pixmap_cache)
2357 case RC_USE_INP_ENC:
2363 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2368 case RC_SPELLCHECKER:
2369 if (ignore_system_lyxrc ||
2370 spellchecker != system_lyxrc.spellchecker) {
2371 os << "\\spellchecker " << spellchecker << '\n';
2376 case RC_SPELLCHECK_CONTINUOUSLY:
2377 if (ignore_system_lyxrc ||
2378 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2379 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2385 case RC_SPELLCHECK_NOTES:
2386 if (ignore_system_lyxrc ||
2387 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2388 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2394 case RC_RTL_SUPPORT:
2395 if (ignore_system_lyxrc ||
2396 rtl_support != system_lyxrc.rtl_support) {
2397 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2401 case RC_VISUAL_CURSOR:
2402 if (ignore_system_lyxrc ||
2403 visual_cursor != system_lyxrc.visual_cursor) {
2404 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2408 case RC_LANGUAGE_PACKAGE:
2409 if (ignore_system_lyxrc ||
2410 language_package != system_lyxrc.language_package) {
2411 os << "\\language_package \"" << language_package
2416 case RC_LANGUAGE_GLOBAL_OPTIONS:
2417 if (ignore_system_lyxrc ||
2418 language_global_options
2419 != system_lyxrc.language_global_options) {
2420 os << "\\language_global_options \""
2421 << convert<string>(language_global_options)
2426 case RC_LANGUAGE_USE_BABEL:
2427 if (ignore_system_lyxrc ||
2428 language_use_babel != system_lyxrc.language_use_babel) {
2429 os << "\\language_use_babel \""
2430 << convert<string>(language_use_babel)
2435 case RC_LANGUAGE_COMMAND_BEGIN:
2436 if (ignore_system_lyxrc ||
2437 language_command_begin
2438 != system_lyxrc.language_command_begin) {
2439 os << "\\language_command_begin \""
2440 << language_command_begin
2445 case RC_LANGUAGE_COMMAND_END:
2446 if (ignore_system_lyxrc ||
2447 language_command_end
2448 != system_lyxrc.language_command_end) {
2449 os << "\\language_command_end \"" << language_command_end
2454 case RC_LANGUAGE_COMMAND_LOCAL:
2455 if (ignore_system_lyxrc ||
2456 language_command_local
2457 != system_lyxrc.language_command_local) {
2458 os << "\\language_command_local \""
2459 << language_command_local
2464 case RC_LANGUAGE_AUTO_BEGIN:
2465 if (ignore_system_lyxrc ||
2466 language_auto_begin != system_lyxrc.language_auto_begin) {
2467 os << "\\language_auto_begin "
2468 << convert<string>(language_auto_begin) << '\n';
2472 case RC_LANGUAGE_AUTO_END:
2473 if (ignore_system_lyxrc ||
2474 language_auto_end != system_lyxrc.language_auto_end) {
2475 os << "\\language_auto_end "
2476 << convert<string>(language_auto_end) << '\n';
2480 case RC_MARK_FOREIGN_LANGUAGE:
2481 if (ignore_system_lyxrc ||
2482 mark_foreign_language
2483 != system_lyxrc.mark_foreign_language) {
2484 os << "\\mark_foreign_language " <<
2485 convert<string>(mark_foreign_language) << '\n';
2491 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2494 case RC_AUTO_NUMBER:
2495 if (ignore_system_lyxrc ||
2496 auto_number != system_lyxrc.auto_number) {
2497 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2501 case RC_DEFAULT_LANGUAGE:
2502 if (ignore_system_lyxrc ||
2503 default_language != system_lyxrc.default_language) {
2504 os << "\\default_language " << default_language << '\n';
2508 case RC_GUI_LANGUAGE:
2509 if (ignore_system_lyxrc ||
2510 gui_language != system_lyxrc.gui_language) {
2511 os << "\\gui_language " << gui_language << '\n';
2515 case RC_EXPORT_OVERWRITE:
2516 if (ignore_system_lyxrc ||
2517 export_overwrite != system_lyxrc.export_overwrite) {
2519 switch (export_overwrite) {
2530 os << "\\export_overwrite " << status << '\n';
2536 << "# FORMATS SECTION ##########################\n"
2540 // New/modified formats
2541 for (Formats::const_iterator cit = formats.begin();
2542 cit != formats.end(); ++cit) {
2543 Format const * format =
2544 system_formats.getFormat(cit->name());
2546 format->extension() != cit->extension() ||
2547 format->prettyname() != cit->prettyname() ||
2548 format->shortcut() != cit->shortcut() ||
2549 format->viewer() != cit->viewer() ||
2550 format->editor() != cit->editor() ||
2551 format->documentFormat() != cit->documentFormat() ||
2552 format->vectorFormat() != cit->vectorFormat()) {
2553 os << "\\format \"" << cit->name() << "\" \""
2554 << cit->extension() << "\" \""
2555 << cit->prettyname() << "\" \""
2556 << cit->shortcut() << "\" \""
2557 << escapeCommand(cit->viewer()) << "\" \""
2558 << escapeCommand(cit->editor()) << "\" \"";
2559 vector<string> flags;
2560 if (cit->documentFormat())
2561 flags.push_back("document");
2562 if (cit->vectorFormat())
2563 flags.push_back("vector");
2564 os << getStringFromVector(flags);
2569 // Look for deleted formats
2570 for (Formats::const_iterator cit = system_formats.begin();
2571 cit != system_formats.end(); ++cit)
2572 if (!formats.getFormat(cit->name()))
2573 os << "\\format \"" << cit->name()
2574 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2577 case RC_VIEWER_ALTERNATIVES: {
2578 Alternatives::const_iterator it = viewer_alternatives.begin();
2579 Alternatives::const_iterator const en = viewer_alternatives.end();
2580 Alternatives::const_iterator const sysend =
2581 system_lyxrc.viewer_alternatives.end();
2582 for (; it != en; ++it) {
2583 string const & fmt = it->first;
2584 CommandSet const & cmd = it->second;
2585 CommandSet::const_iterator sit = cmd.begin();
2586 CommandSet::const_iterator const sen = cmd.end();
2587 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2588 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2589 system_lyxrc.viewer_alternatives.find(fmt);
2590 for (; sit != sen; ++sit) {
2591 string const & cmd = *sit;
2592 if (ignore_system_lyxrc
2593 || sysfmt == sysend // format not found
2594 || sysfmt->second.count(cmd) == 0 // this command not found
2596 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2602 case RC_EDITOR_ALTERNATIVES: {
2603 Alternatives::const_iterator it = editor_alternatives.begin();
2604 Alternatives::const_iterator const en = editor_alternatives.end();
2605 Alternatives::const_iterator const sysend =
2606 system_lyxrc.editor_alternatives.end();
2607 for (; it != en; ++it) {
2608 string const & fmt = it->first;
2609 CommandSet const & cmd = it->second;
2610 CommandSet::const_iterator sit = cmd.begin();
2611 CommandSet::const_iterator const sen = cmd.end();
2612 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2613 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2614 system_lyxrc.editor_alternatives.find(fmt);
2615 for (; sit != sen; ++sit) {
2616 string const & cmd = *sit;
2617 if (ignore_system_lyxrc
2618 || sysfmt == sysend // format not found
2619 || sysfmt->second.count(cmd) == 0 // this command not found
2621 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2627 case RC_DEFAULT_VIEW_FORMAT:
2628 if (ignore_system_lyxrc ||
2629 default_view_format != system_lyxrc.default_view_format) {
2630 os << "\\default_view_format " << default_view_format << '\n';
2640 << "# CONVERTERS SECTION ##########################\n"
2644 // Look for new converters
2645 for (Converters::const_iterator cit = theConverters().begin();
2646 cit != theConverters().end(); ++cit) {
2647 Converter const * converter =
2648 theSystemConverters().getConverter(cit->from,
2651 converter->command != cit->command ||
2652 converter->flags != cit->flags)
2653 os << "\\converter \"" << cit->from << "\" \""
2654 << cit->to << "\" \""
2655 << escapeCommand(cit->command) << "\" \""
2656 << cit->flags << "\"\n";
2659 // New/modifed converters
2660 for (Converters::const_iterator cit = theSystemConverters().begin();
2661 cit != theSystemConverters().end(); ++cit)
2662 if (!theConverters().getConverter(cit->from, cit->to))
2663 os << "\\converter \"" << cit->from
2664 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2671 << "# COPIERS SECTION ##########################\n"
2674 // Look for new movers
2675 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2676 Movers::const_iterator const sysend = theSystemMovers().end();
2677 Movers::const_iterator it = theMovers().begin();
2678 Movers::const_iterator end = theMovers().end();
2680 for (; it != end; ++it) {
2681 Movers::const_iterator const sysit =
2682 find_if(sysbegin, sysend, SameMover(*it));
2683 if (sysit == sysend) {
2684 string const & fmt = it->first;
2685 string const & command =
2686 it->second.command();
2688 os << "\\copier " << fmt
2689 << " \"" << escapeCommand(command) << "\"\n";
2695 // We don't actually delete SpecialisedMover(s) from the
2696 // map, just clear their 'command', so there's no need
2697 // to test for anything else.
2704 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2706 // Why the switch you might ask. It is a trick to ensure that all
2707 // the elements in the LyXRCTags enum is handled. As you can see
2708 // there are no breaks at all. So it is just a huge fall-through.
2709 // The nice thing is that we will get a warning from the compiler
2710 // if we forget an element.
2711 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2713 case LyXRC::RC_ACCEPT_COMPOUND:
2714 case LyXRC::RC_ALT_LANG:
2715 case LyXRC::RC_PLAINTEXT_LINELEN:
2716 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2717 case LyXRC::RC_AUTOCORRECTION_MATH:
2718 case LyXRC::RC_AUTOREGIONDELETE:
2719 case LyXRC::RC_AUTORESET_OPTIONS:
2720 case LyXRC::RC_AUTOSAVE:
2721 case LyXRC::RC_AUTO_NUMBER:
2722 case LyXRC::RC_BACKUPDIR_PATH:
2723 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2724 case LyXRC::RC_BIBTEX_COMMAND:
2725 case LyXRC::RC_BINDFILE:
2726 case LyXRC::RC_CHECKLASTFILES:
2727 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2728 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2729 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2730 case LyXRC::RC_COMPLETION_INLINE_MATH:
2731 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2732 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2733 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2734 case LyXRC::RC_COMPLETION_POPUP_MATH:
2735 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2736 case LyXRC::RC_USELASTFILEPOS:
2737 case LyXRC::RC_LOADSESSION:
2738 case LyXRC::RC_CHKTEX_COMMAND:
2739 case LyXRC::RC_CONVERTER:
2740 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2741 case LyXRC::RC_COPIER:
2742 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2743 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2744 case LyXRC::RC_DATE_INSERT_FORMAT:
2745 case LyXRC::RC_DEFAULT_LANGUAGE:
2746 case LyXRC::RC_GUI_LANGUAGE:
2747 case LyXRC::RC_DEFAULT_PAPERSIZE:
2748 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2749 case LyXRC::RC_DEFFILE:
2750 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2751 case LyXRC::RC_DISPLAY_GRAPHICS:
2752 case LyXRC::RC_DOCUMENTPATH:
2753 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2754 FileName path(lyxrc_new.document_path);
2755 if (path.exists() && path.isDirectory())
2756 package().document_dir() = FileName(lyxrc.document_path);
2758 case LyXRC::RC_EDITOR_ALTERNATIVES:
2759 case LyXRC::RC_ESC_CHARS:
2760 case LyXRC::RC_EXAMPLEPATH:
2761 case LyXRC::RC_FONT_ENCODING:
2762 case LyXRC::RC_FORMAT:
2763 case LyXRC::RC_GROUP_LAYOUTS:
2764 case LyXRC::RC_HUNSPELLDIR_PATH:
2765 case LyXRC::RC_INDEX_ALTERNATIVES:
2766 case LyXRC::RC_INDEX_COMMAND:
2767 case LyXRC::RC_JBIBTEX_COMMAND:
2768 case LyXRC::RC_JINDEX_COMMAND:
2769 case LyXRC::RC_NOMENCL_COMMAND:
2770 case LyXRC::RC_INPUT:
2771 case LyXRC::RC_KBMAP:
2772 case LyXRC::RC_KBMAP_PRIMARY:
2773 case LyXRC::RC_KBMAP_SECONDARY:
2774 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2775 case LyXRC::RC_LANGUAGE_AUTO_END:
2776 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2777 case LyXRC::RC_LANGUAGE_COMMAND_END:
2778 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2779 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2780 case LyXRC::RC_LANGUAGE_PACKAGE:
2781 case LyXRC::RC_LANGUAGE_USE_BABEL:
2782 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2783 case LyXRC::RC_MACRO_EDIT_STYLE:
2784 case LyXRC::RC_MAKE_BACKUP:
2785 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2786 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2787 case LyXRC::RC_NUMLASTFILES:
2788 case LyXRC::RC_PARAGRAPH_MARKERS:
2789 case LyXRC::RC_PATH_PREFIX:
2790 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2791 prependEnvPath("PATH", lyxrc.path_prefix);
2793 case LyXRC::RC_PERS_DICT:
2794 case LyXRC::RC_PREVIEW:
2795 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2796 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2797 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2798 case LyXRC::RC_PRINTCOPIESFLAG:
2799 case LyXRC::RC_PRINTER:
2800 case LyXRC::RC_PRINTEVENPAGEFLAG:
2801 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2802 case LyXRC::RC_PRINTFILEEXTENSION:
2803 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2804 case LyXRC::RC_PRINTODDPAGEFLAG:
2805 case LyXRC::RC_PRINTPAGERANGEFLAG:
2806 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2807 case LyXRC::RC_PRINTPAPERFLAG:
2808 case LyXRC::RC_PRINTREVERSEFLAG:
2809 case LyXRC::RC_PRINTSPOOL_COMMAND:
2810 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2811 case LyXRC::RC_PRINTTOFILE:
2812 case LyXRC::RC_PRINTTOPRINTER:
2813 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2814 case LyXRC::RC_PRINT_COMMAND:
2815 case LyXRC::RC_RTL_SUPPORT:
2816 case LyXRC::RC_SAVE_COMPRESSED:
2817 case LyXRC::RC_SCREEN_DPI:
2818 case LyXRC::RC_SCREEN_FONT_ROMAN:
2819 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2820 case LyXRC::RC_SCREEN_FONT_SANS:
2821 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2822 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2823 case LyXRC::RC_SCREEN_FONT_SIZES:
2824 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2825 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2826 case LyXRC::RC_GEOMETRY_SESSION:
2827 case LyXRC::RC_SCREEN_ZOOM:
2828 case LyXRC::RC_SERVERPIPE:
2829 case LyXRC::RC_SET_COLOR:
2830 case LyXRC::RC_SHOW_BANNER:
2831 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2832 case LyXRC::RC_SPELL_COMMAND:
2833 case LyXRC::RC_SPELLCHECKER:
2834 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2835 case LyXRC::RC_SPELLCHECK_NOTES:
2836 case LyXRC::RC_SPLITINDEX_COMMAND:
2837 case LyXRC::RC_TEMPDIRPATH:
2838 case LyXRC::RC_TEMPLATEPATH:
2839 case LyXRC::RC_TEX_ALLOWS_SPACES:
2840 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2841 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2842 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2844 case LyXRC::RC_THESAURUSDIRPATH:
2845 case LyXRC::RC_UIFILE:
2846 case LyXRC::RC_USER_EMAIL:
2847 case LyXRC::RC_USER_NAME:
2848 case LyXRC::RC_USETEMPDIR:
2849 case LyXRC::RC_USE_ALT_LANG:
2850 case LyXRC::RC_USE_CONVERTER_CACHE:
2851 case LyXRC::RC_USE_ESC_CHARS:
2852 case LyXRC::RC_USE_INP_ENC:
2853 case LyXRC::RC_USE_PERS_DICT:
2854 case LyXRC::RC_USE_TOOLTIP:
2855 case LyXRC::RC_USE_PIXMAP_CACHE:
2856 case LyXRC::RC_USE_SPELL_LIB:
2857 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2858 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2859 case LyXRC::RC_SORT_LAYOUTS:
2860 case LyXRC::RC_FULL_SCREEN_LIMIT:
2861 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2862 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2863 case LyXRC::RC_FULL_SCREEN_TABBAR:
2864 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2865 case LyXRC::RC_FULL_SCREEN_WIDTH:
2866 case LyXRC::RC_VISUAL_CURSOR:
2867 case LyXRC::RC_VIEWER:
2868 case LyXRC::RC_VIEWER_ALTERNATIVES:
2869 case LyXRC::RC_FORWARD_SEARCH_DVI:
2870 case LyXRC::RC_FORWARD_SEARCH_PDF:
2871 case LyXRC::RC_EXPORT_OVERWRITE:
2872 case LyXRC::RC_LAST:
2879 string const LyXRC::getDescription(LyXRCTags tag)
2884 case RC_ACCEPT_COMPOUND:
2885 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2889 case RC_USE_ALT_LANG:
2890 str = _("Specify an alternate language. The default is to use the language of the document.");
2893 case RC_PLAINTEXT_ROFF_COMMAND:
2894 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.");
2897 case RC_PLAINTEXT_LINELEN:
2898 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.");
2901 case RC_AUTOREGIONDELETE:
2902 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2905 case RC_AUTORESET_OPTIONS:
2906 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2910 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2913 case RC_AUTO_NUMBER:
2916 case RC_BACKUPDIR_PATH:
2917 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.");
2920 case RC_BIBTEX_COMMAND:
2921 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2924 case RC_JBIBTEX_COMMAND:
2925 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2929 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2932 case RC_CHECKLASTFILES:
2933 str = _("Select to check whether the lastfiles still exist.");
2936 case RC_CHKTEX_COMMAND:
2937 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2946 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2947 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.");
2950 case RC_SCROLL_BELOW_DOCUMENT:
2951 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");
2954 case RC_MAC_LIKE_WORD_MOVEMENT:
2955 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2958 case RC_SHOW_MACRO_LABEL:
2959 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2962 case RC_DATE_INSERT_FORMAT:
2963 //xgettext:no-c-format
2964 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2968 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2971 case RC_DEFAULT_VIEW_FORMAT:
2972 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2975 case RC_DEFAULT_LANGUAGE:
2976 str = _("New documents will be assigned this language.");
2979 case RC_DEFAULT_PAPERSIZE:
2980 str = _("Specify the default paper size.");
2983 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2984 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2987 case RC_DISPLAY_GRAPHICS:
2988 str = _("Select how LyX will display any graphics.");
2991 case RC_DOCUMENTPATH:
2992 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2996 case RC_USE_ESC_CHARS:
2997 str = _("Specify additional chars that can be part of a word.");
3000 case RC_EXAMPLEPATH:
3001 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3004 case RC_FONT_ENCODING:
3005 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3011 case RC_INDEX_COMMAND:
3012 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\".");
3015 case RC_JINDEX_COMMAND:
3016 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3019 case RC_NOMENCL_COMMAND:
3020 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3027 case RC_KBMAP_PRIMARY:
3028 case RC_KBMAP_SECONDARY:
3029 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.");
3032 case RC_LANGUAGE_AUTO_BEGIN:
3033 str = _("Select if a language switching command is needed at the beginning of the document.");
3036 case RC_LANGUAGE_AUTO_END:
3037 str = _("Select if a language switching command is needed at the end of the document.");
3040 case RC_LANGUAGE_COMMAND_BEGIN:
3041 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.");
3044 case RC_LANGUAGE_COMMAND_END:
3045 str = _("The LaTeX command for changing back to the language of the document.");
3048 case RC_LANGUAGE_COMMAND_LOCAL:
3049 str = _("The LaTeX command for local changing of the language.");
3052 case RC_LANGUAGE_GLOBAL_OPTIONS:
3053 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3056 case RC_LANGUAGE_PACKAGE:
3057 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3060 case RC_LANGUAGE_USE_BABEL:
3061 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3064 case RC_USELASTFILEPOS:
3065 str = _("De-select if you do not want LyX to scroll to saved position.");
3068 case RC_LOADSESSION:
3069 str = _("De-select to prevent loading files opened from the last LyX session.");
3072 case RC_MAKE_BACKUP:
3073 str = _("De-select if you don't want LyX to create backup files.");
3076 case RC_MARK_FOREIGN_LANGUAGE:
3077 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3080 case RC_MOUSE_WHEEL_SPEED:
3081 str = bformat(_("The scrolling speed of the mouse wheel."),
3085 case RC_COMPLETION_POPUP_DELAY:
3086 str = _("The completion popup delay.");
3089 case RC_COMPLETION_POPUP_MATH:
3090 str = _("Select to display the completion popup in math mode.");
3093 case RC_COMPLETION_POPUP_TEXT:
3094 str = _("Select to display the completion popup in text mode.");
3097 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3098 str = _("Show the completion popup without delay after non-unique completion attempt.");
3101 case RC_COMPLETION_POPUP_TEXT:
3102 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3105 case RC_COMPLETION_POPUP_DELAY:
3106 str = _("The inline completion delay.");
3109 case RC_COMPLETION_INLINE_MATH:
3110 str = _("Select to display the inline completion in math mode.");
3113 case RC_COMPLETION_INLINE_TEXT:
3114 str = _("Select to display the inline completion in text mode.");
3117 case RC_COMPLETION_INLINE_DOTS:
3118 str = _("Use \"...\" to shorten long completions.");
3121 case RC_AUTOCORRECTION_MATH:
3122 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3125 case RC_NUMLASTFILES:
3126 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3130 case RC_PATH_PREFIX:
3131 str = _("Specify those directories which should be "
3132 "prepended to the PATH environment variable. "
3133 "Use the OS native format.");
3137 str = _("Shows a typeset preview of things such as math");
3140 case RC_PREVIEW_HASHED_LABELS:
3141 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3144 case RC_PREVIEW_SCALE_FACTOR:
3145 str = _("Scale the preview size to suit.");
3148 case RC_PRINTCOLLCOPIESFLAG:
3149 str = _("The option for specifying whether the copies should be collated.");
3152 case RC_PRINTCOPIESFLAG:
3153 str = _("The option for specifying the number of copies to print.");
3157 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3160 case RC_PRINTEVENPAGEFLAG:
3161 str = _("The option to print only even pages.");
3164 case RC_PRINTEXSTRAOPTIONS:
3165 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3168 case RC_PRINTFILEEXTENSION:
3169 str = _("Extension of printer program output file. Usually \".ps\".");
3172 case RC_PRINTLANDSCAPEFLAG:
3173 str = _("The option to print out in landscape.");
3176 case RC_PRINTODDPAGEFLAG:
3177 str = _("The option to print only odd pages.");
3180 case RC_PRINTPAGERANGEFLAG:
3181 str = _("The option for specifying a comma-separated list of pages to print.");
3184 case RC_PRINTPAPERDIMENSIONFLAG:
3185 str = _("Option to specify the dimensions of the print paper.");
3188 case RC_PRINTPAPERFLAG:
3189 str = _("The option to specify paper type.");
3192 case RC_PRINTREVERSEFLAG:
3193 str = _("The option to reverse the order of the pages printed.");
3196 case RC_PRINTSPOOL_COMMAND:
3197 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.");
3200 case RC_PRINTSPOOL_PRINTERPREFIX:
3201 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.");
3204 case RC_PRINTTOFILE:
3205 str = _("Option to pass to the print program to print to a file.");
3208 case RC_PRINTTOPRINTER:
3209 str = _("Option to pass to the print program to print on a specific printer.");
3212 case RC_PRINT_ADAPTOUTPUT:
3213 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3216 case RC_PRINT_COMMAND:
3217 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3220 case RC_RTL_SUPPORT:
3221 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3224 case RC_VISUAL_CURSOR:
3225 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3229 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3232 case RC_SCREEN_FONT_ROMAN:
3233 case RC_SCREEN_FONT_SANS:
3234 case RC_SCREEN_FONT_TYPEWRITER:
3235 str = _("The screen fonts used to display the text while editing.");
3238 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3239 case RC_SCREEN_FONT_SANS_FOUNDRY:
3240 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3243 case RC_SCREEN_FONT_SCALABLE:
3244 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.");
3247 case RC_SCREEN_FONT_SIZES:
3248 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3251 case RC_SCREEN_ZOOM:
3252 //xgettext:no-c-format
3253 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3256 case RC_GEOMETRY_SESSION:
3257 str = _("Allow session manager to save and restore windows geometry.");
3261 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3267 case RC_SHOW_BANNER:
3268 str = _("De-select if you don't want the startup banner.");
3271 case RC_TEMPDIRPATH:
3272 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3275 case RC_THESAURUSDIRPATH:
3276 str = _("This is the place where the files of the thesaurus library reside.");
3279 case RC_TEMPLATEPATH:
3280 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3283 case RC_TEX_ALLOWS_SPACES:
3286 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3290 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3302 case RC_USE_TOOLTIP:
3303 str = _("Enable the automatic appearance of tool tips in the work area.");
3306 case RC_USE_PIXMAP_CACHE:
3307 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3310 case RC_USE_SPELL_LIB:
3313 case RC_VIEWDVI_PAPEROPTION:
3314 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3329 // The global instance
3332 // The global copy of the system lyxrc entries (everything except preferences)