2015-12-03 132 views
1

我嘗試刪除文本框之間的垂直空間。但是,由於我使用每次都會打開一個新的tikzpicture的newcommand,我不能使用我認爲的setspace? 有沒有其他想法?乳膠:parboxes之間的空間刪除

\documentclass[10pt,a5paper]{article} 
\usepackage[left=10mm, right=10mm, bottom=15mm, top=10mm, footskip=5mm]{geometry} 

\usepackage{xcolor} 
\xdefinecolor{links}{RGB}{251,212,180} 
\xdefinecolor{rechts}{RGB}{214,227,188} 
\xdefinecolor{mitte}{RGB}{218,216,215} 

\usepackage{tikz} 
\usepackage{varwidth} 
\usetikzlibrary{shapes} 
\tikzstyle{sms} = [rectangle callout, draw,very thick, rounded corners, minimum height=20pt] 

\newcommand{\smsr}[1]{\begin{flushright} 
\begin{tikzpicture} 
\node [sms, align=right,callout relative pointer={(0.5,0)}, fill=rechts] {\begin{varwidth}{0.7\textwidth}{#1}\end{varwidth}}; 
\end{tikzpicture}\end{flushright}} 

\newcommand{\smsl}[1]{\begin{flushleft} 
\begin{tikzpicture} 
    \node[sms, align=left,callout relative pointer={(-0.5,0)}, fill=links] {\begin{varwidth}{0.7\textwidth}{#1}\end{varwidth}}; 
    \end{tikzpicture}\end{flushleft} } 

\newcommand{\datum}[1]{\begin{center} \begin{tikzpicture} 
    \node[rectangle, very thick, text width=0.4\textwidth, rounded corners, draw,align=center, fill=mitte] {#1}; 
    \end{tikzpicture} \end{center}} 


\begin{document} 
\small 

\datum{Saturday, 22.July} 
\smsl{Send Hallo} 
\smsr{Answer Bye. Very long line to show the function of automatic line-breaking.} 
\smsr{Still awake?} 

\end{document} 

回答

1

將每個tikzpicture插入另一個環境中可能會插入不需要的垂直間距。也許沒有使用這些:

enter image description here

\documentclass[10pt,a5paper]{article} 
\usepackage[left=10mm, right=10mm, bottom=15mm, top=10mm, footskip=5mm]{geometry} 

\usepackage{xcolor} 
\xdefinecolor{links}{RGB}{251,212,180} 
\xdefinecolor{rechts}{RGB}{214,227,188} 
\xdefinecolor{mitte}{RGB}{218,216,215} 

\usepackage{tikz} 
\usepackage{varwidth} 
\usetikzlibrary{shapes} 
\tikzstyle{sms} = [rectangle callout, draw,very thick, rounded corners, minimum height=20pt] 

\newcommand{\smsr}[1]{\hfill 
    \begin{tikzpicture} 
    \node [sms, align=right,callout relative pointer={(0.5,0)}, fill=rechts] {\begin{varwidth}{0.7\textwidth}{#1}\end{varwidth}}; 
    \end{tikzpicture} 
    \par} 

\newcommand{\smsl}[1]{% 
    \begin{tikzpicture} 
    \node[sms, align=left,callout relative pointer={(-0.5,0)}, fill=links] {\begin{varwidth}{0.7\textwidth}{#1}\end{varwidth}}; 
    \end{tikzpicture} 
    \par} 

\newcommand{\datum}[1]{% 
    \begin{center} 
    \begin{tikzpicture} 
     \node[rectangle, very thick, text width=0.4\textwidth, rounded corners, draw,align=center, fill=mitte] {#1}; 
    \end{tikzpicture} 
    \end{center}} 

\setlength{\parindent}{0pt} 
\begin{document} 
\small 

\datum{Saturday, 22 July} 
\smsl{Send Hallo} 
\smsr{Answer Bye. Very long line to show the function of automatic line-breaking.} 
\smsr{Still awake?} 

\end{document} 

我也刪除任何段落縮進,但保留了冠軍(使用center)下面的文字氣泡間有一定距離設置。

以上的選擇,如果你打算使用\smsl\smsr\datum一切,是使用\raggedright\raggedleft\centering分別(而不是\hfill\smslcenterdatum)。