1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
6 \use_default_options false
12 \maintain_unincluded_children false
18 \font_typewriter default
19 \font_default_family default
27 \default_output_format default
28 \bibtex_command default
29 \index_command default
30 \paperfontsize default
41 \paperorientation portrait
49 \paragraph_separation indent
50 \paragraph_indentation default
51 \quotes_language english
54 \paperpagestyle default
55 \tracking_changes false
75 \begin_layout Standard
76 The Advanced Find&Replace feature
80 \begin_layout Plain Layout
81 For suggestions, comments or clarification requests regarding this document,
82 as well as for notifying possible issues or bugs arising from the use of
83 this feature, please use the standard support channels of LyX (i.e., bug
84 tracking and mailing lists).
89 of LyX allows for searching of complex, format-sensitive text segments
90 and mathematics contents within LyX documents.
91 This constitutes an enhancement of the standard (quick) Find&Replace feature.
94 \begin_layout Standard
95 The set of capabilities of the
96 \begin_inset Quotes eld
100 \begin_inset Quotes erd
103 part of the enhanced Find&Replace feature may be summarised as follows:
106 \begin_layout Itemize
107 the text to search for is entered by means of a full-featured LyX mini-editor;
110 \begin_layout Itemize
111 searching of the entered text occurs both within text and within mathematical
112 formulas possibly present in the document;
115 \begin_layout Itemize
116 both searching of text and of mathematical formulas is allowed, where the
117 latter is done by entering mathematics in the usual way the LyX user is
118 accustomed to do; not only entire mathematical formulas are found, but
119 also parts occurring within more complex formulas;
122 \begin_layout Itemize
123 both case-sensitive and case-insensitive search is possible;
126 \begin_layout Itemize
127 search may be restricted so as to match only at word-boundaries;
130 \begin_layout Itemize
131 search may be format-insensitive, so that the searched text is found in
132 any context/style (standard text, section headings, notes, and even mathematics
133 ), or it may be format-sensitive, so that, for example, a word entered with
134 a section heading will only be found within section headings;
137 \begin_layout Itemize
138 search may be widened to a specific
142 , i.e., a set of files which may be all the children of the document being
143 edited, all the open files, or all the manuals available from the
150 \begin_layout Standard
151 The set of capabilities related to the
152 \begin_inset Quotes eld
156 \begin_inset Quotes erd
159 part of the Find&Replace feature may be summarised as follows:
162 \begin_layout Itemize
163 the replaced text may be entered by means of a full-featured LyX mini-editor;
166 \begin_layout Itemize
167 replace may optionally preserve capitalisation, so that the replaced text
168 capitalisation is adapted so as to mimic the one of the matching text (i.e.,
169 all lowercase, all uppercase, first uppercase followed by lowercase).
172 \begin_layout Standard
173 The Advanced Find&Replace feature is activated with a set of default options
174 which is suitable for the most common needs.
175 A detailed discussion of the available options follows in Sections
180 \begin_inset CommandInset ref
182 reference "sec:Basic-usage"
191 \begin_inset CommandInset ref
193 reference "sec:Advanced-usage"
200 \begin_layout Section
201 \begin_inset CommandInset label
203 name "sec:Basic-usage"
210 \begin_layout Standard
211 The advanced Find&Replace feature of LyX is activated through the [C-S-f]
212 sequence (Ctrl+Shift+f), or through the
214 Edit->Find&Replace (Advanced)
217 This causes the Advanced Find&Replace dialog to show up, as shown in Figure
222 \begin_inset CommandInset ref
224 reference "fig:AdvancedFindReplaceDialog"
229 \begin_inset Wrap figure
236 \begin_layout Plain Layout
237 \begin_inset Graphics
238 filename clipart/AdvancedFindAndReplace.png
246 \begin_layout Plain Layout
249 \begin_layout Plain Layout
250 \begin_inset CommandInset label
252 name "fig:AdvancedFindReplaceDialog"
256 The Advanced Find&Replace Dialog.
269 \begin_layout Subsection
273 \begin_layout Standard
279 LyX mini-editor a simple word, and search for occurrences of it by clicking
284 button below it (or just pressing the
293 The entered word is found both in text mode and in math mode, and both
294 in emphasized, bold or normal face, and both in section titles and in standard
300 keeps searching forward.
305 searches for the entered text backwards.
308 \begin_layout Standard
313 option allows matches to occur only with the same case as entered in the
324 option allows matches to occur only at word boundaries.
327 \begin_layout Subsection
328 Searching for mathematics
331 \begin_layout Standard
332 Mathematical formulas may be searched for by typing in the
337 mini-editor a mathematical formula, such as
338 \begin_inset Formula $x^{2}$
341 or also something more complex like
342 \begin_inset Formula $\frac{x^{2}}{1+x^{2}}$
346 When searching for such formula, it is found both when it is alone and
347 when it occurs in subformulas and nested parts of subformulas, for example
348 the mentioned segments would be found in something like
349 \begin_inset Formula $\frac{x^{2}}{\sqrt{\frac{x^{2}}{1+x^{2}}}}.$
355 \begin_layout Subsection
359 \begin_layout Standard
360 It is also possible to search for text with specific styles.
361 This is done by switching to the
365 pane and unchecking the
373 \begin_layout Enumerate
379 LyX mini-editor a plain word and searching for it would not find instances
380 of the word occurring in emphasized or boldface.
383 \begin_layout Enumerate
389 LyX mini-editor an emphasized or boldface word and searching for it would
390 find the respective instances with same face only, and within the same
392 Note that, for example, an emphasized text is found not only when occurring
393 alone, but also when it is contained in a longer emphasized sentence.
396 \begin_layout Enumerate
402 LyX mini-editor a plain word and giving it a Section style from the style
403 selection dropdown menu, and searching for it, finds occurrences of if
404 only within Section titles.
405 Also, if the text to search is given an emphasized or bold face, in addition
410 style, then it is found only when occurring with the same style.
413 \begin_layout Enumerate
419 LyX mini-editor some mathematics in centered line math (C-S-m) mode, like
421 \begin_inset Formula \[
426 finds only instances of the text within the same kind of mathematical environmen
430 \begin_layout Subsection
434 \begin_layout Standard
435 The text segments matching the text entered in the
440 LyX mini-editor may be replaced with the text segments entered in the
446 In order to find the next occurrence and replace it, click on the
460 Alternatively, you can use the [
476 \begin_layout Standard
477 You can replace full-featured formatted LyX segments in place of the matching
478 text segments in your document.
479 Typical scenarios in which to use this capability may be (just to mention
483 \begin_layout Itemize
484 replacing occurrences of a word with a customized formatted version of the
485 same word, for example replacing occurrences of a name like
486 \begin_inset Quotes eld
490 \begin_inset Quotes erd
493 with its monospace version
496 \begin_inset Quotes eld
500 \begin_inset Quotes erd
506 \begin_layout Standard
507 performing a notation rework of mathematical symbols, for example replacing
509 \begin_inset Quotes eld
513 \begin_inset Formula $R$
517 \begin_inset Quotes erd
521 \begin_inset Quotes eld
525 \begin_inset Formula $\mathbb{R}$
529 \begin_inset Quotes erd
532 (you may want to enable the
540 options and disable the
552 pane, in order to avoid replacing all
553 \begin_inset Quotes eld
557 \begin_inset Quotes erd
560 letters occurring in normal text), or occurrences of
561 \begin_inset Formula $x_{j}^{i}$
565 \begin_inset Formula $x_{i,\, j}$
569 \begin_inset Formula $x[k]$
573 \begin_inset Formula $x_{k}$
579 \begin_layout Section
580 \begin_inset CommandInset label
582 name "sec:Advanced-usage"
589 \begin_layout Subsection
590 About using regular expressions in the Find...
594 \begin_layout Standard
595 There is a regular expression based searching facility.
596 Users may arbitrarily insert, within text or math material to search for,
597 regexp-mode insets that allow to enter regular subexpressions.
598 This is done either through the
602 dropdown button or by the [C-S-r] key sequence.
603 Characters entered in the
608 LyX mini-editor within regexp insets are matched according to the regular
609 expression matching rules
613 \begin_layout Plain Layout
614 but under the constraint that any subexpression must match a well-formed
615 LyX text segment, i.e., when matching LaTeX code, no segments with unbalanced
616 {} braces are allowed to match subexpressions entered by the user.
621 , while text entered outside regexp insets is matched exactly against the
622 same text in the document.
623 Note that it is allowed to cut and paste regexp-mode insets as usual.
624 Examples of using such a feature may be:
627 \begin_layout Enumerate
628 Searching for all fractions with a given denominator: for example, entering
634 LyX mini-editor the fraction
635 \begin_inset Formula $\frac{.*}{1+x^{2}}$
639 \begin_inset Formula $.*$
642 on the numerator is the match-everything regular expression that may be
643 added by clicking on the
645 [Match...]->[Anything]
647 button, or entering the regexp-mode through the [C-S-r] key sequence and
649 \begin_inset Formula $.*$
652 ) finds all fractions with the given denominator.
655 \begin_layout Enumerate
656 Searching for all text with a given style: for example, after unchecking
668 \begin_inset Formula $.*$
673 regular expression and adding it an emphasized or bold face, finds all
674 emphasized and bold face text, respectively.
676 \begin_inset Formula $.*$
679 regular expression a bullet-list, enumerated or Section style, you can
680 find all bullet or enumerated lists, or section titles.
683 \begin_layout Standard
684 Finally, references to subexpressions in regular expressions may be used
685 as usual, enclosing parts of the expression within round braces
686 \begin_inset Formula $()$
689 , and referring back to them through
690 \begin_inset Formula $\backslash1$
694 \begin_inset Formula $\backslash2$
698 \begin_inset Formula $\backslash$
701 symbol is entered in regular-expression mode by pressing twice the backslash
703 For example, try searching for the
704 \begin_inset Formula $([a-z]+)[[:blank:]]\backslash1$
707 regular expression in order to find word repetitions, if any.
710 \begin_layout Standard
711 Note that back references work both when occurring within the same regular
712 expression, and when occurring in multiple different regular expressions,
713 where numbering of back-referenced sub-expressions is absolute, i.e.,
714 \begin_inset Formula $\backslash1$
717 always refers to the first occurrence of
718 \begin_inset Formula $()$
721 in all entered regular expressions.
724 \begin_layout Standard
725 Note that the use of back references in the replaced text is not (yet) implement