I use LaTeX to assign algorithms, and I need to show the steps for the Horspool algorithm to match strings, similar to what is shown in the tutorial. The way he demonstrates the algorithm shows how the pattern is shifted along the text for each failed comparison, with each shift on a new line. The figure is shown below the text with the corresponding horizontal spacing indicating which letters are compared.
Here is an example of how it would look with a DNA sequence:
GAGTAATCCTTCACTTCAAGGCCAGTCTTCACATCTCATCAGA ACATCTCA ACATCTCA ACATCTCA ACATCTCA
I talked a few links to LaTeX. I tried using \hspace to add an interval at the beginning of each line, then adding \hfill after the pattern and before creating a new line. I do not get any errors, but there is no place at the front. The line is filled correctly.
Is there another way to add a space at the beginning of each line or another way to format this?
formatting latex spacing
Feanor
source share