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.
25 #include "Converter.h"
29 #include "FontEnums.h"
32 #include "graphics/GraphicsTypes.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/userinfo.h"
44 using namespace lyx::support;
48 namespace os = support::os;
52 // when adding something to this array keep it sorted!
53 keyword_item lyxrcTags[] = {
54 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
55 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
56 { "\\alternate_language", LyXRC::RC_ALT_LANG },
57 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
58 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
59 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
60 { "\\autosave", LyXRC::RC_AUTOSAVE },
61 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
62 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
63 { "\\bind_file", LyXRC::RC_BINDFILE },
64 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
65 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
66 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
67 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
68 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
69 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
70 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
71 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
72 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
73 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
74 { "\\converter", LyXRC::RC_CONVERTER },
75 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
76 { "\\copier", LyXRC::RC_COPIER },
77 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
78 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
79 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
80 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
81 { "\\def_file", LyXRC::RC_DEFFILE },
82 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
83 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
84 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
85 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
86 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
87 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
88 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
89 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
90 { "\\format", LyXRC::RC_FORMAT },
91 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
92 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
93 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
94 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
95 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
96 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
97 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
98 { "\\input", LyXRC::RC_INPUT },
99 { "\\kbmap", LyXRC::RC_KBMAP },
100 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
101 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
102 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
103 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
104 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
105 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
106 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
107 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
108 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
109 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
110 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
111 { "\\load_session", LyXRC::RC_LOADSESSION },
112 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
113 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
114 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
115 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
116 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
117 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
118 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
119 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
120 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
121 { "\\preview", LyXRC::RC_PREVIEW },
122 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
123 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
124 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
125 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
126 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
127 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
128 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
129 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
130 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
131 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
132 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
133 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
134 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
135 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
136 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
137 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
138 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
139 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
140 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
141 { "\\printer", LyXRC::RC_PRINTER },
142 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
143 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
144 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
145 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
146 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
147 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
148 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
149 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
150 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
151 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
152 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
153 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
154 { "\\set_color", LyXRC::RC_SET_COLOR },
155 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
156 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
157 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
158 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
159 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
160 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
161 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
162 { "\\ui_file", LyXRC::RC_UIFILE },
163 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
164 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
165 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
166 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
167 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
168 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
169 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
170 // compatibility with versions older than 1.4.0 only
171 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
172 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
173 // compatibility with versions older than 1.4.0 only
174 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
175 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
176 { "\\user_email", LyXRC::RC_USER_EMAIL },
177 { "\\user_name", LyXRC::RC_USER_NAME },
178 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
179 // compatibility with versions older than 1.4.0 only
180 { "\\viewer", LyXRC::RC_VIEWER},
181 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
184 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
195 void LyXRC::setDefaults() {
197 def_file = "default";
199 // Get printer from the environment. If fail, use default "",
200 // assuming that everything is set up correctly.
201 printer = getEnv("PRINTER");
202 print_adapt_output = false;
203 print_command = "dvips";
204 print_evenpage_flag = "-B";
205 print_oddpage_flag = "-A";
206 print_pagerange_flag = "-pp";
207 print_copies_flag = "-c";
208 print_collcopies_flag = "-C";
209 print_reverse_flag = "-r";
210 print_landscape_flag = "-t landscape";
211 print_to_printer = "-P";
212 print_to_file = "-o ";
213 print_file_extension = ".ps";
214 print_paper_flag = "-t";
215 print_paper_dimension_flag = "-T";
216 document_path.erase();
217 view_dvi_paper_option.erase();
218 default_papersize = PAPER_DEFAULT;
219 custom_export_format = "ps";
220 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
221 bibtex_command = "bibtex";
223 index_command = "makeindex -c -q";
225 // Because a screen typically is wider than a piece of paper:
227 allow_geometry_session = true;
228 // Default LaTeX font size:
229 font_sizes[FONT_SIZE_TINY] = "5.0";
230 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
231 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
232 font_sizes[FONT_SIZE_SMALL] = "9.0";
233 font_sizes[FONT_SIZE_NORMAL] = "10.0";
234 font_sizes[FONT_SIZE_LARGE] = "12.0";
235 font_sizes[FONT_SIZE_LARGER] = "14.4";
236 font_sizes[FONT_SIZE_LARGEST] = "17.26";
237 font_sizes[FONT_SIZE_HUGE] = "20.74";
238 font_sizes[FONT_SIZE_HUGER] = "24.88";
239 use_scalable_fonts = true;
240 roman_font_name = "";
242 typewriter_font_name = "";
244 auto_region_delete = true;
245 auto_reset_options = false;
246 plaintext_linelen = 65;
247 mouse_wheel_speed = 1.0;
248 num_lastfiles = maxlastfiles;
249 check_lastfiles = true;
250 use_lastfilepos = true;
251 load_session = false;
253 backupdir_path.erase();
254 display_graphics = graphics::ColorDisplay;
255 // Spellchecker settings:
256 use_spell_lib = true;
257 isp_command = "ispell";
258 isp_accept_compound = false;
259 isp_use_input_encoding = false;
260 isp_use_alt_lang = false;
261 isp_use_pers_dict = false;
262 isp_use_esc_chars = false;
265 visual_cursor = false;
267 mark_foreign_language = true;
268 language_auto_begin = true;
269 language_auto_end = true;
270 language_global_options = true;
271 language_use_babel = true;
272 language_package = "\\usepackage{babel}";
273 language_command_begin = "\\selectlanguage{$$lang}";
274 language_command_local = "\\foreignlanguage{$$lang}{";
275 sort_layouts = false;
276 group_layouts = true;
277 default_language = "english";
279 windows_style_tex_paths = false;
280 tex_allows_spaces = false;
281 date_insert_format = "%x";
282 cursor_follows_scrollbar = false;
283 macro_edit_style = MACRO_EDIT_INLINE_BOX;
284 dialogs_iconify_with_main = false;
285 label_init_length = 3;
286 preview = PREVIEW_OFF;
287 preview_hashed_labels = false;
288 preview_scale_factor = "0.9";
289 use_converter_cache = true;
291 use_pixmap_cache = false;
292 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
293 user_name = to_utf8(support::user_name());
294 user_email = to_utf8(support::user_email());
296 // Fullscreen settings
297 full_screen_limit = false;
298 full_screen_toolbars = true;
299 full_screen_tabbar = true;
300 full_screen_scrollbar = true;
301 full_screen_width = 700;
303 completion_popup_math = true;
304 completion_popup_text = false;
305 completion_popup_delay = 2.0;
306 completion_popup_after_complete = true;
307 completion_inline_math = true;
308 completion_inline_text = false;
309 completion_inline_dots = -1;
310 completion_inline_delay = 0.2;
316 void oldFontFormat(string & family, string & foundry)
318 if (family.empty() || family[0] != '-')
320 foundry = token(family, '-', 1);
321 family = token(family, '-', 2);
329 int LyXRC::read(FileName const & filename)
331 Lexer lexrc(lyxrcTags, lyxrcCount);
332 if (lyxerr.debugging(Debug::PARSER))
333 lexrc.printTable(lyxerr);
335 lexrc.setFile(filename);
336 if (!lexrc.isOK()) return -2;
338 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
344 int LyXRC::read(istream & is)
346 Lexer lexrc(lyxrcTags, lyxrcCount);
347 if (lyxerr.debugging(Debug::PARSER))
348 lexrc.printTable(lyxerr);
351 if (!lexrc.isOK()) return -2;
353 LYXERR(Debug::LYXRC, "Reading istream...");
359 int LyXRC::read(Lexer & lexrc)
361 if (!lexrc.isOK()) return -2;
363 while (lexrc.isOK()) {
364 // By using two switches we take advantage of the compiler
365 // telling us if we have missed a LyXRCTags element in
366 // the second switch.
367 // Note that this also shows a problem with Lexer since it
368 // helps us avoid taking advantage of the strictness of the
371 int le = lexrc.lex();
373 case Lexer::LEX_UNDEF:
374 lexrc.printError("Unknown tag `$$Token'");
376 case Lexer::LEX_FEOF:
380 switch (static_cast<LyXRCTags>(le)) {
381 case RC_INPUT: // Include file
384 libFileSearch(string(),
387 lexrc.printError("Error reading "
388 "included file: " + tmp.absFilename());
394 bind_file = os::internal_path(lexrc.getString());
400 def_file = os::internal_path(lexrc.getString());
406 ui_file = os::internal_path(lexrc.getString());
410 case RC_AUTORESET_OPTIONS:
412 auto_reset_options = lexrc.getBool();
416 case RC_DISPLAY_GRAPHICS:
418 display_graphics = graphics::displayTranslator().find(lexrc.getString());
422 case RC_TEX_EXPECTS_WINDOWS_PATHS:
424 windows_style_tex_paths = lexrc.getBool();
428 case RC_TEX_ALLOWS_SPACES:
430 tex_allows_spaces = lexrc.getBool();
436 use_kbmap = lexrc.getBool();
440 case RC_KBMAP_PRIMARY:
442 string const kmap(os::internal_path(lexrc.getString()));
445 } else if (!libFileSearch("kbd", kmap,
447 primary_kbmap = kmap;
449 lexrc.printError("LyX: Keymap `$$Token' not found");
454 case RC_KBMAP_SECONDARY:
456 string const kmap(os::internal_path(lexrc.getString()));
459 } else if (!libFileSearch("kbd", kmap,
461 secondary_kbmap = kmap;
463 lexrc.printError("LyX: Keymap `$$Token' not found");
468 case RC_FONT_ENCODING:
470 fontenc = lexrc.getString();
476 printer = lexrc.getString();
480 case RC_PRINT_COMMAND:
482 print_command = lexrc.getString();
486 case RC_PRINTEVENPAGEFLAG:
488 print_evenpage_flag = lexrc.getString();
492 case RC_PRINTODDPAGEFLAG:
494 print_oddpage_flag = lexrc.getString();
498 case RC_PRINTPAGERANGEFLAG:
500 print_pagerange_flag = lexrc.getString();
504 case RC_PRINTCOPIESFLAG:
506 print_copies_flag = lexrc.getString();
510 case RC_PRINTCOLLCOPIESFLAG:
512 print_collcopies_flag = lexrc.getString();
516 case RC_PRINTREVERSEFLAG:
518 print_reverse_flag = lexrc.getString();
522 case RC_PRINTLANDSCAPEFLAG:
524 print_landscape_flag = lexrc.getString();
528 case RC_PRINTTOPRINTER:
530 print_to_printer = lexrc.getString();
534 case RC_PRINT_ADAPTOUTPUT:
536 print_adapt_output = lexrc.getBool();
542 print_to_file = os::internal_path(lexrc.getString());
546 case RC_PRINTFILEEXTENSION:
548 print_file_extension = lexrc.getString();
552 case RC_PRINTEXSTRAOPTIONS:
554 print_extra_options = lexrc.getString();
558 case RC_PRINTSPOOL_COMMAND:
560 print_spool_command = lexrc.getString();
564 case RC_PRINTSPOOL_PRINTERPREFIX:
566 print_spool_printerprefix = lexrc.getString();
570 case RC_PRINTPAPERDIMENSIONFLAG:
572 print_paper_dimension_flag = lexrc.getString();
576 case RC_PRINTPAPERFLAG:
578 print_paper_flag = lexrc.getString();
582 case RC_CUSTOM_EXPORT_COMMAND:
584 custom_export_command = lexrc.getString();
588 case RC_CUSTOM_EXPORT_FORMAT:
590 custom_export_format = lexrc.getString();
594 case RC_DEFAULT_PAPERSIZE:
597 ascii_lowercase(lexrc.getString());
598 if (size == "usletter")
601 else if (size == "legal")
604 else if (size == "executive")
607 else if (size == "a3")
610 else if (size == "a4")
613 else if (size == "a5")
616 else if (size == "b5")
619 else if (size == "default")
625 case RC_VIEWDVI_PAPEROPTION:
627 view_dvi_paper_option = lexrc.getString();
629 view_dvi_paper_option.erase();
633 case RC_CHKTEX_COMMAND:
635 chktex_command = lexrc.getString();
639 case RC_BIBTEX_COMMAND:
641 bibtex_command = lexrc.getString();
645 case RC_INDEX_COMMAND:
647 index_command = lexrc.getString();
653 dpi = lexrc.getInteger();
659 zoom = lexrc.getInteger();
663 case RC_GEOMETRY_SESSION:
665 allow_geometry_session = lexrc.getBool();
669 case RC_SCREEN_FONT_SIZES:
671 font_sizes[FONT_SIZE_TINY] =
675 font_sizes[FONT_SIZE_SCRIPT] =
679 font_sizes[FONT_SIZE_FOOTNOTE] =
683 font_sizes[FONT_SIZE_SMALL] =
687 font_sizes[FONT_SIZE_NORMAL] =
691 font_sizes[FONT_SIZE_LARGE] =
695 font_sizes[FONT_SIZE_LARGER] =
699 font_sizes[FONT_SIZE_LARGEST] =
703 font_sizes[FONT_SIZE_HUGE] =
707 font_sizes[FONT_SIZE_HUGER] =
712 case RC_SCREEN_FONT_SCALABLE:
714 use_scalable_fonts = lexrc.getBool();
720 autosave = lexrc.getInteger();
724 case RC_DOCUMENTPATH:
726 document_path = os::internal_path(lexrc.getString());
727 document_path = expandPath(document_path);
733 example_path = os::internal_path(lexrc.getString());
734 example_path = expandPath(example_path);
738 case RC_TEMPLATEPATH:
740 template_path = os::internal_path(lexrc.getString());
741 template_path = expandPath(template_path);
747 tempdir_path = os::internal_path(lexrc.getString());
748 tempdir_path = expandPath(tempdir_path);
754 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
758 case RC_USELASTFILEPOS:
760 use_lastfilepos = lexrc.getBool();
766 load_session = lexrc.getBool();
770 case RC_MOUSE_WHEEL_SPEED:
772 mouse_wheel_speed = lexrc.getFloat();
776 case RC_COMPLETION_INLINE_DELAY:
778 completion_inline_delay = lexrc.getFloat();
782 case RC_COMPLETION_INLINE_MATH:
784 completion_inline_math = lexrc.getBool();
788 case RC_COMPLETION_INLINE_TEXT:
790 completion_inline_text = lexrc.getBool();
794 case RC_COMPLETION_INLINE_DOTS:
796 completion_inline_dots = lexrc.getInteger();
800 case RC_COMPLETION_POPUP_DELAY:
802 completion_popup_delay = lexrc.getFloat();
806 case RC_COMPLETION_POPUP_MATH:
808 completion_popup_math = lexrc.getBool();
812 case RC_COMPLETION_POPUP_TEXT:
814 completion_popup_text = lexrc.getBool();
818 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
820 completion_popup_after_complete = lexrc.getBool();
824 case RC_NUMLASTFILES:
826 num_lastfiles = lexrc.getInteger();
830 case RC_CHECKLASTFILES:
832 check_lastfiles = lexrc.getBool();
836 case RC_SCREEN_FONT_ROMAN:
838 roman_font_name = lexrc.getString();
839 oldFontFormat(roman_font_name,
844 case RC_SCREEN_FONT_SANS:
846 sans_font_name = lexrc.getString();
847 oldFontFormat(sans_font_name, sans_font_foundry);
851 case RC_SCREEN_FONT_TYPEWRITER:
853 typewriter_font_name = lexrc.getString();
854 oldFontFormat(typewriter_font_name,
855 typewriter_font_foundry);
859 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
861 roman_font_foundry = lexrc.getString();
865 case RC_SCREEN_FONT_SANS_FOUNDRY:
867 sans_font_foundry = lexrc.getString();
871 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
873 typewriter_font_foundry = lexrc.getString();
879 string lyx_name, x11_name;
882 lyx_name = lexrc.getString();
884 lexrc.printError("Missing color tag.");
889 x11_name = lexrc.getString();
891 lexrc.printError("Missing color name for color: `$$Token'");
895 ColorCode const col =
896 lcolor.getFromLyXName(lyx_name);
897 if (col == Color_none ||
898 col == Color_inherit ||
902 if (!lcolor.setColor(col, x11_name)) {
903 lyxerr << "Bad lyxrc set_color for "
909 case RC_AUTOREGIONDELETE:
910 // Auto region delete defaults to true
912 auto_region_delete = lexrc.getBool();
918 lyxpipes = os::internal_path(lexrc.getString());
919 lyxpipes = expandPath(lyxpipes);
923 case RC_CURSOR_FOLLOWS_SCROLLBAR:
925 cursor_follows_scrollbar = lexrc.getBool();
929 case RC_MACRO_EDIT_STYLE:
931 switch (lexrc.getInteger()) {
932 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
933 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
934 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
939 case RC_DIALOGS_ICONIFY_WITH_MAIN:
941 dialogs_iconify_with_main = lexrc.getBool();
945 case RC_PLAINTEXT_ROFF_COMMAND:
947 plaintext_roff_command = lexrc.getString();
950 case RC_PLAINTEXT_LINELEN:
952 plaintext_linelen = lexrc.getInteger();
955 // Spellchecker settings:
956 case RC_USE_SPELL_LIB:
958 use_spell_lib = lexrc.getBool();
961 case RC_SPELL_COMMAND:
963 isp_command = lexrc.getString();
966 case RC_ACCEPT_COMPOUND:
968 isp_accept_compound = lexrc.getBool();
973 isp_use_input_encoding = lexrc.getBool();
976 case RC_USE_ALT_LANG:
978 isp_use_alt_lang = lexrc.getBool();
981 case RC_USE_PERS_DICT:
983 isp_use_pers_dict = lexrc.getBool();
988 use_tooltip = lexrc.getBool();
991 case RC_USE_PIXMAP_CACHE:
993 use_pixmap_cache = lexrc.getBool();
996 case RC_USE_ESC_CHARS:
998 isp_use_esc_chars = lexrc.getBool();
1003 isp_alt_lang = lexrc.getString();
1008 isp_pers_dict = os::internal_path(lexrc.getString());
1013 isp_esc_chars = lexrc.getString();
1016 case RC_MAKE_BACKUP:
1018 make_backup = lexrc.getBool();
1021 case RC_BACKUPDIR_PATH:
1023 backupdir_path = os::internal_path(lexrc.getString());
1024 backupdir_path = expandPath(backupdir_path);
1027 case RC_DATE_INSERT_FORMAT:
1029 date_insert_format = lexrc.getString();
1032 case RC_LANGUAGE_PACKAGE:
1034 language_package = lexrc.getString();
1037 case RC_LANGUAGE_AUTO_BEGIN:
1039 language_auto_begin = lexrc.getBool();
1042 case RC_LANGUAGE_AUTO_END:
1044 language_auto_end = lexrc.getBool();
1047 case RC_LANGUAGE_GLOBAL_OPTIONS:
1049 language_global_options = lexrc.getBool();
1052 case RC_LANGUAGE_USE_BABEL:
1054 language_use_babel = lexrc.getBool();
1057 case RC_LANGUAGE_COMMAND_BEGIN:
1059 language_command_begin = lexrc.getString();
1062 case RC_LANGUAGE_COMMAND_END:
1064 language_command_end = lexrc.getString();
1067 case RC_LANGUAGE_COMMAND_LOCAL:
1069 language_command_local = lexrc.getString();
1072 case RC_RTL_SUPPORT:
1074 rtl_support = lexrc.getBool();
1077 case RC_VISUAL_CURSOR:
1079 visual_cursor = lexrc.getBool();
1082 case RC_AUTO_NUMBER:
1084 auto_number = lexrc.getBool();
1087 case RC_MARK_FOREIGN_LANGUAGE:
1089 mark_foreign_language = lexrc.getBool();
1094 string fmt, command;
1096 fmt = lexrc.getString();
1099 command = lexrc.getString();
1101 setMover(fmt, command);
1105 case RC_CONVERTER: {
1106 string from, to, command, flags;
1108 from = lexrc.getString();
1111 to = lexrc.getString();
1114 command = lexrc.getString();
1117 flags = lexrc.getString();
1119 if (command.empty()) {
1120 theConverters().erase(from, to);
1122 theConverters().add(from, to, command, flags);
1126 // compatibility with versions older than 1.4.0 only
1128 string format, command;
1130 format = lexrc.getString();
1133 command = lexrc.getString();
1135 formats.setViewer(format, command);
1139 string format, extension, prettyname, shortcut;
1141 format = lexrc.getString();
1144 extension = lexrc.getString();
1147 prettyname = lexrc.getString();
1150 shortcut = lexrc.getString();
1152 string viewer, editor;
1154 viewer = lexrc.getString();
1156 editor = lexrc.getString();
1158 // Hack to ensure compatibility with versions older
1160 int le = lexrc.lex();
1161 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1162 flags = lexrc.getString();
1163 if (le != Lexer::LEX_DATA) {
1164 // We have got a known token.
1165 // Therefore this is an old style
1166 // format definition without
1168 lexrc.pushToken(flags);
1172 int flgs = Format::none;
1173 while (!flags.empty()) {
1175 flags = split(flags, flag, ',');
1176 if (flag == "document")
1177 flgs |= Format::document;
1178 else if (flag == "vector")
1179 flgs |= Format::vector;
1181 lyxerr << "Ignoring unknown flag `"
1182 << flag << "' for format `"
1183 << format << "'." << endl;
1185 if (prettyname.empty()) {
1186 if (theConverters().formatIsUsed(format)) {
1187 lyxerr << "Can't delete format "
1190 formats.erase(format);
1193 formats.add(format, extension, prettyname,
1194 shortcut, viewer, editor, flgs);
1198 case RC_DEFAULT_LANGUAGE:
1200 default_language = lexrc.getString();
1204 case RC_LABEL_INIT_LENGTH:
1206 label_init_length = lexrc.getInteger();
1210 case RC_SHOW_BANNER:
1212 show_banner = lexrc.getBool();
1218 string const tmp = lexrc.getString();
1219 if (tmp == "true" || tmp == "on")
1220 preview = PREVIEW_ON;
1221 else if (tmp == "no_math")
1222 preview = PREVIEW_NO_MATH;
1224 preview = PREVIEW_OFF;
1225 if (tmp != "false" && tmp != "off")
1226 lyxerr << "Unrecognized "
1228 << tmp << '\n' << endl;
1233 case RC_PREVIEW_HASHED_LABELS:
1235 preview_hashed_labels = lexrc.getBool();
1239 case RC_PREVIEW_SCALE_FACTOR:
1241 preview_scale_factor = lexrc.getString();
1247 user_name = lexrc.getString();
1252 user_email = lexrc.getString();
1255 case RC_PATH_PREFIX:
1257 path_prefix = lexrc.getString();
1260 case RC_USE_CONVERTER_CACHE:
1262 use_converter_cache = lexrc.getBool();
1265 case RC_CONVERTER_CACHE_MAXAGE:
1267 converter_cache_maxage =
1268 convert<unsigned int>(lexrc.getString());
1271 case RC_SORT_LAYOUTS:
1273 sort_layouts = lexrc.getBool();
1275 case RC_GROUP_LAYOUTS:
1277 group_layouts = lexrc.getBool();
1279 case RC_FULL_SCREEN_LIMIT:
1281 full_screen_limit = lexrc.getBool();
1283 case RC_FULL_SCREEN_TOOLBARS:
1285 full_screen_toolbars = lexrc.getBool();
1287 case RC_FULL_SCREEN_SCROLLBAR:
1289 full_screen_scrollbar = lexrc.getBool();
1291 case RC_FULL_SCREEN_TABBAR:
1293 full_screen_tabbar = lexrc.getBool();
1295 case RC_FULL_SCREEN_WIDTH:
1297 full_screen_width = lexrc.getInteger();
1300 case RC_LAST: break; // this is just a dummy
1304 /// Update converters data-structures
1305 theConverters().update(formats);
1306 theConverters().buildGraph();
1312 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1314 ofstream ofs(filename.toFilesystemEncoding().c_str());
1316 write(ofs, ignore_system_lyxrc);
1320 void LyXRC::print() const
1322 if (lyxerr.debugging())
1323 write(lyxerr, false);
1331 typedef pair<string, SpecialisedMover> Data;
1333 SameMover(Data const & comparison)
1334 : comparison_(comparison) {}
1336 bool operator()(Data const & data) const
1338 return data.first == comparison_.first &&
1339 data.second.command() == comparison_.second.command();
1347 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1349 LyXRCTags tag = RC_LAST;
1351 if (!name.empty()) {
1352 for (int i = 0; i != lyxrcCount; ++i)
1353 if ("\\" + name == lyxrcTags[i].tag)
1354 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1358 os << "### This file is part of\n"
1359 << "### ========================================================\n"
1360 << "### LyX, The Document Processor\n"
1362 << "### Copyright 1995 Matthias Ettrich\n"
1363 << "### Copyright 1995-2007 The LyX Team.\n"
1365 << "### ========================================================\n"
1367 << "# This file is written by LyX, if you want to make your own\n"
1368 << "# modifications you should do them from inside LyX and save\n"
1371 // Why the switch you might ask. It is a trick to ensure that all
1372 // the elements in the LyXRCTags enum is handled. As you can see
1373 // there are no breaks at all. So it is just a huge fall-through.
1374 // The nice thing is that we will get a warning from the compiler
1375 // if we forget an element.
1379 // input/include files are not done here
1381 if (ignore_system_lyxrc ||
1382 bind_file != system_lyxrc.bind_file) {
1383 string const path = os::external_path(bind_file);
1384 os << "\\bind_file \"" << path << "\"\n";
1390 if (ignore_system_lyxrc ||
1391 def_file != system_lyxrc.def_file) {
1392 string const path = os::external_path(def_file);
1393 os << "\\def_file \"" << path << "\"\n";
1402 << "# MISC SECTION ######################################\n"
1404 // bind files are not done here.
1406 case RC_PATH_PREFIX:
1407 if (ignore_system_lyxrc ||
1408 path_prefix != system_lyxrc.path_prefix) {
1409 os << "\\path_prefix \"" << path_prefix << "\"\n";
1414 if (ignore_system_lyxrc ||
1415 ui_file != system_lyxrc.ui_file) {
1416 string const path = os::external_path(ui_file);
1417 os << "\\ui_file \"" << path << "\"\n";
1421 case RC_AUTOREGIONDELETE:
1422 if (ignore_system_lyxrc ||
1423 auto_region_delete != system_lyxrc.auto_region_delete) {
1424 os << "# Set to false to inhibit automatic replacement of\n"
1425 << "# the current selection.\n"
1426 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1431 case RC_AUTORESET_OPTIONS:
1432 if (ignore_system_lyxrc ||
1433 auto_reset_options != system_lyxrc.auto_reset_options) {
1434 os << "# Set to false to inhibit automatic reset of\n"
1435 << "# the class options to defaults on class change.\n"
1436 << "\\auto_reset_options "
1437 << convert<string>(auto_reset_options)
1443 if (ignore_system_lyxrc ||
1444 autosave != system_lyxrc.autosave) {
1445 os << "# The time interval between auto-saves in seconds.\n"
1446 << "\\autosave " << autosave << '\n';
1450 case RC_DISPLAY_GRAPHICS:
1451 if (ignore_system_lyxrc ||
1452 display_graphics != system_lyxrc.display_graphics) {
1453 os << "# Display graphics within LyX\n"
1454 << "# monochrome|grayscale|color|none\n"
1455 << "\\display_graphics "
1456 << graphics::displayTranslator().find(
1457 graphics::DisplayType(display_graphics))
1462 case RC_SORT_LAYOUTS:
1463 if (ignore_system_lyxrc ||
1464 sort_layouts != system_lyxrc.sort_layouts) {
1465 os << "# Sort layouts alphabetically.\n"
1466 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1470 case RC_GROUP_LAYOUTS:
1471 if (ignore_system_lyxrc ||
1472 group_layouts != system_lyxrc.group_layouts) {
1473 os << "# Group layouts by their category.\n"
1474 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1478 case RC_VIEWDVI_PAPEROPTION:
1479 if (ignore_system_lyxrc ||
1480 view_dvi_paper_option
1481 != system_lyxrc.view_dvi_paper_option) {
1482 os << "# Options used to specify paper size to the\n"
1483 << "# view_dvi_command (e.g. -paper)\n"
1484 << "\\view_dvi_paper_option \""
1485 << view_dvi_paper_option << "\"\n";
1489 case RC_DEFAULT_PAPERSIZE:
1490 if (ignore_system_lyxrc ||
1491 default_papersize != system_lyxrc.default_papersize) {
1492 os << "# The default papersize to use.\n"
1493 << "\\default_papersize \"";
1494 switch (default_papersize) {
1496 os << "default"; break;
1497 case PAPER_USLETTER:
1498 os << "usletter"; break;
1500 os << "legal"; break;
1501 case PAPER_USEXECUTIVE:
1502 os << "executive"; break;
1513 case PAPER_B4: break;
1519 case RC_CHKTEX_COMMAND:
1520 if (ignore_system_lyxrc ||
1521 chktex_command != system_lyxrc.chktex_command) {
1522 os << "\\chktex_command \"" << chktex_command << "\"\n";
1526 case RC_BIBTEX_COMMAND:
1527 if (ignore_system_lyxrc ||
1528 bibtex_command != system_lyxrc.bibtex_command) {
1529 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1533 case RC_INDEX_COMMAND:
1534 if (ignore_system_lyxrc ||
1535 index_command != system_lyxrc.index_command) {
1536 os << "\\index_command \"" << index_command << "\"\n";
1540 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1541 if (ignore_system_lyxrc ||
1542 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1543 os << "\\tex_expects_windows_paths "
1544 << convert<string>(windows_style_tex_paths) << '\n';
1548 case RC_TEX_ALLOWS_SPACES:
1549 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1550 os << "\\tex_allows_spaces "
1551 << convert<string>(tex_allows_spaces) << '\n';
1556 if (ignore_system_lyxrc ||
1557 use_kbmap != system_lyxrc.use_kbmap) {
1558 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1562 case RC_KBMAP_PRIMARY:
1563 if (ignore_system_lyxrc ||
1564 primary_kbmap != system_lyxrc.primary_kbmap) {
1565 string const path = os::external_path(primary_kbmap);
1566 os << "\\kbmap_primary \"" << path << "\"\n";
1570 case RC_KBMAP_SECONDARY:
1571 if (ignore_system_lyxrc ||
1572 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1573 string const path = os::external_path(secondary_kbmap);
1574 os << "\\kbmap_secondary \"" << path << "\"\n";
1579 if (ignore_system_lyxrc ||
1580 lyxpipes != system_lyxrc.lyxpipes) {
1581 string const path = os::external_path(lyxpipes);
1582 os << "\\serverpipe \"" << path << "\"\n";
1586 case RC_DATE_INSERT_FORMAT:
1587 if (ignore_system_lyxrc ||
1588 date_insert_format != system_lyxrc.date_insert_format) {
1589 os << "\\date_insert_format \"" << date_insert_format
1594 case RC_LABEL_INIT_LENGTH:
1595 if (ignore_system_lyxrc ||
1596 label_init_length != system_lyxrc.label_init_length) {
1597 os << "\\label_init_length " << label_init_length
1604 os << "\\user_name \"" << user_name << "\"\n";
1609 os << "\\user_email \"" << user_email << "\"\n";
1613 case RC_SHOW_BANNER:
1614 if (ignore_system_lyxrc ||
1615 show_banner != system_lyxrc.show_banner) {
1616 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1622 if (ignore_system_lyxrc ||
1623 preview != system_lyxrc.preview) {
1629 case PREVIEW_NO_MATH:
1636 os << "\\preview " << status << '\n';
1641 case RC_PREVIEW_HASHED_LABELS:
1642 if (ignore_system_lyxrc ||
1643 preview_hashed_labels !=
1644 system_lyxrc.preview_hashed_labels) {
1645 os << "\\preview_hashed_labels "
1646 << convert<string>(preview_hashed_labels) << '\n';
1651 case RC_PREVIEW_SCALE_FACTOR:
1652 if (ignore_system_lyxrc ||
1653 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1654 os << "\\preview_scale_factor "
1655 << preview_scale_factor << '\n';
1660 case RC_USE_CONVERTER_CACHE:
1661 if (ignore_system_lyxrc ||
1662 use_converter_cache != system_lyxrc.use_converter_cache) {
1663 os << "\\use_converter_cache "
1664 << convert<string>(use_converter_cache) << '\n';
1669 case RC_CONVERTER_CACHE_MAXAGE:
1670 if (ignore_system_lyxrc ||
1671 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1672 os << "\\converter_cache_maxage "
1673 << converter_cache_maxage << '\n';
1679 << "# SCREEN & FONTS SECTION ############################\n"
1683 if (ignore_system_lyxrc ||
1684 dpi != system_lyxrc.dpi) {
1685 os << "\\screen_dpi " << dpi << '\n';
1689 case RC_SCREEN_ZOOM:
1690 if (ignore_system_lyxrc ||
1691 zoom != system_lyxrc.zoom) {
1692 os << "\\screen_zoom " << zoom << '\n';
1696 case RC_GEOMETRY_SESSION:
1697 if (ignore_system_lyxrc ||
1698 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1699 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1704 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1705 if (ignore_system_lyxrc ||
1706 cursor_follows_scrollbar
1707 != system_lyxrc.cursor_follows_scrollbar) {
1708 os << "\\cursor_follows_scrollbar "
1709 << convert<string>(cursor_follows_scrollbar) << '\n';
1713 case RC_MACRO_EDIT_STYLE:
1714 if (ignore_system_lyxrc ||
1716 != system_lyxrc.macro_edit_style) {
1717 os << "\\macro_edit_style ";
1718 switch (macro_edit_style) {
1719 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1720 case MACRO_EDIT_INLINE: os << "1\n"; break;
1721 case MACRO_EDIT_LIST: os << "2\n"; break;
1726 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1727 if (ignore_system_lyxrc ||
1728 dialogs_iconify_with_main
1729 != system_lyxrc.dialogs_iconify_with_main) {
1730 os << "\\dialogs_iconify_with_main "
1731 << convert<string>(dialogs_iconify_with_main) << '\n';
1735 case RC_SCREEN_FONT_ROMAN:
1736 if (ignore_system_lyxrc ||
1737 roman_font_name != system_lyxrc.roman_font_name) {
1738 os << "\\screen_font_roman \"" << roman_font_name
1743 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1744 if (ignore_system_lyxrc ||
1745 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1746 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1751 case RC_SCREEN_FONT_SANS:
1752 if (ignore_system_lyxrc ||
1753 sans_font_name != system_lyxrc.sans_font_name) {
1754 os << "\\screen_font_sans \"" << sans_font_name
1759 case RC_SCREEN_FONT_SANS_FOUNDRY:
1760 if (ignore_system_lyxrc ||
1761 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1762 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1767 case RC_SCREEN_FONT_TYPEWRITER:
1768 if (ignore_system_lyxrc ||
1769 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1770 os << "\\screen_font_typewriter \""
1771 << typewriter_font_name << "\"\n";
1775 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1776 if (ignore_system_lyxrc ||
1777 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1778 os << "\\screen_font_typewriter_foundry \""
1779 << typewriter_font_foundry << "\"\n";
1784 case RC_SCREEN_FONT_SCALABLE:
1785 if (ignore_system_lyxrc ||
1786 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1787 os << "\\screen_font_scalable "
1788 << convert<string>(use_scalable_fonts)
1793 case RC_SCREEN_FONT_SIZES:
1794 if (ignore_system_lyxrc ||
1795 font_sizes[FONT_SIZE_TINY]
1796 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1797 font_sizes[FONT_SIZE_SCRIPT]
1798 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1799 font_sizes[FONT_SIZE_FOOTNOTE]
1800 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1801 font_sizes[FONT_SIZE_SMALL]
1802 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1803 font_sizes[FONT_SIZE_NORMAL]
1804 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1805 font_sizes[FONT_SIZE_LARGE]
1806 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1807 font_sizes[FONT_SIZE_LARGER]
1808 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1809 font_sizes[FONT_SIZE_LARGEST]
1810 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1811 font_sizes[FONT_SIZE_HUGE]
1812 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1813 font_sizes[FONT_SIZE_HUGER]
1814 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1815 os.setf(ios::fixed);
1817 os << "\\screen_font_sizes"
1818 << ' ' << font_sizes[FONT_SIZE_TINY]
1819 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1820 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1821 << ' ' << font_sizes[FONT_SIZE_SMALL]
1822 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1823 << ' ' << font_sizes[FONT_SIZE_LARGE]
1824 << ' ' << font_sizes[FONT_SIZE_LARGER]
1825 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1826 << ' ' << font_sizes[FONT_SIZE_HUGE]
1827 << ' ' << font_sizes[FONT_SIZE_HUGER]
1832 case RC_FULL_SCREEN_LIMIT:
1833 if (ignore_system_lyxrc ||
1834 full_screen_limit != system_lyxrc.full_screen_limit) {
1835 os << "\\fullscreen_limit "
1836 << convert<string>(full_screen_limit)
1841 case RC_FULL_SCREEN_TOOLBARS:
1842 if (ignore_system_lyxrc ||
1843 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1844 os << "\\fullscreen_toolbars "
1845 << convert<string>(full_screen_toolbars)
1850 case RC_FULL_SCREEN_SCROLLBAR:
1851 if (ignore_system_lyxrc ||
1852 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1853 os << "\\fullscreen_scrollbar "
1854 << convert<string>(full_screen_scrollbar)
1859 case RC_FULL_SCREEN_TABBAR:
1860 if (ignore_system_lyxrc ||
1861 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1862 os << "\\fullscreen_tabbar "
1863 << convert<string>(full_screen_tabbar)
1868 case RC_FULL_SCREEN_WIDTH:
1869 if (ignore_system_lyxrc ||
1870 full_screen_width != system_lyxrc.full_screen_width) {
1871 os << "\\fullscreen_width "
1872 << convert<string>(full_screen_width)
1880 << "# COLOR SECTION ###################################\n"
1884 for (int i = 0; i < Color_ignore; ++i) {
1885 ColorCode lc = static_cast<ColorCode>(i);
1887 string const col(lcolor.getX11Name(lc));
1888 if (ignore_system_lyxrc ||
1889 col != system_lcolor.getX11Name(lc)) {
1890 os << "\\set_color \""
1891 << lcolor.getLyXName(lc) << "\" \""
1899 << "# PRINTER SECTION ###################################\n"
1903 if (ignore_system_lyxrc ||
1904 printer != system_lyxrc.printer) {
1905 os << "\\printer \"" << printer << "\"\n";
1909 case RC_PRINT_ADAPTOUTPUT:
1910 if (ignore_system_lyxrc ||
1911 print_adapt_output != system_lyxrc.print_adapt_output) {
1912 os << "\\print_adapt_output "
1913 << convert<string>(print_adapt_output)
1918 case RC_PRINT_COMMAND:
1919 if (ignore_system_lyxrc ||
1920 print_command != system_lyxrc.print_command) {
1921 os << "\\print_command \"" << print_command << "\"\n";
1925 case RC_PRINTEXSTRAOPTIONS:
1926 if (ignore_system_lyxrc ||
1927 print_extra_options != system_lyxrc.print_extra_options) {
1928 os << "\\print_extra_options \"" << print_extra_options
1933 case RC_PRINTSPOOL_COMMAND:
1934 if (ignore_system_lyxrc ||
1935 print_spool_command != system_lyxrc.print_spool_command) {
1936 os << "\\print_spool_command \"" << print_spool_command
1941 case RC_PRINTSPOOL_PRINTERPREFIX:
1942 if (ignore_system_lyxrc ||
1943 print_spool_printerprefix
1944 != system_lyxrc.print_spool_printerprefix) {
1945 os << "\\print_spool_printerprefix \""
1946 << print_spool_printerprefix << "\"\n";
1950 case RC_PRINTEVENPAGEFLAG:
1951 if (ignore_system_lyxrc ||
1952 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1953 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1958 case RC_PRINTODDPAGEFLAG:
1959 if (ignore_system_lyxrc ||
1960 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1961 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1966 case RC_PRINTREVERSEFLAG:
1967 if (ignore_system_lyxrc ||
1968 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1969 os << "\\print_reverse_flag \"" << print_reverse_flag
1974 case RC_PRINTLANDSCAPEFLAG:
1975 if (ignore_system_lyxrc ||
1976 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1977 os << "\\print_landscape_flag \"" << print_landscape_flag
1982 case RC_PRINTPAGERANGEFLAG:
1983 if (ignore_system_lyxrc ||
1984 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1985 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1990 case RC_PRINTCOPIESFLAG:
1991 if (ignore_system_lyxrc ||
1992 print_copies_flag != system_lyxrc.print_copies_flag) {
1993 os << "\\print_copies_flag \"" << print_copies_flag
1998 case RC_PRINTCOLLCOPIESFLAG:
1999 if (ignore_system_lyxrc ||
2000 print_collcopies_flag
2001 != system_lyxrc.print_collcopies_flag) {
2002 os << "\\print_collcopies_flag \""
2003 << print_collcopies_flag
2008 case RC_PRINTPAPERFLAG:
2009 if (ignore_system_lyxrc ||
2010 print_paper_flag != system_lyxrc.print_paper_flag) {
2011 os << "\\print_paper_flag \"" << print_paper_flag
2016 case RC_PRINTPAPERDIMENSIONFLAG:
2017 if (ignore_system_lyxrc ||
2018 print_paper_dimension_flag
2019 != system_lyxrc.print_paper_dimension_flag) {
2020 os << "\\print_paper_dimension_flag \""
2021 << print_paper_dimension_flag << "\"\n";
2025 case RC_PRINTTOPRINTER:
2026 if (ignore_system_lyxrc ||
2027 print_to_printer != system_lyxrc.print_to_printer) {
2028 os << "\\print_to_printer \"" << print_to_printer
2033 case RC_PRINTTOFILE:
2034 if (ignore_system_lyxrc ||
2035 print_to_file != system_lyxrc.print_to_file) {
2036 string const path = os::external_path(print_to_file);
2037 os << "\\print_to_file \"" << path << "\"\n";
2041 case RC_PRINTFILEEXTENSION:
2042 if (ignore_system_lyxrc ||
2043 print_file_extension != system_lyxrc.print_file_extension) {
2044 os << "\\print_file_extension \""
2045 << print_file_extension
2052 << "# EXPORT SECTION ####################################\n"
2055 case RC_CUSTOM_EXPORT_COMMAND:
2056 if (ignore_system_lyxrc ||
2057 custom_export_command
2058 != system_lyxrc.custom_export_command) {
2059 os << "\\custom_export_command \""
2060 << custom_export_command
2065 case RC_CUSTOM_EXPORT_FORMAT:
2066 if (ignore_system_lyxrc ||
2067 custom_export_format
2068 != system_lyxrc.custom_export_format) {
2069 os << "\\custom_export_format \"" << custom_export_format
2076 << "# TEX SECTION #######################################\n"
2079 case RC_FONT_ENCODING:
2080 if (ignore_system_lyxrc ||
2081 fontenc != system_lyxrc.fontenc) {
2082 os << "\\font_encoding \"" << fontenc << "\"\n";
2088 << "# FILE SECTION ######################################\n"
2091 case RC_DOCUMENTPATH:
2092 if (ignore_system_lyxrc ||
2093 document_path != system_lyxrc.document_path) {
2094 string const path = os::external_path(document_path);
2095 os << "\\document_path \"" << path << "\"\n";
2099 case RC_USELASTFILEPOS:
2100 if (ignore_system_lyxrc ||
2101 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2102 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2107 case RC_LOADSESSION:
2108 if (ignore_system_lyxrc ||
2109 load_session != system_lyxrc.load_session) {
2110 os << "\\load_session " << convert<string>(load_session)
2115 case RC_MOUSE_WHEEL_SPEED:
2116 if (ignore_system_lyxrc ||
2117 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2118 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2122 case RC_COMPLETION_INLINE_DELAY:
2123 if (ignore_system_lyxrc ||
2124 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2125 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2129 case RC_COMPLETION_INLINE_MATH:
2130 if (ignore_system_lyxrc ||
2131 completion_inline_math != system_lyxrc.completion_inline_math) {
2132 os << "\\completion_inline_math "
2133 << convert<string>(completion_inline_math) << '\n';
2137 case RC_COMPLETION_INLINE_TEXT:
2138 if (ignore_system_lyxrc ||
2139 completion_inline_text != system_lyxrc.completion_inline_text) {
2140 os << "\\completion_inline_text "
2141 << convert<string>(completion_inline_text) << '\n';
2145 case RC_COMPLETION_INLINE_DOTS:
2146 if (ignore_system_lyxrc ||
2147 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2148 os << "\\completion_inline_dots "
2149 << convert<string>(completion_inline_dots) << '\n';
2153 case RC_COMPLETION_POPUP_DELAY:
2154 if (ignore_system_lyxrc ||
2155 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2156 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2160 case RC_COMPLETION_POPUP_MATH:
2161 if (ignore_system_lyxrc ||
2162 completion_popup_math != system_lyxrc.completion_popup_math) {
2163 os << "\\completion_popup_math "
2164 << convert<string>(completion_popup_math) << '\n';
2168 case RC_COMPLETION_POPUP_TEXT:
2169 if (ignore_system_lyxrc ||
2170 completion_popup_text != system_lyxrc.completion_popup_text) {
2171 os << "\\completion_popup_text "
2172 << convert<string>(completion_popup_text) << '\n';
2176 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2177 if (ignore_system_lyxrc ||
2178 completion_popup_after_complete
2179 != system_lyxrc.completion_popup_after_complete) {
2180 os << "\\completion_popup_after_complete "
2181 << convert<string>(completion_popup_after_complete) << '\n';
2185 case RC_NUMLASTFILES:
2186 if (ignore_system_lyxrc ||
2187 num_lastfiles != system_lyxrc.num_lastfiles) {
2188 os << "\\num_lastfiles " << num_lastfiles << '\n';
2192 case RC_CHECKLASTFILES:
2193 if (ignore_system_lyxrc ||
2194 check_lastfiles != system_lyxrc.check_lastfiles) {
2195 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2200 case RC_EXAMPLEPATH:
2201 if (ignore_system_lyxrc ||
2202 example_path != system_lyxrc.example_path) {
2203 string const path = os::external_path(example_path);
2204 os << "\\example_path \"" << path << "\"\n";
2208 case RC_TEMPLATEPATH:
2209 if (ignore_system_lyxrc ||
2210 template_path != system_lyxrc.template_path) {
2211 string const path = os::external_path(template_path);
2212 os << "\\template_path \"" << path << "\"\n";
2216 case RC_TEMPDIRPATH:
2217 if (ignore_system_lyxrc ||
2218 tempdir_path != system_lyxrc.tempdir_path) {
2219 string const path = os::external_path(tempdir_path);
2220 os << "\\tempdir_path \"" << path << "\"\n";
2228 case RC_PLAINTEXT_LINELEN:
2229 if (ignore_system_lyxrc ||
2230 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2231 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2235 case RC_MAKE_BACKUP:
2236 if (ignore_system_lyxrc ||
2237 make_backup != system_lyxrc.make_backup) {
2238 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2242 case RC_BACKUPDIR_PATH:
2243 if (ignore_system_lyxrc ||
2244 backupdir_path != system_lyxrc.backupdir_path) {
2245 string const path = os::external_path(backupdir_path);
2246 os << "\\backupdir_path \"" << path << "\"\n";
2252 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2255 case RC_PLAINTEXT_ROFF_COMMAND:
2256 if (ignore_system_lyxrc ||
2257 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2258 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2265 << "# SPELLCHECKER SECTION ##############################\n"
2267 case RC_USE_SPELL_LIB:
2268 if (ignore_system_lyxrc ||
2269 use_spell_lib != system_lyxrc.use_spell_lib) {
2270 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2274 case RC_SPELL_COMMAND:
2275 if (ignore_system_lyxrc ||
2276 isp_command != system_lyxrc.isp_command) {
2277 os << "\\spell_command \"" << isp_command << "\"\n";
2281 case RC_ACCEPT_COMPOUND:
2282 if (ignore_system_lyxrc ||
2283 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2284 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2289 case RC_USE_ALT_LANG:
2290 if (ignore_system_lyxrc ||
2291 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2292 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2298 if (ignore_system_lyxrc ||
2299 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2300 os << "\\alternate_language \"" << isp_alt_lang
2305 case RC_USE_ESC_CHARS:
2306 if (ignore_system_lyxrc ||
2307 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2308 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2314 if (ignore_system_lyxrc ||
2315 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2316 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2320 case RC_USE_PERS_DICT:
2321 if (ignore_system_lyxrc ||
2322 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2323 os << "\\use_personal_dictionary "
2324 << convert<string>(isp_use_pers_dict)
2329 case RC_USE_TOOLTIP:
2330 if (ignore_system_lyxrc ||
2331 use_tooltip != system_lyxrc.use_tooltip) {
2332 os << "\\use_tooltip "
2333 << convert<string>(use_tooltip)
2336 case RC_USE_PIXMAP_CACHE:
2337 if (ignore_system_lyxrc ||
2338 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2339 os << "\\use_pixmap_cache "
2340 << convert<string>(use_pixmap_cache)
2344 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2345 string const path = os::external_path(isp_pers_dict);
2346 os << "\\personal_dictionary \"" << path << "\"\n";
2350 case RC_USE_INP_ENC:
2351 if (ignore_system_lyxrc ||
2352 isp_use_input_encoding
2353 != system_lyxrc.isp_use_input_encoding) {
2354 os << "\\use_input_encoding "
2355 << convert<string>(isp_use_input_encoding)
2362 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2365 case RC_RTL_SUPPORT:
2366 if (ignore_system_lyxrc ||
2367 rtl_support != system_lyxrc.rtl_support) {
2368 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2372 case RC_VISUAL_CURSOR:
2373 if (ignore_system_lyxrc ||
2374 visual_cursor != system_lyxrc.visual_cursor) {
2375 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2379 case RC_LANGUAGE_PACKAGE:
2380 if (ignore_system_lyxrc ||
2381 language_package != system_lyxrc.language_package) {
2382 os << "\\language_package \"" << language_package
2387 case RC_LANGUAGE_GLOBAL_OPTIONS:
2388 if (ignore_system_lyxrc ||
2389 language_global_options
2390 != system_lyxrc.language_global_options) {
2391 os << "\\language_global_options \""
2392 << convert<string>(language_global_options)
2397 case RC_LANGUAGE_USE_BABEL:
2398 if (ignore_system_lyxrc ||
2399 language_use_babel != system_lyxrc.language_use_babel) {
2400 os << "\\language_use_babel \""
2401 << convert<string>(language_use_babel)
2406 case RC_LANGUAGE_COMMAND_BEGIN:
2407 if (ignore_system_lyxrc ||
2408 language_command_begin
2409 != system_lyxrc.language_command_begin) {
2410 os << "\\language_command_begin \""
2411 << language_command_begin
2416 case RC_LANGUAGE_COMMAND_END:
2417 if (ignore_system_lyxrc ||
2418 language_command_end
2419 != system_lyxrc.language_command_end) {
2420 os << "\\language_command_end \"" << language_command_end
2425 case RC_LANGUAGE_COMMAND_LOCAL:
2426 if (ignore_system_lyxrc ||
2427 language_command_local
2428 != system_lyxrc.language_command_local) {
2429 os << "\\language_command_local \""
2430 << language_command_local
2435 case RC_LANGUAGE_AUTO_BEGIN:
2436 if (ignore_system_lyxrc ||
2437 language_auto_begin != system_lyxrc.language_auto_begin) {
2438 os << "\\language_auto_begin "
2439 << convert<string>(language_auto_begin) << '\n';
2443 case RC_LANGUAGE_AUTO_END:
2444 if (ignore_system_lyxrc ||
2445 language_auto_end != system_lyxrc.language_auto_end) {
2446 os << "\\language_auto_end "
2447 << convert<string>(language_auto_end) << '\n';
2451 case RC_MARK_FOREIGN_LANGUAGE:
2452 if (ignore_system_lyxrc ||
2453 mark_foreign_language
2454 != system_lyxrc.mark_foreign_language) {
2455 os << "\\mark_foreign_language " <<
2456 convert<string>(mark_foreign_language) << '\n';
2462 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2465 case RC_AUTO_NUMBER:
2466 if (ignore_system_lyxrc ||
2467 auto_number != system_lyxrc.auto_number) {
2468 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2472 case RC_DEFAULT_LANGUAGE:
2473 if (ignore_system_lyxrc ||
2474 default_language != system_lyxrc.default_language) {
2475 os << "\\default_language " << default_language << '\n';
2481 << "# FORMATS SECTION ##########################\n"
2485 // New/modified formats
2486 for (Formats::const_iterator cit = formats.begin();
2487 cit != formats.end(); ++cit) {
2488 Format const * format =
2489 system_formats.getFormat(cit->name());
2491 format->extension() != cit->extension() ||
2492 format->prettyname() != cit->prettyname() ||
2493 format->shortcut() != cit->shortcut() ||
2494 format->viewer() != cit->viewer() ||
2495 format->editor() != cit->editor() ||
2496 format->documentFormat() != cit->documentFormat() ||
2497 format->vectorFormat() != cit->vectorFormat()) {
2498 os << "\\format \"" << cit->name() << "\" \""
2499 << cit->extension() << "\" \""
2500 << cit->prettyname() << "\" \""
2501 << cit->shortcut() << "\" \""
2502 << cit->viewer() << "\" \""
2503 << cit->editor() << "\" \"";
2504 vector<string> flags;
2505 if (cit->documentFormat())
2506 flags.push_back("document");
2507 if (cit->vectorFormat())
2508 flags.push_back("vector");
2509 os << getStringFromVector(flags);
2514 // Look for deleted formats
2515 for (Formats::const_iterator cit = system_formats.begin();
2516 cit != system_formats.end(); ++cit)
2517 if (!formats.getFormat(cit->name()))
2518 os << "\\format \"" << cit->name()
2519 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2528 << "# CONVERTERS SECTION ##########################\n"
2532 // Look for new converters
2533 for (Converters::const_iterator cit = theConverters().begin();
2534 cit != theConverters().end(); ++cit) {
2535 Converter const * converter =
2536 theSystemConverters().getConverter(cit->from,
2539 converter->command != cit->command ||
2540 converter->flags != cit->flags)
2541 os << "\\converter \"" << cit->from << "\" \""
2542 << cit->to << "\" \""
2543 << cit->command << "\" \""
2544 << cit->flags << "\"\n";
2547 // New/modifed converters
2548 for (Converters::const_iterator cit = theSystemConverters().begin();
2549 cit != theSystemConverters().end(); ++cit)
2550 if (!theConverters().getConverter(cit->from, cit->to))
2551 os << "\\converter \"" << cit->from
2552 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2559 << "# COPIERS SECTION ##########################\n"
2562 // Look for new movers
2563 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2564 Movers::const_iterator const sysend = theSystemMovers().end();
2565 Movers::const_iterator it = theMovers().begin();
2566 Movers::const_iterator end = theMovers().end();
2568 for (; it != end; ++it) {
2569 Movers::const_iterator const sysit =
2570 find_if(sysbegin, sysend, SameMover(*it));
2571 if (sysit == sysend) {
2572 string const & fmt = it->first;
2573 string const & command =
2574 it->second.command();
2576 os << "\\copier " << fmt
2577 << " \"" << command << "\"\n";
2583 // We don't actually delete SpecialisedMover(s) from the
2584 // map, just clear their 'command', so there's no need
2585 // to test for anything else.
2593 string const LyXRC::getDescription(LyXRCTags tag)
2598 case RC_ACCEPT_COMPOUND:
2599 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2603 case RC_USE_ALT_LANG:
2604 str = _("Specify an alternate language. The default is to use the language of the document.");
2607 case RC_PLAINTEXT_ROFF_COMMAND:
2608 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.");
2611 case RC_PLAINTEXT_LINELEN:
2612 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.");
2615 case RC_AUTOREGIONDELETE:
2616 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2619 case RC_AUTORESET_OPTIONS:
2620 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2624 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2627 case RC_AUTO_NUMBER:
2630 case RC_BACKUPDIR_PATH:
2631 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.");
2634 case RC_BIBTEX_COMMAND:
2635 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2639 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2642 case RC_CHECKLASTFILES:
2643 str = _("Select to check whether the lastfiles still exist.");
2646 case RC_CHKTEX_COMMAND:
2647 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2656 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2657 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.");
2660 case RC_SHOW_MACRO_LABEL:
2661 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2664 case RC_CUSTOM_EXPORT_COMMAND:
2667 case RC_CUSTOM_EXPORT_FORMAT:
2670 case RC_DATE_INSERT_FORMAT:
2671 //xgettext:no-c-format
2672 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2676 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2679 case RC_DEFAULT_LANGUAGE:
2680 str = _("New documents will be assigned this language.");
2683 case RC_DEFAULT_PAPERSIZE:
2684 str = _("Specify the default paper size.");
2687 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2688 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2691 case RC_DISPLAY_GRAPHICS:
2692 str = _("Select how LyX will display any graphics.");
2695 case RC_DOCUMENTPATH:
2696 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2700 case RC_USE_ESC_CHARS:
2701 str = _("Specify additional chars that can be part of a word.");
2704 case RC_EXAMPLEPATH:
2705 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2708 case RC_FONT_ENCODING:
2709 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2715 case RC_INDEX_COMMAND:
2716 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\".");
2723 case RC_KBMAP_PRIMARY:
2724 case RC_KBMAP_SECONDARY:
2725 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.");
2728 case RC_LABEL_INIT_LENGTH:
2729 str = _("Maximum number of words in the initialization string for a new label");
2732 case RC_LANGUAGE_AUTO_BEGIN:
2733 str = _("Select if a language switching command is needed at the beginning of the document.");
2736 case RC_LANGUAGE_AUTO_END:
2737 str = _("Select if a language switching command is needed at the end of the document.");
2740 case RC_LANGUAGE_COMMAND_BEGIN:
2741 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.");
2744 case RC_LANGUAGE_COMMAND_END:
2745 str = _("The LaTeX command for changing back to the language of the document.");
2748 case RC_LANGUAGE_COMMAND_LOCAL:
2749 str = _("The LaTeX command for local changing of the language.");
2752 case RC_LANGUAGE_GLOBAL_OPTIONS:
2753 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2756 case RC_LANGUAGE_PACKAGE:
2757 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2760 case RC_LANGUAGE_USE_BABEL:
2761 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2764 case RC_USELASTFILEPOS:
2765 str = _("De-select if you do not want LyX to scroll to saved position.");
2768 case RC_LOADSESSION:
2769 str = _("De-select to prevent loading files opened from the last LyX session.");
2772 case RC_MAKE_BACKUP:
2773 str = _("De-select if you don't want LyX to create backup files.");
2776 case RC_MARK_FOREIGN_LANGUAGE:
2777 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2780 case RC_MOUSE_WHEEL_SPEED:
2781 str = bformat(_("The scrolling speed of the mouse wheel."),
2785 case RC_COMPLETION_POPUP_DELAY:
2786 str = _("The completion popup delay.");
2789 case RC_COMPLETION_POPUP_MATH:
2790 str = _("Select to display the completion popup in math mode.");
2793 case RC_COMPLETION_POPUP_TEXT:
2794 str = _("Select to display the completion popup in text mode.");
2797 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2798 str = _("Show the completion popup without delay after non-unique completion attempt.");
2801 case RC_COMPLETION_POPUP_DELAY:
2802 str = _("The inline completion delay.");
2805 case RC_COMPLETION_INLINE_MATH:
2806 str = _("Select to display the inline completion in math mode.");
2809 case RC_COMPLETION_INLINE_TEXT:
2810 str = _("Select to display the inline completion in text mode.");
2813 case RC_COMPLETION_INLINE_DOTS:
2814 str = _("Use \"...\" to shorten long completions.");
2817 case RC_NUMLASTFILES:
2818 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2822 case RC_PATH_PREFIX:
2823 str = _("Specify those directories which should be "
2824 "prepended to the PATH environment variable. "
2825 "Use the OS native format.");
2829 case RC_USE_PERS_DICT:
2830 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2834 str = _("Shows a typeset preview of things such as math");
2837 case RC_PREVIEW_HASHED_LABELS:
2838 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2841 case RC_PREVIEW_SCALE_FACTOR:
2842 str = _("Scale the preview size to suit.");
2845 case RC_PRINTCOLLCOPIESFLAG:
2846 str = _("The option for specifying whether the copies should be collated.");
2849 case RC_PRINTCOPIESFLAG:
2850 str = _("The option for specifying the number of copies to print.");
2854 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2857 case RC_PRINTEVENPAGEFLAG:
2858 str = _("The option to print only even pages.");
2861 case RC_PRINTEXSTRAOPTIONS:
2862 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2865 case RC_PRINTFILEEXTENSION:
2866 str = _("Extension of printer program output file. Usually \".ps\".");
2869 case RC_PRINTLANDSCAPEFLAG:
2870 str = _("The option to print out in landscape.");
2873 case RC_PRINTODDPAGEFLAG:
2874 str = _("The option to print only odd pages.");
2877 case RC_PRINTPAGERANGEFLAG:
2878 str = _("The option for specifying a comma-separated list of pages to print.");
2881 case RC_PRINTPAPERDIMENSIONFLAG:
2882 str = _("Option to specify the dimensions of the print paper.");
2885 case RC_PRINTPAPERFLAG:
2886 str = _("The option to specify paper type.");
2889 case RC_PRINTREVERSEFLAG:
2890 str = _("The option to reverse the order of the pages printed.");
2893 case RC_PRINTSPOOL_COMMAND:
2894 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.");
2897 case RC_PRINTSPOOL_PRINTERPREFIX:
2898 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.");
2901 case RC_PRINTTOFILE:
2902 str = _("Option to pass to the print program to print to a file.");
2905 case RC_PRINTTOPRINTER:
2906 str = _("Option to pass to the print program to print on a specific printer.");
2909 case RC_PRINT_ADAPTOUTPUT:
2910 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2913 case RC_PRINT_COMMAND:
2914 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2917 case RC_RTL_SUPPORT:
2918 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2921 case RC_VISUAL_CURSOR:
2922 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2926 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2929 case RC_SCREEN_FONT_ROMAN:
2930 case RC_SCREEN_FONT_SANS:
2931 case RC_SCREEN_FONT_TYPEWRITER:
2932 str = _("The screen fonts used to display the text while editing.");
2935 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2936 case RC_SCREEN_FONT_SANS_FOUNDRY:
2937 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2940 case RC_SCREEN_FONT_SCALABLE:
2941 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.");
2944 case RC_SCREEN_FONT_SIZES:
2945 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2948 case RC_SCREEN_ZOOM:
2949 //xgettext:no-c-format
2950 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2953 case RC_GEOMETRY_SESSION:
2954 str = _("Allow session manager to save and restore windows geometry.");
2958 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2964 case RC_SHOW_BANNER:
2965 str = _("De-select if you don't want the startup banner.");
2968 case RC_SPELL_COMMAND:
2969 str = _("What command runs the spellchecker?");
2972 case RC_TEMPDIRPATH:
2973 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2976 case RC_TEMPLATEPATH:
2977 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2980 case RC_TEX_ALLOWS_SPACES:
2983 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2987 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2999 case RC_USE_INP_ENC:
3000 str = _("Specify whether to pass the -T input encoding option to ispell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
3003 case RC_USE_TOOLTIP:
3004 str = _("Enable the automatic appearance of tool tips in the work area.");
3007 case RC_USE_PIXMAP_CACHE:
3008 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3011 case RC_USE_SPELL_LIB:
3014 case RC_VIEWDVI_PAPEROPTION:
3015 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3030 // The global instance
3033 // The global copy of the system lyxrc entries (everything except preferences)