LaTeX forum ⇒ Conversion ToolsProblem with conversion from PS to PDF

Information and discussion about output converters related to LaTeX (e.g. dvips, ps2pdf, ...)
User avatar
lanmmt
Posts: 21
Joined: Tue Sep 28, 2010 6:43 pm

Problem with conversion from PS to PDF

Postby lanmmt » Thu Sep 30, 2010 9:37 pm

Well I was playing around with ps2pdf and I'm also unhappy with the results - what is making me unhappy is when I'm selecting some text, it selects text strangely ... I attached an example that shows the problem.

The problem might be related to that described in »Converting from PS to PDF«.
Attachments
ps2pdfTEST.pdf
(13.29 KiB) Downloaded 192 times

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Fri Oct 01, 2010 5:20 pm

lanmmt wrote:Well I was playing around with ps2pdf and I'm also unhappy with the results - what is making me unhappy is when I'm selecting some text, it selects text strangely ... I attached an example that shows the problem.

The entire code of that sample would be much more interesting to see what might cause this behaviour.


Best regards
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

User avatar
lanmmt
Posts: 21
Joined: Tue Sep 28, 2010 6:43 pm

Postby lanmmt » Sun Oct 03, 2010 10:24 pm

  1. \documentclass[11pt]{book}
  2. %\usepackage[left=2.8cm, right=2.8cm, bottom=4cm]{geometry}
  3.  
  4. %%%%%%%%%%% FONTS %%%%%%%%%%
  5. %\usepackage{english}
  6. \usepackage{tipa}
  7. \usepackage[T1]{fontenc}
  8. \usepackage{anyfontsize}
  9.  
  10.  
  11. %%%%%%%%%% FONTS MATH %%%%%%%
  12. %\usepackage{pxfonts}
  13. %\usepackage{amsfonts}
  14. \usepackage{amsmath}
  15. \usepackage{amssymb}
  16. %\usepackage{dsfont}
  17.  
  18. \usepackage{braket}
  19.  
  20. \usepackage{enumerate}
  21.  
  22.  
  23. \usepackage[usenames,dvipsnames]{pstricks}
  24. % \usepackage{epsfig}
  25. % \usepackage{pst-grad} % For gradients
  26. % \usepackage{pst-plot} % For axes
  27. \usepackage{graphicx}
  28. \usepackage{picture}
  29. \usepackage{epsfig}
  30. \usepackage{psfrag}
  31. \usepackage{color}
  32. \usepackage{subfigure}
  33.  
  34. %%%%% MY DEF. %%%%
  35. \newtheorem{proof}{Proof}[section]% ew. zmienić num.
  36.  
  37. %%% cz I %%%
  38. \newcommand{\dd}{\mathrm{d}} % pochodna - d
  39. \newcommand{\db}{\mathrm{dB}}
  40.  
  41. \newcommand{\e}{\mathrm{e}} % liczba e
  42. \newcommand{\ii}{\mathtt{i}} % liczba i
  43. %%% cz II %%%
  44. \newcommand{\w}{\boldsymbol} % pogrubienie na wektor
  45. \newcommand{\E}{\mathcal{E}} % enargia - E "kręcone"
  46.  
  47. %%% cz przed I %%%
  48. \newcommand{\h}{\hat} % do macierzy
  49. \newcommand{\lf}{\left}
  50. \newcommand{\ri}{\right}
  51. %\usepackage{textcomp}
  52. \newtheorem{EX}{Example}[subsection]
  53.  
  54. \newcommand{\Tr}{\mathrm{Tr}} % ślad macierzy Tr
  55. \newcommand{\kb}{k_B} %
  56. \newcommand{\kbt}{k_B T}
  57. \newcommand{\kbT}{k_B T}
  58.  
  59. \newcommand{\tx}{\text}
  60. \newcommand{\vel}{\upsilon}
  61.  
  62.  
  63. %%%%%%% GRAPHIC & TABLES %%%%%%%%%%%%%%
  64. \usepackage{epsfig}
  65. %\usepackage{floatflt}
  66. \usepackage{wrapfig}
  67. \usepackage{multirow}
  68.  
  69.  
  70. \usepackage{braket} % pakiet do "nawiasów"
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  78. % New definition of square root:
  79. % it renames \sqrt as \oldsqrt
  80. \let\oldsqrt\sqrt
  81. % it defines the new \sqrt in terms of the old one
  82. \def\sqrt{\mathpalette\DHLhksqrt}
  83. \def\DHLhksqrt#1#2{%
  84. \setbox0=\hbox{$#1\oldsqrt{#2\,}$}\dimen0=\ht0
  85. \advance\dimen0-0.2\ht0
  86. \setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
  87. {\box0\lower0.4pt\box2}}
  88. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  89.  
  90. \allowdisplaybreaks[4] %łamanie wierszy z wyrażeniami mat.
  91.  
  92. \begin{document}
  93. are separate and their particles do not mix, that is particle number $N$ and $N_0$ and volumes of the systems are constant, they can exchange the energy.
  94. %%%%%%%%%% rysunek %%%%%%%%%%%%%
  95. \begin{center}
  96. \scalebox{1} % Change this value to rescale the drawing.
  97. {
  98. \begin{pspicture}(0,-1.65)(6.54,1.65)
  99. \psellipse[linewidth=0.04,dimen=outer,fillstyle=solid](3.85,0.0)(2.69,1.65)
  100. \psellipse[linewidth=0.04,dimen=inner,fillstyle=solid](1.59,0.43)(1.59,0.96)
  101. \usefont{T1}{ptm}{m}{n}
  102. \rput(1.5214063,0.48){$E$, $N$, $V$}
  103. \usefont{T1}{ptm}{m}{n}
  104. \rput(3.8914063,-0.72){$E_0-E$, $N_0$, $V_0$}
  105. \usefont{T1}{ptm}{m}{n}
  106. \rput(4.4178123,0.52){heat bath}
  107. \end{pspicture}
  108. }
  109. \end{center}
  110. \end{document}

