Posts

Place side-by-side or overlapping images in GIMP with automatic Container adjustment

Image
1 What is GIMP? 2 Side-by-side and overlapping images 3 Canvas (Container) larger than the overall image 4 Overall image larger than the Canvas (Container) 5 Exporting the result 1 What is GIMP? GIMP is an excellent cross-platform image editor: Windows, macOS and any GNU/Linux distribution. It is a full-featured software, strictly open-source and free. Perfect for trying to create a “collage” of overlapping or side-by-side images, even with different sizes, and export the result as a single image in .jpg or .png format. 2 Side-by-side and overlapping images I have repeatedly needed to “blend” several images side by side or overlapping. The advice that is usually given on the net for such an operation in GIMP involves adding by hand the space in the “Canvas” necessary for inserting the images following the first one. For example: after opening a 100x100 px image in GIMP, to place another one of the same size next to it, it is usually advised to create an add...

Converting documents from the .tex format of LaTeX to the .docx format of MS Word

Image
Table of Contents 1. Preface on LaTeX and MS Word 2. Conversion through htlatex . 3. Conversion through Pandoc 4. Document export examples 1. Preface on LaTeX and MS Word I have been using LaTeX for about thirty years to write documents of all kinds: court documents, reports, research, projects and more. After overcoming the challenging initial learning curve, therefore, it is very unlikely that one will go back to "traditional" word processing systems: the extraordinary typographic quality and considerable time savings have become indispensable. Sometimes, however, it is necessary to exchange material written in LaTeX to friends and colleagues who have not yet had the opportunity to appreciate it. In such cases, it is necessary to convert the text into readable word processing software format. Mainly I am referring to the .docx format, typical of MS Word but also readable by other similar systems, such as LibreOffice Writer that I used for this...

Converting from Org Mode to Markdown GFM

Image
Converting from Org Mode to Markdown GFM Table of Contents 1. Does it make sense to talk about Org Mode instead of Markdown? 2. The export problems 3. Some examples to make it clearer 4. The solution: export from Org-Mode to Markdown via Pandoc with GFM option. 5. The special case of exporting code blocks. 1. Does it make sense to talk about Org Mode instead of Markdown? Why should I use Org-Mode to write articles to be published network in Markdown format? Wouldn't it be more convenient to write the articles directly in Markdown? The question is more than justified and the answer is not obvious. First, let me remind you that Org-Mode is a mode of GNU/Emacs. While there are various plugins for other editors, including Vim, none of them can match the outstanding efficiency of the original system. So: to write in Org-Mode, it's best to must use GNU/Emacs. Org-Mode is a complete and extremely powerful structured writing system, alth...

Vim - VimTex, Emacs - AucTeX: create environments in empty fields

Image
Table of Contents 1. Subject of this post 2. Add environment tags in LaTeX to empty objects using Vim 3. Add environment tags in LaTeX to empty text using Emacs and AucTeX 4. Vim vs Emacs, or VimTeX vs AucTeX 1. Subject of this post This post is a follow-up to my previous one named " Vim, VimTex: environments and commands in LaTeX " in which I described the creation of environment tags in the LaTeX language through Vim's "surround.vim" plugin. Specifically, I described how to add environment tags to words and lines objects non-empty , that is, starting from already existing text. If you need a reminder about the concept of "line" in Vim, you can refer to this article of mine: "What is intended by "line" in Vim? How to configure a dual alternate mode of movement between lines? " Here I will add some considerations about tags for environments in LaTeX by using Vim, but now in empty objects , that is, ...

About Vim and the Global Command

Image
Vim and the Global Command: basic structure This post is not a complete review of Vim's Global Command but is just a series of personal observations on it. You can find a good review, written by those who know much more about it than I do, on this page . With the “Global Command” of Vim ( g ) you can replicate various ex-commands on multiple lines. The basic structure of the Global Command is very simple: :g/pattern/command , meaning: : activates the “command mode”. g activates the “global command”. /pattern/ is the “search zone” for matching patterns in the document. /command/ is the command applied to the entire lines where the results are. The basic structure is, therefore, biphasic: an initial search phase and a command phase. To demonstrate how this structure works, let’s assume the existence of the following lines: abc def ghi jkl mno If you want to delete the line containing the “a” letter, you can use the following command :g/a/d in which: : is th...

