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.
24 #include "support/debug.h"
26 #include "Converter.h"
28 #include "support/gettext.h"
31 #include "FontEnums.h"
34 #include "graphics/GraphicsTypes.h"
36 #include "support/convert.h"
37 #include "support/environment.h"
38 #include "support/filetools.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 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
84 { "\\input", LyXRC::RC_INPUT },
85 { "\\kbmap", LyXRC::RC_KBMAP },
86 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
87 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
88 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
89 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
90 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
91 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
92 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
93 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
94 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
95 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
96 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
97 { "\\load_session", LyXRC::RC_LOADSESSION },
98 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
99 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
100 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
101 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
102 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
103 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
104 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
105 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
106 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
107 { "\\preview", LyXRC::RC_PREVIEW },
108 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
109 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
110 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
111 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
112 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
113 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
114 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
115 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
116 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
117 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
118 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
119 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
120 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
121 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
122 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
123 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
124 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
125 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
126 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
127 { "\\printer", LyXRC::RC_PRINTER },
128 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
129 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
130 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
131 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
132 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
133 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
134 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
135 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
136 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
137 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
138 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
139 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
140 { "\\set_color", LyXRC::RC_SET_COLOR },
141 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
142 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
143 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
144 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
145 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
146 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
147 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
148 { "\\ui_file", LyXRC::RC_UIFILE },
149 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
150 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
151 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
152 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
153 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
154 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
155 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
156 // compatibility with versions older than 1.4.0 only
157 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
158 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
159 // compatibility with versions older than 1.4.0 only
160 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
161 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
162 { "\\user_email", LyXRC::RC_USER_EMAIL },
163 { "\\user_name", LyXRC::RC_USER_NAME },
164 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
165 // compatibility with versions older than 1.4.0 only
166 { "\\viewer", LyXRC::RC_VIEWER},
167 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
170 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
181 void LyXRC::setDefaults() {
183 def_file = "default";
185 // Get printer from the environment. If fail, use default "",
186 // assuming that everything is set up correctly.
187 printer = getEnv("PRINTER");
188 print_adapt_output = false;
189 print_command = "dvips";
190 print_evenpage_flag = "-B";
191 print_oddpage_flag = "-A";
192 print_pagerange_flag = "-pp";
193 print_copies_flag = "-c";
194 print_collcopies_flag = "-C";
195 print_reverse_flag = "-r";
196 print_landscape_flag = "-t landscape";
197 print_to_printer = "-P";
198 print_to_file = "-o ";
199 print_file_extension = ".ps";
200 print_paper_flag = "-t";
201 print_paper_dimension_flag = "-T";
202 document_path.erase();
203 view_dvi_paper_option.erase();
204 default_papersize = PAPER_DEFAULT;
205 custom_export_format = "ps";
206 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
207 bibtex_command = "bibtex";
209 index_command = "makeindex -c -q";
211 // Because a screen typically is wider than a piece of paper:
213 allow_geometry_session = true;
214 // Default LaTeX font size:
215 font_sizes[FONT_SIZE_TINY] = "5.0";
216 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
217 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
218 font_sizes[FONT_SIZE_SMALL] = "9.0";
219 font_sizes[FONT_SIZE_NORMAL] = "10.0";
220 font_sizes[FONT_SIZE_LARGE] = "12.0";
221 font_sizes[FONT_SIZE_LARGER] = "14.4";
222 font_sizes[FONT_SIZE_LARGEST] = "17.26";
223 font_sizes[FONT_SIZE_HUGE] = "20.74";
224 font_sizes[FONT_SIZE_HUGER] = "24.88";
225 use_scalable_fonts = true;
226 roman_font_name = "";
228 typewriter_font_name = "";
230 auto_region_delete = true;
231 auto_reset_options = false;
232 plaintext_linelen = 65;
233 mouse_wheel_speed = 1.0;
234 num_lastfiles = maxlastfiles;
235 check_lastfiles = true;
236 use_lastfilepos = true;
237 load_session = false;
239 backupdir_path.erase();
240 display_graphics = graphics::ColorDisplay;
241 // Spellchecker settings:
242 use_spell_lib = true;
243 isp_command = "ispell";
244 isp_accept_compound = false;
245 isp_use_input_encoding = false;
246 isp_use_alt_lang = false;
247 isp_use_pers_dict = false;
248 isp_use_esc_chars = false;
251 visual_cursor = false;
253 mark_foreign_language = true;
254 language_auto_begin = true;
255 language_auto_end = true;
256 language_global_options = true;
257 language_use_babel = true;
258 language_package = "\\usepackage{babel}";
259 language_command_begin = "\\selectlanguage{$$lang}";
260 language_command_local = "\\foreignlanguage{$$lang}{";
261 sort_layouts = false;
262 default_language = "english";
264 windows_style_tex_paths = false;
265 tex_allows_spaces = false;
266 date_insert_format = "%x";
267 cursor_follows_scrollbar = false;
268 macro_edit_style = MACRO_EDIT_INLINE_BOX;
269 dialogs_iconify_with_main = false;
270 label_init_length = 3;
271 preview = PREVIEW_OFF;
272 preview_hashed_labels = false;
273 preview_scale_factor = "0.9";
274 use_converter_cache = true;
276 use_pixmap_cache = false;
277 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
279 user_name = to_utf8(support::user_name());
281 user_email = to_utf8(support::user_email());
287 void oldFontFormat(string & family, string & foundry)
289 if (family.empty() || family[0] != '-')
291 foundry = token(family, '-', 1);
292 family = token(family, '-', 2);
300 int LyXRC::read(FileName const & filename)
302 Lexer lexrc(lyxrcTags, lyxrcCount);
303 if (lyxerr.debugging(Debug::PARSER))
304 lexrc.printTable(lyxerr);
306 lexrc.setFile(filename);
307 if (!lexrc.isOK()) return -2;
309 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
315 int LyXRC::read(istream & is)
317 Lexer lexrc(lyxrcTags, lyxrcCount);
318 if (lyxerr.debugging(Debug::PARSER))
319 lexrc.printTable(lyxerr);
322 if (!lexrc.isOK()) return -2;
324 LYXERR(Debug::LYXRC, "Reading istream...");
330 int LyXRC::read(Lexer & lexrc)
332 if (!lexrc.isOK()) return -2;
334 while (lexrc.isOK()) {
335 // By using two switches we take advantage of the compiler
336 // telling us if we have missed a LyXRCTags element in
337 // the second switch.
338 // Note that this also shows a problem with Lexer since it
339 // helps us avoid taking advantage of the strictness of the
342 int le = lexrc.lex();
344 case Lexer::LEX_UNDEF:
345 lexrc.printError("Unknown tag `$$Token'");
347 case Lexer::LEX_FEOF:
351 switch (static_cast<LyXRCTags>(le)) {
352 case RC_INPUT: // Include file
355 libFileSearch(string(),
358 lexrc.printError("Error reading "
359 "included file: " + tmp.absFilename());
365 bind_file = os::internal_path(lexrc.getString());
371 def_file = os::internal_path(lexrc.getString());
377 ui_file = os::internal_path(lexrc.getString());
381 case RC_AUTORESET_OPTIONS:
383 auto_reset_options = lexrc.getBool();
387 case RC_DISPLAY_GRAPHICS:
389 display_graphics = graphics::displayTranslator().find(lexrc.getString());
393 case RC_TEX_EXPECTS_WINDOWS_PATHS:
395 windows_style_tex_paths = lexrc.getBool();
399 case RC_TEX_ALLOWS_SPACES:
401 tex_allows_spaces = lexrc.getBool();
407 use_kbmap = lexrc.getBool();
411 case RC_KBMAP_PRIMARY:
413 string const kmap(os::internal_path(lexrc.getString()));
416 } else if (!libFileSearch("kbd", kmap,
418 primary_kbmap = kmap;
420 lexrc.printError("LyX: Keymap `$$Token' not found");
425 case RC_KBMAP_SECONDARY:
427 string const kmap(os::internal_path(lexrc.getString()));
430 } else if (!libFileSearch("kbd", kmap,
432 secondary_kbmap = kmap;
434 lexrc.printError("LyX: Keymap `$$Token' not found");
439 case RC_FONT_ENCODING:
441 fontenc = lexrc.getString();
447 printer = lexrc.getString();
451 case RC_PRINT_COMMAND:
453 print_command = lexrc.getString();
457 case RC_PRINTEVENPAGEFLAG:
459 print_evenpage_flag = lexrc.getString();
463 case RC_PRINTODDPAGEFLAG:
465 print_oddpage_flag = lexrc.getString();
469 case RC_PRINTPAGERANGEFLAG:
471 print_pagerange_flag = lexrc.getString();
475 case RC_PRINTCOPIESFLAG:
477 print_copies_flag = lexrc.getString();
481 case RC_PRINTCOLLCOPIESFLAG:
483 print_collcopies_flag = lexrc.getString();
487 case RC_PRINTREVERSEFLAG:
489 print_reverse_flag = lexrc.getString();
493 case RC_PRINTLANDSCAPEFLAG:
495 print_landscape_flag = lexrc.getString();
499 case RC_PRINTTOPRINTER:
501 print_to_printer = lexrc.getString();
505 case RC_PRINT_ADAPTOUTPUT:
507 print_adapt_output = lexrc.getBool();
513 print_to_file = os::internal_path(lexrc.getString());
517 case RC_PRINTFILEEXTENSION:
519 print_file_extension = lexrc.getString();
523 case RC_PRINTEXSTRAOPTIONS:
525 print_extra_options = lexrc.getString();
529 case RC_PRINTSPOOL_COMMAND:
531 print_spool_command = lexrc.getString();
535 case RC_PRINTSPOOL_PRINTERPREFIX:
537 print_spool_printerprefix = lexrc.getString();
541 case RC_PRINTPAPERDIMENSIONFLAG:
543 print_paper_dimension_flag = lexrc.getString();
547 case RC_PRINTPAPERFLAG:
549 print_paper_flag = lexrc.getString();
553 case RC_CUSTOM_EXPORT_COMMAND:
555 custom_export_command = lexrc.getString();
559 case RC_CUSTOM_EXPORT_FORMAT:
561 custom_export_format = lexrc.getString();
565 case RC_DEFAULT_PAPERSIZE:
568 ascii_lowercase(lexrc.getString());
569 if (size == "usletter")
572 else if (size == "legal")
575 else if (size == "executive")
578 else if (size == "a3")
581 else if (size == "a4")
584 else if (size == "a5")
587 else if (size == "b5")
590 else if (size == "default")
596 case RC_VIEWDVI_PAPEROPTION:
598 view_dvi_paper_option = lexrc.getString();
600 view_dvi_paper_option.erase();
604 case RC_CHKTEX_COMMAND:
606 chktex_command = lexrc.getString();
610 case RC_BIBTEX_COMMAND:
612 bibtex_command = lexrc.getString();
616 case RC_INDEX_COMMAND:
618 index_command = lexrc.getString();
624 dpi = lexrc.getInteger();
630 zoom = lexrc.getInteger();
634 case RC_GEOMETRY_SESSION:
636 allow_geometry_session = lexrc.getBool();
640 case RC_SCREEN_FONT_SIZES:
642 font_sizes[FONT_SIZE_TINY] =
646 font_sizes[FONT_SIZE_SCRIPT] =
650 font_sizes[FONT_SIZE_FOOTNOTE] =
654 font_sizes[FONT_SIZE_SMALL] =
658 font_sizes[FONT_SIZE_NORMAL] =
662 font_sizes[FONT_SIZE_LARGE] =
666 font_sizes[FONT_SIZE_LARGER] =
670 font_sizes[FONT_SIZE_LARGEST] =
674 font_sizes[FONT_SIZE_HUGE] =
678 font_sizes[FONT_SIZE_HUGER] =
683 case RC_SCREEN_FONT_SCALABLE:
685 use_scalable_fonts = lexrc.getBool();
691 autosave = lexrc.getInteger();
695 case RC_DOCUMENTPATH:
697 document_path = os::internal_path(lexrc.getString());
698 document_path = expandPath(document_path);
704 example_path = os::internal_path(lexrc.getString());
705 example_path = expandPath(example_path);
709 case RC_TEMPLATEPATH:
711 template_path = os::internal_path(lexrc.getString());
712 template_path = expandPath(template_path);
718 tempdir_path = os::internal_path(lexrc.getString());
719 tempdir_path = expandPath(tempdir_path);
725 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
729 case RC_USELASTFILEPOS:
731 use_lastfilepos = lexrc.getBool();
737 load_session = lexrc.getBool();
741 case RC_MOUSE_WHEEL_SPEED:
743 mouse_wheel_speed = lexrc.getFloat();
747 case RC_NUMLASTFILES:
749 num_lastfiles = lexrc.getInteger();
753 case RC_CHECKLASTFILES:
755 check_lastfiles = lexrc.getBool();
759 case RC_SCREEN_FONT_ROMAN:
761 roman_font_name = lexrc.getString();
762 oldFontFormat(roman_font_name,
767 case RC_SCREEN_FONT_SANS:
769 sans_font_name = lexrc.getString();
770 oldFontFormat(sans_font_name, sans_font_foundry);
774 case RC_SCREEN_FONT_TYPEWRITER:
776 typewriter_font_name = lexrc.getString();
777 oldFontFormat(typewriter_font_name,
778 typewriter_font_foundry);
782 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
784 roman_font_foundry = lexrc.getString();
788 case RC_SCREEN_FONT_SANS_FOUNDRY:
790 sans_font_foundry = lexrc.getString();
794 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
796 typewriter_font_foundry = lexrc.getString();
802 string lyx_name, x11_name;
805 lyx_name = lexrc.getString();
807 lexrc.printError("Missing color tag.");
812 x11_name = lexrc.getString();
814 lexrc.printError("Missing color name for color: `$$Token'");
818 ColorCode const col =
819 lcolor.getFromLyXName(lyx_name);
820 if (col == Color_none ||
821 col == Color_inherit ||
825 if (!lcolor.setColor(col, x11_name)) {
826 lyxerr << "Bad lyxrc set_color for "
832 case RC_AUTOREGIONDELETE:
833 // Auto region delete defaults to true
835 auto_region_delete = lexrc.getBool();
841 lyxpipes = os::internal_path(lexrc.getString());
842 lyxpipes = expandPath(lyxpipes);
846 case RC_CURSOR_FOLLOWS_SCROLLBAR:
848 cursor_follows_scrollbar = lexrc.getBool();
852 case RC_MACRO_EDIT_STYLE:
854 switch (lexrc.getInteger()) {
855 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
856 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
857 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
862 case RC_DIALOGS_ICONIFY_WITH_MAIN:
864 dialogs_iconify_with_main = lexrc.getBool();
868 case RC_PLAINTEXT_ROFF_COMMAND:
870 plaintext_roff_command = lexrc.getString();
873 case RC_PLAINTEXT_LINELEN:
875 plaintext_linelen = lexrc.getInteger();
878 // Spellchecker settings:
879 case RC_USE_SPELL_LIB:
881 use_spell_lib = lexrc.getBool();
884 case RC_SPELL_COMMAND:
886 isp_command = lexrc.getString();
889 case RC_ACCEPT_COMPOUND:
891 isp_accept_compound = lexrc.getBool();
896 isp_use_input_encoding = lexrc.getBool();
899 case RC_USE_ALT_LANG:
901 isp_use_alt_lang = lexrc.getBool();
904 case RC_USE_PERS_DICT:
906 isp_use_pers_dict = lexrc.getBool();
911 use_tooltip = lexrc.getBool();
914 case RC_USE_PIXMAP_CACHE:
916 use_pixmap_cache = lexrc.getBool();
919 case RC_USE_ESC_CHARS:
921 isp_use_esc_chars = lexrc.getBool();
926 isp_alt_lang = lexrc.getString();
931 isp_pers_dict = os::internal_path(lexrc.getString());
936 isp_esc_chars = lexrc.getString();
941 make_backup = lexrc.getBool();
944 case RC_BACKUPDIR_PATH:
946 backupdir_path = os::internal_path(lexrc.getString());
947 backupdir_path = expandPath(backupdir_path);
950 case RC_DATE_INSERT_FORMAT:
952 date_insert_format = lexrc.getString();
955 case RC_LANGUAGE_PACKAGE:
957 language_package = lexrc.getString();
960 case RC_LANGUAGE_AUTO_BEGIN:
962 language_auto_begin = lexrc.getBool();
965 case RC_LANGUAGE_AUTO_END:
967 language_auto_end = lexrc.getBool();
970 case RC_LANGUAGE_GLOBAL_OPTIONS:
972 language_global_options = lexrc.getBool();
975 case RC_LANGUAGE_USE_BABEL:
977 language_use_babel = lexrc.getBool();
980 case RC_LANGUAGE_COMMAND_BEGIN:
982 language_command_begin = lexrc.getString();
985 case RC_LANGUAGE_COMMAND_END:
987 language_command_end = lexrc.getString();
990 case RC_LANGUAGE_COMMAND_LOCAL:
992 language_command_local = lexrc.getString();
997 rtl_support = lexrc.getBool();
1000 case RC_VISUAL_CURSOR:
1002 visual_cursor = lexrc.getBool();
1005 case RC_AUTO_NUMBER:
1007 auto_number = lexrc.getBool();
1010 case RC_MARK_FOREIGN_LANGUAGE:
1012 mark_foreign_language = lexrc.getBool();
1017 string fmt, command;
1019 fmt = lexrc.getString();
1022 command = lexrc.getString();
1024 setMover(fmt, command);
1028 case RC_CONVERTER: {
1029 string from, to, command, flags;
1031 from = lexrc.getString();
1034 to = lexrc.getString();
1037 command = lexrc.getString();
1040 flags = lexrc.getString();
1042 if (command.empty()) {
1043 theConverters().erase(from, to);
1045 theConverters().add(from, to, command, flags);
1049 // compatibility with versions older than 1.4.0 only
1051 string format, command;
1053 format = lexrc.getString();
1056 command = lexrc.getString();
1058 formats.setViewer(format, command);
1062 string format, extension, prettyname, shortcut;
1064 format = lexrc.getString();
1067 extension = lexrc.getString();
1070 prettyname = lexrc.getString();
1073 shortcut = lexrc.getString();
1075 string viewer, editor;
1077 viewer = lexrc.getString();
1079 editor = lexrc.getString();
1081 // Hack to ensure compatibility with versions older
1083 int le = lexrc.lex();
1084 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1085 flags = lexrc.getString();
1086 if (le != Lexer::LEX_DATA) {
1087 // We have got a known token.
1088 // Therefore this is an old style
1089 // format definition without
1091 lexrc.pushToken(flags);
1095 int flgs = Format::none;
1096 while (!flags.empty()) {
1098 flags = split(flags, flag, ',');
1099 if (flag == "document")
1100 flgs |= Format::document;
1101 else if (flag == "vector")
1102 flgs |= Format::vector;
1104 lyxerr << "Ignoring unknown flag `"
1105 << flag << "' for format `"
1106 << format << "'." << endl;
1108 if (prettyname.empty()) {
1109 if (theConverters().formatIsUsed(format)) {
1110 lyxerr << "Can't delete format "
1113 formats.erase(format);
1116 formats.add(format, extension, prettyname,
1117 shortcut, viewer, editor, flgs);
1121 case RC_DEFAULT_LANGUAGE:
1123 default_language = lexrc.getString();
1127 case RC_LABEL_INIT_LENGTH:
1129 label_init_length = lexrc.getInteger();
1133 case RC_SHOW_BANNER:
1135 show_banner = lexrc.getBool();
1141 string const tmp = lexrc.getString();
1142 if (tmp == "true" || tmp == "on")
1143 preview = PREVIEW_ON;
1144 else if (tmp == "no_math")
1145 preview = PREVIEW_NO_MATH;
1147 preview = PREVIEW_OFF;
1148 if (tmp != "false" && tmp != "off")
1149 lyxerr << "Unrecognized "
1151 << tmp << '\n' << endl;
1156 case RC_PREVIEW_HASHED_LABELS:
1158 preview_hashed_labels = lexrc.getBool();
1162 case RC_PREVIEW_SCALE_FACTOR:
1164 preview_scale_factor = lexrc.getString();
1170 user_name = lexrc.getString();
1175 user_email = lexrc.getString();
1178 case RC_PATH_PREFIX:
1180 path_prefix = lexrc.getString();
1183 case RC_USE_CONVERTER_CACHE:
1185 use_converter_cache = lexrc.getBool();
1188 case RC_CONVERTER_CACHE_MAXAGE:
1190 converter_cache_maxage =
1191 convert<unsigned int>(lexrc.getString());
1194 case RC_SORT_LAYOUTS:
1196 sort_layouts = lexrc.getBool();
1199 case RC_LAST: break; // this is just a dummy
1203 /// Update converters data-structures
1204 theConverters().update(formats);
1205 theConverters().buildGraph();
1211 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1213 ofstream ofs(filename.toFilesystemEncoding().c_str());
1215 write(ofs, ignore_system_lyxrc);
1219 void LyXRC::print() const
1221 if (lyxerr.debugging())
1222 write(lyxerr, false);
1230 typedef pair<string, SpecialisedMover> Data;
1232 SameMover(Data const & comparison)
1233 : comparison_(comparison) {}
1235 bool operator()(Data const & data) const
1237 return data.first == comparison_.first &&
1238 data.second.command() == comparison_.second.command();
1246 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1248 LyXRCTags tag = RC_LAST;
1250 if (!name.empty()) {
1251 for (int i = 0; i != lyxrcCount; ++i)
1252 if ("\\" + name == lyxrcTags[i].tag)
1253 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1257 os << "### This file is part of\n"
1258 << "### ========================================================\n"
1259 << "### LyX, The Document Processor\n"
1261 << "### Copyright 1995 Matthias Ettrich\n"
1262 << "### Copyright 1995-2007 The LyX Team.\n"
1264 << "### ========================================================\n"
1266 << "# This file is written by LyX, if you want to make your own\n"
1267 << "# modifications you should do them from inside LyX and save\n"
1270 // Why the switch you might ask. It is a trick to ensure that all
1271 // the elements in the LyXRCTags enum is handled. As you can see
1272 // there are no breaks at all. So it is just a huge fall-through.
1273 // The nice thing is that we will get a warning from the compiler
1274 // if we forget an element.
1278 // input/include files are not done here
1280 if (ignore_system_lyxrc ||
1281 bind_file != system_lyxrc.bind_file) {
1282 string const path = os::external_path(bind_file);
1283 os << "\\bind_file \"" << path << "\"\n";
1289 if (ignore_system_lyxrc ||
1290 def_file != system_lyxrc.def_file) {
1291 string const path = os::external_path(def_file);
1292 os << "\\def_file \"" << path << "\"\n";
1301 << "# MISC SECTION ######################################\n"
1303 // bind files are not done here.
1305 case RC_PATH_PREFIX:
1306 if (ignore_system_lyxrc ||
1307 path_prefix != system_lyxrc.path_prefix) {
1308 os << "\\path_prefix \"" << path_prefix << "\"\n";
1313 if (ignore_system_lyxrc ||
1314 ui_file != system_lyxrc.ui_file) {
1315 string const path = os::external_path(ui_file);
1316 os << "\\ui_file \"" << path << "\"\n";
1320 case RC_AUTOREGIONDELETE:
1321 if (ignore_system_lyxrc ||
1322 auto_region_delete != system_lyxrc.auto_region_delete) {
1323 os << "# Set to false to inhibit automatic replacement of\n"
1324 << "# the current selection.\n"
1325 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1330 case RC_AUTORESET_OPTIONS:
1331 if (ignore_system_lyxrc ||
1332 auto_reset_options != system_lyxrc.auto_reset_options) {
1333 os << "# Set to false to inhibit automatic reset of\n"
1334 << "# the class options to defaults on class change.\n"
1335 << "\\auto_reset_options "
1336 << convert<string>(auto_reset_options)
1342 if (ignore_system_lyxrc ||
1343 autosave != system_lyxrc.autosave) {
1344 os << "# The time interval between auto-saves in seconds.\n"
1345 << "\\autosave " << autosave << '\n';
1349 case RC_DISPLAY_GRAPHICS:
1350 if (ignore_system_lyxrc ||
1351 display_graphics != system_lyxrc.display_graphics) {
1352 os << "# Display graphics within LyX\n"
1353 << "# monochrome|grayscale|color|none\n"
1354 << "\\display_graphics "
1355 << graphics::displayTranslator().find(
1356 graphics::DisplayType(display_graphics))
1361 case RC_SORT_LAYOUTS:
1362 if (ignore_system_lyxrc ||
1363 sort_layouts != system_lyxrc.sort_layouts) {
1364 os << "# Sort layouts alphabetically.\n"
1365 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1369 case RC_VIEWDVI_PAPEROPTION:
1370 if (ignore_system_lyxrc ||
1371 view_dvi_paper_option
1372 != system_lyxrc.view_dvi_paper_option) {
1373 os << "# Options used to specify paper size to the\n"
1374 << "# view_dvi_command (e.g. -paper)\n"
1375 << "\\view_dvi_paper_option \""
1376 << view_dvi_paper_option << "\"\n";
1380 case RC_DEFAULT_PAPERSIZE:
1381 if (ignore_system_lyxrc ||
1382 default_papersize != system_lyxrc.default_papersize) {
1383 os << "# The default papersize to use.\n"
1384 << "\\default_papersize \"";
1385 switch (default_papersize) {
1387 os << "default"; break;
1388 case PAPER_USLETTER:
1389 os << "usletter"; break;
1391 os << "legal"; break;
1392 case PAPER_USEXECUTIVE:
1393 os << "executive"; break;
1404 case PAPER_B4: break;
1410 case RC_CHKTEX_COMMAND:
1411 if (ignore_system_lyxrc ||
1412 chktex_command != system_lyxrc.chktex_command) {
1413 os << "\\chktex_command \"" << chktex_command << "\"\n";
1417 case RC_BIBTEX_COMMAND:
1418 if (ignore_system_lyxrc ||
1419 bibtex_command != system_lyxrc.bibtex_command) {
1420 os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1424 case RC_INDEX_COMMAND:
1425 if (ignore_system_lyxrc ||
1426 index_command != system_lyxrc.index_command) {
1427 os << "\\index_command \"" << index_command << "\"\n";
1431 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1432 if (ignore_system_lyxrc ||
1433 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1434 os << "\\tex_expects_windows_paths "
1435 << convert<string>(windows_style_tex_paths) << '\n';
1439 case RC_TEX_ALLOWS_SPACES:
1440 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1441 os << "\\tex_allows_spaces "
1442 << convert<string>(tex_allows_spaces) << '\n';
1447 if (ignore_system_lyxrc ||
1448 use_kbmap != system_lyxrc.use_kbmap) {
1449 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1453 case RC_KBMAP_PRIMARY:
1454 if (ignore_system_lyxrc ||
1455 primary_kbmap != system_lyxrc.primary_kbmap) {
1456 string const path = os::external_path(primary_kbmap);
1457 os << "\\kbmap_primary \"" << path << "\"\n";
1461 case RC_KBMAP_SECONDARY:
1462 if (ignore_system_lyxrc ||
1463 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1464 string const path = os::external_path(secondary_kbmap);
1465 os << "\\kbmap_secondary \"" << path << "\"\n";
1470 if (ignore_system_lyxrc ||
1471 lyxpipes != system_lyxrc.lyxpipes) {
1472 string const path = os::external_path(lyxpipes);
1473 os << "\\serverpipe \"" << path << "\"\n";
1477 case RC_DATE_INSERT_FORMAT:
1478 if (ignore_system_lyxrc ||
1479 date_insert_format != system_lyxrc.date_insert_format) {
1480 os << "\\date_insert_format \"" << date_insert_format
1485 case RC_LABEL_INIT_LENGTH:
1486 if (ignore_system_lyxrc ||
1487 label_init_length != system_lyxrc.label_init_length) {
1488 os << "\\label_init_length " << label_init_length
1495 os << "\\user_name \"" << user_name << "\"\n";
1500 os << "\\user_email \"" << user_email << "\"\n";
1504 case RC_SHOW_BANNER:
1505 if (ignore_system_lyxrc ||
1506 show_banner != system_lyxrc.show_banner) {
1507 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1513 if (ignore_system_lyxrc ||
1514 preview != system_lyxrc.preview) {
1520 case PREVIEW_NO_MATH:
1527 os << "\\preview " << status << '\n';
1532 case RC_PREVIEW_HASHED_LABELS:
1533 if (ignore_system_lyxrc ||
1534 preview_hashed_labels !=
1535 system_lyxrc.preview_hashed_labels) {
1536 os << "\\preview_hashed_labels "
1537 << convert<string>(preview_hashed_labels) << '\n';
1542 case RC_PREVIEW_SCALE_FACTOR:
1543 if (ignore_system_lyxrc ||
1544 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1545 os << "\\preview_scale_factor "
1546 << preview_scale_factor << '\n';
1551 case RC_USE_CONVERTER_CACHE:
1552 if (ignore_system_lyxrc ||
1553 use_converter_cache != system_lyxrc.use_converter_cache) {
1554 os << "\\use_converter_cache "
1555 << convert<string>(use_converter_cache) << '\n';
1560 case RC_CONVERTER_CACHE_MAXAGE:
1561 if (ignore_system_lyxrc ||
1562 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1563 os << "\\converter_cache_maxage "
1564 << converter_cache_maxage << '\n';
1570 << "# SCREEN & FONTS SECTION ############################\n"
1574 if (ignore_system_lyxrc ||
1575 dpi != system_lyxrc.dpi) {
1576 os << "\\screen_dpi " << dpi << '\n';
1580 case RC_SCREEN_ZOOM:
1581 if (ignore_system_lyxrc ||
1582 zoom != system_lyxrc.zoom) {
1583 os << "\\screen_zoom " << zoom << '\n';
1587 case RC_GEOMETRY_SESSION:
1588 if (ignore_system_lyxrc ||
1589 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1590 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1595 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1596 if (ignore_system_lyxrc ||
1597 cursor_follows_scrollbar
1598 != system_lyxrc.cursor_follows_scrollbar) {
1599 os << "\\cursor_follows_scrollbar "
1600 << convert<string>(cursor_follows_scrollbar) << '\n';
1604 case RC_MACRO_EDIT_STYLE:
1605 if (ignore_system_lyxrc ||
1607 != system_lyxrc.macro_edit_style) {
1608 os << "\\macro_edit_style ";
1609 switch (macro_edit_style) {
1610 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1611 case MACRO_EDIT_INLINE: os << "1\n"; break;
1612 case MACRO_EDIT_LIST: os << "2\n"; break;
1617 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1618 if (ignore_system_lyxrc ||
1619 dialogs_iconify_with_main
1620 != system_lyxrc.dialogs_iconify_with_main) {
1621 os << "\\dialogs_iconify_with_main "
1622 << convert<string>(dialogs_iconify_with_main) << '\n';
1626 case RC_SCREEN_FONT_ROMAN:
1627 if (ignore_system_lyxrc ||
1628 roman_font_name != system_lyxrc.roman_font_name) {
1629 os << "\\screen_font_roman \"" << roman_font_name
1634 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1635 if (ignore_system_lyxrc ||
1636 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1637 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1642 case RC_SCREEN_FONT_SANS:
1643 if (ignore_system_lyxrc ||
1644 sans_font_name != system_lyxrc.sans_font_name) {
1645 os << "\\screen_font_sans \"" << sans_font_name
1650 case RC_SCREEN_FONT_SANS_FOUNDRY:
1651 if (ignore_system_lyxrc ||
1652 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1653 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1658 case RC_SCREEN_FONT_TYPEWRITER:
1659 if (ignore_system_lyxrc ||
1660 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1661 os << "\\screen_font_typewriter \""
1662 << typewriter_font_name << "\"\n";
1666 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1667 if (ignore_system_lyxrc ||
1668 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1669 os << "\\screen_font_typewriter_foundry \""
1670 << typewriter_font_foundry << "\"\n";
1675 case RC_SCREEN_FONT_SCALABLE:
1676 if (ignore_system_lyxrc ||
1677 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1678 os << "\\screen_font_scalable "
1679 << convert<string>(use_scalable_fonts)
1684 case RC_SCREEN_FONT_SIZES:
1685 if (ignore_system_lyxrc ||
1686 font_sizes[FONT_SIZE_TINY]
1687 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1688 font_sizes[FONT_SIZE_SCRIPT]
1689 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1690 font_sizes[FONT_SIZE_FOOTNOTE]
1691 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1692 font_sizes[FONT_SIZE_SMALL]
1693 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1694 font_sizes[FONT_SIZE_NORMAL]
1695 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1696 font_sizes[FONT_SIZE_LARGE]
1697 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1698 font_sizes[FONT_SIZE_LARGER]
1699 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1700 font_sizes[FONT_SIZE_LARGEST]
1701 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1702 font_sizes[FONT_SIZE_HUGE]
1703 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1704 font_sizes[FONT_SIZE_HUGER]
1705 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1706 os.setf(ios::fixed);
1708 os << "\\screen_font_sizes"
1709 << ' ' << font_sizes[FONT_SIZE_TINY]
1710 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1711 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1712 << ' ' << font_sizes[FONT_SIZE_SMALL]
1713 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1714 << ' ' << font_sizes[FONT_SIZE_LARGE]
1715 << ' ' << font_sizes[FONT_SIZE_LARGER]
1716 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1717 << ' ' << font_sizes[FONT_SIZE_HUGE]
1718 << ' ' << font_sizes[FONT_SIZE_HUGER]
1725 << "# COLOR SECTION ###################################\n"
1729 for (int i = 0; i < Color_ignore; ++i) {
1730 ColorCode lc = static_cast<ColorCode>(i);
1732 string const col(lcolor.getX11Name(lc));
1733 if (ignore_system_lyxrc ||
1734 col != system_lcolor.getX11Name(lc)) {
1735 os << "\\set_color \""
1736 << lcolor.getLyXName(lc) << "\" \""
1744 << "# PRINTER SECTION ###################################\n"
1748 if (ignore_system_lyxrc ||
1749 printer != system_lyxrc.printer) {
1750 os << "\\printer \"" << printer << "\"\n";
1754 case RC_PRINT_ADAPTOUTPUT:
1755 if (ignore_system_lyxrc ||
1756 print_adapt_output != system_lyxrc.print_adapt_output) {
1757 os << "\\print_adapt_output "
1758 << convert<string>(print_adapt_output)
1763 case RC_PRINT_COMMAND:
1764 if (ignore_system_lyxrc ||
1765 print_command != system_lyxrc.print_command) {
1766 os << "\\print_command \"" << print_command << "\"\n";
1770 case RC_PRINTEXSTRAOPTIONS:
1771 if (ignore_system_lyxrc ||
1772 print_extra_options != system_lyxrc.print_extra_options) {
1773 os << "\\print_extra_options \"" << print_extra_options
1778 case RC_PRINTSPOOL_COMMAND:
1779 if (ignore_system_lyxrc ||
1780 print_spool_command != system_lyxrc.print_spool_command) {
1781 os << "\\print_spool_command \"" << print_spool_command
1786 case RC_PRINTSPOOL_PRINTERPREFIX:
1787 if (ignore_system_lyxrc ||
1788 print_spool_printerprefix
1789 != system_lyxrc.print_spool_printerprefix) {
1790 os << "\\print_spool_printerprefix \""
1791 << print_spool_printerprefix << "\"\n";
1795 case RC_PRINTEVENPAGEFLAG:
1796 if (ignore_system_lyxrc ||
1797 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1798 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1803 case RC_PRINTODDPAGEFLAG:
1804 if (ignore_system_lyxrc ||
1805 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1806 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1811 case RC_PRINTREVERSEFLAG:
1812 if (ignore_system_lyxrc ||
1813 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1814 os << "\\print_reverse_flag \"" << print_reverse_flag
1819 case RC_PRINTLANDSCAPEFLAG:
1820 if (ignore_system_lyxrc ||
1821 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1822 os << "\\print_landscape_flag \"" << print_landscape_flag
1827 case RC_PRINTPAGERANGEFLAG:
1828 if (ignore_system_lyxrc ||
1829 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1830 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1835 case RC_PRINTCOPIESFLAG:
1836 if (ignore_system_lyxrc ||
1837 print_copies_flag != system_lyxrc.print_copies_flag) {
1838 os << "\\print_copies_flag \"" << print_copies_flag
1843 case RC_PRINTCOLLCOPIESFLAG:
1844 if (ignore_system_lyxrc ||
1845 print_collcopies_flag
1846 != system_lyxrc.print_collcopies_flag) {
1847 os << "\\print_collcopies_flag \""
1848 << print_collcopies_flag
1853 case RC_PRINTPAPERFLAG:
1854 if (ignore_system_lyxrc ||
1855 print_paper_flag != system_lyxrc.print_paper_flag) {
1856 os << "\\print_paper_flag \"" << print_paper_flag
1861 case RC_PRINTPAPERDIMENSIONFLAG:
1862 if (ignore_system_lyxrc ||
1863 print_paper_dimension_flag
1864 != system_lyxrc.print_paper_dimension_flag) {
1865 os << "\\print_paper_dimension_flag \""
1866 << print_paper_dimension_flag << "\"\n";
1870 case RC_PRINTTOPRINTER:
1871 if (ignore_system_lyxrc ||
1872 print_to_printer != system_lyxrc.print_to_printer) {
1873 os << "\\print_to_printer \"" << print_to_printer
1878 case RC_PRINTTOFILE:
1879 if (ignore_system_lyxrc ||
1880 print_to_file != system_lyxrc.print_to_file) {
1881 string const path = os::external_path(print_to_file);
1882 os << "\\print_to_file \"" << path << "\"\n";
1886 case RC_PRINTFILEEXTENSION:
1887 if (ignore_system_lyxrc ||
1888 print_file_extension != system_lyxrc.print_file_extension) {
1889 os << "\\print_file_extension \""
1890 << print_file_extension
1897 << "# EXPORT SECTION ####################################\n"
1900 case RC_CUSTOM_EXPORT_COMMAND:
1901 if (ignore_system_lyxrc ||
1902 custom_export_command
1903 != system_lyxrc.custom_export_command) {
1904 os << "\\custom_export_command \""
1905 << custom_export_command
1910 case RC_CUSTOM_EXPORT_FORMAT:
1911 if (ignore_system_lyxrc ||
1912 custom_export_format
1913 != system_lyxrc.custom_export_format) {
1914 os << "\\custom_export_format \"" << custom_export_format
1921 << "# TEX SECTION #######################################\n"
1924 case RC_FONT_ENCODING:
1925 if (ignore_system_lyxrc ||
1926 fontenc != system_lyxrc.fontenc) {
1927 os << "\\font_encoding \"" << fontenc << "\"\n";
1933 << "# FILE SECTION ######################################\n"
1936 case RC_DOCUMENTPATH:
1937 if (ignore_system_lyxrc ||
1938 document_path != system_lyxrc.document_path) {
1939 string const path = os::external_path(document_path);
1940 os << "\\document_path \"" << path << "\"\n";
1944 case RC_USELASTFILEPOS:
1945 if (ignore_system_lyxrc ||
1946 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1947 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1952 case RC_LOADSESSION:
1953 if (ignore_system_lyxrc ||
1954 load_session != system_lyxrc.load_session) {
1955 os << "\\load_session " << convert<string>(load_session)
1960 case RC_MOUSE_WHEEL_SPEED:
1961 if (ignore_system_lyxrc ||
1962 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1963 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1967 case RC_NUMLASTFILES:
1968 if (ignore_system_lyxrc ||
1969 num_lastfiles != system_lyxrc.num_lastfiles) {
1970 os << "\\num_lastfiles " << num_lastfiles << '\n';
1974 case RC_CHECKLASTFILES:
1975 if (ignore_system_lyxrc ||
1976 check_lastfiles != system_lyxrc.check_lastfiles) {
1977 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
1982 case RC_EXAMPLEPATH:
1983 if (ignore_system_lyxrc ||
1984 example_path != system_lyxrc.example_path) {
1985 string const path = os::external_path(example_path);
1986 os << "\\example_path \"" << path << "\"\n";
1990 case RC_TEMPLATEPATH:
1991 if (ignore_system_lyxrc ||
1992 template_path != system_lyxrc.template_path) {
1993 string const path = os::external_path(template_path);
1994 os << "\\template_path \"" << path << "\"\n";
1998 case RC_TEMPDIRPATH:
1999 if (ignore_system_lyxrc ||
2000 tempdir_path != system_lyxrc.tempdir_path) {
2001 string const path = os::external_path(tempdir_path);
2002 os << "\\tempdir_path \"" << path << "\"\n";
2010 case RC_PLAINTEXT_LINELEN:
2011 if (ignore_system_lyxrc ||
2012 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2013 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2017 case RC_MAKE_BACKUP:
2018 if (ignore_system_lyxrc ||
2019 make_backup != system_lyxrc.make_backup) {
2020 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2024 case RC_BACKUPDIR_PATH:
2025 if (ignore_system_lyxrc ||
2026 backupdir_path != system_lyxrc.backupdir_path) {
2027 string const path = os::external_path(backupdir_path);
2028 os << "\\backupdir_path \"" << path << "\"\n";
2034 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2037 case RC_PLAINTEXT_ROFF_COMMAND:
2038 if (ignore_system_lyxrc ||
2039 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2040 os << "\\plaintext_roff_command \"" << plaintext_roff_command
2047 << "# SPELLCHECKER SECTION ##############################\n"
2049 case RC_USE_SPELL_LIB:
2050 if (ignore_system_lyxrc ||
2051 use_spell_lib != system_lyxrc.use_spell_lib) {
2052 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2056 case RC_SPELL_COMMAND:
2057 if (ignore_system_lyxrc ||
2058 isp_command != system_lyxrc.isp_command) {
2059 os << "\\spell_command \"" << isp_command << "\"\n";
2063 case RC_ACCEPT_COMPOUND:
2064 if (ignore_system_lyxrc ||
2065 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2066 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2071 case RC_USE_ALT_LANG:
2072 if (ignore_system_lyxrc ||
2073 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2074 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2080 if (ignore_system_lyxrc ||
2081 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2082 os << "\\alternate_language \"" << isp_alt_lang
2087 case RC_USE_ESC_CHARS:
2088 if (ignore_system_lyxrc ||
2089 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2090 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2096 if (ignore_system_lyxrc ||
2097 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2098 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2102 case RC_USE_PERS_DICT:
2103 if (ignore_system_lyxrc ||
2104 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2105 os << "\\use_personal_dictionary "
2106 << convert<string>(isp_use_pers_dict)
2111 case RC_USE_TOOLTIP:
2112 if (ignore_system_lyxrc ||
2113 use_tooltip != system_lyxrc.use_tooltip) {
2114 os << "\\use_tooltip "
2115 << convert<string>(use_tooltip)
2118 case RC_USE_PIXMAP_CACHE:
2119 if (ignore_system_lyxrc ||
2120 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2121 os << "\\use_pixmap_cache "
2122 << convert<string>(use_pixmap_cache)
2126 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2127 string const path = os::external_path(isp_pers_dict);
2128 os << "\\personal_dictionary \"" << path << "\"\n";
2132 case RC_USE_INP_ENC:
2133 if (ignore_system_lyxrc ||
2134 isp_use_input_encoding
2135 != system_lyxrc.isp_use_input_encoding) {
2136 os << "\\use_input_encoding "
2137 << convert<string>(isp_use_input_encoding)
2144 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2147 case RC_RTL_SUPPORT:
2148 if (ignore_system_lyxrc ||
2149 rtl_support != system_lyxrc.rtl_support) {
2150 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2154 case RC_VISUAL_CURSOR:
2155 if (ignore_system_lyxrc ||
2156 visual_cursor != system_lyxrc.visual_cursor) {
2157 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2161 case RC_LANGUAGE_PACKAGE:
2162 if (ignore_system_lyxrc ||
2163 language_package != system_lyxrc.language_package) {
2164 os << "\\language_package \"" << language_package
2169 case RC_LANGUAGE_GLOBAL_OPTIONS:
2170 if (ignore_system_lyxrc ||
2171 language_global_options
2172 != system_lyxrc.language_global_options) {
2173 os << "\\language_global_options \""
2174 << convert<string>(language_global_options)
2179 case RC_LANGUAGE_USE_BABEL:
2180 if (ignore_system_lyxrc ||
2181 language_use_babel != system_lyxrc.language_use_babel) {
2182 os << "\\language_use_babel \""
2183 << convert<string>(language_use_babel)
2188 case RC_LANGUAGE_COMMAND_BEGIN:
2189 if (ignore_system_lyxrc ||
2190 language_command_begin
2191 != system_lyxrc.language_command_begin) {
2192 os << "\\language_command_begin \""
2193 << language_command_begin
2198 case RC_LANGUAGE_COMMAND_END:
2199 if (ignore_system_lyxrc ||
2200 language_command_end
2201 != system_lyxrc.language_command_end) {
2202 os << "\\language_command_end \"" << language_command_end
2207 case RC_LANGUAGE_COMMAND_LOCAL:
2208 if (ignore_system_lyxrc ||
2209 language_command_local
2210 != system_lyxrc.language_command_local) {
2211 os << "\\language_command_local \""
2212 << language_command_local
2217 case RC_LANGUAGE_AUTO_BEGIN:
2218 if (ignore_system_lyxrc ||
2219 language_auto_begin != system_lyxrc.language_auto_begin) {
2220 os << "\\language_auto_begin "
2221 << convert<string>(language_auto_begin) << '\n';
2225 case RC_LANGUAGE_AUTO_END:
2226 if (ignore_system_lyxrc ||
2227 language_auto_end != system_lyxrc.language_auto_end) {
2228 os << "\\language_auto_end "
2229 << convert<string>(language_auto_end) << '\n';
2233 case RC_MARK_FOREIGN_LANGUAGE:
2234 if (ignore_system_lyxrc ||
2235 mark_foreign_language
2236 != system_lyxrc.mark_foreign_language) {
2237 os << "\\mark_foreign_language " <<
2238 convert<string>(mark_foreign_language) << '\n';
2244 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2247 case RC_AUTO_NUMBER:
2248 if (ignore_system_lyxrc ||
2249 auto_number != system_lyxrc.auto_number) {
2250 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2254 case RC_DEFAULT_LANGUAGE:
2255 if (ignore_system_lyxrc ||
2256 default_language != system_lyxrc.default_language) {
2257 os << "\\default_language " << default_language << '\n';
2263 << "# FORMATS SECTION ##########################\n"
2267 // New/modified formats
2268 for (Formats::const_iterator cit = formats.begin();
2269 cit != formats.end(); ++cit) {
2270 Format const * format =
2271 system_formats.getFormat(cit->name());
2273 format->extension() != cit->extension() ||
2274 format->prettyname() != cit->prettyname() ||
2275 format->shortcut() != cit->shortcut() ||
2276 format->viewer() != cit->viewer() ||
2277 format->editor() != cit->editor() ||
2278 format->documentFormat() != cit->documentFormat() ||
2279 format->vectorFormat() != cit->vectorFormat()) {
2280 os << "\\format \"" << cit->name() << "\" \""
2281 << cit->extension() << "\" \""
2282 << cit->prettyname() << "\" \""
2283 << cit->shortcut() << "\" \""
2284 << cit->viewer() << "\" \""
2285 << cit->editor() << "\" \"";
2286 vector<string> flags;
2287 if (cit->documentFormat())
2288 flags.push_back("document");
2289 if (cit->vectorFormat())
2290 flags.push_back("vector");
2291 os << getStringFromVector(flags);
2296 // Look for deleted formats
2297 for (Formats::const_iterator cit = system_formats.begin();
2298 cit != system_formats.end(); ++cit)
2299 if (!formats.getFormat(cit->name()))
2300 os << "\\format \"" << cit->name()
2301 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2310 << "# CONVERTERS SECTION ##########################\n"
2314 // Look for new converters
2315 for (Converters::const_iterator cit = theConverters().begin();
2316 cit != theConverters().end(); ++cit) {
2317 Converter const * converter =
2318 theSystemConverters().getConverter(cit->from,
2321 converter->command != cit->command ||
2322 converter->flags != cit->flags)
2323 os << "\\converter \"" << cit->from << "\" \""
2324 << cit->to << "\" \""
2325 << cit->command << "\" \""
2326 << cit->flags << "\"\n";
2329 // New/modifed converters
2330 for (Converters::const_iterator cit = theSystemConverters().begin();
2331 cit != theSystemConverters().end(); ++cit)
2332 if (!theConverters().getConverter(cit->from, cit->to))
2333 os << "\\converter \"" << cit->from
2334 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2341 << "# COPIERS SECTION ##########################\n"
2344 // Look for new movers
2345 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2346 Movers::const_iterator const sysend = theSystemMovers().end();
2347 Movers::const_iterator it = theMovers().begin();
2348 Movers::const_iterator end = theMovers().end();
2350 for (; it != end; ++it) {
2351 Movers::const_iterator const sysit =
2352 find_if(sysbegin, sysend, SameMover(*it));
2353 if (sysit == sysend) {
2354 string const & fmt = it->first;
2355 string const & command =
2356 it->second.command();
2358 os << "\\copier " << fmt
2359 << " \"" << command << "\"\n";
2365 // We don't actually delete SpecialisedMover(s) from the
2366 // map, just clear their 'command', so there's no need
2367 // to test for anything else.
2375 string const LyXRC::getDescription(LyXRCTags tag)
2380 case RC_ACCEPT_COMPOUND:
2381 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2385 case RC_USE_ALT_LANG:
2386 str = _("Specify an alternate language. The default is to use the language of the document.");
2389 case RC_PLAINTEXT_ROFF_COMMAND:
2390 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.");
2393 case RC_PLAINTEXT_LINELEN:
2394 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.");
2397 case RC_AUTOREGIONDELETE:
2398 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2401 case RC_AUTORESET_OPTIONS:
2402 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2406 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2409 case RC_AUTO_NUMBER:
2412 case RC_BACKUPDIR_PATH:
2413 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.");
2416 case RC_BIBTEX_COMMAND:
2417 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2421 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2424 case RC_CHECKLASTFILES:
2425 str = _("Select to check whether the lastfiles still exist.");
2428 case RC_CHKTEX_COMMAND:
2429 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2438 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2439 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.");
2442 case RC_SHOW_MACRO_LABEL:
2443 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2446 case RC_CUSTOM_EXPORT_COMMAND:
2449 case RC_CUSTOM_EXPORT_FORMAT:
2452 case RC_DATE_INSERT_FORMAT:
2453 //xgettext:no-c-format
2454 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2458 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2461 case RC_DEFAULT_LANGUAGE:
2462 str = _("New documents will be assigned this language.");
2465 case RC_DEFAULT_PAPERSIZE:
2466 str = _("Specify the default paper size.");
2469 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2470 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2473 case RC_DISPLAY_GRAPHICS:
2474 str = _("Select how LyX will display any graphics.");
2477 case RC_DOCUMENTPATH:
2478 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2482 case RC_USE_ESC_CHARS:
2483 str = _("Specify additional chars that can be part of a word.");
2486 case RC_EXAMPLEPATH:
2487 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2490 case RC_FONT_ENCODING:
2491 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2497 case RC_INDEX_COMMAND:
2498 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\".");
2505 case RC_KBMAP_PRIMARY:
2506 case RC_KBMAP_SECONDARY:
2507 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.");
2510 case RC_LABEL_INIT_LENGTH:
2511 str = _("Maximum number of words in the initialization string for a new label");
2514 case RC_LANGUAGE_AUTO_BEGIN:
2515 str = _("Select if a language switching command is needed at the beginning of the document.");
2518 case RC_LANGUAGE_AUTO_END:
2519 str = _("Select if a language switching command is needed at the end of the document.");
2522 case RC_LANGUAGE_COMMAND_BEGIN:
2523 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.");
2526 case RC_LANGUAGE_COMMAND_END:
2527 str = _("The LaTeX command for changing back to the language of the document.");
2530 case RC_LANGUAGE_COMMAND_LOCAL:
2531 str = _("The LaTeX command for local changing of the language.");
2534 case RC_LANGUAGE_GLOBAL_OPTIONS:
2535 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2538 case RC_LANGUAGE_PACKAGE:
2539 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2542 case RC_LANGUAGE_USE_BABEL:
2543 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2546 case RC_USELASTFILEPOS:
2547 str = _("De-select if you do not want LyX to scroll to saved position.");
2550 case RC_LOADSESSION:
2551 str = _("De-select to prevent loading files opened from the last LyX session.");
2554 case RC_MAKE_BACKUP:
2555 str = _("De-select if you don't want LyX to create backup files.");
2558 case RC_MARK_FOREIGN_LANGUAGE:
2559 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2562 case RC_MOUSE_WHEEL_SPEED:
2563 str = bformat(_("The scrolling speed of the mouse wheel. "),
2567 case RC_NUMLASTFILES:
2568 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2572 case RC_PATH_PREFIX:
2573 str = _("Specify those directories which should be "
2574 "prepended to the PATH environment variable. "
2575 "Use the OS native format.");
2579 case RC_USE_PERS_DICT:
2580 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2584 str = _("Shows a typeset preview of things such as math");
2587 case RC_PREVIEW_HASHED_LABELS:
2588 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2591 case RC_PREVIEW_SCALE_FACTOR:
2592 str = _("Scale the preview size to suit.");
2595 case RC_PRINTCOLLCOPIESFLAG:
2596 str = _("The option for specifying whether the copies should be collated.");
2599 case RC_PRINTCOPIESFLAG:
2600 str = _("The option for specifying the number of copies to print.");
2604 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2607 case RC_PRINTEVENPAGEFLAG:
2608 str = _("The option to print only even pages.");
2611 case RC_PRINTEXSTRAOPTIONS:
2612 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2615 case RC_PRINTFILEEXTENSION:
2616 str = _("Extension of printer program output file. Usually \".ps\".");
2619 case RC_PRINTLANDSCAPEFLAG:
2620 str = _("The option to print out in landscape.");
2623 case RC_PRINTODDPAGEFLAG:
2624 str = _("The option to print only odd pages.");
2627 case RC_PRINTPAGERANGEFLAG:
2628 str = _("The option for specifying a comma-separated list of pages to print.");
2631 case RC_PRINTPAPERDIMENSIONFLAG:
2632 str = _("Option to specify the dimensions of the print paper.");
2635 case RC_PRINTPAPERFLAG:
2636 str = _("The option to specify paper type.");
2639 case RC_PRINTREVERSEFLAG:
2640 str = _("The option to reverse the order of the pages printed.");
2643 case RC_PRINTSPOOL_COMMAND:
2644 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.");
2647 case RC_PRINTSPOOL_PRINTERPREFIX:
2648 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.");
2651 case RC_PRINTTOFILE:
2652 str = _("Option to pass to the print program to print to a file.");
2655 case RC_PRINTTOPRINTER:
2656 str = _("Option to pass to the print program to print on a specific printer.");
2659 case RC_PRINT_ADAPTOUTPUT:
2660 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2663 case RC_PRINT_COMMAND:
2664 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2667 case RC_RTL_SUPPORT:
2668 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2671 case RC_VISUAL_CURSOR:
2672 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2676 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2679 case RC_SCREEN_FONT_ROMAN:
2680 case RC_SCREEN_FONT_SANS:
2681 case RC_SCREEN_FONT_TYPEWRITER:
2682 str = _("The screen fonts used to display the text while editing.");
2685 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2686 case RC_SCREEN_FONT_SANS_FOUNDRY:
2687 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2690 case RC_SCREEN_FONT_SCALABLE:
2691 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.");
2694 case RC_SCREEN_FONT_SIZES:
2695 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2698 case RC_SCREEN_ZOOM:
2699 //xgettext:no-c-format
2700 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2703 case RC_GEOMETRY_SESSION:
2704 str = _("Allow session manager to save and restore windows geometry.");
2708 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2714 case RC_SHOW_BANNER:
2715 str = _("De-select if you don't want the startup banner.");
2718 case RC_SPELL_COMMAND:
2719 str = _("What command runs the spellchecker?");
2722 case RC_TEMPDIRPATH:
2723 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2726 case RC_TEMPLATEPATH:
2727 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2730 case RC_TEX_ALLOWS_SPACES:
2733 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2737 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2749 case RC_USE_INP_ENC:
2750 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.");
2753 case RC_USE_TOOLTIP:
2754 str = _("Enable the automatic appearance of tool tips in the work area.");
2757 case RC_USE_PIXMAP_CACHE:
2758 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2761 case RC_USE_SPELL_LIB:
2764 case RC_VIEWDVI_PAPEROPTION:
2765 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2780 // The global instance
2783 // The global copy of the system lyxrc entries (everything except preferences)