This is a lame workaround to get excel plots as vector images.
Select your Micro$oft Excel plots. Copy. Open Micro$oft PowerPoint. Paste-special as enhanced metafile (emf) into an otherwise empty slide. Save your PowerPoint slide as an "other format" file (on the 2007 menu), and choose "emf" (an enhanced windows metafile! wow!). Import your emf file into inkscape and ungroup the object. Delect all the a4-sized crappy blank space from the image and enjoy.
Friday, 29 October 2010
Excel axis labels workaround
Problem:
When making an x-y scatter plot in Micro$oft Excel 2007, there appears to be a bug which prevents the x-axis tick labels displaying correctly (at least on my machine). When you set the x-axis tick labels to text, e.g. "apple", "banana", "pear"..., the chart just displays the labels as 1, 2, 3... even when you are careful to select the cells containing the text labels as your x-data, and despite them showing up correctly in the "select data" dialogue box. This only appears to be an issue for the x-y scatter plot type.
Workaround 1:
Install linux boot disc...
Workaround 2:
Add a new dummy data series to your graph with x = {"apple", "banana", "pear"...} and y = {0, 0, 0...}, or some other value below the y-axis minimum. Select only this series, and set the chart type to area. The x-axis tick labels should now display correctly for the whole chart. Obviously delete the dummy data label from your legend, if you have one.
When making an x-y scatter plot in Micro$oft Excel 2007, there appears to be a bug which prevents the x-axis tick labels displaying correctly (at least on my machine). When you set the x-axis tick labels to text, e.g. "apple", "banana", "pear"..., the chart just displays the labels as 1, 2, 3... even when you are careful to select the cells containing the text labels as your x-data, and despite them showing up correctly in the "select data" dialogue box. This only appears to be an issue for the x-y scatter plot type.
Workaround 1:
Install linux boot disc...
Workaround 2:
Add a new dummy data series to your graph with x = {"apple", "banana", "pear"...} and y = {0, 0, 0...}, or some other value below the y-axis minimum. Select only this series, and set the chart type to area. The x-axis tick labels should now display correctly for the whole chart. Obviously delete the dummy data label from your legend, if you have one.
Friday, 1 October 2010
Stupid papersize stupid stupid
After finally getting to the stage where my thesis would compile on a different computer (see last post to install the extra .sty files), I then discover my page headers have disappeared on my pdf output. It turns out that this is due to the default ps2pdf setting being US letter paper, rather than the A4 size that the rest of my document is on. The answer (for the moment, anyway) is this:
ps2pdf -sPAPERSIZE=a4 thesis.ps
I'm forced to go a-latexin' followed by dvipsin' then ps2pdf because of some bounding box issues with my images with pdflatex that I can't be bothered to solve.
That will serve me right for having a typo in my thesis.
ps2pdf -sPAPERSIZE=a4 thesis.ps
I'm forced to go a-latexin' followed by dvipsin' then ps2pdf because of some bounding box issues with my images with pdflatex that I can't be bothered to solve.
That will serve me right for having a typo in my thesis.
Thursday, 30 September 2010
Installing a latex .sty file
I've never managed to successfully do this until now. Here's the deal:
1) download & unzip the package from CTAN
2) run latex on the .ins file so that it creates a .sty file
3) find out what your computer thinks your TDS tree should be:
kpsewhich -var-value TEXMFLOCAL
(mine says "/usr/local/share/texmf")
4) create the tree /usr/local/share/texmf/tex/latex/ if it isn't already there (where is the name of your sty file)
5) paste in your .sty file
6) run mktexlsr /usr/local/share/texmf/
7) profit.
1) download & unzip the package from CTAN
2) run latex on the .ins file so that it creates a .sty file
3) find out what your computer thinks your TDS tree should be:
kpsewhich -var-value TEXMFLOCAL
(mine says "/usr/local/share/texmf")
4) create the tree /usr/local/share/texmf/tex/latex/
5) paste in your .sty file
6) run mktexlsr /usr/local/share/texmf/
7) profit.
Monday, 16 August 2010
Including pdf files into latex
Further to my earlier post today, this post is the story of how I managed to get my research papers into my thesis as appendices. The earlier post tells a fascinating tale of how I sorted the page counters out and forced some blank pages. I then compiled up to pdf (via ps2pdf, to include my eps diagrams). To insert my other pdf pages I wrote a new latex file to stitch stuff together using pdfpages. Sadly this makes my hyperlinks go away, but nevermind. The object here is to be able to have a file which can be printed and bound by people who don't care to re-arrange pages for me. Behold:
\documentclass[a4paper,portrait]{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages={1-32}]{thesis.pdf}
\includepdf[pages={33-34}, landscape, turn=false]{thesis.pdf} % some landscape pages
\includepdf[pages={35-202}]{thesis.pdf}
\includepdf[pages={1-5,{},{},{}}, landscape, nup=1x2, turn=false]{Appendices/specs.pdf}
\includepdf[pages={203-204}]{thesis.pdf}
\includepdf[pages={1-4}]{Appendices/prl.pdf}
\includepdf[pages={205-206}]{thesis.pdf}
\includepdf[pages={1-4}]{Appendices/pra.pdf}
\includepdf[pages={207-220}]{thesis.pdf}
\end{document}
Chunks of my thesis are included (I guess you can spot them), including some landscape pages as a special case. The "turn = false" means that any pdf viewers still display them as portrait. This was important to me, as I want to be able to check they're not going to print upside down! The last two appendices are four pages each and on American letter ("freedom") paper, but that's okay: they'll be scaled for A4. The "specs.pdf" file is 5 pages long and I have included it as 2-up printing on landscape pages which show as portrait in the viewer. Since I needed ensure that they occupy 4 sides of A4 in total, I included 3 blank pages denoted by the empty braces {}. So, the first two-and-a-half sides of A4 have the 5 pages of specs.pdf, and then there are one-and-a-half blank sides following.
I compile with pdflatex.
\documentclass[a4paper,portrait]{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages={1-32}]{thesis.pdf}
\includepdf[pages={33-34}, landscape, turn=false]{thesis.pdf} % some landscape pages
\includepdf[pages={35-202}]{thesis.pdf}
\includepdf[pages={1-5,{},{},{}}, landscape, nup=1x2, turn=false]{Appendices/specs.pdf}
\includepdf[pages={203-204}]{thesis.pdf}
\includepdf[pages={1-4}]{Appendices/prl.pdf}
\includepdf[pages={205-206}]{thesis.pdf}
\includepdf[pages={1-4}]{Appendices/pra.pdf}
\includepdf[pages={207-220}]{thesis.pdf}
\end{document}
Chunks of my thesis are included (I guess you can spot them), including some landscape pages as a special case. The "turn = false" means that any pdf viewers still display them as portrait. This was important to me, as I want to be able to check they're not going to print upside down! The last two appendices are four pages each and on American letter ("freedom") paper, but that's okay: they'll be scaled for A4. The "specs.pdf" file is 5 pages long and I have included it as 2-up printing on landscape pages which show as portrait in the viewer. Since I needed ensure that they occupy 4 sides of A4 in total, I included 3 blank pages denoted by the empty braces {}. So, the first two-and-a-half sides of A4 have the 5 pages of specs.pdf, and then there are one-and-a-half blank sides following.
I compile with pdflatex.
LaTeX: coloured text and blank page fun.
I want to insert some research papers into my thesis. These are in separate pdf files which I don't yet know how I will insert. (pdfpages isn't my friend because I'm banned from using pdflatex due to having eps graphics which I can't be bothered to convert.)
I'll figure out that bit in a minute, but right now I want to force a blank page (with a header and footer) which will be printed on the reverse of an appendix section page. This has to come before the place where I will insert the pdf pages. Actually, latex adds this page automatically at the moment, because it wants my "Appendix" section pages to be on the right-hand sides of my document. The issue is that if I then start to add to my page counter, the reverse-side blank page has the wrong page number for where it will be printed!
Here's my work-around. Each introductory page for an appendix goes like this:
\chapter{An included paper}
Following is a copy of an amazing paper from our research group.
\newpage
\mbox{}
The mbox ensures the new page actually happens. Then, before the next \include{} in the master file, I add four pages (the research paper length!) to my counter.
\addtocounter{page}{4}
So far, so awesome. Now I'll fight to include the papers in the file. I'm thinking psutils...
OH! I forgot to tell you about coloured text! Before I found the mbox doo-dah I was going to just write "cheese" in white on the blank page. I'd do the following in my preamble:
\usepackage{color}
\definecolor{orange}{rgb}{1,0.5,0}
and then on my "blank" page, I'd do:
\newpage
\textcolor{orange}{cheese}
Ok, that's orange, but you get the picture. You can define white.
I'll figure out that bit in a minute, but right now I want to force a blank page (with a header and footer) which will be printed on the reverse of an appendix section page. This has to come before the place where I will insert the pdf pages. Actually, latex adds this page automatically at the moment, because it wants my "Appendix" section pages to be on the right-hand sides of my document. The issue is that if I then start to add to my page counter, the reverse-side blank page has the wrong page number for where it will be printed!
Here's my work-around. Each introductory page for an appendix goes like this:
\chapter{An included paper}
Following is a copy of an amazing paper from our research group.
\newpage
\mbox{}
The mbox ensures the new page actually happens. Then, before the next \include{} in the master file, I add four pages (the research paper length!) to my counter.
\addtocounter{page}{4}
So far, so awesome. Now I'll fight to include the papers in the file. I'm thinking psutils...
OH! I forgot to tell you about coloured text! Before I found the mbox doo-dah I was going to just write "cheese" in white on the blank page. I'd do the following in my preamble:
\usepackage{color}
\definecolor{orange}{rgb}{1,0.5,0}
and then on my "blank" page, I'd do:
\newpage
\textcolor{orange}{cheese}
Ok, that's orange, but you get the picture. You can define white.
Monday, 7 June 2010
Non-coloured hyperrefs in latex
So, I love to leap around my thesis like superman using the "hyperref" package. However, I do not like increased printing costs by having pretty pink references on every page (our printer selects the cheaper b/w printing intelligently). I was colouring my links black using this clunky bit of code:
\hypersetup{
colorlinks,%
citecolor=black,%
filecolor=black,%
linkcolor=black,%
urlcolor=black
}
...but this resulted in the printer choosing to mix colours to achieve black text on pages with a hyperlink! Argh! It looked stupid, it was stupid! Hopefully this more elegant bit of code might fix whatever oddity is occuring:
\hypersetup{pdfborder={0 0 0},colorlinks = false}
The pdf certainly looks no different... fingers crossed for printing time.
\hypersetup{
colorlinks,%
citecolor=black,%
filecolor=black,%
linkcolor=black,%
urlcolor=black
}
...but this resulted in the printer choosing to mix colours to achieve black text on pages with a hyperlink! Argh! It looked stupid, it was stupid! Hopefully this more elegant bit of code might fix whatever oddity is occuring:
\hypersetup{pdfborder={0 0 0},colorlinks = false}
The pdf certainly looks no different... fingers crossed for printing time.
Subscribe to:
Posts (Atom)
