Tuesday, March 13, 2018

LaTeX Series: Local TeX Tree

1. Destination texmf-local: your local TeX tree

The first step is to determine in what directory the new font will live. You can't choose just any directory, it has to be part of the TeX hierarchy. The best choice is your “local texmf” tree, which you can determine as follows:
MiKTeX
Navigate through the MiKTeX program:
Start > Programs > MiKTeX > Maintenance > Roots
(or MiKTeX Settings, in older versions). Some paths shown there have a Description such as InstallUserConfig, or UserData. A tree labeledUserConfig (but not any of the others) is an acceptable target for your new fonts, if you have no permission to create a new tree. However, it is better to use a tree without a description, as follows:You can create a new local tree by clicking on Add. The folder must not contain files at its root level or MiKTeX will reject it. Files in the folder must be in subfolders similar to the subfolders in the Install root. (MiKTeX info.)
TeX Live and MacTeX
From a system terminal (aka command prompt, shell window) enter the command kpsewhich --var-value TEXMFLOCAL to see the directory name. The default on Unix is /usr/local/texlive/texmf-local.
If you are not using one of the above TeX distributions, you'll need to consult other documentation.

2. Manual Package Installation

2.1 MikTex

If you want to install your own .sty files, then you should copy the files into the directory tex/latex/mystuff relative to a new TEXMF root directory.
Example:
  1. Create a new TEXMF root: mkdir ~/mytexmf
  2. Create a sub directory: mkdir -p ~/mytexmf/tex/latex/mystuff
  3. Copy your .cls and/or .sty files to ~/mytexmf/tex/latex/mystuff
  4. Register the TEXMF root directory ~/mytexmf
The last step can be carried out in MiKTeX Console.

2.2 TeX Live and MacTeX

The following are the steps that you should follow to install a new LaTeX package into your own home directory.
  1. Download the package file(s) from wherever they are available. Most packages are available from CTAN; enter appropriate keywords in the search fields to find the files.
  2. Packages may be distributed in different ways. Many packages on CTAN, for instance, come with a .dtx file and a .ins file. If the package you are installing comes with these files, you will have to process them with latex to create the actual files that make up the package. That is, type
    latex filename.dtx and/or latex filename.ins
    to unpackage the various .sty and other files in the package.
  3. Create a directory ~Library/texmf in your home directory, if there is not one there already.
  4. Install the various package files into subdirectories of texmf as follows:
    • All .bst and .bib files into texmf/bibtex (or subdirectories)
    • All font-related files into texmf/fonts (or subdirectories)
    • All documentation files into texmf/docs
    • All other files (.sty.cls.tex, etc.) should go into texmf/tex.
Alternatively, you could put all of the .sty etc. files into the same directory as the document you are editing. However, if you end up wanting to use them again later, you will have to copy them into the new directory as well, so in the long term it is probably better to put them into ~/texmf.

Source: [1, 2, 3, 4]

Monday, June 19, 2017

Balik Kampung

Lama dah tak pos entry....

kali ni note utk diri sendiri.... balik kampung!!!!


Friday, November 25, 2016

Mac Series: Reduce PDF File Size in Preview

zpjet has posted a very good article reproduce below:



I was never satisfied with results of "Reduce File Size" Quartz filter when trying to make some PDFs smaller before sending them by e-mail. It made them too small, and the graphics were fuzzy.

I eventually found where these filters are:

/System/Library/Filters

I was delighted to find out they're XML files easily editable with TextEdit (or any other text editor). I also found why this particular filter makes quite unusable PDFs, as these parameters were just too low:

Compression Quality 0.0
ImageSizeMax 512

So I copied this file to my Desktop, and then made two more copies of it, and called them Reduce File Size Good, Better and Best. Then I changed the parameters of each file to 0.25, 0.5 and 0.75 for Compression Quality, and used these three values for ImageSizeMax:

842 (that's A4 at 72dpi)
1684 (A4 at 144dpi)
3508 (A4 at 300dpi)

Finally, I changed the default string for the Name key at the end of each file to reflect the three settings, so they display the names I have given them in the menu.

Then I copied them to a /Library/Filters folder I created (for some reason, ~/Library/Filters doesn't work in Lion) and now when I open a picture or PDF in Preview, I have the option of four different qualities for reduced file sizes.

As an example, I have a JPEG of scanned A4 invoice at 300dpi and it's 1.6MB. When exporting to PDF in reduced size, the file is only 27 KB and it's quite unusable - very fuzzy and hard to read. The Good one is much easier to read, slightly fuzzy and still only 80 KB. Better is 420 KB and clear, and the Best is 600 KB and almost as good as the original even on a laser printer.

[kirkmc adds: Interesting hint. I see this as useful only for creating PDFs from files. If I'm scanning something, and I don't want the file to be too big, I'll either scan it at a lower resolution, or change the resolution in an image editor before making a PDF.]


Wednesday, October 5, 2016

Windows Series: Directory or Junctions?

When you created a "Junction", it will behave like you have all the files in that particular folder. However, the files actually located at other place (target folder).

There is no way to know whether the folder you look at is a "directory" or a "junction" using the windows explorer. There are alternatives however to differentiate them.

One way is by using the "Command Prompt".

Steps:

1) Change the directory to the folder/directory of interest
2) dir /a to list all directory/junctions
3) dir /al /s to list all directory/junctions in the directory or subdirectories

