Georg Brandl avatar Georg Brandl committed 7e29662

#380: use correct command to determine line width when two-column layout is in effect.

Comments (0)

Files changed (2)

sphinx/texinputs/sphinx.sty

 \newlength\leftsidespace
 \def\mycolorbox#1{%
   \setlength\leftsidespace{\@totalleftmargin}%
-  \setlength\distancetoright{\textwidth}%
+  \setlength\distancetoright{\linewidth}%
   \advance\distancetoright -\@totalleftmargin %
   \noindent\hspace*{\@totalleftmargin}%
   \fcolorbox{VerbatimBorderColor}{VerbatimColor}{%
 \newcommand{\pysiglinewithargsret}[3]{%
   \settowidth{\py@argswidth}{#1\code{(}}%
   \addtolength{\py@argswidth}{-2\py@argswidth}%
-  \addtolength{\py@argswidth}{\textwidth}%
+  \addtolength{\py@argswidth}{\linewidth}%
   \item[#1\code{(}\py@sigparams{#2}{#3}]}
 
 % This version is being checked in for the historical record; it shows

sphinx/writers/latex.py

 
     def visit_topic(self, node):
         self.body.append('\\setbox0\\vbox{\n'
-                         '\\begin{minipage}{0.95\\textwidth}\n')
+                         '\\begin{minipage}{0.95\\linewidth}\n')
     def depart_topic(self, node):
         self.body.append('\\end{minipage}}\n'
                          '\\begin{center}\\setlength{\\fboxsep}{5pt}'
         elif self.table.has_verbatim:
             self.body.append('\n\\begin{tabular}')
         else:
-            self.body.append('\n\\begin{tabulary}{\\textwidth}')
+            self.body.append('\n\\begin{tabulary}{\\linewidth}')
         if self.table.colspec:
             self.body.append(self.table.colspec)
         else:
             if self.table.has_verbatim:
                 colwidth = 0.95 / self.table.colcount
-                colspec = ('p{%.3f\\textwidth}|' % colwidth) * \
+                colspec = ('p{%.3f\\linewidth}|' % colwidth) * \
                           self.table.colcount
                 self.body.append('{|' + colspec + '}\n')
             elif self.table.longtable:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.