1 package org.jetbrains.plugins.ipnb.editor.panels.code;
3 import com.intellij.openapi.ui.VerticalFlowLayout;
4 import com.intellij.openapi.util.text.StringUtil;
5 import org.jetbrains.annotations.NotNull;
6 import org.jetbrains.annotations.Nullable;
7 import org.jetbrains.plugins.ipnb.IpnbUtils;
8 import org.jetbrains.plugins.ipnb.editor.IpnbEditorUtil;
9 import org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel;
10 import org.jetbrains.plugins.ipnb.format.cells.output.IpnbLatexOutputCell;
14 public class IpnbLatexPanel extends IpnbCodeOutputPanel<IpnbLatexOutputCell> {
16 public IpnbLatexPanel(@NotNull final IpnbLatexOutputCell cell, @NotNull final IpnbFilePanel parent,
17 @Nullable IpnbCodePanel ipnbCodePanel) {
18 super(cell, parent, ipnbCodePanel);
19 setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP));
20 setBackground(IpnbEditorUtil.getBackground());
24 protected JComponent createViewPanel() {
25 final int width = myParent.getWidth();
26 return IpnbUtils.createLatexPane(StringUtil.join(myCell.getLatex(), ""), width);