I'm just learning latex, so this may be trivial to some of you. I went through a few tutorials but they all seem to cover the same things.
我只是在学习乳胶,所以这对你们中的一些人来说可能是微不足道的。我经历了一些教程,但它们似乎都涵盖了同样的事情。
I'm writing a big report - calculation all the way (and it has to be neat, because it's part of the documentation). It consists of a frame around the page (15mm margins), and 3 columns inside it: in the left column (3cm wide) are references from where the equation came from (e.g. "ABS 3-2-7"), in the middle is the calculation and in the right is the accepted value (5cm wide). It is a standard way of doing things, so I don't have a choice over the layout.
我正在撰写一份大报告 - 一路计算(而且必须整洁,因为它是文档的一部分)。它由一个围绕页面的框架(15mm边距)和内部的3列组成:左列(3cm宽)是等式来自的位置(例如“ABS 3-2-7”),位于中间是计算,右边是可接受的值(5厘米宽)。这是一种标准的做事方式,所以我没有选择布局。
Now, I don't understand, how would I go in creating such layout ? The frame with columns has to appear on every page. How to accomplish that ? I've never seen such a document so I'm not sure how to ease the creation.
现在,我不明白,我将如何创建这样的布局?带有列的框架必须出现在每个页面上。怎么做到这一点?我从未见过这样的文件所以我不确定如何减轻创作。
And second, how do I rename things that are in english language in document classes ? For example, "article" class, I have "References" and I need to have "Literatura". Is there a way to rename it without touching .cls file?
第二,如何在文档类中重命名英语语言的东西?例如,“文章”类,我有“参考”,我需要“Literatura”。有没有办法重命名它而不涉及.cls文件?
3 个解决方案
#1
For your first problem, look at the longtable package (available at ctan.org if you haven't already got it installed)
对于您的第一个问题,请查看longtable包(如果您尚未安装,请访问ctan.org)
The problem with using tabular is it won't work as you want across pages.
使用表格的问题是它不会像你想要的那样在页面之间工作。
As far as the second problem, it will depend on the environment and the document type, but typically you'll have to renew a command.
就第二个问题而言,它将取决于环境和文档类型,但通常您必须更新命令。
For example, add to the preamble \renewcommand\refname{Literatura} for the article class to do what you were asking for. If I recall correctly it is bibname for books.
例如,添加到文章类的前导码\ renewcommand \ refname {Literatura}以执行您要求的操作。如果我没记错的话,这是书的bibname。
#2
Table design in LaTeX has not been made very easy. I would use tabbing
rather than tabular
and draw the lines manually to keep things simple. A downside is that you don't get any automatic sizing of the table cells, but since your format is fixed, I would consider it a good thing (i.e., if text overflows, you notice it and get to fix it yourself, and your table doesn't accidentally get stretched into the margins). If you use multiple tables like this in your document, try packaging the commands with \newenvironment
.
LaTeX中的表设计并不容易。我会使用tabbing而不是tabular并手动绘制线条以保持简单。一个缺点是你没有得到表格单元格的任何自动调整,但由于你的格式是固定的,我认为这是一件好事(即,如果文本溢出,你会发现它并自己修复它,并且你的表不会意外地伸入边缘)。如果在文档中使用这样的多个表,请尝试使用\ newenvironment打包命令。
\documentclass{article}
\usepackage[margin=15mm]{geometry}
\usepackage{amsmath}
\usepackage{calc}
\newlength{\tableheight}
\setlength{\tableheight}{20cm} % how high to draw the lines of the table
\newlength{\rulethickness}
\setlength{\rulethickness}{1pt} % how thick lines to draw
\newcommand{\verticalline}{\smash{\rule[-\tableheight]{\rulethickness}{\tableheight}}}
\newlength{\myindent}
\setlength{\myindent}{3mm} % how much to indent each column
\newlength{\leftcolumn}
\setlength{\leftcolumn}{3cm-\myindent}
\newlength{\midcolumn}
\setlength{\midcolumn}{\textwidth-3cm-5cm-\myindent-\rulethickness}
\newlength{\rightcolumn}
\setlength{\rightcolumn}{5cm-\myindent}
\begin{document}
\begin{tabbing}
% first set the tab stops
\hspace*{\myindent}\=\hspace{\leftcolumn}\=%
\hspace{\myindent}\=\hspace{\midcolumn}\=%
\hspace{\myindent}\=\hspace{\rightcolumn}\=\kill
% then draw the lines
\rule{\textwidth}{\rulethickness}\\[-\baselineskip]
\smash{\rule[-\tableheight]{\textwidth}{\rulethickness}}\\[-\baselineskip]
\verticalline\>\>\verticalline\>\>\verticalline\>\>\verticalline\\
% Now start the table: indent the first column with \>
\>ABS 3--2--7
% ... and each additional column with \>\>
\>\> $\iint_{-\infty,-\infty}^{\infty,\infty} e^{-x^2-y^2}\, dx\,dy$
\>\> 2.507
% End each line with \\, add e.g. [2pt] to get 2pt extra space if required
\\[2pt]
% here's another line:
\>ABS 3--2--8 \>\> $\displaystyle\sum_{k=0}^n k^2$ \>\> $\frac12 n(n+1)$ \\
% etc. Be careful not to overflow the table - there's no automatic check for that.
\end{tabbing}
\newpage % also remember to start a new page after the table
\end{document}
To change the fixed names, see this FAQ, or possibly this one if you are using babel
.
要更改固定名称,请参阅此常见问题解答,如果您使用babel,请参阅此常见问题解答。
#3
In this case you probably want to use the tabular
environment to generate the three columns (or as simon notes longtable
if your report-thingy runs longer than one page). Something like:
在这种情况下,您可能希望使用表格环境来生成三列(如果您的报表内容超过一页,则可以使用simon注释。就像是:
\framebox{
\centering
\begin{tabular}{p{3cm}|p{\specialwidth}|p{5cm}}
Ref 1-0-0 & 1.2345 & 1.2346 \\
Ref 1-0-1 & 2.3456 & 2.3454 \\
...
\end{tabular}
}
You'll note that I've used paragraph formatted columns (the p{<length>}
formatting specifiers), and stuck a frame around it with \framebox
.
你会注意到我使用了段落格式的列(p {
You can either compute \specialwidth
by hand, or calculate it:
您可以手动计算\ specialwidth,也可以计算它:
\newlength{\specialwidth}
\setlength{\specialwidth}{\textwidth}
\addtolength{\specialwidth}{-10cm} % extra room for the seperators...
I can't help you on the internationalization issue...
我无法帮助你解决国际化问题......
#1
For your first problem, look at the longtable package (available at ctan.org if you haven't already got it installed)
对于您的第一个问题,请查看longtable包(如果您尚未安装,请访问ctan.org)
The problem with using tabular is it won't work as you want across pages.
使用表格的问题是它不会像你想要的那样在页面之间工作。
As far as the second problem, it will depend on the environment and the document type, but typically you'll have to renew a command.
就第二个问题而言,它将取决于环境和文档类型,但通常您必须更新命令。
For example, add to the preamble \renewcommand\refname{Literatura} for the article class to do what you were asking for. If I recall correctly it is bibname for books.
例如,添加到文章类的前导码\ renewcommand \ refname {Literatura}以执行您要求的操作。如果我没记错的话,这是书的bibname。
#2
Table design in LaTeX has not been made very easy. I would use tabbing
rather than tabular
and draw the lines manually to keep things simple. A downside is that you don't get any automatic sizing of the table cells, but since your format is fixed, I would consider it a good thing (i.e., if text overflows, you notice it and get to fix it yourself, and your table doesn't accidentally get stretched into the margins). If you use multiple tables like this in your document, try packaging the commands with \newenvironment
.
LaTeX中的表设计并不容易。我会使用tabbing而不是tabular并手动绘制线条以保持简单。一个缺点是你没有得到表格单元格的任何自动调整,但由于你的格式是固定的,我认为这是一件好事(即,如果文本溢出,你会发现它并自己修复它,并且你的表不会意外地伸入边缘)。如果在文档中使用这样的多个表,请尝试使用\ newenvironment打包命令。
\documentclass{article}
\usepackage[margin=15mm]{geometry}
\usepackage{amsmath}
\usepackage{calc}
\newlength{\tableheight}
\setlength{\tableheight}{20cm} % how high to draw the lines of the table
\newlength{\rulethickness}
\setlength{\rulethickness}{1pt} % how thick lines to draw
\newcommand{\verticalline}{\smash{\rule[-\tableheight]{\rulethickness}{\tableheight}}}
\newlength{\myindent}
\setlength{\myindent}{3mm} % how much to indent each column
\newlength{\leftcolumn}
\setlength{\leftcolumn}{3cm-\myindent}
\newlength{\midcolumn}
\setlength{\midcolumn}{\textwidth-3cm-5cm-\myindent-\rulethickness}
\newlength{\rightcolumn}
\setlength{\rightcolumn}{5cm-\myindent}
\begin{document}
\begin{tabbing}
% first set the tab stops
\hspace*{\myindent}\=\hspace{\leftcolumn}\=%
\hspace{\myindent}\=\hspace{\midcolumn}\=%
\hspace{\myindent}\=\hspace{\rightcolumn}\=\kill
% then draw the lines
\rule{\textwidth}{\rulethickness}\\[-\baselineskip]
\smash{\rule[-\tableheight]{\textwidth}{\rulethickness}}\\[-\baselineskip]
\verticalline\>\>\verticalline\>\>\verticalline\>\>\verticalline\\
% Now start the table: indent the first column with \>
\>ABS 3--2--7
% ... and each additional column with \>\>
\>\> $\iint_{-\infty,-\infty}^{\infty,\infty} e^{-x^2-y^2}\, dx\,dy$
\>\> 2.507
% End each line with \\, add e.g. [2pt] to get 2pt extra space if required
\\[2pt]
% here's another line:
\>ABS 3--2--8 \>\> $\displaystyle\sum_{k=0}^n k^2$ \>\> $\frac12 n(n+1)$ \\
% etc. Be careful not to overflow the table - there's no automatic check for that.
\end{tabbing}
\newpage % also remember to start a new page after the table
\end{document}
To change the fixed names, see this FAQ, or possibly this one if you are using babel
.
要更改固定名称,请参阅此常见问题解答,如果您使用babel,请参阅此常见问题解答。
#3
In this case you probably want to use the tabular
environment to generate the three columns (or as simon notes longtable
if your report-thingy runs longer than one page). Something like:
在这种情况下,您可能希望使用表格环境来生成三列(如果您的报表内容超过一页,则可以使用simon注释。就像是:
\framebox{
\centering
\begin{tabular}{p{3cm}|p{\specialwidth}|p{5cm}}
Ref 1-0-0 & 1.2345 & 1.2346 \\
Ref 1-0-1 & 2.3456 & 2.3454 \\
...
\end{tabular}
}
You'll note that I've used paragraph formatted columns (the p{<length>}
formatting specifiers), and stuck a frame around it with \framebox
.
你会注意到我使用了段落格式的列(p {
You can either compute \specialwidth
by hand, or calculate it:
您可以手动计算\ specialwidth,也可以计算它:
\newlength{\specialwidth}
\setlength{\specialwidth}{\textwidth}
\addtolength{\specialwidth}{-10cm} % extra room for the seperators...
I can't help you on the internationalization issue...
我无法帮助你解决国际化问题......