因此我创建了以下内容:
\documentclass[17pt]{extarticle}
\usepackage{extsizes}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{fancyhdr}
\usepackage{fontspec}
\usepackage{tikz}
% To set the font and formatting:
\setmainfont{[lcars.ttf]} %To load the font named lcars
%\setmainfont[AutoFakeBold=1.5, AutoFakeSlant=0.4]{lcars.ttf} % To set bold or italics if I wanted to.
% LCARS Colours begin:
% Sources for colours:
% http://lcarsmania.com/designguide/Okudagrams_Color.png
% http://www.lcarscom.net/lcars_colors.gif
\definecolor{LCARSBG}{HTML}{000000} % Pure black
\definecolor{LCARSTCMain}{HTML}{FF9900} %Dark yellow
\definecolor{LCARSTC1}{HTML}{CC99CC} % Light purple
\definecolor{LCARSTC2}{HTML}{9999CC} % Light blue
\definecolor{LCARSTC3}{HTML}{CC6666} % Light red
\definecolor{LCARSTC4}{HTML}{FFCC99} % Light peach
\definecolor{LCARSTC5}{HTML}{9999FF} % Light blue, a different variant
\definecolor{LCARSTC6}{HTML}{FF9966} % Light orange
\definecolor{LCARSTC7}{HTML}{CC6699} % Pink
\definecolor{LCARSTC8}{HTML}{F5173C} % Light red
% LCARS Colours end.
% To set page numbers to the right colour and style.
\makeatletter
\fancypagestyle{mypagestyle}{%
\fancyhf{}% Clear header/footer
\fancyfoot[C]{\textcolor{LCARSTCMain}{\thepage}}% Page # in middle/centre of footer
\renewcommand{\footrulewidth}{0pt}% No footer rule
\def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi
\vskip-\footruleskip\vskip-\footrulewidth
\hrule\@width\headwidth\@height\footrulewidth\vskip\footruleskip}}
}
\makeatother
\pagestyle{mypagestyle}
\begin{document}
\begin{flushleft}
\pagecolor{LCARSBG} % Page background colour.
\color{LCARSTCMain} % Main body text colour.
\section*{\textcolor{LCARSTC5}{Section Title:}}
\textcolor{LCARSTC8}{A question or subheading here?}\newline
\textcolor{LCARSTC6}{Another sub heading:}\newline
\lipsum[1]
\begin{tikzpicture}
\draw[rounded corners] (0, 0) rectangle (4, 1) {};
\end{tikzpicture}
\end{flushleft}
\end{document}
但是我想要做实际的形状我相信 tikz 包最适合这个?
看着 :http://www.lcars-terminal.de/tutorial/guideline.htm
尤其是http://www.lcars-terminal.de/tutorial/guideline/font_size.gif
我想将像此图所示的形状添加到文档的页边距和页眉,实现此目的的最佳方法是什么?我是 LaTeX 初学者。
答案1
这是为了给你一个开始。
\documentclass[tikz,border=3.14mm]{standalone}
\definecolor{LCARSTC2}{HTML}{9999CC} % Light blue
\begin{document}
\begin{tikzpicture}[LCAR/.style={rounded corners,path picture={
\fill[LCARSTC2,even odd rule,rounded corners] (path picture bounding box.south west)
rectangle (path picture bounding box.north east)
([xshift=1mm,yshift=2mm]path picture bounding box.south west)
rectangle ([xshift=-1mm,yshift=-2mm]path picture bounding box.north east);
},inner ysep=4mm,inner xsep=2mm,font=\sffamily}]
\node [LCAR] {Hello world};
\end{tikzpicture}
\end{document}
至于您的评论(请注意,我只加载用于showframe
标记页面边界的几何图形):
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{lipsum}
\usepackage{tikz}
\definecolor{LCARSTC2}{HTML}{9999CC} % Light blue
\begin{document}
\lipsum[1]
\noindent\begin{tikzpicture}[LCAR/.style={rounded corners,path picture={
\fill[LCARSTC2,even odd rule,rounded corners] (path picture bounding box.south west)
rectangle (path picture bounding box.north east)
([xshift=1mm,yshift=2mm]path picture bounding box.south west)
rectangle ([xshift=-1mm,yshift=-2mm]path picture bounding box.north east);
},inner ysep=4mm,inner xsep=2mm,font=\sffamily}]
\node [LCAR,text width=\linewidth-6mm,minimum width=\linewidth] {\lipsum[2]};
\end{tikzpicture}
\lipsum[3]
\end{document}
请注意,还有更多的选项和键,甚至可能性(例如,您可以使用库tikzmark
),但我遇到与费马相同的问题:我没有足够的空间来详细说明。;-)