Times New Roman font in Latex

1. Nov 20, 2012

S_David

Hello,

I need to change the font in my latex file to Times New Roman, and I used this in the preamble to do that:

Code (Text):

\usepackage{fontspec}
\setmainfont{Times New Roman}

but I get errors in compilation from PS->PDF. Why? Is there any other way? I need this compilation from PS->PDF for some figures to appear correctly.

Thanks

2. Nov 20, 2012

Simon Bridge

How are you doing the compilation and what are the errors?

3. Nov 20, 2012

S_David

Latex->PS->PDF. There are 10 errors. They are not in front of me now.

4. Nov 21, 2012

Simon Bridge

In order to turn a .tex file into a .ps file, you had to use a computer program - there are lots that do this: which one did you use. Likewise for doing the .ps to a .pdf.

You can turn a .tex directly into pdf using the program "pdflatex" for example, or from ps to pdf using "ps2pdf".

The errors are important for figuring out what went wrong.
i.e. perhaps the font does not have some of the characters you are trying to use - the errors will tell you that.

5. Nov 21, 2012

S_David

No I need to go from PS to PDF as I have tikz figures. Anyway, I have done it using XeLatex and it works now. Thanks

6. Nov 21, 2012

Simon Bridge

Yep, XeLatex bundles the stuff commonly needed and has good online support.
I still use CLI latex and pdflatex with a text editor. For anything besides pdf I'd export to dvi but tiks figures won't do that will they?

Of course you could have imported the ps using Adobe Acrobat ... but you may be using Linux or only free/gratis software. In future - remember that this sort of question is meaningless without the names of the software used and the exact error messages (copy and paste).

7. Nov 22, 2012

AlephZero

That figures, because XeTeX handles fonts in a completely different way from older versions of TeX. Earlier versions wouldn't understand
Code (Text):

\sepackage{fontspec}
\setmainfont{Times New Roman}

Of course there is a way to use Times Roman in earlier versions of TeX, but if your document was meant to be processed by XeTeX, changing that might only be the first of a long list of compatibility issues!

8. Nov 22, 2012

S_David

OK, I will remember that. I am using TeXnicCenter. Thanks

Yet there is another problem, which is that my document is now written in two fonts after using the above package: Not all my document appear the same. Some fonts are the default (which is bright), and some fonts are Times New Roman (which is dark). Why?

9. Nov 22, 2012

AlephZero

If you make a SMALL document that shows the problem and attach it, somebody might be able to help.

Otherwise, we are just guessing. You haven't told us anything about what you did except "it didn't work".

10. Nov 22, 2012

S_David

Here are two consecutive pages, where it appears to me that the first one is not Times New Roman, but the second one is.

Thanks

Attached Files:

• Pages from Proposal.pdf
File size:
112.6 KB
Views:
163
11. Nov 22, 2012

AlephZero

When I said "attach the file" I meant the tex input file, not just the output, so anybody who is interested enough can play around with it in their version of TeX.

I'm not convinced you have two different fonts. I can see what you describe when I look at the PDF with Adobe Reader 11, but when I zoomed in on the same word on pages 1 and 2, made two screen dumps, and pasted them side by side, I can't see any difference at all. (Open the attachment in a separate window to see it "full size").

Using "properties" in Adobe reader the only fonts in the PDF are Times Roman, Times Roman Bold (probably used for the headings) and a lot of the Computer Modern fonts for the math. Computer Modern text fonts don't look anything like Times Roman, so can't be one of those.

This is probably some weird artefact of way the the PDF viewer is rendering the font, not a TeX problem. It's possible you have done something (e.g. when creating the figure?) that changed the "weight" (i.e. blackness) of the font slightly, and didn't change it back again. Try deleting the figure and see if that gets rid of the problem.

Attached Files:

• the.png
File size:
2.2 KB
Views:
175
12. Nov 22, 2012

S_David

I tried to do the same as in my document, but the result was not the same:

Code (Text):
\documentclass[a4paper,oneside,12pt]{report}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{fontspec}
\setmainfont{Times New Roman}

\begin{document}

A major design parameter here is the accuracy of the factor $a$, and the residual Doppler the tolerated by an adaptive equalizer, where a residual Doppler of the order $10^{-4}$ is needed to a ... equalizer to track the changes, otherwise, it diverge .... In ... it was shown that the preprocessing resampling converts the wide-band signal to a narrow-band signal, where ... can be used to eliminate the residual Doppler effect resulting from the estimation error of the factor $a$.

\tikzstyle{block} = [draw, top color=blue!40,
\tikzstyle{sum} = [draw, top color=blue!40, bottom color=blue!5, circle, node distance=1cm, shade,drop shadow]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]

