How to add a custom class to lyx on Mac.

Preface: Latex is one the most sophisticated typesetting system designed for production of technical and scientific documents. If you are not using it, you do not know what you are missing. Lyx is another open source softwares which has the power and flexibility of Latex with a user friendly graphical interface.

Despite the powerfulness of the above softwares, sometimes there is compatibility issue between them. For example, adding a custom class file (<classname>.cls) written for LaTex to Lyx takes more than copy and paste. In the following the procedure for adding a cls file to Lyx is outlined:

I would like to add three more points:

1) As explained in the link, first you need to copy the cls file in your latex directory. To find your latex directory you can use the following syntax in the Terminal: kpsewhich -var-value TEXMFHOME

2) To make a layout file, you just need to open a text file and name it as <custom>.layout .

3) You also need to find your Lyx package content directory. You can find your package directory  by opening Lyx>About Lyx. There are two addresses. You need the Library directory.

Following the above procedure you would be able to import the class file into the Lyx, however, the new commands defined in the class file do not automatically appear in the Lyx menu, although you can use it as Latex command in the Lyx.

How natural is our mathematical world?

Looking at the geometry, we instantly realize that we are used to assume everything is composed of straight lines. Or the mathematical analysis is full of linear assumptions here and there. However, in reality finding a straight line or a linearly interacting system is almost out of reach. This difference may seem  abstract at the first sight. However, the effect of our mathematical assumption is perfectly vivid in manmade products, such that, by looking at a particular object we could easily distinguish manmade from natural. This deviation is clear since all of manmade products are engineered based on the mathematics that does not share the same symmetry with the nature around us.

This is also true, for our modeling. All of our models are linear interaction model, which absolutely is far from what happen in the real life. As it is nicely mentioned by Wigner, we are so lucky that our models can roughly explain what happen in the real life. Additionally, This type of thinking is not limited to the science or the engineering, but it is also extended to the social sciences such as philosophy. We should understand that sometimes what we call perfect or ideal, is not necessarly the ideal of nature around us. We should also note that what we learn in the school is not necessarily what happen in the world.

I finish this post by asking, can there be a different mathematics, more inline with the nature, where we can relax a straight line or linearity assumptions?


رعایت قانون اختیاری نیست

اخیرا موضوعی رو خوندم که توش اشاره داشت که اما بنینو، وزیر امور خارجه ایتالیا در هنگام ورود به ایران اصرار داشت که بی‌ حجاب وارد شه. صرف نظر از اینکه آیا شخص بنده با روسری اجباری موافق یا مخالفم، به نظرم کار ایشون یخورده غیر منطقی‌ و خارج از شئونات دیپلماتیک بوده، و در واقع احساسی‌ عمل کرده. از آونجایی که برخی‌ هموطن‌های ما هم دچار این مباحث میشن، دوست دارم که نظرم رو راجع به این موضوع بیان کنم.

خانوم اما بنینو باید این مساله رو درک کنه که حجاب در ایران از بحث فقهی‌ و مذهبی‌ خارج شده و به بحث قانونی تبدیل شده، و رعایت قانون بر همگان بویجه افرادی که وارد ایران یا هر کشور دیگه‌ای میشن لازم الاجراست. مثل اینکه، بر فرض داشتن سلاح تو کانادا غیر مجازه، و یه آمریکایی بگه من می‌خوام با کلتم وارد بشم.

در ادامه ظاهراً اشاره شده بود که وقتی‌ که دیپلماتهای ایرانی‌ به کشورهای دیگه میرند، کشور میزبان به احترام اونها مشروب روی میزا نمی‌گذارند. این نشان فرهیختگی اون کشوراست، ولی‌ باید باز اشاره کنم که گذاشتن شراب روی میز یه بحث عرفی در خارج از ایران هست، نه یه بحث قانونی، در حالیکه پوشیدن حجاب یک بحث قانونی در ایران هست.

اینکه حالا چرا حجاب اجباریه، و چجوری می‌شه عوضش کرد و غیره کاملا بحث‌های جدایی هستند که در جای خود باید نقد بشند. ولی‌ این نکته مهمه که درک کنیم، در هر کشوری زندگی‌ می‌کنیم، یک سری قوانین هست که ما با اونا مشکل داریم، ولی‌ مخالفت ما به ما حق عدم رعایت قانون رو نمیده. بلکه ما باید در چهارچوبهای قانونی تلاش کنیم که اون قانون به سمت بهتر شدن حرکت کنه.


