🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.software
5 messages
5 total messages Started by Bryan Milligan Sat, 09 Jan 1993 19:19
LaTeX problem (missing text)
#1818
Author: Bryan Milligan
Date: Sat, 09 Jan 1993 19:19
16 lines
1068 bytes
I'm having a problem with NeXTTeX, specificall LaTeX although I don't
know if the problem occurs in other modes.  When I view or print a
compiled file, there is frequently sections of text missing.  There
are no errors generated; the text just doesn't show up, and the following
text is moved up.  At first I thought it was Edit's line wrap feature,
but turning it off didn't seem to affect it.  If I place a CR before the 
effected text, it shows up, but I have no idea why.  Any clues, O Noble
Gods of NeXT?


--

Bryan Milligan
Department of Aerospace Engineering
Texas A&M University
bryan@kolsky.tamu.edu  (NeXT Mail accepted)
Re: LaTeX problem (missing text)
#1821
Author: Dick Silbar
Date: Sat, 09 Jan 1993 21:11
19 lines
1465 bytes
In article <1in8f5INN9j4@tamsun.tamu.edu> bryan@kolsky.tamu.edu (Bryan  
Milligan) writes:
> I'm having a problem with NeXTTeX, specificall LaTeX although I don't
> know if the problem occurs in other modes.  When I view or print a
> compiled file, there is frequently sections of text missing.  There
> are no errors generated; the text just doesn't show up, and the  
following
> text is moved up.  At first I thought it was Edit's line wrap feature,
> but turning it off didn't seem to affect it.  If I place a CR before the 
> effected text, it shows up, but I have no idea why.  Any clues, O Noble
> Gods of NeXT?
> 
My secretary had a problem similar to what you described with a file that  
was made using a WordMarc editor on an IBM-PC and saved in ascii.  Looking  
at the file using emacs showed there were ^M characters at the places  
where the text disappearred.  Doing a query-replace of the ^M with a space  
cured the problem.

   Dick Silbar
Re: LaTeX problem (missing text)
#1826
Author: Tom Marchioro
Date: Sun, 10 Jan 1993 07:33
50 lines
2634 bytes
In <1993Jan9.211126.8260@newshost.lanl.gov> silbar@cantina.lanl.gov (Dick Silbar) writes:

>In article <1in8f5INN9j4@tamsun.tamu.edu> bryan@kolsky.tamu.edu (Bryan  
>Milligan) writes:
>> I'm having a problem with NeXTTeX, specificall LaTeX although I don't
>> know if the problem occurs in other modes.  When I view or print a
>> compiled file, there is frequently sections of text missing.  There
>> are no errors generated; the text just doesn't show up, and the  
>following
>> text is moved up.  At first I thought it was Edit's line wrap feature,
>> but turning it off didn't seem to affect it.  If I place a CR before the 
>> effected text, it shows up, but I have no idea why.  Any clues, O Noble
>> Gods of NeXT?
>> 
>My secretary had a problem similar to what you described with a file that  
>was made using a WordMarc editor on an IBM-PC and saved in ascii.  Looking  
>at the file using emacs showed there were ^M characters at the places  
>where the text disappearred.  Doing a query-replace of the ^M with a space  
>cured the problem.

I corresponded with the original poster, and this was indeed the problem.
This comes up often enough that I have a couple of little utilities I like to 
use, and I post there here for anyone who is interested:

First, to remove the control-M line endings

Save the following to a file called "undos", set the executable bit on it, 
and put it in you path, either /usr/local/bin or your personal Apps folder
is best

#!/bin/csh
if (-f /tmp/undos.foo) then
rm -f /tmp/undos.foo
endif
tr -d '\015' < $1  >/tmp/undos.foo
rm $1
mv /tmp/undos.foo $1

this will then allow you to type 
"undos name_of_file" in a shell and hte ^M's will be gone. (see man tr to 
understand how it works).

You can make something similar to take out the ^Z's which often cause troubles
as EOF markers.

Hope this is Helpful --- Tom

PS:  I also have a "todos" script, but (1) I almost never need it and 
(2) I honestly have forgotten how it works.  If you need it write me and
I'll take the time to remember what I did way back when.
Re: LaTeX problem (missing text)
#1829
Author: Tom Marchioro
Date: Sun, 10 Jan 1993 19:21
7 lines
931 bytes
I should also mention on this subject that filters from DOS to NeXT and
NeXT to DOS are built in to the new version of TeXmenu (under the 
Tools -> Converters menu).  These have the advantage that they 
convert not only the primary file but also all of the included files.
A great app, for all sorts of reasons!

TLM
Re: LaTeX problem (missing text)
#1848
Author: Meinhard E. Mayer (Hardy)
Date: Mon, 11 Jan 1993 21:22
187 lines
6694 bytes
For emacs-users here is an emacs-lisp file which will do the required
things for you; sorry for its length ;):

;; -*-Emacs-Lisp-*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; File:         dos-mode.el
;; RCS:          $Header: dos-mode.el,v 1.8 92/10/01 13:49:50 ange Exp $
;; Description:  MSDOS minor mode for GNU Emacs
;; Author:       Andy Norman, Hewlett-Packard Labs, Bristol, England.
;; Created:      Wed May  6 16:42:29 1992
;; Modified:     Thu Oct  1 13:49:32 1992 (Andy Norman) ange@hplb.hpl.hp.com
;; Language:     Emacs-Lisp
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Copyright (C) 1992  Andy Norman.
;;;
;;; Author: Andy Norman (ange@hplb.hpl.hp.com)
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 1, or (at your option)
;;; any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; A copy of the GNU General Public License can be obtained from this
;;; program's author (send electronic mail to ange@hplb.hpl.hp.com) or from
;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
;;; 02139, USA.

