Below you will find pages that utilize the taxonomy term “RegEx”
Automatic generation of hyperlinks in LaTeX environment, using Vim's Regular Expressions, between PDF documents.
Vim is an editor with endless capabilities. It can also generate hyperlinks in LaTeX language to other locally stored documents, thanks to its built-in Regular Expressions. For lawyers, this means linking a legal document with its related evidentiary materials. This is the analysis of the procedure.
- 1. Subject of this article.
- 2. Main document configuration.
- 3. RegEx formula for automatic link generation.
- 4. Explanation of the RegEx formula.
- 5. Management of “underline character”.
- 6. Links within the text
1. Subject of this article.
Sometimes it is necessary to include in a main PDF document a list of documents to be retrieved with specific hyperlinks dedicated to each item in the list.
Vim Is Magic or Nomagic?
What’s this joke?
The title is a joke with the name of “V.I.M.” but, at the same time, it’s a real mode of Vim itself: the Magic Mode.
To understand what Magic Mode is, the primary source is the item :help magic
in Vim.
In a few words:
- The Magic Mode refers to the regular expressions
- The Magic Mode is enabled by default in Vim.
- You can explicitly invoke the Magic Mode with the
\m
command in the RegEx search area. - To deactivate it you must set
\M
(capitalized m) in the RegEx search area. - When you use the
\M
command you invoke the Nomagic Mode. - Nomagic Mode turns “almost all special regex symbols into ordinary ones unless they start with a backslash”.
- There is also a Very Nomagic Mode that extends the effect to other characters, not relevant to this article.
When is magic mode (default) better than nomagic?
To analyze the difference between magic and nomagic mode, I resume a formula from a previous article of mine.
Vim: study on transposing lists of names from horizontal to vertical
Primary purpose of the study.
- Initial status: series of inline names, separated by a semicolon followed by a space.
- Objective: Transpose all names into one column by removing both semicolons and spaces.
- Purpose: Creating list for mail-merging with e-mail client (Thunderbird).
- Tools: Vim and built-in RegEx function.
- Example:
Secondary goal
To test the integration between Markdown and css tags.
Comparison of Vim and Emacs for a substitution operation using regular expressions
Preface
This article is a summary of two previous posts that you can read at these pages:
- “Vim: Study on constructing Regular Expressions to delete or reduce blank lines with Global Command”
- “Emacs: Study on constructing Regular Expressions to delete or reduce blank lines”
The topic of “regular expressions” in Vim and Emacs is well suited for a functional comparison across the four different scenarios covered in the above articles to which I refer for a description of the syntax.
Emacs: Study on constructing Regular Expressions to delete or reduce blank lines
After writing an article focusing on “Vim: Study on constructing Regular Expressions to delete or reduce blank lines with Global Command” I tried to match with a similar operation with Emacs.
The goal is to study the differences in syntax related to “regular expressions” between two writing systems.
The following is the result of my attempts after various searches on the net.
Removing blank lines in Emacs using RegExp
First of all, it may be useful to display the blank lines in the document.
Vim: Study on constructing Regular Expressions to delete or reduce blank lines with Global Command
Preface
On the topic of this article you may find interesting the following one: “Vim and Regular Expressions for removing redundant whitespace”.
Unlike the previous article, here the presence of whitespace causes different solutions than blank lines regardless of the number of their occurrences.
The study in this article is focused on both the analysis of “regular expressions” and Vim’s global command.
Vim and the Global Command
The Global Command in Vim is the g
key.
Vim and Regular Expressions for removing redundant whitespace
Introduction and structure of the article
I wrote this article to practice “in situ” formula construction of Regular Expressions also called RegEx in Vim.
In particular, the goal is to “clean up” documents with excess whitespace at both the beginning and end of each line.
A basic knowledge of Vim and the Regular Expressions built into the editor is sufficient for understanding the article.
The various formulas are applied to whole documents but, since they are very normal search commands in Vim, they can be applied to individual rows or to specific ranges of rows in the context of the document.
Animated GIFs about basic RegEx in Vim and Emacs
A non-preface about RegEx
In my little experience as a LaTeX writer using Vim and Emacs, I sometimes use the extraordinary efficiency of RegEx, also known as RegExp or “Regular Expressions”.
Vim and Emacs, provide built-in support for RegEx.
I’ll show you in the following clips some elementary uses of regex in both editors.
The software developer community will smile, but the following animated GIFs are intended for writers, not computer programmers.