
垂直線怎麼畫虛線投影機中的列之間的線?
我已經找到如何製作垂線, 但不是虛線:(
答案1
有點 hacky,但是透過您提供的dashrule
套件和\rotatebox
宏,graphicx
您可以實現類似以下內容的功能(MWE 取自您連結的其他問題):
\documentclass[demo]{beamer}
\usepackage{dashrule}
\begin{document}
\begin{columns}[c]
\begin{column}{0.5\textwidth}
\includegraphics<1>[width=0.35\textwidth]{picture.jpg}
\end{column}
\rotatebox{-90}{\hskip-1.8cm\hdashrule[0.2ex]{5cm}{1pt}{3mm}}
\begin{column}{0.50\textwidth}
\hskip10pt
\includegraphics<1>[width=0.35\textwidth]{picture.jpg}
\end{column}
\end{columns}
\end{document}
您需要將\hdashrule
巨集封裝到旋轉框中,並在旋轉後手動調整規則的起點\hskip
。
\hdashrule
您可以透過套件文件中解釋的命令參數來控制規則的破折因子、厚度、長度等。
TikZ解決方案
只是為了好玩,這裡有一個基於 TikZ 的替代解決方案:
\documentclass[demo]{beamer}
\usepackage{tikz}
\newcommand{\vdashrule}[1]{\tikz[remember picture]\draw[dashed,thick,overlay](current page.north)--+(0,-#1);}
\begin{document}
\begin{columns}[c]
\begin{column}{0.5\textwidth}
\includegraphics<1>[width=0.35\textwidth]{picture.jpg}
\end{column}
\vdashrule{3.5}
\begin{column}{0.50\textwidth}
\hskip10pt
\includegraphics<1>[width=0.35\textwidth]{picture.jpg}
\end{column}
\end{columns}
\end{document}
我剛剛定義了一個\vdashrule
利用overlay
和remember picture
TikZ 選項的命令,它可以讓您將規則錨定到框架邊框(或框架中的其他任何位置,如果您願意)。
規則的長度由參數指定,樣式可以透過 TikZ 選項控制。
視覺結果與之前的螢幕截圖幾乎相同。