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
29 \bibtex_command default
30 \index_command default
31 \paperfontsize default
43 \paperorientation portrait
52 \paragraph_separation indent
53 \paragraph_indentation default
54 \quotes_language english
57 \paperpagestyle default
58 \tracking_changes false
78 \begin_layout Standard
79 The Advanced Find&Replace feature
83 \begin_layout Plain Layout
84 For suggestions, comments or clarification requests regarding this document,
85 as well as for notifying possible issues or bugs arising from the use of
86 this feature, please use the standard support channels of LyX (i.e., bug
87 tracking and mailing lists).
92 of LyX allows for searching of complex, format-sensitive text segments
93 and mathematics contents within LyX documents.
94 This constitutes an enhancement of the standard (quick) Find&Replace feature.
97 \begin_layout Standard
98 The set of capabilities of the
99 \begin_inset Quotes eld
103 \begin_inset Quotes erd
106 part of the enhanced Find&Replace feature may be summarised as follows:
109 \begin_layout Itemize
110 the text to search for is entered by means of a full-featured LyX mini-editor;
113 \begin_layout Itemize
114 searching of the entered text occurs both within text and within mathematical
115 formulas possibly present in the document;
118 \begin_layout Itemize
119 both searching of text and of mathematical formulas is allowed, where the
120 latter is done by entering mathematics in the usual way the LyX user is
121 accustomed to do; not only entire mathematical formulas are found, but
122 also parts occurring within more complex formulas;
125 \begin_layout Itemize
126 both case-sensitive and case-insensitive search is possible;
129 \begin_layout Itemize
130 search may be restricted so as to match only at word-boundaries;
133 \begin_layout Itemize
134 search may be format-insensitive, so that the searched text is found in
135 any context/style (standard text, section headings, notes, and even mathematics
136 ), or it may be format-sensitive, so that, for example, a word entered with
137 a section heading will only be found within section headings;
140 \begin_layout Itemize
141 search may be widened to a specific
145 , i.e., a set of files which may be all the children of the document being
146 edited, all the open files, or all the manuals available from the
153 \begin_layout Standard
154 The set of capabilities related to the
155 \begin_inset Quotes eld
159 \begin_inset Quotes erd
162 part of the Find&Replace feature may be summarised as follows:
165 \begin_layout Itemize
166 the replaced text may be entered by means of a full-featured LyX mini-editor;
169 \begin_layout Itemize
170 replace may optionally preserve capitalisation, so that the replaced text
171 capitalisation is adapted so as to mimic the one of the matching text (i.e.,
172 all lowercase, all uppercase, first uppercase followed by lowercase).
175 \begin_layout Standard
176 The Advanced Find&Replace feature is activated with a set of default options
177 which is suitable for the most common needs.
178 A detailed discussion of the available options follows in Sections
183 \begin_inset CommandInset ref
185 reference "sec:Basic-usage"
194 \begin_inset CommandInset ref
196 reference "sec:Advanced-usage"
203 \begin_layout Section
204 \begin_inset CommandInset label
206 name "sec:Basic-usage"
213 \begin_layout Standard
214 The advanced Find&Replace feature of LyX is activated through the [C-S-f]
215 sequence (Ctrl+Shift+f), or through the
217 Edit->Find&Replace (Advanced)
220 This causes the Advanced Find&Replace dialog to show up, as shown in Figure
225 \begin_inset CommandInset ref
227 reference "fig:AdvancedFindReplaceDialog"
232 \begin_inset Wrap figure
239 \begin_layout Plain Layout
240 \begin_inset Graphics
241 filename clipart/AdvancedFindAndReplace.png
250 \begin_layout Plain Layout
253 \begin_layout Plain Layout
254 \begin_inset CommandInset label
256 name "fig:AdvancedFindReplaceDialog"
260 The Advanced Find&Replace Dialog.
273 \begin_layout Subsection
277 \begin_layout Standard
283 LyX mini-editor a simple word, and search for occurrences of it by clicking
288 button below it (or just pressing the
297 The entered word is found both in text mode and in math mode, and both
298 in emphasized, bold or normal face, and both in section titles and in standard
304 keeps searching forward.
309 searches for the entered text backwards.
312 \begin_layout Standard
317 option allows matches to occur only with the same case as entered in the
328 option allows matches to occur only at word boundaries.
331 \begin_layout Subsection
332 Searching for mathematics
335 \begin_layout Standard
336 Mathematical formulas may be searched for by typing in the
341 mini-editor a mathematical formula, such as
342 \begin_inset Formula $x^{2}$
345 or also something more complex like
346 \begin_inset Formula $\frac{x^{2}}{1+x^{2}}$
350 When searching for such formula, it is found both when it is alone and
351 when it occurs in subformulas and nested parts of subformulas, for example
352 the mentioned segments would be found in something like
353 \begin_inset Formula $\frac{x^{2}}{\sqrt{\frac{x^{2}}{1+x^{2}}}}.$
359 \begin_layout Subsection
363 \begin_layout Standard
364 It is also possible to search for text with specific styles.
365 This is done by switching to the
369 pane and unchecking the
377 \begin_layout Enumerate
383 LyX mini-editor a plain word and searching for it would not find instances
384 of the word occurring in emphasized or boldface.
387 \begin_layout Enumerate
393 LyX mini-editor an emphasized or boldface word and searching for it would
394 find the respective instances with same face only, and within the same
396 Note that, for example, an emphasized text is found not only when occurring
397 alone, but also when it is contained in a longer emphasized sentence.
400 \begin_layout Enumerate
406 LyX mini-editor a plain word and giving it a Section style from the style
407 selection dropdown menu, and searching for it, finds occurrences of if
408 only within Section titles.
409 Also, if the text to search is given an emphasized or bold face, in addition
414 style, then it is found only when occurring with the same style.
417 \begin_layout Enumerate
423 LyX mini-editor some mathematics in centered line math (C-S-m) mode, like
425 \begin_inset Formula \[
431 finds only instances of the text within the same kind of mathematical environmen
435 \begin_layout Subsection
439 \begin_layout Standard
440 The text segments matching the text entered in the
445 LyX mini-editor may be replaced with the text segments entered in the
451 In order to find the next occurrence and replace it, click on the
465 Alternatively, you can use the [
481 \begin_layout Standard
482 You can replace full-featured formatted LyX segments in place of the matching
483 text segments in your document.
484 Typical scenarios in which to use this capability may be (just to mention
488 \begin_layout Itemize
489 replacing occurrences of a word with a customized formatted version of the
490 same word, for example replacing occurrences of a name like
491 \begin_inset Quotes eld
495 \begin_inset Quotes erd
498 with its monospace version
501 \begin_inset Quotes eld
505 \begin_inset Quotes erd
511 \begin_layout Standard
512 performing a notation rework of mathematical symbols, for example replacing
514 \begin_inset Quotes eld
518 \begin_inset Formula $R$
522 \begin_inset Quotes erd
526 \begin_inset Quotes eld
530 \begin_inset Formula $\mathbb{R}$
534 \begin_inset Quotes erd
537 (you may want to enable the
545 options and disable the
557 pane, in order to avoid replacing all
558 \begin_inset Quotes eld
562 \begin_inset Quotes erd
565 letters occurring in normal text), or occurrences of
566 \begin_inset Formula $x_{j}^{i}$
570 \begin_inset Formula $x_{i,\, j}$
574 \begin_inset Formula $x[k]$
578 \begin_inset Formula $x_{k}$
584 \begin_layout Section
585 \begin_inset CommandInset label
587 name "sec:Advanced-usage"
594 \begin_layout Subsection
595 About using regular expressions in the Find...
599 \begin_layout Standard
600 There is a regular expression based searching facility.
601 Users may arbitrarily insert, within text or math material to search for,
602 regexp-mode insets that allow to enter regular subexpressions.
603 This is done either through the
607 dropdown button or by the [C-S-r] key sequence.
608 Characters entered in the
613 LyX mini-editor within regexp insets are matched according to the regular
614 expression matching rules
618 \begin_layout Plain Layout
619 but under the constraint that any subexpression must match a well-formed
620 LyX text segment, i.e., when matching LaTeX code, no segments with unbalanced
621 {} braces are allowed to match subexpressions entered by the user.
626 , while text entered outside regexp insets is matched exactly against the
627 same text in the document.
628 Note that it is allowed to cut and paste regexp-mode insets as usual.
629 Examples of using such a feature may be:
632 \begin_layout Enumerate
633 Searching for all fractions with a given denominator: for example, entering
639 LyX mini-editor the fraction
640 \begin_inset Formula $\frac{.*}{1+x^{2}}$
644 \begin_inset Formula $.*$
647 on the numerator is the match-everything regular expression that may be
648 added by clicking on the
650 [Match...]->[Anything]
652 button, or entering the regexp-mode through the [C-S-r] key sequence and
654 \begin_inset Formula $.*$
657 ) finds all fractions with the given denominator.
660 \begin_layout Enumerate
661 Searching for all text with a given style: for example, after unchecking
673 \begin_inset Formula $.*$
678 regular expression and adding it an emphasized or bold face, finds all
679 emphasized and bold face text, respectively.
681 \begin_inset Formula $.*$
684 regular expression a bullet-list, enumerated or Section style, you can
685 find all bullet or enumerated lists, or section titles.
688 \begin_layout Standard
689 Finally, references to subexpressions in regular expressions may be used
690 as usual, enclosing parts of the expression within round braces
691 \begin_inset Formula $()$
694 , and referring back to them through
695 \begin_inset Formula $\backslash1$
699 \begin_inset Formula $\backslash2$
703 \begin_inset Formula $\backslash$
706 symbol is entered in regular-expression mode by pressing twice the backslash
708 For example, try searching for the
709 \begin_inset Formula $([a-z]+)[[:blank:]]\backslash1$
712 regular expression in order to find word repetitions, if any.
715 \begin_layout Standard
716 Note that back references work both when occurring within the same regular
717 expression, and when occurring in multiple different regular expressions,
718 where numbering of back-referenced sub-expressions is absolute, i.e.,
719 \begin_inset Formula $\backslash1$
722 always refers to the first occurrence of
723 \begin_inset Formula $()$
726 in all entered regular expressions.
729 \begin_layout Standard
730 Note that the use of back references in the replaced text is not (yet) implement