Change latex output paper size in Mac OS
sudo texconfig-sys
at the terminal and select the default paper size.
How to set up Unison over SSH for file synchronization between Windows XP and Ubuntu
In Windows XP:
First, install Unison.
1. download Unison pre-compiled binaries for Windows from
http://alan.petitepomme.net/unison/index.html
no installation is required.
2. Check if there is an GTK folder in the directory C:\Program Files\Common Files\.
If not, download and install GTK+ Rev (Pidgin GTK+, at least version 2.12) from
http://sourceforge.net/projects/pidgin/files/
You also have to add C:\Program Files\Common Files\GTK\2.0\bin
to the system PATH variable in the system settings:
(a) right click "My Computers", select "Properties"
(b) In "Advanced", select "Environment Variables"
(c) In "System variables", select to edit "Path"
(d) Add the new path to Path
Now Unison should work. If you start Unison, you will be asked to
select an existing profile or create a new one. We will talk about
the profile later.
Next, install PuTTY.
1. download Windows installer for everything except PyTTYtel from
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
install PuTTY. Then putty.exe, pageant.exe, puttygen.exe and plink.exe are installed.
2. download a ssh2plink.bat from
http://twiki.org/p/pub/Codev/UnisonKeySetup/ssh2plink.bat
or you can create a batch file named ssh2plink.bat containing following commands:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@echo off
rem fix ssh args to be compatible with plink (putty)
rem Required for Unison synchronisation over ssh.
rem Following options are probably compatible:
rem -l name, -[1246AaCiNstTvVxX]
rem incompatible:
rem -p nnn (replaced by P); -e none (no equivalent)
setlocal
rem Edit this to point to your location for plink.exe
set PLINKEXE=P:\apps\putty\plink
set ARGLIST=-ssh
:nextarg
if "x%1" == "x" goto doneargs
if NOT "%1" == "-p" goto checkesc
rem plink uses upper case P to flag port number
set ARGLIST=%ARGLIST% -P %2
shift
shift
goto nextarg
:checkesc
if NOT "%1" == "-e" goto useit
rem unison likes to include "-e none" which plink does not support.
shift
shift
goto nextarg
:useit
set ARGLIST=%ARGLIST% %1
shift
goto nextarg
endlocal
:doneargs
%PLINKEXE% %ARGLIST%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3. In ssh2plink.bat, change the directory of PLINKEXE to your own directory.
For example, if your plink.exe is under "C:\Program Files\PuTTY", you can modify it to
"set PLINKEXE=P:\Program/ Files\putty\plink".
Note that if there is any space in the directory, you have to use "/ " instead of " ".
4. put the ssh2plink.bat in the same folder with the Unison execution file.
Third, edit the profile in Unison.
1. Find the directory of the default profile: default.prf.
Typically it locates in "Documents and Settings\username\.unison"
2. create a new profile, say, music.prf containing
sshcmd = ssh2plink.bat
root = C:\music
root = ssh://UsernameonUbuntu@ipaddress/home/music
sshargs=-pw password
In the above, the second line is the local directory that you want to synchronize.
The third line is the second directory you want to synchronize on your Ubuntu machine
with its ip address and your login name.
The last line is the password corresponding to the usernameonubuntu on Ubuntu.
We are done with Windows.
In Ubuntu:
1. Install Unison and openSSH server for Ubuntu.
You can install them by using Ubuntu's package manager.
2. Start SSH server on Ubuntu by command:
Sudo /etc/init.d/ssh start
Now you can run your Unison on your Windows machine. It shoud work!
Print from Opera Browser in Ubuntu
Open File->Print, select Printer Program tab. Fill in: program=lpr and
parameter=-P
. No space between -P and ,
e.g., if your printer's name is PDF-Printer, then parameter = -PPDF-Printer
pdf editor in Ubuntu
flpsed is a useful app that allows you to edit postscript. It can import and export PDF files (i.e., convert pdf to ps using pdftops or convert ps to pdf). Therefore it can be used as a PDF editor as well. You could use it to add text to existing pdf documents, to fill out forms etc, without using Acrobat Distiller, or its equivalents available for Windows and Macs.
PrimoPDF --- Free PDF generator in Windows OS
PrimoPDF is a free tool for high-quality PDF creation, comprising a user-friendly interface that enables printing to PDF from virtually any Windows application. Additionally, PrimoPDF provides the ability to optimize PDF output for screen, print, ebook, and prepress, secure PDF files with 40- or 128-bit encryption, and add document information (e.g. title, author, subject, keywords) to converted PDF files.
http://www.primopdf.com/
An introduction to command line editors
Written by Jem Matzan
At some point in your GNU/Linux or BSD adventures, you're going to have to use a command-line text editor. Some of them are pretty easy to use but have few features. Others are powerful but require a study session with the tutorial file to learn how to operate them. Most often you just need a text editor to edit a couple of config files and don't want to spend 45 minutes working through a tutorial. How about a crash course to get you going?
All text editors share two common qualities: they will open a file if you type its path and name in after the program name, and they will reserve changing the file until you tell it to. So to edit your /etc/shells file with any of the editors in this article, you'd type something like this:
nano /etc/shells
or if you're already in the /etc directory, you can forgo the path:
nano shells
Once in the editor, none of your changes will be applied until you save the file. If you try to quit before you've saved the file, the editor will usually ask you if you want to save it first.
The easy ones
In GNU/Linux, you can sometimes find simple command line text editors like Pico and its GNU brother Nano.
Pico is an acronym for the PIne COmposer -- Pine being a command-line email client that is sometimes installed by default in GNU/Linux distributions. If you have Pine, you have Pico. Pico and Nano share most of their commands, and are pretty easy to use:
* To save a file, press Ctrl-o
* To quit, press Ctrl-x
* To perform a simple search, press Ctrl-w and type in the search string
You do not have to do anything to start editing text once the program is open -- just start typing as you would in a word processor. If a line is too long for your terminal window, it will have a $ at the end of the line and you'll have to use the arrow keys to scroll over to the latter portion of the line. You can also move down to the line below the extended line and hit the left arrow, which will bring you to the last character in the previous line.
You'll probably notice that the most important commands are listed in a bar at the bottom of the terminal screen, so if you forget what command does what, you can glance down and find out.
FreeBSD has a simple editor called ee in the base system, and it's extremely easy to use. Just press the Escape key and a menu will pop up offering you various file functions. To get rid of the menu, hit the Esc key again. As with Nano and Pico, you just start typing once the program is open.
To start Nano, Pico, or ee, just type its name in lowercase letters at the command line and press Enter.
vi and Emacs all over
The vi editor is practically universal, especially in the Unix and BSD worlds. Many operating systems package either vi or an enhanced edition of vi -- usually Vim -- with their base system. vi is much more difficult to learn and use than Pico, Nano, or ee, but it is able to do more. Many people use vi as a tool for writing and editing programs and Web pages and composing email as well as everyday editing.
Unlike the easier editors, vi won't let you start typing right away. Here are the commands you need to know to use vi and Vim for quick editing jobs:
* Press i to enter "insert mode," which allows you to type and erase text
* Press Escape to exit "insert mode"
* Press colon and then type w and press Enter to save a file, as in:
:w
* Press the d key twice to delete a line
* Press the / key and then enter a search string to perform a search
* Press the o key to skip to the next line, insert a line break, and enter "insert mode"
* Type in :q and press enter to quit
* To save and then quit, type :wq and press Enter
* To quit without saving, type :q! and press Enter
Remember to exit insert mode before you try to execute other commands.
Emacs is a similarly archaic editor, but its command execution structure is totally different. Instead of typing letters or prefacing a command with a colon, Emacs works with key combinations. Once you open a file you can just start typing and editing, so it's a little bit easier to use if you're not used to complex text editors. Here are the pertinent commands:
* Press Ctrl-x and then Ctrl-s to save a file
* Press Ctrl-x and then Ctrl-c to quit
* Press Ctrl-s and then type in a search string to perform a search
Vim, vi, and Emacs are all started from the command line by typing their name in lowercase letters and pressing Enter. If lines are too long for the screen, Emacs will put a \ at the end of the line and continue it below the line. vi will not mark the end of the too-long line, but will continue it below that line.
Merge several pdf files into one
PDFjam is a small collection of shell scripts which provide a simple interface to some of the functionality of the excellent pdfpages package (by Andreas Matthias) for pdfLaTeX. At present the utilities available are:
* pdfnup, which allows PDF files to be "n-upped" in roughly the way that psnup does for PostScript files.
* pdfjoin, which concatenates the pages of multiple PDF files together into a single file
* pdf90, which rotates the pages of one or more PDF files through 90 degrees (anti-clockwise).
In every case, source files are left unchanged.
A potential drawback of these utilities is that any hyperlinks in the source PDF are lost. On the positive side, there is no appreciable degradation of image quality in processing PDF files with thse programs, unlike some other indirect methods such as pdf2ps | psnup | ps2pdf (in the author's experience). [Better than the rather indirect approach taken here would be filters that work directly on the PDF code, to produce output files with hyperlinks intact.]
These tools are designed for Unix-like systems, including Mac OS X. I am told that pdfnup works fine also on Windows computers with MikTeX and the cygwin unix tools; I know of no reason why pdfjoin and pdf90 should not also work in that way.
An alternative set of PDF manipulation tools, which are java-based, is provided by the Multivalent project. They do much the same things as PDFjam, and quite a bit more. Hyperlinks don't seem to be preserved there either, though, when n-upping a document.
For Mac OS X, n-up with a more visual interface is provided by PDF Nup Maker. Like PDFjam, this is a front end to pdflatex/pdfpages.
The PDFjam software is made available free, under GPL version 2 (see the file named COPYING that is included with the package). It comes with ABSOLUTELY NO WARRANTY of fitness for any purpose whatever.
Pre-requisites
1. A Unix-like operating system (Linux, Mac OS X, Solaris, etc.)
2. A working, up-to-date installation of pdfTeX (including pdflatex and an up-to-date copy of pdftex.def)
3. A working installation of the LaTeX package pdfpages (version 0.2e or later)
Download
Download the shell scripts as pdfjam_1.20.tgz.
Bernhard Walle has kindly made available an RPM package for Linux. Eduard Bloch has kindly packaged PDFjam for Debian. Paul Chvostek has kindly made a port to FreeBSD.
For Mac OS X droplets, see below.
PDFjam is a project at freshmeat: please subscribe there to receive update announcements.
Installation/configuration
Look at the small block of lines flagged CONFIGURATION in each of the scripts. The main requirement is to provide the correct path to pdflatex on your system. If pdflatex is in your search path (as it ought to be), no change should be needed. Also set here are defaults for paper size etc. These settings can be changed by editing the scripts themselves, or (better) by putting them in a site-configuration file (at /etc/pdfnup.conf, /usr/share/etc/pdfnup.conf, /usr/local/share/pdfnup.conf, or /usr/local/etc/pdfnup.conf) and/or a user-defaults file ~/.pdfnup.conf to be read in that order when any of pdfnup, pdfjoin or pdf90 runs (if present these configuration files will override corresponding settings found in the scripts themselves). For example, if you want your own output to be on "US letter" size paper by default, simply put the line
paper=letterpaper
in a plain text file named file .pdfnup.conf in your home directory.
Make sure that the scripts are executable by all who might need to execute them. If they are to be available to all users on your system, perhaps move them to /usr/local/bin (or make symbolic links to them there). The man pages should be installed on the MANPATH of all who need to read them.
Using the scripts
Once the scripts are installed, help on usage can be obtained by
pdfnup --help
pdfjoin --help
pdf90 --help
Some examples:
For pdfnup,
pdfnup mywork/wasteful.pdf --nup 2x2
will produce a new 4-up file wasteful-2x2.pdf in directory mywork , and
pdfnup mywork/wasteful.pdf --nup 2x1 --outfile mywork2/halfthewaste.pdf
produces a 2-up file halfthewaste.pdf in directory mywork2. The source pdf file wasteful.pdf is left unchanged.
pdfnup file1.pdf file2.pdf --frame true --nup 2x2
makes new files file1-2x2.pdf and file2-2x2.pdf in the current directory, with a border printed around the 4 input pages on each output page.
Other options to pdfnup include --pages, --paper, --orient, --trim, --delta, --offset, --scale and --openright.
For pdfjoin,
pdfjoin file1.pdf file2.pdf file3.pdf --fitpaper true
produces a new file file3-joined.pdf in the current directory, with all pages included at their original sizes.
pdfjoin file1.pdf file2.pdf file3.pdf --fitpaper false --paper a4paper --outfile ~/docs/mybigfile.pdf
scales all of the pages to fit on A4-size paper, and makes the resultant file as ~/docs/mybigfile.pdf .
One possible use for pdfjoin, then, is to change the paper size of a PDF file, for example
pdfjoin USletterfile.pdf --paper a4paper --fitpaper false --outfile USletterfile-A4size.pdf
Other options to pdfjoin include --trim and --offset. The output filename and location are determined by the last input file if --outfile is not specified.
For pdf90,
pdf90 file1.pdf --outfile stuff/myrotatedfile.pdf
rotates all pages and puts the result in myrotatedfile.pdf in subdirectory stuff of the current directory, while
pdf90 file1.pdf file2.pdf
makes new files file1-rotated.pdf and file2-rotated.pdf in the current directory. pdf90 retains original page sizes in the output file.
Mac OS X only: drag-and-drop
Under Mac OS X, DropScript can be used to make simple drag-and-drop applications from these scripts. Some sample droplets are provided in pdfdroplets_1.20.tgz: these may be all you'll need! The sample droplets look like this:
These droplets assume that your pdflatex is at /usr/local/teTeX/bin/powerpc-apple-darwin-current/pdflatex. If pdflatex lives somewhere else on your system, the droplets won't work until you include in your home directory a file named .pdfnup.conf (or there is a system-wide file pdfnup.conf at one of the four locations listed above), containing the line
pdflatex=/path/to/pdflatex
where /path/to/pdflatex is the answer you get when you type which pdflatex in the Terminal.
Create and Print to a virtual PDF printer using cups-pdf
I have been looking for a solution to print any file to pdf using a pdf printer driver.
cups-pdf is the package I was looking for apparently.
Here is its set up of a few steps.
Install cups-pdf by using:
$sudo apt-get install cups-pdf
Edit /etc/cups/cupsd.conf and change the line that says:
RunAsUser Yes
to
RunAsUser No
Restart cupsys:
$sudo /etc/init.d/cupsys restart
Add a new printer (System->Administration->Printing) selecting the “Local Printer” “PDF Printer” option. In the next step choose “Generic Printer” and then used the “Postscript Color Printer (Ver 3)” driver.
Rename the printer
If you want a name better than "postscript-color-printer"
sudo pico /etc/cups/printers.conf
Change
to
sudo /etc/init.d/cupsys restart
Now you should be able to print to pdf by selecting the newly setup printer.
Cribs:
1) The output .pdf files are stored in your “Home” directory. I can’t find a way to change this output directory to something of my liking
2) The output files are named with pre-defined names (job_8-untitled_document.pdf is an example). It would have been nice to select a name while printing.
Installing Software in Ubuntu
One day, Ubuntu came into my view. I felt I would like it though I never liked a Linux OS before. Since then, I started my experience using Ubuntu, a great Linux OS. In order for the newer to Linux OS like me to get familar with some basic necessary knowledge, I want to collect some useful guide in using Ubuntu. Here's my first step.
Quote from "http://www.psychocats.net/linux/installingsoftware.php"
Here are the main ways to install software in Ubuntu in order of ease (easiest to hardest):
1. apt-get/Synaptic/Adept
All Debian-based distros having something called "apt-get" which allows you to draw from a set of online repositories (stored in the /etc/apt/sources.list file) that house packages (i.e., programs/software). You can enable extra Ubuntu repositories by following these instructions--extra repositories means more software available to install. The apt-get command does several things at once--it downloads the appropriate files, downloads all their dependencies, and installs all of them. A single command installs the software. You don't have to download a separate installer file or unzip or go through a wizard or reboot. For example, if I wanted to install Thunderbird, I'd type these commands in a terminal:
sudo apt-get update
sudo apt-get install mozilla-thunderbird
The first command looks both at what I have installed and what's available in the repositories. The second command downloads the packages needed for Thunderbird and installs them.
Another great thing about apt-get is the ability to install several different packages at once. For example, if I wanted to install not only Thunderbird but Firefox, GIMP, Inkscape, Juk, and Wine, I could type in these commands:
sudo apt-get update
sudo apt-get install mozilla-thunderbird firefox gimp inkscape juk wine
and all of those packages would download and install themselves.
On the Ubuntu forums and in many of the Wiki and other guides, you'll often see instructions to sudo apt-get install some package or other. People will give you commands because it's easier than describing what to click in a graphical user interface, and you can just copy and paste the command.
However, there is a graphical version of apt-get. For Ubuntu, it's Synaptic Package Manager. There's also a nice "browsing" environment in which you can search for packages by name and/or description. You can browse by categories of software or look at what's installed versus what's not installed. It's a lot like an ecommerce model of "shopping" for software, except you don't have to pay when you "check out." The equivalent of sudo apt-get update is clicking the Reload button. The sudo apt-get install command, however, is broken into different steps. Instead of listing a bunch of applications you want to install, you mark each one for installation (or removal), and then click Apply Changes or Commit Changes and then everything's downloaded and installed (or uninstalled). I've written another guide on how to use Synaptic Package Manager (complete with screenshots), in case you need pictures to see what it's all about.
2. Manual installation of a .deb
While the Ubuntu repositories are quite extensive (especially if you add extra repositories), they don't cover everything. Sometimes (for the Opera web browser, for example), you have to install a separate file. If you must do so, then try to get ahold of a .deb file. .deb is the native file format for Debian-based distributions like Ubuntu. In fact, if you actually visit the online repositories, you'll notice that the files there are mostly stored as .deb files.
The only difference between manually installing a .deb file and using apt-get to install a .deb file is that apt-get will resolve dependencies for you (if one package needs another to be installed, apt-get will install that "pre-requisite" package). If you manually install a .deb file, you will also have to manually install its dependencies. Don't worry, though--if you try to manually install a .deb file and it has dependencies, you'll soon find out what those dependencies are.
Here's what you should do.
Download the .deb file to your desktop. For this example, let's use Opera. Now, the Opera file that's currently available for Ubuntu has a quite ugly name: opera_8.50-20050916.6-shared-qt_en_etch_i386.deb. There are several ways to deal with this ugly name, seeing as how you have to type in the exact name of the .deb file in order to install it. You can rename it to something simpler (say, opera.deb), you can copy and paste the name, or you can just suck it up and retype it exactly as is. Let's assume, though, that you're going to do it the ugly way. You'd open up a terminal and type these commands:
cd Desktop
sudo dpkg -i opera_8.50-20050916.6-shared-qt_en_etch_i386.deb
That's it... well, as long as there are no dependencies.
3. Manual installation of a .rpm
Occasionally, for a program, you're just not able to find a .deb. There may seem to be, however, a plethora of .rpm files for the program. If you must use an .rpm (not native to Debian-based distros), then use an .rpm. It's a very similar procedure to the .deb one described above, just using a different command (one that converts the "alien" format of .rpm):
One-time deal, just to get alien:
sudo apt-get update
sudo apt-get install alien
Now you can actually use alien:
cd Desktop
sudo alien -i opera-8.50-20050916.5-shared-qt.i386-en.rpm
Again, no dependencies will be resolved.
4. Installing from source
Some people prefer to install from source, but I listed it last because it's what usually scares people off from Linux and makes them think "Why is it so difficult to install software in Linux?" However, it's still an option, and unfortunately it's sometimes the only option, depending on how obscure the software is you're trying to install.
The first thing you'll have to do in Ubuntu is install a meta-package called build-essential (a meta-package isn't a real package--it's a pointer that tells Synaptic/Adept/apt-get to install a bunch of other real packages):
sudo apt-get update
sudo apt-get install build-essential
I can't think of a program off the top of my head that I ever needed to install from source, so I'm just going to make something up--let's call it obscure-1.0. Most likely, it'll come as zipped file called obscure-1.0.tar.gz. Download this to your desktop. Then type this in a terminal:
tar -xvzf obscure-1.0.tar.gz
cd obscure-1.0
./configure
make
sudo make install
Installing from source, like the previous two methods, also does not resolve dependencies--you'll have to install those separately. The ./configure command may indeed tell you what dependencies you need but in a rather peculiar way; for example, it will often return with, say, a rather cryptic "gtk not found," in spite of the fact that the user has gtk installed! In fact, what is actually missing is the gtk development files, libgtkx.y-dev. In general, when it says "can't find library blah" and libary blah is already installed, it usually means that it can't find the blah development files, which can almost invariably be found and installed by searching synaptic for "blah dev."*
Note: in Ubuntu, you can "un-tar" (or unzip) a .tar.gz graphically. I've never had to use the tar terminal command. To un-tar a .tar.gz graphically, just open it (double-click usually does this), then click on Extract.
Discover My Family Story
I just found some exciting information about the
LIN family.
Chinese

: from a word meaning ‘forest’. Bi Gan was a half-brother to Zhou Xin, the cruel and corrupt last king (1154–1123
bc) of the Shang dynasty. Bi Gan criticized his half-brother’s excesses, and for this he had his belly ripped open and his heart cut out. His wife fled to Chang Forest, where she gave birth to a son. When Zhou Xin was toppled by the new Zhou dynasty, the new Zhou ruler granted the son some land together with the name Lin.