Thanks to [source]

Tuesday, October 4, 2016

Windows Series: Junction

I worked across Windows-OS X, and several PC's...
Thus, I use dropbox to store my files; files anywhere across PC's and OS. ...

Using normal shortcut is not an option. Because OS X uses different kind of shortcut called alias which will not work on Windows. Similarly Windows uses .lnk (shell links) that will not work on OS X. On different PCs, the dropbox is installed on different drives (i.e. on PC1 E:\Dropbox, on PC2 F:\Dropbox) which will affect the shortcut created. It will not be accessible in PC2 if the shortcut created in PC1.

One of the solution is using "JUNCTION" which solved the problem that I've been facing across multiple PC/OS.

Steps:
1) Run Command Prompt as administrator
2) mklink[space]/J[space]"link"[space]"target" (i.e. mklink[space]/J[space]"F:\Dropbox\TEACHING\SESI_2016-2017\ENT310_220\ASSESSMENTjunction"[space] "F:\Dropbox\UniMAP\TEACHING\MASTERFOLDER\ENT310_220\ASSESSMENT") 

Thanks to [source]

Friday, September 30, 2016

MS Word Series: Bold Caption Label & Number But Not The Caption Text

This macro is intended to BOLD the CAPTION LABEL & NUMBER but not the caption title.

Sub CaptionBoldNot()
'
' CaptionBoldNot Macro
'
'
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Text = ""
    .Style = "Caption"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute
  End With
  Do While .Find.Found
    With .Paragraphs.Last.Range.Duplicate
      .End = .Start + Len(Split(.Text, " ")(0)) + 1
      .MoveEndUntil " ", wdForward
      .Style = "Strong"
    End With
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
End Sub


Thanks to the original author

Monday, March 21, 2016

MS Office Series: Equation/Math Font

The article here lists out the fonts available that look much better than Cambria Math.

In summary, three other nice fonts that work with Microsoft Office’s new Equation Editor (these are compatible with Office 2007 or later):
  • XITS Math is somewhat compatible with Times (download here).
  • Asana Math is compatible with Palatino (download here) and if you don’t have Palatino, you can download it here, among other places
  • Latin Modern is the LaTeX font of choice. There is a math font (download here) and a whole family of text fonts (download here). Note: these may not look good on screen, but they look just perfect when printed.

Monday, August 17, 2015

Macbook Series: Read and Write NTFS HDD

This is another thing that bother me.

As usual, after googling around I found this article that provide a working solution... for now.

Good luck!!

Macbook Series - Tweaking External Monitor Resolution

Annoyed with the built in option provided by OSX.

Luckily I found this article to change the external monitor resolution close to the its spec.

Yeay!!

Finally - Own Macbook Air

Smileeeeeeeee....

My decision to own a MBA was affected by the facts that:

1) MBA reputation & built quality
2) Hard to find good ultrabook with the same/comparable quality with MBA at reasonable price

Now... It's time to play with my new toy :)

Friday, June 5, 2015

Mendeley Series: Dropbox Workaround

There is a great article regarding a workaround on Mendeley and cloud storage, specifically Google Drive. However, the principle can be applied to Dropbox as well.

There are some clarifications needed for beginner; like myself.

I will simplify the steps based on the article.

  1. Open an elevated command prompt (search cmd under start menu, right click the black box icon, run as admin).
    # Navigate to "C:\users\YOURNAME\appdata\local\Mendeley Ltd.\" at the command line.  Don’t go into the Mendeley Desktop folder itself.
  2. Copy the "Mendeley Desktop" folder into your preferred Dropbox folder i.e. E:\Dropbox\Mendeley
  3. Rename "Mendeley Desktop" on original location "C:\users\YOURNAME\appdata\local\Mendeley Ltd.\" to any names i.e. "MendeleyDesktop_backup"
  4. Make a symbolic directory junction (crikey):

    mklink /j “Mendeley Desktop” “PATH” where PATH is where you saved it to your Dropbox (doesn’t need to be the same on all computers, that’s just for PDF’s so you don’t need to use the network drive path here).

    So, for me it was:

    mklink /j “Mendeley Desktop” “E:\Dropbox\MENDELEY\Mendeley Desktop
  5. Now, fire up Mendeley and all should be ok.  Check it is before closing mendeley and then repeating this on each computer (no need to copy the local mendeley to google drive again, just continue from where you back it up locally just in case).