Vim, VimTex: environments and commands in LaTeX

Image
Vim, LaTeX and VimTex: surround commands Table of Contents 1. A smart system for writing 2. VimTex Built-in functions for environments and commands 3. Create a surround function in VimTex based upon surround.vim plugin 1. A smart system for writing Vim is a great editing tool. LaTeX is a "State of the Art" typesetting system. Vim and LaTeX together make a powerful writing system, but an add-on is needed to relate them. VimTex provides exactly that target by relating Vim to LaTeX, and it does its job very well. So Vim and VimTex is a smart system for every kind of writer in LaTeX. The topic is vast and certainly cannot be contained in a short post like this one. In this article, I simply cover functions for managing environments and commands. 2. VimTex Built-in functions for environments and commands I assume that those who use LaTeX already know the difference between commands and environments. VimTeX ha...

Vim Is Magic or Nomagic?

Image
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 . It’s the Vim RegEx formula for...

Markdown in Firefox

Image
Abstract Use Mozilla Firefox as a Markdown documents viewer written on Linux Ubuntu, Fedora and Arch, with mention of MS Windows and macOS. Mozilla Firefox and the Markdown layout Mozilla Firefox, one of the best Internet browsers, does not natively read documents written in Markdown. If you try to open a document written in Markdown, the browser asks whether it should save it locally or open it with an application among those offered by the operating system. But it doesn’t render the document. It is necessary, therefore, to use an add-on plugin to view a Markdown document in rendered mode within the navigator. An excellent plugin is Markdown Viewer Webext . In addition to displaying content written in Markdown, the component makes available a pop-up table of contents that also allows you to choose the style ( default and github ) and download the HTML version of the document locally. I did, however, have some problems to install the component under GNU/Linux, especially on...

Vim, UltiSnips and Honza vim-snippets: difference and management of the snippets and UltiSnips folders

Image
What is the subject of this article? In this article I will talk about Vim, snippets powered by SirVer UltiSnip : “ the ultimate solution for snippets in Vim ” and Honza vim-snippets (hereafter also simply referred as “honza”). For some more information you can refer to this previous article of mine . SirVer UltiSnip is a plugin to launch and manage snippets in Vim. The application does not contain snippets but you can create your own by following the plugin syntax or use a collection of ready-made snippets. Honza vim-snippets contains an extensive collection of snippets for various languages. In fact into the Honza GitHub repository you’ll find two separate collections of snippets for the same languages. What’s the difference about them? This is the argument we are going to talk about in this article. All operations were performed on a computer running the GNU/Linux operating system. Honza and the snippets collections In the Honza vim-snippets GitHub repository you will...

Vim: study on transposing lists of names from horizontal to vertical

Image
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 : From: One@mail; Two@mail; Three@mail; ... To: One@mail Two@mail Three@mail ... Secondary goal To test the integration between Markdown and css tags. This objective was accomplished in the Example above by inserting the following code: <p style = "text-align: center; font-weight: bold;" > Da: </p> <pre> One@mail; Two@mail; Three@mail; ... </pre> <p style = "text-align: center; font-weight: bold;" > A: </p> <pre> One@mail Two@mail Three@mail ... </pre> Vim: regular expression for the primary target To obtain the transposition from horizontal to vertica...

Vim: replace text in all opened buffers with only one command

Image
Vim: do you need to replace some text in all opened buffers? Do You need to perform a substitution between two words or text fragments in all opened buffers? The first option is to open all the buffers and perform a search with substitution in each of them. The search and replace string will look like the one below, where foo will be the data element to be replaced and bar will be the replaced data element. %s/foo/bar/g The letter g at the end of the string determines the g lobal substitution avoiding the acceptance for each replaced element. Vim: is it possible to perform the operation with a single command? The one previously illustrated is already a good system, but you can do better: you can replace all items in all documents opened in Vim with a single command . The command is as follows: :bufdo %s/foo/bar/g | w Basically, the bufdo command extends the operation to all open buffers. The name itself is mnemonic from: buffer do , meaning to do in every buffer . The...