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 { "\\converter", LyXRC::RC_CONVERTER },
67 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
68 { "\\copier", LyXRC::RC_COPIER },
69 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
70 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
71 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
72 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
73 { "\\def_file", LyXRC::RC_DEFFILE },
74 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
75 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
76 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
77 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
78 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
79 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
80 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
81 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
82 { "\\format", LyXRC::RC_FORMAT },
83 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
84 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
85 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
86 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
87 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
88 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
89 { "\\input", LyXRC::RC_INPUT },
90 { "\\kbmap", LyXRC::RC_KBMAP },
91 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
92 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
93 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
94 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
95 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
96 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
97 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
98 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
99 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
100 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
101 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
102 { "\\load_session", LyXRC::RC_LOADSESSION },
103 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
104 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
105 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
106 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
107 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
108 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
109 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
110 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
111 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
112 { "\\preview", LyXRC::RC_PREVIEW },
113 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
114 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
115 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
116 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
117 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
118 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
119 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
120 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
121 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
122 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
123 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
124 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
125 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
126 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
127 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
128 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
129 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
130 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
131 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
132 { "\\printer", LyXRC::RC_PRINTER },
133 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
134 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
135 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
136 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
137 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
138 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
139 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
140 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
141 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
142 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
143 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
144 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
145 { "\\set_color", LyXRC::RC_SET_COLOR },
146 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
147 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
148 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
149 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
150 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
151 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
152 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
153 { "\\ui_file", LyXRC::RC_UIFILE },
154 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
155 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
156 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
157 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
158 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
159 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
160 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
161 // compatibility with versions older than 1.4.0 only
162 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
163 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
164 // compatibility with versions older than 1.4.0 only
165 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
166 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
167 { "\\user_email", LyXRC::RC_USER_EMAIL },
168 { "\\user_name", LyXRC::RC_USER_NAME },
169 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
170 // compatibility with versions older than 1.4.0 only
171 { "\\viewer", LyXRC::RC_VIEWER},
172 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
175 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
186 void LyXRC::setDefaults() {
188 def_file = "default";
190 // Get printer from the environment. If fail, use default "",
191 // assuming that everything is set up correctly.
192 printer = getEnv("PRINTER");
193 print_adapt_output = false;
194 print_command = "dvips";
195 print_evenpage_flag = "-B";
196 print_oddpage_flag = "-A";
197 print_pagerange_flag = "-pp";
198 print_copies_flag = "-c";
199 print_collcopies_flag = "-C";
200 print_reverse_flag = "-r";
201 print_landscape_flag = "-t landscape";
202 print_to_printer = "-P";
203 print_to_file = "-o ";
204 print_file_extension = ".ps";
205 print_paper_flag = "-t";
206 print_paper_dimension_flag = "-T";
207 document_path.erase();
208 view_dvi_paper_option.erase();
209 default_papersize = PAPER_DEFAULT;
210 custom_export_format = "ps";
211 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
212 bibtex_command = "bibtex";
214 index_command = "makeindex -c -q";
216 // Because a screen typically is wider than a piece of paper:
218 allow_geometry_session = true;
219 // Default LaTeX font size:
220 font_sizes[FONT_SIZE_TINY] = "5.0";
221 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
222 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
223 font_sizes[FONT_SIZE_SMALL] = "9.0";
224 font_sizes[FONT_SIZE_NORMAL] = "10.0";
225 font_sizes[FONT_SIZE_LARGE] = "12.0";
226 font_sizes[FONT_SIZE_LARGER] = "14.4";
227 font_sizes[FONT_SIZE_LARGEST] = "17.26";
228 font_sizes[FONT_SIZE_HUGE] = "20.74";
229 font_sizes[FONT_SIZE_HUGER] = "24.88";
230 use_scalable_fonts = true;
231 roman_font_name = "";
233 typewriter_font_name = "";
235 auto_region_delete = true;
236 auto_reset_options = false;
237 plaintext_linelen = 65;
238 mouse_wheel_speed = 1.0;
239 num_lastfiles = maxlastfiles;
240 check_lastfiles = true;
241 use_lastfilepos = true;
242 load_session = false;
244 backupdir_path.erase();
245 display_graphics = graphics::ColorDisplay;
246 // Spellchecker settings:
247 use_spell_lib = true;
248 isp_command = "ispell";
249 isp_accept_compound = false;
250 isp_use_input_encoding = false;
251 isp_use_alt_lang = false;
252 isp_use_pers_dict = false;
253 isp_use_esc_chars = false;
256 visual_cursor = false;
258 mark_foreign_language = true;
259 language_auto_begin = true;
260 language_auto_end = true;
261 language_global_options = true;
262 language_use_babel = true;
263 language_package = "\\usepackage{babel}";
264 language_command_begin = "\\selectlanguage{$$lang}";
265 language_command_local = "\\foreignlanguage{$$lang}{";
266 sort_layouts = false;
267 default_language = "english";
269 windows_style_tex_paths = false;
270 tex_allows_spaces = false;
271 date_insert_format = "%x";
272 cursor_follows_scrollbar = false;
273 macro_edit_style = MACRO_EDIT_INLINE_BOX;
274 dialogs_iconify_with_main = false;
275 label_init_length = 3;
276 preview = PREVIEW_OFF;
277 preview_hashed_labels = false;
278 preview_scale_factor = "0.9";
279 use_converter_cache = true;
281 use_pixmap_cache = false;
282 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
283 // Fullscreen settings
284 full_screen_limit = false;
285 full_screen_toolbars = true;
286 full_screen_tabbar = true;
287 full_screen_scrollbar = true;
288 full_screen_width = 700;
290 user_name = to_utf8(support::user_name());
292 user_email = to_utf8(support::user_email());
298 void oldFontFormat(string & family, string & foundry)
300 if (family.empty() || family[0] != '-')
302 foundry = token(family, '-', 1);
303 family = token(family, '-', 2);
311 int LyXRC::read(FileName const & filename)
313 Lexer lexrc(lyxrcTags, lyxrcCount);
314 if (lyxerr.debugging(Debug::PARSER))
315 lexrc.printTable(lyxerr);
317 lexrc.setFile(filename);
318 if (!lexrc.isOK()) return -2;
320 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
326 int LyXRC::read(istream & is)
328 Lexer lexrc(lyxrcTags, lyxrcCount);
329 if (lyxerr.debugging(Debug::PARSER))
330 lexrc.printTable(lyxerr);
333 if (!lexrc.isOK()) return -2;
335 LYXERR(Debug::LYXRC, "Reading istream...");
341 int LyXRC::read(Lexer & lexrc)
343 if (!lexrc.isOK()) return -2;
345 while (lexrc.isOK()) {
346 // By using two switches we take advantage of the compiler
347 // telling us if we have missed a LyXRCTags element in
348 // the second switch.
349 // Note that this also shows a problem with Lexer since it
350 // helps us avoid taking advantage of the strictness of the
353 int le = lexrc.lex();
355 case Lexer::LEX_UNDEF:
356 lexrc.printError("Unknown tag `$$Token'");
358 case Lexer::LEX_FEOF:
362 switch (static_cast<LyXRCTags>(le)) {
363 case RC_INPUT: // Include file
366 libFileSearch(string(),
369 lexrc.printError("Error reading "
370 "included file: " + tmp.absFilename());
376 bind_file = os::internal_path(lexrc.getString());
382 def_file = os::internal_path(lexrc.getString());
388 ui_file = os::internal_path(lexrc.getString());
392 case RC_AUTORESET_OPTIONS:
394 auto_reset_options = lexrc.getBool();
398 case RC_DISPLAY_GRAPHICS:
400 display_graphics = graphics::displayTranslator().find(lexrc.getString());
404 case RC_TEX_EXPECTS_WINDOWS_PATHS:
406 windows_style_tex_paths = lexrc.getBool();
410 case RC_TEX_ALLOWS_SPACES:
412 tex_allows_spaces = lexrc.getBool();
418 use_kbmap = lexrc.getBool();
422 case RC_KBMAP_PRIMARY:
424 string const kmap(os::internal_path(lexrc.getString()));
427 } else if (!libFileSearch("kbd", kmap,
429 primary_kbmap = kmap;
431 lexrc.printError("LyX: Keymap `$$Token' not found");
436 case RC_KBMAP_SECONDARY:
438 string const kmap(os::internal_path(lexrc.getString()));
441 } else if (!libFileSearch("kbd", kmap,
443 secondary_kbmap = kmap;
445 lexrc.printError("LyX: Keymap `$$Token' not found");
450 case RC_FONT_ENCODING:
452 fontenc = lexrc.getString();
458 printer = lexrc.getString();
462 case RC_PRINT_COMMAND:
464 print_command = lexrc.getString();
468 case RC_PRINTEVENPAGEFLAG:
470 print_evenpage_flag = lexrc.getString();
474 case RC_PRINTODDPAGEFLAG:
476 print_oddpage_flag = lexrc.getString();
480 case RC_PRINTPAGERANGEFLAG:
482 print_pagerange_flag = lexrc.getString();
486 case RC_PRINTCOPIESFLAG:
488 print_copies_flag = lexrc.getString();
492 case RC_PRINTCOLLCOPIESFLAG:
494 print_collcopies_flag = lexrc.getString();
498 case RC_PRINTREVERSEFLAG:
500 print_reverse_flag = lexrc.getString();
504 case RC_PRINTLANDSCAPEFLAG:
506 print_landscape_flag = lexrc.getString();
510 case RC_PRINTTOPRINTER:
512 print_to_printer = lexrc.getString();
516 case RC_PRINT_ADAPTOUTPUT:
518 print_adapt_output = lexrc.getBool();
524 print_to_file = os::internal_path(lexrc.getString());
528 case RC_PRINTFILEEXTENSION:
530 print_file_extension = lexrc.getString();
534 case RC_PRINTEXSTRAOPTIONS:
536 print_extra_options = lexrc.getString();
540 case RC_PRINTSPOOL_COMMAND:
542 print_spool_command = lexrc.getString();
546 case RC_PRINTSPOOL_PRINTERPREFIX:
548 print_spool_printerprefix = lexrc.getString();
552 case RC_PRINTPAPERDIMENSIONFLAG:
554 print_paper_dimension_flag = lexrc.getString();
558 case RC_PRINTPAPERFLAG:
560 print_paper_flag = lexrc.getString();
564 case RC_CUSTOM_EXPORT_COMMAND:
566 custom_export_command = lexrc.getString();
570 case RC_CUSTOM_EXPORT_FORMAT:
572 custom_export_format = lexrc.getString();
576 case RC_DEFAULT_PAPERSIZE:
579 ascii_lowercase(lexrc.getString());
580 if (size == "usletter")
583 else if (size == "legal")
586 else if (size == "executive")
589 else if (size == "a3")
592 else if (size == "a4")
595 else if (size == "a5")
598 else if (size == "b5")
601 else if (size == "default")
607 case RC_VIEWDVI_PAPEROPTION:
609 view_dvi_paper_option = lexrc.getString();
611 view_dvi_paper_option.erase();
615 case RC_CHKTEX_COMMAND:
617 chktex_command = lexrc.getString();
621 case RC_BIBTEX_COMMAND:
623 bibtex_command = lexrc.getString();
627 case RC_INDEX_COMMAND:
629 index_command = lexrc.getString();
635 dpi = lexrc.getInteger();
641 zoom = lexrc.getInteger();
645 case RC_GEOMETRY_SESSION:
647 allow_geometry_session = lexrc.getBool();
651 case RC_SCREEN_FONT_SIZES:
653 font_sizes[FONT_SIZE_TINY] =
657 font_sizes[FONT_SIZE_SCRIPT] =
661 font_sizes[FONT_SIZE_FOOTNOTE] =
665 font_sizes[FONT_SIZE_SMALL] =
669 font_sizes[FONT_SIZE_NORMAL] =
673 font_sizes[FONT_SIZE_LARGE] =
677 font_sizes[FONT_SIZE_LARGER] =
681 font_sizes[FONT_SIZE_LARGEST] =
685 font_sizes[FONT_SIZE_HUGE] =
689 font_sizes[FONT_SIZE_HUGER] =
694 case RC_SCREEN_FONT_SCALABLE:
696 use_scalable_fonts = lexrc.getBool();
702 autosave = lexrc.getInteger();
706 case RC_DOCUMENTPATH:
708 document_path = os::internal_path(lexrc.getString());
709 document_path = expandPath(document_path);
715 example_path = os::internal_path(lexrc.getString());
716 example_path = expandPath(example_path);
720 case RC_TEMPLATEPATH:
722 template_path = os::internal_path(lexrc.getString());
723 template_path = expandPath(template_path);
729 tempdir_path = os::internal_path(lexrc.getString());
730 tempdir_path = expandPath(tempdir_path);
736 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
740 case RC_USELASTFILEPOS:
742 use_lastfilepos = lexrc.getBool();
748 load_session = lexrc.getBool();
752 case RC_MOUSE_WHEEL_SPEED:
754 mouse_wheel_speed = lexrc.getFloat();
758 case RC_NUMLASTFILES:
760 num_lastfiles = lexrc.getInteger();
764 case RC_CHECKLASTFILES:
766 check_lastfiles = lexrc.getBool();
770 case RC_SCREEN_FONT_ROMAN:
772 roman_font_name = lexrc.getString();
773 oldFontFormat(roman_font_name,
778 case RC_SCREEN_FONT_SANS:
780 sans_font_name = lexrc.getString();
781 oldFontFormat(sans_font_name, sans_font_foundry);
785 case RC_SCREEN_FONT_TYPEWRITER:
787 typewriter_font_name = lexrc.getString();
788 oldFontFormat(typewriter_font_name,
789 typewriter_font_foundry);
793 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
795 roman_font_foundry = lexrc.getString();
799 case RC_SCREEN_FONT_SANS_FOUNDRY:
801 sans_font_foundry = lexrc.getString();
805 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
807 typewriter_font_foundry = lexrc.getString();
813 string lyx_name, x11_name;
816 lyx_name = lexrc.getString();
818 lexrc.printError("Missing color tag.");
823 x11_name = lexrc.getString();
825 lexrc.printError("Missing color name for color: `$$Token'");
829 ColorCode const col =
830 lcolor.getFromLyXName(lyx_name);
831 if (col == Color_none ||
832 col == Color_inherit ||
836 if (!lcolor.setColor(col, x11_name)) {
837 lyxerr << "Bad lyxrc set_color for "
843 case RC_AUTOREGIONDELETE:
844 // Auto region delete defaults to true
846 auto_region_delete = lexrc.getBool();
852 lyxpipes = os::internal_path(lexrc.getString());
853 lyxpipes = expandPath(lyxpipes);
857 case RC_CURSOR_FOLLOWS_SCROLLBAR:
859 cursor_follows_scrollbar = lexrc.getBool();
863 case RC_MACRO_EDIT_STYLE:
865 switch (lexrc.getInteger()) {
866 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
867 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
868 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
873 case RC_DIALOGS_ICONIFY_WITH_MAIN:
875 dialogs_iconify_with_main = lexrc.getBool();
879 case RC_PLAINTEXT_ROFF_COMMAND:
881 plaintext_roff_command = lexrc.getString();
884 case RC_PLAINTEXT_LINELEN:
886 plaintext_linelen = lexrc.getInteger();
889 // Spellchecker settings:
890 case RC_USE_SPELL_LIB:
892 use_spell_lib = lexrc.getBool();
895 case RC_SPELL_COMMAND:
897 isp_command = lexrc.getString();
900 case RC_ACCEPT_COMPOUND:
902 isp_accept_compound = lexrc.getBool();
907 isp_use_input_encoding = lexrc.getBool();
910 case RC_USE_ALT_LANG:
912 isp_use_alt_lang = lexrc.getBool();
915 case RC_USE_PERS_DICT:
917 isp_use_pers_dict = lexrc.getBool();
922 use_tooltip = lexrc.getBool();
925 case RC_USE_PIXMAP_CACHE:
927 use_pixmap_cache = lexrc.getBool();
930 case RC_USE_ESC_CHARS:
932 isp_use_esc_chars = lexrc.getBool();
937 isp_alt_lang = lexrc.getString();
942 isp_pers_dict = os::internal_path(lexrc.getString());
947 isp_esc_chars = lexrc.getString();
952 make_backup = lexrc.getBool();
955 case RC_BACKUPDIR_PATH:
957 backupdir_path = os::internal_path(lexrc.getString());
958 backupdir_path = expandPath(backupdir_path);
961 case RC_DATE_INSERT_FORMAT:
963 date_insert_format = lexrc.getString();
966 case RC_LANGUAGE_PACKAGE:
968 language_package = lexrc.getString();
971 case RC_LANGUAGE_AUTO_BEGIN:
973 language_auto_begin = lexrc.getBool();
976 case RC_LANGUAGE_AUTO_END:
978 language_auto_end = lexrc.getBool();
981 case RC_LANGUAGE_GLOBAL_OPTIONS:
983 language_global_options = lexrc.getBool();
986 case RC_LANGUAGE_USE_BABEL:
988 language_use_babel = lexrc.getBool();
991 case RC_LANGUAGE_COMMAND_BEGIN:
993 language_command_begin = lexrc.getString();
996 case RC_LANGUAGE_COMMAND_END:
998 language_command_end = lexrc.getString();
1001 case RC_LANGUAGE_COMMAND_LOCAL:
1003 language_command_local = lexrc.getString();
1006 case RC_RTL_SUPPORT:
1008 rtl_support = lexrc.getBool();
1011 case RC_VISUAL_CURSOR:
1013 visual_cursor = lexrc.getBool();
1016 case RC_AUTO_NUMBER:
1018 auto_number = lexrc.getBool();
1021 case RC_MARK_FOREIGN_LANGUAGE:
1023 mark_foreign_language = lexrc.getBool();
1028 string fmt, command;
1030 fmt = lexrc.getString();
1033 command = lexrc.getString();
1035 setMover(fmt, command);
1039 case RC_CONVERTER: {
1040 string from, to, command, flags;
1042 from = lexrc.getString();
1045 to = lexrc.getString();
1048 command = lexrc.getString();
1051 flags = lexrc.getString();
1053 if (command.empty()) {
1054 theConverters().erase(from, to);
1056 theConverters().add(from, to, command, flags);
1060 // compatibility with versions older than 1.4.0 only
1062 string format, command;
1064 format = lexrc.getString();
1067 command = lexrc.getString();
1069 formats.setViewer(format, command);
1073 string format, extension, prettyname, shortcut;
1075 format = lexrc.getString();
1078 extension = lexrc.getString();
1081 prettyname = lexrc.getString();
1084 shortcut = lexrc.getString();
1086 string viewer, editor;
1088 viewer = lexrc.getString();
1090 editor = lexrc.getString();
1092 // Hack to ensure compatibility with versions older
1094 int le = lexrc.lex();
1095 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1096 flags = lexrc.getString();
1097 if (le != Lexer::LEX_DATA) {
1098 // We have got a known token.
1099 // Therefore this is an old style
1100 // format definition without
1102 lexrc.pushToken(flags);
1106 int flgs = Format::none;
1107 while (!flags.empty()) {
1109 flags = split(flags, flag, ',');
1110 if (flag == "document")
1111 flgs |= Format::document;
1112 else if (flag == "vector")
1113 flgs |= Format::vector;
1115 lyxerr << "Ignoring unknown flag `"
1116 << flag << "' for format `"
1117 << format << "'." << endl;
1119 if (prettyname.empty()) {
1120 if (theConverters().formatIsUsed(format)) {
1121 lyxerr << "Can't delete format "
1124 formats.erase(format);
1127 formats.add(format, extension, prettyname,
1128 shortcut, viewer, editor, flgs);
1132 case RC_DEFAULT_LANGUAGE:
1134 default_language = lexrc.getString();
1138 case RC_LABEL_INIT_LENGTH:
1140 label_init_length = lexrc.getInteger();
1144 case RC_SHOW_BANNER:
1146 show_banner = lexrc.getBool();
1152 string const tmp = lexrc.getString();
1153 if (tmp == "true" || tmp == "on")
1154 preview = PREVIEW_ON;
1155 else if (tmp == "no_math")
1156 preview = PREVIEW_NO_MATH;
1158 preview = PREVIEW_OFF;
1159 if (tmp != "false" && tmp != "off")
1160 lyxerr << "Unrecognized "
1162 << tmp << '\n' << endl;
1167 case RC_PREVIEW_HASHED_LABELS:
1169 preview_hashed_labels = lexrc.getBool();
1173 case RC_PREVIEW_SCALE_FACTOR:
1175 preview_scale_factor = lexrc.getString();
1181 user_name = lexrc.getString();
1186 user_email = lexrc.getString();
1189 case RC_PATH_PREFIX:
1191 path_prefix = lexrc.getString();
1194 case RC_USE_CONVERTER_CACHE:
1196 use_converter_cache = lexrc.getBool();
1199 case RC_CONVERTER_CACHE_MAXAGE:
1201 converter_cache_maxage =
1202 convert<unsigned int>(lexrc.getString());
1205 case RC_SORT_LAYOUTS:
1207 sort_layouts = lexrc.getBool();
1209 case RC_FULL_SCREEN_LIMIT:
1211 full_screen_limit = lexrc.getBool();
1213 case RC_FULL_SCREEN_TOOLBARS:
1215 full_screen_toolbars = lexrc.getBool();
1217 case RC_FULL_SCREEN_SCROLLBAR:
1219 full_screen_scrollbar = lexrc.getBool();
1221 case RC_FULL_SCREEN_TABBAR:
1223 full_screen_tabbar = lexrc.getBool();
1225 case RC_FULL_SCREEN_WIDTH:
1227 full_screen_width = lexrc.getInteger();
1230 case RC_LAST: break; // this is just a dummy
1234 /// Update converters data-structures
1235 theConverters().update(formats);
1236 theConverters().buildGraph();
1242 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1244 ofstream ofs(filename.toFilesystemEncoding().c_str());
1246 write(ofs, ignore_system_lyxrc);
1250 void LyXRC::print() const
1252 if (lyxerr.debugging())
1253 write(lyxerr, false);
1261 typedef pair<string, SpecialisedMover> Data;
1263 SameMover(Data const & comparison)
1264 : comparison_(comparison) {}
1266 bool operator()(Data const & data) const
1268 return data.first == comparison_.first &&
1269 data.second.command() == comparison_.second.command();
1277 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1279 LyXRCTags tag = RC_LAST;
1281 if (!name.empty()) {
1282 for (int i = 0; i != lyxrcCount; ++i)
1283 if ("\\" + name == lyxrcTags[i].tag)
1284 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1288 os << "### This file is part of\n"
1289 << "### ========================================================\n"
1290 << "### LyX, The Document Processor\n"
1292 << "### Copyright 1995 Matthias Ettrich\n"
1293 << "### Copyright 1995-2007 The LyX Team.\n"
1295 << "### ========================================================\n"
1297 << "# This file is written by LyX, if you want to make your own\n"
1298 << "# modifications you should do them from inside LyX and save\n"
1301 // Why the switch you might ask. It is a trick to ensure that all
1302 // the elements in the LyXRCTags enum is handled. As you can see
1303 // there are no breaks at all. So it is just a huge fall-through.
1304 // The nice thing is that we will get a warning from the compiler
1305 // if we forget an element.
1309 // input/include files are not done here
1311 if (ignore_system_lyxrc ||
1312 bind_file != system_lyxrc.bind_file) {
1313 string const path = os::external_path(bind_file);
1314 os << "\\bind_file \"" << path << "\"\n";
1320 if (ignore_system_lyxrc ||
1321 def_file != system_lyxrc.def_file) {
1322 string const path = os::external_path(def_file);
1323 os << "\\def_file \"" << path << "\"\n";
1332 << "# MISC SECTION ######################################\n"
1334 // bind files are not done here.
1336 case RC_PATH_PREFIX:
1337 if (ignore_system_lyxrc ||
1338 path_prefix != system_lyxrc.path_prefix) {
1339 os << "\\path_prefix \"" << path_prefix << "\"\n";
1344 if (ignore_system_lyxrc ||
1345 ui_file != system_lyxrc.ui_file) {
1346 string const path = os::external_path(ui_file);
1347 os << "\\ui_file \"" << path << "\"\n";
1351 case RC_AUTOREGIONDELETE:
1352 if (ignore_system_lyxrc ||
1353 auto_region_delete != system_lyxrc.auto_region_delete) {
1354 os << "# Set to false to inhibit automatic replacement of\n"
1355 << "# the current selection.\n"
1356 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1361 case RC_AUTORESET_OPTIONS:
1362 if (ignore_system_lyxrc ||
1363 auto_reset_options != system_lyxrc.auto_reset_options) {
1364 os << "# Set to false to inhibit automatic reset of\n"
1365 << "# the class options to defaults on class change.\n"
1366 << "\\auto_reset_options "
1367 << convert<string>(auto_reset_options)
1373 if (ignore_system_lyxrc ||
1374 autosave != system_lyxrc.autosave) {
1375 os << "# The time interval between auto-saves in seconds.\n"
1376 << "\\autosave " << autosave << '\n';
1380 case RC_DISPLAY_GRAPHICS:
1381 if (ignore_system_lyxrc ||
1382 display_graphics != system_lyxrc.display_graphics) {
1383 os << "# Display graphics within LyX\n"
1384 << "# monochrome|grayscale|color|none\n"
1385 << "\\display_graphics "
1386 << graphics::displayTranslator().find(
1387 graphics::DisplayType(display_graphics))
1392 case RC_SORT_LAYOUTS:
1393 if (ignore_system_lyxrc ||
1394 sort_layouts != system_lyxrc.sort_layouts) {
1395 os << "# Sort layouts alphabetically.\n"
1396 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1400 case RC_VIEWDVI_PAPEROPTION:
1401 if (ignore_system_lyxrc ||
1402 view_dvi_paper_option
1403 != system_lyxrc.view_dvi_paper_option) {
1404 os << "# Options used to specify paper size to the\n"
1405 << "# view_dvi_command (e.g. -paper)\n"
1406 << "\\view_dvi_paper_option \""
1407 << view_dvi_paper_option << "\"\n";
1411 case RC_DEFAULT_PAPERSIZE:
1412 if (ignore_system_lyxrc ||
1413 default_papersize != system_lyxrc.default_papersize) {
1414 os << "# The default papersize to use.\n"
1415 << "\\default_papersize \"";
1416 switch (default_papersize) {
1418 os << "default"; break;
1419 case PAPER_USLETTER:
1420 os << "usletter"; break;
1422 os << "legal"; break;
1423 case PAPER_USEXECUTIVE:
1424 os << "executive"; break;
1435 case PAPER_B4: break;
1441 case RC_CHKTEX_COMMAND:
1442 if (ignore_system_lyxrc ||
1443 chktex_command != system_lyxrc.chktex_command) {
1444 os << "\\chktex_command \"" << chktex_command << "\"\n";
1448 case RC_BIBTEX_COMMAND:
1449 if (ignore_system_lyxrc ||
1450 bibtex_command != system_lyxrc.bibtex_command) {
1451 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1455 case RC_INDEX_COMMAND:
1456 if (ignore_system_lyxrc ||
1457 index_command != system_lyxrc.index_command) {
1458 os << "\\index_command \"" << index_command << "\"\n";
1462 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1463 if (ignore_system_lyxrc ||
1464 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1465 os << "\\tex_expects_windows_paths "
1466 << convert<string>(windows_style_tex_paths) << '\n';
1470 case RC_TEX_ALLOWS_SPACES:
1471 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1472 os << "\\tex_allows_spaces "
1473 << convert<string>(tex_allows_spaces) << '\n';
1478 if (ignore_system_lyxrc ||
1479 use_kbmap != system_lyxrc.use_kbmap) {
1480 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1484 case RC_KBMAP_PRIMARY:
1485 if (ignore_system_lyxrc ||
1486 primary_kbmap != system_lyxrc.primary_kbmap) {
1487 string const path = os::external_path(primary_kbmap);
1488 os << "\\kbmap_primary \"" << path << "\"\n";
1492 case RC_KBMAP_SECONDARY:
1493 if (ignore_system_lyxrc ||
1494 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1495 string const path = os::external_path(secondary_kbmap);
1496 os << "\\kbmap_secondary \"" << path << "\"\n";
1501 if (ignore_system_lyxrc ||
1502 lyxpipes != system_lyxrc.lyxpipes) {
1503 string const path = os::external_path(lyxpipes);
1504 os << "\\serverpipe \"" << path << "\"\n";
1508 case RC_DATE_INSERT_FORMAT:
1509 if (ignore_system_lyxrc ||
1510 date_insert_format != system_lyxrc.date_insert_format) {
1511 os << "\\date_insert_format \"" << date_insert_format
1516 case RC_LABEL_INIT_LENGTH:
1517 if (ignore_system_lyxrc ||
1518 label_init_length != system_lyxrc.label_init_length) {
1519 os << "\\label_init_length " << label_init_length
1526 os << "\\user_name \"" << user_name << "\"\n";
1531 os << "\\user_email \"" << user_email << "\"\n";
1535 case RC_SHOW_BANNER:
1536 if (ignore_system_lyxrc ||
1537 show_banner != system_lyxrc.show_banner) {
1538 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1544 if (ignore_system_lyxrc ||
1545 preview != system_lyxrc.preview) {
1551 case PREVIEW_NO_MATH:
1558 os << "\\preview " << status << '\n';
1563 case RC_PREVIEW_HASHED_LABELS:
1564 if (ignore_system_lyxrc ||
1565 preview_hashed_labels !=
1566 system_lyxrc.preview_hashed_labels) {
1567 os << "\\preview_hashed_labels "
1568 << convert<string>(preview_hashed_labels) << '\n';
1573 case RC_PREVIEW_SCALE_FACTOR:
1574 if (ignore_system_lyxrc ||
1575 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1576 os << "\\preview_scale_factor "
1577 << preview_scale_factor << '\n';
1582 case RC_USE_CONVERTER_CACHE:
1583 if (ignore_system_lyxrc ||
1584 use_converter_cache != system_lyxrc.use_converter_cache) {
1585 os << "\\use_converter_cache "
1586 << convert<string>(use_converter_cache) << '\n';
1591 case RC_CONVERTER_CACHE_MAXAGE:
1592 if (ignore_system_lyxrc ||
1593 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1594 os << "\\converter_cache_maxage "
1595 << converter_cache_maxage << '\n';
1601 << "# SCREEN & FONTS SECTION ############################\n"
1605 if (ignore_system_lyxrc ||
1606 dpi != system_lyxrc.dpi) {
1607 os << "\\screen_dpi " << dpi << '\n';
1611 case RC_SCREEN_ZOOM:
1612 if (ignore_system_lyxrc ||
1613 zoom != system_lyxrc.zoom) {
1614 os << "\\screen_zoom " << zoom << '\n';
1618 case RC_GEOMETRY_SESSION:
1619 if (ignore_system_lyxrc ||
1620 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1621 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1626 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1627 if (ignore_system_lyxrc ||
1628 cursor_follows_scrollbar
1629 != system_lyxrc.cursor_follows_scrollbar) {
1630 os << "\\cursor_follows_scrollbar "
1631 << convert<string>(cursor_follows_scrollbar) << '\n';
1635 case RC_MACRO_EDIT_STYLE:
1636 if (ignore_system_lyxrc ||
1638 != system_lyxrc.macro_edit_style) {
1639 os << "\\macro_edit_style ";
1640 switch (macro_edit_style) {
1641 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1642 case MACRO_EDIT_INLINE: os << "1\n"; break;
1643 case MACRO_EDIT_LIST: os << "2\n"; break;
1648 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1649 if (ignore_system_lyxrc ||
1650 dialogs_iconify_with_main
1651 != system_lyxrc.dialogs_iconify_with_main) {
1652 os << "\\dialogs_iconify_with_main "
1653 << convert<string>(dialogs_iconify_with_main) << '\n';
1657 case RC_SCREEN_FONT_ROMAN:
1658 if (ignore_system_lyxrc ||
1659 roman_font_name != system_lyxrc.roman_font_name) {
1660 os << "\\screen_font_roman \"" << roman_font_name
1665 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1666 if (ignore_system_lyxrc ||
1667 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1668 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1673 case RC_SCREEN_FONT_SANS:
1674 if (ignore_system_lyxrc ||
1675 sans_font_name != system_lyxrc.sans_font_name) {
1676 os << "\\screen_font_sans \"" << sans_font_name
1681 case RC_SCREEN_FONT_SANS_FOUNDRY:
1682 if (ignore_system_lyxrc ||
1683 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1684 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1689 case RC_SCREEN_FONT_TYPEWRITER:
1690 if (ignore_system_lyxrc ||
1691 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1692 os << "\\screen_font_typewriter \""
1693 << typewriter_font_name << "\"\n";
1697 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1698 if (ignore_system_lyxrc ||
1699 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1700 os << "\\screen_font_typewriter_foundry \""
1701 << typewriter_font_foundry << "\"\n";
1706 case RC_SCREEN_FONT_SCALABLE:
1707 if (ignore_system_lyxrc ||
1708 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1709 os << "\\screen_font_scalable "
1710 << convert<string>(use_scalable_fonts)
1715 case RC_SCREEN_FONT_SIZES:
1716 if (ignore_system_lyxrc ||
1717 font_sizes[FONT_SIZE_TINY]
1718 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1719 font_sizes[FONT_SIZE_SCRIPT]
1720 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1721 font_sizes[FONT_SIZE_FOOTNOTE]
1722 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1723 font_sizes[FONT_SIZE_SMALL]
1724 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1725 font_sizes[FONT_SIZE_NORMAL]
1726 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1727 font_sizes[FONT_SIZE_LARGE]
1728 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1729 font_sizes[FONT_SIZE_LARGER]
1730 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1731 font_sizes[FONT_SIZE_LARGEST]
1732 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1733 font_sizes[FONT_SIZE_HUGE]
1734 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1735 font_sizes[FONT_SIZE_HUGER]
1736 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1737 os.setf(ios::fixed);
1739 os << "\\screen_font_sizes"
1740 << ' ' << font_sizes[FONT_SIZE_TINY]
1741 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1742 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1743 << ' ' << font_sizes[FONT_SIZE_SMALL]
1744 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1745 << ' ' << font_sizes[FONT_SIZE_LARGE]
1746 << ' ' << font_sizes[FONT_SIZE_LARGER]
1747 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1748 << ' ' << font_sizes[FONT_SIZE_HUGE]
1749 << ' ' << font_sizes[FONT_SIZE_HUGER]
1754 case RC_FULL_SCREEN_LIMIT:
1755 if (ignore_system_lyxrc ||
1756 full_screen_limit != system_lyxrc.full_screen_limit) {
1757 os << "\\fullscreen_limit "
1758 << convert<string>(full_screen_limit)
1763 case RC_FULL_SCREEN_TOOLBARS:
1764 if (ignore_system_lyxrc ||
1765 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1766 os << "\\fullscreen_toolbars "
1767 << convert<string>(full_screen_toolbars)
1772 case RC_FULL_SCREEN_SCROLLBAR:
1773 if (ignore_system_lyxrc ||
1774 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1775 os << "\\fullscreen_scrollbar "
1776 << convert<string>(full_screen_scrollbar)
1781 case RC_FULL_SCREEN_TABBAR:
1782 if (ignore_system_lyxrc ||
1783 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1784 os << "\\fullscreen_tabbar "
1785 << convert<string>(full_screen_tabbar)
1790 case RC_FULL_SCREEN_WIDTH:
1791 if (ignore_system_lyxrc ||
1792 full_screen_width != system_lyxrc.full_screen_width) {
1793 os << "\\fullscreen_width "
1794 << convert<string>(full_screen_width)
1802 << "# COLOR SECTION ###################################\n"
1806 for (int i = 0; i < Color_ignore; ++i) {
1807 ColorCode lc = static_cast<ColorCode>(i);
1809 string const col(lcolor.getX11Name(lc));
1810 if (ignore_system_lyxrc ||
1811 col != system_lcolor.getX11Name(lc)) {
1812 os << "\\set_color \""
1813 << lcolor.getLyXName(lc) << "\" \""
1821 << "# PRINTER SECTION ###################################\n"
1825 if (ignore_system_lyxrc ||
1826 printer != system_lyxrc.printer) {
1827 os << "\\printer \"" << printer << "\"\n";
1831 case RC_PRINT_ADAPTOUTPUT:
1832 if (ignore_system_lyxrc ||
1833 print_adapt_output != system_lyxrc.print_adapt_output) {
1834 os << "\\print_adapt_output "
1835 << convert<string>(print_adapt_output)
1840 case RC_PRINT_COMMAND:
1841 if (ignore_system_lyxrc ||
1842 print_command != system_lyxrc.print_command) {
1843 os << "\\print_command \"" << print_command << "\"\n";
1847 case RC_PRINTEXSTRAOPTIONS:
1848 if (ignore_system_lyxrc ||
1849 print_extra_options != system_lyxrc.print_extra_options) {
1850 os << "\\print_extra_options \"" << print_extra_options
1855 case RC_PRINTSPOOL_COMMAND:
1856 if (ignore_system_lyxrc ||
1857 print_spool_command != system_lyxrc.print_spool_command) {
1858 os << "\\print_spool_command \"" << print_spool_command
1863 case RC_PRINTSPOOL_PRINTERPREFIX:
1864 if (ignore_system_lyxrc ||
1865 print_spool_printerprefix
1866 != system_lyxrc.print_spool_printerprefix) {
1867 os << "\\print_spool_printerprefix \""
1868 << print_spool_printerprefix << "\"\n";
1872 case RC_PRINTEVENPAGEFLAG:
1873 if (ignore_system_lyxrc ||
1874 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1875 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1880 case RC_PRINTODDPAGEFLAG:
1881 if (ignore_system_lyxrc ||
1882 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1883 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1888 case RC_PRINTREVERSEFLAG:
1889 if (ignore_system_lyxrc ||
1890 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1891 os << "\\print_reverse_flag \"" << print_reverse_flag
1896 case RC_PRINTLANDSCAPEFLAG:
1897 if (ignore_system_lyxrc ||
1898 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1899 os << "\\print_landscape_flag \"" << print_landscape_flag
1904 case RC_PRINTPAGERANGEFLAG:
1905 if (ignore_system_lyxrc ||
1906 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1907 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1912 case RC_PRINTCOPIESFLAG:
1913 if (ignore_system_lyxrc ||
1914 print_copies_flag != system_lyxrc.print_copies_flag) {
1915 os << "\\print_copies_flag \"" << print_copies_flag
1920 case RC_PRINTCOLLCOPIESFLAG:
1921 if (ignore_system_lyxrc ||
1922 print_collcopies_flag
1923 != system_lyxrc.print_collcopies_flag) {
1924 os << "\\print_collcopies_flag \""
1925 << print_collcopies_flag
1930 case RC_PRINTPAPERFLAG:
1931 if (ignore_system_lyxrc ||
1932 print_paper_flag != system_lyxrc.print_paper_flag) {
1933 os << "\\print_paper_flag \"" << print_paper_flag
1938 case RC_PRINTPAPERDIMENSIONFLAG:
1939 if (ignore_system_lyxrc ||
1940 print_paper_dimension_flag
1941 != system_lyxrc.print_paper_dimension_flag) {
1942 os << "\\print_paper_dimension_flag \""
1943 << print_paper_dimension_flag << "\"\n";
1947 case RC_PRINTTOPRINTER:
1948 if (ignore_system_lyxrc ||
1949 print_to_printer != system_lyxrc.print_to_printer) {
1950 os << "\\print_to_printer \"" << print_to_printer
1955 case RC_PRINTTOFILE:
1956 if (ignore_system_lyxrc ||
1957 print_to_file != system_lyxrc.print_to_file) {
1958 string const path = os::external_path(print_to_file);
1959 os << "\\print_to_file \"" << path << "\"\n";
1963 case RC_PRINTFILEEXTENSION:
1964 if (ignore_system_lyxrc ||
1965 print_file_extension != system_lyxrc.print_file_extension) {
1966 os << "\\print_file_extension \""
1967 << print_file_extension
1974 << "# EXPORT SECTION ####################################\n"
1977 case RC_CUSTOM_EXPORT_COMMAND:
1978 if (ignore_system_lyxrc ||
1979 custom_export_command
1980 != system_lyxrc.custom_export_command) {
1981 os << "\\custom_export_command \""
1982 << custom_export_command
1987 case RC_CUSTOM_EXPORT_FORMAT:
1988 if (ignore_system_lyxrc ||
1989 custom_export_format
1990 != system_lyxrc.custom_export_format) {
1991 os << "\\custom_export_format \"" << custom_export_format
1998 << "# TEX SECTION #######################################\n"
2001 case RC_FONT_ENCODING:
2002 if (ignore_system_lyxrc ||
2003 fontenc != system_lyxrc.fontenc) {
2004 os << "\\font_encoding \"" << fontenc << "\"\n";
2010 << "# FILE SECTION ######################################\n"
2013 case RC_DOCUMENTPATH:
2014 if (ignore_system_lyxrc ||
2015 document_path != system_lyxrc.document_path) {
2016 string const path = os::external_path(document_path);
2017 os << "\\document_path \"" << path << "\"\n";
2021 case RC_USELASTFILEPOS:
2022 if (ignore_system_lyxrc ||
2023 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2024 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2029 case RC_LOADSESSION:
2030 if (ignore_system_lyxrc ||
2031 load_session != system_lyxrc.load_session) {
2032 os << "\\load_session " << convert<string>(load_session)
2037 case RC_MOUSE_WHEEL_SPEED:
2038 if (ignore_system_lyxrc ||
2039 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2040 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2044 case RC_NUMLASTFILES:
2045 if (ignore_system_lyxrc ||
2046 num_lastfiles != system_lyxrc.num_lastfiles) {
2047 os << "\\num_lastfiles " << num_lastfiles << '\n';
2051 case RC_CHECKLASTFILES:
2052 if (ignore_system_lyxrc ||
2053 check_lastfiles != system_lyxrc.check_lastfiles) {
2054 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2059 case RC_EXAMPLEPATH:
2060 if (ignore_system_lyxrc ||
2061 example_path != system_lyxrc.example_path) {
2062 string const path = os::external_path(example_path);
2063 os << "\\example_path \"" << path << "\"\n";
2067 case RC_TEMPLATEPATH:
2068 if (ignore_system_lyxrc ||
2069 template_path != system_lyxrc.template_path) {
2070 string const path = os::external_path(template_path);
2071 os << "\\template_path \"" << path << "\"\n";
2075 case RC_TEMPDIRPATH:
2076 if (ignore_system_lyxrc ||
2077 tempdir_path != system_lyxrc.tempdir_path) {
2078 string const path = os::external_path(tempdir_path);
2079 os << "\\tempdir_path \"" << path << "\"\n";
2087 case RC_PLAINTEXT_LINELEN:
2088 if (ignore_system_lyxrc ||
2089 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2090 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2094 case RC_MAKE_BACKUP:
2095 if (ignore_system_lyxrc ||
2096 make_backup != system_lyxrc.make_backup) {
2097 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2101 case RC_BACKUPDIR_PATH:
2102 if (ignore_system_lyxrc ||
2103 backupdir_path != system_lyxrc.backupdir_path) {
2104 string const path = os::external_path(backupdir_path);
2105 os << "\\backupdir_path \"" << path << "\"\n";
2111 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2114 case RC_PLAINTEXT_ROFF_COMMAND:
2115 if (ignore_system_lyxrc ||
2116 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2117 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2124 << "# SPELLCHECKER SECTION ##############################\n"
2126 case RC_USE_SPELL_LIB:
2127 if (ignore_system_lyxrc ||
2128 use_spell_lib != system_lyxrc.use_spell_lib) {
2129 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2133 case RC_SPELL_COMMAND:
2134 if (ignore_system_lyxrc ||
2135 isp_command != system_lyxrc.isp_command) {
2136 os << "\\spell_command \"" << isp_command << "\"\n";
2140 case RC_ACCEPT_COMPOUND:
2141 if (ignore_system_lyxrc ||
2142 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2143 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2148 case RC_USE_ALT_LANG:
2149 if (ignore_system_lyxrc ||
2150 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2151 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2157 if (ignore_system_lyxrc ||
2158 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2159 os << "\\alternate_language \"" << isp_alt_lang
2164 case RC_USE_ESC_CHARS:
2165 if (ignore_system_lyxrc ||
2166 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2167 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2173 if (ignore_system_lyxrc ||
2174 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2175 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2179 case RC_USE_PERS_DICT:
2180 if (ignore_system_lyxrc ||
2181 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2182 os << "\\use_personal_dictionary "
2183 << convert<string>(isp_use_pers_dict)
2188 case RC_USE_TOOLTIP:
2189 if (ignore_system_lyxrc ||
2190 use_tooltip != system_lyxrc.use_tooltip) {
2191 os << "\\use_tooltip "
2192 << convert<string>(use_tooltip)
2195 case RC_USE_PIXMAP_CACHE:
2196 if (ignore_system_lyxrc ||
2197 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2198 os << "\\use_pixmap_cache "
2199 << convert<string>(use_pixmap_cache)
2203 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2204 string const path = os::external_path(isp_pers_dict);
2205 os << "\\personal_dictionary \"" << path << "\"\n";
2209 case RC_USE_INP_ENC:
2210 if (ignore_system_lyxrc ||
2211 isp_use_input_encoding
2212 != system_lyxrc.isp_use_input_encoding) {
2213 os << "\\use_input_encoding "
2214 << convert<string>(isp_use_input_encoding)
2221 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2224 case RC_RTL_SUPPORT:
2225 if (ignore_system_lyxrc ||
2226 rtl_support != system_lyxrc.rtl_support) {
2227 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2231 case RC_VISUAL_CURSOR:
2232 if (ignore_system_lyxrc ||
2233 visual_cursor != system_lyxrc.visual_cursor) {
2234 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2238 case RC_LANGUAGE_PACKAGE:
2239 if (ignore_system_lyxrc ||
2240 language_package != system_lyxrc.language_package) {
2241 os << "\\language_package \"" << language_package
2246 case RC_LANGUAGE_GLOBAL_OPTIONS:
2247 if (ignore_system_lyxrc ||
2248 language_global_options
2249 != system_lyxrc.language_global_options) {
2250 os << "\\language_global_options \""
2251 << convert<string>(language_global_options)
2256 case RC_LANGUAGE_USE_BABEL:
2257 if (ignore_system_lyxrc ||
2258 language_use_babel != system_lyxrc.language_use_babel) {
2259 os << "\\language_use_babel \""
2260 << convert<string>(language_use_babel)
2265 case RC_LANGUAGE_COMMAND_BEGIN:
2266 if (ignore_system_lyxrc ||
2267 language_command_begin
2268 != system_lyxrc.language_command_begin) {
2269 os << "\\language_command_begin \""
2270 << language_command_begin
2275 case RC_LANGUAGE_COMMAND_END:
2276 if (ignore_system_lyxrc ||
2277 language_command_end
2278 != system_lyxrc.language_command_end) {
2279 os << "\\language_command_end \"" << language_command_end
2284 case RC_LANGUAGE_COMMAND_LOCAL:
2285 if (ignore_system_lyxrc ||
2286 language_command_local
2287 != system_lyxrc.language_command_local) {
2288 os << "\\language_command_local \""
2289 << language_command_local
2294 case RC_LANGUAGE_AUTO_BEGIN:
2295 if (ignore_system_lyxrc ||
2296 language_auto_begin != system_lyxrc.language_auto_begin) {
2297 os << "\\language_auto_begin "
2298 << convert<string>(language_auto_begin) << '\n';
2302 case RC_LANGUAGE_AUTO_END:
2303 if (ignore_system_lyxrc ||
2304 language_auto_end != system_lyxrc.language_auto_end) {
2305 os << "\\language_auto_end "
2306 << convert<string>(language_auto_end) << '\n';
2310 case RC_MARK_FOREIGN_LANGUAGE:
2311 if (ignore_system_lyxrc ||
2312 mark_foreign_language
2313 != system_lyxrc.mark_foreign_language) {
2314 os << "\\mark_foreign_language " <<
2315 convert<string>(mark_foreign_language) << '\n';
2321 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2324 case RC_AUTO_NUMBER:
2325 if (ignore_system_lyxrc ||
2326 auto_number != system_lyxrc.auto_number) {
2327 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2331 case RC_DEFAULT_LANGUAGE:
2332 if (ignore_system_lyxrc ||
2333 default_language != system_lyxrc.default_language) {
2334 os << "\\default_language " << default_language << '\n';
2340 << "# FORMATS SECTION ##########################\n"
2344 // New/modified formats
2345 for (Formats::const_iterator cit = formats.begin();
2346 cit != formats.end(); ++cit) {
2347 Format const * format =
2348 system_formats.getFormat(cit->name());
2350 format->extension() != cit->extension() ||
2351 format->prettyname() != cit->prettyname() ||
2352 format->shortcut() != cit->shortcut() ||
2353 format->viewer() != cit->viewer() ||
2354 format->editor() != cit->editor() ||
2355 format->documentFormat() != cit->documentFormat() ||
2356 format->vectorFormat() != cit->vectorFormat()) {
2357 os << "\\format \"" << cit->name() << "\" \""
2358 << cit->extension() << "\" \""
2359 << cit->prettyname() << "\" \""
2360 << cit->shortcut() << "\" \""
2361 << cit->viewer() << "\" \""
2362 << cit->editor() << "\" \"";
2363 vector<string> flags;
2364 if (cit->documentFormat())
2365 flags.push_back("document");
2366 if (cit->vectorFormat())
2367 flags.push_back("vector");
2368 os << getStringFromVector(flags);
2373 // Look for deleted formats
2374 for (Formats::const_iterator cit = system_formats.begin();
2375 cit != system_formats.end(); ++cit)
2376 if (!formats.getFormat(cit->name()))
2377 os << "\\format \"" << cit->name()
2378 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2387 << "# CONVERTERS SECTION ##########################\n"
2391 // Look for new converters
2392 for (Converters::const_iterator cit = theConverters().begin();
2393 cit != theConverters().end(); ++cit) {
2394 Converter const * converter =
2395 theSystemConverters().getConverter(cit->from,
2398 converter->command != cit->command ||
2399 converter->flags != cit->flags)
2400 os << "\\converter \"" << cit->from << "\" \""
2401 << cit->to << "\" \""
2402 << cit->command << "\" \""
2403 << cit->flags << "\"\n";
2406 // New/modifed converters
2407 for (Converters::const_iterator cit = theSystemConverters().begin();
2408 cit != theSystemConverters().end(); ++cit)
2409 if (!theConverters().getConverter(cit->from, cit->to))
2410 os << "\\converter \"" << cit->from
2411 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2418 << "# COPIERS SECTION ##########################\n"
2421 // Look for new movers
2422 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2423 Movers::const_iterator const sysend = theSystemMovers().end();
2424 Movers::const_iterator it = theMovers().begin();
2425 Movers::const_iterator end = theMovers().end();
2427 for (; it != end; ++it) {
2428 Movers::const_iterator const sysit =
2429 find_if(sysbegin, sysend, SameMover(*it));
2430 if (sysit == sysend) {
2431 string const & fmt = it->first;
2432 string const & command =
2433 it->second.command();
2435 os << "\\copier " << fmt
2436 << " \"" << command << "\"\n";
2442 // We don't actually delete SpecialisedMover(s) from the
2443 // map, just clear their 'command', so there's no need
2444 // to test for anything else.
2452 string const LyXRC::getDescription(LyXRCTags tag)
2457 case RC_ACCEPT_COMPOUND:
2458 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2462 case RC_USE_ALT_LANG:
2463 str = _("Specify an alternate language. The default is to use the language of the document.");
2466 case RC_PLAINTEXT_ROFF_COMMAND:
2467 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.");
2470 case RC_PLAINTEXT_LINELEN:
2471 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.");
2474 case RC_AUTOREGIONDELETE:
2475 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2478 case RC_AUTORESET_OPTIONS:
2479 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2483 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2486 case RC_AUTO_NUMBER:
2489 case RC_BACKUPDIR_PATH:
2490 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.");
2493 case RC_BIBTEX_COMMAND:
2494 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2498 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2501 case RC_CHECKLASTFILES:
2502 str = _("Select to check whether the lastfiles still exist.");
2505 case RC_CHKTEX_COMMAND:
2506 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2515 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2516 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.");
2519 case RC_SHOW_MACRO_LABEL:
2520 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2523 case RC_CUSTOM_EXPORT_COMMAND:
2526 case RC_CUSTOM_EXPORT_FORMAT:
2529 case RC_DATE_INSERT_FORMAT:
2530 //xgettext:no-c-format
2531 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2535 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2538 case RC_DEFAULT_LANGUAGE:
2539 str = _("New documents will be assigned this language.");
2542 case RC_DEFAULT_PAPERSIZE:
2543 str = _("Specify the default paper size.");
2546 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2547 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2550 case RC_DISPLAY_GRAPHICS:
2551 str = _("Select how LyX will display any graphics.");
2554 case RC_DOCUMENTPATH:
2555 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2559 case RC_USE_ESC_CHARS:
2560 str = _("Specify additional chars that can be part of a word.");
2563 case RC_EXAMPLEPATH:
2564 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2567 case RC_FONT_ENCODING:
2568 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2574 case RC_INDEX_COMMAND:
2575 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\".");
2582 case RC_KBMAP_PRIMARY:
2583 case RC_KBMAP_SECONDARY:
2584 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.");
2587 case RC_LABEL_INIT_LENGTH:
2588 str = _("Maximum number of words in the initialization string for a new label");
2591 case RC_LANGUAGE_AUTO_BEGIN:
2592 str = _("Select if a language switching command is needed at the beginning of the document.");
2595 case RC_LANGUAGE_AUTO_END:
2596 str = _("Select if a language switching command is needed at the end of the document.");
2599 case RC_LANGUAGE_COMMAND_BEGIN:
2600 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.");
2603 case RC_LANGUAGE_COMMAND_END:
2604 str = _("The LaTeX command for changing back to the language of the document.");
2607 case RC_LANGUAGE_COMMAND_LOCAL:
2608 str = _("The LaTeX command for local changing of the language.");
2611 case RC_LANGUAGE_GLOBAL_OPTIONS:
2612 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2615 case RC_LANGUAGE_PACKAGE:
2616 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2619 case RC_LANGUAGE_USE_BABEL:
2620 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2623 case RC_USELASTFILEPOS:
2624 str = _("De-select if you do not want LyX to scroll to saved position.");
2627 case RC_LOADSESSION:
2628 str = _("De-select to prevent loading files opened from the last LyX session.");
2631 case RC_MAKE_BACKUP:
2632 str = _("De-select if you don't want LyX to create backup files.");
2635 case RC_MARK_FOREIGN_LANGUAGE:
2636 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2639 case RC_MOUSE_WHEEL_SPEED:
2640 str = bformat(_("The scrolling speed of the mouse wheel. "),
2644 case RC_NUMLASTFILES:
2645 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2649 case RC_PATH_PREFIX:
2650 str = _("Specify those directories which should be "
2651 "prepended to the PATH environment variable. "
2652 "Use the OS native format.");
2656 case RC_USE_PERS_DICT:
2657 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2661 str = _("Shows a typeset preview of things such as math");
2664 case RC_PREVIEW_HASHED_LABELS:
2665 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2668 case RC_PREVIEW_SCALE_FACTOR:
2669 str = _("Scale the preview size to suit.");
2672 case RC_PRINTCOLLCOPIESFLAG:
2673 str = _("The option for specifying whether the copies should be collated.");
2676 case RC_PRINTCOPIESFLAG:
2677 str = _("The option for specifying the number of copies to print.");
2681 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2684 case RC_PRINTEVENPAGEFLAG:
2685 str = _("The option to print only even pages.");
2688 case RC_PRINTEXSTRAOPTIONS:
2689 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2692 case RC_PRINTFILEEXTENSION:
2693 str = _("Extension of printer program output file. Usually \".ps\".");
2696 case RC_PRINTLANDSCAPEFLAG:
2697 str = _("The option to print out in landscape.");
2700 case RC_PRINTODDPAGEFLAG:
2701 str = _("The option to print only odd pages.");
2704 case RC_PRINTPAGERANGEFLAG:
2705 str = _("The option for specifying a comma-separated list of pages to print.");
2708 case RC_PRINTPAPERDIMENSIONFLAG:
2709 str = _("Option to specify the dimensions of the print paper.");
2712 case RC_PRINTPAPERFLAG:
2713 str = _("The option to specify paper type.");
2716 case RC_PRINTREVERSEFLAG:
2717 str = _("The option to reverse the order of the pages printed.");
2720 case RC_PRINTSPOOL_COMMAND:
2721 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.");
2724 case RC_PRINTSPOOL_PRINTERPREFIX:
2725 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.");
2728 case RC_PRINTTOFILE:
2729 str = _("Option to pass to the print program to print to a file.");
2732 case RC_PRINTTOPRINTER:
2733 str = _("Option to pass to the print program to print on a specific printer.");
2736 case RC_PRINT_ADAPTOUTPUT:
2737 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2740 case RC_PRINT_COMMAND:
2741 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2744 case RC_RTL_SUPPORT:
2745 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2748 case RC_VISUAL_CURSOR:
2749 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2753 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2756 case RC_SCREEN_FONT_ROMAN:
2757 case RC_SCREEN_FONT_SANS:
2758 case RC_SCREEN_FONT_TYPEWRITER:
2759 str = _("The screen fonts used to display the text while editing.");
2762 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2763 case RC_SCREEN_FONT_SANS_FOUNDRY:
2764 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2767 case RC_SCREEN_FONT_SCALABLE:
2768 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.");
2771 case RC_SCREEN_FONT_SIZES:
2772 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2775 case RC_SCREEN_ZOOM:
2776 //xgettext:no-c-format
2777 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2780 case RC_GEOMETRY_SESSION:
2781 str = _("Allow session manager to save and restore windows geometry.");
2785 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2791 case RC_SHOW_BANNER:
2792 str = _("De-select if you don't want the startup banner.");
2795 case RC_SPELL_COMMAND:
2796 str = _("What command runs the spellchecker?");
2799 case RC_TEMPDIRPATH:
2800 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2803 case RC_TEMPLATEPATH:
2804 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2807 case RC_TEX_ALLOWS_SPACES:
2810 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2814 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2826 case RC_USE_INP_ENC:
2827 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.");
2830 case RC_USE_TOOLTIP:
2831 str = _("Enable the automatic appearance of tool tips in the work area.");
2834 case RC_USE_PIXMAP_CACHE:
2835 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2838 case RC_USE_SPELL_LIB:
2841 case RC_VIEWDVI_PAPEROPTION:
2842 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2857 // The global instance
2860 // The global copy of the system lyxrc entries (everything except preferences)