You are not logged in.

#1 2010-12-08 22:53:48

Ben9250
Member
From: Bath - England
Registered: 2010-06-10
Posts: 208
Website

Trouble with Latex [SOLVED]

Hi, I'm trying to get an arial font for my latex documents. Lyx does not have one by default, but If I put:

\renewcommand{\rmdefault}{phv} % Arial
\renewcommand{\sfdefault}{phv} % Arial
 

into a document's preamble, then it does export to pdf as Arial.

I went tothe following website to try and install an Arial Font http://www.tug.dk/FontCatalogue/arial/
And followed the instructions, installing the relevent files into texmf-dist and running mktexlsr as sudo. But when I include

\usepackage[T1]{fontenc}
\usepackage[scaled]{uarial}
\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif

in the preamble in LyX as the site says I get an error telling me

pdfTeX error: pdflatex (file ua1r8r): Font ua1r8r at 570 not found

However I don't think I ever downloaded such a file, and don't think it's on that CTAN site. So I'm unsure on whether I installed it correctly or not, especially as the first preamble worked without installing a font.

I'm also looking to install wrapfig.sty but I'm not sure where this would go either, it's more confusing than it was for Ubuntu.

Does anyone know how I can get Arial or wrapfig.sty installed in the correct tree and it actually work? I've spent ages on this.

Cheers,
Ben.

Last edited by Ben9250 (2010-12-11 18:29:55)


"In England we have come to rely upon a comfortable time-lag of fifty years or a century intervening between the perception that something ought to be done and a serious attempt to do it."
  - H. G. Wells

Offline

#2 2010-12-08 23:14:02

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: Trouble with Latex [SOLVED]

Do you have texlive-fontsextra package installed?

First, phv is Nimbus Sans L, a Helvetica clone. (I think the "phv" stands for "postscript Helvetica"), not Arial, though most people can't tell them apart. I'm assuming Helvetica is close enough?

I'm a bit confused by the description of the problem. The first commands you gave with phv: they do or do not lead to a PDF with the right fonts? If so, what's the problem with those commands?

What happens with:

\usepackage[T1]{fontenc}
\usepackage{helvet}
\renewcommand*{\familydefault}{\sfdefault}

?

Try also the same with \usepackage{tgheros} in place of \usepackage{helvet} -- which provides TeX Gyre Heros, another Helvetica clone.

I've never actually tried to use the uarial package; it's tricky, since even though it uses URW A030 (an Arial clone), it's not completely a free license and so not typically included with default TeXlive installations. You could try the getnonfreefonts script, but from what I understand that doesn't seem to work so well with the Arch packages. (Works fine with TeXlive installed directly from TUG/CTAN though, which is what I have.)

Is the problem limited to LyX, or do you have similar problems if compiling a minimal document like this from the commandline:

pdflatex sample.tex

with this sample.tex

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[scaled]{helvet}
\renewcommand*{\familydefault}{\sfdefault}
\begin{document}
Hello world.
\end{document}

Is it important that you get Arial instead of phv/Helvetica?

Last edited by frabjous (2010-12-08 23:24:23)

Offline

#3 2010-12-08 23:16:46

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: Trouble with Latex [SOLVED]

Oh, about the other issue.

sudo pacman -S texlive-latexextra

should install wrapfig along with a number of other useful LaTeX packages.

How are things any harder than they are on Ubuntu? It seems to me that they're about the same. Personally, I prefer more control so I don't use either's package systems, and just install TeXlive directly using the net installer on the TUG site, which gives me the tlmgr for complete control ... but I don't see how the Arch packages are any harder to use than the Debian/Ubuntu ones.

Last edited by frabjous (2010-12-08 23:18:05)

Offline

#4 2010-12-09 00:41:05

Ben9250
Member
From: Bath - England
Registered: 2010-06-10
Posts: 208
Website

Re: Trouble with Latex [SOLVED]

