• ベストアンサー

[pLaTeX2e]\begin{matrix}環境を利用した、縁付行列の作り方

1点お聞きしたいことがあります。 ttp://www002.upp.so-net.ne.jp/latex/bordermatrix.html にあるような縁付行列を、\usepackage{amsmath}を利用した \begin{matrix}・・・\end{matrix}環境で書きたいと 思っているのですが可能でしょうか。 目的は、 $X=\begin{pmatrix} x_{11} & x_{12} & x_{13} \\ \vdots & \vdots & \vdots \\ x_{91} & x_{92} & x_{93} \end{pmatrix} の各列に、X1, X2, X3 のラベルをつけることです。 よろしくお願いいたします。

質問者が選んだベストアンサー

  • ベストアンサー
  • geko3
  • ベストアンサー率34% (11/32)
回答No.3

こんにちは,奥村先生のTeX QAに同じ質問がありますね. $ \borderbracketmatrix{ & a & b \cr 1 & 2 & 3 \cr 1 & 2 & 3 \cr } $ これでいけますか?

参考URL:
http://oku.edu.mie-u.ac.jp/~okumura/texfaq/qa/18116.html
wakabayashiryou
質問者

お礼

\borderbracketmatrix ではコンパイル失敗しましたが、 \bodermatrix では成功しました! ラベルは縦だけでなく、横にもつけられるんですね! (※↑の例だと、縦;(a, b)、横;(1, 1)) 本当に助かりました。ありがとうございました!

その他の回答 (2)

  • Knotopolog
  • ベストアンサー率50% (564/1107)
回答No.2

pLaTeX2e, LaTeX, TeX に関する質問は,下記サイトで詳しく教えてくれます. [TeX Q & A] http://oku.edu.mie-u.ac.jp/~okumura/texfaq/qa このサイトを調べましたが,あなたの質問は記載されていないので, もし,必要ならば上記サイトへ質問してみて下さい.

参考URL:
http://oku.edu.mie-u.ac.jp/~okumura/texfaq/qa
wakabayashiryou
質問者

お礼

ご回答ありがとうございます。 お返事遅れて申し訳ございません。 おっしゃるとおり、そちらのサイトで 質問をするべきでした。 失念しておりました。 後日、そちらのサイトの質問ページに このサイトへのリンクを貼ろうと思います。

  • kabaokaba
  • ベストアンサー率51% (724/1416)
回答No.1

amsmathはbordermatrixを再定義してないはずだから そのまま \documentclass{jarticle} \usepackage{amsmath} \begin{document} $ \bordermatrix{ a & b & c \cr 1 & 2 & 3 \cr 1 & 2 & 3 \cr } $ \end{document} で使えます. このインタフェースがいやなら, amsmathの真似をして環境型に作り直せばいいだけですが, マクロ作成に慣れてないとかなりしんどいです.

wakabayashiryou
質問者

お礼

ご回答ありがとうございます。 お返事遅れて申し訳ございません。 ソースを打ってみたのですが、 1列目がかっこからはみだしてしまいました。 私の打ち間違えでしょうか? また、行列のかっこを[ ]に変えたりもしたくて、 \boderbmatrixと変えてみましたが コンパイルでエラーになってしまいます。 何かお分かりでしたら、大変恐縮ですが もう1度お返事いただけると嬉しいです。

