在下一列上浮动一个棋盘图

在下一列上浮动一个棋盘图

我的第二个棋盘图在第一列放不下,因此 LaTeX 增加了第一列的段落间距。这确实确保了第二个棋盘图恰好出现在第二列的顶部。但是,我更喜欢保留标准段落间距,我能想到的最佳解决方案是使用 来\vfill填充空格。以下是我的两个问题:

  1. 当我尝试使用\columnbreak而不是 时\vfill,收到一条错误消息,提示这是一个未定义的控制序列。在这种情况下 和 会\columnbreak给出\vfill相同的结果吗?
  2. 我怎样才能让 LaTeX 在第一列中以正常段落间距输入尽可能多的文本,然后再在第二列中显示第二张图表?这样,第二张图表的顺序就会乱了,但我可以给它加上标题。
\documentclass[10pt,twocolumn]{article}

 \usepackage{xskak} 
 \usepackage{chessboard}

 \begin{document}

 \thispagestyle{empty} 

 \begin{center}
  \textbf{Chiburdanizde - Watson} \\
  \textit{Brussels 1987}
 \end{center}

 \begin{center} 

 \newchessgame[setwhite={Pg3,Ph4,Kf2}, addblack={ph6,kd6}]

 \chessboard[
  pgfstyle=border, linewidth = 0.03em, markfield=f5, color=red,
  pgfstyle= {[base,at={\pgfpoint{0pt}{-0.4ex}}]text}, 
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 1, markfield=f4, 
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 2, markfield=g4, 
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 2, markfield=e4,
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 3, markfield=f3,
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 4, markfield=e3,
  color=black,
  pgfstyle= {[base,at={\pgfpoint{0pt}{-0.4ex}}]text}, 
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 1, markfield=h5,
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 1, markfield=e6,
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 2, markfield=f6,
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 3, markfield=g6,
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 3, markfield=e7,
   text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 4, markfield=f7]

 \end{center}

 The diagram above illustrates the system of corresponding squares in the pawn endgame.  If the kings are on corresponding squares, say white king on f4 and black king on e6, then whoever it is to move is in zugzwang.  In addition, White wins if he can maneuver his king to the key square f5.

 \fenboard{8/8/3k3p/8/7P/6P1/5K2/8 w - - 0 57}
 \styleC

 \mainline{57. Kf3?}

 This allows Black to put White in zugzwang with his next move.  From the diagram, it is clear that White wins after \variation{1. Ke3} as the black king cannot reach the corresponding square f7 in one move.

 \mainline{57... Ke7! 58.Kf4 Ke6 59.g4}

 White altered the pawn structure, so we need a new diagram of corresponding squares.  It is now a battle for the key squares d5, e5, and f5.

 \vfill

 \begin{center} 

  \chessboard[
   mover=false,
   pgfstyle=border, linewidth = 0.03em, markregion=d5-f5, color=red,
   pgfstyle= {[base,at={\pgfpoint{0pt}{-0.4ex}}]text}, 
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 1, markfields={d4,d2},
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 2, markfields={e4,e2},
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 3, markfield=f2,
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 4, markfields={d3,d1},
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 5, markfields={e3,e1},
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 6, markfields={f3,f1},
   color=black,
   pgfstyle= {[base,at={\pgfpoint{0pt}{-0.4ex}}]text}, 
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 1, markfields={d6,d8},
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 2, markfield=e8,
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 3, markfields={f6,f8},
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 4, markfield=d7,
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 5, markfield=e7,
    text=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily 6, markfield=f7,
   margintop=false]

 \end{center}

 \mainline{59... Kf6 60.Kf3 Ke7?}

 Watson explained in \textit{New in Chess} that his blunder was due to extreme time pressure.  From the diagram, we see that the only move for Black is \variation{60... Kf7}.

 \mainline{61.Ke3! Kf7 62.Kd4 Kf6 63.Kd5 Ke7 64.Ke5 Kf7 65.Kf5 Kg7 66.Ke6 Kg6 67. h5+ Kg5 68.Kf7 Kxg4 69.Kg6 Kf4 70.Kxh6}

 and Black resigned. 

\end{document}

答案1

你试过制作这些浮动图形吗?用\begin{center}...\end{center}环境替换

\begin{figure}[ht]
\centering
...
\end{figure}

应该可以完成这个工作。

答案2

使用\newpage而不是\columnbreak。不过,我会使用类似这样的方法:

\twocolumn[\centering\textbf{Chiburdanizde --- Watson}\\ 
  \textit{Brussels 1987}]
...
\newpage
\vspace*{1pt}
...

或者使用当前标题

\newpage
\phantom{\parbox{\linewidth}{\begin{center}\textbf{Chiburdanizde --- Watson}\\ 
  \textit{Brussels 1987}\end{center}\smallskip}}

如果你的棋盘可以放在其他地方,那么使用图形环境

答案3

这不是您实际问题的答案,但看了您的示例,我认为我应该介绍一种更通用的设置文本字体的方法。我认为不可能将其偷偷放入 pgfstyle 命令中,因为 pgf 的内部命令 (\pgftext) 将其键设置为 late),但如果您在序言中插入以下代码,您应该能够textfont=\fontsize{1.2ex}{1.2ex}\bfseries \sffamily在棋盘或 中本地使用该键\setchessboard

我很高兴知道它是否有效,以及您是否喜欢该键的处理和命名。如果是,我会将代码添加到下一个版本中。

\makeatletter
\def\board@pgf@style@textfont{}

\cbDefinePgfFieldStyle{text}{%
    \ifthenelse%
     {\boolean{\XKV@UFCB@locset@inverse@value}}%
     {\pgftext[rotate=180,#2]{\normalfont\board@pgf@style@textfont\board@pgf@curtext}}%
     {\pgftext[#2]{\normalfont\board@pgf@style@textfont\board@pgf@curtext}}}%

\cbDefinePgfRegionStyle{text}{%
 \pgfextractx{\len@board@tempx}{{\pgfpointanchor{#1}{center}}}%
 \pgfextracty{\len@board@tempy}{{\pgfpointanchor{#1}{center}}}%
 \pgftransformshift
  {\pgfpointintersectionoflines
     {\pgfpointxy{-0.5}{0.5}}%
     {\pgfpointadd
      {\pgfpoint{\len@board@tempx}{\len@board@tempy}}%
      {\pgfpointxy{0.5}{-0.5}}}%
     {\pgfpointadd
       {\pgfpoint{\len@board@tempx}{0pt}}%
       {\pgfpointxy{0.5}{0.5}}}%
     {\pgfpointadd
       {\pgfpoint{0pt}{\len@board@tempy}}%
       {\pgfpointxy{-0.5}{-0.5}}}}%
 \ifthenelse%
  {\boolean{\XKV@UFCB@locset@inverse@value}}%
  {\pgftext[rotate=180,#2]{\normalfont\board@pgf@style@textfont\board@pgf@curtext}}%
  {\pgftext[#2]{\normalfont\board@pgf@style@textfont\board@pgf@curtext}}}%

\define@key[UFCB]{locfill}{textfont}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@style@textfont{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@style@textfont{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{textfont}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,textfont=#1}}%

\makeatother

相关内容