Thanks, I think I may go for a vanilla lot then. I'm afraid the reason I probably find it more difficult is that I don't use LaTeX directly, or use if for programming as many people do, hence I don't use it nearly enough to become fluent in all it has to offer, for me it's so I can use Sweave and R code for data analysis. Currently I'm trying to get Org Mode and Babel working for my lab work, but I need the Arial Fonts as it, with 1.5 line spacing is the house document style at my uni. Helevatica works fine, the problem isn't with LyX, I was just using it to quicky judge that the font's were working, rather than write out a bit of tex code and go through the motions, just to find the font didn't work or something - it was just my method of quick assessment. I'm installing the fontsextra package now and I'll see what that does. To clarify, the first commands I gave did lead to a PDF with Arial(ish, maybe a clone or Helevatica) font's. The

\usepackage[T1]{fontenc}
\usepackage{uarial}
\renewcommand*{\familydefault}{\sfdefault}

Were what produced the error. I may try the getnonfreefonts script and see how it fares. The sample of tex code in a plain file and run through pdflatex didn't work either, for arial .

[EDIT] Neither of the commands worked with Org mode and LaTeX for the Arial font. Even after installing the extrafonts.

I'm considering going with the vanilla stuff on CTAN, and seeing if that helps things.

Last edited by Ben9250 (2010-12-09 01:13:38)


"In England we have come to rely upon a comfortable time-lag of fifty years or a century intervening between the perception that something ought to be done and a serious attempt to do it."
  - H. G. Wells

Offline

#5 2010-12-09 01:21:15

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: Trouble with Latex [SOLVED]

To clarify, the first commands I gave did lead to a PDF with Arial(ish, maybe a clone or Helevatica) font's

Why don't you just use those commands, if they work? That should give Helvetica instead of Arial, but what's wrong with that? They're very hard to tell apart. See, e.g. "How to Spot Arial".

The URW A030 font which uarial loads when it works is not an exact match for the standard Microsoft Arial which comes with Windows either, though I think it's closer. If you want that, I'd install ttf-ms-core from AUR and use XeLaTeX with the fontspec package.

Last edited by frabjous (2010-12-09 02:56:13)

Offline

#6 2010-12-09 01:26:15

Ben9250
Member
From: Bath - England
Registered: 2010-06-10
Posts: 208
Website

Re: Trouble with Latex [SOLVED]

The first command, it turns out, only worked in LyX, but not in Org or doing a .tex document. I'm trying to install texlive from CTAN now, although I may have a look at the XeLaTeX. According to the webpage, XeTeX is actually included in Tex Live. So if that does not mean I have to install anything else, how to I make use of XeTeX within Tex live (assuming that's what the webpage means, by it's included in tex -live).

Last edited by Ben9250 (2010-12-09 01:35:32)


"In England we have come to rely upon a comfortable time-lag of fifty years or a century intervening between the perception that something ought to be done and a serious attempt to do it."
  - H. G. Wells

Offline

#7 2010-12-09 03:09:18

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: Trouble with Latex [SOLVED]

I'm afraid I don't know much about Org; someone else would have to give you advice about that -- I'm a vimmer. It seems very strange to me, however, that it would work in LyX but not elsewhere.

I'm afraid I don't know much about Org; someone else would have to give you advice about that -- I'm a vimmer.

It seems very strange to me, however, that these font commands would work in LyX but not elsewhere.

If you save a text file as above, and then run

pdflatex filename.tex

on it, do you get Helvetica then?

XeTeX is a typesetting engine based on TeX but expanded to allow unicode input and arbitrary system (truetype and opentype) fonts. XeLaTeX is a set of macros for using XeTeX modelled on how LaTeX extends TeX. Generally, a XeLaTeX document is exactly like a LaTeX document and can use all (or nearly all) the same packages, plus some additional ones. The most important one is fontspec, which gives you a lot of font control. See the fontspec documentation. You then need to run:

xelatex filename.tex

instead of

pdflatex filename.tex

