3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
22 #include "Converter.h"
23 #include "FontEnums.h"
30 #include "graphics/GraphicsTypes.h"
32 #include "support/convert.h"
33 #include "support/debug.h"
34 #include "support/environment.h"
35 #include "support/FileName.h"
36 #include "support/filetools.h"
37 #include "support/gettext.h"
38 #include "support/lstrings.h"
39 #include "support/os.h"
40 #include "support/Package.h"
41 #include "support/userinfo.h"
47 using namespace lyx::support;
51 namespace os = support::os;
55 // when adding something to this array keep it sorted!
56 LexerKeyword lyxrcTags[] = {
57 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
58 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
59 { "\\alternate_language", LyXRC::RC_ALT_LANG },
60 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
61 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
62 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
63 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
64 { "\\autosave", LyXRC::RC_AUTOSAVE },
65 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
66 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
67 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
68 { "\\bind_file", LyXRC::RC_BINDFILE },
69 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
70 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
71 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
72 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
73 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
74 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
75 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
76 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
77 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
78 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
79 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
80 { "\\converter", LyXRC::RC_CONVERTER },
81 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
82 { "\\copier", LyXRC::RC_COPIER },
83 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
84 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
85 { "\\def_file", LyXRC::RC_DEFFILE },
86 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
87 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
88 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
89 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
90 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
91 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
92 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
93 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
94 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
95 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
96 { "\\format", LyXRC::RC_FORMAT },
97 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
98 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
99 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
100 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
101 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
102 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
103 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
104 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
105 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
106 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
107 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
108 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
109 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
110 { "\\input", LyXRC::RC_INPUT },
111 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
112 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
113 { "\\kbmap", LyXRC::RC_KBMAP },
114 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
115 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
116 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
117 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
118 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
119 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
120 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
121 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
122 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
123 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
124 { "\\load_session", LyXRC::RC_LOADSESSION },
125 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
126 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
127 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
128 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
129 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
130 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
131 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
132 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
133 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
134 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
135 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
136 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
137 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
138 { "\\preview", LyXRC::RC_PREVIEW },
139 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
140 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
141 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
142 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
143 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
144 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
145 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
146 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
147 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
148 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
149 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
150 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
151 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
152 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
153 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
154 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
155 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
156 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
157 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
158 { "\\printer", LyXRC::RC_PRINTER },
159 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
160 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
161 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
162 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
163 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
164 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
165 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
166 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
167 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
168 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
169 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
170 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
171 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
172 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
173 { "\\set_color", LyXRC::RC_SET_COLOR },
174 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
175 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
176 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
177 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
178 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
179 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
180 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
181 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
182 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
183 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
184 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
185 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
186 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
187 { "\\ui_file", LyXRC::RC_UIFILE },
188 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
189 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
190 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
191 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
192 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
193 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
194 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
195 // compatibility with versions older than 1.4.0 only
196 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
197 // compatibility with versions older than 1.4.0 only
198 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
199 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
200 { "\\user_email", LyXRC::RC_USER_EMAIL },
201 { "\\user_name", LyXRC::RC_USER_NAME },
202 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
203 // compatibility with versions older than 1.4.0 only
204 { "\\viewer", LyXRC::RC_VIEWER},
205 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
206 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
209 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
220 void LyXRC::setDefaults()
223 def_file = "default";
225 // Get printer from the environment. If fail, use default "",
226 // assuming that everything is set up correctly.
227 printer = getEnv("PRINTER");
228 print_adapt_output = false;
229 print_command = "dvips";
230 print_evenpage_flag = "-B";
231 print_oddpage_flag = "-A";
232 print_pagerange_flag = "-pp";
233 print_copies_flag = "-c";
234 print_collcopies_flag = "-C";
235 print_reverse_flag = "-r";
236 print_landscape_flag = "-t landscape";
237 print_to_printer = "-P";
238 print_to_file = "-o ";
239 print_file_extension = ".ps";
240 print_paper_flag = "-t";
241 print_paper_dimension_flag = "-T";
242 document_path.erase();
243 view_dvi_paper_option.erase();
244 default_papersize = PAPER_DEFAULT;
245 default_view_format = "pdf2";
246 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
247 bibtex_command = "bibtex";
249 index_command = "makeindex -c -q";
250 nomencl_command = "makeindex -s nomencl.ist";
252 // Because a screen is typically wider than a piece of paper:
254 allow_geometry_session = true;
255 // Default LaTeX font size:
256 font_sizes[FONT_SIZE_TINY] = "5.0";
257 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
258 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
259 font_sizes[FONT_SIZE_SMALL] = "9.0";
260 font_sizes[FONT_SIZE_NORMAL] = "10.0";
261 font_sizes[FONT_SIZE_LARGE] = "12.0";
262 font_sizes[FONT_SIZE_LARGER] = "14.4";
263 font_sizes[FONT_SIZE_LARGEST] = "17.26";
264 font_sizes[FONT_SIZE_HUGE] = "20.74";
265 font_sizes[FONT_SIZE_HUGER] = "24.88";
266 use_scalable_fonts = true;
267 roman_font_name = "";
269 typewriter_font_name = "";
271 auto_region_delete = true;
272 auto_reset_options = false;
273 plaintext_linelen = 65;
274 mouse_wheel_speed = 1.0;
275 num_lastfiles = maxlastfiles;
276 check_lastfiles = true;
277 use_lastfilepos = true;
278 load_session = false;
280 save_compressed = false;
281 backupdir_path.erase();
282 display_graphics = true;
283 // Spellchecker settings:
284 #if defined(USE_ASPELL)
285 spellchecker = "aspell";
286 #elif defined(USE_HUNSPELL)
287 spellchecker = "hunspell";
289 spellchecker = "aspell";
291 spellchecker_accept_compound = false;
292 spellcheck_continuously = false;
293 spellcheck_notes = true;
296 visual_cursor = false;
298 mark_foreign_language = true;
299 language_auto_begin = true;
300 language_auto_end = true;
301 language_global_options = true;
302 language_use_babel = true;
303 language_package = "\\usepackage{babel}";
304 language_command_begin = "\\selectlanguage{$$lang}";
305 language_command_local = "\\foreignlanguage{$$lang}{";
306 sort_layouts = false;
307 group_layouts = true;
308 default_language = "english";
309 gui_language = "auto";
311 windows_style_tex_paths = false;
312 tex_allows_spaces = false;
313 date_insert_format = "%x";
314 cursor_follows_scrollbar = false;
315 scroll_below_document = false;
316 paragraph_markers = false;
317 mac_like_word_movement = false;
318 macro_edit_style = MACRO_EDIT_INLINE_BOX;
319 dialogs_iconify_with_main = false;
320 preview = PREVIEW_OFF;
321 preview_hashed_labels = false;
322 preview_scale_factor = 1.0;
323 use_converter_cache = true;
325 use_pixmap_cache = false;
326 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
327 user_name = to_utf8(support::user_name());
328 user_email = to_utf8(support::user_email());
329 open_buffers_in_tabs = true;
330 single_close_tab_button = false;
331 forward_search_dvi = "xdvi -sourceposition $$n:$$t $$o";
332 forward_search_pdf = string();
334 // Fullscreen settings
335 full_screen_limit = false;
336 full_screen_toolbars = true;
337 full_screen_tabbar = true;
338 full_screen_menubar = true;
339 full_screen_scrollbar = true;
340 full_screen_width = 700;
342 completion_cursor_text = true;
343 completion_popup_math = true;
344 completion_popup_text = false;
345 completion_popup_delay = 2.0;
346 completion_popup_after_complete = true;
347 autocorrection_math = false;
348 completion_inline_math = true;
349 completion_inline_text = false;
350 completion_inline_dots = -1;
351 completion_inline_delay = 0.2;
357 void oldFontFormat(string & family, string & foundry)
359 if (family.empty() || family[0] != '-')
361 foundry = token(family, '-', 1);
362 family = token(family, '-', 2);
370 int LyXRC::read(FileName const & filename)
372 Lexer lexrc(lyxrcTags);
373 if (lyxerr.debugging(Debug::PARSER))
374 lexrc.printTable(lyxerr);
376 lexrc.setFile(filename);
380 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
386 int LyXRC::read(istream & is)
388 Lexer lexrc(lyxrcTags);
389 if (lyxerr.debugging(Debug::PARSER))
390 lexrc.printTable(lyxerr);
396 LYXERR(Debug::LYXRC, "Reading istream...");
402 int LyXRC::read(Lexer & lexrc)
407 while (lexrc.isOK()) {
408 // By using two switches we take advantage of the compiler
409 // telling us if we have missed a LyXRCTags element in
410 // the second switch.
411 // Note that this also shows a problem with Lexer since it
412 // helps us avoid taking advantage of the strictness of the
415 int le = lexrc.lex();
417 case Lexer::LEX_UNDEF:
418 lexrc.printError("Unknown tag `$$Token'");
420 case Lexer::LEX_FEOF:
425 switch (static_cast<LyXRCTags>(le)) {
426 case RC_INPUT: // Include file
429 libFileSearch(string(),
432 lexrc.printError("Error reading "
433 "included file: " + tmp.absFilename());
439 bind_file = os::internal_path(lexrc.getString());
444 def_file = os::internal_path(lexrc.getString());
449 ui_file = os::internal_path(lexrc.getString());
452 case RC_AUTORESET_OPTIONS:
453 lexrc >> auto_reset_options;
456 case RC_DISPLAY_GRAPHICS:
458 display_graphics = lexrc.getString() == "true";
461 case RC_TEX_EXPECTS_WINDOWS_PATHS:
462 lexrc >> windows_style_tex_paths;
465 case RC_TEX_ALLOWS_SPACES:
466 lexrc >> tex_allows_spaces;
473 case RC_KBMAP_PRIMARY:
475 string const kmap(os::internal_path(lexrc.getString()));
476 if (!libFileSearch("kbd", kmap, "kmap").empty()
478 primary_kbmap = kmap;
480 lexrc.printError("LyX: Keymap `$$Token' not found");
485 case RC_KBMAP_SECONDARY:
487 string const kmap(os::internal_path(lexrc.getString()));
488 if (!libFileSearch("kbd", kmap, "kmap").empty()
490 secondary_kbmap = kmap;
492 lexrc.printError("LyX: Keymap `$$Token' not found");
497 case RC_FONT_ENCODING:
505 case RC_PRINT_COMMAND:
506 if (lexrc.next(true)) {
507 print_command = lexrc.getString();
511 case RC_PRINTEVENPAGEFLAG:
512 lexrc >> print_evenpage_flag;
515 case RC_PRINTODDPAGEFLAG:
516 lexrc >> print_oddpage_flag;
519 case RC_PRINTPAGERANGEFLAG:
520 lexrc >> print_pagerange_flag;
523 case RC_PRINTCOPIESFLAG:
524 lexrc >> print_copies_flag;
527 case RC_PRINTCOLLCOPIESFLAG:
528 lexrc >> print_collcopies_flag;
531 case RC_PRINTREVERSEFLAG:
532 lexrc >> print_reverse_flag;
535 case RC_PRINTLANDSCAPEFLAG:
536 lexrc >> print_landscape_flag;
539 case RC_PRINTTOPRINTER:
540 lexrc >> print_to_printer;
543 case RC_PRINT_ADAPTOUTPUT:
544 lexrc >> print_adapt_output;
549 print_to_file = os::internal_path(lexrc.getString());
553 case RC_PRINTFILEEXTENSION:
554 lexrc >> print_file_extension;
557 case RC_PRINTEXSTRAOPTIONS:
558 lexrc >> print_extra_options;
561 case RC_PRINTSPOOL_COMMAND:
562 if (lexrc.next(true)) {
563 print_spool_command = lexrc.getString();
567 case RC_PRINTSPOOL_PRINTERPREFIX:
568 lexrc >> print_spool_printerprefix;
571 case RC_PRINTPAPERDIMENSIONFLAG:
572 lexrc >> print_paper_dimension_flag;
575 case RC_PRINTPAPERFLAG:
576 lexrc >> print_paper_flag;
579 case RC_DEFAULT_PAPERSIZE:
581 string const size = ascii_lowercase(lexrc.getString());
582 if (size == "usletter")
583 default_papersize = PAPER_USLETTER;
584 else if (size == "legal")
585 default_papersize = PAPER_USLEGAL;
586 else if (size == "executive")
587 default_papersize = PAPER_USEXECUTIVE;
588 else if (size == "a3")
589 default_papersize = PAPER_A3;
590 else if (size == "a4")
591 default_papersize = PAPER_A4;
592 else if (size == "a5")
593 default_papersize = PAPER_A5;
594 else if (size == "b5")
595 default_papersize = PAPER_B5;
596 else if (size == "default")
597 default_papersize = PAPER_DEFAULT;
601 case RC_VIEWDVI_PAPEROPTION:
603 view_dvi_paper_option = lexrc.getString();
605 view_dvi_paper_option.erase();
608 case RC_CHKTEX_COMMAND:
609 if (lexrc.next(true)) {
610 chktex_command = lexrc.getString();
614 case RC_BIBTEX_ALTERNATIVES:
615 if (lexrc.next(true)) {
616 bibtex_alternatives.insert(lexrc.getString());
620 case RC_BIBTEX_COMMAND:
621 if (lexrc.next(true)) {
622 bibtex_command = lexrc.getString();
626 case RC_JBIBTEX_COMMAND:
627 if (lexrc.next(true)) {
628 jbibtex_command = lexrc.getString();
632 case RC_INDEX_ALTERNATIVES:
633 if (lexrc.next(true)) {
634 index_alternatives.insert(lexrc.getString());
638 case RC_INDEX_COMMAND:
639 if (lexrc.next(true)) {
640 index_command = lexrc.getString();
644 case RC_JINDEX_COMMAND:
645 if (lexrc.next(true)) {
646 jindex_command = lexrc.getString();
650 case RC_SPLITINDEX_COMMAND:
651 if (lexrc.next(true)) {
652 splitindex_command = lexrc.getString();
656 case RC_NOMENCL_COMMAND:
657 if (lexrc.next(true)) {
658 nomencl_command = lexrc.getString();
670 case RC_GEOMETRY_SESSION:
671 lexrc >> allow_geometry_session;
674 case RC_SCREEN_FONT_SIZES:
675 lexrc >> font_sizes[FONT_SIZE_TINY];
676 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
677 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
678 lexrc >> font_sizes[FONT_SIZE_SMALL];
679 lexrc >> font_sizes[FONT_SIZE_NORMAL];
680 lexrc >> font_sizes[FONT_SIZE_LARGE];
681 lexrc >> font_sizes[FONT_SIZE_LARGER];
682 lexrc >> font_sizes[FONT_SIZE_LARGEST];
683 lexrc >> font_sizes[FONT_SIZE_HUGE];
684 lexrc >> font_sizes[FONT_SIZE_HUGER];
687 case RC_SCREEN_FONT_SCALABLE:
688 lexrc >> use_scalable_fonts;
695 case RC_DOCUMENTPATH:
697 document_path = os::internal_path(lexrc.getString());
698 document_path = expandPath(document_path);
704 example_path = os::internal_path(lexrc.getString());
705 example_path = expandPath(example_path);
709 case RC_TEMPLATEPATH:
711 template_path = os::internal_path(lexrc.getString());
712 template_path = expandPath(template_path);
718 tempdir_path = os::internal_path(lexrc.getString());
719 tempdir_path = expandPath(tempdir_path);
723 case RC_THESAURUSDIRPATH:
725 thesaurusdir_path = os::internal_path(lexrc.getString());
726 thesaurusdir_path = expandPath(thesaurusdir_path);
730 case RC_HUNSPELLDIR_PATH:
732 hunspelldir_path = os::internal_path(lexrc.getString());
733 hunspelldir_path = expandPath(hunspelldir_path);
737 case RC_USELASTFILEPOS:
738 lexrc >> use_lastfilepos;
742 lexrc >> load_session;
745 case RC_MOUSE_WHEEL_SPEED:
746 lexrc >> mouse_wheel_speed;
749 case RC_COMPLETION_INLINE_DELAY:
750 lexrc >> completion_inline_delay;
753 case RC_COMPLETION_INLINE_MATH:
754 lexrc >> completion_inline_math;
757 case RC_COMPLETION_INLINE_TEXT:
758 lexrc >> completion_inline_text;
761 case RC_COMPLETION_INLINE_DOTS:
762 lexrc >> completion_inline_dots;
765 case RC_AUTOCORRECTION_MATH:
766 lexrc >> autocorrection_math;
769 case RC_COMPLETION_POPUP_DELAY:
770 lexrc >> completion_popup_delay;
773 case RC_COMPLETION_POPUP_MATH:
774 lexrc >> completion_popup_math;
777 case RC_COMPLETION_POPUP_TEXT:
778 lexrc >> completion_popup_text;
781 case RC_COMPLETION_CURSOR_TEXT:
782 lexrc >> completion_cursor_text;
785 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
786 lexrc >> completion_popup_after_complete;
789 case RC_NUMLASTFILES:
790 lexrc >> num_lastfiles;
793 case RC_CHECKLASTFILES:
794 lexrc >> check_lastfiles;
797 case RC_SCREEN_FONT_ROMAN:
799 roman_font_name = lexrc.getString();
800 oldFontFormat(roman_font_name,
805 case RC_SCREEN_FONT_SANS:
807 sans_font_name = lexrc.getString();
808 oldFontFormat(sans_font_name, sans_font_foundry);
812 case RC_SCREEN_FONT_TYPEWRITER:
814 typewriter_font_name = lexrc.getString();
815 oldFontFormat(typewriter_font_name,
816 typewriter_font_foundry);
820 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
821 lexrc >> roman_font_foundry;
824 case RC_SCREEN_FONT_SANS_FOUNDRY:
825 lexrc >> sans_font_foundry;
828 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
829 lexrc >> typewriter_font_foundry;
834 lexrc.printError("Missing color tag.");
837 string lyx_name = lexrc.getString();
840 lexrc.printError("Missing color name for color: `$$Token'");
843 string x11_name = lexrc.getString();
845 ColorCode const col =
846 lcolor.getFromLyXName(lyx_name);
847 if (col == Color_none ||
848 col == Color_inherit ||
852 if (!lcolor.setColor(col, x11_name))
853 LYXERR0("Bad lyxrc set_color for " << lyx_name);
857 case RC_AUTOREGIONDELETE:
858 // Auto region delete defaults to true
859 lexrc >> auto_region_delete;
864 lyxpipes = os::internal_path(lexrc.getString());
865 lyxpipes = expandPath(lyxpipes);
869 case RC_CURSOR_FOLLOWS_SCROLLBAR:
870 lexrc >> cursor_follows_scrollbar;
873 case RC_SCROLL_BELOW_DOCUMENT:
874 lexrc >> scroll_below_document;
877 case RC_PARAGRAPH_MARKERS:
878 lexrc >> paragraph_markers;
881 case RC_MAC_LIKE_WORD_MOVEMENT:
882 lexrc >> mac_like_word_movement;
885 case RC_MACRO_EDIT_STYLE:
887 switch (lexrc.getInteger()) {
888 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
889 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
890 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
895 case RC_DIALOGS_ICONIFY_WITH_MAIN:
896 lexrc >> dialogs_iconify_with_main;
899 case RC_PLAINTEXT_LINELEN:
900 lexrc >> plaintext_linelen;
902 // Spellchecker settings:
903 case RC_ACCEPT_COMPOUND:
904 lexrc >> spellchecker_accept_compound;
907 lexrc >> use_tooltip;
909 case RC_USE_PIXMAP_CACHE:
910 lexrc >> use_pixmap_cache;
912 case RC_SPELLCHECKER:
913 lexrc >> spellchecker;
916 lexrc >> spellchecker_alt_lang;
919 lexrc >> spellchecker_esc_chars;
921 case RC_SPELLCHECK_CONTINUOUSLY:
922 lexrc >> spellcheck_continuously;
924 case RC_SPELLCHECK_NOTES:
925 lexrc >> spellcheck_notes;
928 lexrc >> make_backup;
930 case RC_SAVE_COMPRESSED:
931 lexrc >> save_compressed;
933 case RC_BACKUPDIR_PATH:
935 backupdir_path = os::internal_path(lexrc.getString());
936 backupdir_path = expandPath(backupdir_path);
939 case RC_DATE_INSERT_FORMAT:
940 lexrc >> date_insert_format;
942 case RC_LANGUAGE_PACKAGE:
943 lexrc >> language_package;
945 case RC_LANGUAGE_AUTO_BEGIN:
946 lexrc >> language_auto_begin;
948 case RC_LANGUAGE_AUTO_END:
949 lexrc >> language_auto_end;
951 case RC_LANGUAGE_GLOBAL_OPTIONS:
952 lexrc >> language_global_options;
954 case RC_LANGUAGE_USE_BABEL:
955 lexrc >> language_use_babel;
957 case RC_LANGUAGE_COMMAND_BEGIN:
958 lexrc >> language_command_begin;
960 case RC_LANGUAGE_COMMAND_END:
961 lexrc >> language_command_end;
963 case RC_LANGUAGE_COMMAND_LOCAL:
964 lexrc >> language_command_local;
967 lexrc >> rtl_support;
969 case RC_VISUAL_CURSOR:
970 lexrc >> visual_cursor;
973 lexrc >> auto_number;
975 case RC_MARK_FOREIGN_LANGUAGE:
976 lexrc >> mark_foreign_language;
982 fmt = lexrc.getString();
983 if (lexrc.next(true))
984 command = lexrc.getString();
985 setMover(fmt, command);
990 string from, to, command, flags;
992 from = lexrc.getString();
994 to = lexrc.getString();
995 if (lexrc.next(true))
996 command = lexrc.getString();
998 flags = lexrc.getString();
1000 theConverters().erase(from, to);
1002 theConverters().add(from, to, command, flags);
1005 // compatibility with versions older than 1.4.0 only
1007 string format, command;
1008 lexrc >> format >> command;
1009 formats.setViewer(format, command);
1013 string format, extension, prettyname, shortcut;
1014 lexrc >> format >> extension >> prettyname >> shortcut;
1015 string viewer, editor;
1016 if (lexrc.next(true))
1017 viewer = lexrc.getString();
1018 if (lexrc.next(true))
1019 editor = lexrc.getString();
1021 // Hack to ensure compatibility with versions older
1023 int le = lexrc.lex();
1024 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1025 flags = lexrc.getString();
1026 if (le != Lexer::LEX_DATA) {
1027 // We have got a known token.
1028 // Therefore this is an old style
1029 // format definition without
1031 lexrc.pushToken(flags);
1035 int flgs = Format::none;
1036 while (!flags.empty()) {
1038 flags = split(flags, flag, ',');
1039 if (flag == "document")
1040 flgs |= Format::document;
1041 else if (flag == "vector")
1042 flgs |= Format::vector;
1044 LYXERR0("Ignoring unknown flag `"
1045 << flag << "' for format `"
1048 if (prettyname.empty()) {
1049 if (theConverters().formatIsUsed(format))
1050 LYXERR0("Can't delete format " << format);
1052 formats.erase(format);
1054 formats.add(format, extension, prettyname,
1055 shortcut, viewer, editor, flgs);
1059 case RC_VIEWER_ALTERNATIVES: {
1060 string format, command;
1062 format = lexrc.getString();
1063 if (lexrc.eatLine())
1064 command = lexrc.getString();
1065 viewer_alternatives[format].insert(command);
1068 case RC_EDITOR_ALTERNATIVES: {
1069 string format, command;
1070 lexrc >> format >> command;
1071 editor_alternatives[format].insert(command);
1075 case RC_DEFAULT_VIEW_FORMAT:
1076 lexrc >> default_view_format;
1079 case RC_DEFAULT_LANGUAGE:
1080 lexrc >> default_language;
1083 case RC_GUI_LANGUAGE:
1084 lexrc >> gui_language;
1087 case RC_SHOW_BANNER:
1088 lexrc >> show_banner;
1093 string const tmp = lexrc.getString();
1094 if (tmp == "true" || tmp == "on")
1095 preview = PREVIEW_ON;
1096 else if (tmp == "no_math")
1097 preview = PREVIEW_NO_MATH;
1099 preview = PREVIEW_OFF;
1100 if (tmp != "false" && tmp != "off")
1101 LYXERR0("Unrecognized preview status \""
1107 case RC_PREVIEW_HASHED_LABELS:
1108 lexrc >> preview_hashed_labels;
1111 case RC_PREVIEW_SCALE_FACTOR:
1112 lexrc >> preview_scale_factor;
1119 lexrc >> user_email;
1122 case RC_PATH_PREFIX:
1123 lexrc >> path_prefix;
1126 case RC_USE_CONVERTER_CACHE:
1127 lexrc >> use_converter_cache;
1129 case RC_CONVERTER_CACHE_MAXAGE:
1130 lexrc >> converter_cache_maxage;
1133 case RC_SORT_LAYOUTS:
1134 lexrc >> sort_layouts;
1136 case RC_GROUP_LAYOUTS:
1137 lexrc >> group_layouts;
1139 case RC_FULL_SCREEN_LIMIT:
1140 lexrc >> full_screen_limit;
1142 case RC_FULL_SCREEN_TOOLBARS:
1143 lexrc >> full_screen_toolbars;
1145 case RC_FULL_SCREEN_SCROLLBAR:
1146 lexrc >> full_screen_scrollbar;
1148 case RC_FULL_SCREEN_TABBAR:
1149 lexrc >> full_screen_tabbar;
1151 case RC_FULL_SCREEN_MENUBAR:
1152 lexrc >> full_screen_menubar;
1154 case RC_FULL_SCREEN_WIDTH:
1155 lexrc >> full_screen_width;
1157 case RC_OPEN_BUFFERS_IN_TABS:
1158 lexrc >> open_buffers_in_tabs;
1160 case RC_SINGLE_CLOSE_TAB_BUTTON:
1161 lexrc >> single_close_tab_button;
1163 case RC_FORWARD_SEARCH_DVI:
1164 if (lexrc.next(true))
1165 forward_search_dvi = lexrc.getString();
1167 case RC_FORWARD_SEARCH_PDF:
1168 if (lexrc.next(true))
1169 forward_search_pdf = lexrc.getString();
1172 // Obsoteted in 1.4.0
1175 case RC_SPELL_COMMAND:
1177 case RC_PLAINTEXT_ROFF_COMMAND:
1178 case RC_USE_ALT_LANG:
1179 case RC_USE_ESC_CHARS:
1180 case RC_USE_INP_ENC:
1181 case RC_USE_PERS_DICT:
1182 case RC_USE_SPELL_LIB:
1183 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1184 << lexrc.getString() << "'.");
1189 break; // this is just a dummy
1193 /// Update converters data-structures
1194 theConverters().update(formats);
1195 theConverters().buildGraph();
1201 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1203 ofstream ofs(filename.toFilesystemEncoding().c_str());
1205 write(ofs, ignore_system_lyxrc);
1209 void LyXRC::print() const
1211 if (lyxerr.debugging())
1212 write(lyxerr, false);
1220 typedef pair<string, SpecialisedMover> Data;
1222 SameMover(Data const & comparison)
1223 : comparison_(comparison) {}
1225 bool operator()(Data const & data) const
1227 return data.first == comparison_.first &&
1228 data.second.command() == comparison_.second.command();
1238 // Escape \ and " so that LyXLex can read the string later
1239 string escapeCommand(string const & str) {
1240 return subst(subst(str , "\\", "\\\\"),
1247 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1249 LyXRCTags tag = RC_LAST;
1251 if (!name.empty()) {
1252 for (int i = 0; i != lyxrcCount; ++i)
1253 if ("\\" + name == lyxrcTags[i].tag)
1254 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1258 os << "# LyX " << lyx_version
1259 << " generated this file. If you want to make your own\n"
1260 << "# modifications you should do them from inside LyX and save.\n"
1263 // Why the switch you might ask. It is a trick to ensure that all
1264 // the elements in the LyXRCTags enum are handled. As you can see
1265 // there are no breaks at all. So it is just a huge fall-through.
1266 // The nice thing is that we will get a warning from the compiler
1267 // if we forget an element.
1271 // input/include files are not done here
1273 if (ignore_system_lyxrc ||
1274 bind_file != system_lyxrc.bind_file) {
1275 string const path = os::external_path(bind_file);
1276 os << "\\bind_file \"" << path << "\"\n";
1282 if (ignore_system_lyxrc ||
1283 def_file != system_lyxrc.def_file) {
1284 string const path = os::external_path(def_file);
1285 os << "\\def_file \"" << path << "\"\n";
1294 << "# MISC SECTION ######################################\n"
1296 // bind files are not done here.
1298 case RC_PATH_PREFIX:
1299 if (ignore_system_lyxrc ||
1300 path_prefix != system_lyxrc.path_prefix) {
1301 os << "\\path_prefix \"" << path_prefix << "\"\n";
1306 if (ignore_system_lyxrc ||
1307 ui_file != system_lyxrc.ui_file) {
1308 string const path = os::external_path(ui_file);
1309 os << "\\ui_file \"" << path << "\"\n";
1313 case RC_AUTOREGIONDELETE:
1314 if (ignore_system_lyxrc ||
1315 auto_region_delete != system_lyxrc.auto_region_delete) {
1316 os << "# Set to false to inhibit automatic replacement of\n"
1317 << "# the current selection.\n"
1318 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1323 case RC_AUTORESET_OPTIONS:
1324 if (ignore_system_lyxrc ||
1325 auto_reset_options != system_lyxrc.auto_reset_options) {
1326 os << "# Set to false to inhibit automatic reset of\n"
1327 << "# the class options to defaults on class change.\n"
1328 << "\\auto_reset_options "
1329 << convert<string>(auto_reset_options)
1335 if (ignore_system_lyxrc ||
1336 autosave != system_lyxrc.autosave) {
1337 os << "# The time interval between auto-saves in seconds.\n"
1338 << "\\autosave " << autosave << '\n';
1342 case RC_DISPLAY_GRAPHICS:
1343 if (ignore_system_lyxrc ||
1344 display_graphics != system_lyxrc.display_graphics) {
1345 os << "# Display graphics within LyX\n"
1347 << "\\display_graphics "
1348 << (display_graphics ? "true" : "false")
1353 case RC_SORT_LAYOUTS:
1354 if (ignore_system_lyxrc ||
1355 sort_layouts != system_lyxrc.sort_layouts) {
1356 os << "# Sort layouts alphabetically.\n"
1357 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1361 case RC_GROUP_LAYOUTS:
1362 if (ignore_system_lyxrc ||
1363 group_layouts != system_lyxrc.group_layouts) {
1364 os << "# Group layouts by their category.\n"
1365 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1369 case RC_VIEWDVI_PAPEROPTION:
1370 if (ignore_system_lyxrc ||
1371 view_dvi_paper_option
1372 != system_lyxrc.view_dvi_paper_option) {
1373 os << "# Options used to specify paper size to the\n"
1374 << "# view_dvi_command (e.g. -paper)\n"
1375 << "\\view_dvi_paper_option \""
1376 << view_dvi_paper_option << "\"\n";
1380 case RC_DEFAULT_PAPERSIZE:
1381 if (ignore_system_lyxrc ||
1382 default_papersize != system_lyxrc.default_papersize) {
1383 os << "# The default papersize to use.\n"
1384 << "\\default_papersize \"";
1385 switch (default_papersize) {
1387 os << "default"; break;
1388 case PAPER_USLETTER:
1389 os << "usletter"; break;
1391 os << "legal"; break;
1392 case PAPER_USEXECUTIVE:
1393 os << "executive"; break;
1404 case PAPER_B4: break;
1410 case RC_CHKTEX_COMMAND:
1411 if (ignore_system_lyxrc ||
1412 chktex_command != system_lyxrc.chktex_command) {
1413 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1417 case RC_BIBTEX_ALTERNATIVES: {
1418 CommandSet::const_iterator it = bibtex_alternatives.begin();
1419 CommandSet::const_iterator end = bibtex_alternatives.end();
1420 for ( ; it != end; ++it) {
1421 if (ignore_system_lyxrc
1422 || !system_lyxrc.bibtex_alternatives.count(*it))
1423 os << "\\bibtex_alternatives \""
1429 case RC_BIBTEX_COMMAND:
1430 if (ignore_system_lyxrc ||
1431 bibtex_command != system_lyxrc.bibtex_command) {
1432 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1436 case RC_JBIBTEX_COMMAND:
1437 if (ignore_system_lyxrc ||
1438 jbibtex_command != system_lyxrc.jbibtex_command) {
1439 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1443 case RC_INDEX_ALTERNATIVES: {
1444 CommandSet::const_iterator it = index_alternatives.begin();
1445 CommandSet::const_iterator end = index_alternatives.end();
1446 for ( ; it != end; ++it) {
1447 if (ignore_system_lyxrc
1448 || !system_lyxrc.index_alternatives.count(*it))
1449 os << "\\index_alternatives \""
1455 case RC_INDEX_COMMAND:
1456 if (ignore_system_lyxrc ||
1457 index_command != system_lyxrc.index_command) {
1458 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1462 case RC_JINDEX_COMMAND:
1463 if (ignore_system_lyxrc ||
1464 jindex_command != system_lyxrc.jindex_command) {
1465 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1469 case RC_SPLITINDEX_COMMAND:
1470 if (ignore_system_lyxrc ||
1471 splitindex_command != system_lyxrc.splitindex_command) {
1472 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1476 case RC_NOMENCL_COMMAND:
1477 if (ignore_system_lyxrc ||
1478 nomencl_command != system_lyxrc.nomencl_command) {
1479 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1483 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1484 if (ignore_system_lyxrc ||
1485 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1486 os << "\\tex_expects_windows_paths "
1487 << convert<string>(windows_style_tex_paths) << '\n';
1491 case RC_TEX_ALLOWS_SPACES:
1492 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1493 os << "\\tex_allows_spaces "
1494 << convert<string>(tex_allows_spaces) << '\n';
1499 if (ignore_system_lyxrc ||
1500 use_kbmap != system_lyxrc.use_kbmap) {
1501 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1505 case RC_KBMAP_PRIMARY:
1506 if (ignore_system_lyxrc ||
1507 primary_kbmap != system_lyxrc.primary_kbmap) {
1508 string const path = os::external_path(primary_kbmap);
1509 os << "\\kbmap_primary \"" << path << "\"\n";
1513 case RC_KBMAP_SECONDARY:
1514 if (ignore_system_lyxrc ||
1515 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1516 string const path = os::external_path(secondary_kbmap);
1517 os << "\\kbmap_secondary \"" << path << "\"\n";
1522 if (ignore_system_lyxrc ||
1523 lyxpipes != system_lyxrc.lyxpipes) {
1524 string const path = os::external_path(lyxpipes);
1525 os << "\\serverpipe \"" << path << "\"\n";
1529 case RC_DATE_INSERT_FORMAT:
1530 if (ignore_system_lyxrc ||
1531 date_insert_format != system_lyxrc.date_insert_format) {
1532 os << "\\date_insert_format \"" << date_insert_format
1539 os << "\\user_name \"" << user_name << "\"\n";
1544 os << "\\user_email \"" << user_email << "\"\n";
1548 case RC_SHOW_BANNER:
1549 if (ignore_system_lyxrc ||
1550 show_banner != system_lyxrc.show_banner) {
1551 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1557 if (ignore_system_lyxrc ||
1558 preview != system_lyxrc.preview) {
1564 case PREVIEW_NO_MATH:
1571 os << "\\preview " << status << '\n';
1576 case RC_PREVIEW_HASHED_LABELS:
1577 if (ignore_system_lyxrc ||
1578 preview_hashed_labels !=
1579 system_lyxrc.preview_hashed_labels) {
1580 os << "\\preview_hashed_labels "
1581 << convert<string>(preview_hashed_labels) << '\n';
1586 case RC_PREVIEW_SCALE_FACTOR:
1587 if (ignore_system_lyxrc ||
1588 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1589 os << "\\preview_scale_factor "
1590 << preview_scale_factor << '\n';
1595 case RC_USE_CONVERTER_CACHE:
1596 if (ignore_system_lyxrc ||
1597 use_converter_cache != system_lyxrc.use_converter_cache) {
1598 os << "\\use_converter_cache "
1599 << convert<string>(use_converter_cache) << '\n';
1604 case RC_CONVERTER_CACHE_MAXAGE:
1605 if (ignore_system_lyxrc ||
1606 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1607 os << "\\converter_cache_maxage "
1608 << converter_cache_maxage << '\n';
1614 << "# SCREEN & FONTS SECTION ############################\n"
1618 if (ignore_system_lyxrc ||
1619 dpi != system_lyxrc.dpi) {
1620 os << "\\screen_dpi " << dpi << '\n';
1624 case RC_SCREEN_ZOOM:
1625 if (ignore_system_lyxrc ||
1626 zoom != system_lyxrc.zoom) {
1627 os << "\\screen_zoom " << zoom << '\n';
1631 case RC_GEOMETRY_SESSION:
1632 if (ignore_system_lyxrc ||
1633 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1634 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1639 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1640 if (ignore_system_lyxrc ||
1641 cursor_follows_scrollbar
1642 != system_lyxrc.cursor_follows_scrollbar) {
1643 os << "\\cursor_follows_scrollbar "
1644 << convert<string>(cursor_follows_scrollbar) << '\n';
1648 case RC_SCROLL_BELOW_DOCUMENT:
1649 if (ignore_system_lyxrc ||
1650 scroll_below_document
1651 != system_lyxrc.scroll_below_document) {
1652 os << "\\scroll_below_document "
1653 << convert<string>(scroll_below_document) << '\n';
1657 case RC_PARAGRAPH_MARKERS:
1658 if (ignore_system_lyxrc ||
1660 != system_lyxrc.paragraph_markers) {
1661 os << "\\paragraph_markers "
1662 << convert<string>(paragraph_markers) << '\n';
1666 case RC_MAC_LIKE_WORD_MOVEMENT:
1667 if (ignore_system_lyxrc ||
1668 mac_like_word_movement
1669 != system_lyxrc.mac_like_word_movement) {
1670 os << "\\mac_like_word_movement "
1671 << convert<string>(mac_like_word_movement) << '\n';
1675 case RC_MACRO_EDIT_STYLE:
1676 if (ignore_system_lyxrc ||
1678 != system_lyxrc.macro_edit_style) {
1679 os << "\\macro_edit_style ";
1680 switch (macro_edit_style) {
1681 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1682 case MACRO_EDIT_INLINE: os << "1\n"; break;
1683 case MACRO_EDIT_LIST: os << "2\n"; break;
1688 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1689 if (ignore_system_lyxrc ||
1690 dialogs_iconify_with_main
1691 != system_lyxrc.dialogs_iconify_with_main) {
1692 os << "\\dialogs_iconify_with_main "
1693 << convert<string>(dialogs_iconify_with_main) << '\n';
1697 case RC_SCREEN_FONT_ROMAN:
1698 if (ignore_system_lyxrc ||
1699 roman_font_name != system_lyxrc.roman_font_name) {
1700 os << "\\screen_font_roman \"" << roman_font_name
1705 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1706 if (ignore_system_lyxrc ||
1707 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1708 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1713 case RC_SCREEN_FONT_SANS:
1714 if (ignore_system_lyxrc ||
1715 sans_font_name != system_lyxrc.sans_font_name) {
1716 os << "\\screen_font_sans \"" << sans_font_name
1721 case RC_SCREEN_FONT_SANS_FOUNDRY:
1722 if (ignore_system_lyxrc ||
1723 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1724 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1729 case RC_SCREEN_FONT_TYPEWRITER:
1730 if (ignore_system_lyxrc ||
1731 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1732 os << "\\screen_font_typewriter \""
1733 << typewriter_font_name << "\"\n";
1737 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1738 if (ignore_system_lyxrc ||
1739 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1740 os << "\\screen_font_typewriter_foundry \""
1741 << typewriter_font_foundry << "\"\n";
1746 case RC_SCREEN_FONT_SCALABLE:
1747 if (ignore_system_lyxrc ||
1748 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1749 os << "\\screen_font_scalable "
1750 << convert<string>(use_scalable_fonts)
1755 case RC_SCREEN_FONT_SIZES:
1756 if (ignore_system_lyxrc ||
1757 font_sizes[FONT_SIZE_TINY]
1758 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1759 font_sizes[FONT_SIZE_SCRIPT]
1760 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1761 font_sizes[FONT_SIZE_FOOTNOTE]
1762 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1763 font_sizes[FONT_SIZE_SMALL]
1764 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1765 font_sizes[FONT_SIZE_NORMAL]
1766 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1767 font_sizes[FONT_SIZE_LARGE]
1768 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1769 font_sizes[FONT_SIZE_LARGER]
1770 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1771 font_sizes[FONT_SIZE_LARGEST]
1772 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1773 font_sizes[FONT_SIZE_HUGE]
1774 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1775 font_sizes[FONT_SIZE_HUGER]
1776 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1777 os.setf(ios::fixed);
1779 os << "\\screen_font_sizes"
1780 << ' ' << font_sizes[FONT_SIZE_TINY]
1781 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1782 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1783 << ' ' << font_sizes[FONT_SIZE_SMALL]
1784 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1785 << ' ' << font_sizes[FONT_SIZE_LARGE]
1786 << ' ' << font_sizes[FONT_SIZE_LARGER]
1787 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1788 << ' ' << font_sizes[FONT_SIZE_HUGE]
1789 << ' ' << font_sizes[FONT_SIZE_HUGER]
1794 case RC_FULL_SCREEN_LIMIT:
1795 if (ignore_system_lyxrc ||
1796 full_screen_limit != system_lyxrc.full_screen_limit) {
1797 os << "\\fullscreen_limit "
1798 << convert<string>(full_screen_limit)
1803 case RC_FULL_SCREEN_TOOLBARS:
1804 if (ignore_system_lyxrc ||
1805 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1806 os << "\\fullscreen_toolbars "
1807 << convert<string>(full_screen_toolbars)
1812 case RC_FULL_SCREEN_SCROLLBAR:
1813 if (ignore_system_lyxrc ||
1814 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1815 os << "\\fullscreen_scrollbar "
1816 << convert<string>(full_screen_scrollbar)
1821 case RC_FULL_SCREEN_TABBAR:
1822 if (ignore_system_lyxrc ||
1823 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1824 os << "\\fullscreen_tabbar "
1825 << convert<string>(full_screen_tabbar)
1830 case RC_FULL_SCREEN_MENUBAR:
1831 if (ignore_system_lyxrc ||
1832 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1833 os << "\\fullscreen_menubar "
1834 << convert<string>(full_screen_menubar)
1839 case RC_FULL_SCREEN_WIDTH:
1840 if (ignore_system_lyxrc ||
1841 full_screen_width != system_lyxrc.full_screen_width) {
1842 os << "\\fullscreen_width "
1843 << convert<string>(full_screen_width)
1848 case RC_OPEN_BUFFERS_IN_TABS:
1849 if (ignore_system_lyxrc ||
1850 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1851 os << "\\open_buffers_in_tabs "
1852 << convert<string>(open_buffers_in_tabs)
1857 case RC_SINGLE_CLOSE_TAB_BUTTON:
1858 if (ignore_system_lyxrc ||
1859 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1860 os << "\\single_close_tab_button "
1861 << convert<string>(single_close_tab_button)
1866 case RC_FORWARD_SEARCH_DVI:
1867 if (ignore_system_lyxrc ||
1868 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1869 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1873 case RC_FORWARD_SEARCH_PDF:
1874 if (ignore_system_lyxrc ||
1875 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1876 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1882 << "# COLOR SECTION ###################################\n"
1886 for (int i = 0; i < Color_ignore; ++i) {
1887 ColorCode lc = static_cast<ColorCode>(i);
1888 string const col = lcolor.getX11Name(lc);
1889 if (ignore_system_lyxrc
1890 || col != system_lcolor.getX11Name(lc)) {
1891 os << "\\set_color \""
1892 << lcolor.getLyXName(lc) << "\" \""
1900 << "# PRINTER SECTION ###################################\n"
1904 if (ignore_system_lyxrc ||
1905 printer != system_lyxrc.printer) {
1906 os << "\\printer \"" << printer << "\"\n";
1910 case RC_PRINT_ADAPTOUTPUT:
1911 if (ignore_system_lyxrc ||
1912 print_adapt_output != system_lyxrc.print_adapt_output) {
1913 os << "\\print_adapt_output "
1914 << convert<string>(print_adapt_output)
1919 case RC_PRINT_COMMAND:
1920 if (ignore_system_lyxrc ||
1921 print_command != system_lyxrc.print_command) {
1922 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1926 case RC_PRINTEXSTRAOPTIONS:
1927 if (ignore_system_lyxrc ||
1928 print_extra_options != system_lyxrc.print_extra_options) {
1929 os << "\\print_extra_options \"" << print_extra_options
1934 case RC_PRINTSPOOL_COMMAND:
1935 if (ignore_system_lyxrc ||
1936 print_spool_command != system_lyxrc.print_spool_command) {
1937 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1942 case RC_PRINTSPOOL_PRINTERPREFIX:
1943 if (ignore_system_lyxrc ||
1944 print_spool_printerprefix
1945 != system_lyxrc.print_spool_printerprefix) {
1946 os << "\\print_spool_printerprefix \""
1947 << print_spool_printerprefix << "\"\n";
1951 case RC_PRINTEVENPAGEFLAG:
1952 if (ignore_system_lyxrc ||
1953 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1954 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1959 case RC_PRINTODDPAGEFLAG:
1960 if (ignore_system_lyxrc ||
1961 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1962 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1967 case RC_PRINTREVERSEFLAG:
1968 if (ignore_system_lyxrc ||
1969 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1970 os << "\\print_reverse_flag \"" << print_reverse_flag
1975 case RC_PRINTLANDSCAPEFLAG:
1976 if (ignore_system_lyxrc ||
1977 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1978 os << "\\print_landscape_flag \"" << print_landscape_flag
1983 case RC_PRINTPAGERANGEFLAG:
1984 if (ignore_system_lyxrc ||
1985 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1986 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1991 case RC_PRINTCOPIESFLAG:
1992 if (ignore_system_lyxrc ||
1993 print_copies_flag != system_lyxrc.print_copies_flag) {
1994 os << "\\print_copies_flag \"" << print_copies_flag
1999 case RC_PRINTCOLLCOPIESFLAG:
2000 if (ignore_system_lyxrc ||
2001 print_collcopies_flag
2002 != system_lyxrc.print_collcopies_flag) {
2003 os << "\\print_collcopies_flag \""
2004 << print_collcopies_flag
2009 case RC_PRINTPAPERFLAG:
2010 if (ignore_system_lyxrc ||
2011 print_paper_flag != system_lyxrc.print_paper_flag) {
2012 os << "\\print_paper_flag \"" << print_paper_flag
2017 case RC_PRINTPAPERDIMENSIONFLAG:
2018 if (ignore_system_lyxrc ||
2019 print_paper_dimension_flag
2020 != system_lyxrc.print_paper_dimension_flag) {
2021 os << "\\print_paper_dimension_flag \""
2022 << print_paper_dimension_flag << "\"\n";
2026 case RC_PRINTTOPRINTER:
2027 if (ignore_system_lyxrc ||
2028 print_to_printer != system_lyxrc.print_to_printer) {
2029 os << "\\print_to_printer \"" << print_to_printer
2034 case RC_PRINTTOFILE:
2035 if (ignore_system_lyxrc ||
2036 print_to_file != system_lyxrc.print_to_file) {
2037 string const path = os::external_path(print_to_file);
2038 os << "\\print_to_file \"" << path << "\"\n";
2042 case RC_PRINTFILEEXTENSION:
2043 if (ignore_system_lyxrc ||
2044 print_file_extension != system_lyxrc.print_file_extension) {
2045 os << "\\print_file_extension \""
2046 << print_file_extension
2053 << "# TEX SECTION #######################################\n"
2056 case RC_FONT_ENCODING:
2057 if (ignore_system_lyxrc ||
2058 fontenc != system_lyxrc.fontenc) {
2059 os << "\\font_encoding \"" << fontenc << "\"\n";
2065 << "# FILE SECTION ######################################\n"
2068 case RC_DOCUMENTPATH:
2069 if (ignore_system_lyxrc ||
2070 document_path != system_lyxrc.document_path) {
2071 string const path = os::external_path(document_path);
2072 os << "\\document_path \"" << path << "\"\n";
2076 case RC_USELASTFILEPOS:
2077 if (ignore_system_lyxrc ||
2078 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2079 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2084 case RC_LOADSESSION:
2085 if (ignore_system_lyxrc ||
2086 load_session != system_lyxrc.load_session) {
2087 os << "\\load_session " << convert<string>(load_session)
2092 case RC_MOUSE_WHEEL_SPEED:
2093 if (ignore_system_lyxrc ||
2094 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2095 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2099 case RC_COMPLETION_INLINE_DELAY:
2100 if (ignore_system_lyxrc ||
2101 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2102 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2106 case RC_COMPLETION_INLINE_MATH:
2107 if (ignore_system_lyxrc ||
2108 completion_inline_math != system_lyxrc.completion_inline_math) {
2109 os << "\\completion_inline_math "
2110 << convert<string>(completion_inline_math) << '\n';
2114 case RC_COMPLETION_INLINE_TEXT:
2115 if (ignore_system_lyxrc ||
2116 completion_inline_text != system_lyxrc.completion_inline_text) {
2117 os << "\\completion_inline_text "
2118 << convert<string>(completion_inline_text) << '\n';
2122 case RC_COMPLETION_INLINE_DOTS:
2123 if (ignore_system_lyxrc ||
2124 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2125 os << "\\completion_inline_dots "
2126 << convert<string>(completion_inline_dots) << '\n';
2130 case RC_AUTOCORRECTION_MATH:
2131 if (ignore_system_lyxrc ||
2132 autocorrection_math != system_lyxrc.autocorrection_math) {
2133 os << "\\autocorrection_math "
2134 << convert<string>(autocorrection_math) << '\n';
2138 case RC_COMPLETION_POPUP_DELAY:
2139 if (ignore_system_lyxrc ||
2140 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2141 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2145 case RC_COMPLETION_POPUP_MATH:
2146 if (ignore_system_lyxrc ||
2147 completion_popup_math != system_lyxrc.completion_popup_math) {
2148 os << "\\completion_popup_math "
2149 << convert<string>(completion_popup_math) << '\n';
2153 case RC_COMPLETION_POPUP_TEXT:
2154 if (ignore_system_lyxrc ||
2155 completion_popup_text != system_lyxrc.completion_popup_text) {
2156 os << "\\completion_popup_text "
2157 << convert<string>(completion_popup_text) << '\n';
2161 case RC_COMPLETION_CURSOR_TEXT:
2162 if (ignore_system_lyxrc ||
2163 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2164 os << "\\completion_cursor_text "
2165 << convert<string>(completion_cursor_text) << '\n';
2169 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2170 if (ignore_system_lyxrc ||
2171 completion_popup_after_complete
2172 != system_lyxrc.completion_popup_after_complete) {
2173 os << "\\completion_popup_after_complete "
2174 << convert<string>(completion_popup_after_complete) << '\n';
2178 case RC_NUMLASTFILES:
2179 if (ignore_system_lyxrc ||
2180 num_lastfiles != system_lyxrc.num_lastfiles) {
2181 os << "\\num_lastfiles " << num_lastfiles << '\n';
2185 case RC_CHECKLASTFILES:
2186 if (ignore_system_lyxrc ||
2187 check_lastfiles != system_lyxrc.check_lastfiles) {
2188 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2193 case RC_EXAMPLEPATH:
2194 if (ignore_system_lyxrc ||
2195 example_path != system_lyxrc.example_path) {
2196 string const path = os::external_path(example_path);
2197 os << "\\example_path \"" << path << "\"\n";
2201 case RC_TEMPLATEPATH:
2202 if (ignore_system_lyxrc ||
2203 template_path != system_lyxrc.template_path) {
2204 string const path = os::external_path(template_path);
2205 os << "\\template_path \"" << path << "\"\n";
2209 case RC_TEMPDIRPATH:
2210 if (ignore_system_lyxrc ||
2211 tempdir_path != system_lyxrc.tempdir_path) {
2212 string const path = os::external_path(tempdir_path);
2213 os << "\\tempdir_path \"" << path << "\"\n";
2217 case RC_THESAURUSDIRPATH:
2218 if (ignore_system_lyxrc ||
2219 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2220 string const path = os::external_path(thesaurusdir_path);
2221 os << "\\thesaurusdir_path \"" << path << "\"\n";
2225 case RC_HUNSPELLDIR_PATH:
2226 if (ignore_system_lyxrc ||
2227 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2228 string const path = os::external_path(hunspelldir_path);
2229 os << "\\hunspelldir_path \"" << path << "\"\n";
2237 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2240 case RC_PLAINTEXT_LINELEN:
2241 if (ignore_system_lyxrc ||
2242 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2243 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2247 case RC_MAKE_BACKUP:
2248 if (ignore_system_lyxrc ||
2249 make_backup != system_lyxrc.make_backup) {
2250 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2254 case RC_SAVE_COMPRESSED:
2255 if (ignore_system_lyxrc ||
2256 save_compressed != system_lyxrc.save_compressed) {
2257 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2261 case RC_BACKUPDIR_PATH:
2262 if (ignore_system_lyxrc ||
2263 backupdir_path != system_lyxrc.backupdir_path) {
2264 string const path = os::external_path(backupdir_path);
2265 os << "\\backupdir_path \"" << path << "\"\n";
2271 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2275 << "# SPELLCHECKER SECTION ##############################\n"
2278 case RC_SPELL_COMMAND:
2279 case RC_USE_SPELL_LIB:
2283 case RC_ACCEPT_COMPOUND:
2284 if (ignore_system_lyxrc ||
2285 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2286 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2291 case RC_USE_ALT_LANG:
2296 if (ignore_system_lyxrc ||
2297 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2298 os << "\\alternate_language \"" << spellchecker_alt_lang
2303 case RC_USE_ESC_CHARS:
2307 if (ignore_system_lyxrc ||
2308 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2309 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2313 case RC_USE_PERS_DICT:
2317 case RC_USE_TOOLTIP:
2318 if (ignore_system_lyxrc ||
2319 use_tooltip != system_lyxrc.use_tooltip) {
2320 os << "\\use_tooltip "
2321 << convert<string>(use_tooltip)
2326 case RC_USE_PIXMAP_CACHE:
2327 if (ignore_system_lyxrc ||
2328 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2329 os << "\\use_pixmap_cache "
2330 << convert<string>(use_pixmap_cache)
2339 case RC_USE_INP_ENC:
2345 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2350 case RC_SPELLCHECKER:
2351 if (ignore_system_lyxrc ||
2352 spellchecker != system_lyxrc.spellchecker) {
2353 os << "\\spellchecker " << spellchecker << '\n';
2358 case RC_SPELLCHECK_CONTINUOUSLY:
2359 if (ignore_system_lyxrc ||
2360 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2361 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2367 case RC_SPELLCHECK_NOTES:
2368 if (ignore_system_lyxrc ||
2369 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2370 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2376 case RC_RTL_SUPPORT:
2377 if (ignore_system_lyxrc ||
2378 rtl_support != system_lyxrc.rtl_support) {
2379 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2383 case RC_VISUAL_CURSOR:
2384 if (ignore_system_lyxrc ||
2385 visual_cursor != system_lyxrc.visual_cursor) {
2386 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2390 case RC_LANGUAGE_PACKAGE:
2391 if (ignore_system_lyxrc ||
2392 language_package != system_lyxrc.language_package) {
2393 os << "\\language_package \"" << language_package
2398 case RC_LANGUAGE_GLOBAL_OPTIONS:
2399 if (ignore_system_lyxrc ||
2400 language_global_options
2401 != system_lyxrc.language_global_options) {
2402 os << "\\language_global_options \""
2403 << convert<string>(language_global_options)
2408 case RC_LANGUAGE_USE_BABEL:
2409 if (ignore_system_lyxrc ||
2410 language_use_babel != system_lyxrc.language_use_babel) {
2411 os << "\\language_use_babel \""
2412 << convert<string>(language_use_babel)
2417 case RC_LANGUAGE_COMMAND_BEGIN:
2418 if (ignore_system_lyxrc ||
2419 language_command_begin
2420 != system_lyxrc.language_command_begin) {
2421 os << "\\language_command_begin \""
2422 << language_command_begin
2427 case RC_LANGUAGE_COMMAND_END:
2428 if (ignore_system_lyxrc ||
2429 language_command_end
2430 != system_lyxrc.language_command_end) {
2431 os << "\\language_command_end \"" << language_command_end
2436 case RC_LANGUAGE_COMMAND_LOCAL:
2437 if (ignore_system_lyxrc ||
2438 language_command_local
2439 != system_lyxrc.language_command_local) {
2440 os << "\\language_command_local \""
2441 << language_command_local
2446 case RC_LANGUAGE_AUTO_BEGIN:
2447 if (ignore_system_lyxrc ||
2448 language_auto_begin != system_lyxrc.language_auto_begin) {
2449 os << "\\language_auto_begin "
2450 << convert<string>(language_auto_begin) << '\n';
2454 case RC_LANGUAGE_AUTO_END:
2455 if (ignore_system_lyxrc ||
2456 language_auto_end != system_lyxrc.language_auto_end) {
2457 os << "\\language_auto_end "
2458 << convert<string>(language_auto_end) << '\n';
2462 case RC_MARK_FOREIGN_LANGUAGE:
2463 if (ignore_system_lyxrc ||
2464 mark_foreign_language
2465 != system_lyxrc.mark_foreign_language) {
2466 os << "\\mark_foreign_language " <<
2467 convert<string>(mark_foreign_language) << '\n';
2473 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2476 case RC_AUTO_NUMBER:
2477 if (ignore_system_lyxrc ||
2478 auto_number != system_lyxrc.auto_number) {
2479 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2483 case RC_DEFAULT_LANGUAGE:
2484 if (ignore_system_lyxrc ||
2485 default_language != system_lyxrc.default_language) {
2486 os << "\\default_language " << default_language << '\n';
2490 case RC_GUI_LANGUAGE:
2491 if (ignore_system_lyxrc ||
2492 gui_language != system_lyxrc.gui_language) {
2493 os << "\\gui_language " << gui_language << '\n';
2499 << "# FORMATS SECTION ##########################\n"
2503 // New/modified formats
2504 for (Formats::const_iterator cit = formats.begin();
2505 cit != formats.end(); ++cit) {
2506 Format const * format =
2507 system_formats.getFormat(cit->name());
2509 format->extension() != cit->extension() ||
2510 format->prettyname() != cit->prettyname() ||
2511 format->shortcut() != cit->shortcut() ||
2512 format->viewer() != cit->viewer() ||
2513 format->editor() != cit->editor() ||
2514 format->documentFormat() != cit->documentFormat() ||
2515 format->vectorFormat() != cit->vectorFormat()) {
2516 os << "\\format \"" << cit->name() << "\" \""
2517 << cit->extension() << "\" \""
2518 << cit->prettyname() << "\" \""
2519 << cit->shortcut() << "\" \""
2520 << escapeCommand(cit->viewer()) << "\" \""
2521 << escapeCommand(cit->editor()) << "\" \"";
2522 vector<string> flags;
2523 if (cit->documentFormat())
2524 flags.push_back("document");
2525 if (cit->vectorFormat())
2526 flags.push_back("vector");
2527 os << getStringFromVector(flags);
2532 // Look for deleted formats
2533 for (Formats::const_iterator cit = system_formats.begin();
2534 cit != system_formats.end(); ++cit)
2535 if (!formats.getFormat(cit->name()))
2536 os << "\\format \"" << cit->name()
2537 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2540 case RC_VIEWER_ALTERNATIVES: {
2541 Alternatives::const_iterator it = viewer_alternatives.begin();
2542 Alternatives::const_iterator const en = viewer_alternatives.end();
2543 Alternatives::const_iterator const sysend =
2544 system_lyxrc.viewer_alternatives.end();
2545 for (; it != en; ++it) {
2546 string const & fmt = it->first;
2547 CommandSet const & cmd = it->second;
2548 CommandSet::const_iterator sit = cmd.begin();
2549 CommandSet::const_iterator const sen = cmd.end();
2550 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2551 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2552 system_lyxrc.viewer_alternatives.find(fmt);
2553 for (; sit != sen; ++sit) {
2554 string const & cmd = *sit;
2555 if (ignore_system_lyxrc
2556 || sysfmt == sysend // format not found
2557 || sysfmt->second.count(cmd) == 0 // this command not found
2559 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2565 case RC_EDITOR_ALTERNATIVES: {
2566 Alternatives::const_iterator it = editor_alternatives.begin();
2567 Alternatives::const_iterator const en = editor_alternatives.end();
2568 Alternatives::const_iterator const sysend =
2569 system_lyxrc.editor_alternatives.end();
2570 for (; it != en; ++it) {
2571 string const & fmt = it->first;
2572 CommandSet const & cmd = it->second;
2573 CommandSet::const_iterator sit = cmd.begin();
2574 CommandSet::const_iterator const sen = cmd.end();
2575 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2576 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2577 system_lyxrc.editor_alternatives.find(fmt);
2578 for (; sit != sen; ++sit) {
2579 string const & cmd = *sit;
2580 if (ignore_system_lyxrc
2581 || sysfmt == sysend // format not found
2582 || sysfmt->second.count(cmd) == 0 // this command not found
2584 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2590 case RC_DEFAULT_VIEW_FORMAT:
2591 if (ignore_system_lyxrc ||
2592 default_view_format != system_lyxrc.default_view_format) {
2593 os << "\\default_view_format " << default_view_format << '\n';
2603 << "# CONVERTERS SECTION ##########################\n"
2607 // Look for new converters
2608 for (Converters::const_iterator cit = theConverters().begin();
2609 cit != theConverters().end(); ++cit) {
2610 Converter const * converter =
2611 theSystemConverters().getConverter(cit->from,
2614 converter->command != cit->command ||
2615 converter->flags != cit->flags)
2616 os << "\\converter \"" << cit->from << "\" \""
2617 << cit->to << "\" \""
2618 << escapeCommand(cit->command) << "\" \""
2619 << cit->flags << "\"\n";
2622 // New/modifed converters
2623 for (Converters::const_iterator cit = theSystemConverters().begin();
2624 cit != theSystemConverters().end(); ++cit)
2625 if (!theConverters().getConverter(cit->from, cit->to))
2626 os << "\\converter \"" << cit->from
2627 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2634 << "# COPIERS SECTION ##########################\n"
2637 // Look for new movers
2638 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2639 Movers::const_iterator const sysend = theSystemMovers().end();
2640 Movers::const_iterator it = theMovers().begin();
2641 Movers::const_iterator end = theMovers().end();
2643 for (; it != end; ++it) {
2644 Movers::const_iterator const sysit =
2645 find_if(sysbegin, sysend, SameMover(*it));
2646 if (sysit == sysend) {
2647 string const & fmt = it->first;
2648 string const & command =
2649 it->second.command();
2651 os << "\\copier " << fmt
2652 << " \"" << escapeCommand(command) << "\"\n";
2658 // We don't actually delete SpecialisedMover(s) from the
2659 // map, just clear their 'command', so there's no need
2660 // to test for anything else.
2667 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2669 // Why the switch you might ask. It is a trick to ensure that all
2670 // the elements in the LyXRCTags enum is handled. As you can see
2671 // there are no breaks at all. So it is just a huge fall-through.
2672 // The nice thing is that we will get a warning from the compiler
2673 // if we forget an element.
2674 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2676 case LyXRC::RC_ACCEPT_COMPOUND:
2677 case LyXRC::RC_ALT_LANG:
2678 case LyXRC::RC_PLAINTEXT_LINELEN:
2679 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2680 case LyXRC::RC_AUTOCORRECTION_MATH:
2681 case LyXRC::RC_AUTOREGIONDELETE:
2682 case LyXRC::RC_AUTORESET_OPTIONS:
2683 case LyXRC::RC_AUTOSAVE:
2684 case LyXRC::RC_AUTO_NUMBER:
2685 case LyXRC::RC_BACKUPDIR_PATH:
2686 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2687 case LyXRC::RC_BIBTEX_COMMAND:
2688 case LyXRC::RC_BINDFILE:
2689 case LyXRC::RC_CHECKLASTFILES:
2690 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2691 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2692 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2693 case LyXRC::RC_COMPLETION_INLINE_MATH:
2694 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2695 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2696 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2697 case LyXRC::RC_COMPLETION_POPUP_MATH:
2698 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2699 case LyXRC::RC_USELASTFILEPOS:
2700 case LyXRC::RC_LOADSESSION:
2701 case LyXRC::RC_CHKTEX_COMMAND:
2702 case LyXRC::RC_CONVERTER:
2703 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2704 case LyXRC::RC_COPIER:
2705 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2706 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2707 case LyXRC::RC_DATE_INSERT_FORMAT:
2708 case LyXRC::RC_DEFAULT_LANGUAGE:
2709 case LyXRC::RC_GUI_LANGUAGE:
2710 case LyXRC::RC_DEFAULT_PAPERSIZE:
2711 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2712 case LyXRC::RC_DEFFILE:
2713 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2714 case LyXRC::RC_DISPLAY_GRAPHICS:
2715 case LyXRC::RC_DOCUMENTPATH:
2716 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2717 FileName path(lyxrc_new.document_path);
2718 if (path.exists() && path.isDirectory())
2719 package().document_dir() = FileName(lyxrc.document_path);
2721 case LyXRC::RC_EDITOR_ALTERNATIVES:
2722 case LyXRC::RC_ESC_CHARS:
2723 case LyXRC::RC_EXAMPLEPATH:
2724 case LyXRC::RC_FONT_ENCODING:
2725 case LyXRC::RC_FORMAT:
2726 case LyXRC::RC_GROUP_LAYOUTS:
2727 case LyXRC::RC_HUNSPELLDIR_PATH:
2728 case LyXRC::RC_INDEX_ALTERNATIVES:
2729 case LyXRC::RC_INDEX_COMMAND:
2730 case LyXRC::RC_JBIBTEX_COMMAND:
2731 case LyXRC::RC_JINDEX_COMMAND:
2732 case LyXRC::RC_NOMENCL_COMMAND:
2733 case LyXRC::RC_INPUT:
2734 case LyXRC::RC_KBMAP:
2735 case LyXRC::RC_KBMAP_PRIMARY:
2736 case LyXRC::RC_KBMAP_SECONDARY:
2737 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2738 case LyXRC::RC_LANGUAGE_AUTO_END:
2739 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2740 case LyXRC::RC_LANGUAGE_COMMAND_END:
2741 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2742 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2743 case LyXRC::RC_LANGUAGE_PACKAGE:
2744 case LyXRC::RC_LANGUAGE_USE_BABEL:
2745 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2746 case LyXRC::RC_MACRO_EDIT_STYLE:
2747 case LyXRC::RC_MAKE_BACKUP:
2748 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2749 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2750 case LyXRC::RC_NUMLASTFILES:
2751 case LyXRC::RC_PARAGRAPH_MARKERS:
2752 case LyXRC::RC_PATH_PREFIX:
2753 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2754 prependEnvPath("PATH", lyxrc.path_prefix);
2756 case LyXRC::RC_PERS_DICT:
2757 case LyXRC::RC_PREVIEW:
2758 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2759 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2760 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2761 case LyXRC::RC_PRINTCOPIESFLAG:
2762 case LyXRC::RC_PRINTER:
2763 case LyXRC::RC_PRINTEVENPAGEFLAG:
2764 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2765 case LyXRC::RC_PRINTFILEEXTENSION:
2766 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2767 case LyXRC::RC_PRINTODDPAGEFLAG:
2768 case LyXRC::RC_PRINTPAGERANGEFLAG:
2769 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2770 case LyXRC::RC_PRINTPAPERFLAG:
2771 case LyXRC::RC_PRINTREVERSEFLAG:
2772 case LyXRC::RC_PRINTSPOOL_COMMAND:
2773 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2774 case LyXRC::RC_PRINTTOFILE:
2775 case LyXRC::RC_PRINTTOPRINTER:
2776 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2777 case LyXRC::RC_PRINT_COMMAND:
2778 case LyXRC::RC_RTL_SUPPORT:
2779 case LyXRC::RC_SAVE_COMPRESSED:
2780 case LyXRC::RC_SCREEN_DPI:
2781 case LyXRC::RC_SCREEN_FONT_ROMAN:
2782 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2783 case LyXRC::RC_SCREEN_FONT_SANS:
2784 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2785 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2786 case LyXRC::RC_SCREEN_FONT_SIZES:
2787 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2788 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2789 case LyXRC::RC_GEOMETRY_SESSION:
2790 case LyXRC::RC_SCREEN_ZOOM:
2791 case LyXRC::RC_SERVERPIPE:
2792 case LyXRC::RC_SET_COLOR:
2793 case LyXRC::RC_SHOW_BANNER:
2794 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2795 case LyXRC::RC_SPELL_COMMAND:
2796 case LyXRC::RC_SPELLCHECKER:
2797 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2798 case LyXRC::RC_SPELLCHECK_NOTES:
2799 case LyXRC::RC_SPLITINDEX_COMMAND:
2800 case LyXRC::RC_TEMPDIRPATH:
2801 case LyXRC::RC_TEMPLATEPATH:
2802 case LyXRC::RC_TEX_ALLOWS_SPACES:
2803 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2804 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2805 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2807 case LyXRC::RC_THESAURUSDIRPATH:
2808 case LyXRC::RC_UIFILE:
2809 case LyXRC::RC_USER_EMAIL:
2810 case LyXRC::RC_USER_NAME:
2811 case LyXRC::RC_USETEMPDIR:
2812 case LyXRC::RC_USE_ALT_LANG:
2813 case LyXRC::RC_USE_CONVERTER_CACHE:
2814 case LyXRC::RC_USE_ESC_CHARS:
2815 case LyXRC::RC_USE_INP_ENC:
2816 case LyXRC::RC_USE_PERS_DICT:
2817 case LyXRC::RC_USE_TOOLTIP:
2818 case LyXRC::RC_USE_PIXMAP_CACHE:
2819 case LyXRC::RC_USE_SPELL_LIB:
2820 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2821 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2822 case LyXRC::RC_SORT_LAYOUTS:
2823 case LyXRC::RC_FULL_SCREEN_LIMIT:
2824 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2825 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2826 case LyXRC::RC_FULL_SCREEN_TABBAR:
2827 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2828 case LyXRC::RC_FULL_SCREEN_WIDTH:
2829 case LyXRC::RC_VISUAL_CURSOR:
2830 case LyXRC::RC_VIEWER:
2831 case LyXRC::RC_VIEWER_ALTERNATIVES:
2832 case LyXRC::RC_FORWARD_SEARCH_DVI:
2833 case LyXRC::RC_FORWARD_SEARCH_PDF:
2834 case LyXRC::RC_LAST:
2841 string const LyXRC::getDescription(LyXRCTags tag)
2846 case RC_ACCEPT_COMPOUND:
2847 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2851 case RC_USE_ALT_LANG:
2852 str = _("Specify an alternate language. The default is to use the language of the document.");
2855 case RC_PLAINTEXT_ROFF_COMMAND:
2856 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.");
2859 case RC_PLAINTEXT_LINELEN:
2860 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.");
2863 case RC_AUTOREGIONDELETE:
2864 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2867 case RC_AUTORESET_OPTIONS:
2868 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2872 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2875 case RC_AUTO_NUMBER:
2878 case RC_BACKUPDIR_PATH:
2879 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.");
2882 case RC_BIBTEX_COMMAND:
2883 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2886 case RC_JBIBTEX_COMMAND:
2887 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2891 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2894 case RC_CHECKLASTFILES:
2895 str = _("Select to check whether the lastfiles still exist.");
2898 case RC_CHKTEX_COMMAND:
2899 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2908 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2909 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.");
2912 case RC_SCROLL_BELOW_DOCUMENT:
2913 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");
2916 case RC_MAC_LIKE_WORD_MOVEMENT:
2917 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2920 case RC_SHOW_MACRO_LABEL:
2921 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2924 case RC_DATE_INSERT_FORMAT:
2925 //xgettext:no-c-format
2926 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2930 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2933 case RC_DEFAULT_VIEW_FORMAT:
2934 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2937 case RC_DEFAULT_LANGUAGE:
2938 str = _("New documents will be assigned this language.");
2941 case RC_DEFAULT_PAPERSIZE:
2942 str = _("Specify the default paper size.");
2945 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2946 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2949 case RC_DISPLAY_GRAPHICS:
2950 str = _("Select how LyX will display any graphics.");
2953 case RC_DOCUMENTPATH:
2954 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2958 case RC_USE_ESC_CHARS:
2959 str = _("Specify additional chars that can be part of a word.");
2962 case RC_EXAMPLEPATH:
2963 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2966 case RC_FONT_ENCODING:
2967 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2973 case RC_INDEX_COMMAND:
2974 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\".");
2977 case RC_JINDEX_COMMAND:
2978 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2981 case RC_NOMENCL_COMMAND:
2982 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2989 case RC_KBMAP_PRIMARY:
2990 case RC_KBMAP_SECONDARY:
2991 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.");
2994 case RC_LANGUAGE_AUTO_BEGIN:
2995 str = _("Select if a language switching command is needed at the beginning of the document.");
2998 case RC_LANGUAGE_AUTO_END:
2999 str = _("Select if a language switching command is needed at the end of the document.");
3002 case RC_LANGUAGE_COMMAND_BEGIN:
3003 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.");
3006 case RC_LANGUAGE_COMMAND_END:
3007 str = _("The LaTeX command for changing back to the language of the document.");
3010 case RC_LANGUAGE_COMMAND_LOCAL:
3011 str = _("The LaTeX command for local changing of the language.");
3014 case RC_LANGUAGE_GLOBAL_OPTIONS:
3015 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3018 case RC_LANGUAGE_PACKAGE:
3019 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3022 case RC_LANGUAGE_USE_BABEL:
3023 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3026 case RC_USELASTFILEPOS:
3027 str = _("De-select if you do not want LyX to scroll to saved position.");
3030 case RC_LOADSESSION:
3031 str = _("De-select to prevent loading files opened from the last LyX session.");
3034 case RC_MAKE_BACKUP:
3035 str = _("De-select if you don't want LyX to create backup files.");
3038 case RC_MARK_FOREIGN_LANGUAGE:
3039 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3042 case RC_MOUSE_WHEEL_SPEED:
3043 str = bformat(_("The scrolling speed of the mouse wheel."),
3047 case RC_COMPLETION_POPUP_DELAY:
3048 str = _("The completion popup delay.");
3051 case RC_COMPLETION_POPUP_MATH:
3052 str = _("Select to display the completion popup in math mode.");
3055 case RC_COMPLETION_POPUP_TEXT:
3056 str = _("Select to display the completion popup in text mode.");
3059 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3060 str = _("Show the completion popup without delay after non-unique completion attempt.");
3063 case RC_COMPLETION_POPUP_TEXT:
3064 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3067 case RC_COMPLETION_POPUP_DELAY:
3068 str = _("The inline completion delay.");
3071 case RC_COMPLETION_INLINE_MATH:
3072 str = _("Select to display the inline completion in math mode.");
3075 case RC_COMPLETION_INLINE_TEXT:
3076 str = _("Select to display the inline completion in text mode.");
3079 case RC_COMPLETION_INLINE_DOTS:
3080 str = _("Use \"...\" to shorten long completions.");
3083 case RC_AUTOCORRECTION_MATH:
3084 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3087 case RC_NUMLASTFILES:
3088 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3092 case RC_PATH_PREFIX:
3093 str = _("Specify those directories which should be "
3094 "prepended to the PATH environment variable. "
3095 "Use the OS native format.");
3099 str = _("Shows a typeset preview of things such as math");
3102 case RC_PREVIEW_HASHED_LABELS:
3103 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3106 case RC_PREVIEW_SCALE_FACTOR:
3107 str = _("Scale the preview size to suit.");
3110 case RC_PRINTCOLLCOPIESFLAG:
3111 str = _("The option for specifying whether the copies should be collated.");
3114 case RC_PRINTCOPIESFLAG:
3115 str = _("The option for specifying the number of copies to print.");
3119 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3122 case RC_PRINTEVENPAGEFLAG:
3123 str = _("The option to print only even pages.");
3126 case RC_PRINTEXSTRAOPTIONS:
3127 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3130 case RC_PRINTFILEEXTENSION:
3131 str = _("Extension of printer program output file. Usually \".ps\".");
3134 case RC_PRINTLANDSCAPEFLAG:
3135 str = _("The option to print out in landscape.");
3138 case RC_PRINTODDPAGEFLAG:
3139 str = _("The option to print only odd pages.");
3142 case RC_PRINTPAGERANGEFLAG:
3143 str = _("The option for specifying a comma-separated list of pages to print.");
3146 case RC_PRINTPAPERDIMENSIONFLAG:
3147 str = _("Option to specify the dimensions of the print paper.");
3150 case RC_PRINTPAPERFLAG:
3151 str = _("The option to specify paper type.");
3154 case RC_PRINTREVERSEFLAG:
3155 str = _("The option to reverse the order of the pages printed.");
3158 case RC_PRINTSPOOL_COMMAND:
3159 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.");
3162 case RC_PRINTSPOOL_PRINTERPREFIX:
3163 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.");
3166 case RC_PRINTTOFILE:
3167 str = _("Option to pass to the print program to print to a file.");
3170 case RC_PRINTTOPRINTER:
3171 str = _("Option to pass to the print program to print on a specific printer.");
3174 case RC_PRINT_ADAPTOUTPUT:
3175 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3178 case RC_PRINT_COMMAND:
3179 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3182 case RC_RTL_SUPPORT:
3183 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3186 case RC_VISUAL_CURSOR:
3187 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3191 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3194 case RC_SCREEN_FONT_ROMAN:
3195 case RC_SCREEN_FONT_SANS:
3196 case RC_SCREEN_FONT_TYPEWRITER:
3197 str = _("The screen fonts used to display the text while editing.");
3200 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3201 case RC_SCREEN_FONT_SANS_FOUNDRY:
3202 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3205 case RC_SCREEN_FONT_SCALABLE:
3206 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.");
3209 case RC_SCREEN_FONT_SIZES:
3210 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3213 case RC_SCREEN_ZOOM:
3214 //xgettext:no-c-format
3215 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3218 case RC_GEOMETRY_SESSION:
3219 str = _("Allow session manager to save and restore windows geometry.");
3223 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3229 case RC_SHOW_BANNER:
3230 str = _("De-select if you don't want the startup banner.");
3233 case RC_TEMPDIRPATH:
3234 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3237 case RC_THESAURUSDIRPATH:
3238 str = _("This is the place where the files of the thesaurus library reside.");
3241 case RC_TEMPLATEPATH:
3242 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3245 case RC_TEX_ALLOWS_SPACES:
3248 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3252 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3264 case RC_USE_TOOLTIP:
3265 str = _("Enable the automatic appearance of tool tips in the work area.");
3268 case RC_USE_PIXMAP_CACHE:
3269 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3272 case RC_USE_SPELL_LIB:
3275 case RC_VIEWDVI_PAPEROPTION:
3276 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3291 // The global instance
3294 // The global copy of the system lyxrc entries (everything except preferences)