Re: [pstricks] MacTEX install problems

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [pstricks] MacTEX install problems

Luis Sequeira-5
> I "successfully" installed MacTEX-2012 and tried to run the examples supplied with the package. Some worked. None of the pstricks or foreign language examples worked. My main is to use "pstricks" and "pst-func."
>
> I fear some is wrong with the installation. I cannot find any files described in "What has been installed" pdf.
>
> I previously installed TexLive prior to installing MacTEX-2012. My guess that there is installation error.
>
> Should I thrash TexLIVE and TexShop and try to install MacTEX-2012 again?
>
>
>

I assume you are using TeXShop to typeset your documents.
You need to tell TeXShop which TeX program it should use to typeset.
The default is pdflatex, but that does not work well with pstricks, because pstricks requires postscript support.
You could change the default, but there is a better way.

In the following, I will assume the traditional path for pstricks documents, which is to use latex, dvips, and ps2pdf to generate your output.
Nontraditional paths, using either pdflatex, lualatex or xelatex, are possible, but all involve some trickery to make pstricks work.

TeXShop allows you to enter some particular comments at the start of a file. Since they are comments (starting with the '%' sign), they are ignored by TeX;
but TeXShop uses them to decide what program to call.

The easy way to do put the cursor at the beginning of the file and use the Macros->Program menu command. From the list that appears, choose 'latex'.
TeXShop will enter the following into your source file:

% !TEX TS-program = latex

When present, TeXShop will use latex+dvips+ps2pdf for that particular document, regardless of the default you had set.

For foreign characters the situation is similar. TeX does not know about, since it was create in the '70s.
You have to set the encoding and to use the appropriate package.
The default is Mac Roman, but nowadays the right choice is Unicode. You should change the default encoding in TeXShop preferences.
Also, there is a similar command to help TeXShop decide which encoding to choose. Go to Macros->Encoding and choose UTF-8 Unicode.
This will enter the following into your source:

% !TEX encoding = UTF-8 Unicode


Then in your code, use

\usepackage[utf8x]{inputenc}

to tell latex how to deal with non-ascii characters.

Luis Sequeira



----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

Reply | Threaded
Open this post in threaded view
|

Re: [pstricks] MacTEX install problems

Don Green Dragon
Hi Luis,

> <<snip>>
> I assume you are using TeXShop to typeset your documents.

Yes.

Your advice below makes me wonder if I should make some fundamental changes in the basic template that I have developed over the last year of so. It works well but there are a couple of lines therein that I've never really understood and wonder now if they should be changed.

Normally, I use a master/root file as the basic source file with auxiliary source files in subdirectories of the master/root directory. In my template I have NEITHER of the lines

% !TEX TS-program = latex
% !TEX encoding = UTF-8 Unicode

however I do have the two lines

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

The second line is included because it allows me to use the guillemets characters and certain other symbols, but I've never really understood why the first line is there. Note that the first line above is NOT what you recommend below, namely

\usepackage[utf8x]{inputenc}

Should I be using the version you suggest? What would the difference be?



> You need to tell TeXShop which TeX program it should use to typeset.
> The default is pdflatex, but that does not work well with pstricks, because pstricks requires postscript support.
> You could change the default, but there is a better way.
>
> In the following, I will assume the traditional path for pstricks documents, which is to use latex, dvips, and ps2pdf to generate your output.
> Nontraditional paths, using either pdflatex, lualatex or xelatex, are possible, but all involve some trickery to make pstricks work.
>
> TeXShop allows you to enter some particular comments at the start of a file. Since they are comments (starting with the '%' sign), they are ignored by TeX;
> but TeXShop uses them to decide what program to call.
>
> The easy way to do put the cursor at the beginning of the file and use the Macros->Program menu command. From the list that appears, choose 'latex'.
> TeXShop will enter the following into your source file:
>
> % !TEX TS-program = latex
>
> When present, TeXShop will use latex+dvips+ps2pdf for that particular document, regardless of the default you had set.
>
> For foreign characters the situation is similar. TeX does not know about, since it was create in the '70s.
> You have to set the encoding and to use the appropriate package.
> The default is Mac Roman, but nowadays the right choice is Unicode. You should change the default encoding in TeXShop preferences.


In  TextShop -> Preferences... -> Encoding

the default "Western(Mac OS Roman)" is still in effect. I'm leery of changing that to one of

  Unicode (UTF-8)  or  Unicode (UTF-16)

but I conclude that you are recommending such a change! If I were to select one of the above, then I wonder what TeXShop does when opening an 'old' .tex file that was created using the "Western(Mac OS Roman)" option.



> Also, there is a similar command to help TeXShop decide which encoding to choose. Go to Macros->Encoding and choose UTF-8 Unicode.
> This will enter the following into your source:
>
> % !TEX encoding = UTF-8 Unicode
>
>
> Then in your code, use
>
> \usepackage[utf8x]{inputenc}
>
> to tell latex how to deal with non-ascii characters.
>
> Luis Sequeira


Thank you for your explanations which I found both interesting and embarrassing!  :-)


Don Green Dragon
[hidden email]




----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Reply | Threaded
Open this post in threaded view
|

Re: [pstricks] MacTEX install problems

Peter Dyballa

Am 03.08.2013 um 02:05 schrieb Don Green Dragon:

> In my template I have NEITHER of the lines
>
> % !TEX TS-program = latex
> % !TEX encoding = UTF-8 Unicode
>
> however I do have the two lines
>
> \usepackage[utf8]{inputenc}
> \usepackage[T1]{fontenc}

The first two lines, those starting with the percent sign, are only meaningful for the TeXShop application. Every TeX related binary does not see them, because they are comments. For TeXShop they are setting "latex" as the command to compile the source file (which means DVI output, not PDF directly, only a bit of micro-typography, no support for TrueType fonts, instead a possibly better support of PSTricks) and the UTF-8 text encoding for its contents, which matches the LaTeX source's setting

> \usepackage[utf8]{inputenc}

>
> The second line is included because it allows me to use the guillemets characters and certain other symbols, but I've never really understood why the first line is there. Note that the first line above is NOT what you recommend below, namely
>
> \usepackage[utf8x]{inputenc}

Both encodings are more or less equal. The "utf8" encoding is legacy, provided by the LaTeX team, the "utf8x" encoding is Heiko Oberdiek's work, just another package. Their documentation can be found here:

        /usr/local/texlive/2012/texmf-dist/doc/latex/base/inputenc.pdf
        /usr/local/texlive/2012/texmf-dist/doc/latex/oberdiek/inputenx.pdf

>
> In  TextShop -> Preferences... -> Encoding
>
> the default "Western(Mac OS Roman)" is still in effect. I'm leery of changing that to one of
>
> Unicode (UTF-8)  or  Unicode (UTF-16)
>
> but I conclude that you are recommending such a change! If I were to select one of the above, then I wonder what TeXShop does when opening an 'old' .tex file that was created using the "Western(Mac OS Roman)" option.

The LaTeX formats based on the pdfTeX or original TeX engines *do not* support a 16-bit encoding (pTeX, XeTeX, and LuaTeX support 16-bit input encodings). To help TeXShop understand the file's encoding – if it does not read in a basic 8-bit encoding the \usepackage[???]{inputenc} line – use the line "!TEX encoding" line Luis was recommending, but use the correct name TeXShop uses and which matches the chosen LaTeX input encoding!

--
Greetings

  Pete

The world would be a better place if Larry Wall had been born in Iceland, or any other country where the native language actually has syntax.
                                – Peter da Silva


----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex