Adding envelope symbol for corresponding authors in LaTeX documents

Use the package ifsym

\usepackage{ifsym}

and then you can use the command

\Letter

which works as regular text, not as math. This means you have to make sure you are using regular text where you put the envelope symbol to appear

\author{Yo Mero$^{\textrm{\Letter}}$}

In other words, if you use

\author{Yo Mero$^\Letter$}

a different symbol will appear in your document.

To make it easier to write, you can create a new command like

\newcommand{\corrAuthor}{$^{\textrm{\Letter}}$}

 

Advertisements

Calculating (rational) roots of negative numbers in python

It is not possible to calculate the cubic root of a negative number in python using regular functions from scipy and sympy. Here is a quick and dirty solution for the problem using scipy. An analog can be written using sympy.

import scipy as sc

def rationalPower(x,r=1/3.0):

    y = sc.absolute(x)**r

    z = sc.int8(x<0)

    return (1-z)*y – z*y

Examples:

>> rationalPower (-8)

-2.o