【问题标题】:Latex: Space remove between parboxes乳胶:parboxes之间的空间删除
【发布时间】:2015-12-03 21:33:03
【问题描述】:

我尝试删除文本框之间的垂直空间。但是,由于我使用每次打开新 tikzpicture 的 newcommand,我认为我不能使用 setspace? 还有其他想法吗?

\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}

【问题讨论】:

    标签: latex tikz


    【解决方案1】:

    在另一个环境中插入每个tikzpicture 可能会插入不需要的垂直间距。也许不要使用它们:

    \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 用于\smslcenter 用于datum)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-19
      相关资源
      最近更新 更多