LINUX-BG Адрес : http://www.linux-bg.org |
Печат на кирилица с LPRNG и български език в LyX |
От: Димитър Василев - FreeJak Публикувана на: 3-07-2003 Адрес на статията: http://www.linux-bg.org/cgi-bin/y/index.pl?page=article&id=advices&key=352405774 |
Увод Това са моите бележки относно печат на кирилица под LPRNG и настройката на български език в LyX. Замисълът ми е да обменим идеи за това как може да стане и по-добре. Доста често съм виждал питания и лично съм питал как се настройва LPRNG, а отговорите не ме устройваха.Затова седнах, помислих и направих. Необходими програми LPRNG, apsfilter от www.apsfilter.org, html2ps от www.tdb.uu.se/~jan/html2ps.html, enscript и каквито се сетите други филтри, Ghostscript, LaTeX, TeTeX, Perl, OpenOffice. Може да пропускам нещо, но разработчиците на вашия Linux/*BSD не. Базовите инсталации предлагат всичко необходимо за елементарен печат. Проблемът се заключава в следното: Поради "доминиращото" влияние на стратегическия партньор на сегашното ни правителство на пазара за програмно обезпечение и неговото безразличие към световните стандарти, в България е наложено масово кодирането cp-1251. Повечето филтри, разпространими или съвместими с LPRNG подържат кирилица в UTF-8, KOI-8*.Откъдето следва въпроса: "Как, да го вземат мътните, ще печатам?" Решение Печати всичко без HTML - не успях да се преборя с html2ps и Open Office да рендва HTML ( поради стар хардуер, но малки HTML яде за закуска). Предполагам имате подръжка на принтера си в ядрото, без значение дали е вързан към USB, паралелен или друг порт. Въпросното печатащо устройство е вързано към него, работи и е захранвано с ток по време на процедурите за настройка. Влезте във вашата система като root и инсталирайте apsfilter от ports/изходен код. Отидете в неговата директория - /usr/(local)/share/apsfilter. Там има скрипт SETUP, който като бъде изпълнен, започва да ви пита за вашите настройки, желаната разделителна способност и т.н. След инсталирането и тестването на принтера, направете архив на следните файлове: /etc/printcap, /etc/apsfilter/apsfilterrc, /etc/a2ps-site.cfg,/etc/a2ps.cfg, /etc/enscript.cfg, /etc/lpd.*. Сменете правата на LPRNG да приема само от печат само от localhost и управление от root. Моят /etc/lpd.conf: 'force_localhost' 1 или on. Моят /etc/lpd.perms: ACCEPT SERVICE=C SERVER REMOTEUSER=root ACCEPT SERVICE=C LPC=lpd,status,printcap REJECT SERVICE=C ACCEPT SERVICE=M SAMEHOST SAMEUSER ACCEPT SERVICE=M SERVER REMOTEUSER=root REJECT SERVICE=M DEFAULT ACCEPT REJECT SERVICE=X, NOTREMOTEHOST=localhost,127.0.0.1 и т.н NOT REMOTEUSER=root,freejak Повече подробности - man lpd /etc/apsfilter/apsfilterc: ############################################################################## # $ApsCVS: src/apsfilter/template/apsfilterrc.in,v 1.42.2.8 2002/11/09 16:54:28 andreas Exp $ # # Sample apsfilter template file for apsfilter 7.2.5 # # This file is for customizing apsfilter's behaviour # Enables you to configures some aspects of apsfilter to fit your own needs. # # # Possible locations for configuration files: # # a) global configuration for all printers: $CONF_DIR/apsfilterrc # b) printer specific: $CONF_DIR/$QUEUE/apsfilterrc # c) printer specific, supplied by user: $CONF_DIR/$QUEUE/apsfilterrc.$USER # d) printer specific, controlled by user: ~$USER/.apsfilter/apsfilterrc.$QUEUE # (admin must set USE_USER_CODE for this to be used) ############################################################################## #============================================================================= # apsfilter specific configuration #============================================================================= # include special paths you need # default: PATH="/usr/local/bin:/usr/X11R6/bin:/usr/bin:/bin" # PATH="/opt/bin:/usr/openwin/bin:/usr/local/bin:/usr/X11R6/bin:/usr/bin:/bin" # change this if your awk chokes on our programs and/or command line options # default: AWK=awk # AWK=/usr/bin/gawk # who is to be notified in case of a failure # default: NOTIFY=root # NOTIFY=root # directory for temporary file creation # default: TMPDIR=/tmp # TMPDIR=/tmp ### ### WARNING ! ### ### This setting allows users to provide configuration in a shell script; ### do _not_ set this if the input filter runs under a privileged user. ### ### To be on the safe side, you can also create user-specific config files ### $CONF_DIR/$QUEUE/apsfilterrc.$USER ### which contain settings that have been inspected by the administrator. ### # default: USE_USER_CODE="" # #USE_USER_CODE=set #============================================================================= # printer independent configuration #============================================================================= # search path for embedded images used by dvips; this path will be extended # by "$HOME:/tmp:/var/tmp" (where $HOME is the home directory of the user) # default: TEXINPUTS="" # #TEXINPUTS=/usr/accounts/andreas/pictures:/usr/share/dvips/pictures # set this of your MakeTeXPK tool works correctly # default: HAVE_MAKETEXPK="" # HAVE_MAKETEXPK="" # dvips option for setting the resolution # default: DVIPS_RES_DorP=-D # DVIPS_RES_DorP=-P # ghostscript environment variables # defaults: # GS_FONTPATH="/usr/X11R6/lib/X11/fonts/Type1:/var/X11R6/lib/X11/fonts/Type1" # GS_LIB="$GS_FONTPATH" # GS_FONTPATH=/usr/X11R6/lib/X11/fonts/Type1 GS_LIB=/usr/X11R6/lib/X11/fonts/Type1 # set this if your (remote) print jobs are erroneously sent in "raw" mode # default: IGNORE_LPD_RAW="" # #IGNORE_LPD_RAW=set #============================================================================ # printer dependent configuration # (these should go into the printer specific apsfilterrc) #============================================================================ # media type; one of plain, coated, glossy, premium, trans # default: MEDIA="plain" # MEDIA=plain # whether to print uni- or bi-directional # default: SWEEP=bi # SWEEP=bi # custom DVI-to-PrinterLanguage filter (stdin->stdout) # default: PRINT_DVI="" -> will use dvips # #PRINT_DVI='/usr/local/bin/my_super_filter -X -Y -Z -' # escape sequences to be sent before/after a "raw" print job # defaults: # RAW_PROLOGUE="" # RAW_EPILOGUE="" # #RAW_PROLOGUE='\033&k2G\033(s2Q\033&k5W\033&l0L\033&a7L\033(s12H' #RAW_EPILOGUE='\014' # escape sequences to be sent before/after text output via "recode" # (in addition to the RAW_PROLOGUE and RAW_EPILOGUE stuff) # defaults: # RECODE_PROLOGUE="" # RECODE_EPILOGUE="" # # these are examples for the LaserJet/DeskJet/PaintJet family #RECODE_PROLOGUE='\033E\033&k2G\033(0N' #RECODE_EPILOGUE='\033E' # these are examples for the newer Stylus models (probably 740 and later) #RECODE_PROLOGUE='\000\000\000\033\001@EJL 1284.4\012@EJL \012\033@\033@' #RECODE_EPILOGUE='\033@' # codes (printf-style) to create a single blank page # default: BLANK_PAGE='\012\014' # #BLANK_PAGE='\033@' # ghostscript options; will be altered by quality/color/... settings # default: GS_FEATURES="" # #GS_FEATURES='-dBitsPerPixel=32 -dMicroweave -sDithering=fscmyk' # printer initialisation (used by gs) # default: PS_INIT="" # #PS_INIT=stcolor.ps # printer cleanup (used by gs) # default: PS_EXIT="" # #PS_EXIT=showpage.ps # options for the POST_FILTER (called after gs processing) # default: POST_FILTER_OPTS="" # #POST_FILTER_OPTS='-f /etc/my_pnm2ppa.conf' # printer is a duplex capable printer # default: HARDWARE_DUPLEX="" # #HARDWARE_DUPLEX=set # disable duplex printing; only needed if HARDWARE_DUPLEX is empty _and_ if # apsfilter doesn't run on the local host # default: DISABLE_DUPLEX="" # #DISABLE_DUPLEX=set # set these if even/odd pages should be reversed for fake duplex mode, # and control whether the odd pages should be printed first # defaults: # DUPLEX_REVERSE_EVEN="" # DUPLEX_REVERSE_ODD="" # DUPLEX_ODD_FIRST="" # #DUPLEX_REVERSE_EVEN=set #DUPLEX_REVERSE_ODD=set #DUPLEX_ODD_FIRST=set # papertray selection # default: PAPERTRAY="" #> class options: tray0, ..., tray9 # #PAPERTRAY=1 # maximum number of copies printed via "lpr -C copies=42" or "lpr -Zcopies=42"; # this is independent of the "-#" and "-K" switches to lpr # default: MAXCOPIES=10 # #MAXCOPIES=1 # printer is capable of printing multiple copies # default: HARDWARE_COPIES="" # #HARDWARE_COPIES=set # copies should be done at the remote server (if possible); # currently for NetWare and lpd servers # default: REMOTE_COPIES=set # #unset REMOTE_COPIES #============================================================================ # visual appearance of the printout #============================================================================ # filter for ASCII files; one of a2ps, mpage, enscript, recode # default: ASCII_FILTER=a2ps #> class options: a2ps, mpage, enscript, recode # #ASCII_FILTER=recode # override a2ps default options # defaults: # A2PS_BASIC="--delegate=no -X iso1" # A2PS_PAPERSIZE="$PAPERSIZE" (case-corrected) # #don't format troff documents, by Joerg Wunsch <joerg@apsfilter.org> #A2PS_BASIC='-Eplain' #A2PS_PAPERSIZE=Letter #A2PS_PAPERSIZE=A4stylus # override the complete a2ps commandline # default: A2PS_OPTS="" # #A2PS_OPTS='-X iso1 -m --borders=yes --prologue=color --highlight-level=heavy' # override mpage default options # defaults: # MPAGE_BASIC="-CISO-Latin.1 -f" # MPAGE_PAPERSIZE="$PAPERSIZE" (case-corrected) # #MPAGE_BASIC='-CISO-Latin.2 -f' #MPAGE_PAPERSIZE=Letter #MPAGE_PAPERSIZE=A4 # override the complete mpage commandline # default: MPAGE_OPTS="" # #MPAGE_OPTS='-CISO-Latin.2 -a -e -r' # override enscript default options # defaults: # ENSCRIPT_BASIC="-X 88591" # ENSCRIPT_PAPERSIZE="$PAPERSIZE" (case-corrected) # ENSCRIPT_BASIC='-X 88595 -C 88592' #ENSCRIPT_PAPERSIZE=Letter ENSCRIPT_PAPERSIZE=A4 # override the complete enscript commandline # default: ENSCRIPT_OPTS="" # #ENSCRIPT_OPTS='-X 88592 -r --ps-level=1' # set level of pretty-printing (0=none, 1=normal, 2=heavy) # the text-to-PostScript converter must support this # default: PRETTY_PRINTING=1 #> class options: pretty=0, pretty=1, pretty=2 # PRETTY_PRINTING=1 # print headers and borders for ASCII files # defaults: # ASCII_HEADER="" # ASCII_BORDER="" #> class options: header, noheader, border, noborder # #ASCII_HEADER=set #ASCII_BORDER=set # multiple pages per sheet (can be 1,2,4,8) # default: PS_NUP=1 #> class options: 1pps, 2pps, 4pps, 8pps # #PS_NUP=2 # # same setting, but for ASCII files only # default: ASCII_PPS="$PS_NUP" # #ASCII_PPS=2 # force paper orientation # default: LANDSCAPE="" #> class options: landscape, portrait # #LANDSCAPE=set # # same setting, but for ASCII files only # default: ASCII_LANDSCAPE="$LANDSCAPE" # #ASCII_LANDSCAPE=set # override htmldoc options # default: HTMLDOC_OPTS="--webpage" # HTMLDOC_OPTS='--book --charset 8859-5 --no-title' # override html2ps options # default: HTML2PS_OPTS="-e ISO-8859-1 -u -H" # HTML2PS_OPTS='-e ISO-8859-5 -u -H' # override recode options # default: RECODE_OPTS="latin1..ibmpc" # #RECODE_OPTS='latin1..cp437' # use pstools to alter the PostScript printout # defaults: # PS_BOOK="" # PS_UTILS="" #> class options: book # #PS_BOOK=set #PS_UTILS='psselect -r' # duplex printing (will be "faked" if printer can't handle this by itself) # default: DUPLEX="" #> class options: duplex, simplex # #DUPLEX=set # binding edge; must be long or short # default: BINDING=long #> class options: shortbind, longbind # #BINDING=short /etc/a2ps.cfg: # a2ps.cfg -*- Makefile -*- # # System configuration file for a2ps. # Copyright (c) 1988-1993 Miguel Santana # Copyright (c) 1995-2000 Akim Demaille, Miguel Santana # # # This file is part of a2ps. # # 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 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # # # This file defines everything a2ps needs to know about # -- your system (access to the printers) # It is strongly suggested that you check these parameters # are adapted to your system. # -- customizable features # # It is related to the whole system, i.e., it is not the file # the users should modify themselves for their own preferences. # ~/.a2ps/a2psrc is the user's own configuration file, which # is read after this file. # ################################################################# # 1) Definition of some media # # (Must be defined before --medium) # ################################################################# # Medium: name, width height [llx lly urx ury] Medium: A3 842 1190 Medium: A4 595 842 Medium: A5 420 595 Medium: B4 729 1032 Medium: B5 516 729 Medium: Letter 612 792 Medium: Legal 612 1008 Medium: Tabloid 792 1224 Medium: Ledger 1224 792 Medium: Statement 396 612 Medium: Executive 540 720 Medium: Folio 612 936 Medium: Quarto 610 780 Medium: 10x14 720 1008 # Desk Jet users: bigger margins Medium: A4dj 595 842 24 50 571 818 Medium: Letterdj 612 792 24 40 588 768 ################################################################# # 2) Path to the a2ps resource # ################################################################# # Default path where a2ps dropped its library files. LibraryPath: /usr/share/a2ps/sheets:/usr/share/a2ps/ps:/usr/share/a2ps/encoding:/usr/share/a2ps/afm:/usr/share/ogonkify/afm:/usr/share/a2ps/ppd:/usr/share/a2ps/fonts:/usr/share/ogonkify/fonts:/usr/share/a2ps # It may be useful to extend it so that a2ps can see some # TeX or X11 resources: it likes AFM files and PF[AB] files. #AppendLibraryPath: foo ################################################################# # 3) Default settings # ################################################################# # Two virtual pages per sheet Options: -2 # Set automatic pretty-printing on (set to "plain" for off) Options: --pretty-print # By default, single sided printing. Options: -s1 # Name of the document is the list of files # (Don't put too many of them: it breaks some PS interpreters) Options: --title='#10!f|$n|, |' # Header is the client of the job Options: --header=%a # Title of the page is the (short) name of the current file # or the first tagged text if there is Options: --center-title=#?1|$t1|$n| # Left part of the title is the mod. date of the file # or empty is there is a tag2 Options: --left-title='#?2||$e $T|' # Right part of the title is the page number # or tag2 if there is Options: --right-title='#?2|$t2|$Q|' # If in landscape, print date on the left hand side # If portrait, then print date on recto, and sheet # on verso Options: --left-footer=#?l!%E!#?v|%E|%s./%s#|! # Center footer is the list of files on this sheet if landscape Options: --footer='#?l|#!s-$f-, -||' # If in landscape, print date on the right hand side # If portrait, then print date on verso, and sheet # on recto Options: --right-footer=#?l!%s./%s#!#?v|%s./%s#|%E|! # We want the %%Page comments to be instructive. # There are two predefined choices: #{pl.short} and #{pl.long} PageLabelFormat: #{pl.short} # Report the number of lines which were wrapped. Variable: cfg.wrapped 1 ############################################################### # 4) Preconfigured Variables # ############################################################### # # Some variables for the delegations # # Calling AcrobatReader for PDF to PostScript. #Variable: del.acroread \ # acroread -toPostScript # Acrobat 4 lets us specify the medium, which is precious sometimes, and # that we should shrink the document to the size of the medium. #Variable: del.acroread \ # acroread -toPostScript -size "#wx#h" -shrink # Passes the options to psnup. A problem with psnup is that even if # no service is requested, the PostScript is altered. There are such # problems with dvips. A symptom is that the figure are spread on # several pages. To avoid that, with ``-1'', we use cat instead of # psnup -1. # The files (in and out) are to be given if not stdin and stdout. Variable: del.psnup \ #?o!cat!psnup -#v #?V||-q| #?j|-d|| #?r||-c| -w#w -h#h! # Passes to psselect for PS page selection. Variable: del.psselect \ #?p!psselect #?V||-q| -p#p!cat! # Passes to psselect, and then psnup Variable: del.psselnup #{del.psselect} | #{del.psnup} # Calls to dvips. The sequence waits for the file name, and # produces on stdout. Variable: del.dvips dvips #?p|-pp#p|| #?V||-q| -T#wpt,#hpt -f # We use a modified texi2dvi which accepts -b (--batch), -c (--clean), # and -l (--language). Variable: del.texi2dvi \ texi2dvi4a2ps -b -c #?V|--verbose|--quiet| 1>&2 # a2ps will be called upon decompressed files. Variable: del.a2ps\ a2ps #?p|-a#p|| #?V|-v2|-q| -#v -o- --stdin=$N # convert, part of ImageMagick, is used for many image formats # If you want the name of the file to be printed along with the picture, # add `-label $f' Variable: del.imagick convert -page #wx#h # TeX MetaFont and MetaPost files. Variable: del.metafont \ (TEXINPUTS=%d:$$TEXINPUTS && \ mft $f && tex $N.tex '\\end') #?V|1>&2|> /dev/null| Variable: del.metapost \ (TEXINPUTS=%d:$$TEXINPUTS && \ mft $f && mv $f.tex $N.tex && tex $N.tex '\\end') #?V|1>&2|> /dev/null| # # Variables for special printers. # # Either GV (prefered) or Ghostview will be used as the "display" printer # We give -dNOPLATFONTS so that real fonts are used # (Strange results appear with Ogonkify's fonts for instance). #Variable: ghostview ghostview -arguments -dNOPLATFONTS Variable: ghostview gv -antialias -arguments -dNOPLATFONTS # Used for the `pdf' printer. # Use as `#{ps2pdf} INPUT OUTPUT'. # Variable: ps2pdf gs -g"#wx#h" -r72 -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$N.pdf -c save pop -f #f0 Variable: ps2pdf ps2pdf -g"#wx#h" -r72 #Variable: ps2pdf distill -pairs -pagesize #w #h pts # # Some macro for ToC or page label # # Useful for the page label format: # pl.short: just the page intervals Variable: pl.short #!s|$p-|,| # pl.long: file name and page intervals Variable: pl.long #!s|$n $p-|,| # The default layout for Table of Contents Variable: toc \\Keyword{Table of Contents}\n\ #-1!f\ |$2# \\keyword{$-.20n} sheets $3s< to $3s> ($2s#) pages \ $3p<-$3p> $4l# lines\n|| ################################################################# # 5) Preconfigured delegations # ################################################################# # # Delegations are ways to hand off the processing of some # files to other filters. # # When delegating, interesting meta sequences are # $f -- current filename, i.e. the one to delegate. # Note that $f expands exactly to the file, which means # that in most cases you need '$f' (with the two quotes) # to avoid both (i) problems with space in names, and # (ii) other shell active characters, such as $. # Yeah, I know, we need something more elaborated in case # the file has quotes ' in it # #f0 to #f9 -- temporary filename you can use. # rm is done by a2ps itself. No need to quote. # ########## Compressed files # A compressed file should be decompressed and processed by a2ps # A consequence is that the decompressed file may be delegated. Delegation: gzip-a2ps gzip:ps gzip -cd '$f' | #{del.a2ps} Delegation: gzip-a2ps compress:ps gzip -cd '$f' | #{del.a2ps} #Delegation: bzip-a2ps bzip:ps bzip -cd '$f' | #{del.a2ps} Delegation: bzip2-a2ps bzip2:ps bzip2 -cd '$f' | #{del.a2ps} ########## DVI files # Pass DVI files to dvips. # * A problem with dvips is that even on failure it dumps its # prologue, hence it looks like a success (output is produced). To # avoid that, we use an auxiliary files and conditional call to psnup # instead of piping. # * It tries to figure if the doc is landscape (use of seminar for # instance) by looking for `landscape' in the first strings of # the DVI file. Delegation: dvips dvi:ps\ if strings '$f' | sed 10q | fgrep landscape > /dev/null 2>&1; then \ #{del.dvips} -T#hpt,#wpt '$f' -o #f0 && #?o|cat|#{del.psnup} -r| #f0; \ else \ #{del.dvips} '$f' -o #f0 && #{del.psnup} #f0; \ fi ########## HTML files # Pass HTML to Netscape, hoping that there is an Netscape running... # Tricks: # 1. Netscape can't output on stdout, hence use a tmp file (#f0) # 2. openfile refuses relative paths, so prepend cwd (%d) when relative # 3. remote 'openfile' -remote 'saveas' is bad, because it is handled # asynchronously, and the output can correspond to a previously # loaded page (not that of openfile). So run Netscape twice. # 4. It asks the user if s/he wants to replace an existing output file, # so rm before. Delegation: Netscape html:ps \ rm -f #f0; \ if echo '$f' | grep '^/' >/dev/null 2>&1; then \ ${NETSCAPE:-netscape} -noraise -remote 'openfile($f)'; \ else \ ${NETSCAPE:-netscape} -noraise -remote 'openfile(%d/$f)'; \ fi && \ ${NETSCAPE:-netscape} -noraise -remote 'saveas(#f0,postscript)' && \ #{del.psselect} #f0 | #{del.psnup} ########## MetaFont / MetaPost files Delegation: MetaFont mf:ps \ #{del.metafont} && #{dvips} $N.dvi | #{psnup} Delegation: MetaPost mp:ps \ #{del.metapost} && #{dvips} $N.dvi | #{psnup} ########## PDF files # Delegated to pdf2ps, GS 5.50 Delegation: pdf2ps pdf:ps \ pdf2ps '$f' #f0 && #{del.psselect} #f0 | #{del.psnup} # Delegated to AcrobatReader #Delegation: Acrobat pdf:ps \ # #{del.acroread} < '$f' | #{del.psselnup} ########## PostScript files # Pass the PostScript files to psnup and psselect Delegation: PsNup ps:ps fixps #?V||-q| '$f' | #{del.psselnup} ########## ROFF files # Pass the roff files to groff. Ask grog how groff should be called. # Use fixps to ensure there is a %%BeginSetup/%%EndSetup section. Delegation: Groff roff:ps \ eval `grog -Tps '$f'` | fixps #?V!!-q! | #{del.psselnup} ########## TeX files, supposed to be LaTeX files in fact # Use texi2dvi for TeX file Delegation: texi2dvi tex:ps \ #{del.texi2dvi} -l latex -o #f0 '$f' && #{del.dvips} -f #f0 | #{del.psnup} ########## Texinfo files # Use texi2dvi for Texinfo file # In a near future, we might no longer have to specify --expand, but # currently, it is safer. Delegation: texi2dvi texinfo:ps \ #{del.texi2dvi} -e -o #f0 -l texinfo '$f' && #{del.dvips} -f #f0 | #{del.psnup} ######################## Using ImageMagick for images ########## GIF files Delegation: ImageMagick gif:ps\ #{del.imagick} 'gif:$f' ps:- | #{del.psselnup} ########## JPEG files Delegation: ImageMagick jpeg:ps\ #{del.imagick} 'jpeg:$f' ps:- | #{del.psselnup} ########## PNG files Delegation: ImageMagick png:ps\ #{del.imagick} 'png:$f' ps:- | #{del.psselnup} ########## TIFF files Delegation: ImageMagick tiff:ps\ #{del.imagick} 'tiff:$f' ps:- | #{del.psselnup} ########## XBM files Delegation: ImageMagick xbm:ps\ #{del.imagick} 'xbm:$f' ps:- | #{del.psselnup} ########## XPM files Delegation: ImageMagick xpm:ps\ #{del.imagick} 'xpm:$f' ps:- | #{del.psselnup} ################################################################# # 6) Some interesting UserOptions/Printers # ################################################################# # Print like an old fashioned ASCII printer UserOption: lp -1m -Eplain -B --borders=no # Print mails. Strip some headers. UserOption: mail -gEmail --strip=1 UserOption: longmail -gEmail --strip=1 -2R # Printing a booklet # To print a booklet, we must be sure to output Simplex, and 1 up. # Install the lp hook for booklets. UserOption: book -1Dlp.hook=#{lp.hook.book} -s1 # This variable defines a hook for `lp'. The output is piped into # psbook in order to print a booklet. Variable: lp.hook.book \ #?o! psbook #?V,,-q, | psnup -2 #?V,,-q, | psset -nt | \ ! echo "Cannot be used with more than two pages per sheet." >&2 ; exit 1! # Some special setpagedevice requests UserOption: manual -SManualFeed:true # Force a2ps to issue a Simplex request. UserOption: s1 -SDuplex:false UserOption: simplex -SDuplex:false # Nice display, i.e., use colors, and one virtual per page. UserOption: display -1 --prolog=color -Pdisplay # It is better not to pipe in ghostview Printer: display | cat > #f0 && #{ghostview} #f0 # Save into a file named after the input files. # E.g. a2ps src/foo.c => foo.ps Printer: file > $N.#. # Dry run. Helpful to know the page usage etc. Printer: void > /dev/null # Produce PDF. # It is better not to output in two up, or even worse: in landscape. Printer: pdf | cat >#f0 && #{ps2pdf} #f0 $N.pdf UserOption: pdf -1 -P pdf --prologue=color # We define the DefaultPrinter and the Unknown Printer just in case # a2ps-site.cfg fails to define them. Under normal circumstances # these entries *will* be overridden. # First, the default printer (option -d, no argument) DefaultPrinter: | #{lp.default} # Second, a printer unknown to a2ps (option -P, argument is #o) UnknownPrinter: | #{lp} #o ################################################################# # 7) Your local settings # ################################################################# # How to call file(1), and if possible, follow the links FileCommand: /usr/bin/file -L # Define a variable to call lp/lpr on the default printer, preceded # with a hook to post-process PostScript (to call psbook for instance). # Something like `#{lp.hook} lp #{lp.options}' # or `#{lp.hook} lpr #{lp.options}'. Variable: lp.default #{lp.hook} lp #{lp.options} # The same, but when a printer is specified. # Something like `#{lp.hook} lp #{lp.options} -d' # or `#{lp.hook} lpr #{lp.options} -P'. Variable: lp #{lp.hook} lp #{lp.options} -d # To avoid that the next installation of a2ps destroys your # definitions, local customization would be better done in # a2ps-site.cfg. Include: a2ps-site.cfg /etc/a2ps-site.cfg: # a2ps-site.cfg -*- Makefile -*- # # This file is included from a2ps.cfg # # In this file should be defined your specific values you want to keep # for other installation (future) installation of a2ps. ################################################################# # 1) System dependent parameters # ################################################################# # Default encoding Options: --encoding=iso-8859-5 # Default medium Options: --medium=A4dj ################################################################# # 2) Your printers # ################################################################# # By default, produce Level 1 PostScript. # Currently it only means to consider only the 13 level 1 standard # fonts, and not the 35 standard level 2 fonts. DefaultPPD: level1 # NOTE: # Because sending a file to a printer is system dependent and because # this file is meant to be system independent, there are two variables # defined in a2ps.cfg you should use here. # - #{lp.default} # Its value is typically `lp' or `lpr'. # - #{lp} # Its value is typically `lp -d' or `lpr -P'. Immediately after # #{lp} there should be the name of the printer. # ### DefaultPrinter # DefaultPrinter is the printer which is called upon `a2ps -d'. DefaultPrinter: | #{lp.default} ### UnknownPrinter # The `UnknownPrinter' is the command used when the user specified # the name of the printer (a2ps -P <printer-name>), but <printer-name> # is not specified below as a special case. # <printer-name> is available here as `#o'. UnknownPrinter: | #{lp} #o ### Some special printers. # This section is to fill only if you want to tune your system. # The entry `UnknownPrinter' is enough to handle any case. # For instance, I want to specify that arlette is a Level 2 PostScript # printer. I specif no command, so the `UnknownPrinter' command will # be used. #Printer: arlette level2 # dominique is a level 2 PostScript _without_ Duplex support. # Here I *want* a special command, not that of the UnknownPrinter. # We use the shell script psmandup to simulate Duplex. #Printer: dominique level2 | #?d#psmandup -n|## #{lp} dominique # This is just to show that any command can be used. Instead of # printing, the output is piped in `wc'. #Printer: wc | wc -l # You can also save in a file if you wish. #Printer: netscape >netscape.ps # This example uses the fact that `$N' expands in the input file name, # so a2ps foo -P gzip will save the output in foo.ps.gz. #Printer: gzip | gzip -c > $N.#..gz /etc/enscript.cfg: # # GNU Enscript configuration file. # Copyright (c) 1995-2000 Markku Rossi. # # Author: Markku Rossi <mtr@iki.fi> # # # # This file is part of GNU enscript. # # 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 2, 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. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # # Do we accept PostScript font's composite characters? As a default, # this is false because I think this is GhostScript dependant. AcceptCompositeCharacters: 0 # Lookup path for the AFM files. AFMPath: /usr/share/enscript/afm:/usr/local/lib/ps:/usr/lib/ps # Append ^D character to the end of the output. Some printers like HP # LaserJet 5 require this but the default is `false'. AppendCtrlD: 0 # How characters greater than 127 are printed: # 1 generate clean 7-bit code; print characters greater than 127 # in the backslash-octal notation `\xxx' (default) # 0 generate 8-bit code Clean7Bit: 0 # Default input encoding. DefaultEncoding: iso-8859-5 # Default fancy header. DefaultFancyHeader: enscript # Default output media. DefaultMedia: A4dj # Where output goes as a default: `printer' or `stdout' DefaultOutputMethod: printer # Include following font files to all PostScript outputs. # # DownloadFont: FooFont1 # DownloadFont: FooFont2 # The escape character for special escapes. EscapeChar: 0 # What to do when a formfeed character is encountered from input: # column move to the beginning of the next column # page move to the beginning of the next page FormFeedType: column # Specify whether the PageSize page device option is generated to the # output. GeneratePageSize: 1 # The gray level which is used to print highlight bars. HighlightBarGray: .97 # How high highlight bars are in lines. The default is 0 so no # highlight bars are printed. # HighlightBars: 2 # Library path. Let's use built-in default. # LibraryPath: # How wrapped lines are marked in printout. Possible values are: `none', # `plus', `box' and `arrow'. As a default, we do not mark them. MarkWrappedLines: none # Media definitions: # name width height llx lly urx ury Media: A3 842 1190 24 24 818 1166 Media: A4 595 842 24 24 571 818 Media: A5 420 595 24 24 396 571 Media: Legal 612 1008 24 24 588 984 Media: Letter 612 792 38 24 574 768 # HP DeskJet media (DeskJet can't print on the bottom 1/2" of the paper). Media: A4dj 595 842 24 50 571 818 Media: Letterdj 612 792 24 40 588 768 # Spooler option to suppress the job header. NoJobHeaderSwitch: -h # How non-printable characters are printed: `caret', `octal', # `questionmark' or `space'. NonPrintableFormat: octal # PostScript output's first line. OutputFirstLine: %!PS-Adobe-3.0 # Default page label format: `short' or `long'. PageLabelFormat: short # Enable / disable page prefeed. PagePrefeed: 0 # The PostScript language level that enscript should use. PostScriptLevel: 2 # Printer name to spool to. As a default we want to use system's # default printer. Printer: aps1 # The spooler command switch to select the printer queue. This option # can also be used to pass other flags to the spooler command but they # must be given bofore the queue switch. QueueParam: -P # Pass following Page Device options to the generated output. # # Duplex printing. # SetPageDevice: Duplex:true # Printer spooler command name. Spooler: lpr # An absolute path to the states program. StatesBinary: /usr/bin/states # Create color outputs with States? StatesColor: 0 # The name of the States configuration file. StatesConfigFile: /usr/share/enscript/hl/enscript.st # States' default highlight style. StatesHighlightStyle: emacs # Path for the States program. # StatesPath: /usr/share/enscript/hl # Pass following statusdict options to the generated output. # # Use always paper tray 1. # StatusDict: setpapertray:1 # Format string for table-of-contents entries. # # TOCFormat: $3v $-40N $3% pages $4L lines $E $C # As a default, print this underlay text to all document. # Underlay: mtr's printout # Underlay text angle. # UnderlayAngle: 45 # Select underlay font. UnderlayFont: Times-Roman200 # Select underlay gray. UnderlayGray: .8 # Underlay text starting position. # UnderlayPosition: +0-0 # Underlay style: `outline' or `filled' UnderlayStyle: outline # EOF /etc/printcap: # # Copyright (c) 1983 Regents of the University of California. # All rights reserved. # # Redistribution and use in source and binary forms are permitted # provided that this notice is preserved and that due credit is given # to the University of California at Berkeley. The name of the University # may not be used to endorse or promote products derived from this # software without specific prior written permission. This software # is provided ``as is'' without express or implied warranty. # # @(#)etc.printcap 5.2 (Berkeley) 5/5/88 # # DecWriter over a tty line. #lp|ap|arpa|ucbarpa|LA-180 DecWriter III:\ # :br#1200:fs#06320:tr=\f:of=/usr/lib/lpf:lf=/usr/adm/lpd-errs: #lp:lp=/dev/lp0:sd=/usr/spool/lp0:of=/usr/lib/lpf: lf=/usr/adm/lpd-errs # # Generic printer: #DeskJet 670C text #txt:\ #:lp=/dev/lp0:\ #:if=/usr/local/bin/lpfilter:\ #:sd=/var/spool/lpd:\ #:lf=/var/spool/lpd/log:\ #:af=/var/spool/lpd/acct:\ #:mx#0:\ #:sh: # # typical remote printer entry #ucbvax|vax|vx|ucbvax line printer:\ # :lp=:rm=ucbvax:sd=/usr/spool/vaxlpd:lf=/usr/adm/lpd-errs: #varian|va|Benson Varian:\ # :lp=/dev/va0:sd=/usr/spool/vad:mx#2000:pl#58:px#2112:py#1700:tr=\f:\ # :of=/usr/lib/vpf:if=/usr/lib/vpf:tf=/usr/lib/rvcat:cf=/usr/lib/vdmp:\ # :gf=/usr/lib/vplotf:df=/usr/local/dvif:\ # :vf=/usr/lib/vpltdmp:lf=/usr/adm/lpd-errs: #versatec|vp|Versatec plotter:\ # :lp=/dev/vp0:sd=/usr/spool/vpd:sb:sf:mx#0:pw#106:pl#86:px#7040:py#2400:\ # :of=/usr/lib/vpfW:if=/usr/lib/vpsf:tf=/usr/lib/vcat:cf=/usr/lib/vdmp:\ # :gf=/usr/lib/vplotf:vf=/usr/lib/vpltdmp:lf=/usr/adm/lpd-errs:\ # :tr=\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ #\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ #\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n: # #lp|panasonic:lp=/dev/lp1:sd=/usr/spool/lp/panasonic:lf=/usr/bin/mail:mc#1:\ # ft=$$c$$p$$r$$f:hl#2:fl#3:ht=$$c$$n$$r$$t:sh: # # HP Laser jet plus #lp|hpj:\ # :lp=/dev/lp1:\ # :sd=/usr/spool/lp1:\ # :mx#0:\ # :of=/usr/spool/lp1/hpjlp: # :lf=/usr/spool/lp1/hp-log: # #lp|Generic dot-matrix printer entry:\ # :lp=/dev/lp1:\ # :sd=/var/spool/lp1/lp:sh:\ # :if=/usr/bin/lpf:\ # :df=/var/spool/lp1/filter.ps:\ # :tf=/var/spool/lp1/filter.ps:\ # :af=/var/spool/lp1/lp-acct:\ # :lf=/var/spool/lp1/lp-err: # APS1_BEGIN:printer1 # - don't delete start label for apsfilter printer1 # - no other printer defines between BEGIN and END LABEL aps1|ijs/DESKJET_670;r=600x600;q=high;c=full;p=a4;m=auto:\ :lp=/dev/lp0:\ :if=/etc/apsfilter/basedir/bin/apsfilter:\ :sd=/var/spool/lpd/aps1:\ :lf=/var/spool/lpd/aps1/log:\ :af=/var/spool/lpd/aps1/acct:\ :mx#0:\ :sh: # APS1_END - don't delete this # APS2_BEGIN:printer2 # - don't delete start label for apsfilter printer2 # - no other printer defines between BEGIN and END LABEL #lp0|cdj670;r=600x600;q=high;c=full;p=a4;m=auto:\ # :lp=/dev/lp0:\ # :if=/etc/apsfilter/basedir/bin/apsfilter:\ # :sd=/var/spool/lpd/lp:\ # :lf=/var/spool/lpd/lp/log:\ # :af=/var/spool/lpd/lp/acct:\ # :mx#0:\ # :sh: # APS2_END - don't delete this # APS3_BEGIN:printer3 # - don't delete start label for apsfilter printer3 # - no other printer defines between BEGIN and END LABEL #aps2|cdj670;r=600x600;q=high;c=full;p=a4;m=auto:\ # :lp=/dev/lp0:\ # :if=/etc/apsfilter/basedir/bin/apsfilter:\ # :sd=/var/spool/lpd/aps2:\ # :lf=/var/spool/lpd/aps2/log:\ # :af=/var/spool/lpd/aps2/acct:\ ## :mx#0:\ # :sh: # APS3_END - don't delete this Качете си и html2ps. Към нето има sample конфигурация, която можете да използвате за модел на вашия ~/.html2psrc. Синтаксът е html2ps -f /path/to/*rcfile -o test.ps ./htmlfile. Макар да върши работа само за латиница, е чудесен инструмент. Кирилишки HTML се печати през Open Office с опцията от Print менюто Print to File. След което lpr -Pprinter -C:high filename. Кирилица в Lyx. Моят ~/.lyx/prefercences: ### This file is part of ### ======================================================== ### LyX, The Document Processor ### ### Copyright 1995 Matthias Ettrich ### Copyright 1995-2001 The LyX Team. ### ### ======================================================== # This file is written by LyX, if you want to make your own # modifications you should do them from inside LyX and save # # MISC SECTION ###################################### # # The default papersize to use. \default_papersize "a4" \kbmap true \kbmap_primary "/usr/local/share/lyx/kbd/american.kmap" \kbmap_secondary "/usr/local/share/lyx/kbd/bg-bds-1251.kmap" # # SCREEN & FONTS SECTION ############################ # \screen_zoom 164 \screen_font_roman "Times" \screen_font_roman_foundry "Rfx" \screen_font_sans "Arial" \screen_font_typewriter "Georgia" \screen_font_sizes 5.00 7.00 8.00 9.00 18.00 20.00 22.00 24.00 26.00 28.00 # # COLOR SECTION ################################### # \set_color "cursor" "#000000" \set_color "background" "#faf0e6" \set_color "foreground" "#000000" \set_color "selection" "#add8e6" \set_color "latex" "#8b0000" \set_color "preview" "#000000" \set_color "note" "#ffff00" \set_color "notebg" "#ffff00" \set_color "depthbar" "#cd5c5c" \set_color "language" "#0000ff" \set_color "command" "#000000" \set_color "commandbg" "#f0ffff" \set_color "commandframe" "#000000" \set_color "special" "#4169e1" \set_color "graphicsbg" "#faf0e6" \set_color "math" "#00008b" \set_color "mathbg" "#faf0e6" \set_color "mathmacrobg" "#faf0e6" \set_color "mathframe" "#ff00ff" \set_color "mathcursor" "#000000" \set_color "mathline" "#0000ff" \set_color "captionframe" "#8b0000" \set_color "collapsable" "#8b0000" \set_color "collapsableframe" "#cd5c5c" \set_color "insetbg" "#cccccc" \set_color "insetframe" "#cd5c5c" \set_color "error" "#ff0000" \set_color "eolmarker" "#a52a2a" \set_color "added_space" "#a52a2a" \set_color "appendixline" "#a52a2a" \set_color "topline" "#a52a2a" \set_color "tabularline" "#000000" \set_color "tabularonoffline" "#b0c4de" \set_color "bottomarea" "#666666" \set_color "pagebreak" "#4169e1" \set_color "top" "#e5e5e5" \set_color "bottom" "#999999" \set_color "left" "#e5e5e5" \set_color "right" "#999999" \set_color "buttonbg" "#cccccc" # # PRINTER SECTION ################################### # # # EXPORT SECTION #################################### # # # TEX SECTION ####################################### # \font_encoding "T2B" # # FILE SECTION ###################################### # # # ASCII EXPORT SECTION ############################## # # # SPELLCHECKER SECTION ############################## # \spell_command "aspell" # # LANGUAGE SUPPORT SECTION ########################## # # # 2nd MISC SUPPORT SECTION ########################## # \default_language bulgarian # # FORMATS SECTION ########################## # # # CONVERTERS SECTION ########################## # Прави прости PDF-и, PS и т.н. За висш пилотаж в TeX, ще трябва да отделите повече време и да пишете с vi/emacs. Справки: zadnik.org и tetex.org, ако не се лъжа. Поздрави, Димитър Василев << Как да подкараме DRI с i845' Intel Extreme Graphics | Повече сигурност с pam_limits >> |
Авторите на сайта, както и техните сътрудници запазват авторските права върху собствените си материали публикувани тук,
но те са copyleft т.е. могат свободно да бъдат копирани и разпространявани с изискването изрично да се упоменава името на автора,
както и да се публикува на видно място, че те са взети от оригиналния им URL-адрес на този сървър (http://www.linux-bg.org). Авторските права на преводните материали принадлежат на техните автори. Ако с публикуването тук на някакъв материал неволно са нарушени нечии права - след констатирането на този факт материалът ще бъде свален.
All trademarks, logos and copyrights mentioned on this site are the property of their respective owners.
|