我遇到了一个奇怪的问题 - 问题实际上与 diagrams 包无关,但从某种意义上说,问题就出在这里 - 有人能发现我做错了什么吗?或者我应该怎么做才能解决这个问题?
这就是我想做的事情:
我正在按照 Emily Riehl 的“上下文中的范畴理论”在 texStudio 中做笔记,使用 Paul Taylor 的交换图包;效果很好。
我现在还将所有定义提取为闪存卡,以便导入 AnkiDroid 2.1 - 这也很好用,除了图表中的箭头是斜的。我已经能够将问题缩小到 AnkiDroid 所需的 .png 转换;无论我使用什么,都会发生同样的情况:
dvipng -D 200 -T tight test.dvi -o test2.png
或者
convert -density 200 -trim test.pdf test.png
这是代码:
% -*- coding:utf-8 -*-
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{enumerate}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[bbgreekl]{mathbbol}
\usepackage{diagrams}
\DeclareSymbolFont{bbold}{U}{bbold}{m}{n}
\DeclareSymbolFontAlphabet{\mathbbold}{bbold}
\newtheorem{mydef}{Definition}[section]
\newtheorem{obs}{Observe}[section]
\newtheorem{ex}{Example}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{exe}{Exercises}[section]
\newcommand{\lift}[2]{%
\setlength{\unitlength}{1pt}
\begin{picture}(0,0)(0,0)
\put(0,{#1}){\makebox(0,0)[b]{${#2}$}}
\end{picture}
}
\newcommand{\lowerarrow}[1]{%
\setlength{\unitlength}{0.03\DiagramCellWidth}
\begin{picture}(0,0)(0,0)
\qbezier(-28,-4)(0,-18)(28,-4)
\put(0,-14){\makebox(0,0)[t]{$\scriptstyle {#1}$}}
\put(28.6,-3.7){\vector(2,1){0}}
\end{picture}
}
\newcommand{\upperarrow}[1]{%
\setlength{\unitlength}{0.03\DiagramCellWidth}
\begin{picture}(0,0)(0,0)
\qbezier(-28,11)(0,25)(28,11)
\put(0,21){\makebox(0,0)[b]{$\scriptstyle {#1}$}}
\put(28.6,10.7){\vector(2,-1){0}}
\end{picture}
}
\newenvironment{note}{\paragraph{NOTE:}}{}
\newenvironment{field}{\paragraph{field:}}{}
\begin{document}
\begin{note}
\begin{field}
\textbf{Slice categories}
\end{field}
\begin{field}
\begin{enumerate}[i]
\item $c/C$, called \textbf{C under c}, is the category whose objects are morphisms $f \colon c \rightarrow x$ with domain $c$ and in which a morphism from $f \colon c \rightarrow x$ to $g \colon c \rightarrow y$ is a map $h \colon x \rightarrow y$ between the codomains so that the triangle:
\begin{diagram} \label{DiagramCunderc}
& & c & & \\
& \ldTo^f & & \rdTo^g & \\
x & & \rTo^h & & y
\end{diagram}
\textbf{commutes}, i.e., so that g = h f .
\item $C/c$, called \textbf{C over c}, is the category whose objects are morphisms $f \colon x \rightarrow c$ with codomain $c$ and in which a morphism from $f \colon x \rightarrow c$ to $g \colon y \rightarrow c$ is a map $h \colon x \rightarrow y$ between the domains so that the triangle:
\begin{diagram} \label{DiagramCoverc}
x & & \rTo^h & & y \\
& \rdTo_f & & \ldTo_g & \\
& & c & &
\end{diagram}
\textbf{commutes}, i.e. so that $f = g h$.
\end{enumerate}
\end{field}
\begin{field}
Category
\end{field}
\end{note}
\end{document}
它看起来应该是这样的(这是生成的 PDF 文件的屏幕截图 - 它看起来与我生成的 DVI 完全相同):
但最终结果是这样的:
答案1
以下是如何使用 获取这些图表的方法pstricks
(如果有用的话):
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{enumerate}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{float}
\usepackage{pst-node, auto-pst-pdf}
\usepackage[bbgreekl]{mathbbold}
\DeclareSymbolFont{bbold}{U}{bbold}{m}{n}
\DeclareSymbolFontAlphabet{\mathbbold}{bbold}
\newtheorem{mydef}{Definition}[section]
\newtheorem{obs}{Observe}[section]
\newtheorem{ex}{Example}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{exe}{Exercises}[section]
\newenvironment{note}{\paragraph{NOTE:}}{}
\newenvironment{field}{\paragraph{field:}}{}
\begin{document}
\begin{note}
\begin{field}
\textbf{Slice categories}
\end{field}
\begin{field}
\begin{enumerate}[i]
\item $c/C$, called \textbf{C under c}, is the category whose objects are morphisms $f \colon c \rightarrow x$ with domain $c$ and in which a morphism from $f \colon c \rightarrow x$ to $g \colon c \rightarrow y$ is a map $h \colon x \rightarrow y$ between the codomains so that the triangle:
\begin{postscript} \[
\psset{arrows=->, arrowinset=0.12, nodesepA=3pt, nodesepB=2pt, labelsep=2pt, shortput=nab, linejoin=1}
\everypsbox{\scriptstyle}
\begin{psmatrix}
& [name=c] c \\
[name=x] x & & [name=y] y
\ncline{x}{y}^{h}
\ncline{c}{x}\nbput[nrot=:D]{f}
\ncline{c}{y}\naput[nrot=:U]{g}
\end{psmatrix}
\] \end{postscript}
\textbf{commutes}, i.e., so that $ g = h f $.
\item $C/c$, called \textbf{C over c}, is the category whose objects are morphisms $f \colon x \rightarrow c$ with codomain $c$ and in which a morphism from $f \colon x \rightarrow c$ to $g \colon y \rightarrow c$ is a map $h \colon x \rightarrow y$ between the domains so that the triangle:
\begin{postscript} \[
\psset{arrows=->, arrowinset=0.12, nodesepA=3pt, nodesepB=2pt, labelsep=3pt, shortput=nab}
\everypsbox{\scriptstyle}
\begin{psmatrix}
[name=x] x & & [name=y] y \\
& [name=c] c
\ncline{x}{y}^{h}
\ncline{x}{c}\nbput[nrot=:U]{f}
\ncline{y}{c}\naput[nrot=:D]{g}
\end{psmatrix}
\] \end{postscript}
\textbf{commutes}, i.e. so that $f = g h$.
\end{enumerate}
\end{field}
\begin{field}
Category
\end{field}
\end{note}
\end{document}