悠闲数学娱乐论坛(第2版)'s Archiver

math_dalin 发表于 2016-8-22 00:00

关于人教论坛里撸题集LaTeX简介的问题

kuing 老师,我将您人教论坛里的所有代码复制下来,用ctexart,自己填上东西,不能编译呀!提示的问题居然是导言区里的那些usepackage.
我用的是texlive2016+texstudio.
不知您可否将您的导言区完整的分享一下,很冒昧,若不合时宜,望您海涵,直接略去即可!
谢谢您!

kuing 发表于 2016-8-22 00:45

原帖中我讲过
[quote]我会尽量给出代码的说明,各位请先阅读后再按需取用,切勿随便抄了就算,否则极容易出现问题。[/quote]
不知你有没有仔细去看,如果没有,不管三七二十一就全抄,那就请自己排查了。

isee 发表于 2016-8-22 09:30

[quote]kuing 老师,我将您人教论坛里的所有代码复制下来,用ctexart,自己填上东西,不能编译呀!提示的问题居然 ...
[size=2][color=#999999]math_dalin 发表于 2016-8-22 00:00[/color] [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=18738&ptid=4202][img]http://kuing.orzweb.net/images/common/back.gif[/img][/url][/size][/quote]

初学不要搞那么复杂,针对数学而言,体会下根式,分式,一元二方程求根公式之类,然后再慢慢复杂。

kuing 发表于 2016-8-22 15:02

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=18740&ptid=4202]3#[/url] [i]isee[/i] [/b]

据我所知他不是初学

math_dalin 发表于 2016-8-22 15:47