so here it is

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Wed Oct 06, 2010 8:01 pm

Uh-oh, what a dump of code. Never thought that it would be so much. At first sight I see some obsolete packages [1]. Furthermore you are loading packages twice.

Many packages and other parts of the code seem not to be relevant to the problem. But I assume that you need them and know exactly what they are doing.

Since it is too time consuming to dig through the code of your example, I can only offer a short document that should work fine.
  1. \documentclass[11pt,a4paper,english]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{babel}
  5. \usepackage{pstricks-add}
  6.  
  7. \begin{document}
  8. are separate and their particles do not mix, that is particle number $N$ and $N_0$ and volumes of the systems are constant, they can exchange the energy.
  9.  
  10. \begin{figure}[!ht]
  11. \centering
  12. \begin{pspicture}[showgrid=false](-3,-2)(3,2)
  13. \psellipse(0,0)(2.5,1.5)
  14. \psellipse[fillstyle=solid](-1.5,0.75)(1.5,0.9)
  15. \rput(-1.5,0.75){$E$, $N$, $V$}
  16. \rput(0,-0.75){$E_0-E$, $N_0$, $V_0$}
  17. \rput(1,0){heat bath}
  18. \end{pspicture}
  19. \caption{A figure}\label{fig:figure}
  20. \end{figure}
  21. \end{document}

Compile this the way you mentioned and see if it is working. Otherwise present a minimal example that reproduces the behaviour [2]. That means to shorten the original code until a minimum remains that fails.

[1] View topic: Obsolete packages and document classes — Avoid usage!
[2] View topic: Avoidable mistakes
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Postby CrazyHorse » Wed Oct 06, 2010 8:32 pm

lanmmt wrote:so here it is

it is a problem with the viewer and not the code and not ps2pdf.

Herbert

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Wed Oct 06, 2010 8:52 pm

CrazyHorse wrote:it is a problem with the viewer and not the code and not ps2pdf. […]

I can comprehend the problem with Adobe Reader (on Wind0ws) and Okular (on Linux). Tests on my other machine with other viewers on Wind0ws will have to wait until I fixed the hardware crash.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

