优化 Latex 生成的 PDF 文件的打印区域

优化 Latex 生成的 PDF 文件的打印区域

我正在使用文档类extarticle为我的班级制作测验、作业等。在 pdf 输出文件中,有很多空间未使用。这导致额外的纸张消耗。我们如何使 pdf 输出更紧凑以避免纸张浪费。

我将非常感激任何对此提供的帮助。

沙阿

下面给出了一个最小示例。pdf 输出包含两页,但内容非常简短,应该可以轻松放在一页甚至更少的页面上。减小字体大小是一个有用的技巧,但如果我不想减小字体,还有其他方法可以优化打印区域吗?

\documentclass[a4, 14pt]{extarticle}

\usepackage{extsizes}

\usepackage{amsmath,amssymb,bm}

\begin{document}

{{\begin{center} \Large{ Calculus II (MAT-1205)} \end{center}} {{\begin{center}  Sequences and Series  \end{center}} {{\begin{center}  \bf{Quiz $\# 3$ (5\% Weightage) }\end{center}}
\noindent
\begin{tabular}{@{}p{3in}p{2.5in}}
{\bf{Name: \line(1,0){130}  }} \hspace{0.5cm} & {\bf{Roll No. \line(1,0){80}  }} \\ & \\
{\bf {Summer 2014}} \hspace{0.5cm} & Thursday, Sep 19, 2014 \\ & \\
{\bf{Duration:}} 25 Minutes \hspace{0.5cm} & {\bf{Maximum Points: }} 20 \\
\hline \hline
\end{tabular}

\vspace{2cm}

\noindent
{\bf{Important Note:}} Show all the details of your solutions. Failing to do so may result in deduction of marks.  \\

\noindent
{\bf{Question 1}} \\

\noindent
Determine if the following infinite sequences converge or diverge. If the sequence converges, determine its limit. \\

\noindent
(i) \begin{equation}
\left\{\frac{3n^{2}-1}{10n+5n^{2}}\right\}_{n=2}^{\infty} \nonumber
\end{equation}

\noindent
(ii) %\begin{align}
 \[ \left\{\frac{(-1)^{n}}{n}\right\}_{n=1}^{\infty} \] %$$

\begin{flushright} {\bf{10 points}} \end{flushright}

\noindent
{\bf{Question 2}} \\ % 

\noindent
Express the repeating decimal $5.232323...$ as the ratio of two integers.  

\begin{flushright} {\bf{10 points}} \end{flushright}


\end{document}

答案1

  1. 不要使用\begin{center}\centering而是在组内使用
  2. \bf{text}是错误的。使用\textbf{text}{\bfseries text}
  3. 同样适用于\Large{text},应该是{\Large text}

话虽如此,您可以使用包减少默认边距geometry

\documentclass[a4paper, 14pt]{extarticle}
\usepackage[margin=1in]{geometry}
%\usepackage{extsizes}    % not need with this class

\usepackage{amsmath,amssymb,bm}

\begin{document}

{\centering
{\Large Calculus II (MAT-1205)}

\medskip
Sequences and Series

\medskip
\bfseries Quiz $\# 3$ (5\% Weightage)
\par}

\bigskip
\noindent
\begin{tabular}{@{}p{3in}p{2.5in}}
{\textbf{Name: \line(1,0){130}  }} \hspace{0.5cm} & {\textbf{Roll No. \line(1,0){80}  }} \\ & \\
{\textbf {Summer 2014}} \hspace{0.5cm} & Thursday, Sep 19, 2014 \\ & \\
{\textbf{Duration:}} 25 Minutes \hspace{0.5cm} & {\textbf{Maximum Points: }} 20 \\
\hline \hline
\end{tabular}

\vspace{1cm}

\noindent
{\textbf{Important Note:}} Show all the details of your solutions. Failing to do so may result in deduction of marks.  \\

\noindent
{\textbf{Question 1}} \\

\noindent
Determine if the following infinite sequences converge or diverge. If the sequence converges, determine its limit. \\

\noindent
(i) \begin{equation}
\left\{\frac{3n^{2}-1}{10n+5n^{2}}\right\}_{n=2}^{∞} \nonumber
\end{equation}

\noindent
(ii) %\begin{align}
 \[ \left\{\frac{(-1)ⁿ}{n}\right\}_{n=1}^{∞} \] %$$

\begin{flushright} {\bf{10 points}} \end{flushright}

\noindent
{\textbf{Question 2}} \\ %

\noindent
Express the repeating decimal $5.232323...$ as the ratio of two integers.

\begin{flushright} {\textbf{10 points}} \end{flushright}


\end{document}

在此处输入图片描述

答案2

当然,有一些很棒的测验软件包,但您可以创建自己的风格。在这里,我将纸张设置为列,因为 A4 页面不太适合打印宽行,并且为了有效利用空间,需要更多列。

我还创建了一些宏,以便于使用,并提高一致性。现在,您只需使用,\Question{points}{question}而不必使用大量格式和冗余代码。我还使用了 no parskip-package 来删除缩进,因为您显然不希望在这里这样做。

现在会自动计算可用的最大分数和总数并将其放入头表中。

编号的输出equation已更改,因此它使用罗马数字,正如您所希望的那样。您不需要手动添加它。

输出

在此处输入图片描述

代码

\documentclass[a4paper, 14pt,twocolumn]{extarticle}

\usepackage[
  margin=1cm,
  includefoot,
  footskip=20pt
  ]{geometry}
\usepackage{parskip}% To remove indent on paragraphs for whole document
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{totcount}% To display the total number of points for this quiz.
\usepackage{tabularx}

\newtotcounter{points}
\newcommand{\Points}[1]{%
  \addtocounter{points}{#1}% Store how many points we have in total
  \par\hfill{\bfseries#1 points}\par%
}
\newtotcounter{question}
\newcommand{\QuestionTitle}{%
  \par\bigskip%
     \stepcounter{question}%
    {\bfseries Question \thequestion}
    \medskip%
}

\newcommand{\Question}[2]{%
  \QuestionTitle

  #2

  \Points{#1}
}
\renewcommand{\theequation}{\roman{equation}}

\begin{document}
\makeatletter
\twocolumn[
\begin{@twocolumnfalse}%{\textwidth}
{\centering
{\Large Calculus II (MAT-1205)}

\medskip
Sequences and Series

\medskip
\bfseries Quiz $\# 3$ (5\% Weightage)
\par}

\bigskip
\renewcommand{\arraystretch}{1.5}% A factor for extra space between lines
\begin{tabularx}{\textwidth}{@{\hspace{2cm}}lXl@{\hspace{2cm}}}
  \textbf{Name: \line(1,0){130}} && {\textbf{Roll No. \line(1,0){80}  }} \\
  \textbf{Summer 2014} && Thursday, Sep 19, 2014 \\
  \textbf{Duration:} \textbf{25} Minutes \hspace{0.5cm} && \textbf{\total{points}} points, with \textbf{\total{question}} questions. \\
  \hline \hline
\end{tabularx}
\vspace{.5cm}
\end{@twocolumnfalse}
]
\makeatother

\framebox[\columnwidth]{\parbox{.9\columnwidth}{{\textbf{Important Note:}} Show all the details of your solutions. Failing to do so may result in deduction of marks.}}

\Question{10}{%

Determine if the following infinite sequences converge or diverge. If the sequence converges, determine its limit.

\begin{equation}
  \left\{ \frac{ 3n^{2}-1 }{ 10n + 5n^{2} } \right\}_{ n=2 }^{ \infty }
\end{equation}
\begin{equation}
  \left\{ \frac{ (-1) ?}{ n } \right\}_{ n=1 }^{ \infty }
\end{equation}
}

\Question{10}{%

Express the repeating decimal \(5.232323\ldots\) as the ratio of two integers.
}

\Question{20}{What is the meaning of life?}
\Question{25}{How much wood would a woodchuck chuck if a woodchuck could chuck wood?}
  \vfill\eject% Manulal columnbreak. For `\multicols`, you could use `\columnbreak`
\Question{50}{How many ducks are there on \texttt{tex.stackexchange.com}?}
\Question{5}{Does a duck produce an echo?}
\Question{10}{Are tigers better than ducks?}
\Question{15}{What about donkeys?}




\end{document}

相关内容