Skip to content

Commit 1ae6310

Browse files
committed
next/latex: start working on the latex landing page ...
1 parent 32c4a51 commit 1ae6310

File tree

13 files changed

+58
-18
lines changed

13 files changed

+58
-18
lines changed

src/packages/frontend/account/dark-mode.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import { AccountStore } from "./store";
1010

1111
export const DARK_MODE_KEYS = ["brightness", "contrast", "sepia"] as const;
1212

13-
// Icon unicode character for dark mode toggle (◑ - circle with right half black)
14-
export const DARK_MODE_ICON = 0x25d1;
15-
1613
type Config = Record<(typeof DARK_MODE_KEYS)[number], number>;
1714

1815
export const DARK_MODE_MINS: Config = {

src/packages/frontend/account/other-settings.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
*/
55

66
import { Button, Card, Slider } from "antd";
7-
import { debounce } from "lodash";
87
import { Map } from "immutable";
8+
import { debounce } from "lodash";
99
import { useMemo } from "react";
10-
import { defineMessages, FormattedMessage, useIntl } from "react-intl";
10+
import { FormattedMessage, defineMessages, useIntl } from "react-intl";
1111

1212
import { Checkbox, Panel } from "@cocalc/frontend/antd-bootstrap";
1313
import { Rendered, redux, useTypedRedux } from "@cocalc/frontend/app-framework";
@@ -41,15 +41,15 @@ import {
4141
import { NewFilenameFamilies } from "@cocalc/frontend/project/utils";
4242
import track from "@cocalc/frontend/user-tracking";
4343
import { webapp_client } from "@cocalc/frontend/webapp-client";
44+
import { DARK_MODE_ICON } from "@cocalc/util/consts/ui";
4445
import { DEFAULT_NEW_FILENAMES, NEW_FILENAMES } from "@cocalc/util/db-schema";
46+
import { DARK_MODE_DEFAULTS } from "@cocalc/util/db-schema/accounts";
4547
import { OTHER_SETTINGS_REPLY_ENGLISH_KEY } from "@cocalc/util/i18n/const";
4648
import {
47-
DARK_MODE_ICON,
4849
DARK_MODE_KEYS,
4950
DARK_MODE_MINS,
5051
get_dark_mode_config,
5152
} from "./dark-mode";
52-
import { DARK_MODE_DEFAULTS } from "@cocalc/util/db-schema/accounts";
5353
import { I18NSelector, I18N_MESSAGE, I18N_TITLE } from "./i18n-selector";
5454
import Messages from "./messages";
5555
import Tours from "./tours";

src/packages/frontend/frame-editors/frame-tree/commands/generic-commands.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { debounce } from "lodash";
1010
import { useEffect, useRef } from "react";
1111
import { defineMessage, IntlShape, useIntl } from "react-intl";
1212

13-
import { DARK_MODE_ICON } from "@cocalc/frontend/account/dark-mode";
1413
import { set_account_table } from "@cocalc/frontend/account/util";
1514
import { redux } from "@cocalc/frontend/app-framework";
1615
import { Icon } from "@cocalc/frontend/components";
@@ -30,6 +29,7 @@ import { isSupportedExtension } from "@cocalc/frontend/project/page/home-page/ai
3029
import { AI_GENERATE_DOC_TAG } from "@cocalc/frontend/project/page/home-page/ai-generate-utils";
3130
import openSupportTab from "@cocalc/frontend/support/open";
3231
import userTracking from "@cocalc/frontend/user-tracking";
32+
import { DARK_MODE_ICON } from "@cocalc/util/consts/ui";
3333
import { filename_extension } from "@cocalc/util/misc";
3434
import { addCommands } from "./commands";
3535
import { SEARCH_COMMANDS } from "./const";

src/packages/frontend/frame-editors/latex-editor/output-control-build.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ import type { MenuProps } from "antd";
1212
import { Dropdown } from "antd";
1313
import { useIntl } from "react-intl";
1414

15-
import { Button as BSButton } from "@cocalc/frontend/antd-bootstrap";
16-
import { DARK_MODE_ICON } from "@cocalc/frontend/account/dark-mode";
1715
import { set_account_table } from "@cocalc/frontend/account/util";
16+
import { Button as BSButton } from "@cocalc/frontend/antd-bootstrap";
1817
import { useRedux, useTypedRedux } from "@cocalc/frontend/app-framework";
1918
import { Icon } from "@cocalc/frontend/components";
2019
import { COMMANDS } from "@cocalc/frontend/frame-editors/frame-tree/commands";
@@ -24,6 +23,7 @@ import {
2423
BUILD_ON_SAVE_LABEL,
2524
} from "@cocalc/frontend/frame-editors/frame-tree/commands/generic-commands";
2625
import { editor, IntlMessage } from "@cocalc/frontend/i18n";
26+
import { DARK_MODE_ICON } from "@cocalc/util/consts/ui";
2727

2828
import { Actions } from "./actions";
2929

src/packages/next/components/landing/info.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface Props {
2323
belowWide?: boolean;
2424
caption?: ReactNode;
2525
children: ReactNode;
26-
icon?: IconName;
26+
icon?: IconName | JSX.Element;
2727
image?: string | StaticImageData;
2828
imageComponent?: ReactNode; // if set, this replaces the image!
2929
level?: TitleProps["level"];
@@ -130,9 +130,9 @@ export default function Info({
130130
...textStyle,
131131
}}
132132
>
133-
{icon && (
133+
{icon != null && (
134134
<span style={{ fontSize: "24pt", marginRight: "5px" }}>
135-
<Icon name={icon} />{" "}
135+
{typeof icon === "string" ? <Icon name={icon} /> : icon}{" "}
136136
</span>
137137
)}
138138
{title}

src/packages/next/pages/features/latex-editor.tsx

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import { Descriptions, Layout } from "antd";
77

88
import { Icon } from "@cocalc/frontend/components/icon";
9+
import { DARK_MODE_ICON } from "@cocalc/util/consts/ui";
10+
911
import Backups from "components/landing/backups";
1012
import Code from "components/landing/code";
1113
import Collaboration from "components/landing/collaboration";
@@ -21,18 +23,22 @@ import Publishing from "components/landing/publishing";
2123
import SignIn from "components/landing/sign-in";
2224
import { Paragraph, Text, Title } from "components/misc";
2325
import A from "components/misc/A";
26+
2427
import { Customize } from "lib/customize";
2528
import withCustomize from "lib/with-customize";
26-
import LatexCollab from "public/features/cocalc-latex-concurrent-editing.png";
27-
import LatexEditorImage from "public/features/cocalc-latex-editor-2019.png";
29+
30+
import LatexCollab from "public/features/latex-editor-realtime-sync-20251003.png";
2831
import Sidechat from "public/features/cocalc-latex-side-chat-v2.png";
2932
import Pythontex from "public/features/cocalc-pythontex.png";
3033
import Sagetex from "public/features/cocalc-sagetex.png";
3134
import AIFormula from "public/features/latex-ai-formula.png";
3235
import CustomCommand from "public/features/latex-custom-command-02.png";
36+
import LatexDarkMode from "public/features/latex-editor-darkmode-20251003.png";
37+
import LatexEditorImage from "public/features/latex-editor-main-20251003.png";
3338
import Knitr from "public/features/latex-editor-rnw-01.png";
3439
import LatexTimetravel from "public/features/latex-editor-timetravel-01.png";
3540
import Logo from "public/features/latex-logo.svg";
41+
import LatexPythontex from "public/features/latex-editor-pythontex-20251003.png";
3642

3743
export default function LatexEditor({ customize }) {
3844
return (
@@ -49,11 +55,11 @@ export default function LatexEditor({ customize }) {
4955
subtitle={
5056
<>
5157
Focus on writing LaTeX. CoCalc takes care of everything else.
52-
<hr />
58+
{/*<hr />
5359
<A href="https://about.cocalc.com/2023/01/13/cocalcs-online-latex-editor/">
5460
Learn much more about LaTeX in CoCalc from this new blog
5561
post...
56-
</A>
62+
</A> */}
5763
</>
5864
}
5965
image={LatexEditorImage}
@@ -218,7 +224,7 @@ export default function LatexEditor({ customize }) {
218224
anchor="a-computational"
219225
icon="laptop"
220226
title="Full computational environment"
221-
image={LatexEditorImage}
227+
image={LatexPythontex}
222228
alt="Two browser windows editing the same LaTeX file"
223229
wide
224230
>
@@ -481,6 +487,40 @@ export default function LatexEditor({ customize }) {
481487
</Paragraph>
482488
</Info>
483489

490+
<Info
491+
anchor="a-darkmode"
492+
icon={
493+
<Icon style={{ fontSize: "40px" }} unicode={DARK_MODE_ICON} />
494+
}
495+
title={"Dark Mode with PDF Support"}
496+
image={LatexDarkMode}
497+
>
498+
<Paragraph>
499+
If you like working in{" "}
500+
<span
501+
style={{
502+
background: "black",
503+
color: "white",
504+
padding: "2px 5px",
505+
}}
506+
>
507+
Dark Mode
508+
</span>
509+
, feel welcome to CoCalc as well!
510+
</Paragraph>
511+
<Paragraph>
512+
{" "}
513+
The <LaTeX /> editor not only supports the usual dark mode
514+
funcionality, but also styling the PDF. This means despite that
515+
your resulting PDF will be on a white page, you see it with a dark
516+
page and bright font characters.{" "}
517+
</Paragraph>
518+
<Paragraph>
519+
There is also a button to quickly disable the PDF dark mode, to
520+
double check the actual output.
521+
</Paragraph>
522+
</Info>
523+
484524
<Info
485525
anchor="a-timetravel"
486526
title="TimeTravel"
-268 KB
Binary file not shown.
-275 KB
Binary file not shown.
519 KB
Loading
458 KB
Loading

0 commit comments

Comments
 (0)