\begin{figure}[h!]
\begin{center}
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
%\begin{tikzpicture}[scale = 0.6]
% We start by placing the blocks
\node [input, name=input] {};

\node [block, right of=input,node distance=3cm] (Map) {Mapping};
\node [block, right of=Map,
node distance=4cm] (IDFT) {IDFT \& $+$CP};
\node [block, right of=IDFT,
node distance=4cm] (ch) {$\{h_l\}$};
\node [block, below of=ch,
node distance=3cm] (DFT) {-CP \&  DFT};
\node [output, right of=ch,node distance=3cm] (output1) {};
\node [sum, below of=output1,node distance=1.5cm] (sum) {$\Sigma$};
\node [block, left of=DFT,
node distance=4cm] (FDE) {FDE};
\node [block, left of=FDE,
node distance=4cm] (Dec) {Detection};
\node [output, left of=Dec,node distance=3cm] (output2) {};
\node [input, right of=sum,node distance=2cm] (input2) {};
%\node [output, name=output, right of=IDFT] {};
% We draw an edge between the controller and system block to
% calculate the coordinate u. We need it to place the measurement block.
%\draw [->] (controller) -- node[name=u] {$u$} (system);

%\node [block, below of=u] (measurements) {Measurements};
%
%% Once the nodes are placed, connecting them is easy.
\draw [draw,->] (input) -- node {$\{b_k\}$} (Map);
\draw [draw,->] (Map) -- node {$\{X_k\}$} (IDFT);
\draw [draw,->] (IDFT) -- node {$\{x_n\}$} (ch);
\draw [draw,->] (ch) -| node {} (sum);
%\draw [draw,->] (sum) -- node {} (output1);
\draw [draw,->] (sum) |- node [pos=0.8]{$\{y_n\}$} (DFT);
\draw [draw,->] (DFT) -- node {$\{Y_k\}$} (FDE);
\draw [draw,->] (FDE) -- node {$\{\tilde{X}_k\}$} (Dec);
\draw [draw,->] (Dec) -- node {$\{\hat{b}_k\}$} (output2);
\draw [draw,->] (input2) -- node {$\{z_n\}$} (sum);
%\draw [->] (sum) -- node {$e$} (controller);
%\draw [->] (system) -- node [name=y] {$y$}(output);
%\draw [->] (y) |- (measurements);
%\draw [->] (measurements) -| node[pos=0.99] {$-$}
%node [near end] {$y_m$} (sum);
\end{tikzpicture}
\caption{OFDM block diagram}
\label{Fig:OFDMBD}
\end{center}
\end{figure}

A major design parameter here is the accuracy of the factor $a$, and the residual Doppler the tolerated by an adaptive equalizer, where a residual Doppler of the order $10^{-4}$ is needed to a .. equalizer to track the changes, otherwise, it diverge .... In ... it was shown that the preprocessing resampling converts the wide-band signal to a narrow-band signal, where ... can be used to eliminate the residual Doppler effect resulting from the estimation error of the factor $a$.
\end{document}
where I separate two paragraphs by a tikz figure, and the tow paragraphs are of the same fonts and darkness, while they are not in my document!!

13. Nov 22, 2012

S_David

I deleted the figure, but it is still there!!

14. Nov 22, 2012

AlephZero

OK, the "good" news is I can reproduce it, but understanding it might take longer (and I don't have much time tomorrow).

It seems to be affecting all the text on the page with the figure on it (both before and after the actual figure). The preceding and following pages all seem to be in the "light" typeface.

IMO that's a "should not happen" situation - it suggests something is incompatible with something else, but it's not at all obvious what.

15. Nov 22, 2012

S_David

I am home now, tomorrow I will post my preamble. May be I am using some packages that make that effect. Do you thing fade or shadow in the tikz package may have this effect?

16. Nov 23, 2012

AlephZero

Deleting the "drop shadow" option in \tikzstyle{block} and \tikzstyle{sum} seems to fix it. The "shade" option doesn't seem to affect anything apart from the drop shadows so you can probably delete that as well.

FWIW I got a warning in the .log file saying

Googling various TeX forums, it seems like the only workround is to make a separate tex file for each figure, create a PDF for each one, then use \includegraphics to merge them into the complete document. You will have to play around with the "bounding box" options of \includedgraphics to crop the images down to their "actual size".

Of course an easier workround is to decide that you don't really need boxes with shadows!

17. Nov 23, 2012

S_David

When I delete drop shadow the font becomes light, but it should be dark, shouldn't it? The same for another document I have under the same specifications, the font is dark.!!