加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

LaTeX技巧567:latex 如何在页面下方插入图形

(2011-09-02 21:09:29)
标签:

latex

通栏图

双栏

分类: 插图技巧

QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载

时投稿或者写文章,尤其是双栏模式下总是想要把图片放在我们想要她在的位置,非常考验我们的代码水平,特别是下面这种情况:双栏模式下插入单栏图,一般情况下,期刊给出的是使用\begin{figure*}[t]  .... \end{figure*} 进而,图片会放到下一页置顶位置,很多用户想把图片放到当前页底部该怎么办呢?

【解决方案】
演示代码如下:
    \documentclass[a4paper,10pt,twocolumn]{article}
    \usepackage{graphicx,dblfloatfix,caption,afterpage}
    \usepackage[english]{babel}
    \usepackage{blindtext}
    \begin{document}
    \tableofcontents
    \section{Zero}
    \blindtext[1]

    \blindtext[1]

    %\afterpage{\newpage} % bottom on third page
    %\afterpage{\clearpage} % cuts a column, bottom on third page

    \blindtext[1]

    \blindtext[1]

    \begin{figure}[!h]
      \centering
      \includegraphics{test.jpg}
      \caption{test picture 1}
    \label{fig:1}
    \end{figure}

    \blindtext[1]

    \begin{figure}[!h]
      \centering
      \includegraphics{test.jpg}
      \caption{test picture 2}
    \label{fig:2}
    \end{figure}

    %\afterpage{\newpage} % bottom on third page
    %\afterpage{\clearpage} % bottom on third page

    % save counter
    \newcounter{savefig}
    \setcounter{savefig}{\value{figure}}
    % step preemptively
    \stepcounter{figure}

    % figure* MUST be declared before first \newpage!
    % so in this case, it is declared (still) within pg1.
    \begin{figure*}[!b]
      \centering
      \includegraphics{test.jpg}
      \caption{test picture dbl}
    \label{fig:dbl}
    \end{figure*}

    % reset counter
    \setcounter{figure}{\value{savefig}}

    \afterpage{\newpage} % first newpage: goes from pg1:col2 to pg2:col1

    \blindtext[1]

    %\afterpage{\clearpage % alone
    %}

    %\newpage~\newpage % clears everything prematurely, but manages to put minipage and bottom on same page
    %\afterpage{\clearpage} %

    \section{One}
    A bit of bla bla bla here...

    A bit of bla bla bla...

    \begin{figure}[h]
      \centering
      \includegraphics{test.jpg}
      \caption{test picture 3}
    \label{fig:3}
    \end{figure}

    %\noindent\begin{minipage}{\columnwidth}
    %\captionsetup{type=figure}
    \centering
    \includegraphics{test.jpg}
    \caption{test picture 3}
    %\label{fig:3}
    %\end{minipage}


    \blindtext[1]

    \afterpage{\newpage}  % second newpage: goes from pg2:col1 to pg2:col2

    \blindtext[1]

    \section{Two}
    \blindtext[1]

    \afterpage{\newpage} % third newpage: goes from pg2:col2 to pg3:col1; AND
    % seemingly this 'flushes' the bottom float, which will now appear on pg2!

    % step post-emptively
    % (as here the bottom, Fig4 should be inserted - so we're ready for Fig5 next)
    \stepcounter{figure}

    \blindtext[1]

    \blindtext[1]

    \begin{figure}[h]
      \centering
      \includegraphics{test.jpg}
      \caption{test picture 5}
    \label{fig:5}
    \end{figure}

    \blindtext[1]

    \end{document}

效果哦:
LaTeX技巧567:latex <wbr>如何在页面下方插入图形


0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有