Specific header settings of Emacs org-mode for LaTex export

#+LATEX_HEADER: \usepackage[margin=1.0in]{geometry}
#+LATEX_HEADER: \usepackage[numbers,sort&compress,square]{natbib}
#+latex_header: \usepackage{glossaries}
#+latex_header: \makeglossaries
#+latex_header: \usepackage{setspace} \singlespacing
#+latex_header: \usepackage{enumitem}
#+latex_header: \setlist[itemize]{noitemsep, topsep=0pt}
#+latex_header: \setlist[enumerate]{noitemsep, topsep=0pt}
#+OPTIONS: d:nil ^:nil H:2 toc:nil
  • 1st line: setting all four side margins, 1 inch.
  • 2nd line: natbib setup for numbered references of which citation is sorted and compressed, i.e., instead of [1,2,3,4] it will show [1-4].
  • 3rd and 4th: nomenclature setup
  • 5th line: linespacing setup, single and double
  • 6th and 7th lines: setting line gaps between enumerated and itemized ones zero.
Posted in Uncategorized

Learn The Entire Python Language In A Single Image (link)

An interesting page that contains a single image for python language. Here.

Image link: Here

Posted in Uncategorized

How to replace the 4th occurrence of a character in a file using sed

sed -i "s/\"/ \"/4" myFile.txt

The above command will replace the 4th occurrence of by in file “myFile.txt”, which is equivalent to putting a space in front of the 4th double quote.

Posted in Uncategorized

How to change an extension of many files

In a Linux terminal:

$ for f in *.txt; do mv -- "$f" "${f%.txt}.text"; done

will rename all *.txt to *.text files.

Posted in Uncategorized

How to compile .tex file without stopping

Method 1: using pdflatex to generate a pdf file

$ pdflatex   -interaction   nonstopmode   myTexFile.tex  

Method 2: using latexmk to generate a dvi file.

$ latexmk   myTexFile.tex 
Posted in Uncategorized

How to write output values to the standard output without carriage return in FORTRAN

How to write output values to the standard output without carriage return:

program tstNoadv
 integer :: i
 do i = 1, 10
 write(*,"(A1,I6.4,$)") char(13), i
 call system("sleep 1")
 end do
 write(*,*) "Done"
 stop
end program
Posted in FORTRAn

How to make a pdf output from LyX without opening LyX file

Suppose you have a LyX file, my_thesis.lyx, in the current directory. Then, simply execute a command:

$ lyx -e pdf2 my_thesis.lyx

This will generate an output PDF file: my_thesis.pdf. If a PDF file of the same name already exists, it will be overwritten by the newly generated one.

 

Posted in Lyx