这简单简历类(对于莱克斯),规定逐项列举环境定义simplecv.layout
如下:
Style Itemize
Margin Static
LatexType Item_Environment
LatexName itemize
NextNoIndent 1
LeftMargin MMN
LabelSep xx
ItemSep 0.2
TopSep 0.7
BottomSep 0.7
ParSep 0.3
Align Block
AlignPossible Block, Left
LabelType Itemize
LabelString "*"
End
使用项目段落对齐设置为合理的(这是默认值),生成一个视觉上正确的项目列表(下面的屏幕截图,左侧)。
我想要一个左边对齐。尝试这样做(即通过 LyX 的段落设置界面进行更改),会自行打印(默认)项目符号,并将文本推到下一行(下面的屏幕截图,右侧)!
完整的代码,这次使用 {\raggedright ... \par}
,如 LyX 的 LaTeX 源窗口中所示:
% 预览源代码
%% LyX 2.0.2 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage{charter}
\usepackage[scaled=0.8]{berasans}
\usepackage{beramono}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=1.4cm,bmargin=3cm,lmargin=2cm,rmargin=2.5cm}
\pagestyle{empty}
\setcounter{secnumdepth}{0}
\setcounter{tocdepth}{2}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{pifont}
\makeatletter
\@ifundefined{date}{}{\date{}}
\AtBeginDocument{
\def\labelitemi{\footnotesize\(\bullet\)}
\def\labelitemii{\footnotesize\(\circ\)}
\def\labelitemiii{\tiny\ding{71}}
\def\labelitemiv{\tiny\ding{75}}
}
\makeatother
\usepackage{babel}
\begin{document}
\begin{itemize}
\item \noindent \begin{flushleft}
{\raggedright Sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text\par}
\par\end{flushleft}
\item \noindent Sample text sample text sample text sample text sample text
sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text sample text sample text sample text sample text sample text sample
text\end{itemize}
\end{document}
视觉效果(如较大的屏幕截图所示)是错误的左对齐项和正确对齐的项:
如何实现正确的左对齐?Align
,AlignPossible
指令simplecv.layout
相关吗?
[问自己:我是否触碰了影响相关行为的其他全局设置?]
答案1
LyX 插入“不缩进段落”格式前对齐环境flushleft
,这会导致布局问题。相反,请\noindent
从段落设置窗口中选择“缩进段落”来删除:
请注意,flushleft
环境会自动将段落缩进设置为0pt
,因此无需指定“无段落缩进”检查。实际上,这是通过 内部完成的\raggedright
,因此您也可以通过两个 ERT 手动实现这一点{\raggedright ... \par}
:
\raggedright
将段落设置为“左对齐”,同时\par
确保段落/项目符号已完成 - TeX 需要这样做,因为它设置线基于段落的文本。