如何在方框中写便条?

如何在方框中写便条?

如何写出像便签一样的笔记?我使用了命令,\framebox但页面空间不足,部分文本消失了。有没有更好的方法?

这是我正在写的一个示例。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tgbonum}
\begin{document}
\framebox[1.02\width]{Note: don't use this for a single sphere  use {\LARGE $C=\frac{k}{K_e(\frac{1}{b}-\frac{1}{a})}$} and at infinity $\frac{1}{a}$=0 (stray capacitance) }
\end{document} 

答案1

如何书写像便签一样的笔记?

我曾经tcolorbox做过一个看起来像便签的“盒子”。代码如下:

\documentclass{article}
\usepackage[utf8]{inputenc}

% Packages needed:
\usepackage{tikz, adjustbox}
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{wrapfig}

% Defining colors for sticky note:
\definecolor{BgYellow}{HTML}{FFF59C}
\definecolor{FrameYellow}{HTML}{F7A600}

% Dummy text package:
\usepackage{lipsum}

% Defining Sticky note box:
\newtcolorbox{StickyNote}[1][]{%
    enhanced,
    before skip=2mm,after skip=2mm, 
    width=0.5\textwidth, boxrule=0.2mm, % width of the sticky note
    colback=BgYellow, colframe=FrameYellow, % Colors
    attach boxed title to top left={xshift=0cm,yshift*=0mm-\tcboxedtitleheight},
    varwidth boxed title*=-3cm,
    % The titlebox:
    boxed title style={frame code={%
        \path[left color=FrameYellow,right color=FrameYellow,
        middle color=FrameYellow]
        ([xshift=-0mm]frame.north west) -- ([xshift=0mm]frame.north east)
        [rounded corners=0mm]-- ([xshift=0mm,yshift=0mm]frame.north east)
        -- (frame.south east) -- (frame.south west)
        -- ([xshift=0mm,yshift=0mm]frame.north west)
        [sharp corners]-- cycle;
        },interior engine=empty,
    },
    sharp corners,rounded corners=southeast,arc is angular,arc=3mm,
    % The "folded paper" in the bottom right corner:
    underlay={%
        \path[fill=BgYellow!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
        \path[draw=FrameYellow,shorten <=-0.05mm,shorten >=-0.05mm,color=FrameYellow] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
        },
    drop fuzzy shadow, % Shadow
    fonttitle=\bfseries, 
    title={#1}
}

\begin{document}

% Put the sticky note in a wrapfigure to have text wrap around it.
\begin{wrapfigure}{L}{0.6\textwidth}
\begin{StickyNote}[Sticky Note]

Note: don't use this for a single sphere  use {\LARGE $C=\frac{k}{K_e(\frac{1}{b}-\frac{1}{a})}$} and at infinity $\frac{1}{a}$=0 (stray capacitance)

\end{StickyNote}
\end{wrapfigure}
\lipsum[1-1]

\end{document}

输出结果如下:

在此处输入图片描述

您也可以使用不带标题的便签。为此,只需删除[Sticky Note]后面的即可\begin{StickyNote}

相关内容