In summary,

For the master pc:
  • copy mendeley data directory somewhere to Dropbox
  • ensure pdfs are on Dropbox *in the same structure*
  • if Dropbox isn’t on the same drive letter for all pc’s share it and map it to the drive letter of your choice.
  • back up local mendeley directory
  • symlink
  • test mendeley works.  shut it down.

For all other pc’s,
  • if Dropbox isn’t on the same drive letter for all pc’s share it and map it to the drive letter of your choice.
  • back up local mendeley directory
  • symlink
  • test mendeley works.  shut it down.
Here's an article, explaining the magic behind symlink. 

Good luck!!!



Wednesday, May 27, 2015

First Day: Hafiy at Nursery

It has been a while since my last visit to my own blog :)

Hari ini adalah "hari dalam sejarah" buat nyome-nyome Hafiy.

Lulus kena tinggal di nursery, walaupun melalak lepas tak nampak ummi dan abi dia :p

Ummi dia kena pergi ke klinik; minum air gula.

Abi dia macam biasa; kerja.

Hari ini, pukul 12.00 ummi dia tak sabar nak ambil anak kesayangan dia tu :).

Esok, mudah-mudahan Hafiy lulus lagi dan seterusnya boleh la tinggal lama sikit; either sampai 1415 or 1800. InsyaALLAH.


がんばれハフィくん。

Tuesday, February 24, 2015

Short DOS Readable File Name

Very simple application.. obtained the .BAT file somewhere.. credit to the contributor...

Instruction

1) Click Ctrl+R
2) Type "cmd"
3) Drag downloaded file, space
4) Paste the long file path desired
5) Enter/Return

Example:
C:\Users\Username\>C:\User\Username\Desktop\shortPathDOS.bat D:\SkyDrive\Installer\Somefilefolder\filenames.doc

Result:
D:\SkyDrive\INSTAL~1\Some file folder\file names.doc

Download file

Note: Rename the file extension to ".bat"

Thursday, February 19, 2015

Manjaro Series: Couldn't Update

Finally... after a few months (maybe) I didn't boot into manjaro... I booted up and tried to update...

However, I was welcomed with "signature from "Name " is unknown trust" error....!!! wtfish!!!


Luckily the solution is easy and only took a few steps... thank to the manjaro forum.

Meanwhile.... still installing updates.... 1GB worth update ;p

Tuesday, February 3, 2015

PhD Examination 「本審査」



PhD Examination本審査 

2014年 02月03日

火曜日

0900


A Dissertation By 

Toqwan


Guided By

Associate Professor Kouki Nagamune 「長宗 高樹」


Examiners

Professor Murase Kazuyuki 「村瀬 一之」
Professor Naniwa Tomohide 「浪花 智英」
Professor Hosoda Yosuke 「細田 陽介」

Audiences
Noorsuriana
Muhammad Khairul 
A few lab members

Monday, February 2, 2015

Prior to Big Day

明日は本審査があります。

少し緊張した。

#prayformysuccess

Friday, January 30, 2015

Tabung Haji & ASB Dividen Calculator

I found the calculator here.

Great way to monitor your $$$.

Download calculator (wait for 5 seconds to skip ad)




Thursday, January 29, 2015

Representative for 卒業式

I was told by my 先生 that I've been selected as the representative for 博士 student. I was like......

wahhhhhh~!!!

Okay....

"No problem 先生."
"How many of 博士 student that will be graduating?"

"9 students." 先生 said.

"I'm the only one from our department right.."
"へぇぇぇぇぇ~「Heeeee~」"

The 本審査 will only be held on 2月3日, but they asked me to become a representative already?... Huuhuhuuuuu....

InsyaALLAH..... I can do it!!!

楽しみ!!

Thursday, January 22, 2015

LaTeX Series: How to Convert From LaTeX to MS Word

There will be times when you have to use MS Word format of your LaTeX documents. As far as I'm concern, there is no perfect software or workaround currently available to produce 100% LaTeX-MS Word compatible conversion.

However, there are currently a few methods with some pro and cons here and there.

My choice for now is TeX4ht.

Here's explanation of the command needed for the conversion [link] and some workaround for the known problems [link 1, link 2, link 3]

Tuesday, January 13, 2015

MS Word Series: Preserve Document Map When Converting the Document to PDF

Hi guys,

Referring to the title of this post, I found a very simple solution here.

The steps are as follows:

  1. Click Save as...PDF or XPS.
  2. Select PDF as the save type, then click Options (above the Publish button).
  3. Midway down, select Create bookmarks using: and select Headings.
Taraaa!!! Your document maps should now be on the left side of the PDF (Bookmark tab) when you publish.