Wednesday, November 23, 2011

[LaTeX] How to solve subfig package overriding custom captions in Figures and Tables

26 Zulhijah 1432H.

Here i am writing my thesis using Kile.

Along the way, i need to add three separate figures with its own subcaptions, grouped under one main caption (also known as global caption). Don't understand what i'm saying? See Pic 1.


Pic 1 - See Figure 2.5 in the picture. Three separate figures with its own subcaptions, grouped under one global caption.


To do like Figure 2.5 in Pic 1, i used the subfig package after reading about it here:
WikiBooks > LaTeX/Floats, Figures and Captions > Captions > Subfloats

So i added:
\usepackage{subfig}
to my preamble, which is in the UPMthesisEnglish.tex file.

Wait. What's a preamble and what is UPMthesisEnglish.tex?


A LaTeX preamble is:
"The preamble file defines the style of the document and tells Latex which packages to use, such as packages for including figures."

Source: Chris Paciorek. Latex preamble. Accessed: 23 Nov 2011.

UPMthesisEnglish.tex is the main file of my thesis template and is also where my preamble is. Microsoft Word and LibreOffice Writer users will identify this as the Master document. To know a bit more about the template i'm using, see here, How to set different page margins within the same chapter in LaTeX under Tools.

However, nobody told me the subfig package will override my already existing custom captions for Tables and Figures, or that the package is supposed to be used with the caption package. As a result, all the previously bolded captions in Figures and Tables turn out unbolded, and the vertical spacing between figure and caption was reduced.

After a some searching, here's how to get the custom captions bolded again and at the same time use the subfig package without having to use the caption package. Put this in the preamble:
\usepackage[caption=false]{subfig}

Source: sommerfee's post here, Re: subfig package destroys figure captions. Accessed: 23 Nov 2011.

Then re-Build. Should work by now. As for me, everything is OK except for the altered vertical spacing between figure and caption. Manual tweaking is required suppose :-\

Wednesday, October 19, 2011

Problem in Kile: [ViewPDF] failed to start

21 Zulkaedah 1432H
Update: 25 Safar 1433H / 19 Jan 2012M, Khamis.


With a new laptop (mentioned in this post: How to solve Flash problems on Ubuntu 11.10 Oneiric Ocelot) and Ubuntu 11.10 freshly setup, problems are bound to appear frequently at the beginning.

After ironing out the Flash problem, now here's another problem; i can't view the PDF compiled in Kile. As seen in Pic 1, i get the error:
[ViewPDF] failed to start
Pic 1 - The [ViewPDF] failed to start error.



Checking Kile in Ubuntu Software Center as seen in Pic 2, i had every add-ons marked except for one that i definitely don't need and isn't the cause for this error. So if everything is there, then why the error?

Pic 2 - Kile add-ons in Ubuntu Software Center.



Another check in Ubuntu Software Center for Okular, turns out that it wasn't installed along with Kile; each package had to be installed individually.

By now, you can guess how to solve this problem.


1. Run Ubuntu Software Center.


2. In the Ubuntu Software Center window, type the search term okular in the search field. The search results will be auto-filtered as seen in Pic 3.


3. In the search results, click on the Okular (okular) package. A More Info button and Install button will appear below the package's name, see Pic 3.

If you want to add add-ons, click the More Info button. From here, go to Step 4.

If you don't need any add-ons or straightaway want to install the package, click the Install button. From here, go to Step 6.

Pic 3 - Refer Step 3. Okular search results.



4. Tick the add-ons you need or untick the add-ons you do not need. Then click the Apply Changes button. See Pic 4.

Pic 4 - Refer Step 4. Okular add-ons in Ubuntu Software Center.



5. After changes have been applied, click the Install button, see Pic 5.

Pic 5 - Refer Step 5. Installing Okular with add-ons via Ubuntu Software Center.



6. An Authenticate window will appear prompting for your password. Key-in your password then click the Authenticate button. See Pic 6.

Pic 6 - Refer Step 6. Authenticating the installation action.



7. Once installation is complete, the Install button (see Pic 5) will turn into the Remove button, see Pic 7.

