Running Latex using Docker

A simple way to compile your latex files without installing a latex-distribution is the usage of a docker-container. Thanks to https://github.com/blang/latex-docker it is easier than ever.

Within your directory with your article.tex invoke:

docker run --rm -i --user="$(id -u):$(id -g)" --net=none -v "$PWD":/data blang/latex xelatex article.tex

The current directory is mounted into the container and thus the latex executable within the container can access the source files (xelatex article.tex) and the results are placed in the current directory too.

Advertisements

Running TiddlyWiki using Docker

Thanks to https://github.com/djmaze/tiddlywiki-docker it is easy to launch a TiddlyWiki as nodejs-server from a docker image. Here is my setup, which simplifies the workflow by some bash-aliases.

Setup

In ~/.bash_profile define

# /Users/MyUserName/wikipath defines the mounted wiki directory
alias starttiddly="docker run -d --name tiddlycontainer -p 127.0.0.1:10000:8080 -v /Users/MyUserName/wikipath:/var/lib/tiddlywiki mazzolino/tiddlywiki"
alias stoptiddly="docker container stop tiddlycontainer && docker container rm tiddlycontainer"

Usage

  1. Start a bash-terminal and invoke starttiddly to start the server
  2. Open your browser at http://localhost:10000 and work with tiddlywiki (the default login is user/wiki)
  3. After usage shutdown the container by invoking stoptiddly

Update: Of course you can also use docker run -rm...to remove the container after running. This will shorten the stoptiddly-script.

Latex: Alignment of a fixed-width column in the tabular-environment

Based on the post even fixed-width columns can be aligned.

\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{babel}
\usepackage{array}
\begin{document}
% Centered fixed-width column
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
% Right-aligned fixed-width column
\newcolumntype{R}[1]{>{\rtab\arraybackslash}m{#1}}

\begin{tabular}{C{2cm}R{2cm}}
\hline
Ein etwas langer Text, der sicherlich umbrochen wird & a\\
\hline
oder kurz & b\\
\hline
\end{tabular}
\end{document}

How to develop your IntelliJ IDEA plugins even faster with JRebel

Back in my NetBeans times I wrote several articles (1, 2) about using Zeroturnarounds JRebel to develop NetBeans plugins faster by not restarting nor reloading the whole target-platform. JRebel is a Java agent, so it can be used with nearly every Java-based application. Even for developing IDEA plugins. And here is how you do it:

One-Time-Setup

  1. Buy a JRebel license or get a free one for your open-source plugin at myRebel
  2. Install the JRebel plugin for IDEA from the plugin manager (for bundling JRebel, a configuration UI and debugging support)
  3. Activate the plugin using the license from step 1
  4. Update the your Run- or Debug configuration with the Java agent configuration – based on the standard documentation)
    For example: -agentpath:/Users/markiewb/Downloads/jrebel/lib/libjrebel64.dylib
    runconfiguration

Every-day-workflow

  1. Run / debug your plugin using the configuration created above – JRebel should show its banner and an IDEA instance should load
    banner
  2. Edit your Java sources as normal and when you want to get the changes reloaded then compile the project/all the changed files (thus the sources are compiled into class-files and JRebel can pick up the changes)
  3. Reinvoke your plugins actions (or what ever) in the target platform – your changes should be picked up

Notes

Note 1 Not all changes will be picked up. JRebel does not have yet official support for this usage scenario. Especially changes in the plugin.xml won’t be picked up. But within existing or new Java classes you can code and refactor as much as you like!

Note 2 If you are on Mac OS consider to install JRebel separately. I had issues to set the Java agent with the bundled JRebel from the JRebel IDE plugin. Do you see the culprit in -agentpath:/Users/markiewb/Library/Application Support/IntelliJIdea2017.2/jr-ide-idea/lib/jrebel6/lib/libjrebel64.dylib? The whitespace!

Note 3 Of course this also works when you write plugins for the other Java based IntelliJ platform IDEs like WebStorm, PHPStorm and so on.

IDEA: Navigator plugin for GWT

Within the last two days I wrote a new plugin, which allows you to jump faster between files of GWT services.

Using IDEAs “Related symbols” action you can jump from the async method in the interface to its implementation and vice-versa – all based on filename conventions and it is nice example of a GotoRelatedProvider.

Here you jump between files:

Here you jump between methods of files:

https://plugins.jetbrains.com/plugin/9912-navigator-extension-for-google-web-toolkit

This plugin requires the community edition of IntelliJ IDEA.