This is not a blog, but my notes and tips for research. Feel free to take any information and leave any comments or questions.
Search This Blog
Wednesday, March 23, 2016
Adding latex template in Ubuntu
Make a new directory for
Class files under
/usr/share/texlive/texmf-dist/tex/latex/
BST files under
/usr/share/texlive/texmf-dist/bibtex/bst/
STY files under
/usr/share/texlive/texmf-dist/tex/latex/
Tuesday, October 6, 2015
Friday, September 18, 2015
pdfcrop with margins
http://askubuntu.com/questions/124692/command-line-tool-to-crop-pdf-files
If you wish to crop a pdf with left, top, right and bottom margins of 5, 10, 20, and 30 pt (points), then run
pdfcrop --margins '5 10 20 30' input.pdf output.pdf
in terminal. To actually crop something away, use negative values in the argument for crop. For example,
pdfcrop --margins '-50 -50 -50 -50' input.pdf output.pdf
crops 50 pts from the left, top, right, bottom (in this order).
If you run only the command
pdfcrop input, it will output a file titled input-crop.pdf with zero margins. I find this very handy when including pdf illustrations in documents.
Cropping multiple files
Unfortunately, pdfcrop cannot crop multiple files at the time. It is however easy to write a script that will crop all pdfs in the folder the script is located in.
Create a new empty file, and call it
something.sh. Open it with a text editor and insert the following:#!/bin/bash
for FILE in ./*.pdf; do
pdfcrop "${FILE}"
done
Save it, and close. Then right click the file, go to Properties > Permissions and check the field Allow executing file as program. Now close the dialog. Run the script by double clicking it and choosingRun in Terminal. And new, zero-margin cropped version of all pdfs with suffix -crop will now be printed in the folder. If you want margins or other things, you can of course just open the script and add arguments after
pdfcrop.Saturday, September 12, 2015
linear regression matlab script
function [p,Rsq] = LinearRegression (Xin,Yin)
% LinearRegression example
% x=0:1:9;
% y=3.0 * x + 7 + rand(1,length(x)) ;
% [p,Rsq] = LinearRegression (x,y) ;
% yfit = p(1)*x + p(2) ;
% plot(x,y,"o",x,yfit) ;
p = polyfit(Xin,Yin,1);
Yfit = p(1) * Xin + p(2);
Yresid = Yin - Yfit;
SSresid = sum(Yresid.^2);
SStotal = (length(Yin)-1) * var(Yin);
Rsq = 1 - SSresid/SStotal;
% LinearRegression example
% x=0:1:9;
% y=3.0 * x + 7 + rand(1,length(x)) ;
% [p,Rsq] = LinearRegression (x,y) ;
% yfit = p(1)*x + p(2) ;
% plot(x,y,"o",x,yfit) ;
p = polyfit(Xin,Yin,1);
Yfit = p(1) * Xin + p(2);
Yresid = Yin - Yfit;
SSresid = sum(Yresid.^2);
SStotal = (length(Yin)-1) * var(Yin);
Rsq = 1 - SSresid/SStotal;
Wednesday, September 9, 2015
lyx shortcuts
https://pepebioinformatics.wordpress.com/2014/03/06/lyx-keyboard-shortcuts/
LyX Keyboard Shortcuts
- ⇧ + ⌘ + L -> Insert Label (label-insert);
- ⌘ + L -> Insert ERT (ert-insert);
- ⇧ + ⌘ + G -> Insert Graphic (dialog-show-new-inset graphics);
- ⇧ + ⌘ + FF -> Insert FloatFigure (float-insert figure);
- ⇧ + ⌘ + FT -> Insert FloatTable (float-insert table);
- ⇧ + ⌘ + P -> Typewriter font;
- ⇧ + ⌘ + C -> Insert Cross-reference (dialog-show-new-inset ref);
- ^ + A + [C, L or R] -> paragraph-params \align Center, Left or Right;
- ⌘ + E -> Italic (font-emph);
- ⌘ + B -> Bold (font-bold);
- ⌘ + M -> Insert Math (math-mode);
- ⌘ + ⇧ + R -> Refresh Run
- ⌘ + R -> Run
- ^ + P + [*] + [234]; layout [without numbers] [S/SubS/SubSubS]
Thursday, August 20, 2015
Netgen on Mac
Netgen installation on Mac is hopeless.
It is better to use Ubuntu virtual machine or Windows laptop.
It is better to use Ubuntu virtual machine or Windows laptop.
Tuesday, August 18, 2015
Netgen command line approach
This works for version 4.9 but does not for 5.3.1 (only GUI mode).
$ netgen -batchmode -geofile=cone.geo -meshfile=cone.ng -coarse
$ netgen -batchmode -geofile=cone.geo -meshfile=cone.ngn -meshfiletype="Neutral Format"
The possible mesh size options are
-verycoarse
-coarse
-moderate
-fine
-veryfine
$ netgen -batchmode -geofile=cone.geo -meshfile=cone.ng -coarse
$ netgen -batchmode -geofile=cone.geo -meshfile=cone.ngn -meshfiletype="Neutral Format"
-verycoarse
-coarse
-moderate
-fine
-veryfine
Subscribe to:
Posts (Atom)
Labels
- Academic Notes (4)
- BLAS (1)
- CEE618 (2)
- CentOS (1)
- Computation (1)
- Conferences (1)
- Cross compiling (1)
- Graphics (1)
- Hawaii Tour (2)
- Intel compiler (1)
- Just (1)
- Laptop (1)
- LaTex (22)
- Life and Humanity (8)
- Linux and Computing (107)
- LSF (1)
- Lyx (3)
- Macintosh (5)
- MPI (1)
- News (11)
- OpenFoam (1)
- OpenMPI (1)
- PBS (2)
- Software (4)
- SSH (2)
- torque (1)
- Touchpad (1)
- VMD (1)
- yum (1)