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/filetools.h"
36 #include "support/gettext.h"
37 #include "support/lstrings.h"
38 #include "support/os.h"
39 #include "support/userinfo.h"
45 using namespace lyx::support;
49 namespace os = support::os;
53 // when adding something to this array keep it sorted!
54 LexerKeyword lyxrcTags[] = {
55 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
56 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
57 { "\\alternate_language", LyXRC::RC_ALT_LANG },
58 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
59 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
60 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
61 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
62 { "\\autosave", LyXRC::RC_AUTOSAVE },
63 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
64 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
65 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
66 { "\\bind_file", LyXRC::RC_BINDFILE },
67 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
68 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
69 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
70 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
71 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
72 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
73 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
74 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
75 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
76 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
77 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
78 { "\\converter", LyXRC::RC_CONVERTER },
79 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
80 { "\\copier", LyXRC::RC_COPIER },
81 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
82 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
83 { "\\def_file", LyXRC::RC_DEFFILE },
84 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
85 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
86 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
87 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
88 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
89 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
90 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
91 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
92 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
93 { "\\format", LyXRC::RC_FORMAT },
94 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
95 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
96 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
97 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
98 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
99 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
100 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
101 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
102 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
103 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
104 { "\\input", LyXRC::RC_INPUT },
105 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
106 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
107 { "\\kbmap", LyXRC::RC_KBMAP },
108 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
109 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
110 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
111 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
112 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
113 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
114 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
115 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
116 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
117 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
118 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
119 { "\\load_session", LyXRC::RC_LOADSESSION },
120 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
121 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
122 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
123 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
124 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
125 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
126 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
127 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
128 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
129 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
130 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
131 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
132 { "\\preview", LyXRC::RC_PREVIEW },
133 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
134 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
135 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
136 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
137 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
138 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
139 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
140 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
141 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
142 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
143 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
144 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
145 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
146 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
147 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
148 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
149 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
150 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
151 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
152 { "\\printer", LyXRC::RC_PRINTER },
153 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
154 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
155 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
156 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
157 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
158 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
159 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
160 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
161 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
162 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
163 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
164 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
165 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
166 { "\\set_color", LyXRC::RC_SET_COLOR },
167 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
168 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
169 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
170 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
171 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
172 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
173 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
174 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
175 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
176 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
177 { "\\ui_file", LyXRC::RC_UIFILE },
178 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
179 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
180 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
181 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
182 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
183 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
184 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
185 // compatibility with versions older than 1.4.0 only
186 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
187 // compatibility with versions older than 1.4.0 only
188 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
189 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
190 { "\\user_email", LyXRC::RC_USER_EMAIL },
191 { "\\user_name", LyXRC::RC_USER_NAME },
192 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
193 // compatibility with versions older than 1.4.0 only
194 { "\\viewer", LyXRC::RC_VIEWER},
195 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
198 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
209 void LyXRC::setDefaults()
212 def_file = "default";
214 // Get printer from the environment. If fail, use default "",
215 // assuming that everything is set up correctly.
216 printer = getEnv("PRINTER");
217 print_adapt_output = false;
218 print_command = "dvips";
219 print_evenpage_flag = "-B";
220 print_oddpage_flag = "-A";
221 print_pagerange_flag = "-pp";
222 print_copies_flag = "-c";
223 print_collcopies_flag = "-C";
224 print_reverse_flag = "-r";
225 print_landscape_flag = "-t landscape";
226 print_to_printer = "-P";
227 print_to_file = "-o ";
228 print_file_extension = ".ps";
229 print_paper_flag = "-t";
230 print_paper_dimension_flag = "-T";
231 document_path.erase();
232 view_dvi_paper_option.erase();
233 default_papersize = PAPER_DEFAULT;
234 default_view_format = "pdf2";
235 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
236 bibtex_command = "bibtex";
238 index_command = "makeindex -c -q";
239 nomencl_command = "makeindex -s nomencl.ist";
241 // Because a screen typically is wider than a piece of paper:
243 allow_geometry_session = true;
244 // Default LaTeX font size:
245 font_sizes[FONT_SIZE_TINY] = "5.0";
246 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
247 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
248 font_sizes[FONT_SIZE_SMALL] = "9.0";
249 font_sizes[FONT_SIZE_NORMAL] = "10.0";
250 font_sizes[FONT_SIZE_LARGE] = "12.0";
251 font_sizes[FONT_SIZE_LARGER] = "14.4";
252 font_sizes[FONT_SIZE_LARGEST] = "17.26";
253 font_sizes[FONT_SIZE_HUGE] = "20.74";
254 font_sizes[FONT_SIZE_HUGER] = "24.88";
255 use_scalable_fonts = true;
256 roman_font_name = "";
258 typewriter_font_name = "";
260 auto_region_delete = true;
261 auto_reset_options = false;
262 plaintext_linelen = 65;
263 mouse_wheel_speed = 1.0;
264 num_lastfiles = maxlastfiles;
265 check_lastfiles = true;
266 use_lastfilepos = true;
267 load_session = false;
269 backupdir_path.erase();
270 display_graphics = true;
271 // Spellchecker settings:
272 spellchecker_accept_compound = false;
273 spellchecker_use_input_encoding = false;
274 spellchecker_use_alt_lang = false;
275 spellchecker_use_pers_dict = false;
276 spellchecker_use_esc_chars = false;
277 spellcheck_continuously = false;
280 visual_cursor = false;
282 mark_foreign_language = true;
283 language_auto_begin = true;
284 language_auto_end = true;
285 language_global_options = true;
286 language_use_babel = true;
287 language_package = "\\usepackage{babel}";
288 language_command_begin = "\\selectlanguage{$$lang}";
289 language_command_local = "\\foreignlanguage{$$lang}{";
290 sort_layouts = false;
291 group_layouts = true;
292 default_language = "english";
293 gui_language = "auto";
295 windows_style_tex_paths = false;
296 tex_allows_spaces = false;
297 date_insert_format = "%x";
298 cursor_follows_scrollbar = false;
299 scroll_below_document = false;
300 mac_like_word_movement = false;
301 macro_edit_style = MACRO_EDIT_INLINE_BOX;
302 dialogs_iconify_with_main = false;
303 label_init_length = 3;
304 preview = PREVIEW_OFF;
305 preview_hashed_labels = false;
306 preview_scale_factor = "0.9";
307 use_converter_cache = true;
309 use_pixmap_cache = false;
310 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
311 user_name = to_utf8(support::user_name());
312 user_email = to_utf8(support::user_email());
313 open_buffers_in_tabs = true;
315 // Fullscreen settings
316 full_screen_limit = false;
317 full_screen_toolbars = true;
318 full_screen_tabbar = true;
319 full_screen_menubar = true;
320 full_screen_scrollbar = true;
321 full_screen_width = 700;
323 completion_cursor_text = true;
324 completion_popup_math = true;
325 completion_popup_text = false;
326 completion_popup_delay = 2.0;
327 completion_popup_after_complete = true;
328 autocorrection_math = false;
329 completion_inline_math = true;
330 completion_inline_text = false;
331 completion_inline_dots = -1;
332 completion_inline_delay = 0.2;
338 void oldFontFormat(string & family, string & foundry)
340 if (family.empty() || family[0] != '-')
342 foundry = token(family, '-', 1);
343 family = token(family, '-', 2);
351 int LyXRC::read(FileName const & filename)
353 Lexer lexrc(lyxrcTags);
354 if (lyxerr.debugging(Debug::PARSER))
355 lexrc.printTable(lyxerr);
357 lexrc.setFile(filename);
361 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
367 int LyXRC::read(istream & is)
369 Lexer lexrc(lyxrcTags);
370 if (lyxerr.debugging(Debug::PARSER))
371 lexrc.printTable(lyxerr);
377 LYXERR(Debug::LYXRC, "Reading istream...");
383 int LyXRC::read(Lexer & lexrc)
388 while (lexrc.isOK()) {
389 // By using two switches we take advantage of the compiler
390 // telling us if we have missed a LyXRCTags element in
391 // the second switch.
392 // Note that this also shows a problem with Lexer since it
393 // helps us avoid taking advantage of the strictness of the
396 int le = lexrc.lex();
398 case Lexer::LEX_UNDEF:
399 lexrc.printError("Unknown tag `$$Token'");
401 case Lexer::LEX_FEOF:
406 switch (static_cast<LyXRCTags>(le)) {
407 case RC_INPUT: // Include file
410 libFileSearch(string(),
413 lexrc.printError("Error reading "
414 "included file: " + tmp.absFilename());
420 bind_file = os::internal_path(lexrc.getString());
425 def_file = os::internal_path(lexrc.getString());
430 ui_file = os::internal_path(lexrc.getString());
433 case RC_AUTORESET_OPTIONS:
434 lexrc >> auto_reset_options;
437 case RC_DISPLAY_GRAPHICS:
439 display_graphics = lexrc.getString() == "true";
442 case RC_TEX_EXPECTS_WINDOWS_PATHS:
443 lexrc >> windows_style_tex_paths;
446 case RC_TEX_ALLOWS_SPACES:
447 lexrc >> tex_allows_spaces;
454 case RC_KBMAP_PRIMARY:
456 string const kmap(os::internal_path(lexrc.getString()));
459 } else if (!libFileSearch("kbd", kmap,
461 primary_kbmap = kmap;
463 lexrc.printError("LyX: Keymap `$$Token' not found");
468 case RC_KBMAP_SECONDARY:
470 string const kmap(os::internal_path(lexrc.getString()));
473 } else if (!libFileSearch("kbd", kmap,
475 secondary_kbmap = kmap;
477 lexrc.printError("LyX: Keymap `$$Token' not found");
482 case RC_FONT_ENCODING:
490 case RC_PRINT_COMMAND:
491 if (lexrc.next(true)) {
492 print_command = lexrc.getString();
496 case RC_PRINTEVENPAGEFLAG:
497 lexrc >> print_evenpage_flag;
500 case RC_PRINTODDPAGEFLAG:
501 lexrc >> print_oddpage_flag;
504 case RC_PRINTPAGERANGEFLAG:
505 lexrc >> print_pagerange_flag;
508 case RC_PRINTCOPIESFLAG:
509 lexrc >> print_copies_flag;
512 case RC_PRINTCOLLCOPIESFLAG:
513 lexrc >> print_collcopies_flag;
516 case RC_PRINTREVERSEFLAG:
517 lexrc >> print_reverse_flag;
520 case RC_PRINTLANDSCAPEFLAG:
521 lexrc >> print_landscape_flag;
524 case RC_PRINTTOPRINTER:
525 lexrc >> print_to_printer;
528 case RC_PRINT_ADAPTOUTPUT:
529 lexrc >> print_adapt_output;
534 print_to_file = os::internal_path(lexrc.getString());
538 case RC_PRINTFILEEXTENSION:
539 lexrc >> print_file_extension;
542 case RC_PRINTEXSTRAOPTIONS:
543 lexrc >> print_extra_options;
546 case RC_PRINTSPOOL_COMMAND:
547 if (lexrc.next(true)) {
548 print_spool_command = lexrc.getString();
552 case RC_PRINTSPOOL_PRINTERPREFIX:
553 lexrc >> print_spool_printerprefix;
556 case RC_PRINTPAPERDIMENSIONFLAG:
557 lexrc >> print_paper_dimension_flag;
560 case RC_PRINTPAPERFLAG:
561 lexrc >> print_paper_flag;
564 case RC_DEFAULT_PAPERSIZE:
566 string const size = ascii_lowercase(lexrc.getString());
567 if (size == "usletter")
568 default_papersize = PAPER_USLETTER;
569 else if (size == "legal")
570 default_papersize = PAPER_USLEGAL;
571 else if (size == "executive")
572 default_papersize = PAPER_USEXECUTIVE;
573 else if (size == "a3")
574 default_papersize = PAPER_A3;
575 else if (size == "a4")
576 default_papersize = PAPER_A4;
577 else if (size == "a5")
578 default_papersize = PAPER_A5;
579 else if (size == "b5")
580 default_papersize = PAPER_B5;
581 else if (size == "default")
582 default_papersize = PAPER_DEFAULT;
586 case RC_VIEWDVI_PAPEROPTION:
588 view_dvi_paper_option = lexrc.getString();
590 view_dvi_paper_option.erase();
593 case RC_CHKTEX_COMMAND:
594 if (lexrc.next(true)) {
595 chktex_command = lexrc.getString();
599 case RC_BIBTEX_ALTERNATIVES:
600 if (lexrc.next(true)) {
601 bibtex_alternatives.insert(lexrc.getString());
605 case RC_BIBTEX_COMMAND:
606 if (lexrc.next(true)) {
607 bibtex_command = lexrc.getString();
611 case RC_JBIBTEX_COMMAND:
612 if (lexrc.next(true)) {
613 jbibtex_command = lexrc.getString();
617 case RC_INDEX_ALTERNATIVES:
618 if (lexrc.next(true)) {
619 index_alternatives.insert(lexrc.getString());
623 case RC_INDEX_COMMAND:
624 if (lexrc.next(true)) {
625 index_command = lexrc.getString();
629 case RC_JINDEX_COMMAND:
630 if (lexrc.next(true)) {
631 jindex_command = lexrc.getString();
635 case RC_SPLITINDEX_COMMAND:
636 if (lexrc.next(true)) {
637 splitindex_command = lexrc.getString();
641 case RC_NOMENCL_COMMAND:
642 if (lexrc.next(true)) {
643 nomencl_command = lexrc.getString();
655 case RC_GEOMETRY_SESSION:
656 lexrc >> allow_geometry_session;
659 case RC_SCREEN_FONT_SIZES:
660 lexrc >> font_sizes[FONT_SIZE_TINY];
661 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
662 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
663 lexrc >> font_sizes[FONT_SIZE_SMALL];
664 lexrc >> font_sizes[FONT_SIZE_NORMAL];
665 lexrc >> font_sizes[FONT_SIZE_LARGE];
666 lexrc >> font_sizes[FONT_SIZE_LARGER];
667 lexrc >> font_sizes[FONT_SIZE_LARGEST];
668 lexrc >> font_sizes[FONT_SIZE_HUGE];
669 lexrc >> font_sizes[FONT_SIZE_HUGER];
672 case RC_SCREEN_FONT_SCALABLE:
673 lexrc >> use_scalable_fonts;
680 case RC_DOCUMENTPATH:
682 document_path = os::internal_path(lexrc.getString());
683 document_path = expandPath(document_path);
689 example_path = os::internal_path(lexrc.getString());
690 example_path = expandPath(example_path);
694 case RC_TEMPLATEPATH:
696 template_path = os::internal_path(lexrc.getString());
697 template_path = expandPath(template_path);
703 tempdir_path = os::internal_path(lexrc.getString());
704 tempdir_path = expandPath(tempdir_path);
708 case RC_THESAURUSDIRPATH:
710 thesaurusdir_path = os::internal_path(lexrc.getString());
711 thesaurusdir_path = expandPath(thesaurusdir_path);
717 LYXERR0("Ignoring obsolete use_tempdir flag.");
720 case RC_USELASTFILEPOS:
721 lexrc >> use_lastfilepos;
725 lexrc >> load_session;
728 case RC_MOUSE_WHEEL_SPEED:
729 lexrc >> mouse_wheel_speed;
732 case RC_COMPLETION_INLINE_DELAY:
733 lexrc >> completion_inline_delay;
736 case RC_COMPLETION_INLINE_MATH:
737 lexrc >> completion_inline_math;
740 case RC_COMPLETION_INLINE_TEXT:
741 lexrc >> completion_inline_text;
744 case RC_COMPLETION_INLINE_DOTS:
745 lexrc >> completion_inline_dots;
748 case RC_AUTOCORRECTION_MATH:
749 lexrc >> autocorrection_math;
752 case RC_COMPLETION_POPUP_DELAY:
753 lexrc >> completion_popup_delay;
756 case RC_COMPLETION_POPUP_MATH:
757 lexrc >> completion_popup_math;
760 case RC_COMPLETION_POPUP_TEXT:
761 lexrc >> completion_popup_text;
764 case RC_COMPLETION_CURSOR_TEXT:
765 lexrc >> completion_cursor_text;
768 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
769 lexrc >> completion_popup_after_complete;
772 case RC_NUMLASTFILES:
773 lexrc >> num_lastfiles;
776 case RC_CHECKLASTFILES:
777 lexrc >> check_lastfiles;
780 case RC_SCREEN_FONT_ROMAN:
782 roman_font_name = lexrc.getString();
783 oldFontFormat(roman_font_name,
788 case RC_SCREEN_FONT_SANS:
790 sans_font_name = lexrc.getString();
791 oldFontFormat(sans_font_name, sans_font_foundry);
795 case RC_SCREEN_FONT_TYPEWRITER:
797 typewriter_font_name = lexrc.getString();
798 oldFontFormat(typewriter_font_name,
799 typewriter_font_foundry);
803 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
804 lexrc >> roman_font_foundry;
807 case RC_SCREEN_FONT_SANS_FOUNDRY:
808 lexrc >> sans_font_foundry;
811 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
812 lexrc >> typewriter_font_foundry;
817 lexrc.printError("Missing color tag.");
820 string lyx_name = lexrc.getString();
823 lexrc.printError("Missing color name for color: `$$Token'");
826 string x11_name = lexrc.getString();
828 ColorCode const col =
829 lcolor.getFromLyXName(lyx_name);
830 if (col == Color_none ||
831 col == Color_inherit ||
835 if (!lcolor.setColor(col, x11_name))
836 LYXERR0("Bad lyxrc set_color for " << lyx_name);
840 case RC_AUTOREGIONDELETE:
841 // Auto region delete defaults to true
842 lexrc >> auto_region_delete;
847 lyxpipes = os::internal_path(lexrc.getString());
848 lyxpipes = expandPath(lyxpipes);
852 case RC_CURSOR_FOLLOWS_SCROLLBAR:
853 lexrc >> cursor_follows_scrollbar;
856 case RC_SCROLL_BELOW_DOCUMENT:
857 lexrc >> scroll_below_document;
860 case RC_MAC_LIKE_WORD_MOVEMENT:
861 lexrc >> mac_like_word_movement;
864 case RC_MACRO_EDIT_STYLE:
866 switch (lexrc.getInteger()) {
867 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
868 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
869 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
874 case RC_DIALOGS_ICONIFY_WITH_MAIN:
875 lexrc >> dialogs_iconify_with_main;
878 case RC_PLAINTEXT_ROFF_COMMAND:
879 (void) lexrc.getString(); // Obsoleted in 2.0
881 case RC_PLAINTEXT_LINELEN:
882 lexrc >> plaintext_linelen;
884 // Spellchecker settings:
885 case RC_ACCEPT_COMPOUND:
886 lexrc >> spellchecker_accept_compound;
889 lexrc >> spellchecker_use_input_encoding;
891 case RC_USE_ALT_LANG:
892 lexrc >> spellchecker_use_alt_lang;
894 case RC_USE_PERS_DICT:
895 lexrc >> spellchecker_use_pers_dict;
898 lexrc >> use_tooltip;
900 case RC_USE_PIXMAP_CACHE:
901 lexrc >> use_pixmap_cache;
903 case RC_USE_ESC_CHARS:
904 lexrc >> spellchecker_use_esc_chars;
907 lexrc >> spellchecker_alt_lang;
911 spellchecker_pers_dict = os::internal_path(lexrc.getString());
914 lexrc >> spellchecker_esc_chars;
916 case RC_SPELLCHECK_CONTINUOUSLY:
917 lexrc >> spellcheck_continuously;
920 lexrc >> make_backup;
922 case RC_BACKUPDIR_PATH:
924 backupdir_path = os::internal_path(lexrc.getString());
925 backupdir_path = expandPath(backupdir_path);
928 case RC_DATE_INSERT_FORMAT:
929 lexrc >> date_insert_format;
931 case RC_LANGUAGE_PACKAGE:
932 lexrc >> language_package;
934 case RC_LANGUAGE_AUTO_BEGIN:
935 lexrc >> language_auto_begin;
937 case RC_LANGUAGE_AUTO_END:
938 lexrc >> language_auto_end;
940 case RC_LANGUAGE_GLOBAL_OPTIONS:
941 lexrc >> language_global_options;
943 case RC_LANGUAGE_USE_BABEL:
944 lexrc >> language_use_babel;
946 case RC_LANGUAGE_COMMAND_BEGIN:
947 lexrc >> language_command_begin;
949 case RC_LANGUAGE_COMMAND_END:
950 lexrc >> language_command_end;
952 case RC_LANGUAGE_COMMAND_LOCAL:
953 lexrc >> language_command_local;
956 lexrc >> rtl_support;
958 case RC_VISUAL_CURSOR:
959 lexrc >> visual_cursor;
962 lexrc >> auto_number;
964 case RC_MARK_FOREIGN_LANGUAGE:
965 lexrc >> mark_foreign_language;
971 fmt = lexrc.getString();
972 if (lexrc.next(true))
973 command = lexrc.getString();
974 setMover(fmt, command);
979 string from, to, command, flags;
981 from = lexrc.getString();
983 to = lexrc.getString();
984 if (lexrc.next(true))
985 command = lexrc.getString();
987 flags = lexrc.getString();
989 theConverters().erase(from, to);
991 theConverters().add(from, to, command, flags);
994 // compatibility with versions older than 1.4.0 only
996 string format, command;
997 lexrc >> format >> command;
998 formats.setViewer(format, command);
1002 string format, extension, prettyname, shortcut;
1003 lexrc >> format >> extension >> prettyname >> shortcut;
1004 string viewer, editor;
1005 if (lexrc.next(true))
1006 viewer = lexrc.getString();
1007 if (lexrc.next(true))
1008 editor = lexrc.getString();
1010 // Hack to ensure compatibility with versions older
1012 int le = lexrc.lex();
1013 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1014 flags = lexrc.getString();
1015 if (le != Lexer::LEX_DATA) {
1016 // We have got a known token.
1017 // Therefore this is an old style
1018 // format definition without
1020 lexrc.pushToken(flags);
1024 int flgs = Format::none;
1025 while (!flags.empty()) {
1027 flags = split(flags, flag, ',');
1028 if (flag == "document")
1029 flgs |= Format::document;
1030 else if (flag == "vector")
1031 flgs |= Format::vector;
1033 LYXERR0("Ignoring unknown flag `"
1034 << flag << "' for format `"
1037 if (prettyname.empty()) {
1038 if (theConverters().formatIsUsed(format))
1039 LYXERR0("Can't delete format " << format);
1041 formats.erase(format);
1043 formats.add(format, extension, prettyname,
1044 shortcut, viewer, editor, flgs);
1048 case RC_DEFAULT_VIEW_FORMAT:
1049 lexrc >> default_view_format;
1052 case RC_DEFAULT_LANGUAGE:
1053 lexrc >> default_language;
1056 case RC_GUI_LANGUAGE:
1057 lexrc >> gui_language;
1060 case RC_LABEL_INIT_LENGTH:
1061 lexrc >> label_init_length;
1064 case RC_SHOW_BANNER:
1065 lexrc >> show_banner;
1070 string const tmp = lexrc.getString();
1071 if (tmp == "true" || tmp == "on")
1072 preview = PREVIEW_ON;
1073 else if (tmp == "no_math")
1074 preview = PREVIEW_NO_MATH;
1076 preview = PREVIEW_OFF;
1077 if (tmp != "false" && tmp != "off")
1078 LYXERR0("Unrecognized preview status \""
1084 case RC_PREVIEW_HASHED_LABELS:
1085 lexrc >> preview_hashed_labels;
1088 case RC_PREVIEW_SCALE_FACTOR:
1089 lexrc >> preview_scale_factor;
1096 lexrc >> user_email;
1099 case RC_PATH_PREFIX:
1100 lexrc >> path_prefix;
1103 case RC_USE_CONVERTER_CACHE:
1104 lexrc >> use_converter_cache;
1106 case RC_CONVERTER_CACHE_MAXAGE:
1107 lexrc >> converter_cache_maxage;
1110 case RC_SORT_LAYOUTS:
1111 lexrc >> sort_layouts;
1113 case RC_GROUP_LAYOUTS:
1114 lexrc >> group_layouts;
1116 case RC_FULL_SCREEN_LIMIT:
1117 lexrc >> full_screen_limit;
1119 case RC_FULL_SCREEN_TOOLBARS:
1120 lexrc >> full_screen_toolbars;
1122 case RC_FULL_SCREEN_SCROLLBAR:
1123 lexrc >> full_screen_scrollbar;
1125 case RC_FULL_SCREEN_TABBAR:
1126 lexrc >> full_screen_tabbar;
1128 case RC_FULL_SCREEN_MENUBAR:
1129 lexrc >> full_screen_menubar;
1131 case RC_FULL_SCREEN_WIDTH:
1132 lexrc >> full_screen_width;
1134 case RC_OPEN_BUFFERS_IN_TABS:
1135 lexrc >> open_buffers_in_tabs;
1139 case RC_SPELL_COMMAND:
1140 case RC_USE_SPELL_LIB:
1141 (void) lexrc.getString();
1145 break; // this is just a dummy
1149 /// Update converters data-structures
1150 theConverters().update(formats);
1151 theConverters().buildGraph();
1157 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1159 ofstream ofs(filename.toFilesystemEncoding().c_str());
1161 write(ofs, ignore_system_lyxrc);
1165 void LyXRC::print() const
1167 if (lyxerr.debugging())
1168 write(lyxerr, false);
1176 typedef pair<string, SpecialisedMover> Data;
1178 SameMover(Data const & comparison)
1179 : comparison_(comparison) {}
1181 bool operator()(Data const & data) const
1183 return data.first == comparison_.first &&
1184 data.second.command() == comparison_.second.command();
1194 // Escape \ and " so that LyXLex can read the string later
1195 string escapeCommand(string const & str) {
1196 return subst(subst(str , "\\", "\\\\"),
1203 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1205 LyXRCTags tag = RC_LAST;
1207 if (!name.empty()) {
1208 for (int i = 0; i != lyxrcCount; ++i)
1209 if ("\\" + name == lyxrcTags[i].tag)
1210 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1214 os << "# LyX " << lyx_version
1215 << " generated this file. If you want to make your own\n"
1216 << "# modifications you should do them from inside LyX and save.\n"
1219 // Why the switch you might ask. It is a trick to ensure that all
1220 // the elements in the LyXRCTags enum are handled. As you can see
1221 // there are no breaks at all. So it is just a huge fall-through.
1222 // The nice thing is that we will get a warning from the compiler
1223 // if we forget an element.
1227 // input/include files are not done here
1229 if (ignore_system_lyxrc ||
1230 bind_file != system_lyxrc.bind_file) {
1231 string const path = os::external_path(bind_file);
1232 os << "\\bind_file \"" << path << "\"\n";
1238 if (ignore_system_lyxrc ||
1239 def_file != system_lyxrc.def_file) {
1240 string const path = os::external_path(def_file);
1241 os << "\\def_file \"" << path << "\"\n";
1250 << "# MISC SECTION ######################################\n"
1252 // bind files are not done here.
1254 case RC_PATH_PREFIX:
1255 if (ignore_system_lyxrc ||
1256 path_prefix != system_lyxrc.path_prefix) {
1257 os << "\\path_prefix \"" << path_prefix << "\"\n";
1262 if (ignore_system_lyxrc ||
1263 ui_file != system_lyxrc.ui_file) {
1264 string const path = os::external_path(ui_file);
1265 os << "\\ui_file \"" << path << "\"\n";
1269 case RC_AUTOREGIONDELETE:
1270 if (ignore_system_lyxrc ||
1271 auto_region_delete != system_lyxrc.auto_region_delete) {
1272 os << "# Set to false to inhibit automatic replacement of\n"
1273 << "# the current selection.\n"
1274 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1279 case RC_AUTORESET_OPTIONS:
1280 if (ignore_system_lyxrc ||
1281 auto_reset_options != system_lyxrc.auto_reset_options) {
1282 os << "# Set to false to inhibit automatic reset of\n"
1283 << "# the class options to defaults on class change.\n"
1284 << "\\auto_reset_options "
1285 << convert<string>(auto_reset_options)
1291 if (ignore_system_lyxrc ||
1292 autosave != system_lyxrc.autosave) {
1293 os << "# The time interval between auto-saves in seconds.\n"
1294 << "\\autosave " << autosave << '\n';
1298 case RC_DISPLAY_GRAPHICS:
1299 if (ignore_system_lyxrc ||
1300 display_graphics != system_lyxrc.display_graphics) {
1301 os << "# Display graphics within LyX\n"
1303 << "\\display_graphics "
1304 << (display_graphics ? "true" : "false")
1309 case RC_SORT_LAYOUTS:
1310 if (ignore_system_lyxrc ||
1311 sort_layouts != system_lyxrc.sort_layouts) {
1312 os << "# Sort layouts alphabetically.\n"
1313 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1317 case RC_GROUP_LAYOUTS:
1318 if (ignore_system_lyxrc ||
1319 group_layouts != system_lyxrc.group_layouts) {
1320 os << "# Group layouts by their category.\n"
1321 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1325 case RC_VIEWDVI_PAPEROPTION:
1326 if (ignore_system_lyxrc ||
1327 view_dvi_paper_option
1328 != system_lyxrc.view_dvi_paper_option) {
1329 os << "# Options used to specify paper size to the\n"
1330 << "# view_dvi_command (e.g. -paper)\n"
1331 << "\\view_dvi_paper_option \""
1332 << view_dvi_paper_option << "\"\n";
1336 case RC_DEFAULT_PAPERSIZE:
1337 if (ignore_system_lyxrc ||
1338 default_papersize != system_lyxrc.default_papersize) {
1339 os << "# The default papersize to use.\n"
1340 << "\\default_papersize \"";
1341 switch (default_papersize) {
1343 os << "default"; break;
1344 case PAPER_USLETTER:
1345 os << "usletter"; break;
1347 os << "legal"; break;
1348 case PAPER_USEXECUTIVE:
1349 os << "executive"; break;
1360 case PAPER_B4: break;
1366 case RC_CHKTEX_COMMAND:
1367 if (ignore_system_lyxrc ||
1368 chktex_command != system_lyxrc.chktex_command) {
1369 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1373 case RC_BIBTEX_ALTERNATIVES: {
1374 set<string>::const_iterator it = bibtex_alternatives.begin();
1375 set<string>::const_iterator end = bibtex_alternatives.end();
1376 for ( ; it != end; ++it) {
1377 if (ignore_system_lyxrc
1378 || !system_lyxrc.bibtex_alternatives.count(*it))
1379 os << "\\bibtex_alternatives \""
1385 case RC_BIBTEX_COMMAND:
1386 if (ignore_system_lyxrc ||
1387 bibtex_command != system_lyxrc.bibtex_command) {
1388 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1392 case RC_JBIBTEX_COMMAND:
1393 if (ignore_system_lyxrc ||
1394 jbibtex_command != system_lyxrc.jbibtex_command) {
1395 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1399 case RC_INDEX_ALTERNATIVES: {
1400 set<string>::const_iterator it = index_alternatives.begin();
1401 set<string>::const_iterator end = index_alternatives.end();
1402 for ( ; it != end; ++it) {
1403 if (ignore_system_lyxrc
1404 || !system_lyxrc.index_alternatives.count(*it))
1405 os << "\\index_alternatives \""
1411 case RC_INDEX_COMMAND:
1412 if (ignore_system_lyxrc ||
1413 index_command != system_lyxrc.index_command) {
1414 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1418 case RC_JINDEX_COMMAND:
1419 if (ignore_system_lyxrc ||
1420 jindex_command != system_lyxrc.jindex_command) {
1421 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1425 case RC_SPLITINDEX_COMMAND:
1426 if (ignore_system_lyxrc ||
1427 splitindex_command != system_lyxrc.splitindex_command) {
1428 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1432 case RC_NOMENCL_COMMAND:
1433 if (ignore_system_lyxrc ||
1434 nomencl_command != system_lyxrc.nomencl_command) {
1435 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1439 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1440 if (ignore_system_lyxrc ||
1441 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1442 os << "\\tex_expects_windows_paths "
1443 << convert<string>(windows_style_tex_paths) << '\n';
1447 case RC_TEX_ALLOWS_SPACES:
1448 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1449 os << "\\tex_allows_spaces "
1450 << convert<string>(tex_allows_spaces) << '\n';
1455 if (ignore_system_lyxrc ||
1456 use_kbmap != system_lyxrc.use_kbmap) {
1457 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1461 case RC_KBMAP_PRIMARY:
1462 if (ignore_system_lyxrc ||
1463 primary_kbmap != system_lyxrc.primary_kbmap) {
1464 string const path = os::external_path(primary_kbmap);
1465 os << "\\kbmap_primary \"" << path << "\"\n";
1469 case RC_KBMAP_SECONDARY:
1470 if (ignore_system_lyxrc ||
1471 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1472 string const path = os::external_path(secondary_kbmap);
1473 os << "\\kbmap_secondary \"" << path << "\"\n";
1478 if (ignore_system_lyxrc ||
1479 lyxpipes != system_lyxrc.lyxpipes) {
1480 string const path = os::external_path(lyxpipes);
1481 os << "\\serverpipe \"" << path << "\"\n";
1485 case RC_DATE_INSERT_FORMAT:
1486 if (ignore_system_lyxrc ||
1487 date_insert_format != system_lyxrc.date_insert_format) {
1488 os << "\\date_insert_format \"" << date_insert_format
1493 case RC_LABEL_INIT_LENGTH:
1494 if (ignore_system_lyxrc ||
1495 label_init_length != system_lyxrc.label_init_length) {
1496 os << "\\label_init_length " << label_init_length
1503 os << "\\user_name \"" << user_name << "\"\n";
1508 os << "\\user_email \"" << user_email << "\"\n";
1512 case RC_SHOW_BANNER:
1513 if (ignore_system_lyxrc ||
1514 show_banner != system_lyxrc.show_banner) {
1515 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1521 if (ignore_system_lyxrc ||
1522 preview != system_lyxrc.preview) {
1528 case PREVIEW_NO_MATH:
1535 os << "\\preview " << status << '\n';
1540 case RC_PREVIEW_HASHED_LABELS:
1541 if (ignore_system_lyxrc ||
1542 preview_hashed_labels !=
1543 system_lyxrc.preview_hashed_labels) {
1544 os << "\\preview_hashed_labels "
1545 << convert<string>(preview_hashed_labels) << '\n';
1550 case RC_PREVIEW_SCALE_FACTOR:
1551 if (ignore_system_lyxrc ||
1552 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1553 os << "\\preview_scale_factor "
1554 << preview_scale_factor << '\n';
1559 case RC_USE_CONVERTER_CACHE:
1560 if (ignore_system_lyxrc ||
1561 use_converter_cache != system_lyxrc.use_converter_cache) {
1562 os << "\\use_converter_cache "
1563 << convert<string>(use_converter_cache) << '\n';
1568 case RC_CONVERTER_CACHE_MAXAGE:
1569 if (ignore_system_lyxrc ||
1570 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1571 os << "\\converter_cache_maxage "
1572 << converter_cache_maxage << '\n';
1578 << "# SCREEN & FONTS SECTION ############################\n"
1582 if (ignore_system_lyxrc ||
1583 dpi != system_lyxrc.dpi) {
1584 os << "\\screen_dpi " << dpi << '\n';
1588 case RC_SCREEN_ZOOM:
1589 if (ignore_system_lyxrc ||
1590 zoom != system_lyxrc.zoom) {
1591 os << "\\screen_zoom " << zoom << '\n';
1595 case RC_GEOMETRY_SESSION:
1596 if (ignore_system_lyxrc ||
1597 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1598 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1603 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1604 if (ignore_system_lyxrc ||
1605 cursor_follows_scrollbar
1606 != system_lyxrc.cursor_follows_scrollbar) {
1607 os << "\\cursor_follows_scrollbar "
1608 << convert<string>(cursor_follows_scrollbar) << '\n';
1612 case RC_SCROLL_BELOW_DOCUMENT:
1613 if (ignore_system_lyxrc ||
1614 scroll_below_document
1615 != system_lyxrc.scroll_below_document) {
1616 os << "\\scroll_below_document "
1617 << convert<string>(scroll_below_document) << '\n';
1621 case RC_MAC_LIKE_WORD_MOVEMENT:
1622 if (ignore_system_lyxrc ||
1623 mac_like_word_movement
1624 != system_lyxrc.mac_like_word_movement) {
1625 os << "\\mac_like_word_movement "
1626 << convert<string>(mac_like_word_movement) << '\n';
1630 case RC_MACRO_EDIT_STYLE:
1631 if (ignore_system_lyxrc ||
1633 != system_lyxrc.macro_edit_style) {
1634 os << "\\macro_edit_style ";
1635 switch (macro_edit_style) {
1636 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1637 case MACRO_EDIT_INLINE: os << "1\n"; break;
1638 case MACRO_EDIT_LIST: os << "2\n"; break;
1643 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1644 if (ignore_system_lyxrc ||
1645 dialogs_iconify_with_main
1646 != system_lyxrc.dialogs_iconify_with_main) {
1647 os << "\\dialogs_iconify_with_main "
1648 << convert<string>(dialogs_iconify_with_main) << '\n';
1652 case RC_SCREEN_FONT_ROMAN:
1653 if (ignore_system_lyxrc ||
1654 roman_font_name != system_lyxrc.roman_font_name) {
1655 os << "\\screen_font_roman \"" << roman_font_name
1660 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1661 if (ignore_system_lyxrc ||
1662 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1663 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1668 case RC_SCREEN_FONT_SANS:
1669 if (ignore_system_lyxrc ||
1670 sans_font_name != system_lyxrc.sans_font_name) {
1671 os << "\\screen_font_sans \"" << sans_font_name
1676 case RC_SCREEN_FONT_SANS_FOUNDRY:
1677 if (ignore_system_lyxrc ||
1678 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1679 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1684 case RC_SCREEN_FONT_TYPEWRITER:
1685 if (ignore_system_lyxrc ||
1686 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1687 os << "\\screen_font_typewriter \""
1688 << typewriter_font_name << "\"\n";
1692 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1693 if (ignore_system_lyxrc ||
1694 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1695 os << "\\screen_font_typewriter_foundry \""
1696 << typewriter_font_foundry << "\"\n";
1701 case RC_SCREEN_FONT_SCALABLE:
1702 if (ignore_system_lyxrc ||
1703 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1704 os << "\\screen_font_scalable "
1705 << convert<string>(use_scalable_fonts)
1710 case RC_SCREEN_FONT_SIZES:
1711 if (ignore_system_lyxrc ||
1712 font_sizes[FONT_SIZE_TINY]
1713 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1714 font_sizes[FONT_SIZE_SCRIPT]
1715 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1716 font_sizes[FONT_SIZE_FOOTNOTE]
1717 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1718 font_sizes[FONT_SIZE_SMALL]
1719 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1720 font_sizes[FONT_SIZE_NORMAL]
1721 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1722 font_sizes[FONT_SIZE_LARGE]
1723 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1724 font_sizes[FONT_SIZE_LARGER]
1725 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1726 font_sizes[FONT_SIZE_LARGEST]
1727 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1728 font_sizes[FONT_SIZE_HUGE]
1729 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1730 font_sizes[FONT_SIZE_HUGER]
1731 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1732 os.setf(ios::fixed);
1734 os << "\\screen_font_sizes"
1735 << ' ' << font_sizes[FONT_SIZE_TINY]
1736 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1737 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1738 << ' ' << font_sizes[FONT_SIZE_SMALL]
1739 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1740 << ' ' << font_sizes[FONT_SIZE_LARGE]
1741 << ' ' << font_sizes[FONT_SIZE_LARGER]
1742 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1743 << ' ' << font_sizes[FONT_SIZE_HUGE]
1744 << ' ' << font_sizes[FONT_SIZE_HUGER]
1749 case RC_FULL_SCREEN_LIMIT:
1750 if (ignore_system_lyxrc ||
1751 full_screen_limit != system_lyxrc.full_screen_limit) {
1752 os << "\\fullscreen_limit "
1753 << convert<string>(full_screen_limit)
1758 case RC_FULL_SCREEN_TOOLBARS:
1759 if (ignore_system_lyxrc ||
1760 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1761 os << "\\fullscreen_toolbars "
1762 << convert<string>(full_screen_toolbars)
1767 case RC_FULL_SCREEN_SCROLLBAR:
1768 if (ignore_system_lyxrc ||
1769 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1770 os << "\\fullscreen_scrollbar "
1771 << convert<string>(full_screen_scrollbar)
1776 case RC_FULL_SCREEN_TABBAR:
1777 if (ignore_system_lyxrc ||
1778 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1779 os << "\\fullscreen_tabbar "
1780 << convert<string>(full_screen_tabbar)
1785 case RC_FULL_SCREEN_MENUBAR:
1786 if (ignore_system_lyxrc ||
1787 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1788 os << "\\fullscreen_menubar "
1789 << convert<string>(full_screen_menubar)
1794 case RC_FULL_SCREEN_WIDTH:
1795 if (ignore_system_lyxrc ||
1796 full_screen_width != system_lyxrc.full_screen_width) {
1797 os << "\\fullscreen_width "
1798 << convert<string>(full_screen_width)
1803 case RC_OPEN_BUFFERS_IN_TABS:
1804 if (ignore_system_lyxrc ||
1805 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1806 os << "\\open_buffers_in_tabs "
1807 << convert<string>(open_buffers_in_tabs)
1814 << "# COLOR SECTION ###################################\n"
1818 for (int i = 0; i < Color_ignore; ++i) {
1819 ColorCode lc = static_cast<ColorCode>(i);
1820 string const col = lcolor.getX11Name(lc);
1821 if (ignore_system_lyxrc
1822 || col != system_lcolor.getX11Name(lc)) {
1823 os << "\\set_color \""
1824 << lcolor.getLyXName(lc) << "\" \""
1832 << "# PRINTER SECTION ###################################\n"
1836 if (ignore_system_lyxrc ||
1837 printer != system_lyxrc.printer) {
1838 os << "\\printer \"" << printer << "\"\n";
1842 case RC_PRINT_ADAPTOUTPUT:
1843 if (ignore_system_lyxrc ||
1844 print_adapt_output != system_lyxrc.print_adapt_output) {
1845 os << "\\print_adapt_output "
1846 << convert<string>(print_adapt_output)
1851 case RC_PRINT_COMMAND:
1852 if (ignore_system_lyxrc ||
1853 print_command != system_lyxrc.print_command) {
1854 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1858 case RC_PRINTEXSTRAOPTIONS:
1859 if (ignore_system_lyxrc ||
1860 print_extra_options != system_lyxrc.print_extra_options) {
1861 os << "\\print_extra_options \"" << print_extra_options
1866 case RC_PRINTSPOOL_COMMAND:
1867 if (ignore_system_lyxrc ||
1868 print_spool_command != system_lyxrc.print_spool_command) {
1869 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1874 case RC_PRINTSPOOL_PRINTERPREFIX:
1875 if (ignore_system_lyxrc ||
1876 print_spool_printerprefix
1877 != system_lyxrc.print_spool_printerprefix) {
1878 os << "\\print_spool_printerprefix \""
1879 << print_spool_printerprefix << "\"\n";
1883 case RC_PRINTEVENPAGEFLAG:
1884 if (ignore_system_lyxrc ||
1885 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1886 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1891 case RC_PRINTODDPAGEFLAG:
1892 if (ignore_system_lyxrc ||
1893 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1894 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1899 case RC_PRINTREVERSEFLAG:
1900 if (ignore_system_lyxrc ||
1901 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1902 os << "\\print_reverse_flag \"" << print_reverse_flag
1907 case RC_PRINTLANDSCAPEFLAG:
1908 if (ignore_system_lyxrc ||
1909 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1910 os << "\\print_landscape_flag \"" << print_landscape_flag
1915 case RC_PRINTPAGERANGEFLAG:
1916 if (ignore_system_lyxrc ||
1917 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1918 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1923 case RC_PRINTCOPIESFLAG:
1924 if (ignore_system_lyxrc ||
1925 print_copies_flag != system_lyxrc.print_copies_flag) {
1926 os << "\\print_copies_flag \"" << print_copies_flag
1931 case RC_PRINTCOLLCOPIESFLAG:
1932 if (ignore_system_lyxrc ||
1933 print_collcopies_flag
1934 != system_lyxrc.print_collcopies_flag) {
1935 os << "\\print_collcopies_flag \""
1936 << print_collcopies_flag
1941 case RC_PRINTPAPERFLAG:
1942 if (ignore_system_lyxrc ||
1943 print_paper_flag != system_lyxrc.print_paper_flag) {
1944 os << "\\print_paper_flag \"" << print_paper_flag
1949 case RC_PRINTPAPERDIMENSIONFLAG:
1950 if (ignore_system_lyxrc ||
1951 print_paper_dimension_flag
1952 != system_lyxrc.print_paper_dimension_flag) {
1953 os << "\\print_paper_dimension_flag \""
1954 << print_paper_dimension_flag << "\"\n";
1958 case RC_PRINTTOPRINTER:
1959 if (ignore_system_lyxrc ||
1960 print_to_printer != system_lyxrc.print_to_printer) {
1961 os << "\\print_to_printer \"" << print_to_printer
1966 case RC_PRINTTOFILE:
1967 if (ignore_system_lyxrc ||
1968 print_to_file != system_lyxrc.print_to_file) {
1969 string const path = os::external_path(print_to_file);
1970 os << "\\print_to_file \"" << path << "\"\n";
1974 case RC_PRINTFILEEXTENSION:
1975 if (ignore_system_lyxrc ||
1976 print_file_extension != system_lyxrc.print_file_extension) {
1977 os << "\\print_file_extension \""
1978 << print_file_extension
1985 << "# TEX SECTION #######################################\n"
1988 case RC_FONT_ENCODING:
1989 if (ignore_system_lyxrc ||
1990 fontenc != system_lyxrc.fontenc) {
1991 os << "\\font_encoding \"" << fontenc << "\"\n";
1997 << "# FILE SECTION ######################################\n"
2000 case RC_DOCUMENTPATH:
2001 if (ignore_system_lyxrc ||
2002 document_path != system_lyxrc.document_path) {
2003 string const path = os::external_path(document_path);
2004 os << "\\document_path \"" << path << "\"\n";
2008 case RC_USELASTFILEPOS:
2009 if (ignore_system_lyxrc ||
2010 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2011 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2016 case RC_LOADSESSION:
2017 if (ignore_system_lyxrc ||
2018 load_session != system_lyxrc.load_session) {
2019 os << "\\load_session " << convert<string>(load_session)
2024 case RC_MOUSE_WHEEL_SPEED:
2025 if (ignore_system_lyxrc ||
2026 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2027 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2031 case RC_COMPLETION_INLINE_DELAY:
2032 if (ignore_system_lyxrc ||
2033 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2034 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2038 case RC_COMPLETION_INLINE_MATH:
2039 if (ignore_system_lyxrc ||
2040 completion_inline_math != system_lyxrc.completion_inline_math) {
2041 os << "\\completion_inline_math "
2042 << convert<string>(completion_inline_math) << '\n';
2046 case RC_COMPLETION_INLINE_TEXT:
2047 if (ignore_system_lyxrc ||
2048 completion_inline_text != system_lyxrc.completion_inline_text) {
2049 os << "\\completion_inline_text "
2050 << convert<string>(completion_inline_text) << '\n';
2054 case RC_COMPLETION_INLINE_DOTS:
2055 if (ignore_system_lyxrc ||
2056 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2057 os << "\\completion_inline_dots "
2058 << convert<string>(completion_inline_dots) << '\n';
2062 case RC_AUTOCORRECTION_MATH:
2063 if (ignore_system_lyxrc ||
2064 autocorrection_math != system_lyxrc.autocorrection_math) {
2065 os << "\\autocorrection_math "
2066 << convert<string>(autocorrection_math) << '\n';
2070 case RC_COMPLETION_POPUP_DELAY:
2071 if (ignore_system_lyxrc ||
2072 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2073 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2077 case RC_COMPLETION_POPUP_MATH:
2078 if (ignore_system_lyxrc ||
2079 completion_popup_math != system_lyxrc.completion_popup_math) {
2080 os << "\\completion_popup_math "
2081 << convert<string>(completion_popup_math) << '\n';
2085 case RC_COMPLETION_POPUP_TEXT:
2086 if (ignore_system_lyxrc ||
2087 completion_popup_text != system_lyxrc.completion_popup_text) {
2088 os << "\\completion_popup_text "
2089 << convert<string>(completion_popup_text) << '\n';
2093 case RC_COMPLETION_CURSOR_TEXT:
2094 if (ignore_system_lyxrc ||
2095 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2096 os << "\\completion_cursor_text "
2097 << convert<string>(completion_cursor_text) << '\n';
2101 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2102 if (ignore_system_lyxrc ||
2103 completion_popup_after_complete
2104 != system_lyxrc.completion_popup_after_complete) {
2105 os << "\\completion_popup_after_complete "
2106 << convert<string>(completion_popup_after_complete) << '\n';
2110 case RC_NUMLASTFILES:
2111 if (ignore_system_lyxrc ||
2112 num_lastfiles != system_lyxrc.num_lastfiles) {
2113 os << "\\num_lastfiles " << num_lastfiles << '\n';
2117 case RC_CHECKLASTFILES:
2118 if (ignore_system_lyxrc ||
2119 check_lastfiles != system_lyxrc.check_lastfiles) {
2120 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2125 case RC_EXAMPLEPATH:
2126 if (ignore_system_lyxrc ||
2127 example_path != system_lyxrc.example_path) {
2128 string const path = os::external_path(example_path);
2129 os << "\\example_path \"" << path << "\"\n";
2133 case RC_TEMPLATEPATH:
2134 if (ignore_system_lyxrc ||
2135 template_path != system_lyxrc.template_path) {
2136 string const path = os::external_path(template_path);
2137 os << "\\template_path \"" << path << "\"\n";
2141 case RC_TEMPDIRPATH:
2142 if (ignore_system_lyxrc ||
2143 tempdir_path != system_lyxrc.tempdir_path) {
2144 string const path = os::external_path(tempdir_path);
2145 os << "\\tempdir_path \"" << path << "\"\n";
2149 case RC_THESAURUSDIRPATH:
2150 if (ignore_system_lyxrc ||
2151 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2152 string const path = os::external_path(thesaurusdir_path);
2153 os << "\\thesaurusdir_path \"" << path << "\"\n";
2161 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2164 case RC_PLAINTEXT_LINELEN:
2165 if (ignore_system_lyxrc ||
2166 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2167 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2171 case RC_MAKE_BACKUP:
2172 if (ignore_system_lyxrc ||
2173 make_backup != system_lyxrc.make_backup) {
2174 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2178 case RC_BACKUPDIR_PATH:
2179 if (ignore_system_lyxrc ||
2180 backupdir_path != system_lyxrc.backupdir_path) {
2181 string const path = os::external_path(backupdir_path);
2182 os << "\\backupdir_path \"" << path << "\"\n";
2188 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2192 << "# SPELLCHECKER SECTION ##############################\n"
2195 case RC_SPELL_COMMAND:
2196 case RC_USE_SPELL_LIB:
2200 case RC_ACCEPT_COMPOUND:
2201 if (ignore_system_lyxrc ||
2202 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2203 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2208 case RC_USE_ALT_LANG:
2209 if (ignore_system_lyxrc ||
2210 spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
2211 os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
2217 if (ignore_system_lyxrc ||
2218 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2219 os << "\\alternate_language \"" << spellchecker_alt_lang
2224 case RC_USE_ESC_CHARS:
2225 if (ignore_system_lyxrc ||
2226 spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
2227 os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
2233 if (ignore_system_lyxrc ||
2234 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2235 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2239 case RC_USE_PERS_DICT:
2240 if (ignore_system_lyxrc ||
2241 spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
2242 os << "\\use_personal_dictionary "
2243 << convert<string>(spellchecker_use_pers_dict)
2248 case RC_USE_TOOLTIP:
2249 if (ignore_system_lyxrc ||
2250 use_tooltip != system_lyxrc.use_tooltip) {
2251 os << "\\use_tooltip "
2252 << convert<string>(use_tooltip)
2255 case RC_USE_PIXMAP_CACHE:
2256 if (ignore_system_lyxrc ||
2257 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2258 os << "\\use_pixmap_cache "
2259 << convert<string>(use_pixmap_cache)
2263 if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
2264 string const path = os::external_path(spellchecker_pers_dict);
2265 os << "\\personal_dictionary \"" << path << "\"\n";
2269 case RC_USE_INP_ENC:
2270 if (ignore_system_lyxrc ||
2271 spellchecker_use_input_encoding
2272 != system_lyxrc.spellchecker_use_input_encoding) {
2273 os << "\\use_input_encoding "
2274 << convert<string>(spellchecker_use_input_encoding)
2281 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2284 case RC_SPELLCHECK_CONTINUOUSLY:
2285 if (ignore_system_lyxrc ||
2286 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2287 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2293 case RC_RTL_SUPPORT:
2294 if (ignore_system_lyxrc ||
2295 rtl_support != system_lyxrc.rtl_support) {
2296 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2300 case RC_VISUAL_CURSOR:
2301 if (ignore_system_lyxrc ||
2302 visual_cursor != system_lyxrc.visual_cursor) {
2303 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2307 case RC_LANGUAGE_PACKAGE:
2308 if (ignore_system_lyxrc ||
2309 language_package != system_lyxrc.language_package) {
2310 os << "\\language_package \"" << language_package
2315 case RC_LANGUAGE_GLOBAL_OPTIONS:
2316 if (ignore_system_lyxrc ||
2317 language_global_options
2318 != system_lyxrc.language_global_options) {
2319 os << "\\language_global_options \""
2320 << convert<string>(language_global_options)
2325 case RC_LANGUAGE_USE_BABEL:
2326 if (ignore_system_lyxrc ||
2327 language_use_babel != system_lyxrc.language_use_babel) {
2328 os << "\\language_use_babel \""
2329 << convert<string>(language_use_babel)
2334 case RC_LANGUAGE_COMMAND_BEGIN:
2335 if (ignore_system_lyxrc ||
2336 language_command_begin
2337 != system_lyxrc.language_command_begin) {
2338 os << "\\language_command_begin \""
2339 << language_command_begin
2344 case RC_LANGUAGE_COMMAND_END:
2345 if (ignore_system_lyxrc ||
2346 language_command_end
2347 != system_lyxrc.language_command_end) {
2348 os << "\\language_command_end \"" << language_command_end
2353 case RC_LANGUAGE_COMMAND_LOCAL:
2354 if (ignore_system_lyxrc ||
2355 language_command_local
2356 != system_lyxrc.language_command_local) {
2357 os << "\\language_command_local \""
2358 << language_command_local
2363 case RC_LANGUAGE_AUTO_BEGIN:
2364 if (ignore_system_lyxrc ||
2365 language_auto_begin != system_lyxrc.language_auto_begin) {
2366 os << "\\language_auto_begin "
2367 << convert<string>(language_auto_begin) << '\n';
2371 case RC_LANGUAGE_AUTO_END:
2372 if (ignore_system_lyxrc ||
2373 language_auto_end != system_lyxrc.language_auto_end) {
2374 os << "\\language_auto_end "
2375 << convert<string>(language_auto_end) << '\n';
2379 case RC_MARK_FOREIGN_LANGUAGE:
2380 if (ignore_system_lyxrc ||
2381 mark_foreign_language
2382 != system_lyxrc.mark_foreign_language) {
2383 os << "\\mark_foreign_language " <<
2384 convert<string>(mark_foreign_language) << '\n';
2390 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2393 case RC_AUTO_NUMBER:
2394 if (ignore_system_lyxrc ||
2395 auto_number != system_lyxrc.auto_number) {
2396 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2400 case RC_DEFAULT_LANGUAGE:
2401 if (ignore_system_lyxrc ||
2402 default_language != system_lyxrc.default_language) {
2403 os << "\\default_language " << default_language << '\n';
2407 case RC_GUI_LANGUAGE:
2408 if (ignore_system_lyxrc ||
2409 gui_language != system_lyxrc.gui_language) {
2410 os << "\\gui_language " << gui_language << '\n';
2416 << "# FORMATS SECTION ##########################\n"
2420 // New/modified formats
2421 for (Formats::const_iterator cit = formats.begin();
2422 cit != formats.end(); ++cit) {
2423 Format const * format =
2424 system_formats.getFormat(cit->name());
2426 format->extension() != cit->extension() ||
2427 format->prettyname() != cit->prettyname() ||
2428 format->shortcut() != cit->shortcut() ||
2429 format->viewer() != cit->viewer() ||
2430 format->editor() != cit->editor() ||
2431 format->documentFormat() != cit->documentFormat() ||
2432 format->vectorFormat() != cit->vectorFormat()) {
2433 os << "\\format \"" << cit->name() << "\" \""
2434 << cit->extension() << "\" \""
2435 << cit->prettyname() << "\" \""
2436 << cit->shortcut() << "\" \""
2437 << escapeCommand(cit->viewer()) << "\" \""
2438 << escapeCommand(cit->editor()) << "\" \"";
2439 vector<string> flags;
2440 if (cit->documentFormat())
2441 flags.push_back("document");
2442 if (cit->vectorFormat())
2443 flags.push_back("vector");
2444 os << getStringFromVector(flags);
2449 // Look for deleted formats
2450 for (Formats::const_iterator cit = system_formats.begin();
2451 cit != system_formats.end(); ++cit)
2452 if (!formats.getFormat(cit->name()))
2453 os << "\\format \"" << cit->name()
2454 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2457 case RC_DEFAULT_VIEW_FORMAT:
2458 if (ignore_system_lyxrc ||
2459 default_view_format != system_lyxrc.default_view_format) {
2460 os << "\\default_view_format " << default_view_format << '\n';
2470 << "# CONVERTERS SECTION ##########################\n"
2474 // Look for new converters
2475 for (Converters::const_iterator cit = theConverters().begin();
2476 cit != theConverters().end(); ++cit) {
2477 Converter const * converter =
2478 theSystemConverters().getConverter(cit->from,
2481 converter->command != cit->command ||
2482 converter->flags != cit->flags)
2483 os << "\\converter \"" << cit->from << "\" \""
2484 << cit->to << "\" \""
2485 << escapeCommand(cit->command) << "\" \""
2486 << cit->flags << "\"\n";
2489 // New/modifed converters
2490 for (Converters::const_iterator cit = theSystemConverters().begin();
2491 cit != theSystemConverters().end(); ++cit)
2492 if (!theConverters().getConverter(cit->from, cit->to))
2493 os << "\\converter \"" << cit->from
2494 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2501 << "# COPIERS SECTION ##########################\n"
2504 // Look for new movers
2505 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2506 Movers::const_iterator const sysend = theSystemMovers().end();
2507 Movers::const_iterator it = theMovers().begin();
2508 Movers::const_iterator end = theMovers().end();
2510 for (; it != end; ++it) {
2511 Movers::const_iterator const sysit =
2512 find_if(sysbegin, sysend, SameMover(*it));
2513 if (sysit == sysend) {
2514 string const & fmt = it->first;
2515 string const & command =
2516 it->second.command();
2518 os << "\\copier " << fmt
2519 << " \"" << escapeCommand(command) << "\"\n";
2525 // We don't actually delete SpecialisedMover(s) from the
2526 // map, just clear their 'command', so there's no need
2527 // to test for anything else.
2535 string const LyXRC::getDescription(LyXRCTags tag)
2540 case RC_ACCEPT_COMPOUND:
2541 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2545 case RC_USE_ALT_LANG:
2546 str = _("Specify an alternate language. The default is to use the language of the document.");
2549 case RC_PLAINTEXT_ROFF_COMMAND:
2550 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.");
2553 case RC_PLAINTEXT_LINELEN:
2554 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.");
2557 case RC_AUTOREGIONDELETE:
2558 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2561 case RC_AUTORESET_OPTIONS:
2562 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2566 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2569 case RC_AUTO_NUMBER:
2572 case RC_BACKUPDIR_PATH:
2573 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.");
2576 case RC_BIBTEX_COMMAND:
2577 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2580 case RC_JBIBTEX_COMMAND:
2581 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2585 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2588 case RC_CHECKLASTFILES:
2589 str = _("Select to check whether the lastfiles still exist.");
2592 case RC_CHKTEX_COMMAND:
2593 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2602 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2603 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.");
2606 case RC_SCROLL_BELOW_DOCUMENT:
2607 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");
2610 case RC_MAC_LIKE_WORD_MOVEMENT:
2611 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2614 case RC_SHOW_MACRO_LABEL:
2615 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2618 case RC_DATE_INSERT_FORMAT:
2619 //xgettext:no-c-format
2620 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2624 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2627 case RC_DEFAULT_VIEW_FORMAT:
2628 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2631 case RC_DEFAULT_LANGUAGE:
2632 str = _("New documents will be assigned this language.");
2635 case RC_DEFAULT_PAPERSIZE:
2636 str = _("Specify the default paper size.");
2639 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2640 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2643 case RC_DISPLAY_GRAPHICS:
2644 str = _("Select how LyX will display any graphics.");
2647 case RC_DOCUMENTPATH:
2648 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2652 case RC_USE_ESC_CHARS:
2653 str = _("Specify additional chars that can be part of a word.");
2656 case RC_EXAMPLEPATH:
2657 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2660 case RC_FONT_ENCODING:
2661 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2667 case RC_INDEX_COMMAND:
2668 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\".");
2671 case RC_JINDEX_COMMAND:
2672 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2675 case RC_NOMENCL_COMMAND:
2676 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2683 case RC_KBMAP_PRIMARY:
2684 case RC_KBMAP_SECONDARY:
2685 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.");
2688 case RC_LABEL_INIT_LENGTH:
2689 str = _("Maximum number of words in the initialization string for a new label");
2692 case RC_LANGUAGE_AUTO_BEGIN:
2693 str = _("Select if a language switching command is needed at the beginning of the document.");
2696 case RC_LANGUAGE_AUTO_END:
2697 str = _("Select if a language switching command is needed at the end of the document.");
2700 case RC_LANGUAGE_COMMAND_BEGIN:
2701 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.");
2704 case RC_LANGUAGE_COMMAND_END:
2705 str = _("The LaTeX command for changing back to the language of the document.");
2708 case RC_LANGUAGE_COMMAND_LOCAL:
2709 str = _("The LaTeX command for local changing of the language.");
2712 case RC_LANGUAGE_GLOBAL_OPTIONS:
2713 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2716 case RC_LANGUAGE_PACKAGE:
2717 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2720 case RC_LANGUAGE_USE_BABEL:
2721 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2724 case RC_USELASTFILEPOS:
2725 str = _("De-select if you do not want LyX to scroll to saved position.");
2728 case RC_LOADSESSION:
2729 str = _("De-select to prevent loading files opened from the last LyX session.");
2732 case RC_MAKE_BACKUP:
2733 str = _("De-select if you don't want LyX to create backup files.");
2736 case RC_MARK_FOREIGN_LANGUAGE:
2737 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2740 case RC_MOUSE_WHEEL_SPEED:
2741 str = bformat(_("The scrolling speed of the mouse wheel."),
2745 case RC_COMPLETION_POPUP_DELAY:
2746 str = _("The completion popup delay.");
2749 case RC_COMPLETION_POPUP_MATH:
2750 str = _("Select to display the completion popup in math mode.");
2753 case RC_COMPLETION_POPUP_TEXT:
2754 str = _("Select to display the completion popup in text mode.");
2757 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2758 str = _("Show the completion popup without delay after non-unique completion attempt.");
2761 case RC_COMPLETION_POPUP_TEXT:
2762 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2765 case RC_COMPLETION_POPUP_DELAY:
2766 str = _("The inline completion delay.");
2769 case RC_COMPLETION_INLINE_MATH:
2770 str = _("Select to display the inline completion in math mode.");
2773 case RC_COMPLETION_INLINE_TEXT:
2774 str = _("Select to display the inline completion in text mode.");
2777 case RC_COMPLETION_INLINE_DOTS:
2778 str = _("Use \"...\" to shorten long completions.");
2781 case RC_AUTOCORRECTION_MATH:
2782 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2785 case RC_NUMLASTFILES:
2786 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2790 case RC_PATH_PREFIX:
2791 str = _("Specify those directories which should be "
2792 "prepended to the PATH environment variable. "
2793 "Use the OS native format.");
2797 case RC_USE_PERS_DICT:
2798 str = _("Specify an alternate personal dictionary file. E.g. \".aspell_english\".");
2802 str = _("Shows a typeset preview of things such as math");
2805 case RC_PREVIEW_HASHED_LABELS:
2806 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2809 case RC_PREVIEW_SCALE_FACTOR:
2810 str = _("Scale the preview size to suit.");
2813 case RC_PRINTCOLLCOPIESFLAG:
2814 str = _("The option for specifying whether the copies should be collated.");
2817 case RC_PRINTCOPIESFLAG:
2818 str = _("The option for specifying the number of copies to print.");
2822 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2825 case RC_PRINTEVENPAGEFLAG:
2826 str = _("The option to print only even pages.");
2829 case RC_PRINTEXSTRAOPTIONS:
2830 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2833 case RC_PRINTFILEEXTENSION:
2834 str = _("Extension of printer program output file. Usually \".ps\".");
2837 case RC_PRINTLANDSCAPEFLAG:
2838 str = _("The option to print out in landscape.");
2841 case RC_PRINTODDPAGEFLAG:
2842 str = _("The option to print only odd pages.");
2845 case RC_PRINTPAGERANGEFLAG:
2846 str = _("The option for specifying a comma-separated list of pages to print.");
2849 case RC_PRINTPAPERDIMENSIONFLAG:
2850 str = _("Option to specify the dimensions of the print paper.");
2853 case RC_PRINTPAPERFLAG:
2854 str = _("The option to specify paper type.");
2857 case RC_PRINTREVERSEFLAG:
2858 str = _("The option to reverse the order of the pages printed.");
2861 case RC_PRINTSPOOL_COMMAND:
2862 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.");
2865 case RC_PRINTSPOOL_PRINTERPREFIX:
2866 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.");
2869 case RC_PRINTTOFILE:
2870 str = _("Option to pass to the print program to print to a file.");
2873 case RC_PRINTTOPRINTER:
2874 str = _("Option to pass to the print program to print on a specific printer.");
2877 case RC_PRINT_ADAPTOUTPUT:
2878 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2881 case RC_PRINT_COMMAND:
2882 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2885 case RC_RTL_SUPPORT:
2886 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2889 case RC_VISUAL_CURSOR:
2890 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2894 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2897 case RC_SCREEN_FONT_ROMAN:
2898 case RC_SCREEN_FONT_SANS:
2899 case RC_SCREEN_FONT_TYPEWRITER:
2900 str = _("The screen fonts used to display the text while editing.");
2903 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2904 case RC_SCREEN_FONT_SANS_FOUNDRY:
2905 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2908 case RC_SCREEN_FONT_SCALABLE:
2909 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.");
2912 case RC_SCREEN_FONT_SIZES:
2913 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2916 case RC_SCREEN_ZOOM:
2917 //xgettext:no-c-format
2918 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2921 case RC_GEOMETRY_SESSION:
2922 str = _("Allow session manager to save and restore windows geometry.");
2926 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2932 case RC_SHOW_BANNER:
2933 str = _("De-select if you don't want the startup banner.");
2936 case RC_TEMPDIRPATH:
2937 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2940 case RC_THESAURUSDIRPATH:
2941 str = _("This is the place where the files of the thesaurus library reside.");
2944 case RC_TEMPLATEPATH:
2945 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2948 case RC_TEX_ALLOWS_SPACES:
2951 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2955 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2967 case RC_USE_INP_ENC:
2968 str = _("Specify whether to pass the -T input encoding option to aspell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
2971 case RC_USE_TOOLTIP:
2972 str = _("Enable the automatic appearance of tool tips in the work area.");
2975 case RC_USE_PIXMAP_CACHE:
2976 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2979 case RC_USE_SPELL_LIB:
2982 case RC_VIEWDVI_PAPEROPTION:
2983 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2998 // The global instance
3001 // The global copy of the system lyxrc entries (everything except preferences)