Показват се публикациите с етикет Latex. Показване на всички публикации
Показват се публикациите с етикет Latex. Показване на всички публикации

събота, 10 януари 2015 г.

How to convert color eps to grayscale

That turned out more complicated that it seems. The default ways didn't seem to work for me, because the eps was produced by Maple (so there is a bitmap graphics inside).

Here is what it worked for my figure.eps:

$epstopdf figure.eps
$gs  -sOutputFile=output.pdf  -sDEVICE=pdfwrite  -sColorConversionStrategy=Gray  -dProcessColorModel=/DeviceGray  -dCompatibilityLevel=1.4  -dNOPAUSE  -dBATCH  figure.pdf
$ pdftops -eps output.pdf

This can be done easily to a script like this:

#!/bin/bash
epstopdf $@ -o output_eps.pdf
gs -sOutputFile=output.pdf -sDEVICE=pdfwrite -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -dCompatibiltyLevel=1.4 -dNOPAUSE -dBATCH output_eps.pdf
pdftops -eps output.pdf

Save it as epstograyscale.sh
$sudo chmod +x  epstograyscale.sh
$sh epstograyscale.sh figure.eps

It worked on my PC.

петък, 20 април 2012 г.

How to install Latex winfonts in Linux

As unbelievable as it is, for a second time this year, I need to redo scientific publications prepared in Latex, in a way that they will fit the Windows-based journal/proceedings. Shame for physicists and physics as a whole. People simply don't value real quality these days.
So after some wine-emulations of Mathtype, now I have to make a document title "Times New Roman, 9pt, bold". Oh, well.
My research didn't lead to satisfying solution, so I decided to make the whole document in the Times font using \usepackage{pslatex} which seems to do the job. The change of the size was done by:
\fontsize{9pt}{11pt}\selectfont
Later I found this lovely instructions how to install winfonts under Linux, something which the README of the winfonts didn't inform me of.


1. download winfonts.zip from http://www.ctan.org/tex-archive/fonts/winfonts/
2. unzip it to your local texmf tree $unzip winfonts.zip -d ~/texmf.
3. make font files recognized by TeX.
$mkdir -p ~/texmf/fonts/TTF && cd ~/texmf/fonts/TTF && ln -s /usr/share/fonts/TTF
(assuming the font files such as verdana.ttf are under /usr/share/fonts/TTF)
3. $mktexlsr
4. $updmap --enable Map winfonts.map
5. To use them:
\documentclass[]{article}
\usepackage[T1
]{fontenc}
\usepackage{winfonts}
\renewcommand{\rmdefault}{georgia}
\renewcommand{\sfdefault}{verdana}
\renewcommand{\ttdefault}{courier-ttf
}
\begin{document}
dark \textsf{star} \texttt{13}
\end{document
}
It turns out that it's not that hard to install the fonts. Then, if you want to apply them only to certain text and not to the whole document, you can select them with \fontfamily{times-ttf}\selectfont{} And that's it.
I don't quite understand how I could need this information to start with, but since I obviously need to do stunts like this, this information is certainly very helpful.
Another Latex-related helpful link is: http://franz.kollmann.in/latex/latex.html
And also, the wiki for the page dimensions: http://en.wikibooks.org/wiki/LaTeX/Page_Layout#Page_dimensions