- Questo topic ha 12 risposte, 7 partecipanti ed è stato aggiornato l'ultima volta 22 anni, 11 mesi fa da .
-
Topic
-
Salve, ho scopiazzato e corretto uno csript trovato in rete per l’anteprima dei fonts installati nel nostro sistema ed utilizzabili con latex.
Lo script funziona con tetex sulla mia Debian, non so se funziona altrove.
In output riceverete una bell atabella con il nome della famiglia da usare nel comando \fontfamily{} e con una breve anteprima del carattere.`#!/bin/sh
# a script to make a sample page
# of LaTeX fonts installed on your systemTEXPATH=”/usr/share/texmf”
#TEXPATH=”/usr/local/share/texmf”
SAMPLEFILE=”sample.tex”FONTS=`find $TEXPATH -name “*.fd” -exec grep “DeclareFontFamily” {} \; | tr '{' '}' | cut -d '}' -f 4 | sort | uniq | grep -v put`
if [ -e $SAMPLEFILE ];
then
rm -f $SAMPLEFILE *.aux *.log *.dvi *.ps;if [ “$?” -ne 0 ];
then
echo “Some error occurred removing $SAMPLEFILE”
exit 1;
fifi
HEADER='
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{ae,aecompl}% Layout Setting
\oddsidemargin 0.0in
\evensidemargin 0.0in
\textwidth 6.5in
\headheight 15pt
\topmargin 0.0in
\textheight=9.0in\usepackage{supertabular}
\title{My \LaTeX~fonts\ldots}
\author{}
\date{}\newcommand\tabletitle{\\ Font Name & Sample Text\\\hline\hline}
\newcommand\sample[1]{\\ #1 & \fontfamily{#1} \selectfont QWERTY~~qwerty~~012345789\\\hline}\begin{document}
\vspace{-2cm}
\maketitle\begin{center}
\begin{supertabular}{p{2cm}|p{8cm}}\tabletitle
'
FOOTER='
\end{supertabular}
\end{center}\vspace{2cm}
\noindent
Use these fonts with \verb|\fontfamily{name}\selectfont| \newline
\hspace{10cm}Thanks to \LaTeXe.\end{document}
'echo “$HEADER” >> $SAMPLEFILE
for font in $FONTS;
do
echo ” \\sample{$font}” >> $SAMPLEFILE;
doneecho “$FOOTER” >> $SAMPLEFILE
# Ignoring unavailable fonts …
IGNOREFONTS=`latex $SAMPLEFILE | grep “LaTeX Font Warning: Font shape” | cut -d '/' -f 2 | sort | uniq`
echo $IGNOREFONTS
TMP1=`tempfile`
TMP2=`tempfile`echo “$FONTS” > $TMP1;
echo “$IGNOREFONTS” > $TMP2;if [ -z $IGNOREFONTS ];
then
VALIDFONTS=$FONTS
else
VALIDFONTS=`diff -y $TMP1 $TMP2 | grep '<' | cut -f 1` fi rm $TMP1 $TMP2; # The final sample file ... if [ -e $SAMPLEFILE ]; then rm -f $SAMPLEFILE *.aux *.log *.dvi *.ps; if [ "$?" -ne 0 ]; then echo "Some error occurred removing $SAMPLEFILE" exit 1; fi fi echo "$HEADER" >> $SAMPLEFILEfor font in $VALIDFONTS;
do
echo ” \\sample{$font}” >> $SAMPLEFILE;
doneecho “$FOOTER” >> $SAMPLEFILE
latex $SAMPLEFILE
dvips *.dvirm *.log *.aux *.tex *.dvi`
Provate e fate sapere.
Ho in cantiere anche uno script per facilitare l’installazione dei font postscript per LaTeX.
Ciao ciao,
RN
- Devi essere connesso per rispondere a questo topic.