to produce a PDF. (You can no doubt set up your editor to do that. Heck, even recent versions of LyX provide a menu option for using XeLaTeX instead of regular LaTeX; though I've never done that myself. Details here.)

A minimal XeLaTeX document might look something like this:

\documentclass{article}
\usepackage{xunicode}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text.Ligatures=Common}
\setmainfont{Arial}
\begin{document}

Hello world.

\end{document}

That would use the Arial font installed systemwide.

Yes, xelatex should come with any up-to-date full TeXlive installation. I don't know which of the Arch packages it is contained in, but surely it's in texlive-most. If you install the full scheme of TeXlive from TUG/CTAN you should get it as well.

Last edited by frabjous (2010-12-09 03:10:44)

Offline

#8 2010-12-09 14:13:01

Ben9250
Member
From: Bath - England
Registered: 2010-06-10
Posts: 208
Website

Re: Trouble with Latex [SOLVED]

Thanks, I'm looking into trying to see if theres a way to have Org mode use XeLateX instead, I think theres a command I've seen that will go into a .emacs file, but I'll update later with progress. EDIT: Making a .tex file and using xelatex on it works, now I'm trying to get lyx to work, I keep inputting the converter and file handling settings in lyx and followed all the instructions here: http://wiki.lyx.org/LyX/XeTeX, but the converters or file formats keep dissapearing when I restart lyx and I get an error message when I try to export PDF (xelatex). Apparantly achiving this will be a lot easier as of Lyx 2.0

Last edited by Ben9250 (2010-12-09 14:58:15)


"In England we have come to rely upon a comfortable time-lag of fifty years or a century intervening between the perception that something ought to be done and a serious attempt to do it."
  - H. G. Wells

Offline

#9 2010-12-10 18:19:45

Ben9250
Member
From: Bath - England
Registered: 2010-06-10
Posts: 208
Website

Re: Trouble with Latex [SOLVED]

Tried to export using xelatex in Emacs and Org-Mode, I did this by switching the use of pdflatex to xelatex by changing

org-latex-to-pdf-process

to

xelatex -interaction nonstopmode %b

, and when I try to export the beginnings of a document to see if it works:

#+TITLE:My First Try with Org Mode
#+AUTHOR: Ben.
#+OPTIONS: num:nil ^:nil f:nil
#+LATEX_HEADER: \usepackage{amscd}
#+BABEL: :session *R* :results silent
#+LATEX_CLASS: article
#+begin_LaTeX:
 \usepackage{xunicode}
 \usepackage{fontspec}
 \defaultfontfeatures{Mapping=tex-text.Ligatures=Common}
 \setmainfont{Arial}
#+end_LaTeX:

Hellow World, more work to come

It exports to pdf, but does not export in the correct format i.e. not with the system Arial Font, but the normal roman-ish font. Is there some packages that are causing this or somethig else I need to do to the LaTeX headers or default package settings? So far the only thing I've changed is the org-latex-to-pdf-process. I haven't managed to find a great deal of information about this online.

Cheers.


"In England we have come to rely upon a comfortable time-lag of fifty years or a century intervening between the perception that something ought to be done and a serious attempt to do it."
  - H. G. Wells

Offline

#10 2010-12-10 18:56:00

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: Trouble with Latex [SOLVED]

I hope someone with more knowledge of Org mode has something to say, but at first blush, it appears to me that

 \usepackage{xunicode}
 \usepackage{fontspec}
 \defaultfontfeatures{Mapping=tex-text.Ligatures=Common}
 \setmainfont{Arial}

ought to go with after #+LATEX_HEADER: rather than after #+begin_LaTeX:.

Offline

#11 2010-12-11 18:29:38

Ben9250
Member
From: Bath - England
Registered: 2010-06-10
Posts: 208
Website

Re: Trouble with Latex [SOLVED]

I've managed to get the Arial font working with pdflatex as well, using getnonfreefonts installed them to a texmf folder in my home directory and they work, creating a .tex file and inputting the headers does the trick.


"In England we have come to rely upon a comfortable time-lag of fifty years or a century intervening between the perception that something ought to be done and a serious attempt to do it."
  - H. G. Wells

Offline

Board footer

Powered by FluxBB