[code]\documentclass[10pt,a4paper]{ctexart}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
%单图居中,用法 \onetu{图}(插图部分可包括\caption和\label,下同)
\newcommand\onetu[1]{%
        \begin{figure}[!ht]
                \centering
                #1
        \end{figure}}
       
        %双图横排,可调宽,用法 \twotu{图}{图} 或 \twotu[x]{图}{图} %其中x为0到1之间的数字,\twotu{图}{图} 等价于 \twotu[0.5]{图}{图}
        \newcommand\twotu[3][0.5]{%
                \begin{figure}[!ht]
                        \begin{minipage}[b]{#1\linewidth}
                                \centering
                                #2
                        \end{minipage}%
                        \begin{minipage}[b]{\linewidth-#1\linewidth}
                                \centering
                                #3
                        \end{minipage}
                \end{figure}}
               
                %三图、四图横排,等宽,用法 \threetu{图}{图}{图} \fourtu{图}{图}{图}{图}
                \newcommand\threetu[3]{%
                        \begin{figure}[!ht]
                                \begin{minipage}[b]{\linewidth/3}
                                        \centering
                                        #1
                                \end{minipage}%
                                \begin{minipage}[b]{\linewidth/3}
                                        \centering
                                        #2
                                \end{minipage}%
                                \begin{minipage}[b]{\linewidth/3}
                                        \centering
                                        #3
                                \end{minipage}
                        \end{figure}}
                        \newcommand\fourtu[4]{%
                                \begin{figure}[!ht]
                                        \begin{minipage}[b]{\linewidth/4}
                                                \centering
                                                #1
                                        \end{minipage}%
                                        \begin{minipage}[b]{\linewidth/4}
                                                \centering
                                                #2
                                        \end{minipage}%
                                        \begin{minipage}[b]{\linewidth/4}
                                                \centering
                                                #3
                                        \end{minipage}%
                                        \begin{minipage}[b]{\linewidth/4}
                                                \centering
                                                #4
                                        \end{minipage}
                                \end{figure}}
                               
                                \newcommand\fourtuxx[4]{%
                                        \begin{minipage}[b]{(\linewidth-\parindent)/4}
                                                \centering
                                                #1\par A
                                        \end{minipage}%
                                        \begin{minipage}[b]{(\linewidth-\parindent)/4}
                                                \centering
                                                #2\par B
                                        \end{minipage}%
                                        \begin{minipage}[b]{(\linewidth-\parindent)/4}
                                                \centering
                                                #3\par C
                                        \end{minipage}%
                                        \begin{minipage}[b]{(\linewidth-\parindent)/4}
                                                \centering
                                                #4\par D
                                        \end{minipage}}
\begin{document}

\onetu{
        \includegraphics[width=0.7\linewidth]{perp}
        \caption{}
        \label{fig:perp}
}

\fourtuxx
{\includegraphics[width=0.2\linewidth]{perp}}
{\includegraphics[width=0.2\linewidth]{perp}}
{\includegraphics[width=0.2\linewidth]{perp}}
{\includegraphics[width=0.2\linewidth]{perp}}


\threetu
{\includegraphics[width=0.3\linewidth]{perp}
        \caption{}
        \label{fig:perp}}
{\includegraphics[width=0.3\linewidth]{perp}
        \caption{}
        \label{fig:perp}}
{\includegraphics[width=0.3\linewidth]{perp}
        \caption{}
        \label{fig:perp}}

\twotu
{\includegraphics[width=0.4\linewidth]{perp}
        {\includegraphics[width=0.4\linewidth]{perp}       

\end{document}[/code]

math_dalin 发表于 2016-8-22 15:51

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=18740&ptid=4202]3#[/url] [i]isee[/i] [/b]
我主要测试了图的排列这部分,结果只有\onetu是正确的!

kuing 发表于 2016-8-22 15:53

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=18743&ptid=4202]6#[/url] [i]math_dalin[/i] [/b]

[quote]\usepackage{calc,ifthen}
%算术包和条件判断包(选择题选项命令需要用到)
[/quote]
要加这个
因为并排放图和选项放图都用了长度计算,需要 calc 包
而选择题选项除了长度计算还有条件判断,就还需要 ifthen 包
这算是我那里没说清楚吧

math_dalin 发表于 2016-8-22 16:08

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=18744&ptid=4202]7#[/url] [i]kuing[/i] [/b]
谢谢您!kuing老师!这段代码正是我梦寐以求的!编译出来太漂亮了!

math_dalin 发表于 2016-8-22 17:16

所有内容均已整合完毕,编译后居然连$1$次警告都没有,真的是太棒了!谢谢kuing老师!

isee 发表于 2016-8-22 20:38

k版又被老师了。。

kuing 发表于 2016-8-23 02:49

[quote]k版又被老师了。。
[size=2][color=#999999]isee 发表于 2016-8-22 20:38[/color] [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=18750&ptid=4202][img]http://kuing.orzweb.net/images/common/back.gif[/img][/url][/size][/quote]
他应该是知道的,如果我没记错,以前我和他同在一个TeX群,我就说过我不是老师更不想别人叫我老师,但是人家就是喜欢叫,我也没办法哩。

math_dalin 发表于 2016-8-23 07:12

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=18750&ptid=4202]10#[/url] [i]isee[/i] [/b]
我的LaTeX入门也是得益于kuing老师。原来我还建了一个LaTeX群,还邀请kuing老师当过管理员呢!后来小群并入了CTeX大群。所以一直以来都非常感激kuing老师的耐心指导和无私奉献!

math_dalin 发表于 2016-8-23 10:35

不好意思!刚才百度了一下,原来“老师”这个词现在已经是个贬义词了,那我以后不再称呼您“老师”了。那就以后尊称您“K版主”或“K版”!再次表示歉意!

isee 发表于 2016-8-23 11:49

这里仅仅说k版不是教师身份。

kuing 发表于 2016-8-23 12:58

[b]回复 [url=http://kuing.orzweb.net/redirect.php?goto=findpost&pid=18758&ptid=4202]13#[/url] [i]math_dalin[/i] [/b]

我并没有说“老师”是贬义词的意思,只是纯粹不喜欢被这么叫而已,别想多了

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.