Pic 7 - Refer Step 7. The Install button is now the Remove button.



Try recompiling your document in Kile. My problem went away by now. See Pic 8.

Pic 8 - Refer Step 7. Everything is working great now. Kile is in the background window, Okular is in the foreground window.

Monday, October 17, 2011

How to solve Flash problems on Ubuntu 11.10 Oneiric Ocelot

19 Zulkaedah 1432H
Updated: 26 Ramadan 1433H / 13 Aug 2012M, Is.
26 Jamadilawal 1433H / 18 Apr 2012M, Rabu.
25 Safar 1433H / 19 Jan 2012M, Khamis.
19th Oct 2011, Ra.


My old Toshiba Satellite M100 laptop has met the end of its service life :(. Starting its service life in the place of the old  laptop is a new Lenovo IdeaPad Z470 laptop. The switch from old to new laptop happened around the Ubuntu upgrade from Ubuntu 11.04 Natty Narwhal to Ubuntu 11.10 Oneiric Ocelot.

The new laptop comes pre-installed with Windows 7. For reasons not-so-important-to-mention, the laptop has been setup to dual boot: Windows 7 or Ubuntu. i'm running Ubuntu 11.10 (64-bit).

Among the problems i face are:
  • Adapting to the oddly placed Delete button on this keyboard. i miss the old keyboard :'(. Next time i get a new laptop, it's going to be a Toshiba! :D
  • Adapting to how odd the keyboard on this new laptop feels when typing
  • Problems with the touch-sensitive buttons (all the buttons in the volume button row) specific to this laptop. Problem isn't solved yet.
  • Flash problems with FireFox and Chromium
  • Bluetooth is turned on automatically at start-up. i want it turned off.

Below are the simple steps to solve the Flash problem with FireFox. i took the solution from here, Re: Problems with flash player in Ubuntu 11.10 and refined the explanation.

===
Update: 26 Ramadan 1433H / 13 Aug 2012M, Is.
James Maxwell (http://www.blogger.com/profile/12426809746992406630) suggested this post for Windows Firefox:
3 Tips to Fix Firefox Crash Problem
http://remote-technician.blogspot.in/2012/08/3-tips-to-fix-firefox-crash-problem.html
===

1. Run your FireFox browser.


2. Referring to Pic 1, from FireFox's toolbar: Tools > Add-ons

The Add-ons Manager tab will appear in the browser. See Pic 2.

Pic 1 - Refer Step 2.


Pic 2 - Refer Step 2. The Add-ons Manager tab in the FireFox browser.



3. In the Add-ons Manager tab, go to Get Add-ons tab. See Pic 2.

Referring to Pic 3, type the term flash in the search field then press the Enter button to search for the Flash-Aid extension.

The Search tab will automatically appear above the Get Add-ons tab. Look for the Flash-Aid extension in the search results. The current version at the time this post is written is Flash-Aid 2.2.1. Click the Install button to download the extension.

Pic 3 - Refer Step 3. Searching for the Flash-Aid extension and downloading it.



4. After downloading is done, click the Restart now link (located beside the extension's name) to restart your FireFox browser then install the extension, see Pic 4. Fret not, any opened tabs will be reloaded after restarting your browser.

Pic 4 - Refer Step 4. Restarting FireFox to install the Flash-Aid extension.



After restarting FireFox, to check whether the Flash-Aid extension is installed, go to the Extensions tab, see Pic 5.

Satisfied, close the Add-ons Manager tab, there's no further need for it.

Pic 5 - Refer Step 4. Checking for the Flash-Aid extension in the Extensions tab.



5. In your FireFox browser, notice the Flash-Aid button (see Pic 6) at the right-hand-most on the same row of the address bar. See Pic 7.

Pic 6 - Refer Step 5. The Flash-Aid button.



Pic 7 - Refer Step 5. Flash-Aid button position in my FireFox browser.



Click-hold the Flash-Aid button. A pop-up menu appears. Choose Wizard Mode for aid to correct the flash errors. See Pic 8.

The Flash-Aid Wizard window appears, see Pic 9.

Pic 8 - Refer Step 5.



6. In the Flash-Aid Wizard window, Installation Options; under the question:
Which version of flash you want to install?

Choose from the drop-down menu the version of flash you want to use depending on your architecture, then click the Next button. See Pic 9.

If you're running Ubuntu 32-bit, use:
  • Adobe Stable, from repositories (32bit with compatibility wrapper)

If you're running Ubuntu 64-bit, you can choose to use:
  • Adobe Stable, from repositories (32bit with compatibility wrapper), or
  • Adobe Beta, from Adobe Labs

i chose "Adobe Beta, from Adobe Labs".

Pic 9 - Refer Step 6.



7. Still in the Flash-Aid Wizard window, Removal Options; under the question:
Which installed plugins you want to remove?

Tick the box for the plugins you want to remove then click the Next button. See Pic 10.

i left all the boxes ticked and simply clicked the Next button.

Pic 10 - Refer Step 7.



8. Still in the Flash-Aid Wizard window, Tweaking Options; under the question:
Which optimization tweaks you want to apply?

Tick the box for the tweaks you want to apply then click the Next button. See Pic 11.

i left all the boxes ticked and simply clicked the Next button.

Pic 11 - Refer Step 8.



9. Still in the Flash-Aid Wizard window, Script Options; under the question:
What do you want to do?

Choose what you want to do then click the Finish button. See Pic 12.

i left the option at Execute and simply clicked the Finish button.

Pic 12 - Refer Step 9.



The Flash-Aid Wizard window will disappear and a Terminal window will appear. See Pic 13.

Pic 13 - Refer Step 9.



10. In the Terminal, follow the commands that appear.

If requested, type in your password then press the Enter button. See Pic 13.

When asked:
Do you want to continue [Y/n]?

Type in y then press the Enter button. See Pic 14.

Pic 14 - Refer Step 10.



11. When the process in the Terminal has finished, see Pic 15; close the Terminal, then restart your FireFox browser.

Pic 15 - Refer Step 11.



12. Try going to a website with flash contents to check if your flash has been installed correctly.



Flash problems return

After quite sometime, it appears the flash problem suddenly returns for no reason. It's possibly because of the new Ubuntu updates for flash or browser. A notification (see Pic 17) is supposed to automatically appear to inform about updates. Most of the time i don't notice it :P

13. Simply go to the Flash-Aid icon (see Pic 6), click-hold, then select Check Update. See Pic 16.

A notification will appear to inform about any update, see Pic 17. If there is a new update, choose the update method (Wizard Mode / Quick Mode / Advance Mode) you are comfortable with. i'm sure by now you have a preferred method :).

Pic 16 - Refer Step 13. Checking for update.



Pic 17 - Refer Step 13. Update notification. Update available.



This this just my opinion: Even if there is an update, if your flash is working OK, just leave it be -- Don't update. It's not broken, so why fix?

Tuesday, October 11, 2011

This Blender n00b is modelling a house

14 Zulkaedah 1432H

Sharing my attempt at learning Blender by following the guide, Blender 3D: Noob to Pro, starting from nil. The closest i've come to anything 3D is using CATIA in my previous study/ramble.

The following pics were modelled using Blender 2.59 on my husband's PC running Ubuntu 11.04.

By the way, my old Toshiba Satellite M100 laptop has performed its duty excellently and reached the end of its service life (the fan has stopped spinning for the second time), while the new Lenovo IdeaPad Z470 laptop is at the service center for hard disk problems :( *sigh*... which also means i'm currently unable to continue writing my over-delayed thesis, and it's nearly TWO weeks already! That's why i'm learning Blender at the moment -- to use time as wise as possible.

Pic 1 is the result from this page:
- Blender 3D: Noob to Pro/What is a Mesh?

Pic 1 - Cat face! :D


Pic 2 is the result of these pages:
- Blender 3D: Noob to Pro/Quickie Model
- Blender 3D: Noob to Pro/Quickie Render

Pic 2 - N00bie house.


Pic 3 is the result of this page:
- Blender 3D: Noob to Pro/Improving Your House

Pic 3 - It's a house. It's a bank. It's a...


Pic 4 is me rambling before starting the next lesson:
- Blender 3D: Noob to Pro/Modeling a Simple Person

Pic 4 - Traditional Malay house on stilts. Nostalgic, huh?


A lot more reading to do! :-\

Thursday, August 11, 2011

How to set different page margins within the same chapter in LaTeX

Update: 24 Aug 2011M/ 24 Ramadan 1432H, Ra.
8 Ramadan 1432H

My thesis has fixed (consistent) margins throughout the whole document, so it's no problem to set the margins once and leave it be.

But what if a thesis has different margins for different pages within the same chapter? -- This problem most probably hits book-writers too.

For instance, it is required the top margin for
the page-with-"Chapter" be 5cm (see Pic 1 and Pic 5), while
the page-without-"Chapter" be 3cm (see Pic 2 and Pic 6).

As for the rest,
2.5cm for the bottom margin (see Pic 6),
3.8cm for the left margin (see Pic 5), and
2.5cm for the right margin (see Pic 5).

Pic 1 - Opening page (page-with-"Chapter").


Pic 2 - Succeeding page (page-without-"Chapter").


Tools

Template
If you want to use the same template i'm using (though mine has been heavily modified by now), you can get it here:
INSPEM -- Institute For Mathematical Research.

From there, look for this link to download the template:
UPM Thesis Template (Versi BI)

And download the guide too:
User Guide for UPM Thesis Template

You must first modify the template as directed by the guide before proceeding to use the template.

Dummy text
As for the text, simply go to this link:
Lorem Ipsum - All the facts - Lipsum generator
and generate a few paragraphs of dummy text.


Steps

1. Add the following commands to the list of packages in your main file. In my case, it will be the UPMthesisEnglish.tex file, see Pic 3.

\usepackage[top=3.0cm, bottom=2.5cm, left=3.8cm, right=2.5cm]{geometry}

\usepackage{titlesec}

Pic 3 - Adding the commands in the UPMthesisEnglish.tex file.


The geometry package will be used to set the margins for the page-without-"Chapter" page (see Pic 2).

If your thesis has a fixed margin throughout the whole document, the first command line (command line numbered-1 in Pic 3) is enough!

Also, you can use the first command line to override margin settings (and only the margin settings, nothing else) in the *.cls file. In my case, it will be the UPMthesisEnglish.cls file. i don't know how others' *.cls file looks like but mine is really messy + complicated.

The titlesec package will be used to set the margins for the page-with-"Chapter" page (see Pic 1). Basically we will vertically offset the title.


2. Add the following commands to the relevant sub-files. In my case, i'm using my own Chapter4.tex file. You can use the generated dummy text in your file.

\titlespacing*{\chapter}{0pt}{1.5cm}{1cm}

\titleformat{\chapter}[display]{\normalfont\bfseries\centering}{\MakeUppercase\chaptertitlename\ \thechapter}{0pt}{\normalfont\uppercase}

As seen in Pic 4, put the command lines at the topmost of the file, before these lines:

\chapter{\textbf{Methodology}}\label{method}
\thispagestyle{empty}

Pic 4 - Adding the commands in my Chapter4.tex file.


{0pt}
  • is the horizontal spacing between the left margin and the  title.

{1.5cm}
  • is the vertical spacing preceding the title (which will vertically offset the title, which in turn will offset the succeeding texts as well)
  • the offset is combined with the top margin of page-without-"Chapter"
  • 3.0cm (top margin of page-without-"Chapter")
    + 1.5cm (vertical offset)
    = 4.5cm --> 5.0cm (top margin of page-with-"Chapter")

{1cm}
  • Vertical spacing between the chapter title and the next text. In this case, the vertical space between the word METHODOLOGY and the first paragraph (see Pic 1).

To read further about the formatting, download the file:
titlesec.pdf.
  • \titleformat is on page 4.
  • \titlespacing* is on page 4 and 5.

Also, read here:


3. Compile your file. Make a physical print of the *.pdf file. In my case, it is the UPMthesisEnglish.pdf file. Then measure the margins in the printed document. Otherwise use a virtual ruler. If your virtual ruler needs calibration, go to iRuler.net - Online ruler.

Unless you have nuclear-reactor-precision confidence with your method, DO NOT measure the margins by slapping on a physical ruler against the screen... like i did *oh! the shame of it*. The measurements will probably be off.

After learning from my mistake, i'm using the Screen Ruler now. See Pic 5.

Pic 5 - Virtual ruler. Screen Ruler.


Where to measure?

To measure the top margin of a page-with-"Chapter" page, go to any page with a chapter. See Pic 6.

Pic 6 - Top margin for the page-with-"Chapter" page. Also shown in this pic are the left and right margins. This pic is the superimposed result of three separate pics.


To measure the top margin of a page-without-"Chapter" page, find a page that does not have a break in paragraph (one part of the paragraph on the previous page, another part of the paragraph on this page), i.e., the page starts with a paragraph. See Pic 7.

Pic 7 - Top margin for the page-without-"Chapter" page. Also shown in this pic is the bottom margin. This pic is the superimposed result of two separate pics.


To measure the bottom margin, find a page that does not have a break in paragraph (one part of the paragraph on this page, another part of the paragraph on the next page), i.e., the page ends with a complete paragraph. See Pic 7.

The reason for not wanting a paragraph that breaks across pages is because, the line spacing (singlespace/doublespace/etc) will effect your measurement.

As for the left margin and right margin, they can be measured on any page you like. See Pic 6.


Reference

http://en.wikibooks.org/wiki/LaTeX/Page_Layout
http://www.ctex.org/documents/packages/layout/titlesec.pdf


Note

i don't know how this process will affect the ToC (Table of Contents), and other pages.

Thank you to the email sender(s).

Wednesday, May 11, 2011

Adobe Flash + 64Bit Ubuntu 11.04

Sekiranya flash browser korang jadi terencat setelah upgrade ke ubuntu 11.0464bit, sila buat langkah berikut:
  • add-apt-repository ppa:sevenmachines/flash
  • apt-get update
  • apt-get install flashplugin64-installer
  • restart browser

Dicilok tanpa kebenaran dari sini

Tuesday, May 10, 2011

How to create a boxed-label in Xfig

27 Jamadil Awal 1432H

Thank you to Brian V. Smith for his speedy reply on how to create a boxed-label using Xfig.

Pic 1 - An example of a boxed-label created using OpenOffice Writer.
See the box containing the text Sharp nose? Because i don't know what the correct term is, that's what i call a boxed-label... :P


1. Run Xfig. From the Panel > Applications > Graphics > Xfig. Refer Pic 2.

Pic 2 - Refer Step 1.


2. In the Drawing Mode panel (refer Pic 3), click the POLYLINE drawing icon (refer Pic 4).

Pic 3 - Refer Step 2. The Drawing Mode panel.


Pic 4 - Refer Step 2. The POLYLINE drawing icon in the Drawing Mode panel.


3. Near the bottom-right corner, there is a box labelled Dimension line (refer Pic 5). Click it.

Pic 5 - Refer Step 3. The Dimension line icon.


4. A pop-up window labelled Xfig: Dimension Line Settings appears. Set it as follows:

in the Line section:
- set the Thickness = 0

in the Arrows section:
- set the Types = (NONE) (NONE)
*Click + hold on the arrowhead icon. A pop-up menu appears. At the top of the menu, select (NONE).

in the Box section:
- set the Thickness = 0
 *This is the case if you want a border-less box.
 
- set the Color = pick a color (this will be the fill color of the label)
 *Since the canvas is white, it is probably a good practise for the time being to change the color to something visible. For this example, i use Pink4.

 in the Ticks section:
- make sure the Show ticks checkbox is empty.
*Ticks are the right-angled line at both ends of the line we will be drawing later.
 
in the Text section:
- put a tick in the User defined text (not actual length) checkbox.
- select the Font, Size, and Color for the text. i use the default settings.

Then click the Ok button at the bottom of the window.

Pic 6 - Refer Step 4. Changing the properties in the Xfig: Dimension Line Settings pop-up window.


5. Hold down the Shift button. Left-click the mouse button on the canvas to create the first point. Release the Shift button.


6. Left-click the mouse button again to create the final (end) point.


7. A pop-up window titled Xfig: Edit panel appears. At the bottom of this window is the Text section for you to input your text.

*When typing-in your text, make sure the cross-hair/cursor rests within the text field itself; otherwise nothing appears when you type. Think of it as a way of activating that particular field.

Pic 7 - Refer Step 7. Typing in the text.


8. When you want to see the changes, click the Apply button.

When you're satisfied with the changes, click the Done button.

Pic 8 - Refer Step 8. Previewing and confirming the changes made.


9. To make further edits to your label, click the CHANGE OBJECT via EDIT panel icon (refer Pic 10) in the Editing Mode panel (refer Pic 9). Go to your label and left-click it. The Xfig: Edit panel pop-up window (refer Pic 7, and Pic 8) appears.

Pic 9 - Refer Step 9. The Editing Mode panel.


Pic 10 - Refer Step 9. The CHANGE OBJECT via EDIT panel icon.



Note:
The height of the boxed-label follows the height of the text. You aren't able to change the height of the box. Refer Pic 11.

Pic 11 - Example how boxed-label height follows the text height.



Just in case anyone is interested to read in Brian's own words, here are excerpt from the emails.

Here is my question:
Was wondering if there is an automated feature to add boxed-labels like the one shown in the attached file Screenshot-13.png. What i understand up to now, the only way to created a boxed-label takes 3 steps: 1- create a box, 2- add the text, and 3- compound the box and text. Is there such a thing that the box automatically expands as text is typed + we can change the background color + line size? Similar to the "Insert text" feature in Microsoft Word.


And here is his reply:
That's a very good question.  xfig doesn't have exactly such a feature, but you can use the "dimension line" object to do it.

Select the line drawing tool and on the bottom panel scroll to the "Dimension line" button at the right edge. Click on it and set the following properties:

Line/Thickness = 0
Arrows/Types = (None) (None)
Box/Thickness = 0
Box/Color = your choice (this will be the color behind the text)
Uncheck Ticks/Show ticks
Under "Text" check "User defined text..."
Select the font, size and color for the text

Click Ok

To make a text box, hold the shift key and click on the canvas where you want the left edge of the text box to be and click anywhere to the right of that.
The edit panel will pop up and you can enter the text at the bottom of that.
Click Ok and voila!

The widths of the boxes will be equal to the length of the text string, so if you want them all the same width you will need to add padding spaces.

It's a little out of the ordinary, but I tried it here and it looks ok.
Once you've set up the dimension like attribute panel you just need to click twice and enter the text to make them.

Sunday, April 10, 2011

Black Screen after updating

If you get the Black Screen when booting-up the PC after updating the system...
  1. Boot-up to the Grub menu. Please refer here on how to boot-up into the Grub menu.
  2. Select the third line down. This is usually the second kernel. We are predicting that the problem is coming from the first kernel, so now we are opting for a problem-free boot-up by using the second kernel.
  3. Remember the numbers in the first line on the Grub menu, as we will delete it later. For example 2.6.35-28 -- remember this number or write it down.
  4. If you can boot-up using the second kernel, its means that the first kernel is the culprit that is giving you the Black Screen.
  5. Go to System > Administration > Synaptic Package Manager.
  6. Search for the term "linux-image".
  7. Find the linux-image package with the Latest Version numbers as you've written down in the previous steps. Right-click > Mark for complete removal.
  8. Find the linux-image-generic package with the same Latest Version numbers. Right-click > Mark for complete removal.
  9. Make sure that the numbers in the Latest Version column are the same numbers as the numbers in the first line in the Grub menu. Otherwise the first line will still appear.
  10. Click Apply then reboot your PC.
Done


Modified from here:

Saturday, April 9, 2011

Grub Menu

  1. If you only have 1 Operating System, Grub Menu will not be shown because it is turned off by default.
  2. You can enter the Grub Menu by holding down the Shift button on your PC when boot-up.
  3. If you want to turn on the Grub Menu, open your Terminal.
  4. Type sudo su then press Enter.
  5. Type sudo nano /etc/default/grub then press Enter.
  6. Comment out "GRUB_HIDDEN_TIMEOUT=0" by putting # at the beginning of the line
  7. Save it.
  8. Recompile grub with the following command "sudo update-grub".
  9. Reboot your PC.
  10. You should see the Grub Menu on the next boot-up.
*Modified from here http://ubuntuforums.org/showthread.php?p=9982109

Sunday, March 20, 2011

[OpenOffice] How to print (export) a PDF in a different paper size?

Update: 4 March 2012M / 11 Rabiulakhir 1433H, Ah.
2 April 2011 / 28 Rabiulakhir 1432H, Sa.
21 March 2011 / 16 Rabiulakhir 1432H, Is.

11 Rabiulakhir 1432H

Here i am creating a document the size of an A5 in portrait orientation. That's the size when you take an A4 paper, hold it in landscape orientation, then fold it vertically in the middle; only now you've got two pieces of A5 in portrait. Is that twisting your brains?

See here about the A4, and A5 paper:
http://en.wikipedia.org/wiki/ISO_216#The_A_series

See here about the portrait, and landscape orientation:
http://en.wikipedia.org/wiki/Page_orientation

Then here i am again, without success trying to print two portrait-A5 pages on a single landscape-A4 paper. The solution came with a little googling around. Here's how...

First you need to setup a virtual printer. If you've already have this setup then go to Part C.


Part A: Checking for a virtual printer

1. A much shorter + simpler way of checking for a printer is from the panel, System > Administration > Printing. See Pic 1.

Pic 1 - Refer Step 1. Checking the presence of printer(s).


A new window similar to Pic 2 will appear. In it are shown the printers connected to your laptop, be it virtual or physical printers.

Pic 2 - Refer Step 1. No printers yet.


As you can see in Pic 2, no printer is connected to my laptop yet. You can see what it will look like in Pic 15 when a printer is connected; in this case it will be our virtual printer as will be explained in Part B.


2. Since we're going to use OpenOffice.org Writer, here's how to check from within Writer itself. To run Writer, from the panel, Applications > Office > OpenOffice.org Word Processor. See Pic 3.

Pic 3 - Refer Step 1. Running OpenOffice.org Writer.


3. To check for the printer, from the toolbar click File > Printer Settings.... See Pic 4.

Pic 4 - Refer Step 3. Running the pop-up for printer settings.


4. In the Printer Setup pop-up window similar to Pic 5, in the Name drop-down list you can see the name(s) of the printer(s). Currently mine's Generic Printer *i don't exactly know what it means :p*.

Pic 5 - Refer Step 4. Printer Setup pop-up window. Before installing the virtual printer.


What Pic 5 will look like with the presence of our virtual printer can be seen in Pic 16.

Close the Printer Setup pop-up window and quit Writer before proceeding to Part B.


Part B: Setting-up a virtual printer

The virtual printer i'm going to use is named CUPS-PDF. The steps explained in Part B of this post is simply the elaborated version of what is explained here, Installing a PDF Printer on Ubuntu. Tohir (the author in the previous link) explains how to use the Terminal as well as Synaptic Package Manager to install CUPS-PDF. i choose to use the Synaptic Package Manager. Another option is to use Ubuntu Software Center.


5. From the panel, System > Administration > Synaptic Package Manager. See Pic 6.

Pic 6 - Refer Step 5. Running the Synaptic Package Manager.


6. Depending on your user privileges, you might need to enter an administrative password similar to Pic 7. Type in the password in the Password field, then click the OK button.

Pic 7 - Refer Step 6. Enter the administrative password to proceed with Synaptic Package Manager.


Once that is done, you'll see the Synaptic Package Manager window similar to Pic 8.

Pic 8 - Refer Step 6. The Synaptic Package Manager window.


7. In the Synaptic Package Manager window, type this:
cups-pdf
in the Quick Search field. You'll see the filtered results similar to Pic 9.

Pic 9 - Refer Step 7. Filtered results for the term cups-pdf.


8. Referring to Pic 9, in the filtered results, there is a package named cups-pdf. To its leftmost will be a white box in the S column.

Click that white box. A pop-up menu similar to Pic 10 appears. Select the option Mark for Installation.

Pic 10 - Refer Step 8. Marking CUPS-PDF for installation.


The previously-white box will now have a tick inside it, as seen in Pic 11.

Pic 11 - Refer Step 8 and 9.


9. Referring to Pic 11, click the button in the toolbar labeled Apply.

A Summary pop-up window similar to Pic 12 appears. To see the list of item(s) to be installed, click the triangle next to To be installed. Click the Apply button to proceed with the installation.

If for some reasons there are other packages required for installation along with CUPS-PDF, my suggestion is to accept them. However if you're unsure, the safe step is to cancel the installation and look for information about those packages :). Better safe than sorry!

Pic 12 - Refer Step 9. Summarising packages to be installed.


Pic 13 shows the installation progress taking place. Once the installation process is done, the previously empty white box (Pic 9) is now a green-filled box, see Pic 14.

Pic 13 - Refer Step 9. Installation in progress.


Pic 14 - Refer Step 9. CUPS-PDF is now in the system!


A little note here. From online reads about CUPS-PDF, it is mentioned that you need to create a folder named PDF in your Home Folder before proceeding to create your PDF file. The latest news is: you don't have to do that any more! Because that folder-creating step has been eliminated. The folder will be auto-created along with your PDF file in it! i've created a PDF file without having a folder named PDF in my Home Folder :)


10. Now to check for our virtual printer. Refer to Step 1, Pic 1 and Pic 15.

Pic 15 - Refer Step 10. Our virtual printer is present. Compare Pic 15 to Pic 2.


Repeat Step 2-4 to check for the printer in Writer. See Pic 16.

Pic 16 - Refer Step 10. Printer Setup pop-up window. After installing the virtual printer. Compare Pic 16 to Pic 5.


Part C: Different paper-size printing (exporting)

11. Run OpenOffice Writer as shown in Step 2. Open the document you want to print in a different paper size.


12. Go to File > Page Preview. See Pic 17.

Pic 17 - Refer Step 12. Going to Page Preview view.


13. In the Page Preview view, click the Print options page view button (in the Page Preview toolbar) similar to Pic 18.


Pic 18 - Refer Step 13. Print options page view button to setup the current document.


The current document is the document you currently have in Writer.

The resulting document is the document that will be produced using CUPS-PDF.

A Print Option pop-up window similar to Pic 19 appears. Setup how you want your current document to align in the resulting document, then click OK. i use the default values.

Pic 19 - Refer Step 13. Preparing the layout of the current document on the resulting document.


14. Then click the Print page view button (in the Page Preview toolbar) similar to Pic 20.

Pic 20 - Refer Step 14. Print page view button to setup the resulting document then print (in this case, export) the current document.


The Print pop-up window similar to Pic 21 appears. Click the button Properties....

Pic 21 - Refer Step 14. Prior to printing.


The Properties of PDF pop-up window similar to Pic 22 appears. Set the Paper size to be the size of the resulting PDF document. Set the Orientation as well. Then click OK. i want mine to be an A4 in landscape.

Pic 22 - Refer Step 14. Setting-up the resulting document prior to printing.


When you come back to the Print pop-up window in Pic 21, click OK. Another pop-up similar to Pic 23 will appear, probably a few seconds depending on your document complexity.

Pic 23 - Refer Step 14. Printing in progress.


15. When the Printing... pop-up (Pic 23) disappears, check for your PDF file. From the panel, go to Places > Home Folder, as shown in Pic 24. Inside your Home Folder will be a PDF folder as shown in Pic 25. Inside the PDF folder will be your PDF file.

Pic 24 - Refer Step 15. Locating the Home Folder.


Pic 25 - Refer Step 15. Your PDF file is in the PDF folder.


You can see my results here:

Catatan Haid


Initially, the document came out right, only it was rotated to be portrait (all the writings were on their side). Simply using PDF-Shuffler to rotate them to be in landscape (all writings were right-side up).