Skip to content

Commit

Permalink
minor change in target structure
Browse files Browse the repository at this point in the history
Former-commit-id: 9903869
  • Loading branch information
RalXYZ committed Aug 25, 2021
1 parent 9f35292 commit 070e89d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![cover](./Supplemental/cover.png)
# Typora伪装LaTeX中文样式主题

[预览](#预览) | [安装与使用](#安装与使用) | [下载与版本日志](releases) | [个性化设置](#个性化设置) | [面向高级用户](#面向高级用户) | [常见问题](常见问题) | [已知 bug](#已知-bug)
[预览](#预览) | [安装与使用](#安装与使用) | [下载](https://github.com/Keldos-Li/typora-latex-theme/releases) | [个性化设置](#个性化设置) | [面向高级用户](#面向高级用户) | [常见问题](常见问题) | [已知 bug](#已知-bug)

本项目的初衷是为了简化中国大陆本科生**小型通识课论文**(或**小型实验报告**)撰写的负担。这里基本采用了浙江大学要求的格式(字体较小,页边距较小),但大部分同学都可以自行在 CSS 中修改适合自己学校的格式。

Expand Down Expand Up @@ -92,13 +92,13 @@ $$

1. 安装本主题前,**请确保您已经安装 Typora**. 如果您不清楚 Typora 是什么,这里有[一段介绍](#什么是-typora)。如果您对 markdown 的语法还不了解,您可以从这里[获得帮助](#什么是-markdown)

2. 前往本项目的 [release](release) 页面,然后下载最新版本的 `latex-theme.zip`.
2. 前往本项目的 [release](https://github.com/Keldos-Li/typora-latex-theme/releases) 页面,然后下载适合您操作系统的最新版本压缩包。比如,如果您在使用 Windows 操作系统,您就应该下载 `latex-theme-windows.zip`.

3. 解压缩这个文件,并进入解压缩后的文件夹。在这个文件夹里,请运行符合您操作系统的脚本文件:

- 如果您正在使用 Windows 操作系统,请运行 `install.ps1` 文件。具体的运行方式是:右键点击 `install.ps1` 文件,然后点击“使用 PowerShell 运行”。
- 如果您正在使用 macOS ,请运行 `install.sh` 文件。具体的运行方式是:打开*终端*,将 `install.sh` 文件拖入终端窗口中。如果您不知道如何打开终端,这里有[一份介绍](#macos-如何打开终端)
- 本主题目前没有对 Linux 的完善支持。如果您在使用 Linux ,且愿意体验本主题,您也可以通过运行 `install.sh` 的方式进行安装。
- 本主题目前没有对 Linux 的完善支持。如果您在使用 Linux ,且愿意体验本主题,您也可以通过先下载 `latex-theme-macos.zip`,再运行 `install.sh` 的方式进行安装。

5. 如果您是要更新这个主题,以上的过程仍然有效;**新的主题文件会自动覆盖旧的主题文件**

Expand Down Expand Up @@ -131,7 +131,7 @@ $$
```

进行个性化设置有两种方案:
1. 您可以直接在您下载的安装包中进行修改。比如,如果您目前在使用 Windows 操作系统,且您想修改亮色主题的主题文件,那您就应该打开 `Windows/latex.css`**在完成修改后,请重新执行与您操作系统相匹配的脚本(`install.ps1``install.sh`),并重新启动 Typora,以应用您的更改**
1. 您可以直接在您下载的安装包中进行修改。**在完成修改后,请重新执行与您操作系统相匹配的脚本(`install.ps1``install.sh`),并重新启动 Typora,以应用您的更改**
2. (面向高级用户)您也可以直接更改 Typora 主题文件夹下的文件,[点击此处了解主题文件夹所在的位置](#主题文件夹)。进入这个文件夹后,与本主题相关的两个文件分别是 `latex.css``latex-dark.css`,请您按需修改。**在完成修改后,请重新启动 Typora,以应用您的更改**

如果您在打开 CSS 文件时遇到了困难,请考虑使用 *记事本*(Windows)或*文本编辑*(macOS)打开它。**绝对不要用 Microsoft Word 打开它!!!就算它可以!**
Expand Down
3 changes: 1 addition & 2 deletions src/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Add-Type -AssemblyName PresentationFramework

$dir="$env:APPDATA\Typora\themes"
$os="Windows"

Write-Output "正在寻找 Typora 主题文件夹 $dir"
If (Test-Path -Path $dir -PathType Container) {
Expand All @@ -19,7 +18,7 @@ If (Test-Path -Path $dir -PathType Container) {
}

Try {
Copy-Item -Path "$os\*" -Destination $dir -Recurse -Force -ErrorAction Stop
Copy-Item -Path ".\*.css" -Destination $dir -Recurse -Force -ErrorAction Stop
} Catch {
$MessageBody = $_.Exception.Message
$ButtonType = [System.Windows.MessageBoxButton]::OK
Expand Down
4 changes: 1 addition & 3 deletions src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ base_dir=`dirname $0`
if [ `uname` = "Linux" ]
then
dir="$HOME/.config/Typora/themes"
os="$base_dir/Linux"
elif [ `uname` = "Darwin" ]
then
dir="$HOME/Library/Application Support/abnerworks.Typora/themes"
os="$base_dir/macOS"
else
echo "暂不支持当前操作系统 `uname`"
exit 1
Expand All @@ -25,7 +23,7 @@ else
exit 2
fi

cp -f $os/* "$dir"
cp -f $base_dir/*.css "$dir"
if [ $? -eq 0 ]
then
echo "安装成功"
Expand Down
13 changes: 8 additions & 5 deletions src/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

target_dir="./latex-theme"
working_dir="./build"
windows="Windows"
macos="macOS"
linux="Linux"
windows="windows"
macos="macos"
linux="linux"

if [ -d $target_dir ]; then
rm -r $target_dir
Expand Down Expand Up @@ -50,7 +50,10 @@ scss --sourcemap=none $working_dir/macos-dark.scss $target_dir/$linux/latex-dark

########################################################################

cp ./install.sh $target_dir
cp ./install.ps1 $target_dir
cp ./install.sh $target_dir/$macos
cp ./install.ps1 $target_dir/$windows

zip -rj $target_dir/latex-theme-$macos.zip $target_dir/$macos/*
zip -rj $target_dir/latex-theme-$windows.zip $target_dir/$windows/*

rm -r $working_dir

0 comments on commit 070e89d

Please sign in to comment.