下面的代码有效,但是有两个问题:
该对齐方式不起作用,因此每一列都流到空白处并且没有完全对齐。
我想用垂直线将两列分开:在左列的右边缘。
而且这些段落似乎没有缩进或在它们之间没有空格。
想法?
\ tolerance代码通常可以解决对齐问题,但是这里没有。而且,\ colseprulecolor {CustomGrey}通常适用于一行,但不在此处。
\documentclass[12pt]{article}
\usepackage[letterpaper, % Choose paper size
left= 1.0in, % Set the margins
right= 1.0in, %
top= 1.0in, %
bottom=1.5in]{geometry} %
\usepackage{paracol,lipsum} % Needed for the column environment
\usepackage[english]{babel}
\usepackage[utf8]{inputenc} % Apostrophes and quotes need this
\usepackage{fancyhdr} % Needed for header and footer lines and colors
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{pythontex} % Allows for the inclusion of Python code
\usepackage{lastpage} % Needed for page numbering
\usepackage[dvipsnames]{xcolor} % Needed for the colors in the commands
\usepackage[font={scriptsize}]{caption}
\usepackage[retainorgcmds]{IEEEtrantools}
\usepackage{parallel}
%---------------------------- Colors ----------------------------------------------------------------------------%
\definecolor{CustomOrange}{rgb}{1, 0.43529, 0.01176} % Define custom colors
\definecolor{CustomGrey}{rgb}{0.4745, 0.4745, 0.4745} % Define custom colors
%---------------------------- Header & Footer -------------------------------------------------------------------%
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{1.0pt} % Thickness of header rule
\renewcommand{\headrule}{\hbox to\headwidth{\color{CustomOrange}\leaders\hrule height \headrulewidth\hfill}}
\renewcommand{\footrulewidth}{1pt} % Thickness of header rule
\renewcommand{\footrule}{\hbox to\headwidth{\color{CustomOrange}\leaders\hrule height \headrulewidth\hfill}}
\fancyfoot[R]{Page \thepage\ of \pageref{LastPage}} % Page numbering
\setlength{\parindent}{0pt} % Indentation of paragraphs
\setlength{\parskip}{0.35cm plus0mm minus0mm} % Used to set space between paragraphs. Requires {parskip}
\setlength\headheight{60pt}
%---------------------------- Set Columns -----------------------------------------------------------------------%
%\columnsep=0.05\textwidth % Set space between columns
%\setcolumnwidth{.35\textwidth, .6\textwidth} % One entry for each column, see paracol{} below
\tolerance=1 % Code fixes the justification issue with columns flowing over
\emergencystretch=\maxdimen %
\hyphenpenalty=10000 %
\hbadness=10000 %
\setlength{\columnseprule}{1.0pt} % Thickness and color of vertical line between columns
\colseprulecolor{CustomGrey} %
%---------------------------- Begin Document---------------------------------------------------------------------%
\begin{document}
\begin{Parallel}{2in}{4in}
\ParallelLText{\lipsum[1-7]}
\ParallelRText{\lipsum[2-6]}
\end{Parallel}
\end{document}
答案 0 :(得分:0)
public static void main(String[] args) {
final int WIDTH = 600;
final int HEIGHT = 600;
int amount = 0;
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
int amount = amount + 1;
}
}, 2*1000, 2*1000);
JFrame frame = new JFrame("TimerTest");
frame.setVisible(true);
frame.setSize(WIDTH, HEIGHT);
frame.setResizable(false);
frame.setLayout(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel label = new JLabel("");
label.setText(String.valueOf(amount));
frame.add(label);
}
}
关键字修复问题1 。它用于照顾小宽度的柱子/盒子以止血。
将\sloppy
更改为\begin{Parallel}{2in}{4in}
时, 问题2 将消失。 \begin{Parallel}[v]{2in}{4in}
表示列之间的垂直线。
[v]
行,所以出现了问题3 。这将重置整个文档中的缩进。
将所有内容放在一起:
\setlength{\parindent}{0pt}
现在这些应该可以解决您的问题。
编辑!
这是使用%Remove the follwing line: \setlength{\parindent}{0pt}
\begin{Parallel}[v]{2in}{4in}
\sloppy
\ParallelLText{\lipsum[1-7]}
\ParallelRText{\lipsum[2-6]}
\end{Parallel}
的另一种解决方案:
paracol