summaryrefslogtreecommitdiff
path: root/docutils
diff options
context:
space:
mode:
authorgrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-05-28 10:51:16 +0000
committergrubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2007-05-28 10:51:16 +0000
commit42779ab4dbb4f85752a12ffdac62ddb9d1173b87 (patch)
tree2710567a220daa95a76d351b055f90c3bcbd04ef /docutils
parentc6539723165e2ea2ed6ed31f728dc975ce7f96bc (diff)
downloaddocutils-42779ab4dbb4f85752a12ffdac62ddb9d1173b87.tar.gz
Table column width with 3 decimal places.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5167 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
-rw-r--r--docutils/HISTORY.txt1
-rw-r--r--docutils/docutils/writers/latex2e/__init__.py2
-rw-r--r--docutils/test/functional/expected/standalone_rst_latex.tex10
-rwxr-xr-xdocutils/test/test_writers/test_latex2e.py4
4 files changed, 9 insertions, 8 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt
index e26b884b6..e54b8ea70 100644
--- a/docutils/HISTORY.txt
+++ b/docutils/HISTORY.txt
@@ -116,6 +116,7 @@ Changes Since 0.4
* docutils/writers/latex2e/__init__.py:
+ - Table column width with 3 decimal places.
- Add table stubs support (boldfont).
- Add assemble_parts to writer.
- Add simply support for nested tables.
diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py
index d58c9c5eb..b8f0e7fcf 100644
--- a/docutils/docutils/writers/latex2e/__init__.py
+++ b/docutils/docutils/writers/latex2e/__init__.py
@@ -470,7 +470,7 @@ class Table:
colwidth = factor * float(node['colwidth']+1) / width
self._col_width.append(colwidth+0.005)
self._rowspan.append(0)
- latex_table_spec += "%sp{%.2f\\locallinewidth}" % (bar,colwidth+0.005)
+ latex_table_spec += "%sp{%.3f\\locallinewidth}" % (bar,colwidth+0.005)
return latex_table_spec+bar
def get_column_width(self):
diff --git a/docutils/test/functional/expected/standalone_rst_latex.tex b/docutils/test/functional/expected/standalone_rst_latex.tex
index 4cc2f0eab..eda0be6e5 100644
--- a/docutils/test/functional/expected/standalone_rst_latex.tex
+++ b/docutils/test/functional/expected/standalone_rst_latex.tex
@@ -914,7 +914,7 @@ A figure directive:
\includegraphics[width=50]{../../../docs/user/rst/images/biohazard.png}
\caption{A figure is an image with a caption and/or a legend:}{\small
-\begin{longtable}[c]{|p{0.16\locallinewidth}|p{0.56\locallinewidth}|}
+\begin{longtable}[c]{|p{0.156\locallinewidth}|p{0.563\locallinewidth}|}
\hline
re
@@ -1209,7 +1209,7 @@ Compound 5, block 3 (a paragraph).
Compound 7, with a table inside:
-\begin{longtable}[c]{|p{0.25\locallinewidth}|p{0.25\locallinewidth}|p{0.25\locallinewidth}|}
+\begin{longtable}[c]{|p{0.249\locallinewidth}|p{0.249\locallinewidth}|p{0.249\locallinewidth}|}
\hline
Left cell, first
@@ -1317,7 +1317,7 @@ paragraph 2
This table has a cell spanning two columns:
-\begin{longtable}[c]{|p{0.07\locallinewidth}|p{0.07\locallinewidth}|p{0.09\locallinewidth}|}
+\begin{longtable}[c]{|p{0.075\locallinewidth}|p{0.075\locallinewidth}|p{0.086\locallinewidth}|}
\hline
\multicolumn{2}{|l|}{\textbf{
Inputs
@@ -1378,7 +1378,7 @@ True
Here's a table with cells spanning several rows:
-\begin{longtable}[c]{|p{0.30\locallinewidth}|p{0.16\locallinewidth}|p{0.23\locallinewidth}|}
+\begin{longtable}[c]{|p{0.296\locallinewidth}|p{0.156\locallinewidth}|p{0.226\locallinewidth}|}
\hline
\textbf{
Header row, column 1
@@ -1499,7 +1499,7 @@ width as the third line.
\subsection*{5.2~~~Various non-ASCII characters}
\label{various-non-ascii-characters}
-\begin{longtable}[c]{|p{0.03\locallinewidth}|p{0.42\locallinewidth}|}
+\begin{longtable}[c]{|p{0.028\locallinewidth}|p{0.424\locallinewidth}|}
\hline
©
diff --git a/docutils/test/test_writers/test_latex2e.py b/docutils/test/test_writers/test_latex2e.py
index 60492569d..f3a225194 100755
--- a/docutils/test/test_writers/test_latex2e.py
+++ b/docutils/test/test_writers/test_latex2e.py
@@ -385,7 +385,7 @@ latex_head + """\
\\setlength{\\locallinewidth}{\\linewidth}
-\\begin{longtable}[c]{|p{0.07\locallinewidth}|p{0.07\locallinewidth}|}
+\\begin{longtable}[c]{|p{0.075\locallinewidth}|p{0.075\locallinewidth}|}
\\caption{Foo}\\\\
\\hline
& \\\\
@@ -419,7 +419,7 @@ latex_head + """\
\\setlength{\\locallinewidth}{\\linewidth}
-\\begin{longtable}[c]{p{0.07\locallinewidth}p{0.07\locallinewidth}}
+\\begin{longtable}[c]{p{0.075\locallinewidth}p{0.075\locallinewidth}}
1
&