Latex space reducing hacks

  1. Reduce space above and below equations: Place following lines after \begin{document}
\setlength{\abovedisplayskip}{2pt}
\setlength{\belowdisplayskip}{2pt}

2.  Reduce space above and below section/subsection titles. Place these lines before beginning the document.

\usepackage[compact]{titlesec}
\titlespacing
*{\section} {0pt}{2\baselineskip}{3\baselineskip}
\titlespacing*{\subsection} {0pt}{2\baselineskip}{3\baselineskip}

This answer is copied from this StackOverflow link. In Springer, llncs format I found this sucks but a hack around the same is provided in this StackOverflow answer. It really works!!.

Advertisements

Side by side latex figure/table placement

1.  Place two figures side by side with separate captions and labels [copied from https://tex.stackexchange.com/a/37582/88745%5D

\usepackage{subfigure}
\begin{figure}
\centering
\parbox{5cm}{
\includegraphics[width=5cm]{img1}
\caption{First.}
\label{fig:2figsA}}
\qquad
\begin{minipage}{5cm}
\includegraphics[width=5cm]{img2}
\caption{Second.}
\label{fig:2figsB}
\end{minipage}
\end{figure}

2. Place Table and a Figure side by side.   [source:https://tex.stackexchange.com/a/265891/88745%5D

\documentclass{article}
\usepackage{graphicx}
\usepackage{capt-of}% or \usepackage{caption}
\usepackage{booktabs}
\usepackage{varwidth}

\begin{document}
\begin{table}[ht]
  \begin{varwidth}[b]{0.6\linewidth}
    \centering
    \begin{tabular}{ l r r r }
      \toprule
      Student & Hours/week & Grade \\
      \midrule
      Ada Lovelace & 2 & A \\
      Linus Thorvalds & 8 & A \\
      Bruce Willis & 12 & F \\
      Richard Stallman & 10 & B \\
      Grace Hopper & 12 & A \\
      Alan Turing & 8 & C \\
      Bill Gates & 6 & D \\
      Steve Jobs & 4 & E \\
      \bottomrule
    \end{tabular}
    \caption{Student Database}
    \label{table:student}
  \end{varwidth}%
  \hfill
  \begin{minipage}[b]{0.4\linewidth}
    \centering
    \includegraphics[width=40mm]{example-image}
    \captionof{figure}{2-D scatterplot of the Student Database}
    \label{fig:image}
  \end{minipage}
\end{table}
\end{document}

Insert Latex equations and tables in Powerpoint and Keynote

At times we need to copy the Latex equations and tables in our presentation slides prepared either in Microsoft Powerpoint or Apple Keynote. There are many options to do the same but here I will explain a simple approach

  1. Ensure that LatexiT is already installed on your machine. If it is not installed download a fresh copy from this link
  2. Open LatexiT and copy the required latex equation/table from your latex file into the LatexiT editor. Make sure that you remove- begin{table}, begin{equation} type of commands.   After copying, click on LaTeX it button at bottom right to generate equations and tables
  3. Once your equation/table is drawn, save the file using from File Menu.

There are different options for customizing the output such as font size, installing new packages.

Sustainable Energy

In Oxford dictionary sustainable means “able to be maintained at a certain rate or level.”  According to the United Nations sustainability is defined as “meeting the needs of the present without compromising the ability of future generations to meet their own needs .” The important question to ask is why we are discussing sustainable energy, and the answer is either we have limited sources of energy or we are polluting our environment at the incredibly fast rate. In fact, we are facing both of these challenges, but at the consumer level, we don’t realize these.

The major sources of energy are coal, oil and natural gas. Two major problems with these resources are they are: 1) limited and are getting depleted; this means that our future generations will face energy scarcity. 2) Coal, the main energy source emit lots of carbon dioxide, a green house gas which eventually results in the greenhouse effect. The greenhouse effect deals with heating of our climate which eventually melts the glaciers raises water levels and affects global ecosystem badly.

Sustainable energy aims to find solutions to our existing energy problem by proposing renewable energy sources which regenerate naturally and produce clean energy. These sources include solar, wind, water, biogas, geothermal energy. All these sources are inexhaustible. Sustainable energy also includes the practices of energy efficiency and conservation.

Stephen Pacala, an environment biologist at Princeton University mentions that we can handle the increasing carbon dioxide challenge with following four options:

  1. Efficiency: Develop technologies or appliances which are energy efficient
  2. Tripling our nuclear power plants
  3. Cleaning coal plants by burying carbon emissions
  4. Harnessing SUN’s energy using solar panels etc.

Eigen vectors and Eigen values

A point x in a two-dimensional space represents a vector because it has a magnitude and a direction with respect to the center (0, 0). A scalar multiplication of x represents another vector which lies on the same line (elongated or scaled down) as that of vector x.  When we multiply vector x with a matrix A, it again results in a vector but now the resultant vector will be either in the same previous direction as that of x or in a new direction. Also, the resultant vector will get either scaled up or down. If the resultant vector lies in the same direction then we say vector x is Eigen vector of matrix A, otherwise, it is not an Eigen vector. A 96 seconds youtube video explains the same concept visually.

Corresponding to Eigen vector, we too get a scalar value (\lambda) which on multiplying vector x results in the same vector as that obtained by above matrix multiplication. Mathematically,

A*x =   \lambda*x

Here, x refers to Eigen Vector and \lambda refers  to Eigen value.

 

References:

  1.  https://www.youtube.com/watch?v=wXCRcnbCsJA
  2. http://blog.stata.com/2011/03/09/understanding-matrices-intuitively-part-2/

Installing and configuring RaZberry

Follow these steps to install RaZberry:

  1. Format memory card using SDFormatter
  2. Download OS for Raspberry and burn OS image on memory card by  using Etcher software
  3. Enable display as mentioned in this post.
  4. Connect your Raspberry to Monitor and enable following in the Raspberry configuration: VNC, SSH
  5. Install screen: This will help in running scripts in the background even when ssh session disconnects
  6. Install Z-wave using instructions mentioned on Z-wave website

Enable display in Raspberry Pi

Do you want to connect your Raspberry Pi to an external display via HDMI? If yes, follow these simple steps:

  1. Install operating system on memory card
  2. Open config.txt in the memory card
  3. Search following lines and uncomment these lines:
  4. hdmi_safe=1
  5. hdmi_force_hotplug=1
  6. Now save the file and insert memory card in Raspberry Pi Module
  7. Insert one end of HDMI cable in the Raspberry Pi and other side in the monitor.
  8. Now you should be able to get GUI of Raspberry on the monitor.