関連するQ&A

  • TeXで11列以上の行列を入力する

    TeXで、 \documentclass{jsarticle} \usepackage{amsmath} \begin{document} \begin{equation} \begin{bmatrix} 1&1&1&1&1&1&0&0&0&0&0 \end{bmatrix} \end{equation} \end{document} のように、11列ある行列を書こうとするとエラーが出ます。 10列までなら書けるのですが・・・。 l.6 1&1&1&1&1&1&0&0&0&0& 0\\ No pages of output 上のような表示が出ます。 どうすれば11列以上書けるのでしょうか?? 分かる方、どうぞよろしくお願いします。

  • Latexの改行について

    Latexで数学の文書を作成しているのですが、 体裁で少し困ったことがあります。 例えば、 \documentclass[12pt,a4j]{jarticle} \usepackage{amsmath,thmbox} \begin{document} \begin{proof} \begin{enumerate} \item \begin{align} 2x+3&=x-1 \\ x+4&=0 \\ x&=-4 \end{align} \item \begin{align} \int _a^b(x+3)^3\,dx \end{align} \end{enumerate} \end{proof} \end{document} のような物があった時に、 1.Proof: と 箇条書きの番号(1.)が別の行 2.箇条書きの番号とalign環境の最初の行(2x+3…や積分記号)が同じ行 になってほしいと思います。 どのようにすればよいか、アドバイスよろしくお願いします

  • texの基本的な質問

    \documentclass[a4j,11pt]{jreport} \usepackage{amsmath,amssymb,amsthm} \begin{document} \newtheorem{prf}{証明} \renewcommand{\theprf}{} \begin{prf} a=b \qed \end{prf} \end{document} 証明.と表示されるのですが .を消したいのですが、どうすれば、よろしいですか?

  • LaTeXのnewtheorem環境のカスタマイズ

    LaTeXのいわゆる定理環境において、番号をカッコで囲むようにカスタマイズしたいのですが、どうすればよろしいでしょうか。 要するに、 定理(1) ◯◯◯ 定理(2) ××× などと表示してほしいのです。 今使用しているLaTeXのサンプルソースは以下の通りです。 ¥documentclass[a4paper, fleqn, 11pt]{jsarticle} ¥usepackage{amsmath} ¥newtheorem{teiri}{定理} ¥title{Sample} ¥author{匿名希望} ¥date{2012年3月24日} ¥begin{document} ¥maketitle ¥section{例} ¥teiri ここに定理を入力する。 ¥end{document}

  • LaTeXでの画像ファイルの挿入

    LaTeX初心者です。 LaTeXで文章を作成する際,bmpファイルを挿入したいと思います。 いろいろと検索をし,試したのですが,なかなかできません。 当方,dviout,GSview4.9,Ghostscript9.02を利用しています。 %%%%%%%%%%%%%%%%%%%%その1 \documentclass[a4paper, 10pt]{jarticle} \usepackage{enumerate} \usepackage[dviout]{graphicx} \begin{document} \section*{1} %文章 \begin{center} \includegraphics[width=4cm]{1.bmp} \end{center} \end{document} %%%%%%%%%%%%%%%%%%%% これだと,画像が挿入されますが, %%%%%%%%%%%%%%%%%%%%その2 \documentstyle[a4j,fleqn]{jarticle} \usepackage{enumerate} \usepackage[dviout]{graphicx} \newcommand{\AmS}{${\cal A}\kern-.1667em\lower.5ex \hbox{${\cal M}$}\kern-.075em{\cal S}$} %\setlength{\textheight}{25cm} %\addtolength{\topmargin}{-1cm} \begin{document} \begin{center} \includegraphics[width=4cm]{3.bmp} \end{center} \end{document} %%%%%%%%%%%%%%%%%%%% これだと挿入できません。 その2,のスタイルで画像を挿入したいと思います。 なにが駄目で,どうすれば挿入できるのか,ご回答のほど宜しくお願い致します。

  • WinShellでPDFを作る時のエラーについて

    Gnu plotで作図したものをWinShellでPDFにしようとしています。 ↓Gnu plotでの作図 Terminal type set to 'windows' gnuplot> plot sin(x) gnuplot> replot cos(x) gnuplot> set term postscript eps Terminal type set to 'postscript' Options are 'eps noenhanced monochrome blacktext \ dashed dashlength 1.0 linewidth 1.0 defaultplex \ palfuncparam 2000,0.003 \ butt "Helvetica" 14' gnuplot> set output "sincos.eps" gnuplot> replot ↓WinShlell \documentclass{jarticle} \pagestyle{empty} \usepackage{amsmath} \usepackage{graphicx} \begin{document} \begin{figure}[htb] \begin{center} \includegraphics[scale=0.8]{sincos.eps} \caption{sin(x)とcos(x)のグラフ} \end{center} \end{figure} \end{document} これを入力して実行すると エラー: LaTeX Error: Cannot determine size of graphic in sincos.eps (no BoundingBox). -------------------------------------------------- - 1 個のエラー, 0 個の警告, 0 個のオーバーフル, 0 個のアンダーフル と出てきます。 このエラーの解決法について教えてください。

  • 残差平方和の「補正項」の計算

    添付の写真の通り、そろばんや電卓が計算手段だった昔は、残差平方和の計算式に補正項があったそうです。その補正項を導きたいです。自分で解こうとしたのですが、途中までしか解けなかったのでご覧ください (非常に複雑なので敢えてLaTeXで書きました。ネットでもhttps://cocalc.com/projects/f3d50097-ed36-4084-96ec-e2e05d64b443/files/Welcome-to-CoCalc.tex?session=defaultなどに貼れば見れます): \documentclass{article} \usepackage[dvipdfmx]{graphicx} \usepackage{amsmath} \usepackage{breqn} \begin{document} \parindent = 0pt 残差平方和の計算\\ 定義式(2.1.6)\\ (\(\bar{x.}\)は平均値です) \begin{equation}\label{xx} \begin{split} S &= \sum_{i=1}^{n} e_i^2 \\ &= \sum_{i=1}^{n} (x_i - \bar{x.} )^2 \\ \end{split} \end{equation} 残差平方和の補正項 \begin{equation}\label{2.1.6} \begin{split} S &= \sum_{i=1}^{n} x_i^2 - \frac{(\sum_{i=1}^{n} x_i)^2}{n} \\ \end{split} \end{equation} 残差平方和から補正項を導いてみる \begin{equation}\label{xx} \begin{split} S &= \sum_{i=1}^{n} e_i^2 \\ &= \sum_{i=1}^{n} (x_i - \bar{x.} )^2 \\ &= \sum_{i=1}^{n} (x_i^2 - 2x_i \bar{x.} + \bar{x.}^2) \\ &= \sum_{i=1}^{n} x_i^2 - 2\sum_{i=1}^{n} x_i \bar{x.} + \sum_{i=1}^{n} \bar{x.}^2 \\ \end{split} \end{equation} つまり、 \begin{equation}\label{xx} \begin{split} - 2\sum_{i=1}^{n} x_i \bar{x.} + \sum_{i=1}^{n} \bar{x.}^2 = - \frac{(\sum_{i=1}^{n} x_i)^2}{n}\\ \end{split} \end{equation} ・・・ということでしょうか?\\ これ以降が解けません。\\ 補正項に\(\bar{x.}\)が無いことから推測すると、\\ 補正項というのは近似値なのでしょうか? \end{document} 以上、よろしくお願いします

  • LaTeXマクロのemathを使ってもグラフを描画できません。

    LaTeXマクロのemathを使ってもグラフを描画できません。 Active Perlもちゃんとインストールしているのですが。 ソースは \documentclass{jarticle} \usepackage{emathP} \begin{document} \begin{zahyou}[ul=4mm](-2,8)(-2,2) \def\Fx{sin(X)+cos(X)} \YGurafu\Fx\xmin\xmax \end{zahyou} \end{document} です。 コマンドプロンプトで必ず、下記のような警告が出ます。 LaTeX Warning: do perl on input line 6 どうすれば、グラフを描画できるでしょうか。 OSはwindows 7です。環境変数のPathにもちゃんと;C:\w32tex\binを付け加えています。

  • TEX 本文を横書きにする方法

    お世話になります。 texを用紙横書きで設定したいのですが、 以下の書式でうまくいきません。 \documentclass[a4j,landscape,10pt]{jarticle} \AtBeginDvi{\special{landscape}} \usepackage{amsmath} \usepackage{array} \usepackage{multicol} \setlength{\oddsidemargin}{-15mm} \setlength{\topmargin}{-25mm} \setlength{\textwidth}{180mm} \setlength{\textheight}{250mm} \setlength{\columnsep}{0.4pt} \setlength{\columnseprule}{0.4pt} \setlength{\columnwidth}{10cm} \pagestyle{empty} \begin{document} \begin{multicols}{4} %本文内容 \end{multicols}{4} \end{document} 用紙は横書きになっていますが、本文が横書きに対応していないようです。 対象方法がお分かりの方いらっしゃいましたら、ご教授願います。

  • latexで画像データの貼り付け

    latexで実験レポートを書きたいのですが、latexの文章に 画像データを貼り付けようとしても画像が表示されません。 \documentclass{jarticle} \usepackage[dviout]{graphicx} \begin{document}     ・     ・     ・ \begin{figure} \centering \includegraphics[width=5cm]{sample.bmp} \caption{○○○} \end{figure} \end{document} としてみたのですが、コンパイルしてみてみると 画像の部分だけ空白になっていてその下にタイトルが表示されます。 そして、下のほうに[Can not get date file ~]みたいな文が表示されます。 原因の分かる方は助言お願いします。