User avatar
lanmmt
Posts: 21
Joined: Tue Sep 28, 2010 6:43 pm

Postby lanmmt » Wed Oct 06, 2010 8:58 pm

...well it works, almost...
now the text is ok, but all the time I see that (1,1) in the left top corner, and in the book (I'm writing - that's the cause of so long preambule - I need it all, and thank you that you have noticed I have double comends) I get two extra pages at the begining o_O and I get this:
  1. ! Undefined control sequence.
  2. \resetOptions ...\pst@linetype {0}\pstScalePoints
  3. (1,1){}{}\psset [pstricks-...
  4. l.2054 \resetOptions
  5.  
  6. ? h
  7. The control sequence at the end of the top line
  8. of your error message was never \def'ed. If you have
  9. misspelled it (e.g., `\hobx'), type `I' and the correct
  10. spelling (e.g., `I\hbox'). Otherwise just continue,
  11. and I'll forget about whatever was undefined.
  12.  
  13. ?
  14.  
  15. ! LaTeX Error: Missing \begin{document}.
  16.  
  17. See the LaTeX manual or LaTeX Companion for explanation.
  18. Type H <return> for immediate help.
  19. ...
  20.  
  21. l.2054 \resetOptions
  22.  
  23. ?
  24. )

the same problem was with the code you've posted.

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Postby CrazyHorse » Wed Oct 06, 2010 9:05 pm

lanmmt wrote:...well it works, almost...
now the text is ok, but all the time I see that (1,1) in the left top corner, and in the book (I'm writing - that's the cause of so long preambule - I need it all, and thank you that you have noticed I have double comends) I get two extra pages at the begining o_O and I get this:
  1. ! Undefined control sequence.
  2. \resetOptions ...\pst@linetype {0}\pstScalePoints
  3. (1,1){}{}\psset [pstricks-...
  4. l.2054 \resetOptions

the same problem was with the code you've posted.


your PSTricks files are really out of date, update your system.

Herbert

User avatar
lanmmt
Posts: 21
Joined: Tue Sep 28, 2010 6:43 pm

Postby lanmmt » Wed Oct 06, 2010 9:24 pm

Ok, I think I've solved my last problem, I've searched the files pstricks is using I've started with the pst-math - which is last named in the log, and than I had an idea, maybe it's something with the
  1. \usepackage{pstricks-add}

which (I've forgot to say earlier) solved the earlier problem. So I've looked for something that might be 'bad' and than went to 2035 line and commented it. And tadam it's working:D

So summarising:
I've
1) added
  1. \usepackage{pstricks-add}

2) removed
  1. \usepackage[usenames,dvipsnames]{pstricks}

(optional)
3) commented line 2035 in pstricks-add.tex (I've fonded it in C:\Program Files (x86)\MiKTeX 2.7\tex\generic\pstricks-add):
  1. %\pstScalePoints(1,1){}{}%

4) made compilation ps2pdf (actualy I've written a code:
  1. @rem You can put here any commands you want - this batch file can be executed from LEd's toolbar
  2. @rem There are 3 parameters passed to this batch:
  3. @rem %1 - <MAINFILEDIR>
  4. @rem %2 - <MAINFILENAME>
  5. @rem %3 - <MAINFILEDISK>
  6. @rem You can also define in tex_cmd.gd file some additional parameters to be passed to this batch file.
  7. @echo off
  8. %3
  9. cd %1
  10. latex.exe --src-specials %2
  11. dvips.exe %2.dvi -o %2.ps
  12. ps2pdf.exe %2.ps %2.pdf

so I have a dvi, ps and pdf document;)

User avatar
lanmmt
Posts: 21
Joined: Tue Sep 28, 2010 6:43 pm

Postby lanmmt » Wed Oct 06, 2010 9:26 pm

CrazyHorse wrote:your PSTricks files are really out of date, update your system.

Herbert

well I thought I've updated them last night, maybe my MikTeX haven't noticed something. I'll try to update them once more, if that won't help, maybe I should try to update them manualy?


Return to “Conversion Tools”

Who is online

Users browsing this forum: Google [Bot] and 1 guest