There have been critical moments in our life when we wanted just to get over it, either it is an exam, or defence, or a promotion, citizenship, etc. On the other hand, this is our life which is passing by, so we want it to slowly moving forward. There is an interesting movie illustrating these two competing features of our daily life: . The style of movie is a little bit childish, however, the bottom line message is for all adults. I encourage everyone to watch this movie. Here is my my favourite quotes from the movie:

1) it seems that whatever I do, I disappoint someone. You have to make sure that you are not disappointing the wrong people.

2) they are Japanese, they can’t wait for a fish to cook.

How to teach a (physics) course: Feynman’s view

During my graduate studies, I was fortunate to study at different universities in different countries, and I started to develop a rough guideline for myself on how to teach a course or write a lecture note. I took almost 15 graduate courses on different topics on mathematics, physics, earth science, electrical engineering, and computer science in Canada. During these years, I have listed whatever I found annoying in different classrooms, to make sure that I would not repeat it myself.

Recently, I came across an interview with Feynman on origins of “The Feynman lectures on physics”, in the book entitled “Feynman’s Tips on Physics: Reflections, Advice, Insights, Practice“. I have the older version of this book which, unfortunately, does not have those interviews with authors of the books. It is a fun book and I encourage everyone who is passionate about teaching physics to read it.

My list of guidelines has a lot in common with what Feynman pointed out, although it does not exhaust my list, he pinpointed the main concerns. I hope that every teacher would take into account these points before going to classroom.  I will present the point (more or less) the same way Feynman explained in his interview:

1) Do not teach anything that you have to teach over again because it was wrong, unless you pointed out it was wrong. For example, if the Newton equation is approximate, inform students from the beginning about the range of validity of every equation.

2) The lectures should be enough for advanced students, also an average guy should understand it, so  try to invent.

3)  There should be clear distinction between what is understandable from what has been taught so far, and what is not.

4) Ensure that each lecture stand by itself. It is not a good idea to say that, the time is up and we will continue this discussion next time.

A tribute to Aaron Swartz.

Aaron Swartz is a symbol of a young generation who is fighting against all the cruelties of our governing systems imposed on us, instead of protecting us from bullies. Probably, the worst set of laws are made for saving, distributing, and using the information made by us for us, particularly scientific literatures. Scientist probably is lowest paid group of professionals compared to artists, athletes, and journalists. As a scientist, I share the same concerns with Aaron about open access guerilla.

This post is tribute to Aaron, and I encourage all of you to read his “Guerilla Open Access Manifesto“.

Gender equality in Persian language.

I believe that language is the first intellectual creation of human being. Looking at different languages, there are several similarities and differences. One of those similarities between many languages such as English, French, and Arabic is that they are gender biased. It means that making a non gender biased statement is almost impossible. There are always some prefix or suffix to determine the nature of the “subject” or “object” as masculine or feminine.

In persian language you do not have this issue. There is almost no determinator of gender in the verbs, names or adjectives. So, each sentence is equally applicable to both males and females unless it is specified. I believe that this fact refers to the gender unbiasedness of ancient Persians. I do not have much studies in this field, however, I am planning to read more in this direction to understand better the issue of gender (in)equality in different languages. So, stay tune.

Every person is innocent but a suspect!

The most common legal right of a human being is the presumption of innocence, which means, one is considered to be innocent until proven guilty. I think, the interpretation of this principle is very tricky nowadays. There are several approaches and attitudes toward this principle for national and international securities. Previously, innocence of citizens was assumed, so no one had the right to collect personal and interpersonal information without the person’s permission.

However, the new approach, apparently, is that, everybody is innocent but a suspect! Hence, all the information should be gathered in order to prove the sin when it is necessary. Facebook, google, yahoo, and almost all other online and offline companies are basically carriers to transfer our information for marketing and, of course, other purposes. Thanks to Snowden we are well aware of other purposes of this stored information. Very soon there will be a time when everybody is living in a society with transparent walls (of course, transparent only to some people) and is analyzed by people who can see through them. Not long from now, the information of our living habits would be a tool in governments hands not only to control us but also to shape our behaviour, in the direction of their interests.
We are already living in the era of pre-determined paradigms such that we believe those paradigms are discovered by us, and we have no doubt about them. For example, the idea of success, patriotism, human rights, work, education, etc. In future, or maybe already, paradigms will be also shifted by the governors, while it is believed by the people of the society that they are responsible for making the shift (like “The Truman Show”). It is a simple strategy: people act based on their beliefs. By controlling and manipulating the belief system, one can control everything while giving a false impression that there is no control. I would call this new era: the era of ” adiabatic paradigm shift”.