;;; Description:
;;;
;;; This package does two things:
;;;
;;; If a file being read into a buffer has the ^M character at the end of each
;;; line then these extra characters are discarded from the file's buffer.
;;; The trailing ^Z, if present, is discarded too.  The buffer is now put into
;;; the dos-mode minor-mode.
;;;
;;; Secondly, when a buffer in dos-mode is being written out, the ^M and
;;; optional ^Z characters are replaced before the write happens.
;;;
;;; dos-mode can be toggled for a buffer with M-x dos-mode.
 
;;; Installation:
;;;
;;; Byte-compile dos-mode.el to dos-mode.elc and put them both in a directory
;;; on your load-path.  Load the package from your .emacs file with:
;;;
;;;   (require 'dos-mode)
;;;
;;; dos-mode can't sensibly be auto-loaded; you are either using it, or you
;;; aren't.

;;; LISPDIR ENTRY for the Elisp Archive
;;; 
;;;    LCD Archive Entry:
;;;    dos-mode|Andy Norman|ange@hplb.hpl.hp.com
;;;    |MSDOS minor mode for GNU Emacs
;;;    |$Date: 92/10/01 13:49:50 $|$Revision: 1.8 $|

(provide 'dos-mode)

(defvar dos-mode-distance 200
  "Number of characters to search for RETURN when looking for a DOS file.")

(defvar dos-mode nil
  "This buffer is to be converted to/from DOS format when read/written.")

(make-variable-buffer-local 'dos-mode)
(setq-default dos-mode nil)

(or (assq 'dos-mode minor-mode-alist)
    (setq minor-mode-alist (cons '(dos-mode " DOS") minor-mode-alist)))

(defun dos-mode (arg)
  "Toggle DOS mode.
With arg, turn DOS mode on iff arg is positive.
In DOS mode, when the buffer is saved, it is converted to DOS format first,
and when restored it is converted to UNIX format first."
  (interactive "P")
  (setq dos-mode
	(if (null arg) (not dos-mode)
	  (> (prefix-numeric-value arg) 0)))
  (set-buffer-modified-p t))

(defvar dos-seen-ctl-Z nil
  "Remember whether C-Z was seen at the end of this buffer.")

(make-variable-buffer-local 'dos-seen-ctl-Z)
(setq-default dos-seen-ctl-Z nil)

(defun dos-convert-buffer-to-unix ()
  "Converts the current buffer from DOS format to UNIX format."
  (let ((mod-p (buffer-modified-p))
	(buffer-read-only nil))
    (save-excursion
      (goto-char (point-min))
      (while (re-search-forward "\r" nil t)
	(replace-match ""))
      (goto-char (point-max))
      (beginning-of-line)
      (forward-line -1)			;should be safe enough
      (setq dos-seen-ctl-Z (search-forward "\C-z" nil t))
      (if dos-seen-ctl-Z
	  (replace-match "")))
    (set-buffer-modified-p mod-p)
    (setq dos-mode t)))

(defun dos-convert-buffer-to-dos ()
  "Converts the current buffer from UNIX format to DOS format."
  (save-excursion
    (goto-char (point-min))
    (while (re-search-forward "\n" nil t)
      (replace-match "\r\n"))
    (if dos-seen-ctl-Z
	(progn
	  (goto-char (point-max))
	  (insert "\C-z")))))

(defun dos-check-buffer ()
  "Used as a find-file hook, if the buffer looks like a DOS format buffer
then it will be converted to a UNIX format buffer."
  (if (or dos-mode
	  (save-excursion
	    (goto-char (point-min))
	    (re-search-forward "\r\n"
			       (min (point-max) dos-mode-distance)
			       t)))
      (dos-convert-buffer-to-unix)))

(defun dos-write-buffer ()
  "If the current buffer was originally a DOS format buffer, write it as such."
  (if dos-mode
      (let* ((buffer-read-only nil)
	     (window (get-buffer-window (current-buffer)))
	     (p (point))
	     (m (mark))
	     (ws (and window (window-start window))))
	(dos-convert-buffer-to-dos)
	(unwind-protect
	    (write-region (point-min)
			  (point-max)
			  buffer-file-name
			  nil
			  t)
	  (dos-convert-buffer-to-unix)	;convert back again!
	  (and window
	       (set-window-start window
				 (save-excursion (goto-char ws)
						 (beginning-of-line)
						 (point))))
	  (goto-char p)
	  (set-mark m))
	t)))

(or (memq 'dos-write-buffer write-file-hooks)
    (setq write-file-hooks
	  (append write-file-hooks
		  (list 'dos-write-buffer)))) ;stick it on the end

(or (memq 'dos-check-buffer find-file-hooks)
    (setq find-file-hooks
	  (append find-file-hooks
		  (list 'dos-check-buffer))))
;;;;;;; end of dos-mode.el ;;;;;;;










--
Hardy 
-----
Meinhard E. Mayer,  Department of Physics, UC Irvine 
e-mail: hardy@golem.ps.uci.edu (preferred) or MMAYER@UCI.BITNET
!!!! NO NEXTMAIL TO THESE ADDRESSES, PLEASE !!!!!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads