beamer output: fix single digit column percentage (#4691)

fixes #4690
This commit is contained in:
Mauro Bieg 2018-06-07 19:50:14 +02:00 committed by John MacFarlane
parent 9536eb7c79
commit 905dee6ee3
4 changed files with 34 additions and 7 deletions

View file

@ -487,7 +487,7 @@ blockToLaTeX (Div (identifier,classes,kvs) bs)
then \contents ->
let fromPct xs =
case reverse xs of
'%':ds -> '0':'.': reverse ds
'%':ds -> showFl (read (reverse ds) / 100 :: Double)
_ -> xs
w = maybe "0.48" fromPct (lookup "width" kvs)
in inCmd "begin" "column" <>

View file

@ -58,7 +58,7 @@ ok
\protect\hypertarget{slide-one}{}
\begin{columns}[T]
\begin{column}{0.40\textwidth}
\begin{column}{0.4\textwidth}
\begin{itemize}
\tightlist
\item
@ -68,7 +68,7 @@ ok
\end{itemize}
\end{column}
\begin{column}{0.40\textwidth}
\begin{column}{0.4\textwidth}
\begin{itemize}
\tightlist
\item
@ -78,11 +78,10 @@ ok
\end{itemize}
\end{column}
\begin{column}{0.10\textwidth}
\begin{column}{0.1\textwidth}
ok
\end{column}
\end{columns}
\end{frame}
```

View file

@ -17,7 +17,7 @@ pandoc -t beamer
\protect\hypertarget{level-2-blocks}{}
\begin{columns}[T]
\begin{column}{0.40\textwidth}
\begin{column}{0.4\textwidth}
\begin{block}{Block one}
\begin{itemize}
@ -29,7 +29,7 @@ pandoc -t beamer
\end{block}
\end{column}
\begin{column}{0.60\textwidth}
\begin{column}{0.6\textwidth}
\begin{block}{Block two}
\begin{itemize}

28
test/command/4690.md Normal file
View file

@ -0,0 +1,28 @@
```
% pandoc -t beamer
# title
:::: {.columns}
::: {.column width="8%"}
content
:::
::: {.column width="84%"}
content2
:::
::::
^D
\begin{frame}{title}
\protect\hypertarget{title}{}
\begin{columns}[T]
\begin{column}{0.08\textwidth}
content
\end{column}
\begin{column}{0.84\textwidth}
content2
\end{column}
\end{columns}
\end{frame}
```